From d3ab2310110e3365a3e90167c6839ee0c17bd835 Mon Sep 17 00:00:00 2001 From: Ahmad Sajid Date: Mon, 20 Apr 2020 09:32:51 +0600 Subject: [PATCH 001/243] Updated put-method-response and put-integration-response aws apigateway put-method-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-models application/json=Empty and aws apigateway put-integration-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-templates application/json="" were generating "Error parsing parameter '--response-templates': Expected: '=', received: '/' for input:" this edit will fix this issue, so new comers wont face problem while following the tuts --- doc_source/services-apigateway-tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 543ac971..86ac586a 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -325,7 +325,7 @@ Set `content-type` of the `POST` method response and integration response to JSO ``` $ aws apigateway put-method-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-models application/json=Empty + --status-code 200 --response-models "{\"application/json"\":""\"Empty"\"}""" { "statusCode": "200", "responseModels": { @@ -338,7 +338,7 @@ Set `content-type` of the `POST` method response and integration response to JSO ``` $ aws apigateway put-integration-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-templates application/json="" + --status-code 200 --response-templates "{\"application/json"\":""\"\"}"" { "statusCode": "200", "responseTemplates": { @@ -473,4 +473,4 @@ Or, you can use the following Curl command: ``` $ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` \ No newline at end of file +``` From e4cf6663678503600169064402672b48928d815d Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 12 May 2020 21:44:53 -0700 Subject: [PATCH 002/243] Update README.md --- sample-apps/s3-java/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index 407063bf..1ddcd98d 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -15,7 +15,7 @@ Use the following instructions to deploy the sample application. # Requirements - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) -- [Gradle 5](https://gradle.org/releases/) +- [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). From c87438f5c3bc977ea66e2d323cfa2fc948c76f5e Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Thu, 14 May 2020 17:18:05 -0700 Subject: [PATCH 003/243] mysql2, IAM auth --- sample-apps/rds-mysql/5-create-dbtable.sh | 2 +- sample-apps/rds-mysql/6-invoke.sh | 2 +- sample-apps/rds-mysql/README.md | 6 +++ sample-apps/rds-mysql/dbadmin/index-iam.js | 49 +++++++++++++++++++ sample-apps/rds-mysql/dbadmin/index.js | 2 +- sample-apps/rds-mysql/dbadmin/package.json | 12 ----- sample-apps/rds-mysql/lib/nodejs/package.json | 2 +- sample-apps/rds-mysql/template.yml | 32 ++++++++++-- 8 files changed, 88 insertions(+), 19 deletions(-) create mode 100644 sample-apps/rds-mysql/dbadmin/index-iam.js delete mode 100644 sample-apps/rds-mysql/dbadmin/package.json diff --git a/sample-apps/rds-mysql/5-create-dbtable.sh b/sample-apps/rds-mysql/5-create-dbtable.sh index 30f97776..7fd45a93 100755 --- a/sample-apps/rds-mysql/5-create-dbtable.sh +++ b/sample-apps/rds-mysql/5-create-dbtable.sh @@ -1,4 +1,4 @@ #!/bin/bash set -eo pipefail -FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id dbadmin --query 'StackResourceDetail.PhysicalResourceId' --output text) +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) aws lambda invoke --function-name $FUNCTION --payload file://events/db-create-table.json out.json diff --git a/sample-apps/rds-mysql/6-invoke.sh b/sample-apps/rds-mysql/6-invoke.sh index 73a0b68a..6de0eda1 100755 --- a/sample-apps/rds-mysql/6-invoke.sh +++ b/sample-apps/rds-mysql/6-invoke.sh @@ -1,6 +1,6 @@ #!/bin/bash set -eo pipefail -FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id dbadmin --query 'StackResourceDetail.PhysicalResourceId' --output text) +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do aws lambda invoke --function-name $FUNCTION --payload file://events/db-read-table.json out.json diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index b6d413c4..0a69d3a1 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -110,6 +110,12 @@ Finally, view the application in the Lambda console. ![Application](/sample-apps/rds-mysql/images/rdsmysql-application.png) +# Use IAM authorization with a database proxy + +This application includes a second handler that uses the function's credentials to authenticate ([index-iam.js](/sample-apps/rds-mysql/dbadmin/index-iam.js)). You can use this method to connect to an RDS Proxy without configuring the function with a database password. + +For more information, see [Configuring database access](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html) in the AWS Lambda Developer Guide. + # Cleanup To delete the application, run the cleanup script. diff --git a/sample-apps/rds-mysql/dbadmin/index-iam.js b/sample-apps/rds-mysql/dbadmin/index-iam.js new file mode 100644 index 00000000..05074858 --- /dev/null +++ b/sample-apps/rds-mysql/dbadmin/index-iam.js @@ -0,0 +1,49 @@ +const AWSXRay = require('aws-xray-sdk-core') +const captureMySQL = require('aws-xray-sdk-mysql') +const mysql = captureMySQL(require('mysql2')) +const AWS = require('aws-sdk') +const username = process.env.databaseUser +const host = process.env.databaseHost +const database = process.env.databaseName +const region = process.env.AWS_REGION +const sqlport = 3306 + +const signer = new AWS.RDS.Signer({ + region: region, + hostname: host, + port: sqlport, + username: username +}) + +exports.handler = async (event) => { + let connectionConfig = { + host : host, + user : username, + database : database, + ssl: 'Amazon RDS', + authPlugins: { mysql_clear_password: () => () => signer.getAuthToken() } + } + var connection = mysql.createConnection(connectionConfig) + var query = event.query + var result + connection.connect() + + connection.query(query, function (error, results, fields) { + if (error) throw error + console.log("Ran query: " + query) + for (result in results) + console.log(results[result]) + }) + + return new Promise( ( resolve, reject ) => { + connection.end( err => { + if ( err ) + return reject( err ) + const response = { + statusCode: 200, + body: JSON.stringify(result), + } + resolve(response) + }) + }) +} diff --git a/sample-apps/rds-mysql/dbadmin/index.js b/sample-apps/rds-mysql/dbadmin/index.js index b0309956..c7767f5a 100644 --- a/sample-apps/rds-mysql/dbadmin/index.js +++ b/sample-apps/rds-mysql/dbadmin/index.js @@ -1,6 +1,6 @@ var AWSXRay = require('aws-xray-sdk-core') var captureMySQL = require('aws-xray-sdk-mysql') -var mysql = captureMySQL(require('mysql')) +var mysql = captureMySQL(require('mysql2')) const username = process.env.databaseUser const password = process.env.databasePassword const host = process.env.databaseHost diff --git a/sample-apps/rds-mysql/dbadmin/package.json b/sample-apps/rds-mysql/dbadmin/package.json deleted file mode 100644 index 774c74cf..00000000 --- a/sample-apps/rds-mysql/dbadmin/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "list-manager-processor", - "version": "1.0.0", - "private": true, - "dependencies": {}, - "devDependencies": { - "aws-xray-sdk-core": "2.4.0", - "aws-xray-sdk-mysql": "2.4.0", - "mysql": "2.17.1" - }, - "scripts": {} -} diff --git a/sample-apps/rds-mysql/lib/nodejs/package.json b/sample-apps/rds-mysql/lib/nodejs/package.json index f5859d75..9e8e82c9 100644 --- a/sample-apps/rds-mysql/lib/nodejs/package.json +++ b/sample-apps/rds-mysql/lib/nodejs/package.json @@ -6,7 +6,7 @@ "aws-xray-sdk-core": "2.4.0", "aws-xray-sdk-mysql": "2.4.0", "md5": "2.2.1", - "mysql": "2.17.1" + "mysql2": "2.1.0" }, "scripts": {} } diff --git a/sample-apps/rds-mysql/template.yml b/sample-apps/rds-mysql/template.yml index a81c1f4a..35151b77 100644 --- a/sample-apps/rds-mysql/template.yml +++ b/sample-apps/rds-mysql/template.yml @@ -48,7 +48,7 @@ Resources: CompatibleRuntimes: - nodejs10.x - nodejs12.x - dbadmin: + function: Type: AWS::Serverless::Function Properties: CodeUri: dbadmin/. @@ -56,6 +56,32 @@ Resources: MemorySize: 128 Timeout: 15 # Function's execution role + Role: !GetAtt role.Arn + role: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: "2012-10-17" + Statement: + - + Effect: Allow + Principal: + Service: + - lambda.amazonaws.com + Action: + - sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess + - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + - arn:aws:iam::aws:policy/service-role/AWSLambdaRole + - arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole Policies: - - AWSLambdaBasicExecutionRole - - AWSLambdaVPCAccessExecutionRole + - PolicyName: rds-iamauth + PolicyDocument: + Version: 2012-10-17 + Statement: + - Effect: Allow + Action: 'rds-db:connect' + Resource: '*' + Path: /service-role/ + From c44b64e0f4c1466724d7d38071c6a797ee995c03 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Fri, 15 May 2020 11:59:39 -0700 Subject: [PATCH 004/243] cleanup --- sample-apps/rds-mysql/template.yml | 54 ++++++++++++++---------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/sample-apps/rds-mysql/template.yml b/sample-apps/rds-mysql/template.yml index 35151b77..d77f7550 100644 --- a/sample-apps/rds-mysql/template.yml +++ b/sample-apps/rds-mysql/template.yml @@ -10,34 +10,6 @@ Parameters: Default: rds-mysql-admin Description: Database password secret name Type: String -Globals: - Function: - Runtime: nodejs12.x - Tracing: Active - Handler: index.handler - Environment: - Variables: - databaseHost: - Fn::ImportValue: - !Sub "${vpcStackName}-db-host" - databaseName: - Fn::ImportValue: - !Sub "${vpcStackName}-db-name" - databaseUser: - Fn::ImportValue: - !Sub "${vpcStackName}-db-user" - databasePassword: !Sub '{{resolve:secretsmanager:${secretName}:SecretString:password}}' - VpcConfig: - SecurityGroupIds: - - Fn::ImportValue: - !Sub "${vpcStackName}-vpc-sg" - SubnetIds: - - Fn::ImportValue: - !Sub "${vpcStackName}-subnet-a" - - Fn::ImportValue: - !Sub "${vpcStackName}-subnet-b" - Layers: - - !Ref libs Resources: libs: Type: AWS::Serverless::LayerVersion @@ -55,8 +27,34 @@ Resources: Description: Run SQL queries. MemorySize: 128 Timeout: 15 + Runtime: nodejs12.x + Tracing: Active + Handler: index.handler + Environment: + Variables: + databaseHost: + Fn::ImportValue: + !Sub "${vpcStackName}-db-host" + databaseName: + Fn::ImportValue: + !Sub "${vpcStackName}-db-name" + databaseUser: + Fn::ImportValue: + !Sub "${vpcStackName}-db-user" + databasePassword: !Sub '{{resolve:secretsmanager:${secretName}:SecretString:password}}' + VpcConfig: + SecurityGroupIds: + - Fn::ImportValue: + !Sub "${vpcStackName}-vpc-sg" + SubnetIds: + - Fn::ImportValue: + !Sub "${vpcStackName}-subnet-a" + - Fn::ImportValue: + !Sub "${vpcStackName}-subnet-b" # Function's execution role Role: !GetAtt role.Arn + Layers: + - !Ref libs role: Type: AWS::IAM::Role Properties: From 532d4acad1e7b796a524636015799bce34c4165c Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Fri, 15 May 2020 12:27:13 -0700 Subject: [PATCH 005/243] readme --- sample-apps/rds-mysql/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index 0a69d3a1..f0b73fc8 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -114,6 +114,16 @@ Finally, view the application in the Lambda console. This application includes a second handler that uses the function's credentials to authenticate ([index-iam.js](/sample-apps/rds-mysql/dbadmin/index-iam.js)). You can use this method to connect to an RDS Proxy without configuring the function with a database password. +To use handler with IAM authentication, change the `databaseHost` environment variable in `template.yml` to the hostname of an RDS Proxy, and change the handler setting to `index-iam.handler`. + + Tracing: Active + Handler: index-iam.handler + Environment: + Variables: + databaseHost: rds-mysql-proxy.proxy-cxarxmpluqha.us-east-2.rds.amazonaws.com + #Fn::ImportValue: + # !Sub "${vpcStackName}-db-host" + For more information, see [Configuring database access](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html) in the AWS Lambda Developer Guide. # Cleanup From 4ed178911c60c60069edab7359e0f57062c751d4 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Fri, 22 May 2020 17:30:11 -0700 Subject: [PATCH 006/243] update Java libraries --- sample-apps/blank-java/build.gradle | 6 +++--- sample-apps/blank-java/pom.xml | 6 +++--- sample-apps/java-basic/build.gradle | 2 +- sample-apps/java-basic/pom.xml | 2 +- sample-apps/java-events-v1sdk/build.gradle | 6 +++--- sample-apps/java-events-v1sdk/pom.xml | 6 +++--- sample-apps/java-events/build.gradle | 4 ++-- sample-apps/java-events/pom.xml | 4 ++-- sample-apps/s3-java/build.gradle | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 4ef9ff7b..710d433f 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -14,13 +14,13 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index f339eeb2..b5c9d487 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -15,17 +15,17 @@ com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.amazonaws aws-lambda-java-events - 2.2.7 + 2.2.9 com.amazonaws aws-lambda-java-log4j2 - 1.1.0 + 1.2.0 com.google.code.gson diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 1f976009..d32fc80a 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -7,7 +7,7 @@ repositories { } dependencies { - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 90cdc064..83b6cd05 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -15,7 +15,7 @@ com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.google.code.gson diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 9a0f649e..bcbb32f5 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -8,8 +8,8 @@ repositories { dependencies { implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.amazonaws:aws-java-sdk-s3:1.11.578' implementation 'com.amazonaws:aws-java-sdk-kinesis:1.11.578' implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.578' @@ -20,7 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index a412ae11..ded5248b 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -15,17 +15,17 @@ com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.amazonaws aws-lambda-java-events - 2.2.7 + 2.2.9 com.amazonaws aws-lambda-java-log4j2 - 1.1.0 + 1.2.0 com.google.code.gson diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index ae45cb3a..a22a9885 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -7,8 +7,8 @@ repositories { } dependencies { - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 5a0714ab..22df1f42 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -15,12 +15,12 @@ com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.amazonaws aws-lambda-java-events - 2.2.7 + 2.2.9 com.google.code.gson diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 2ab2d35a..425f06e1 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -8,8 +8,8 @@ repositories { dependencies { implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.amazonaws:aws-java-sdk-s3:1.11.578' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' @@ -18,7 +18,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } From 7a861cac2fc0b8f81bf6081967bb1da19ad43837 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Wed, 27 May 2020 11:56:58 -0700 Subject: [PATCH 007/243] cleanup --- sample-apps/rds-mysql/bin/get-stack-event.sh | 1 - sample-apps/rds-mysql/bin/get-stack-status.sh | 1 - 2 files changed, 2 deletions(-) delete mode 100644 sample-apps/rds-mysql/bin/get-stack-event.sh delete mode 100644 sample-apps/rds-mysql/bin/get-stack-status.sh diff --git a/sample-apps/rds-mysql/bin/get-stack-event.sh b/sample-apps/rds-mysql/bin/get-stack-event.sh deleted file mode 100644 index 57e468b7..00000000 --- a/sample-apps/rds-mysql/bin/get-stack-event.sh +++ /dev/null @@ -1 +0,0 @@ -aws cloudformation describe-stack-events --stack-name list-manager --max-items 1 --query 'StackEvents[0]' diff --git a/sample-apps/rds-mysql/bin/get-stack-status.sh b/sample-apps/rds-mysql/bin/get-stack-status.sh deleted file mode 100644 index 1f8b2b5d..00000000 --- a/sample-apps/rds-mysql/bin/get-stack-status.sh +++ /dev/null @@ -1 +0,0 @@ -aws cloudformation describe-stacks --stack-name list-manager --query 'Stacks[*].StackStatus' --output text From a26285f009748b21ab629208cde38a2968f9c8e5 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 1 Jun 2020 20:00:54 +0000 Subject: [PATCH 008/243] Tracing, permissions, AWS CDK applications, .NET 3.1 --- doc_source/API_AliasRoutingConfiguration.md | 2 +- doc_source/API_CreateAlias.md | 2 +- doc_source/API_CreateFunction.md | 6 +- doc_source/API_FunctionConfiguration.md | 4 +- doc_source/API_GetFunctionConfiguration.md | 4 +- doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_Invoke.md | 2 +- doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 4 +- doc_source/API_PublishVersion.md | 4 +- .../API_PutFunctionEventInvokeConfig.md | 2 +- doc_source/API_UpdateAlias.md | 2 +- doc_source/API_UpdateFunctionCode.md | 4 +- doc_source/API_UpdateFunctionConfiguration.md | 6 +- doc_source/access-control-identity-based.md | 2 +- doc_source/applications-console.md | 2 +- doc_source/applications-tutorial.md | 46 ++++- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-console.md | 2 +- doc_source/configuration-database.md | 46 ++++- doc_source/configuration-envvars.md | 8 +- doc_source/configuration-layers.md | 69 ++++++- doc_source/csharp-logging.md | 2 +- doc_source/csharp-package-cli.md | 2 +- doc_source/csharp-package-toolkit.md | 4 +- doc_source/csharp-tracing.md | 126 +++++++++++++ doc_source/downstream-tracing.md | 11 -- doc_source/getting-started-create-function.md | 2 +- doc_source/gettingstarted-concepts.md | 11 +- doc_source/gettingstarted-features.md | 2 +- doc_source/golang-logging.md | 4 +- doc_source/golang-tracing.md | 126 +++++++------ doc_source/index.md | 17 +- doc_source/invocation-async.md | 2 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/java-context.md | 2 +- doc_source/java-exceptions.md | 2 +- doc_source/java-logging.md | 12 +- doc_source/java-package-eclipse.md | 2 +- doc_source/java-package.md | 22 +-- doc_source/java-samples.md | 2 +- doc_source/java-tracing.md | 33 +++- doc_source/lambda-api-permissions-ref.md | 4 +- doc_source/lambda-csharp.md | 3 +- doc_source/lambda-monitoring.md | 32 ++-- doc_source/lambda-permissions.md | 2 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-releases.md | 3 +- doc_source/lambda-ruby.md | 3 +- doc_source/lambda-runtimes.md | 8 +- doc_source/lambda-services.md | 2 +- doc_source/lambda-x-ray-daemon.md | 8 - doc_source/lambda-x-ray.md | 47 ----- .../monitoring-functions-access-metrics.md | 2 - doc_source/monitoring-metrics.md | 4 +- doc_source/nodejs-logging.md | 4 +- doc_source/nodejs-tracing.md | 157 ++++++++++++++-- doc_source/permissions-boundary.md | 2 +- doc_source/powershell-logging.md | 4 +- doc_source/python-logging.md | 4 +- doc_source/python-tracing.md | 177 +++++++++++++----- doc_source/ruby-logging.md | 4 +- doc_source/ruby-tracing.md | 155 +++++++++++++++ doc_source/runtime-support-policy.md | 15 ++ doc_source/runtimes-api.md | 8 +- doc_source/runtimes-custom.md | 4 +- doc_source/samples-blank.md | 6 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/services-alb.md | 2 +- doc_source/services-apigateway.md | 2 +- .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-ec2.md | 4 +- doc_source/services-iot.md | 2 +- doc_source/services-iotevents.md | 2 +- doc_source/services-s3-batch.md | 2 +- doc_source/services-xray.md | 112 +++++++++++ doc_source/using-x-ray.md | 40 ---- doc_source/with-cloudtrail.md | 3 +- doc_source/with-ddb-create-package.md | 2 +- doc_source/with-ddb.md | 3 + doc_source/with-kinesis.md | 5 +- doc_source/with-s3.md | 2 +- doc_source/with-sqs.md | 3 + 86 files changed, 1086 insertions(+), 387 deletions(-) create mode 100644 doc_source/csharp-tracing.md delete mode 100644 doc_source/downstream-tracing.md delete mode 100644 doc_source/lambda-x-ray-daemon.md delete mode 100644 doc_source/lambda-x-ray.md create mode 100644 doc_source/ruby-tracing.md create mode 100644 doc_source/services-xray.md delete mode 100644 doc_source/using-x-ray.md diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 9ff6423c..04330b69 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -5,7 +5,7 @@ The [traffic\-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traf ## Contents **AdditionalVersionWeights** -The name of the second alias, and the percentage of traffic that's routed to it\. +The second version, and the percentage of traffic that's routed to it\. Type: String to double map Key Length Constraints: Minimum length of 1\. Maximum length of 1024\. Key Pattern: `[0-9]+` diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 6c824d66..daad8f65 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -62,7 +62,7 @@ Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: Yes ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. +The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 7efa7b52..177d87b2 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -138,7 +138,7 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` Required: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** @@ -312,7 +312,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -329,7 +329,7 @@ Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index a903b503..fb5d59d6 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -109,7 +109,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` Required: No **State** @@ -130,7 +130,7 @@ Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRole Required: No **Timeout** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. Required: No diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 43063204..7257435d 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -184,7 +184,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -201,7 +201,7 @@ Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d0bad141..428ced78 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -56,7 +56,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 41216d31..660be980 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -53,7 +53,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index f79d091f..15cb019c 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -12,7 +12,7 @@ The status code in the API response doesn't reflect function errors\. Error code For functions with a long timeout, your client might be disconnected during synchronous invocation while it waits for a response\. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep\-alive settings\. -This operation requires permission for the `lambda:InvokeFunction` action\. +This operation requires permission for the [lambda:InvokeFunction](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) action\. ## Request Syntax diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 55c7c648..39ca87c0 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` Required: No **CreatedDate** diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index daa591ac..0863a3ec 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request requires the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 9c722148..1f8273a9 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request requires the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 906b7da0..8794617d 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -40,7 +40,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -95,7 +95,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 9b4d1580..7bb20cf7 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -204,7 +204,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -221,7 +221,7 @@ Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 964b288b..59c0bd25 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -1,6 +1,6 @@ # PutFunctionEventInvokeConfig -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [PutFunctionEventInvokeConfig](#API_PutFunctionEventInvokeConfig)\. +Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index cfc2d8ac..6e99eef6 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -63,7 +63,7 @@ Type: String Required: No ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. +The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 68fad8e8..8cfb015a 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -229,7 +229,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -246,7 +246,7 @@ Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index cd1526b2..b8e9a9d7 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -117,7 +117,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -286,7 +286,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -303,7 +303,7 @@ Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. +The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 9894cd0e..1aeba39a 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -172,7 +172,7 @@ When you configure triggers for your function, you need access to use the AWS se The following policy grants a user permission to create layers and use them with functions\. The resource patterns allow the user to work in any AWS Region and with any layer version, as long as the name of the layer starts with `test-`\. -**Example Layer development policy** +**Example layer development policy** ``` { diff --git a/doc_source/applications-console.md b/doc_source/applications-console.md index 00a0c14a..6d9fe420 100644 --- a/doc_source/applications-console.md +++ b/doc_source/applications-console.md @@ -29,7 +29,7 @@ By default, the Lambda console shows a basic dashboard\. You can customize this Customize your application monitoring page by adding one or more Amazon CloudWatch dashboards to your application template with the [AWS::CloudWatch::Dashboard](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dashboard.html) resource type\. The following example creates a dashboard with a single widget that graphs the number of invocations of a function named `my-function`\. -**Example Function dashboard template** +**Example function dashboard template** ``` Resources: diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index f029d9ce..61903688 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -46,7 +46,7 @@ This tutorial uses CodeCommit for source control\. To set up your local machine ## Create an application -Create an application in the Lambda console\. +Create an application in the Lambda console\. In Lambda, an application is an AWS CloudFormation stack with a Lambda function and any number of supporting resources\. In this tutorial, you create an application that has a function and its execution role\. **To create an application** @@ -68,9 +68,13 @@ Create an application in the Lambda console\. Lambda creates the pipeline and related resources and commits the sample application code to the Git repository\. As resources are created, they appear on the overview page\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-resources.png) + +The **Infrastructure** stack contains the repository, build project, and other resources that combine to form a continuous delivery pipeline\. When this stack finishes deploying, it in turn deploys the application stack that contains the function and execution role\. These are the application resources that appear under **Resources**\. + ## Invoke the function -Invoke the function to verify that it works\. +When the deployment process completes, invoke the function from the Lambda console\. **To invoke the application's function** @@ -83,7 +87,7 @@ Invoke the function to verify that it works\. 1. Choose **Test**\. 1. Configure a test event\. - + **Event name** – **test** + + **Event name** – **event** + **Body** – **\{\}** 1. Choose **Create**\. @@ -92,9 +96,11 @@ Invoke the function to verify that it works\. The Lambda console executes your function and displays the result\. Expand the **Details** section under the result to see the output and execution details\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-result.png) + ## Add an AWS resource -When you create your application, the Lambda console creates a Git repository that contains the sample application\. To get a copy of the application code on your local machine, clone the project repository\. +In the previous step, Lambda console created a Git repository that contains function code, a template, and a build specification\. You can add resources to your application by modifying the template and pushing changes to the repository\. To get a copy of the application on your local machine, clone the repository\. **To clone the project repository** @@ -106,13 +112,13 @@ When you create your application, the Lambda console creates a Git repository th 1. Under **Repository details**, copy the HTTP or SSH repository URI, depending on the authentication mode that you configured during [setup](#applications-tutorial-prepare)\. -1. Clone the repository\. +1. To clone the repository, use the `git clone` command\. ``` ~$ git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo ``` -The repository contains the template for the application, a build specification, and code\. Add a DynamoDB table to the application template\. +To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTable` resource in the template\. **To add a DynamoDB table** @@ -136,11 +142,12 @@ The repository contains the template for the application, a build specification, helloFromLambdaFunction: Type: AWS::Serverless::Function Properties: + CodeUri: ./ Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler Runtime: nodejs10.x MemorySize: 128 - Timeout: 100 - Description: This is a hello from Lambda example. + Timeout: 60 + Description: A Lambda function that returns a static string. Environment: Variables: DDB_TABLE: !Ref ddbTable @@ -159,6 +166,8 @@ The repository contains the template for the application, a build specification, When you push a change, it triggers the application's pipeline\. Use the **Deployments** tab of the application screen to track the change as it flows through the pipeline\. When the deployment is complete, proceed to the next step\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-deployment.png) + ## Update the permissions boundary The sample application applies a *permissions boundary* to its function's execution role\. The permissions boundary limits the permissions that you can add to the function's role\. Without the boundary, users with write access to the project repository could modify the project template to give the function permission to access resources and services outside of the scope of the sample application\. @@ -179,7 +188,7 @@ For more information about permissions boundaries, see [Using permissions bounda ## Update the function code -Next, update the function code to use the table\. The following code uses the table to track the number of invocations processed by each instance of the function\. It uses the log stream ID as a unique identifier\. New instances are created when you update a function, and to handle multiple concurrent invocations\. +Next, update the function code to use the table\. The following code uses the DynamoDB table to track the number of invocations processed by each instance of the function\. It uses the log stream ID as a unique identifier for the function instance\. **To update the function code** @@ -222,6 +231,7 @@ Next, update the function code to use the table\. The following code uses the ta helloFromLambdaFunction: Type: AWS::Serverless::Function Properties: + CodeUri: ./ Handler: src/handlers/index.handler Runtime: nodejs10.x ``` @@ -245,6 +255,10 @@ After the code change is deployed, invoke the function a few times to update the 1. Choose **Start search**\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-ddbtable.png) + +Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [AWS Lambda function scaling](invocation-scaling.md)\. + ## Next steps The AWS CloudFormation template that defines your application resources uses the AWS Serverless Application Model transform to simplify the syntax for resource definitions, and automate uploading the deployment package and other artifacts\. AWS SAM also provides a command line interface \(the AWS SAM CLI\), which has the same packaging and deployment functionality as the AWS CLI, with additional features specific to Lambda applications\. Use the AWS SAM CLI to test your application locally in a Docker container that emulates the Lambda execution environment\. @@ -314,4 +328,16 @@ You can continue to modify and use the sample to develop your own application\. 1. Delete the artifact bucket – **aws\-*us\-east\-2*\-*123456789012*\-my\-app\-pipe**\. -1. Return to the AWS CloudFormation console and delete the infrastructure stack – **serverlessrepo\-my\-app\-toolchain**\. \ No newline at end of file +1. Return to the AWS CloudFormation console and delete the infrastructure stack – **serverlessrepo\-my\-app\-toolchain**\. + +Function logs are not associated with the application or infrastructure stack in AWS CloudFormation\. Delete the log group separately in the CloudWatch Logs console\. + +**To delete the log group** + +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the Amazon CloudWatch console\. + +1. Choose the function's log group \(`/aws/lambda/my-app-helloFromLambdaFunction-YV1VXMPLK7QK`\)\. + +1. Choose **Actions**, and then choose **Delete log group**\. + +1. Choose **Yes, Delete**\. \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index a0a696df..2741577b 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -92,7 +92,7 @@ Provisioned concurrency does not come online immediately after you configure it\ + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -Your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](lambda-x-ray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +Your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index c4edb96b..0cae09bd 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -29,7 +29,7 @@ With the function node selected in the designer, you can modify the following se + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. + **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a VPC](configuration-vpc.md)\. + **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. -+ **Active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](lambda-x-ray.md)\. ++ **Active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. + **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index 2080ab30..f578c9e7 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -12,9 +12,9 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for 1. Configure the following options\. + **Proxy identifier** – The name of the proxy\. - + **RDS DB instance** – A MySQL 5\.6 or MySQL 5\.7 DB instance or cluster\. + + **RDS DB instance** – A [supported MySQL or PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html#rds-proxy.limitations) DB instance or cluster\. + **Secret** – A Secrets Manager secret with the database user name and password\. -**Example Secret** +**Example secret** ``` { @@ -23,13 +23,55 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for } ``` + **IAM role** – An IAM role with permission to use the secret, and a trust policy that allows Amazon RDS to assume the role\. + + **Authentication** – The authentication and authorization method for connecting to the proxy from your function code\. 1. Choose **Add**\. +**Pricing** +Amazon RDS charges a hourly price for proxies that that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. + Proxy creation takes a few minutes\. When the proxy is available, configure your function to connect to the proxy endpoint instead of the database endpoint\. Standard [Amazon RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/) applies\. For more information, see [Managing connections with the Amazon RDS Proxy](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html) in the Amazon Aurora User Guide\. +**Topics** ++ [Using the function's permissions for authentication](#configuration-database-auth) ++ [Sample application](#configuration-database-sample) + +## Using the function's permissions for authentication + +By default, you can connect to a proxy with the same username and password that it uses to connect to the database\. The only difference in your function code is the endpoint that the database client connects to\. The drawback of this method is that you must expose the password to your function code, either by configuring it in a secure environment variable or by retrieving it from Secrets Manager\. + +You can create a database proxy that uses the function's IAM credentials for authentication and authorization instead of a password\. To use the function's permissions to connect to the proxy, set **Authentication** to **Execution role**\. + +The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. + +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** + +``` +const signer = new AWS.RDS.Signer({ + region: region, + hostname: host, + port: sqlport, + username: username +}) + +exports.handler = async (event) => { + let connectionConfig = { + host : host, + user : username, + database : database, + ssl: 'Amazon RDS', + authPlugins: { mysql_clear_password: () => () => signer.getAuthToken() } + } + var connection = mysql.createConnection(connectionConfig) + var query = event.query + var result + connection.connect() +``` + +For more information, see [IAM database authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the Amazon RDS User Guide\. + ## Sample application Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 3620c86a..b5a91eec 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -117,6 +117,9 @@ The following additional environment variables aren't reserved and can be extend + `NODE_PATH` – \([Node\.js](lambda-nodejs.md)\) The Node\.js library path \(`/opt/nodejs/node12/node_modules/:/opt/nodejs/node_modules:$LAMBDA_RUNTIME_DIR/node_modules`\)\. + `PYTHONPATH` – \([Python 2\.7, 3\.6, 3\.8](lambda-python.md)\) The Python library path \(`$LAMBDA_RUNTIME_DIR`\)\. + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. ++ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. ++ `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. ++ `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. @@ -193,6 +196,9 @@ You can also encrypt environment variable values on the client side before sendi 1. Choose **Save**\. +**Note** +When you use the console encryption helpers, your function needs permission to call the `kms:Decrypt` API operation in its [execution role](lambda-intro-execution-role.md)\. + To view sample code for your function's language, choose **Code** next to an environment variable\. The sample code shows how to retrieve an environment variable in a function and decrypt its value\. Another option is to store passwords in AWS Secrets Manager secrets\. You can reference the secret in your AWS CloudFormation templates to set passwords on databases\. You can also set the value of an environment variable on the Lambda function\. For an example, see the next section\. @@ -247,5 +253,5 @@ $ aws lambda update-function-configuration --function-name my-function \ Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. **Sample applications** -+ [Blank](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. ++ [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. + [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index e494bdf2..6956bf03 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -18,6 +18,8 @@ You can also use AWS Serverless Application Model \(AWS SAM\) to manage layers a + [Managing layers](#configuration-layers-manage) + [Including library dependencies in a layer](#configuration-layers-path) + [Layer permissions](#configuration-layers-permissions) ++ [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) ++ [Sample applications](#configuration-layers-samples) ## Configuring a function to use layers @@ -148,7 +150,7 @@ When you delete a layer version, you can no longer configure functions to use it You can move runtime dependencies out of your function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. -To include libraries in a layer, place them in one of the folders supported by your runtime\. +To include libraries in a layer, place them in one of the folders supported by your runtime, or modify that path variable for your language\. + **Node\.js** – `nodejs/node_modules`, `nodejs/node8/node_modules` \(`NODE_PATH`\) **Example AWS X\-Ray SDK for Node\.js** @@ -164,13 +166,6 @@ To include libraries in a layer, place them in one of the folders supported by y │ python/PIL └ python/Pillow-5.3.0.dist-info ``` -+ **Java** – `java/lib` \(classpath\) -**Example Jackson** - - ``` - jackson.zip - └ java/lib/jackson-core-2.2.3.jar - ``` + **Ruby** – `ruby/gems/2.5.0` \(`GEM_PATH`\), `ruby/lib` \(`RUBYLIB`\) **Example JSON** @@ -186,6 +181,13 @@ To include libraries in a layer, place them in one of the folders supported by y └ specifications └ json-2.1.0.gemspec ``` ++ **Java** – `java/lib` \(classpath\) +**Example Jackson** + + ``` + jackson.zip + └ java/lib/jackson-core-2.2.3.jar + ``` + **All** – `bin` \(`PATH`\), `lib` \(`LD_LIBRARY_PATH`\) **Example JQ** @@ -210,4 +212,53 @@ e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Prin Permissions only apply to a single version of a layer\. Repeat the procedure each time you create a new layer version\. -For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. \ No newline at end of file +For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. + +## AWS CloudFormation and AWS SAM + +Use the AWS Serverless Application Model \(AWS SAM\) in your AWS CloudFormation templates to automate the creation and mapping of layers in your application\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your function configuration\. + +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** + +``` +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Properties: + Handler: index.handler + Runtime: nodejs12.x + CodeUri: function/. + Description: Call the AWS Lambda API + Timeout: 10 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambdaReadOnlyAccess + - AWSXrayWriteOnlyAccess + Tracing: Active + Layers: + - !Ref libs + libs: + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) + Properties: + LayerName: blank-nodejs-lib + Description: Dependencies for the blank sample app. + ContentUri: lib/. + CompatibleRuntimes: + - nodejs12.x +``` + +When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. If you deploy changes to your code without modifying your dependencies, AWS SAM skips the layer update, saving upload time\. + +## Sample applications + +The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) + +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 31650878..851bc1d0 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -72,7 +72,7 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index fdd45131..a53197ef 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -35,7 +35,7 @@ dotnet new lambda.EmptyFunction --help The `lambda.EmptyFunction` template supports the following options\. + `--name` – The name of the function\. -+ `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/latest/developer-guide/net-dg-config-creds.html)\. ++ `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html)\. + `--region` – The AWS Region to create the function in\. These options are saved to a file named `aws-lambda-tools-defaults.json`\. diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index c060dc79..2d46af23 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -13,7 +13,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. To create a Lambda application from scratch, choose **Empty Function** and then choose **Finish**\. 1. Examine the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which is read by the Lambda tooling by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: - + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/latest/developer-guide/net-dg-config-creds.html)\. + + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html)\. + **function\-handler** – This is where the `function handler` is specified, which is why you don't have to set it in the wizard\. However, whenever you rename the *Assembly*, *Namespace*, *Class* or *Function* in your function code, you will need to update the corresponding fields in the `aws-lambda-tools-defaults.json file`\. ``` @@ -43,7 +43,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a VPC](configuration-vpc.md)\. + **DLQ** – If your function is invoked asynchronously, [choose a queue or topic](invocation-async.md#dlq) to receive failed invocations\. - + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](lambda-x-ray.md)\. + + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. 1. Choose **Next** and then choose **Upload** to deploy your application\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md new file mode 100644 index 00000000..d41b0693 --- /dev/null +++ b/doc_source/csharp-tracing.md @@ -0,0 +1,126 @@ +# Instrumenting C\# code in AWS Lambda + +Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. + +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. + +[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) + +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. + +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. + +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** + +``` + + + netcoreapp3.1 + true + Lambda + + + + + + + + + + + + +``` + +To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initilization code\. + +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** + +``` + static async void initialize() { + AWSSDKHandler.RegisterXRayForAllServices(); + lambdaClient = new AmazonLambdaClient(); + await callLambda(); + } +``` + +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for \.NET](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet.html) in the AWS X\-Ray Developer Guide\. + +**Topics** ++ [Enabling active tracing with the Lambda API](#csharp-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#csharp-tracing-cloudformation) + +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. + +``` +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active +``` + +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... +``` + +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... +``` \ No newline at end of file diff --git a/doc_source/downstream-tracing.md b/doc_source/downstream-tracing.md deleted file mode 100644 index 6114cd3a..00000000 --- a/doc_source/downstream-tracing.md +++ /dev/null @@ -1,11 +0,0 @@ -# Emitting trace segments from a Lambda function - -For each traced invocation, Lambda will emit the Lambda service segment and all of its subsegments\. In addition, Lambda will emit the Lambda function segment and the init subsegment\. These segments will be emitted regardless of the function's runtime, and with no code changes or additional libraries required\. If you want your Lambda function's X\-Ray traces to include custom segments, annotations, or subsegments for downstream calls, you might need to include additional libraries and annotate your code\. - -Note that any instrumentation code must be implemented inside the Lambda function handler and not as part of the initialization code\. - -The following examples explain how to do this in the supported runtimes: -+ [Instrumenting Python code in AWS Lambda](python-tracing.md) -+ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) -+ [Instrumenting Java code in AWS Lambda](java-tracing.md) -+ [Instrumenting Go code in AWS Lambda](golang-tracing.md) \ No newline at end of file diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 417da61f..fced5ed6 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -88,7 +88,7 @@ If you are done working with the example function, delete it\. You can also dele 1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management console\. -1. Choose the function's role \(`my-function-role-31exxmpl` +1. Choose the function's role \(`my-function-role-31exxmpl`\) 1. Choose **Delete role**\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index b853b7e7..91c3c101 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -4,6 +4,7 @@ With AWS Lambda, you run functions to process events\. You can send events to yo **Topics** + [Function](#gettingstarted-concepts-function) ++ [Qualifier](#gettingstarted-concepts-qualifier) + [Runtime](#gettingstarted-concepts-runtimes) + [Event](#gettingstarted-concepts-event) + [Concurrency](#gettingstarted-concepts-concurrency) @@ -15,6 +16,12 @@ A function is a resource that you can invoke to run your code in AWS Lambda\. A For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. +## Qualifier + +When you invoke or view a function, you can include a qualfier to specify a version or alias\. A version is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An alias is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. + +For more information, see [AWS Lambda function versions](configuration-versions.md)\. + ## Runtime Lambda runtimes allow functions in different languages to run in the same base execution environment\. You configure your function to use a runtime that matches your programming language\. The runtime sits in between the Lambda service and your function code, relaying invocation events, context information, and responses between the two\. You can use runtimes provided by Lambda, or build your own\. @@ -25,7 +32,7 @@ For more information, see [AWS Lambda runtimes](lambda-runtimes.md)\. An event is a JSON formatted document that contains data for a function to process\. The Lambda runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. -**Example Custom event – Weather data** +**Example custom event – Weather data** ``` { @@ -38,7 +45,7 @@ An event is a JSON formatted document that contains data for a function to proce When an AWS service invokes your function, the service defines the shape of the event\. -**Example Service event – Amazon SNS notification** +**Example service event – Amazon SNS notification** ``` { diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 90e77062..b1248b5a 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -20,7 +20,7 @@ Authoring specifics vary between runtimes, but all runtimes share a common progr When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in **initialization code** can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. -Initialization is billed as part of the duration for the first invocation processed by an instance of your function\. When [X\-Ray tracing](lambda-x-ray.md) is enabled, the runtime records separate subsegments for initialization and execution\. +Initialization is billed as part of the duration for the first invocation processed by an instance of your function\. When [X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 58c386a9..01571793 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -19,7 +19,7 @@ func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { } ``` -**Example Log format** +**Example log format** ``` START RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Version: $LATEST @@ -57,7 +57,7 @@ The Go runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index f260a124..69234fc1 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -1,84 +1,102 @@ # Instrumenting Go code in AWS Lambda -You can use the [X\-Ray SDK for Go](https://github.com/aws/aws-xray-sdk-go) with your Lambda function\. If your handler includes [AWS Lambda context object in Go](golang-context.md) as its first argument, that object can be passed to the X\-Ray SDK\. Lambda passes values through this context that the SDK can use to attach subsegments to the Lambda invoke service segment\. Subsegments created with the SDK will appear as a part of your Lambda traces\. +Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -## Installing the X\-Ray SDK +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -Use the following command to install the X\-Ray SDK for Go\. \(The SDK's non\-testing dependencies will be included\)\. +[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) -``` -go get -u github.com/aws/aws-xray-sdk-go/... -``` +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. -If you want to include the test dependencies, use the following command: +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Go\. Download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: ``` -go get -u -t github.com/aws/aws-xray-sdk-go/... +$ go get github.com/aws/aws-xray-sdk-go ``` -You can also use [Glide](https://github.com/Masterminds/glide/blob/master/README.md) to manage dependencies\. +To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. ``` -glide install + xray.AWS(s3.Client) ``` -## Configuring the X\-Ray +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. -The following code sample illustrates how to configure the X\-Ray SDK for Go in your Lambda function: +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) -``` -import ( - "github.com/aws/aws-xray-sdk-go/xray" -) -func myHandlerFunction(ctx context.Context, sample string) { - xray.Configure(xray.Config{ - LogLevel: "info", // default - ServiceVersion: "1.2.3", - }) - ... //remaining handler code -} -``` +The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) in the AWS X\-Ray Developer Guide\. -## Creating a subsegment +**Topics** ++ [Enabling active tracing with the Lambda API](#golang-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#golang-tracing-cloudformation) -The following code illustrates how to start a subsegment: +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -// Start a subsegment - ctx, subSeg := xray.BeginSubsegment(ctx, "subsegment-name") - // ... - // Add metadata or annotation here if necessary - // ... - subSeg.Close(nil) +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active ``` -The following code illustrates how to trace and capture a critical code path: +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` -func criticalSection(ctx context.Context) { - // This example traces a critical code path using a custom subsegment - xray.Capture(ctx, "MyService.criticalSection", func(ctx1 context.Context) error { - var err error - - section.Lock() - result := someLockedResource.Go() - section.Unlock() - - xray.AddMetadata(ctx1, "ResourceResult", result) - }) -} +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... ``` -## Tracing HTTP requests +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -You can also use the `xray.Client()` method if you want to trace an HTTP client, as shown below: +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` -func myFunction (ctx context.Context) ([]byte, error) { - resp, err := ctxhttp.Get(ctx, xray.Client(nil), "https://aws.amazon.com") - if err != nil { - return nil, err - } - return ioutil.ReadAll(resp.Body), nil -} +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... ``` \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index d0378139..ec968ad6 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -62,7 +62,6 @@ Amazon's trademarks and trade dress may not be used in + [Common Lambda application types and use cases](applications-usecases.md) + [Best Practices for Working with AWS Lambda Functions](best-practices.md) + [Using AWS Lambda with other services](lambda-services.md) - + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + [Using AWS Lambda with Alexa](services-alexa.md) + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) + [Tutorial: Using AWS Lambda with Amazon API Gateway](services-apigateway-tutorial.md) @@ -70,6 +69,7 @@ Amazon's trademarks and trade dress may not be used in + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) + + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) + [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md) @@ -88,20 +88,21 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) - + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + [Using AWS Lambda with Amazon EC2](services-ec2.md) + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) + + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) - + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) - + [Using AWS Lambda with Amazon S3 events](with-s3.md) + + [Using AWS Lambda with Amazon S3](with-s3.md) + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) @@ -114,6 +115,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -137,6 +139,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in Ruby](ruby-context.md) + [AWS Lambda function logging in Ruby](ruby-logging.md) + [AWS Lambda function errors in Ruby](ruby-exceptions.md) + + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) + [Building Lambda functions with Java](lambda-java.md) + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda deployment package in Java](java-package.md) @@ -162,6 +165,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in C#](csharp-context.md) + [AWS Lambda function logging in C#](csharp-logging.md) + [AWS Lambda function errors in C#](csharp-exceptions.md) + + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) + [Setting Up a PowerShell Development Environment](powershell-devenv.md) + [AWS Lambda deployment package in PowerShell](powershell-package.md) @@ -173,11 +177,6 @@ Amazon's trademarks and trade dress may not be used in + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) - + [Using AWS X-Ray](lambda-x-ray.md) - + [Tracing Lambda-based applications with AWS X-Ray](using-x-ray.md) - + [Emitting trace segments from a Lambda function](downstream-tracing.md) - + [The AWS X-Ray daemon in the Lambda environment](lambda-x-ray-daemon.md) - + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for AWS Lambda](security-iam.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 868b4f4e..bdc486f6 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -103,7 +103,7 @@ Add destinations to your function in the Lambda console's function designer\. When an invocation matches the condition, Lambda sends a JSON document with details about the invocation to the destination\. The following example shows an invocation record for an event that failed three processing attempts due to a function error\. -**Example Invocation record** +**Example invocation record** ``` { diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 7438b402..211a9727 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -59,7 +59,7 @@ The invocation record contains details about the failed event batch in JSON form The following example shows an invocation record for a Kinesis stream\. -**Example Invocation Record** +**Example invocation Record** ``` { diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 12cc6f36..cd12d375 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -47,7 +47,7 @@ public class Handler implements RequestHandler, String>{ The function serializes the context object into JSON and records it in its log stream\. -**Example Log output** +**Example log output** ``` START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 4e8abcd5..f7b5b503 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -30,7 +30,7 @@ public class HandlerDivide implements RequestHandler, Integer>{ When the function throws `InputLengthException`, the Java runtime serializes it into the following document\. -**Example Error document \(whitespace added\)** +**Example error document \(whitespace added\)** ``` { diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 01f6d51a..5bd1703f 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -27,7 +27,7 @@ public class Handler implements RequestHandler{ } ``` -**Example Log format** +**Example log format** ``` START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST @@ -69,7 +69,7 @@ The Java runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. @@ -209,7 +209,7 @@ To add the request ID to your function's logs, use the appender in the [aws\-lam With this configuration, each line is prepended with the date, time, request ID, log level, and class name\. -**Example Log format with appender** +**Example log format with appender** ``` START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST @@ -270,13 +270,13 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index e90c2a13..5a74dc55 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -50,7 +50,7 @@ In this step, you start Eclipse and create a Maven project\. You will add the ne **Artifact Id:** aws\-lambda\-java\-core - **Version:** 1\.2\.0 + **Version:** 1\.2\.1 **Note** If you are following other tutorial topics in this guide, the specific tutorials might require you to add more dependencies\. Make sure to add those dependencies as required\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 186f7b86..7a53e52f 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -14,9 +14,9 @@ These libraries are available through [Maven central repository](https://search. ``` dependencies { - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' } ``` @@ -28,17 +28,17 @@ dependencies { com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.amazonaws aws-lambda-java-events - 2.2.7 + 2.2.9 com.amazonaws aws-lambda-java-log4j2 - 1.1.0 + 1.2.0 ``` @@ -94,13 +94,13 @@ This build configuration produces a deployment package in the `build/distributio dependencies { implementation platform('software.amazon.awssdk:bom:2.10.73') implementation 'software.amazon.awssdk:lambda' - implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -153,8 +153,8 @@ To build the deployment package, use the `mvn package` command\. [INFO] Building jar: target/java-maven-1.0-SNAPSHOT.jar [INFO] [INFO] --- maven-shade-plugin:3.2.2:shade (default) @ java-maven --- -[INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.0 in the shaded jar. -[INFO] Including com.amazonaws:aws-lambda-java-events:jar:2.2.7 in the shaded jar. +[INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.1 in the shaded jar. +[INFO] Including com.amazonaws:aws-lambda-java-events:jar:2.2.9 in the shaded jar. [INFO] Including joda-time:joda-time:jar:2.6 in the shaded jar. [INFO] Including com.google.code.gson:gson:jar:2.8.6 in the shaded jar. [INFO] Replacing original artifact with shaded artifact. diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 8c7b1290..e0063db6 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -13,7 +13,7 @@ Use the `blank-java` sample app to learn the basics, or as a starting point for [https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) -The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies, for cases where you don't need additional libraries like the AWS SDK and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. +The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. **Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 98860832..50ba1327 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -6,7 +6,7 @@ The X\-Ray *service map* shows the flow of requests through your application\. T [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) -You can enable tracing in your function's configuration\. +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. **To enable active tracing** @@ -18,6 +18,9 @@ You can enable tracing in your function's configuration\. 1. Choose **Save**\. +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. @@ -43,8 +46,23 @@ dependencies { } ``` +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java ](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the AWS X\-Ray Developer Guide\. +**Topics** ++ [Enabling active tracing with the Lambda API](#java-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#java-tracing-cloudformation) ++ [Storing runtime dependencies in a layer](#java-tracing-layers) ++ [Tracing in sample applications](#java-tracing-samples) + ## Enabling active tracing with the Lambda API To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: @@ -79,19 +97,22 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: function: Type: AWS::Serverless::Function Properties: - CodeUri: build/distributions/blank-java.zip Tracing: Active ... ``` -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. +## Storing runtime dependencies in a layer + +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. + +The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. **Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** @@ -115,9 +136,9 @@ Resources: - java8 ``` -With this configuration, you only update library JARs if you change your build dependencies\. When you update your function code, you only need to upload your function's compiled classes, so upload times can be much faster\. +With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. ## Tracing in sample applications diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index ee316881..fdc14b48 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -16,7 +16,7 @@ To restrict permissions by resource, specify the resource by ARN\. For example, the following policy allows a user in account `123456789012` to invoke a function named `my-function` in the US West \(Oregon\) Region\. -**Example Invoke a function policy** +**Example invoke function policy** ``` { @@ -40,7 +40,7 @@ Conditions are an optional policy element that applies additional logic to deter For example, the `lambda:Principal` condition lets you restrict the service or account that a user can grant invocation access to on a function's resource\-based policy\. The following policy lets a user grant permission to SNS topics to invoke a function named `test`\. -**Example Manage function policy permissions** +**Example manage function policy permissions** ``` { diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 84262b02..580726c9 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -36,4 +36,5 @@ To get started with application development in your local environment, deploy on + [AWS Lambda function handler in C\#](csharp-handler.md) + [AWS Lambda context object in C\#](csharp-context.md) + [AWS Lambda function logging in C\#](csharp-logging.md) -+ [AWS Lambda function errors in C\#](csharp-exceptions.md) \ No newline at end of file ++ [AWS Lambda function errors in C\#](csharp-exceptions.md) ++ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index 93eab1b9..7ce323f9 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,19 +1,27 @@ # Monitoring and troubleshooting Lambda applications -AWS Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. It also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. For more information about CloudWatch, see the *[Amazon CloudWatch User Guide](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)*\. +AWS Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. It also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. -You can view request rates and error rates for each of your Lambda functions by using the AWS Lambda console, the CloudWatch console, and other AWS resources\. The following topics describe Lambda CloudWatch metrics and how to access them\. -+ [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) -+ [Working with AWS Lambda function metrics](monitoring-metrics.md) +The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. + +**To monitor a function** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. -You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with Amazon CloudWatch Logs\. It pushes all logs from your code to a CloudWatch Logs group that is associated with a Lambda function \(/aws/lambda/**\)\. To learn more about log groups and accessing them through the CloudWatch console, see [Working with log groups and log streams](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) in the *Amazon CloudWatch Logs User Guide*\. For information about how to access CloudWatch log entries, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. +1. Choose **Monitoring**\. -**Note** -If your Lambda function code is executing, but you don't see any log data being generated after several minutes, this could mean that your execution role for the Lambda function didn't grant permissions to write log data to CloudWatch Logs\. For information about how to make sure that you have set up the execution role correctly to grant these permissions, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. +**Pricing** +CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For details, see [CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/)\. -Each of the monitoring services provides a free tier\. If your application exceeds the free tier limits, pricing is based on usage\. For more information, see [ CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/) and [X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. Also note that standard storage rates apply for CloudWatch logs that are stored by the Lambda service\. +Each time your function is invoked, Lambda records [metrics](monitoring-metrics.md) for the request, the function's response, and the overall state of the function\. You can use metrics to set alarms the are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current Region\. -The monitoring services follow these usage models: -+ AWS Lambda reports metrics and logs to CloudWatch every time your Lambda function executes\. -+ CloudWatch Logs Insights runs when you view the Monitoring page of your Lambda function\. -+ X\-Ray starts to record traces when you enable X\-Ray for a function, or when an upstream service enables X\-Ray\. \ No newline at end of file +To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. You can [view logs](monitoring-cloudwatchlogs.md) in the CloudWatch Logs console, in the Lambda console, or from the command line\. + +In addition to monitoring logs and metrics in CloudWatch, you can use AWS X\-Ray to trace and debug requests served by your application\. For details, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. + +**Topics** ++ [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) ++ [Working with AWS Lambda function metrics](monitoring-metrics.md) ++ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) \ No newline at end of file diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 6574b109..800a57a1 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -2,7 +2,7 @@ You can use AWS Identity and Access Management \(IAM\) to manage access to the Lambda API and resources like functions and layers\. For users and applications in your account that use Lambda, you manage permissions in a permissions policy that you can apply to IAM users, groups, or roles\. To grant permissions to other accounts or AWS services that use your Lambda resources, you use a policy that applies to the resource itself\. -A Lambda function also has a policy, called an [execution role](lambda-intro-execution-role.md), that grants it permission to access AWS services and resources\. At a minimum, your function needs access to Amazon CloudWatch Logs for log streaming\. If you [use AWS X\-Ray to trace your function](lambda-x-ray.md), or your function accesses services with the AWS SDK, you grant it permission to call them in the execution role\. Lambda also uses the execution role to get permission to read from event sources when you use an [event source mapping](invocation-eventsourcemapping.md) to trigger your function\. +A Lambda function also has a policy, called an [execution role](lambda-intro-execution-role.md), that grants it permission to access AWS services and resources\. At a minimum, your function needs access to Amazon CloudWatch Logs for log streaming\. If you [use AWS X\-Ray to trace your function](services-xray.md), or your function accesses services with the AWS SDK, you grant it permission to call them in the execution role\. Lambda also uses the execution role to get permission to read from event sources when you use an [event source mapping](invocation-eventsourcemapping.md) to trigger your function\. **Note** If your function needs network access to a resource like a relational database that isn't accessible through AWS APIs or the internet, [configure it to connect to your VPC](configuration-vpc.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 8e1b9e50..268ebc9c 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 75fa3db4..7b083dfe 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For details, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | @@ -63,7 +64,7 @@ The following table describes the important changes in each release of the *AWS | Introducing SAM Local | AWS Lambda introduces SAM Local \(now known as SAM CLI\), a AWS CLI tool that provides an environment for you to develop, test, and analyze your serverless applications locally before uploading them to the Lambda runtime\. For more information, see [ Testing and debugging serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html)\. | August 11, 2017 | | Canada \(Central\) Region | AWS Lambda is now available in the Canada \(Central\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 22, 2017 | | South America \(São Paulo\) Region | AWS Lambda is now available in the South America \(São Paulo\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 6, 2017 | -| AWS Lambda support for AWS X\-Ray\. | Lambda introduces support for X\-Ray, which allows you to detect, analyze, and optimize performance issues with your Lambda applications\. For more information, see [Using AWS X\-Ray](lambda-x-ray.md)\. | April 19, 2017 | +| AWS Lambda support for AWS X\-Ray\. | Lambda introduces support for X\-Ray, which allows you to detect, analyze, and optimize performance issues with your Lambda applications\. For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. | April 19, 2017 | | Asia Pacific \(Mumbai\) Region | AWS Lambda is now available in the Asia Pacific \(Mumbai\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 28, 2017 | | AWS Lambda now supports Node\.js runtime v6\.10 | AWS Lambda added support for Node\.js runtime v6\.10\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | March 22, 2017 | | Europe \(London\) Region | AWS Lambda is now available in the Europe \(London\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | February 1, 2017 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 9193bc3f..46914084 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -73,4 +73,5 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti + [AWS Lambda deployment package in Ruby](ruby-package.md) + [AWS Lambda context object in Ruby](ruby-context.md) + [AWS Lambda function logging in Ruby](ruby-logging.md) -+ [AWS Lambda function errors in Ruby](ruby-exceptions.md) \ No newline at end of file ++ [AWS Lambda function errors in Ruby](ruby-exceptions.md) ++ [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 0967ffc6..e5960ea3 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -27,10 +27,10 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.12\.22 botocore\-1\.15\.22 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | **Ruby runtimes** diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index fabd706b..6bcfcb89 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -6,7 +6,7 @@ Each service that integrates with Lambda sends data to your function in JSON as The following example shows a test event from an [Application Load Balancer](services-alb.md) that represents a GET request to `/lambda?query=1234ABCD`\. -**Example Event from an Application Load Balancer** +**Example event from an Application Load Balancer** ``` { diff --git a/doc_source/lambda-x-ray-daemon.md b/doc_source/lambda-x-ray-daemon.md deleted file mode 100644 index 508d671a..00000000 --- a/doc_source/lambda-x-ray-daemon.md +++ /dev/null @@ -1,8 +0,0 @@ -# The AWS X\-Ray daemon in the Lambda environment - -[The AWS X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html) is a software application that gathers raw segment data and relays it to the AWS X\-Ray service\. The daemon works in conjunction with the AWS X\-Ray SDKs so that data sent by the SDKs can reach the X\-Ray service\. - -When you trace your Lambda function, the X\-Ray daemon automatically runs in the Lambda environment to gather trace data and send it to X\-Ray\. When tracing, the X\-Ray daemon consumes a maximum of 16 MB or 3 percent of your function's memory allocation\. For example, if you allocate 128 MB of memory to your Lambda function, the X\-Ray daemon has 16 MB of your function's memory allocation\. If you allocate 1024 MB to your Lambda function, the X\-Ray daemon has 31 MB allocated to it \(3 percent\)\. For more information, see [The AWS X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html)\. - -**Note** -Lambda will try to terminate the X\-Ray daemon to avoid exceeding your function's memory limit\. For example, assume you have allocated 128 MB to your Lambda function, which means the X\-Ray daemon will have 16 MB allocated to it\. That leaves your Lambda function with a memory allocation of 112 MB\. However, if your function exceeds 112 MB, the X\-Ray daemon will be terminated to avoid throwing an out\-of\-memory error\. \ No newline at end of file diff --git a/doc_source/lambda-x-ray.md b/doc_source/lambda-x-ray.md deleted file mode 100644 index eaff4597..00000000 --- a/doc_source/lambda-x-ray.md +++ /dev/null @@ -1,47 +0,0 @@ -# Using AWS X\-Ray - -You can use AWS X\-Ray to visualize the components of your application, identify performance bottlenecks, and troubleshoot requests that resulted in an error\. Your Lambda functions send trace data to X\-Ray, and X\-Ray processes the data to generate a service map and searchable trace summaries\. - -If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. For a full list of services that support active instrumentation, see [Supported AWS services](https://docs.aws.amazon.com/xray/latest/devguide/xray-usage.html#xray-usage-codechanges) in the AWS X\-Ray Developer Guide\. - -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. - -You can enable tracing in your function's configuration\. - -**To enable active tracing** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. - -1. Choose a function\. - -1. Under **AWS X\-Ray**, choose **Active tracing**\. - -1. Choose **Save**\. - -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. - -## Using environment variables to communicate with AWS X\-Ray - -AWS Lambda uses environment variables to facilitate communication with the X\-Ray daemon and configure the X\-Ray SDK\. -+ **\_X\_AMZN\_TRACE\_ID:** Contains the tracing header, which includes the sampling decision, trace ID, and parent segment ID\. \(To learn more about these properties, see [Tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader)\.\) If Lambda receives a tracing header when your function is invoked, that header will be used to populate the \_X\_AMZN\_TRACE\_ID environment variable\. If a tracing header was not received, Lambda will generate one for you\. -+ **AWS\_XRAY\_CONTEXT\_MISSING:** The X\-Ray SDK uses this variable to determine its behavior in the event that your function tries to record X\-Ray data, but a tracing header is not available\. Lambda sets this value to `LOG_ERROR `by default\. -+ **AWS\_XRAY\_DAEMON\_ADDRESS:** This environment variable exposes the X\-Ray daemon's address in the following format: *IP\_ADDRESS***:***PORT*\. You can use the X\-Ray daemon's address to send trace data to the X\-Ray daemon directly, without using the X\-Ray SDK\. - -## Lambda traces in the AWS X\-Ray console: Examples - -The following shows Lambda traces for two different Lambda functions\. Each trace showcases a trace structure for a different invocation type: asynchronous and synchronous\. -+ **Async ** – The example following shows an asynchronous Lambda request with one successful invocation and one downstream call to DynamoDB\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Trace_Console_DDB.png) - - The Lambda service segment encapsulates the response time, which is the time it took to return a response \(for example, 202\) to the client\. It includes subsegments for the time spent in the Lambda service queue \(dwell time\) and each invocation attempt\. \(Only one invocation attempt appears in the example preceding\.\) Each attempt subsegment in the service segment will have a corresponding user function segment\. In this example, the user function segment contains two subsegments: the initialization subsegment representing the function's initialization code that is run before the handler, and a downstream call subsegment representing a `ListTables` call to DynamoDB\. - - Status codes and error messages are displayed for each Invocation subsegment and for each downstream call\. -+ **Synchronous** – The example following shows a synchronous request with one downstream call to Amazon S3\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Trace_Console_S3.png) - - The Lambda service segment captures the entire time the request spends in the Lambda service\. The service segment will have a corresponding User function segment\. In this example, the User function segment contains a subsegment representing the function's initialization code \(code run before the handler\), and a subsegment representing the `PutObject` call to Amazon S3\. - -**Note** -If you want to trace HTTP calls, you need to use an HTTP client\. For more information, see [Tracing calls to downstream HTTP web services with the X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java-httpclients.html) or [Tracing calls to downstream HTTP web services with the X\-Ray SDK for Node\.js ](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-httpclients.html)\. \ No newline at end of file diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 6045fd11..126b5a54 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -4,8 +4,6 @@ AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWa **To access the monitoring console** -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. - 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose **Monitoring**\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index a1217437..6b22de36 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -27,7 +27,7 @@ For more information about CloudWatch, see the [https://docs.aws.amazon.com/Amaz ## Using invocation metrics -Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the sum of the `Errors` metric with a period of one minute\. +Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of one minute\. You should view the following metrics with the `Sum` statistic\. @@ -42,7 +42,7 @@ You should view the following metrics with the `Sum` statistic\. ## Using performance metrics -Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Maximum` statistic\. +Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Max` statistic\. **Performance metrics** + `Duration` – The amount of time that your function code spends processing an event\. For the first event processed by an instance of your function, this includes [initialization time](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest 100 milliseconds\. diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 9f4725f0..928f4da4 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -15,7 +15,7 @@ exports.handler = async function(event, context) { } ``` -**Example Log format** +**Example log format** ``` START RequestId: c793869b-ee49-115b-a5b6-4fd21e8dedac Version: $LATEST @@ -48,7 +48,7 @@ The Node\.js runtime logs the `START`, `END`, and `REPORT` lines for each invoca + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 51e4447e..9680316b 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -1,39 +1,162 @@ # Instrumenting Node\.js code in AWS Lambda -In Node\.js, you can have Lambda emit subsegments to X\-Ray to show you information about downstream calls to other AWS services made by your function\. To do so, you first need to include the [the AWS X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) in your deployment package\. In addition, wrap your AWS SDK `require` statement in the following manner\. +Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -``` -const AWSXRay = require('aws-xray-sdk-core') -const AWS = AWSXRay.captureAWS(require('aws-sdk')) -``` +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. + +[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) + +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -Then, use the AWS variable defined in the preceding example to initialize any service client that you want to trace with X\-Ray, for example: +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. + +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. + +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** ``` -const s3 = new AWS.S3() +{ + "name": "blank-nodejs", + "version": "1.0.0", + "private": true, + "devDependencies": { + "aws-sdk": "2.631.0", + "jest": "25.4.0" + }, + "dependencies": { + "aws-xray-sdk-core": "1.1.2" + }, + "scripts": { + "test": "jest" + } +} ``` -After following these steps, any call made from your function using `s3Client` results in an X\-Ray subsegment that represents that call\. As an example, you can run the Node\.js function following to see how the trace looks in X\-Ray\. +To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example index\.js** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') const AWS = AWSXRay.captureAWS(require('aws-sdk')) -const s3 = new AWS.S3() -exports.handler = async function(event) { - return s3.listBuckets().promise() -} +// Create client outside of handler to reuse +const lambda = new AWS.Lambda() + +// Handler +exports.handler = async function(event, context) { + event.Records.forEach(record => { + ... ``` -The following example shows a trace with 2 segments, both named **my\-function**\. +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. - -**** + **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. \ No newline at end of file ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) in the AWS X\-Ray Developer Guide\. + +**Topics** ++ [Enabling active tracing with the Lambda API](#nodejs-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#nodejs-tracing-cloudformation) ++ [Storing runtime dependencies in a layer](#nodejs-tracing-layers) + +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. + +``` +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active +``` + +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... +``` + +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... +``` + +## Storing runtime dependencies in a layer + +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. + +The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: function/. + Tracing: Active + Layers: + - !Ref libs + ... + libs: + Type: AWS::Serverless::LayerVersion + Properties: + LayerName: blank-nodejs-lib + Description: Dependencies for the blank sample app. + ContentUri: lib/. + CompatibleRuntimes: + - nodejs12.x +``` + +With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. + +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/permissions-boundary.md b/doc_source/permissions-boundary.md index 6b010ec3..9ba5075b 100644 --- a/doc_source/permissions-boundary.md +++ b/doc_source/permissions-boundary.md @@ -14,7 +14,7 @@ The boundary limits the permissions of the functions' roles\. You can add permis By default, an application's permissions boundary enables functions to perform actions on the resources in the application\. For example, if the application includes an Amazon DynamoDB table, the boundary allows access to any API action that can be restricted to operate on specific tables with resource\-level permissions\. You can only use actions that don't support resource\-level permissions if they're specifically permitted in the boundary\. These include Amazon CloudWatch Logs and AWS X\-Ray API actions for logging and tracing\. -**Example Permissions boundary** +**Example permissions boundary** ``` { diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 182bd906..24a96cb8 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -19,7 +19,7 @@ Write-Host `## Event Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 3) ``` -**Example Log format** +**Example log format** ``` START RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed Version: $LATEST @@ -60,7 +60,7 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 8d0abb3a..bb6f6150 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -17,7 +17,7 @@ def lambda_handler(event, context): print(event) ``` -**Example Log format** +**Example log format** ``` START RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Version: $LATEST @@ -39,7 +39,7 @@ The Python runtime logs the `START`, `END`, and `REPORT` lines for each invocati + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index ee5a2fe8..88060aea 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,68 +1,153 @@ # Instrumenting Python code in AWS Lambda -In Python, you can have Lambda emit subsegments to X\-Ray to show you information about downstream calls to other AWS services made by your function\. To do so, you first need to include the [the AWS X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in your deployment package\. In addition, you can patch the `boto3` \(or `botocore` if you are using sessions\), so any client you create to access other AWS services will automatically be traced by X\-Ray\. +Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. + +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. + +[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) + +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. + +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. + +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** + +``` +jsonpickle==1.3 +aws-xray-sdk==2.4.3 +``` + +To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. + +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 from aws_xray_sdk.core import xray_recorder -from aws_xray_sdk.core import patch +from aws_xray_sdk.core import patch_all + +logger = logging.getLogger() +logger.setLevel(logging.INFO) +patch_all() + +client = boto3.client('lambda') +client.get_account_settings() -patch(['boto3']) +def lambda_handler(event, context): + logger.info('## ENVIRONMENT VARIABLES\r' + jsonpickle.encode(dict(**os.environ))) + ... ``` -Once you've patched the module you are using to create clients, you can use it to create your traced clients, in the case below Amazon S3: +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the AWS X\-Ray Developer Guide\. + +**Topics** ++ [Enabling active tracing with the Lambda API](#python-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#python-tracing-cloudformation) ++ [Storing runtime dependencies in a layer](#python-tracing-layers) + +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -s3_client = boto3.client('s3') +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active ``` -The X\-Ray SDK for Python creates a subsegment for the call and records information from the request and response\. You can use the `aws_xray_sdk_sdk.core.xray_recorder` to create subsegments automatically by decorating your Lambda functions or manually by calling `xray_recorder.begin_subsegment()` and `xray_recorder.end_subsegment()` inside the function, as shown in the following Lambda function\. +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` -import boto3 -from aws_xray_sdk.core import xray_recorder -from aws_xray_sdk.core import patch +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... +``` -patch(['boto3']) +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -s3_client = boto3.client('s3') +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** -def lambda_handler(event, context): - bucket_name = event['bucket_name'] - bucket_key = event['bucket_key'] - body = event['body'] - - put_object_into_s3(bucket_name, bucket_key, body) - get_object_from_s3(bucket_name, bucket_key) - -# Define subsegments manually -def put_object_into_s3(bucket_name, bucket_key, body): - try: - xray_recorder.begin_subsegment('put_object') - response = s3_client.put_object(Bucket=bucket_name, Key=bucket_key, Body=body) - status_code = response['ResponseMetadata']['HTTPStatusCode'] - xray_recorder.current_subsegment().put_annotation('put_response', status_code) - finally: - xray_recorder.end_subsegment() - -# Use decorators to automatically set the subsegments -@xray_recorder.capture('get_object') -def get_object_from_s3(bucket_name, bucket_key): - response = s3_client.get_object(Bucket=bucket_name, Key=bucket_key) - status_code = response['ResponseMetadata']['HTTPStatusCode'] - xray_recorder.current_subsegment().put_annotation('get_response', status_code) ``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... +``` + +## Storing runtime dependencies in a layer -**Note** -The X\-Ray SDK for Python allows you to patch the following modules: -botocore -boto3 -requests -sqlite3 -mysql -pymysql -You can use `patch_all()` to patch all of them at once\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. + +The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: function/. + Tracing: Active + Layers: + - !Ref libs + ... + libs: + Type: AWS::Serverless::LayerVersion + Properties: + LayerName: blank-python-lib + Description: Dependencies for the blank-python sample app. + ContentUri: package/. + CompatibleRuntimes: + - python3.8 +``` -Following is what a trace emitted by the code preceding looks like \(synchronous invocation\): +With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/AWS_X_Ray_Python.png) \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index f31ef2eb..988b0b17 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -79,7 +79,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. -**Example Log format** +**Example log format** ``` START RequestId: 50aba555-99c8-4b21-8358-644ee996a05f Version: $LATEST @@ -110,7 +110,7 @@ The Ruby runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **Memory Size** – The amount of memory allocated to the function\. + **Max Memory Used** – The amount of memory used by the function\. + **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](lambda-x-ray.md)\. ++ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md new file mode 100644 index 00000000..2488dea9 --- /dev/null +++ b/doc_source/ruby-tracing.md @@ -0,0 +1,155 @@ +# Instrumenting Ruby code in AWS Lambda + +Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. + +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. + +[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) + +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. + +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. + +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** + +``` +# Gemfile +source 'https://rubygems.org' + +gem 'aws-xray-sdk', '0.11.4' +gem 'aws-sdk-lambda', '1.39.0' +gem 'test-unit', '3.3.5' +``` + +To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. + +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** + +``` +# lambda_function.rb +require 'logger' +require 'json' +require 'aws-sdk-lambda' +$client = Aws::Lambda::Client.new() +$client.get_account_settings() + +require 'aws-xray-sdk/lambda' + +def lambda_handler(event:, context:) + logger = Logger.new($stdout) + ... +``` + +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. ++ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Ruby](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-ruby.html) in the AWS X\-Ray Developer Guide\. + +**Topics** ++ [Enabling active tracing with the Lambda API](#ruby-tracing-api) ++ [Enabling active tracing with AWS CloudFormation](#ruby-tracing-cloudformation) ++ [Storing runtime dependencies in a layer](#ruby-tracing-layers) + +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. + +``` +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active +``` + +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... +``` + +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... +``` + +## Storing runtime dependencies in a layer + +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. + +The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: function/. + Tracing: Active + Layers: + - !Ref libs + ... + libs: + Type: AWS::Serverless::LayerVersion + Properties: + LayerName: blank-ruby-lib + Description: Dependencies for the blank-ruby sample app. + ContentUri: lib/. + CompatibleRuntimes: + - ruby2.5 +``` + +With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. + +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 2286fa4d..13403556 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -7,6 +7,21 @@ Deprecation occurs in two phases\. During the first phase, you can no longer cre **Note** Python 2\.7 reached end\-of\-life on January 1st, 2020\. However, the Python 2\.7 runtime is still supported and is not scheduled to be deprecated at this time\. For details, see [Continued support for Python 2\.7 on AWS Lambda](https://aws.amazon.com/blogs/compute/continued-support-for-python-2-7-on-aws-lambda/)\. +The following runtimes have been deprecated: + + +**Deprecated runtimes** + +| Name | Identifier | Operating system | Deprecation completed date | +| --- | --- | --- | --- | +| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | July 30, 2019 | +| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | May 30, 2019 | +| Node\.js 0\.10 | `nodejs` | Amazon Linux | October 31, 2016 | +| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | March 6, 2020 | +| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | April 30, 2019 | +| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | August 12, 2019 | +| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | March 6, 2020 | + In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime\. In some cases, such as security issues that require a backwards\-incompatible update, or software that doesn't support a long\-term support \(LTS\) schedule, advance notice might not be possible\. **Language and framework support policies** diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md index 6335e4fb..cea50763 100644 --- a/doc_source/runtimes-api.md +++ b/doc_source/runtimes-api.md @@ -56,7 +56,7 @@ The tracing header contains the trace ID, parent ID, and sampling decision\. If Sends an invocation response to Lambda\. After the runtime invokes the function handler, it posts the response from the function to the invocation response path\. For synchronous invocations, Lambda then sends the response back to the client\. -**Example Success request** +**Example success request** ``` REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 @@ -71,7 +71,7 @@ curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$R If the function returns an error, the runtime formats the error into a JSON document, and posts it to the invocation error path\. -**Example Request body** +**Example request body** ``` { @@ -80,7 +80,7 @@ If the function returns an error, the runtime formats the error into a JSON docu } ``` -**Example Error request** +**Example error request** ``` REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 @@ -96,7 +96,7 @@ curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$RE If the runtime encounters an error during initialization, it posts an error message to the initialization error path\. -**Example Initialization error request** +**Example initialization error request** ``` ERROR="{\"errorMessage\" : \"Failed to load function.\", \"errorType\" : \"InvalidFunctionException\"}" diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index 3b1f3851..f93de3ee 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -50,9 +50,9 @@ Your runtime code is responsible for completing some initialization tasks\. Then + **Initialize the function** – Load the handler file and run any global or static code that it contains\. Functions should create static resources like SDK clients and database connections once, and reuse them for multiple invocations\. + **Handle errors** – If an error occurs, call the [initialization error](runtimes-api.md#runtimes-api-initerror) API and exit immediately\. -Initialization counts towards billed execution time and timeout\. When an execution triggers the initialization of a new instance of your function, you can see the initialization time in the logs and [AWS X\-Ray trace](lambda-x-ray.md)\. +Initialization counts towards billed execution time and timeout\. When an execution triggers the initialization of a new instance of your function, you can see the initialization time in the logs and [AWS X\-Ray trace](services-xray.md)\. -**Example Log** +**Example log** ``` REPORT RequestId: f8ac1208... Init Duration: 48.26 ms Duration: 237.17 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 26 MB diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 6000ad44..615ae7a4 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -78,7 +78,7 @@ The application template uses an AWS Serverless Application Model \(AWS SAM\) re The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resource** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -113,7 +113,7 @@ Resources: When you deploy the application, AWS CloudFormation applies the AWS SAM transform to the template to generate an AWS CloudFormation template with standard types such as `AWS::Lambda::Function` and `AWS::IAM::Role`\. -**Example Processed template** +**Example processed template** ``` { @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/4\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/4-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index c061d523..5d5c6e5e 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -27,7 +27,7 @@ Standard charges apply for each service\. A Lambda function in the application generates errors randomly\. When CloudWatch Logs detects the word `ERROR` in the function's logs, it sends an event to the processor function for processing\. -**Example – CloudWatch Logs message event** +**Example CloudWatch Logs message event** ``` { @@ -39,7 +39,7 @@ A Lambda function in the application generates errors randomly\. When CloudWatch When it's decoded, the data contains details about the log event\. The function uses these details to identify the log stream, and parses the log message to get the ID of the request that caused the error\. -**Example – Decoded CloudWatch Logs event data** +**Example decoded CloudWatch Logs event data** ``` { @@ -64,7 +64,7 @@ The processor function uses information from the CloudWatch Logs event to downlo ## Instrumentation with AWS X\-Ray -The application uses [AWS X\-Ray](lambda-x-ray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the random error function generating errors for some requests\. It also shows the processor function calling X\-Ray, CloudWatch Logs, and Amazon S3\. +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the random error function generating errors for some requests\. It also shows the processor function calling X\-Ray, CloudWatch Logs, and Amazon S3\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md index 8281e205..8be1d583 100644 --- a/doc_source/services-alb.md +++ b/doc_source/services-alb.md @@ -39,7 +39,7 @@ Elastic Load Balancing invokes your Lambda function synchronously with an event Your function processes the event and returns a response document to the load balancer in JSON\. Elastic Load Balancing converts the document to an HTTP success or error response and returns it to the user\. -**Example Response document format** +**Example response document format** ``` { diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index dd000d69..a7cc9e75 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -133,7 +133,7 @@ Amazon API Gateway gets permission to invoke your function from the function's [ When you add an API to your function by using the Lambda console, using the API Gateway console, or in an AWS SAM template, the function's resource\-based policy is updated automatically\. The following example shows a function policy with a statement that was added by an AWS SAM template\. -**Example Function policy** +**Example function policy** ``` { diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 0832d4c0..ce703c68 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -121,4 +121,4 @@ Update the function configuration to cause the function to return an error, whic 1. Choose **Save**\. -Wait a minute, and then check your email for a message from Amazon SNS\. +Wait a minute, and then check your email for a message from Amazon SNS\. \ No newline at end of file diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index d06de2a5..bdce5f13 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -4,7 +4,7 @@ You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute C CloudWatch Events invokes your Lambda function asynchronously with the event document from Amazon EC2\. -**Example Instance lifecycle event** +**Example instance lifecycle event** ``` { @@ -33,7 +33,7 @@ You can also use the AWS SDK to manage instances and other resources with the Am To process lifecycle events from Amazon EC2, CloudWatch Events needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the CloudWatch Events console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: -**Example Resource\-based policy statement for Amazon EC2 lifecycle notifications** +**Example resource\-based policy statement for Amazon EC2 lifecycle notifications** ``` { diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index 0ba37cca..af9d05fe 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -8,7 +8,7 @@ When an incoming IoT message triggers the rule, AWS IoT invokes your Lambda func The following example shows a moisture reading from a greenhouse sensor\. The **row** and **pos** values identify the location of the sensor\. This example event is based on the greenhouse type in the [AWS IoT Rules tutorials](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules-tutorial.html)\. -**Example Example AWS IoT message event** +**Example AWS IoT message event** ``` { diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md index 2f43e48f..e6692b7c 100644 --- a/doc_source/services-iotevents.md +++ b/doc_source/services-iotevents.md @@ -6,7 +6,7 @@ To use AWS IoT Events, you define a detector model, which is a state\-machine mo When the event occurs, AWS IoT Events invokes your Lambda function asynchronously\. It provides information about the detector model and the event that triggered the action\. The following example message event is based on the definitions in the AWS IoT Events [simple step\-by\-step example](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-simple-example.html)\. -**Example Example AWS IoT Events message event** +**Example AWS IoT Events message event** ``` diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 30e4d0bd..6c4dda1a 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -8,7 +8,7 @@ When the batch job starts, Amazon S3 invokes the Lambda function [synchronously] The following example shows the event that Amazon S3 sends to the Lambda function for an object that is named **customerImage1\.jpg** in the **awsexamplebucket** bucket\. -**Example Example Amazon S3 batch request event** +**Example Amazon S3 batch request event** ``` { diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md new file mode 100644 index 00000000..d1085314 --- /dev/null +++ b/doc_source/services-xray.md @@ -0,0 +1,112 @@ +# Using AWS Lambda with AWS X\-Ray + +You can use AWS X\-Ray to visualize the components of your application, identify performance bottlenecks, and troubleshoot requests that resulted in an error\. Your Lambda functions send trace data to X\-Ray, and X\-Ray processes the data to generate a service map and searchable trace summaries\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. + +To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. + +**To enable active tracing** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **AWS X\-Ray**, choose **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. + +Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. + +In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. + +The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +**Important** +In Lambda, you can use the X\-Ray SDK to extend the `Invocation` subsegment with additional subsegments for downstream calls, annotations, and metadata\. You can't access the function segment directly or record work done outside of the handler invocation scope\. + +See the following topics for a language\-specific introduction to tracing in Lambda: ++ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) ++ [Instrumenting Python code in AWS Lambda](python-tracing.md) ++ [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) ++ [Instrumenting Java code in AWS Lambda](java-tracing.md) ++ [Instrumenting Go code in AWS Lambda](golang-tracing.md) ++ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) + +For a full list of services that support active instrumentation, see [Supported AWS services](https://docs.aws.amazon.com/xray/latest/devguide/xray-usage.html#xray-usage-codechanges) in the AWS X\-Ray Developer Guide\. + +**Topics** ++ [Execution role permissions](#services-xray-permissions) ++ [The AWS X\-Ray daemon](#services-xray-daemon) ++ [Enabling active tracing with the Lambda API](#services-xray-api) ++ [Enabling active tracing with AWS CloudFormation](#services-xray-cloudformation) + +## Execution role permissions + +Lambda needs the following permissions to send trace data to X\-Ray\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. ++ [xray:PutTraceSegments](https://docs.aws.amazon.com/xray/latest/api/API_PutTraceSegments.html) ++ [xray:PutTelemetryRecords](https://docs.aws.amazon.com/xray/latest/api/API_PutTelemetryRecords.html) + +These permissions are included in the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home?#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) managed policy\. + +## The AWS X\-Ray daemon + +Instead of sending trace data directly to the X\-Ray API, the X\-Ray SDK uses a daemon process\. The AWS X\-Ray daemon is an application that runs in the Lambda environment and listens for UDP traffic that contains segments and subsegments\. It buffers incoming data and writes it to X\-Ray in batches, reducing the processing and memory overhead required to trace invocations\. + +The Lambda runtime allows the daemon to up to 3 percent of your function's configured memory or 16 MB, whichever is greater\. If your function runs out of memory during invocation, the runtime terminates the daemon process first to free up memory\. + +For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html) in the X\-Ray Developer Guide\. + +## Enabling active tracing with the Lambda API + +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example AWS CLI command enables active tracing on a function named my\-function\. + +``` +$ aws lambda update-function-configuration --function-name my-function \ +--tracing-config Mode=Active +``` + +Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. + +## Enabling active tracing with AWS CloudFormation + +To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. + +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Lambda::Function + Properties: + TracingConfig: + Mode: Active + ... +``` + +For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. + +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** + +``` +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Tracing: Active + ... +``` \ No newline at end of file diff --git a/doc_source/using-x-ray.md b/doc_source/using-x-ray.md deleted file mode 100644 index 9d386621..00000000 --- a/doc_source/using-x-ray.md +++ /dev/null @@ -1,40 +0,0 @@ -# Tracing Lambda\-based applications with AWS X\-Ray - -AWS X\-Ray is an AWS service that allows you to detect, analyze, and optimize performance issues with your AWS Lambda applications\. X\-Ray collects metadata from the Lambda service and any upstream or downstream services that make up your application\. X\-Ray uses this metadata to generate a detailed service graph that illustrates performance bottlenecks, latency spikes, and other issues that impact the performance of your Lambda application\. - -After using the [Lambda on the AWS X\-Ray service map ](#lambda-service-map)to identify a problematic resource or component, you can zoom in and view a visual representation of the request\. This visual representation covers the time from when an event source triggers a Lambda function until the function execution has completed\. X\-Ray provides you with a breakdown of your function's operations, such as information regarding downstream calls your Lambda function made to other services\. In addition, X\-Ray integration with Lambda provides you with visibility into the AWS Lambda service overhead\. It does so by displaying specifics such as your request's dwell time and number of invocations\. - -**Note** -Only services that currently integrate with X\-Ray show as standalone traces, outside of your Lambda trace\. For a list of services that currently support X\-Ray, see [Integrating AWS X\-Ray with other AWS services](https://docs.aws.amazon.com/xray/latest/devguide/xray-services.html)\. - -## Lambda on the AWS X\-Ray service map - -X\-Ray displays three types of nodes on the service map for requests served by Lambda: -+ **Lambda service \(AWS::Lambda\)** – This type of node represents the time the request spent in the Lambda service\. Timing starts when Lambda first receives the request and ends when the request leaves the Lambda service\. -+ **Lambda function \(AWS::Lambda::Function\)** – This type of node represents the Lambda function's execution time\. -+ **Downstream service calls** – In this type, each downstream service call from within the Lambda function is represented by a separate node\. - -In the diagram following, the nodes represent \(from left to right\): The Lambda service, the user function, and a downstream call to Amazon S3: - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Tracing-S3.png) - -For more information, see [Viewing the service map](https://docs.aws.amazon.com/xray/latest/devguide/xray-console.html)\. - -## Lambda as an AWS X\-Ray trace - -From the service map, you can zoom in to see a trace view of your Lambda function\. The trace will display in\-depth information regarding your function invocations, represented as segments and subsegments: -+ **Lambda service segment** – This segment represents different information depending on the event source used to invoke the function: - + **Synchronous and stream event sources** – The service segment measures the time from when the Lambda service receives the request/event and ends when the request leaves the Lambda service \(after the final invocation for the request is completed\)\. - + **Asynchronous** – The service segment represents the response time, that is, the time it took the Lambda service to return a 202 response to the client\. - - The Lambda service segment can include two types of subsegments: - + **Dwell time \(asynchronous invocations only\)** – Represents the time the function spends in the Lambda service before being invoked\. This subsegment starts when the Lambda service receives the request/event and ends when the Lambda function is invoked for the first time\. - + **Attempt** – Represents a single invocation attempt, including any overhead introduced by the Lambda service\. Examples of overhead are time spent initializing the function's code and function execution time\. -+ **Lambda function segment** – Represents execution time for the function for a given invocation attempt\. It starts when the function handler starts executing and ends when the function terminates\. This segment can include three types of subsegments: - + **Initialization** – The time spent running the `initialization` code of the function, defined as the code outside the Lambda function handler or static initializers\. - + **Downstream calls** – Calls made to other AWS services or downstream HTTP requests from the Lambda function's code\. - + **Custom subsegments** – Custom subsegments that you can add to the Lambda function segment by using the X\-Ray SDK\. - -The Lambda function segment is generated by the Lambda service on behalf of the customer\. It overwrites any segment created in the Lambda function code, including segments generated by the X\-Ray SDK to capture requests via middleware\. If a segment is created in Lambda function code, it is implemented as a facade segment\. The facade segment only allows custom subsegments to be added to and deleted from it; all other segment operations are treated as no\-ops\. - -For each traced invocation, Lambda emits the Lambda service segment and all of its subsegments\. This segment and its subsegments are emitted regardless of the runtime you use\. \ No newline at end of file diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md index 03e536f7..a3d20878 100644 --- a/doc_source/with-cloudtrail.md +++ b/doc_source/with-cloudtrail.md @@ -77,8 +77,9 @@ In this scenario, CloudTrail writes access logs to your S3 bucket\. As for AWS L } ``` -For detailed information about how to configure Amazon S3 as the event source, see [Using AWS Lambda with Amazon S3 events](with-s3.md)\. +For detailed information about how to configure Amazon S3 as the event source, see [Using AWS Lambda with Amazon S3](with-s3.md)\. **Topics** ++ [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) \ No newline at end of file diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md index c95f96eb..79f8d825 100644 --- a/doc_source/with-ddb-create-package.md +++ b/doc_source/with-ddb-create-package.md @@ -167,4 +167,4 @@ func handleRequest(ctx context.Context, e events.DynamoDBEvent) { } ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 3fa752b7..c2b30994 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -139,6 +139,9 @@ Lambda supports the following options for DynamoDB event sources\. + **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. + **Enabled** – Disable the event source to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. +**Note** +DynamoDB charges for read requests that Lambda makes to get records from the stream\. For pricing details, see [Amazon DynamoDB pricing](https://aws.amazon.com/dynamodb/pricing)\. + To manage the event source configuration later, choose the trigger in the designer\. ## Event source mapping APIs diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index c601ce47..284866e4 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -149,6 +149,9 @@ Lambda supports the following options for Kinesis event sources\. + **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. + **Enabled** – Disable the event source to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. +**Note** +Kinesis charges for each shard and, for enhanced fan\-out, data read from the stream\. For pricing details, see [Amazon Kinesis pricing](https://aws.amazon.com/kinesis/data-streams/pricing)\. + To manage the event source configuration later, choose the trigger in the designer\. ## Event source mapping API @@ -273,7 +276,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. The following example shows an invocation record for a Kinesis stream\. -**Example Invocation Record** +**Example invocation Record** ``` { diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index 55ba6ea4..be8400dc 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -1,4 +1,4 @@ -# Using AWS Lambda with Amazon S3 events +# Using AWS Lambda with Amazon S3 You can use Lambda to process [event notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) from Amazon Simple Storage Service\. Amazon S3 can send an event to a Lambda function when an object is created or deleted\. You configure notification settings on a bucket, and grant Amazon S3 permission to invoke a function on the function's resource\-based permissions policy\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index aea99361..0f1e845e 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -132,6 +132,9 @@ Lambda supports the following options for Amazon SQS event sources\. + **Batch size** – The number of items to read from the queue in each batch, up to 10\. The event might contain fewer items if the batch that Lambda read from the queue had fewer items\. + **Enabled** – Disable the event source to stop processing items\. +**Note** +Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon Simple Queue Service pricing](https://aws.amazon.com/sqs/pricing)\. + To manage the event source configuration later, choose the trigger in the designer\. Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. From ce57953f23174641df6bb7f84e23fa7f1d0ecd74 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Wed, 3 Jun 2020 22:01:39 -0700 Subject: [PATCH 009/243] list manager sample --- .../images/listmanager-servicemap.png | Bin 48252 -> 121777 bytes .../images/sample-listmanager.png | Bin 53861 -> 124812 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sample-apps/list-manager/images/listmanager-servicemap.png b/sample-apps/list-manager/images/listmanager-servicemap.png index 34dff816083ceca4bcf65959a23a3bfd446ce078..d48349e6c54aae8194bdd68981dd1a7673779e12 100644 GIT binary patch literal 121777 zcmZ6y1ymeCw=GNz4-h1{5AMM|I0TpA65QRL;O_3hAxLnC;O-Kf;O_2!<-7O3_wK*e zKtfGVPj}VnbN1PLSBRX9*n4;!cqk~S_Y&g53Q$mQsi2@2;QtJXs5%HZI+$47K^2z|i-RFV2QVaT zXs>T)YU5yPZ3Tq}M@$OF;s1>bS=+eUnHrloK$Rj7bAeH$|BTuh>i#>F$idXo5Q_B% z84kPy_wOA=Ya<6|T{}Z4Et{8rha>#wH^ceK+tgt~h1JNTc&gsd$s4XqrYu7?xb!5H+v!<0-NEDWKFjwdOgpopL( zgawpb(hrxN9W-}RcJ5Bf@Z^Kv`Sf$fh!1nZkWmj+Z4njL{aId|TI8K#=3YBY=jAqD zSf0{tDm!-4sKYbRsG|LnL&-$JxFaR}TA2KkToK;!GXLjE$UDZI5~%a1bVV45O_yRk z{MQ@j)f-nb5qb2t0x19IMILndi@Sup8vg$o^A92u{D1#0c>6&C)|cpiUW{bH(SrZ? z4E|IC{^?pxhS@mPac$li~0=>L6|6pPQ{5Q%%3WqGtfz5jDPZv|ZJ zdR}vVrjdxnwV?^kSsIJ{->3W3^IE<46AT8CMC@i$R<_{({_X-*D>%w>Z`oIxHw*Ir z|F_z(1iRn+_%dp$G=e%*+Y~!NkBFHDD{zRyq#Kr6uLBC)K|KIb< zC?fSUI>$0EEzDD;VQEz=%Q*Nmr8p6KHv>#>Tj1-rn8GMwKO=?P+Qhyr4mWG({*X3?-l2p*AND+h76r_5Wdkw2~5ubpyNzjbZsO@97b+$FwI}1?t^Z$)9-IXbF!6-$Hj3FaqyYkm?gH~8j)|y z$7qV%>alTsfc*DdcGeI}OzON5a(0)B7m*r>&Z%n;@U*08oOTY-J)z9ZMt1(~_eCMb zO1glnHhJA2&%zBsxfR<_JxDaa?Rh*qahj6y?Iw``r??!_2iSMmSIt;woE18%tO|ct zefiOU7qNbu-VK>Z8;BY+kZ>cbR{SziQaJM&O#rqz8ZXDTD59G8eR`v^Sba62^?0Aj z?+AhXd=^s+2Zi*GP-*K9qhBbw)!+;hMXW_+7{p}4a!6}%x8N(V!RtD5{j%8<$81Bv zoB7xWvwAjI&G@&~muy<5Bs=$42~<5rJ+KJ>{TwGx5`;wyDx;?canIRbar8COPaY5m zCmOO)zYjP|QG#G9B*se`4I>V#zk!Z;{xPoWO;-S%=_i-Ybqb1RetXY^?!m*RQGL!YCz&@e$s$ za zlFOW41dfwL_`j2U4$jjy>@i5V~C!2K{k>k-_Azq4zPtUr^Q zoT1)%Awtt1Dj`xBshI`qP5If<8=+Y}(zfP+Co?-swKZT%&0aNzGi_ySyd$ChAF;qY7Gtu9$ zZy?-DFj1U;*~3vb9tqohmr5i&8SU&pmWEVWfAw~`{MDry9T{9>i(Er`=w?pQbNdPM zJC0e$m}QkH+sb-4=W)qcrpO2p8r7_7l(13s+J*ngi&)HMf}uWmn>Kx%US3wrTIGD_ zdQ)n#@;#}CcaW3~a>xE#1Djhdyd#dW@}GST z{rhlVWGSV8JPL>hxkNZBeNThwN!6+SN(?uGQp|||ogK*v0qBxm_cusv0PQ^zvPcxbPXn%t#g%-5AZt-wSli9!&|kN&ND zr~AM2eFn#CdOSW%q%5?cv7TsWbZ<(Zuf{EHkM-};Rs_TUy?Cz2Q!4jIR2>y5{{AQQ zh(8sGh)?VgY}Y68?ZgE>?M~xt7bKn;_4JxL{;}`p9y~E~{?&TNh*S~B$vk)~dS@RG z*%WSO5paQEy5ZhU6yKN->_gb;GyZ&;t>SX`su^lxc$V|AR6#m>xLkiVQx#Q3IgXn;G3wsQ8=9AV`iyJrW>!pS(t~@cwJP{u#bUgq23&$tELdy^3Xc2j z7E~3j-&<-4krK|B(0D;3GK^@dRDyF=KU^^ ztM58%(WZHij?FZ%#&?y6Fz`tu)$I0{6>`QXLFjtboy<&_QX#t7zq|MbGOzRl_6pY> zUss!a30N|_dAAb9FS%L^Z@5<+V^(L5H$AN1ke9`%g#9_yo1m6b7pjp&^QSVMK3PvS z_v!u42G*`&+S}0L9v#Izn7G5FtAzQ-S92y42i00~Jw$y{GLREM6-`A(8$k(7_( zI2*>BGMHi4czomAZ|-o4zoermU9|3eB5?DYJ^69iae^geR0}U}|5L2}2jY>apm~v= z&o-@#Ot~Y}j5qT;zqTk;87&~c@GRM8>gYU%_jWihYE|hik@!hv2W!Zled z$qnPX(E{fx(eS%&mykEFc3 zJ-~U?dfP&l_bXM;<9rLdI1`0%Gp#@a1FL1>-J*W`YjkZowIT3;pdH1M2TYx8Zv=XJ zEc}Y%8)Nk5d0@?C(EKin$b^|`LoBkrZ-WUw1&Y~Q{856~aNE2-NSsxzVq(0Qydc|r z9d?|XcHye@lpOcf8BEK8Z2(P}>FZmDKJ8U#UdqE)ykqD~N>SX#VO>pXg2R z5FG5RJ5QeA^kST%DEWFPQS|+-?U178ENoA$YYI*LEiue$HyRxY^%nTez<*XN|p3Ul^%KR6QGcsj)gLOAXf&zbTcBbB@cILq$!%POC<_2NZOXBqefi|7?5c^;j z8ex?`)j?`?){Enz3Mh{|#VtLLJ&zS4&3V60-?p?kyW*Z`tq6E|Kzp;DyoX=^l&h6U zBpeUYkoAGYb#3M*2&a!3F;#gUiFqmt847}-WNx`H^f&c3r58Lw+@lj5(}Bx)V}qrx zrGu%G6D+D%k}h`dworJ>U)}R|IdHk{Ib2VyHHZ$`V5*35odvxvB4f1;#6p#>?8deH z_u4N@b_}dEbSJyInn2Z;yfLc?LKol^{)~jGVBl*Poz3%6{npn@^ic+ymlV+j53wl- z`;-ejjV4NFu_JJsy#+BJ;siyd;F(K9AX-_ShBF~)#=b$PcIkrecK$lOM5=e9WRd%pewwOZj75D`F=qZLc!(c$BsoRz-ZojHp(ES)jnt$9n% zbicPuxNQX@$d3>)IW zA7!M=F0Zxq-YZX*I!)@wR;H~7vxmP!3n9ma>s3XSs_f>`<7d<9mu+`Xel-UB=1)74 zn-~CCV@xB&6gi==LOrA&ux{+tHY5wJ)Oke*)@xa^FOf~p z%85qG=YI1QG2g;7h83kGs&Y=NF9@rPo!G(GfJs6f`tkI-U<9q}`S7p}5-a zJwCkCpuQlBlM$1`2c`d8(-5pL#@C5dXCSvNU_Si=3bPc55rg z_40zW{}3s+rhuj<6wNLU4}3<;&izj=pOX5(7CUAgbhQihXr2w?*##;y~)4$U}ae3=5R6RkZ+Uc>uf zCqmkkn!W>&Tvv}rOhKPf%ZV_-^V{s5FQb;fK}rUl*sbR>Jr1p)tzo1iFyonV%Y;?Hr{lnc>0NrI1jBBk6ol`Z|D>7l_MR9h_`&5oUi^3OjxFcN| zMe_3L$zA8A^XL=?%w1-ER-vR+gEZ4~mmfj71eFkq!(;T|i3!>idv6^CS*_e1w}hVMi#E^}6A z4)eLd5t5fqb6EKVUmM#2Hdv<|t<2N6CRiq0O0skmplRZm8!cKDk+Hy$-J$!jr2Sc2 z6WVkZf~e>sto zE6TEj{#Ms4xhA?3VBq%e;(f04*Q^uU4S^5|+R-A=V~PVMe}2);H??jGbcnG-o^+eN`PD4Bv7E(*5G>LMJ~~)m zo31>6bfm1XBNe2L%jOhs&;GeM+5z;T{d8BBOtTHpI)MTggG&*Zh!BIRU~pZNneE!( z_l|k6_zTtAiax>d#astUqZ;<(9iey7Qo59Z>pB%7sy>=v-O)l{l=n3*5+2`ZZ{Z)A zFZjrMGG*Lv4=ng0M|C~Eb1am|McAr$hk9LnjM3?usuJ_sapRHrj-YfRU(`|I0+ z&>Vk@XS)ve+k@Qp?7H@pdYRTS9eS5I4nNj~e7Gr1K>2X1N7~iZXVQx?P$z`;>?P2S zl;$jHi?}g?GRsyYcs{*@8?pvGWIe<9O-4Vmc5J zndD@79Ii*Gp!5_$Fn(6==zln1s-`T9^|Lf?of~F42b`))?)N(*8bNMBEr;Q z3cJ3MusMqVfJ5HF>yz{sf8C0IE9Fw{K|0%a$jiY?p2DB?^7Z+kjnFpd0F|Hj;e$8V z&Cu>N$v1QYO;BW>$|#CWxut(@;6Q~jm#8MnOS{^wp<()@)C8vK_JH^S>AANfk~#gb zO$q>vAnvg<%?|i4Xd<#$0w^RqF^h}HZg>{fe7;>f=(&_uAFRW5EstLdehJps!UW6< z&cC1!*FpOAuy0$A==_VNH8j?LNdia67U7-mkB~ywB`VhW(ZT$%2AkqY{N@{3C)S&M zuKeWvO+6j~LhjV4zX*4^3PD6XC6b=fEuKbbTDhLXSxj;KC0=)x2$WX+bt8Xew_9XN zI|QX4O!-XbFu@m^_U_qNf|k+Sb91LfrP)tej2)Eg$N8m-Q}0pFj4ie5tOlQTW%9D` zj}3@zd)xIs@U!Aem@Z%zDB>++$y2oho#wjG-u z-#?r2uy;Zj?($weAuwUyzH+bZA5?U3w(JJWCpN>o&}U6=xwS8ji7_DJQE_i*;U-x# z1po7$>6VB7tbI}RZIKtUMg?A|lSC(r?T`AHcFuc*6~5|_zz*fu@JbKMS?0&S0P89? z=U0{Y6zu5@aT4a)5T+nPrS@K(;TIgkkUIwsH*gXLex64paH3xPQ_+8SM_>=`Zu-4u z&)$t3R+flFd=gBYpI3_&CaIqvB2whva~HV&iJugr#=2Htu*-dd?0Mh2yl&gYAmy>e zfmt-c-zxyiRhm3)l4P%_ZS_&MLSrDm30fwj87l#YIyQ_le5{)g-ma}4PAz1e0bao6 zbFLSAd($m8i2OLhq=9-GZ6b4=^7S*u*)4hl{WUv0FNzbLmC=rC<_UU<D z`8SWM2`4sif}KLZQ`t*UOc4MY45w^t&{n1J^1C^kB|yEQE1Wx93p(VO7#4?xh=?+g zDOO%%thl&QHA>uz$r=zuLpp}@JOCu{%zU*EQ=yQeiM~edPcacZHn8<PzixhiNTg2<8o-*bou7#fjqS!8y=If+9uMb7M~Ue0 zH{EdgBZ5?y1v>VPh!k1H7|q-MJ|*-3IdP-Xo};H22!@%X!K&Jo8GZ$N#g9JL-)*ys z;As^7YR9xq#i$^atllL0FsIa>=4n|7`V6JQkJXjmI5DmT&mNv%fzG)_sV4QVnE9?q zmk?%Aw)$#Npeg;y!*iP%ox&(LmgEUe1I52@nKS@BLdf#6Sq$`u@#Nd0g&|-21)l13 z&Sn?0>;~4vkOHD(qUGeEgNpBFbZig*O0+%ot#03iLRdZ^4R0VSe?hfx9AE6uf2ILB zjU;DeLi)l6MvbZ1pf9k{^e6350}p}v!a~dzf4Hz5RGG4nhXt+M)9ou!D<^Vu75X*5 zD87xQ9`%o-W$=;_&Wf?gegb9ri}SKma=6TK!u{KPo3(o^VvKNT>pMa8#(^b}eDeCIjZ z$Wk;z&7yu)hMV30>A1J-@#5w6koOaxd6+&aS59XhlU!!}*!Q}r>FauwSfQe?`|c-{ zuu*>j7XW$_TA2z+PdZAX{oGLq;`^x6ljrl7)*~x3N_4@BKW9(Yo(b%2m#@ucZYvr@ zE`Hv*3^~=EER3a>sF|?FRn3ii(n$0Z_oROw634{6FPBSypSqyv4Z zYItAb&f95vZ+&^yb9i8CN1~2m#aVpKh6^r0(BtA~h3NBDT71`jdZUMCdseF@MKW{l zW#!2L@lqQ5u0H5i`HGeWc1#HKB^r5je)$IMVeIypF-8poXu@Vp%vrhD;(o>~Dfeg7Fxwk2}-*csP{e>%xH z7dUj1Pe~jmtZ1P+dNJ5rNJ-V-b@I}cp&}6r8z^|l?~-oWd|m0*qc^D#*SE}1K@%5n zVO*{6{GKL>-rz3wPPf>e#4I5d2qWr&%?(S=@6-}Sd?=+%0ZsOx-X|)rM1d*0(BC4* z=s&erP?8g#)q3^k215brvGC9tz)dsbXM$IM{NS+6<6=}1MJp!F)0yE&3x5b}9%+S(M)A`GzBL_E+0TzL&#O9Ro)@eoBk&WT-W z0*A@fh5oO#sqVt)`ViLr7)cg~sK0RDj`cvpqLQUI7~cS(leyCvGn3^g(p(e!I2-76 zmssvfW|Z{(xutnN(pgr8*5B3*MQMhHR4ZMG`(!h=*0=6ql{pH)kuJIK0Y9+(S+X14 z_>KAa!8h+k34qtXeqq|W7PC%t^~<5G=Q;LnA3RqGMYx!+aiz(~_(NWn`CvG{s~YoF zTG@g+!tV(0ki+ksNcOV}Enuk6Jd+>8_V{2B|P*d+yMUM6YNhp=A%wk;^%_iZdf6uWrd$<6Mx zI_T!b#czcKDwlqsDEkq>0191d5%ExWU(A-FvXZG(y)wD{*xcj(t{kp@YOki{_K*wF zjrRcwp9~#d+F|A=xEPq^ABf5157f}q%#8`QG+zVaT;1vQq zeWKLTzkhg_(=O+aL1Azq_LYIjyH^VI_jhTz?VHoJ3;%V)*RaGr|HRC+6<>0kiv~wG z3pgjG9}lhOIX>w!b}b<$v^*HO%x~bIqX`T7C-ph~DL}Gmc%vQtPqoFN;^O@XkaXsWo9X*fD8QKQY|5AqX}9iLnv=%DVSAGCl*2+jF>%1P>GCD5Q#MPgrG zPoS2Vk`g~A1+)dpCet%t&iId*r+al;4h~LYkB?lniJ*fS2$L)vnwQ;>Gw=?AotXMG z*%KxEk_mJ)ARulXN^t}Jnx^50Ywn#;&8r<(!3tx zYxq5Ar+UoE6QZPfa%mxB!=yS#6b}4a%S@co)wWK`%i`ge=MT3N+N zxKagUAr{ay@bIL3D&3y=TS&%9M{gzk)4y;93URL1EE>ad>TuSu zYlcebpYapy?Fyuq@M_+etU)T+&dYz%8$1@GgM^Y>pYv5@qiXfD-Gt`ssLbyJ_?)Gy zxUaBTVnWaR^XLnt?eK6u%4IzT_3H?CHuoap#7l%C@-`fJH@ssDxTj3}&id24Okxcw zM}Nl|U+$-z?=1QV(0gC|CSV> zpWE#$ub`ep0y75J;Gsc^9@Kfs4;ku`r7ME%?r;C#^HT8;AoFFN)RAY$LIBtg&GGob zxf{_Qb@PO~C|ffo{IJ~k@|1a^-S?3o0wNI}8L6P5A!%+-qo$??z(z|)Wek^c#s|f> zh3*YYR(y9BFigrc8OyvLb)Lx9ZD;U+ahTs?mXNHiHoZ_zq)QE&;P7&(a(Tupp&p!b zKcyVAP!$odauPPH$EFnze_C|)(+>ZDf?r1lzgms;*dVF)>K?3zF3ft5i^kkCNej?jImS*ghRd#DBc*8W~R0iX1?nPrv}|H;Cd& zKpsa39nnfv1n=GjoZ7$R`A0));2_JzX!bkP=zM(DgMO0{nuK-L%rWN`sFVH@Z~e9H zbB_GmU|*u8MWFz6A#Ipr9~cRo2OmO-?`;IzgjlR zebb(`<4_T8(316vJ!{J4$4G=H0VKIGi=ThD?xy5D5f)<3p95?h96cMG=(;+#$*HM< z!9fyMR*WM$%=ei-N%HM!SQ&8tmJLvpX@R{T+n(>k(s}GN=@y-;_4Z!dRWnOeQdD}J zd3c?N-OM-M5aDKNGaobQ>Cv`aPgXykp1cI)_Kig+WdwY|cpj%2Me+NRPXYP>RPdUa*Y60WuPnI`sT3f2s=wC~d6#j70?tNhCbj&R-q{z%H8QQzto0

DgP)$2KeWEG^E@ z5_(9hKfO{~8ZJROUGn>Cz22O_uy)xv?|6mfR-4E^lofSb>qi7TH3pWDSWTd91&<~+ zmr_t@=kDs|S!`w1Gm}^%NR$lC%p&`F(sZ^|y|bke_jYi>@$cFCL^7lKj7u}U-EC{T z{!95&y16roLa{u3*82GODV9r^yD)xr5wo}D5=uT_V&&x8Y~-zK)hG5G>a|K&8b@3( zFP$GQG6XtZ`da>s5js4;@UARpZU}b-KqUIB9s>{_&R)lb)U`T3;O;bOe6!nd2We%y zZ!d))GV$O8RA_~Ed_G!E;~$1&rn?IVk44@~f1(%Fy9$Cb)-TEC4K zum3gjY^7?V3VOFef%`LDO5#95)}geyc;L&5`u_bDL_#oMVfnh@!X3?$6gFyKPX}!! zI|*3S6lf=~saxId^y*GHf3G|RQ6N$&QDgi}Vp#8z<=g2R(MVC`44YHc=r)Uogp|$! zs+Fn+(OI5G z2@DtkfNBNf8O7}^Fh_i zc4BBZ<>*<_>OnWik2aajMd@Zim78St>nyy z7voQMP(fn>+PM#%B?xY<1g(5H2)TTX52M(sy5zX*dzCpdvVJ@vXoc2qkYAoJ$IJe7~*`Z3nohcedOLiV_R{soe1J`(Cc9s`#+xz?p>kXu>-WtDYHip`OR$Vq?>|kOT{U#{whBg_U850L zrnb4ki49v)8Ex=KXm1^|Bq}AKrKN>32X<$uo zp&_!JuYcm0QXKP9VHxw#1jOiY-}?vHK>;A;4B=IV_SGoHM~^sD>ujFLwhZm4AjKF- z8+lq8c=N;hGPd$4i35(bBaby()0&Nf2EK%GmG$x_eLMHakz+=kWnW{Itat*Oj?&Jj ztyj@O8%VV15C|jzCqg-B^jimQN0}s135z;Qn@ptDg5+{eg}fg8Nsy;EW&bZ{bl~YD z>y#9N*Ky!i6fX$H#msSabw&U9F*ZKle}?Os(I`$-Hhe`m%Ka3fRkpKZ&#v12Mfcq9 zlUlPK6XUG^$yNmJ?Hd0h4Qo);#o&c(?nIGVy&E?74S~T;TNkZP3si>HW8=}qj#6ww z%xLq8r?8_d_P{{gD&?uNP^P?KXt;WQZ^26!ijrT)XCtHSkqPE1T5sYaIdsF$tf4B8 z3#JLLA9A~O`b!+6WqohR5yh?iiJYOa*q^=X$2Y7x`ZFG6dj9mp>Gf|AVZ}`^?I4r<8luv6yaR{XZvj?l>}-<+a)dc4WXXwi0;SH;!cy$rAw-~S@CpY zXxZOk?0>`NTmw!Uxh8u6tqKUGKKpk=sxhqW3uJJ}rhvB1WKbPo81)|PyK)z=C6_1Y zB})J@-U1-!(PX?~j=$aV=VfuZf0uN8|M+*&Iy%*&{qCtG^b;s3F5XigGu5kKSI-M8i{kvF zR3FmnY>qn(w?_%uE4369NC0`UdE#}+2AZ{vTFflC1CjIKv4Gdf(_9Xz{Eq~R#Y%B} zoqMyN^;-Vw}zNJ+rSFj$hw(K$STF56;jp`eQ&=r9<>;ek{+PgcBu(Y zOfip~;_Px^%cIGWU0OvWCE^@ay%k9I1#9sS4W~>Lu>g7Rt&lDfl_0%3 zJ?ol^pm@muca(bmU*v21M?G#G>QN#5-Z5`4&i-H4@t4U4v~EnXf(`t!keH+-=W4>9 zR$$H?<|38Jf{{(;&jU1AVp+5JmvCbl$1O|D6x&KRWd@z$)#qJHzB>;J9oH*YkfjlJ z##RCJnky}xD2~=gjt-7!8 zJJ)*OxpPRPvn|nFVp*r*3iP@N^ktBW`gRa~|NL#~LaJu9j90_wf#AxveuAhz@-?=# zzc@>PAaQDH>h8%&VNp>qC|wLv^G!3q{(RR#0*YeyF6p94d0B24zPp)foee?2yGB(h zayGu&)EC>vNKcqZ`S`3LQRe6Nok7E}xyl15Ldz9VHCuu10Q#~Eqpv`>0vY|bwV1$wVjZmcf+K)Z5EOJ= zifJC+Q8WRpvt&dt6x9U`(L(qvGw-7PP$vzpU&liP1yamaxNT`%Rl8g~*U#NggI;5? zaM7y&TLAAHTsbH#RxVmDw0|~aF!d*8oSg&Jm@ZoZg()#+?MKG3kV=C!O*YS_j1i4K z<@@BASSc%IE`*)0)t<8NgCa8w27Ea;2)KbpL^H-eQnB(7UA@ClsXKBGW*$30ca;)# z(o&JPpjupNtbutBi{Y>#D=Uhfbz9WM_Mj$7LnuBDC#D*Xe)-<%vdxv!^B*L&Z8z?BBw!S=yP#c_62 zHeRSYA@bS;-a%9Ujx>xd3=i7-rJzSul!0UHox9&hX*A9p<9 z!l)1cu~8wN^S-?@ELK2~eNb=_!@^03IcdG$_KShQ1^_zVmI`IGXAtjCQ2c?CI@7Wc zY+7Y+DYSvX()ZJ=yi=D}j|Nv!`<&;cOYxAoDwhvn6WHuTv84E zG4O&`9vQo1H}`jC-bew08`p4+tmuvQ2K^bjeZq??yU2E3F1Z{mIPd9`!q(Pw9k}qn zfA%Rar-z1yE~=;~Y-vfqyu4hDWZrcAi~Mf9ghj`s0Z(Q`Wzpp%SN81TaTR6-A>`k>huD_{jO6gnpPz{YD-q8RF0{*9BLzdc2Zt`9i$4XsL4Bg9br z`CV?KJ59QZSjRVTIx#P0jihymxW%v)3zt?tVY{q%OFp{4yZcg18W(b;nKL2JHS|NCAVr3Be$7%UNataGmD z=wJIiJ;O?$?cP6a^MyrQ?p*{XO*Uy^40u_FpEii)Pv6tJSa=NKxw7FSY{oS=Or~Id?M# z1!Gt@9MyxNsx3BbeKP55c25}8#tFiCUUAA%BF5c&H-C|Cg~gfP3b|w{F?86hc=HC%Q~7{S;MmSh zb@MhX+?g#;tJRiPVeaKMG9%YMgo^2TJ42~erjHp{S%3Us-uaaBhlX-p!&Gd5{V#R8 z$Ng66hUGZ^PY@y)u%!bDRj=&=ZGYBK&su7J+=Ru11*b-xPQC17hD?x5VRNHqO~<$2 z-x$BK;4tAtBukOgenenmV(RYgMI|JZ6%>3eAt5n$U zLHDgc0un&r;ukP2AEyR%h3IHX>0z=J ztf9tCH_@l#fzkuE)MSf61iGS4q7DfQsUL6s{8^w65or41r<9Q21@v~XiMGfn(86u@ z8TxPW_}U01(j@@T2@q~-!X0Gxdm?CuES4LQGi3VK-`SsVp|{tyg?Pe5eJU(TKToMg zzDk6IY)S5HT;0u8)*E#;m&WF;&%gg!+0%WROZejJeYe;AxH#rLwAk*EwaglHc1K`Y zG7l8W{wgUMO&p1WIWaEaC=BcP_U&xFhv#O=emI>IEqB7@&mTG8i9qEtLjbGu{5!Q* zfBz+NN5=b+M;UeXvoCdqUR`b^uy%;kW%Dha%Hk{WI*PODrUVB^osHd)DYWOvi37({ zo!0OPd5Wx~Io#{}SHPHol!XvB8mz{B=V{@8$~obgvXOx)FG;OzI7T{R)_x_Qy5elb9dEk?d2o}q$46t^G-J<}&j(o+R+qkvEsD*WjD&j0k2*(I3jZxbmd zI2Oj^2gx=1S)AS>U}};TS;Jb=OX2D-?w$@8yir8tZzmlhvzY>wNnr3<98x=B)mq@ zFv(WrH!x-a;vEYMFZDE8v6N z5HXcJ=4=W7=JP+Qt-ITFgv5`K`SMdLBMP@@oz_IG#)6N6VKZg#r`AS}kG2B$&&fHL(t5W8TUp)%OMmi1KPEIL1G~-U9F;Pyn)uA{nO_jD z84^L)*7YgSVV517@9e47IIP)NVWKXU0$I^9mU#Q)AaJ$n5%+F!U1GMyFYs;AS-_sa z$u=>roa_eZ+TH2Y%IMA$#Dm6be4fFcq4$qE-j9~CsHj#CDLr~dSD|EwbMDd7Y4vBA z-uGH8W`N=v*@&a#zTLdYQ2IIwVIwzM(q~9k5wZ0maKFaip1=AzFer{NWDo1_8xGxD zkeN!-VDR(Q1emiU9Wo17S%*~y*@AJoWV3-s7vQQNV58y2GNxK4YmlA0K+O>9TjEdx zR}XsuO=w`PYU=pdB-Yh3*yk9l9d<2G_yLyk@dp&xE~ht*MJYKLvCDPS88?!{ERT{D zqGrAgw!B3iIAanflF%G-yP&@dz|2$&>)|@9^5XUM1f(1VM)em;s^Rtn+YLQSpj5i0 z)3XOfX0}wQljoWiQ0#69T9XQJb`N*+u$UdSI-~l-R_{xJwhtX0BxQ6m9{XDNhxQ>v{VXAO(P<+S?Ghw#?~9DLvaD&p~axpi((boZStNRCZT zEqbq3Tm-GXzq7qx-ks(e#<9h8YT{U3>BpA!m5V;%HyPn3= z?LIqgH8}3Y#4%4bo!)0M>rsl@`@QFEU$emj_97%2C;=~d1V~r$VAH`rD+}0ZyB2A$ zmyayq(#d;HaRDTHfD`p5u{ft)6M-={PX15L&bj+-o-QFUh0Rd){Bw3RL)PHp^d$>F z<--Pz4b;&DVV&_l+MGQFMXh5w{&MQkV@VA$4yko?s5D%(0yRHbQOj1RZ}z~URHN2^ z^q2rC@QnW8{ish+YZ(RBRbxs*{21_WO+*MLR~bFNfNkj>_*)65XRE_U(yiK8^lGtN zE4B>Zq{8;1MNv_K_npF$J*`E8jTr7b6t1|S55#A0uHk0Iaz2*q=Z(`$g%tzy3E?O0 zP|NU`vh}-rd;Zw6iDBld?a|?si*)@+QPPs)BXeRKY%UL=^3)yANorcKuve(MeOP6} zqIBioO^HeDT)(rYq^tNl7oup~{w)7N_Xn*`oln!fsM8TIhj8x8FRv)Sg6~Kqm&E=D zbV-J|p+CMZsEwROPUQuVF>>qr#@f0i(1Z`_@k zBq0R#8CR_CXOdZsdfi3NOUfNFb&B07BxVk&OPjaPB)B9(0YFdqN z+VKoZShGrlFY3*dDCrBsPay?r2+@WqwO^Y}oxPg&(4Rm1T%|e7$*T?JSg2O7Dg%IfLW-S>+d9`kwwo!h}c>^PJUqI zM%(cS^zMJbj6&fp_-C@^&S@eOY(h zC#B2%8b8^889jZZ{&_&Zm+Y0ruv=JApYoYe+)b5)sUTQVJ86BeXy0^G&YY_Fhq4j* zN2+B!bSSCt5kn6t@>)+iJaYy`0uO3*m15$9R?ZRi-*tgq=`~-g%8eM*J`|gLO{%Ef z5wB~%gA_KIiT~=ZqJ3JjoJS9(5uhtlO=rtkkA(li^^G(j9`P4U*90Bbc>(BppC(Lpk2bP!%4P3fy)6dANw@AiN3BQg++F&!= z&4kF{S?J2LZMIwx{XSia8r~($CUdLRQf3(#9!^Y4da5W@y7N9gwc?TQ9_}4o8#EQC zKH7?$Hu9Cl3R{(T>eyw2*2gvyQFQ3tcD=gKMA00lOl8RS>HT3~=0-oPkh}Bq1S=sW z!F$pyF{yeyQy{|)zu9Sh2UeDDRPex=MoQiPdOeJqrcM+S76ww^`;HzjQ|IdC%`rkK zG8GcPBxfFT$TYEpV3k}yttxKkes&;}EFCqg29rn4_fJSV0lKg;_qv*dn*)Xl@{{x# zb?6Q)YjMSAm7Qzq@X0MnAMUzrZG{%nkmUHP14_T115>ppN^9>dNrWa^EzC$Xq3?!H zE69Udj9VTOML{6sy#HmAR1udu79>jNjQ=GdL}VG75bU z4AMxDvCeOv7;D8cI1hKvM(whHsU_lP46PMQ!HUgq?2Z=iEa>#im>#Ov zaTphWw@-0L<)SU|t?%oLwwVAE`d$XWk`#vdNFu^QIF(9bmCBRPp!VHAi&R&vcq!3K zsTGC;ZVpr!(W}0?DZG5o&8^=9NDe3CEYB`$Fgattfe+SgM9G)z-8;#Ib4s9$Xnu|S zMmmk|^PAm7OJl-9-+%J zDQ2jcxDm=xoS}q!mNwnaetv>bVW&`(rwm_R)lbd)487It&iN(Di({N9ca-AA>l4FT zDoq#;J;M#R8FbQbuA$IhBggE7j#X2OCrGHrs%cjTQlCXcv_l+qnx?O*QJ@$tkhV9@Bxr`nc`z;^YH0IDy200Z=WJ^} zKz&xdzgco}=;+SMYem+4K;K`kUa9&`94lCRm~c0hnZF<&KoV&RHATkJ9y{FgYW-25 zi|N0ML(v1m>ZX%oRb7`cslv?Y6Y_Lqqp0Fh>qA}p76ZzBu1v5Ml z;a1Zh0d7mWs_OSiSZgJiS4j7B?r`exwWn76NiBmNT^Pt(gEolf)rp@It4{;Q9F8Ly za*1>R-B5ESb;%f0+tdh@vq|K|fbNy8o4xjwPzgvqho2Ef6 zP9ub>naC0B>4HfQopWkW`#yJa2?y2jwn53K&nSbf7u@Uk9^GBKz;RE&H6C4okBH-kumC9HtJ}GhMb!J<+9w)BKN@WB!qM=l9K3%zJQr1!R zxeD}it$c2qDAqV+EJl`m8a?XURzX8qU_K_nIVsT4zL`q4`}nF>(Pg2bSyd812bjseWW zW>fF|uZIWSAc6C>ULVNss7sv}mtqQ3UIyP08^Bl8K!*ZACM%U!q4KIBCa~dKFt#pZ zF3J+IU;m*veDP(=z1_;%YS&ebeuCc4b&2Qbta;bn=kn#Pd>#+bDoC+do$8e|ca29T zCCT~eals?u+BIF)C)8G=>;T%5cT-oHUkz74G{k{kq(KbbNzz*&f&Fe>p5h?a8P<*6 zJpq)r_lKnu*S41yW}EZ!&iwKtyPeP^8?Ghopm~CR^4W89VcSW^FERy>sz3!Vnw=k8 z{kp2D(+QVVl@?aICUr_}zq!cww^vYRp`rZ<2a@K`=$e>ro)-%3UZFVir|_UZg>y%z zc058SKVsHnhFi7WRk%rfvSibY@^W~}XyUMEmANP@7uWg%b7Jq9*w&FGN#uymVkg>K0*xLK zI|tT665}ROjM^`_=cIaAL~&t}$2^e=sY=S~@^W_M0^P(#(?8_PM5?Cq)vNxVxZ?UfW#> z=R4(OW2XLlN6_mgc%Prn7ekpKW&KFejd#GY)!TNFXWu4`2K0*3GP0a7= zPN}}c+^5b^E()4GDFraRVrQtR%y|0vXG=@_{gSlJou2L8N5F-4)1c*aMpnI`Sx80( zkHBogj5~dFXE{eJDkPc+0wAJ(-j}fc2)`a72Lr(xJHl+*I@8@$y?>@922Dbd(Z58I z@%VFUiL^iQz|Y3zzI*~2>rt&_JQT?c>QGvg{XijWeWfk=h5C8^>~w$H(59rb=301n z&!PLnfA<`CO8=f6?Y2d8uc?2va`cbci2<}ZhX8LvtT@iVLl z1!-AOUwa|ivtsKjeKFkpYA^@QZ$g87;Xp0vFIn+bX>({_zuK zyS|8-p#$oTuwX&Vp(4xS9nP)D>JiXsI2KMVLyn$IvjFsbFwo+#?&M@@$LZZV}&AjB<3t)BJT za_Hp-#z6s(DVZzj5&^&J9Y+Foihwn1{a3`n!FFRIM2KMRDZSlV&=BfS)n3-psD$Smvrcc2qH$$;Zu34`I!#%S-BDg6Nl(txa+)bwSc5oN zR>*rUtw@%<#=D+AuyuJG_6k{%|ZSXGGy;{Bpz+0HN3Qts1gNEvVgvz zI8HWH>7vz$tOAJB#}+FL3nsAf62|&Dv;5G$ClBp=8Q#l<8{**ndE_S=L#9Drtsz^o zXrm5iYv`~1cYIEdUn7mdTDeXrq0<>5$6?)|6wbq<>5a*i%Jowlfx!L)iXqHFx#b(p zT;_wy793SwJ>X&L;(Iq2b~WFqS?ZMm*(@*mChp;aGk{;U#mID=IMpn}-a`;hTV_c; zAiiOe$5<9^EwMfRgtfM}koEHeDuC?l+nVAhJM{JWT7RCQNWjl$wDJaUKQsHcE+Qg5R?mmgUHP}evbO%$*1r;nsaWkqYs%xsG9ZkJDs{YcPM zBZH0xXPn>-Cs3;}zT*BQi6qX;aNBPU?BDL&c6GiWY>r+AD!02RVmn@}((GyoV?GSf z5372=eo^jlu=W*jDuv&uSR1*zp9O|zr4_CIxkq1hQ#}!NPZsmDlwzWjUZsz77`K`8bZp=Z`xQNg2h=Z+wvBG{zM?9M*lKu{^;;{B$guE`EIA`P< z_>j28XPbI3k%wTIwnBa96)F{P<#bh3bd>x-YIdk@((Ta-1ubS#hPW!2&JSz-+<&8T zX>{dyJ>+r35q$mXJ4tMk5HZuA9$$i z)xbcb57SX7Ko@1{L(j-#2?e@VIPM^!6lSE1+1#O4Mtiz`b54xgi)WoT=T)kuIS3Qw z;qT963YiWkZ&nHIu}?Z#*z1z=qQ^iZzM}Dj_Sc5vVYWdwVQHa&4-O1I(Dw}e&h%&E zTWUgXW{Cd7Q7wL!4)0Qj38Po5)|%`3&du)&*h6BR{DRid(`eQGiQIQB4w@DK zJ4qm(>^CQYx!fMZtu>*?0i#7*lOu509+LqV2f*W1?_2JSn=nd}js-ViU@@lmZ<|p4 zr!2FU${9Zwld;UGghxemmG7jr-xC&>G{q1LT=&32V?s2!p{S}ZT<`hVi_{R^k3Efz z<}aX`ArJ4L7TD!uXr-bK84jfj7d#4*@9W87ibfhc<6x)sM#M`0ULY<6TI@=f`RCuM z`6^a_A|?MLL3RsS!r8_0RsPG61oXZ}S`?n9dlReLu6$yJzhRtP{rI=LD36B^pMiP3 zXJnF=w(aD|{Q;vAjB1ByVLwV?4w5wl2t~#9%f%r@>YqBwl5`IWuLR&E%3met5L7GQ zfa6zRcLZZzlY4tffmp~&9X&z@0RHqz=l!KQ{kggFADBQCD9Fa^UBGr)XRU0QSNdcD3)rGK!cw1OsD?0w%r()q5=Lah zCwhyOSh6r9694{!~YRvMMO#^>(Y!2tNtIr*H3mD*$1 zDw7N`NDUfc0bnXj2idAjZ%^QrZhO3JN^|jljs!C|;)a3YU8!X7ggO zzQgyrSu$9&zCMx1(yNuh44FCyo_`gQ$I^^R?3=hyV^ zdD+;!gh>FeeK$6cD$02Hp;#sQH0}+UxbFEIyzJI1c_)hAy7M=32X3hNn+Eq~wHDBT5qPClW{7uY}3k$A!==E$`CwLkFN z7ehI>cHjEds%8uoPY`Bxs3RwatYgX8=>h?SIx{ubtw@cDjpY!#vu)*(WEf#2wp7lSZXG`3}{}!ig z2(s>iO|?F0i5E>P0<5`PRx@iw`41cH36s5;MI&NIrY*<6iwZP&Zf+J-1sczC>gCd5%cm1P~e@c>v{N;;0FjN@O<+Fsyf9~d^l9v;6F|`6H_qU_X(1BZz{OheAA9ejnVnfg3ExK z53b4rL?QpHq>Jcj5;0^vrI>G9L;I&7dfQvGZ~$sWaaspq5+_?mkWM?l2MOo?z)s0m zF04iz{A$`Hns);=hkv>f!w?~M6)$lEMx`G=Xpeh275 zNd6B0$wnR*7L(&NYrg$63TvtAReQg6YAuwNNP|d7WYAAIE({Mgpy{$Xqpo00z~(9; z0x&V=iq8^gmuv9Ys5QU^w&$pd9b8C3~&Ix?->?#@y2*O1eC;?wKDwC;oMfE$>+_ABjF zy7d0htlD8yz7LE5t<+`k11gpDXoi3t*@x~OhkrLQMAY&CJGj)3?wc?u5;JzJ#8H<4 zLdWC0q^TwtgjBno0M{+-ytCBdg$;|=Bpq`amQO$c(A}7kW45xNXfP2&g$opW<{q6W zLI+q#Il`c8sJJ)WGmkgKud`Uw(^x`ju6DzTe|mp4(`y3ei{9EH6SkFA$;JUkkKU&7 zU$GXxwhL79G7)ic5~*f@=NicM&Uj`H8u{~B0ue-#ukPnOTsHmZ$XRJ~E_&LKgoh{5 zW6|FDAQ$@IzA2!WNQrB+NFk{A35x*I0bn@=`WnmM3&;G~BQ7oPObn_qA&9!gFlkJ9 zB$U>zxtNJnkDIaKcUfOqt=b=H*sBVn0roH7~nQFU0|+CEm`_7MxrGPnP`(7 z`z^j`0vJaT=*_^DqTF-X#uBX%wj4a|ZAV9EWzBWO zN|^A{=snAOf|e7{H58OXdCi@Nzx7@`PZa`4X;~79{a^6^V@B@%2<)MtGFgQf0{#k) z7b#I=rmZgV=>T^QxHPV^;&`s=R_1X@f~g2V@8q?iKB+b`aAB5M9Si69iD3~*!Ay|~ zdT>Iw(3*7%*@km3o;Gx7{ykT1*7a>$sm_WggJu$NW zen83M;mN_W@g-PzYypn}ADi8y#6dRZQAiaPQ=>20OBqjRNk~8Z6X)mmQBd^yKGI#N zZu7X&Z_rH(g?Zs4D7lS9%MO&)dVAYk`u{z4*=f?4QlBHpxhZ0~rIHTa9#ocRdk}QK zf_~G+Hm11DsE3MKh>}|ahVDbvVB#iPb|7_bVG6a@$-V#23xM~! zhH+`~zyk#CVh)%(y4*uu7qR}zEDC1|DO5wzgA_}V7Be;`i;0P`DDzLB*eBKL-T^1X zU%^6`!#IuqM>ZHzj<5vyK0BQ9dxo@vOB3?aZVDEPf=CQGasm+HdN!aX4v)@Eu0wp0 zdEUah+z*$e-fzbR;gRYu*B$(03WL_h8W_pvUoP+=&Dz3*nfGJX!T&p`kqVf#&8W4_ z@kF_Q#s|or`Jm_SniMzGWXh`IAoG&^>oD3KAlerr1aZE9`c6dWNb^IfhDz3fRF+t{ zd{Q=jLl|IiU(1onkP83@hX`K!BQ%F5_+a&l~JZ1I_ykt4Uu4Q!YqqCZK5V7`OG z`}s4+gi}o^r1s(Bd~@FYdF#4bf6}i$7{JwJ!fNw}?+P1(A`xc9ixRhoFEJ_w_~_H|6^udqyXn8ndE=h zh6n*r3&1}>cgirQ@4>#sNDhW6?oBg51O%AF2d+yge_1^K0v;ruCajopVfsp?DB8I~ z#9-}!`_dh0#j1G=R$4qfJV_}jC8)3DKS+=l(BtE$7L0JBOtmOk*+T&pVH{A0-oj!V zTpolz6VdE%B^U#HcUx1!MMJhM#!QDwRr5<{&~ye3KYT7aLQ7LQXe(_p_)SK`c-%14 zl5g6FKZ0iW_OS)Ko}n-yShfU{gbG@NF1`V^#FHARDE})Z|E>L7-{y5}!52PODiamdakr>rqBGkT~>ICqZn!e>>9O z8r45ajEwv)pf^-a2aGQ)|Nl#w{M4?Y1c5@^+S*7 zg=7=9CEo~dTg8NTjhS?X^(gb!qj*Gzm*|d)aS$Orh;#Gtg5^b;*JBneDaS9TMI6AM}NY`O2Iu;U2d`DWr4DEGvy9*MGvUDXpWOL#tOJ4O{~ z(wWa;U)|jJyja;cp#4pch>W0GV|omjKlmgfiBrnDdc)mzSuu`-;{B_6W^Ruxf5u2o zzK`U4&$>cfzk;SJrZ!|ebc?S28csM{h0_YJmBWP?i+CaqafA@8zr`2+&Nr@3bQY4z zeo4t_(JI8P;|oxJR8L`wGLlYNHaUfycY2t z7JB!qtbGh{nAT5-kti7yrQzH~a-c)Qp+Hm{^)%y-Mb%1M<|Bbk4X#+D-SlXnyRK6O;7G+p(z40Uj% z+ZM9d*8G#(&DR%|m38&!Q>wr#`euhf>~H!2(>)V7&n*R;mViVoU%6_37s9N$C@=TW zuz>et=GY=YE&>xNW*Pm%3P1%yg-tN{*v19K2G3jGFDxDls_(CB zGPX-?&}Fk?<%7}ZvYnAt5hO^Dd#s_XDYB7Dq|`E=ull->UncI|E4{O*kE%->+982; zbZYo=QFdz~J{?zXQ48TBWfR2{CTrw$Hg8$He#4kzR$L4Sd0-6Q^t)$Ix7+Uhk4=LD z;6BQm9YDQcBvSx0jZ|tl%g+St3~_%~N`RvVShdMd^dUF*>q^LBX#UAEx2GRS2Cp|9 z=kG^IYl5uk1~;GIAHwP`$3slJ7+^2ka#~)Yq+BlkO-7I@eS*Lybeo_1&8b_IlCF*VHjT^|3I##4HF)8+!$kGV z*^2t-U&%{$MWt!+I+++!@;Ik9hWpb^aSM{1`#=QKpLt$%3@^BjEk{m1(@Rz59y%iv z(ZT0DqgiIkEUc2zGuvmCrET>|kllECzC5iF35R?f#~tWxD_ASA^r_W+&UDtV&}VbW z>@$pGION7satecmpA;-uQ`BN`jBCnel|rYP|Inz?pww_VZ$k!`mm}{`2iz z-4gOZVP;ie=j`a{NL52aMMI+uhPIXo5)#w%>K9#M-|JZ5NQZ z8c_lESJDCRa}l7xjmnaPxC4`6z9}W3m9txm3XzbJWxuY`t*qE3=hccAsb4(=)E3sP z50QV_7%ubzqlpEAZY)@BRwy<+J)nUZ+YHFA0`jjuKiC^6L2^6(rVQ2Zcn)GK3XS%4 z9~HNnM86m1|^8HtrFVB$$a z%|QUGdztd1M_-bN!L@IA!>!K{yS!9$v048urr-9dqlfIs_SX|vJz=r}jefk@+uk>OF_vlY9Pz4NrSsc^NvnUWC&p5JX*X|VEy*fL6-Hc(oI5ivX7u<*Q z*xTi~)X4R1jg$|IH8fz@^t!VcXa0R%XW$!*y}}xy04Q`A(xcy@FYI4<9p|DF7?bRNco;+e3&-8Fw5hg@9#r>jpOt9K{t1NG_BpJiBJz$QE{HnyCJc0_CS)0=^PP61`nR@ya@WR( z?fDZYwG=1A1AT3jzb0TNQV1qGiRIo@aEKZ zZ4*tJO>az#`Kcgn20Z#>P2>SPvS2O1D4bneS=9DBc4%L{vhtYQ@sP_t4L?OXlyS@A zcz}%P?H)QgSxr$*C9MC5f}1%ojJP8XKaEj{kJX~F+>ro6JLadu$75P!(`s!SiC9_H zmjI?8(u!zih{OQJCD6C+GJQap-w4hmw=>H=E$=(>Fj>H3wz~Z%N|}U%E@A#3Q9M!{ zsvX9MLqcLWgToYxCyDa*m`oiuB?j>H03oFMz%j#T*njTQP_zwiQ{{nS6KUw{$^j7X ze*n9ds>4vR5|Q4Qv;@N9c%CC}GG;H`Q>w|?R5Ju2yYD974jdFZ#Ov)DHsAE22D_g~ z6$Eib&ON})RtPhMRf2koy4n;xF8f@$dPX7{qpqa)$r zUDC0(%n1TlNNavmY_3z-%iXgU?6>TWcghCkBUs$ zk={I|E$LiB`#Wusm`$*zx4vS(x*yYw$`fyO=H=uUlxD%8sZxH^-Wy~I?!$Z+o$hv|Mhbxa(1q%Zr4zOPH_2-??&hS&$@yJNu=HB^L%#&8@A&~ z|2MSQw_swy&Qzz(5t95$QT{s%zHXK?5q8RBjvDjf4a@hY7bisN+`SVVE{>5!~`*6@5T(M+XSu@qbhUA8Kt66?E=HQ#uvSfV{CKl&r$ zF!zH`a{wh<)%N)tqrHQ1@Ab)5yBHu88Jm)Y;#$oKc4tMNlp3Q__^xm@P^LCq&Eez3E!T6bm(GQ~H&~BpLgYun`+haxQU$^UqN9;3D=Q~I(Kc!r zt-Pj`s#yKXG+Ejel+P-1X$f=DlDsxtj0N~q^PNXuVhY|B?=02b$pc^U9uB;n?YW^*f7 z7&(Q;oSqo={@`KxPBp`gi0aQ}O$twDU6T--x_j$ZQ&uoMvZ?EhY{e>>ml3S*PNp;v zaw{qu6#JKp{aGK90#_ zBpT$&b3(oD6Y{Aynw=LiFJ0bsz%vo{QaqF?KnYW&NNB!r5S@Xkv3m=bhnN)3yQTe)%r2e zIzS;Iq5wzOkk+sxH|KUPq?n$?F!z;nFB2W||yWN*h?j%z2$h z`*&zBA@gM5;%56whHg}{m^k50YvVNxT}~ zbH+KH?+G=L^E=aqw5=#d!5<)KBEw3qpBA2rWdcVmUT4z*1j<(iq2X4FVfKe-TlW+l zZ{G&;C$l{=|2$xFIg(cAJKk#-42XS~(mFJDj`;Fb36Av8g>0YBROn!}np;gaU8e^V zGWbS}Zv1spPPcyU8R;>wCPNYM$_ zQj}fY1#=@mPF`bbdB@!(f&@OiuqSr?<*7-%pRl>w&{v3P+o+&imCQT|4Scl5X(=~h zm#i_LXc)7%4c9e3vB=2(!Y-9~)Vx|zUb$B@kFVM3kHk}hm2!OCu4V1E6mN=K1^Set zyzj616y&e{$rca?EG%}>0D}f#1k#+C)=lDzxMI%uCt;C@mddpz(wPtJK_%@DGjsbB z_|tqB)8MDFQ_DWAF798RXggl7u3hVGDR z0%ajOr5L;^N`fO=!df_B_7z(WwP!kr{{H6m`C{{5uSGzAz}q6>+=nTl3J68J2+}A& zu>YdQycxCs-$@;n0StWh(_0e4CsJw@|5)j;))SbxwYJR?zpn!($G?|%f}X|DG<1>^KU=+@H1N;^MSgQkYVhs-oiLpFi@bUtFOkoKtbk%a;2HICOe2dd6M;%iGBJ zJEk9KfeV=Q#~xrDFMX()KiyF38{kEG%#!9R7%8Qehohyh{fqNz3=xkOh>qbb zsq-L_Ya31OT@iKOAU@;VHMtVA8C;s?<(U7K=38bwKcu3~beG;lb^@Hbv&xLspfd?j7099jaSc43K>9FPo`SwA0WI`UR@nX`0eb@NnF-d7h`EcJzE27 z0fnLUPqefUO~N3HC8oTTgfb~8T~^)mz`3nGwqa6Ry1laE$Zo%ayb8caX8QkWqkD;1 z)?)044=!xD%R-2i}B{%>QOU@nokMgL5C-r(`KI;Y~7HLhpEM>EBC!do{t zL&=QcNPP6iJiE}y?l`(^oFz3zYQNU+)Na15JU_&xxh&g%~@o-tOpsnGx6`1ljP zcfWeAXx>IM2|9G!ac@WX1kJT3@ahkT0;hj)*4!yNAdVJrLnu22PgSiUcJq5)mEjd- z)7xKQ6RKy(r+ZndZaoZH(jVJCE$Ihx1Muowgxq+?>)o4*)f+qo1f$awnRK$&%XYq7 z-cA^^c#z=a2Bax-Nbwq9_MMIAS*W@^frD_8HQ7n6RIzH;Xp-O^n5;GOzDts+l=X!2 zt3uZeSGVoR(2QpP^!OfMn{wFHM%dJz2pdJi?JDE-`whOuGVkLTfvKWy_J-3Bu*c@K z)4a#~N1lgwig?k6Pm}3bsu})65K?LIQOI}rBeNvihOCAs%4Io!8ks~;3>`i?Njz$$ zoo!F&_J-M5gE#J7g1I4Jc zmJ?6dP(|!W2-L183QIof9UT0l@Bjq&At)ck7}*oyXWxJ+yGbqtsTQPZ5D^ur9D|16 zd$aD{lM6RLiq6w4%$ZQY;INLBr|S$Xfdd9y=ka`FllY#(Hn;OK0$E&x zZjW`ebkjo))QIVQ^7gTJ-~QoXuEm61Z8{3Vj(9&0iQ~o%C>kpT31Ab|VSC<$wvKC_ z2<7^2e-S;IiTIpL;<0i@M=L$B-jHi=ha$#Jb6aaS+|U@!Hil!7M@)A2EIl)rtt|AY zC`*X}0)YZ@o|P08Ng^YW{+RzVp3cCDgE=Jjknc$pCdE=|c|ZPYYGL-v>xBqdiRl@V zTlKtVWCZq4N5&?|_}Mc|bKUm4e5pF}Wu&g=dk18Rjy3!!u5 zW0r5gOMGQpQjF3N?>xG0axMmV2ihCV!It(QdWnbWg(E}JQNw$U4`PFgF%rtK=@q1O zWx*6tnn-SNNaC_ehEhWC^5Vo*QW1sjgO-5Ti7v~X5L7)y>14LBQzn|&XOlnWCh}&G zR{Ns9&Q{SxNmExzs3ygmOHdLFTQgnP!BRL@j*=Rk|8+1g zPRHFeu34X)c`ECCt6iG1k8yeD)G#*G`LH$=6zQw1Jn4L``i+06bdT#d;_0;I@l!^tu7Iu__og5G!~F?VgAqbHR=Qeg5U zTiGf`irGp^EVTq(Wrb3?kHzYrx4O!aucy98?BdE6_1BXM_0+Ir3Ggfb(4}QYrPzP) z)Fjf0d=i^)lFi@_^Ig<;C$ubNOzfN3d?a9WLh!3H}T zaVOSh@vp|ArhDT*tU0sqiH8qh4oQd~UbwKF5>Oguj~x)VWL{ISPnSm~&nzdeH0A$} z*HTwdn#uApLb#dPDWJL8hhzh^kt0Y@scMmISW@}`PeM`moqkxA)fGIMH{mcP`M9|2LmiUfY_*92{Xt0{9Ua%cg!izW%cUR-%V&Ug8{22duPL zc#jT`jZ6n(^vjBVF{QPFPgfkcr#Q4b0~Dk7@EUS>TGu-m)(*v_lIB14A=rC z;}53n2Z>Rf-A14qsw=Ky*{s-NTpNCy@haqaXS{WyP~cV5P3DcDm_@bL`y!Ow^C4$O zw3`8Wdm0;+S?ET9*FEy^`<*&v=UWvAE3!qaIglwaF6?&aT=+k<*FpArym*$; z3M*rpUC-ACF$q1j-#1u|$*(}055*D{f{oGgUY6d*Wzp#CNM2)t>RgENb&u#8d9*g| z%_b5NPglAFJSG(`3b4F&BV_fIdO~V<59a@$7XU|kpJ$AADhNe10=(@dTI68LL%Ns7MaMmlI;e;PK3CYR5-^F%mv8UV}lK5>+Etzu6 z_4FO7os6}`UkR3jU3B=xlDh-RY~@T96g|`Uq`_CuDk^j+>LJ2^Yrs4OQ7C%Ot)l<6t5Agn$4fLV#b%FSVos>=zNn-nzV=e;`_e&w1O=- zat*Aw?aM@0?N2kjyF8FT7W(^lUgMi;EAJ3m^|?H+6PyYTKJV*g6P{7bCibmmYag># zrKjru)aQ4Kitu1XzjbWb)_jV~`FLk+`PY~+bVY9ln?_H+!usp% z4@xGr-z~&?2V*^rqS-IUu=#!2o01d4^aoVAk{YTX9#Ct^6@GaY$J)?-0HVHn!8C4t zdDDf}%G;lc&6~NQPGqYF$w~Ww{D8h@&XR%vcfw}uGM2Oh`c>MW znTm@|tTzYyUrv2HbSK^qKEhD8VRhN7qL*5N`P&UhxQY@L#O|*T+!zym0VTslV2stq zgCtE)B1Mjr!#O*QXf5PeXHj|S&E>suH3CFW==Wmpe`^i(@w*x-OZ@dShZPFuO2g8$ zAI|WSVaIN^2QcX+jSNihmZht!jQlCjx_EmeMZ9r-T$~c@*@4wCY|5XS*xFC=d$}c4Gbc#Z&fDUmYgVftW8ZV@_|`*7odoh8SKR)c^l^QzIgn5|CBuqQ)@=^qy)Y0N zdNkq?xMG^(IZz3Xt|7s#YLDt>dyzuy=!<~1L&jPk>!y#s{8NN~S$^F50oE{HIA#_b zI=&|H+VQk*Ol*!vMj{3{;){!QbU0hsM+c4tPa~%lUj& z0eH?_pv+@J2$KHfcwle_9O2L5Ljop^V+kuB=aBQeVAah#JAqC^E#ql<~qzQ zFse2;E`wKrS(_i&OWa1D%^xBtdCg;yaVqzYYX}vYd?O$ zG{5_H31k@ZdL|pZUzjAPU@FIZSSiSHZE8#Sg#SSU0yw9``wwl2@>J1=HKos5%1-sgpk?C1k4@hPAvt| ze1nKwK}^r}?{D~r;rrhArMrdor4w~(#!3CDJvMhfM?Lw&v6_J=DL}_^01Yf#8;$g^ zNLf9z(=;XOiBt35`z_kMX?&1Cgt2Ug;i%3#&gyKP& zCchq8APWlMWJk zN99yxuS7Pix-cI@dZsB=d0iy~zjD~0XobInzjWNRmT99xJOy>72>O%ZI*m)_H?yzW zjM4zK@Wic$h6jgv=R?nKDSc_KSk()|SH#MZw_<-l(bbKu`v|wAOE7LZfLrZ`a zmKp)-6lo!~RaX@2ZZIm=&}vHdB>p2`x_y`d`8m8&aT3VtG<(~W-iw5lC38(dfhZ7$EHuTyPcBs<@nH1E+v^V19`%Fzm& zPG9ea9=Pm$WY<)HWhrk@KeEu;189M){c1y+W{fK%G@27;v9icO;93uV2s{=(rU}b8GCx( zx!~s>90YAqYlQC}!eD?^nOD zIca8!uhP4?(;H;vbF(6p>c!;QJNvmP><#u=EGJ7WEK#<@uHSiz67y^ir{|ApujF_~ zDu3D>rSW{ls-^yy^}g7QNvyBZ7ho$xjh0KeUg$ZRw~qLESV~EaiN^Hxohlo0lSe(_vte~B5e+>ZUzfXYEiK=Lz(zu|Xm#-rU`C9yUiL8Mj`Ygl+mw+IzxjsFw z+Jd#dZfa#pQs(qkBWI%f<>;3Z<+_NJk`Ruz!Qk>S_HJWq#2=eE>P+Ab9(;J``Q^rR zrA5tbC-cBY&RTV)ra-Df5ggWgucudUsKHsoX)t&HFvf2~%NVKplJgvb^ zKRc?*LY0PoQ30LT=Y{;)bH9{*T5Z&dilIx+lOQGy(NUuvAetTVOmW!hH8 z2+h$mTs(AJa#)CISb@=?a5)?E(l)Y3{(v?1c{gy==|)f7HY&#HBB4!K}x)27$ESp~7+t`L~_e!JJ&bKkF;}*5ntAQs_0R zl5-n*yUeWyC&4e{c_UEw_Y8-o{d1=0-(E^AB)wr;9qGTOd5Z#JV2Fl2nF1BL_#J`P zqb_Hkf8YCLeJ(A6&s4Hx2++Ai2Xbgs)xv^D4BK3{D)R|i@Z`u?yO2Q9NX2A&T(buiSnJ|vA1_AmVqNTF(atUK}?3zLz zE8nSyBsTw^Z)T0`kl-Li$45vPfg$Uh>3FFYJSz=BdT*sjz{{$QDThPx5r$QL+=~VS zIbXh|fAMoyBi}dVK2&u)pAT}V3A4A8-(f~TTibj6Ejopg3h+bU0WsM?Dg?@mN&i3g z?33sETyq{b__XxiaC3ZOLZ_e6KoO)&!`IYUtG70`D~=LFEWb7IJBhq~4v%0x?yW!J3>P4OD=024i=x%C!eAg%lu#PX!2OHwhdz&YXed(YI4pUq!T3 zF?*(fF&P2^kpom8q@<*w!;uNJ=#~Um$Y5k2b4tVJqxk7$OH3CcmBc+|A(? zbuQdSVoj9d!<+u+1_0XeQ^o9Y4~3+qm^C`p&9v;(h_R8y5Hg$7NxqeP0(X(3ECuq6 z`H>*Vf|^(qHP&LMD~x?K$DB$gzI~=(45uI#Pa7b83tEh14+sEMJ%#lW>;`# zg&De;r8_ET!T=I~vY5{7`yG)1_rq$Z2?fosl;wexwaZn#A{QuS22X`*3G{FSRI=Iq zEl*8a=|p+mtM^9lzQwdZv0Tql=^<2#zfusyQV?N3>m^%i@IWa4J2$3sL9ErMz?j8g8_T6-z?MYgFgikpUsH8d~zCi5$DwOsC#;BvhQN8&F3u}old!+ z+!@-*CKgh=N$e5Mj*WT+@Il12h<&@iZ<(|H9t+Lw(F79{uAH>5it?jpD ztVi4f{hCM#mLCvlA3t5`9WJa`<1Mv#UP0eH!zj$;w6jQRl-r#(%SBaBz+8f}fjT_u4p=|oR zdPe_Yl6!<46GrDeFob))@eC*OJXc-eW9DDwx1n;lbHfsSYfGK8r4&q%}< z?K5cPe8NH_KILyi#4S)wj3)P?fL@a9fJj@P)ti$adx(E|i?V?`$>h*ZcZ`m_s5-(V zK7#OXzbm1IM_0iWE+jE2l*rG zc@5jdD|`vRos&FjQU9LnH%?>)nNg&EAd~ey#!A|&q$5+qZMCoPOp{X*!1*ep1U0&L zo&`!tBhkq+K9I>mmxB$-Bp1=uR_{zo`FTZ5ekSsp+aZa_3ROc9Y3gEx1kM_z7PV4} zOl7B+cM)ztVLt0^NQleCqGY917JGokYm|1rdqg+aFdL_?(QulhRW(g)B#a^ zb|u=a-gATKEQ~17e&3J76~5KNU{o?c5{Rp8%gV!Tmp`9eR8hl5og8fVsotE)hvL&R zF-z_Nnz0j+B)0h2;=IkJwxH;@r1r(O3G$ILnoW^qK4R|`X63b_eCc6LV|~$rGle}6 zi57?04DD_n*;nbm2lnXpPvAg7nTo|@e{Z1PpNIOPzN*=Rkp{X2;|02x$I5+Xy#Tgh z*;AsBEi3so#8|j@X=WhPUoom&y~jQp@?9|k5KIrno9TZ3%K%YkrbvH8;Ma2V|M?>^ zp*%^3=iZ=iy}^sdP(!({AeUK-tEJD<|DqyiLOWsxNp1ThC$qW7lO}zd=a#-%Hp1&&ia# zufu|M`%gE+0Yet*@dF&#W)fI0hf4bcFXLv47!-NAKnHnm#(@C=embNseZ?_Sw@X&3 ztr?8PBV`5ploQ!$fqtrD!BTjZ%`3F;5PidfK$mQ7#>gaHQkwyHMx61Gl-(J5ax7`d zz6tA)Zxa}DUsP)blTV6tiJHO)bT2YLWif-K5=YL-R1k?cdJAFU_;4qwS>Uh38CeT* zpGHOW_rEyHSnQ&R>4EeWt-Fw7Dd`?uJni^Dar!gy$9w-su6xVv(r7@SATHM7?TR&v zNdjvGA5VcvR@^r1HGGX8H)DLIf`O6Hv;2o6;+2{AJ2zF>w;sIWmG27+ftrJZiX0dX zP%DmExY)P8nLIi`BlG)H2iqrRjAIEB&aAltm_-~eQA1Xa{}hBH1&#Q>x)$) zIMdO_xJoIxiBSzs2Uo@lc$$`8p+-q;TOS@8+pl45ko&p+;B6Eb>(ZlR+`8p1`5@NE=VSI z%vd9GI+MjzX`JXH2rP@}TXdKv!r{F2P_li60=H4?&M&>jBtGloB$>l_idYQ`HuEA+ z%Ptt~r#Y<)VuD{oKedO=$PYIFj8%GCT>GSa)K;2OVbwvTM()njiW0?!)_R3Wk$Eik zO=8v}AH-4HcYKGUe5p9YJGY(pP*-2>{(-=Vh={=5Ejzj=z3oG%ex5Kqo6{sdfsXUB zB8C@+lqmLFrI<)_d7Gw@VBWE>jt10|^RH4V)FO-XBK2laBW;zPHHbdM;GB@E&DV?# z9*`M;+CAxgNAPtqKJZ%0psEfL;9x*E%FEJ|dYaMm!wIc(U9)^<^wwu;r&pv)14;f)? z!wDwL29E?7EFg<<|L_3xk8kTwd~VeuFO9_A$22!z5jr$R(Ma<|h_2cqlx*Wp=r9nU(G~HHFhTM1DmzPhTSB_|UNB z4?>gz`5V{7R*x>@yadMP2b5Kk3L{C=N^LKV1;}?%jzcP0jS_SYcC7c=osb4d7;5)1b=5lI*27`$+R+)#O_$8RgRsvQ z66@tsRnbnB-(<*|HDv0-!@IJe5I&(FsySuN8Q(b{hvKkqW?dlxn1L^tMs#?OJW1}W zLL6=@EaNn*OqJ7NF2YNJERBQc-FsJ?SE z7H|yry!+&@N0a?awiJ@@s*+(~ncK_Pn!f`-vgI+g(#AguC)P5Y>M{=eV9R~)0P^lJ zBr_fVG3(6>Fao}%w)^a;5}=YASX&*5R4!U+s9@U#1?iTuY0fwJRZ}Ak?DSw5E}UJb zY0nMOPon*jOZb5y9E0IalHz1yV)E+p>IzWh0)sd0A8$x!V!Ed6vcL`&bF760JglFX?2zjlqvUeKz>;Ol@I2f$ZHV%e)%)(s^#r3{C3kEc2RmNgqE>0 z$>%>*Q1A1+J?Jqb~eEJXpL zn@y;3rP-rBN+>CfX-FN2IZDdPuEG$eoI5awU7N}C*N1dt)O3D9h|#BxKjHjp=M4ds z2_J)10*C6(iqcB7g%m#iRe)0<+ztPzi4p!Y^C7(=)`$pQP;2t( zj5DbJRHkfafhCzre0Vpw`b6K=)ulxb{#4gvh~CrfNCgDqQ*`5CgaU{Vk^(zX)aBZ>ug~m4w<9PL?vl!!v}iJ#mevze5VSNAsxKF?Ru9ZS>#h5 zh|nQrB?_KZN%Gc1xJ~!jHNRSBUh5GDTetBxFOQiH!Q~yVL%|p&! zWoI5B-{O$R@O#^eWbaG>0aInsXUkz=oOU^beocjzSG5^nC&qmzDrl9(z=;1jLw3>7 zd~d2Rvb*0aWq!)#TjIXnUP*yixgzv}%574Oiv=i2RlR9DlWmb8!sKMCyL3H^$suub zz`#!aeQ1Y1AgRj(v`?bgOzY^(-$a{!42@@SZL@{AvcKGIeF1QcT(V;jXkT4ySj|34weeM zE6-ovOXR!vmk&W8({BMQ_72Ef@V(;+X#K;IJs6HG>nu^xIlA`UKC>h~WWk9_42Cnw zWvP06*j=BH43jah=HF}9;>r()PjPy4qY9aUb8{HsE$lnGL!aPq!Dc*4|6Yt*Ql$e-E z3H9#U_!LVc|BTZgvZ^Gp`8p&&1l@neOF|LlyJcB7JEtV&68>(Ij*P zkOxu?wr%B*+7WK&jU%>UythtD<%XJNw=PWt1!Q05;^_=|j`kAs=y+Up=?qJQXlzYy z`|3BzQGog=P-hY(2(7i>2+3i*G3EC7n+>!k$t5Ktgl-A*A}96HeV3Wp;%4jrhI%g= z@?BllyR0%XZVu0Szh=JbLt?an{%>=34}rIA#YsQgY=%W?@MhMuwnHXnmPP8#Qoi;3 zFgVcHPZ!TWOcKGC;?-1A%9AM=RLRB0V@cGt7iM!5IPZ7wF5#Mv>P+J_y9_OUx!XGx?=W(aspq zohE;DTJ??3iz^O2fWxpfhjxBAuFFGP`fDisU9U?H$MyN3*_JUxb$FH*N@uAqK*K9V z7t+^xD_KP9)49%|u4?aY3q&It3S5*O7Jiyc% z5gje0o7K?h%79?5GCY{n3FI~g0|2e`&4@S`5n7dAqbj;<8kE0%Q`9Rq1L6HapE zk`<|FG0`dBA4b>q2ZKXkx4)73qcAu*6h(h#m-uLQc6x9`mz~vlQ_jM&`(arXKg=kV zWf=n{=NfXmtG+>#6;Eg;5jK_(-j`tP>XwGoQtoAfh2`+J5-5HdgJ``MubSYe3e0b^ z@IKPS*%l)Wy{w>^@0Gu=>`se}C4RyfocoBIO$c+MOk2ws932&v#c*|X?S?{c`ioeYxQmlo zc_}!i*ZRFP6?gULx`EXK5Sax7T|x~$nwEv?(nYcd~>mM zX^cjA5OT0TjAgOvPwwA(N@F?z1~O=LU`b{Y6}FCv-wFgUm`~E3q#B5~x;P_TJVLUQ z=G5x+4B3?s+ZmlER~}HDzIK&6N*G4#(iREclvr}Nl=*JeQuQygJUrWLapkX zT0D3^adA<(;_+9iwFqD`ruj9nni_E!A4O^x-?!EgK?P24b4af1*_UOTJ*4GISFRo~ zDss;^5FIQ_xBfd$*AsXAY_N>5e;^{Y{&oRE>PJv&>?JFqj#CT{00qIwA#xUx03?89 zU-L!$1X-!|SaH8$ycfazZWVvX69Ec3IxyC{9%;nEOC4{ZTKCy45=Hw zh4a)8$D1kKpiTwt1S&E~qFhuGgE~MB0yY$f`(D$zYpZ3vC6r}UI?pJ^M*fbOmP;Pk zMTx)Vk;Nv{#L1cu0n3MDsRw?l)UympNKn5Q%kMEkn)J zrZ~kI(YjxktRbBO;{gekLf@}l&q?et3cTN0CVK*-bw;`&erJ8t+jIJiC%-dka!C2r zM6{Gph3a6X^nKCYu9>G}e@Ik*i{T$U)AU=mr@4mE2$5>K%kp+;2Ue710GTIjHmZD} zZ%?oeYh77d9viEQ|Zt2!xqdLc-m zQ^(*OW_cm2u~+x{q!JvyYs4_aUVkNwkFhwG0Af!fkQi}g6GDt}0xEMQjtcSJ!wBexksz=KTnn2q=SFcol!`h+Zy zChY3bb#%n%&CSt^lp8!CISf?whP>YZ8}#tWNp?>1vARZ8#Io^YS!c%fB~eR@f{8h5?W}H_%NmRVvYH_7!7_~QV_b@qq`v7A{U{a-We8T3yhXya>o7bxXYs0_MiedT zSfA`LQcu>q5=J5)OI|i1NZ@+IAzW{mKBJ-FN6{OaNG5houY{N^gev*c`C3oWN7%^{ z>Sap?Q#U-YAu0R-7^L=8N1$TxB|8`p((VH7?tYU?5)$=>w~I=R5hip^P3jJ@M?jeT z#trvJoXfW8FdR8b$~liEVSz2DQgO5Koc$~8+g;Q%fJU|6X zzA~mC=dA#Nl}i=h{Cp*yk6yhHB2BT1>B;V>_j&Y3@|KSgeBWn?OnG;~Odofg^+(^G z_xMZK6}cBAWMG$N)mm>vI|-ncfF+HXwljflh8qr}4D_fKOYR0+5TXC@6}A+FO^XOe z_c7YPK$4G@gJf--)3mfdtem#N!mJ%{r53&4Pc@820CslZA%?Kxs^D-fnLR;C72Y;rHPR-VP&vV^%@1+Xpt0P;YK!0(pTbKH{ z9X`g-(O|wrO@RhPfYTb#A7;csw0Cseym{Cn+>cUBRPXmrv0LKNG+hz7ng0qTr;)b}s|tQD0jZ>FNk5&T(=%}9)EVZp&Sf*{O^ zcH<2fm$iSX1{|1)tg=L#t&p5)Vyl&7>quMZ(DD+Ga0ua`P?|2x3AFJhF-dVS>M;@K zvp^bWHGKXW&;^Sf`kx{nFh%+Zb|^xrA`KMk^_l%sD%ra$(0*yla$Nwr4r)_ydV2w(NprpTE0gPc&k3{S%XX?^B+d|?7;t0S7A)X#f`S2 z-O;Zlv4X9xD#Ar_o}X_D5U0fhO!`mV^u?raS~X<=kBtIN%+87eBzaCbl5!TVxa_eE zJw+^Mx);dT*D2bzwAN|2qfJ~cl`i-nIR~LxG|IB9N(6C$fauA5xSn|+bo-4Ztrm5g zWptoG_TE9%9S9el1F*=-iWuO8-sk}G`?5+pMRXZ)C~0Y7GHPoTFfgrz$O@HJSmSs6 z?A{OQqyemf@%j9#mA)t@tiLxFSkz3Mu9#V>p@&0QfYR0$;bGM{&*I4FNjAU@rx-s> z(W4&>xXkBb2-W6b=K|0^&E{~_g-sOhl=DI2<=p-BSM>m{pFK6z7i?6I9s(8Iv)u`YRdI8KYiB@|6G(gdqUjChN+4+IBSzIC-Hb$-G+=x z6n}{urK-$jFK0fOcS2ZCmaX=9r?FZMTo1Ano1q5!)HZ>UCU$NAsE*mZ+TD}t%lXpH z8HviU0B=IupDaLvXJ~Zu(R(83;l}^pkv7*uF)<^>g#kCwb`^bBFQpPBP`tO_tK{-@ z)OdmDJLKctxf}Kt0PA1-i1vlaO`b@6Uk_b~moz^FXIrQyEJFDfU->!wQ zo^4Au{AovK+Z4}gMcOyoPH0x6x>^+~IO;#MI>yzu8iVh&jd9_e5+6_AA_NCkw{%0W zw#Rr}mZR zIpKT%Xq373!ro4_iP?l8F@7nHdC1cU7|{-ODj6CS|JB9U2X4{fx3e=FsLAQ&jRp1Z5d zhZG*yO_A%HG+}`tC)N$AmtoU=WF}4yvYB%OWgzW|w34d8p5=&_dfecxNy~)}bmnHD zZ>jpt0e_{eKMg9Hn`cmyOf&|>`BbNWx^#ezK^WL15fBh?h>80)tVxD8kNntKj4$2W zP8_keM}IM~^$P_&b(f`O>mK%zWlc?u`M{;E&ugOtJ^ldp@;3Ln#ksHPh!QH;Wz7O? zi3ihY2o?)30aq9J`8^k73&GXIzOIjZ)P>@IGwsJ0@tZru6zN%FJPdhUT6R;Bb$@q~ z5wAt$nk04n06(M~4B<&7vfS!>@EjY+#4^307_jT)`t5t8l+;_&*Lk_| zI@1S$(=>D^)VKo4?G|#FjcJ2JXQ&a@zfpy(*R(bYh?{eVx%Kt&%I3D^7!d}zB6mx5 z$kns`N`^oqZINOYB@+?fHKLiC<7PO_R)Vdq9LD@1M~BQczjStWY9r^=?Pf`HffPfy zQ_avUt`Qu7l@Ig^7s&?$bddjY;O)xGG7OZuJTvFSX?7zH87VvXA zS7`&WfphC9&?)6YV%qkfXcu4L>kDIRX9w`Z06LsiRaFrnDqzVch=aVBjsdcLCJv7N zU%!B4DcbJ?cH8k`T!gX)4{^5W*fXJ5B+#1}!m_^WUqu!J+UecEgb$-vP=> zp!JvHbD^@oiV+mBk7~J7AeIvQN0B_XYJ%)pRN$aZHkdQRLRuX~$SY=SUsqjaOb;7M zzgju^;UDnBn?$`6V7YyT9I#a`(jz=QH6UU(k>gPg1I&#n8P>C7BTX z9A{I);||O}5f)O}pBrD*-acWj{#2Edk5vEKv>=_IAAVBlIe2sjY|Wa1|NCr4)eGM+ zcFILW3=IumRtz9J+|ePBB26Kh{jpUuJd0A_$Oup7nmX6rX`M&HC(g&j=%Q0N#j2^#YAi?pb-`b^{L*(v>$5o?m{sYac_P%C~2 zQ*Qz?1x4tkV<%YrQ%-7f1itN5Kj&B1pQzHt@MK>pVRb_~-l^|c4jtfyy5fVUjN%^x z1cEwZx<%?*fZLT~8Ho!ID@lQ|2Ve*hle{Kah}QK!a@-3(DpW@toGpDyLTlj)&35LvrMe4 zzC}d|d0-P0s-pXoC;ikol~JR;mVnI~bt3Nb&o{)*{_DmJN{Vzw5~BNstv|q)w75G# zqzvbfDRS5>QrhA44u>fQ1IMuWjxBw#F_=r#Eii90CTC}(qQ#EGsm|2gWb0RlD>8v) zMk%j22v39^g4p$o)!x1f1|0&?2fqP<|8Vdr#ElMfr){@`bIKsuzm^(3IsgP5!M_b zbBAQy+z;ul@qB%;9S>%TTTad{e|}Z-EVU%gMoQC{D)&M+?;1qLe7&G1Nz+$EySdjI z=EiG3Vboa+-YF@S=TKUlw?2`}$>>Ks%`-xCz9q_rC?vWI)rO5)61m@&n=jNwS603^ zAoGg>NKPZtB^?c6_g7gbCwb;A*uEjPaP{d9K_UeX&gfa2(2+C;jcZ^!HnY;UG zxLsegTCLbi`(r5f2r7ueCl#U-9Ft<8L|Zz^*sD;OpSPX^eZ@dzB4=t}3pYu!cXA>H zqXBoV(KRN)6AKGqEiGb9OiT?+}Bx{!=Gg8x%r$xpu-=`xXbccqhmM@c8Vf9dc8o>698T--hwOaQ(GX3>6hrHSw3 z;{!}#^WyGR!*-Npg=*=kYhfS$K-BP^h#jT1QDvC}%~)+q=Y5<70j{}`mli2D##l1z zVZBVSQZ<)C4~k>b6`TZG`h)>Yg&~y)c0v)X5ds-M?S}B5%7G#-EY?z0xkSf= zsmmT~LWq8%x1;Rs{qKgbB6siRTrCsGfv#I7Mh@Q@(;nSQKnzq9v5RBWL+S{bTb^d< z%z5+)7q)M!ilg8hQ+7^XW=TB$-^us}MJ6T&nIr*FCs4-4#Wh;vE(ccF!~_%3x5urL zh-l1~mMuw|^bL{ck;$75`VtD~RhC2r#lk6WF#g2OGpS&I^Cjqa#UJBkuUh)-$i!@_)J@Lvxp#6Gb~8a8@*t>K>B;KVou zf2qV4pJo=YmVRJlH;xKD@qV;9*1I1)x|#X);abm6o{%a1fzHMT^=J3?#IF_6p=x!N z_7gm1&)Wg3j-2z>#=c_d%0p2ic7?R*%aYBLCG?ZWM7>cu{<@@}|I?NIvg}6>o84RZ zvfqpzWeCnWyc}Wu1Y_dj(ymnvz@PgPJKXY14NWH0HQ`Tm>@vb;zfpKCKVuxK)>k#T z!v|j&MeRepEFQWBy1Iqg5gqLbw{w3XU*CLTN(x-Bm{-=Q^SyxXG16t5PhJUgOd<6O z0&^U=(ch?0rCCsStvvm9)}$X0l?~;!*`>M&ODvYVFGkA09gXODY9d|O<;zCI`6yIo zq-^~33j#~b;RO24ug!^T$ne5FBnRc`_D6-RMfQ>zNOHD2vyqwHDPu6vCWybSL?u0A zbU7IYa|Q!Ohd=C)ig27h-dW!uRd?GVi;2TX%PUUdK%SA#>*{M;B^TY? z2%_Kf4O$cZCzXx%1p$;_d*P=^uTwq>h)~C7wYH{COvqBx(2NBpt%^tLyE~%9E2WJ= zqwWB3Ojm5~HQ=EWSO-})l)uo$H1$4F){# zfVR7DZ{{l`q2pEW-K8{|L`c>C452S6)48qPdq+po0p=>ury*v~bnM_B+oZC`OY0&> zX2N~n=#PTBjRF6GFubkFffg2TZ|}1e7HwT0=yz%nH8p(T9`E3w#N_1Yk-sGxnq_b_ z**g}M7%fRH{RqO9fce?R^tf*k9)ClRe)IVTf$L~|pqFoo9(%q&NcP|8>nK?$>thCI zrB$s9ve>fXlTn|`l&hm?X4Qp9Vg~h2 ztdhv{;H@t&qQ_dlau95_Drt!(_5H2e!^6SLYt9d^oM5b9eNv-U#FUx}63xQE#99zWjaGP3y@yM&Pr-XFqw zU6MAc^qeP%RT`emseDxgeD028x8@&2;$%U%B61O04^|3_ui(3;C#2r4Fpf)kJXRax zCUR1QPrQ|#pJQZRlYFx}L?nEEmaqIobyI!NznKU5CqTjwfOJsb1CT8x6%}Xcr;fwdBCL44G;g8oRaA6Ak=oGx^aWPu{CAoKWMV!sJmg@) zeA7OI%B^q54YbH9if~ZS$0;;nIh(8j99cSP)>x9f9vms*{cvQaxWEiO-K5=#uY$E3 z-z>J9tHqt1DKGWq(=>%$Twm|B2@+(%@2Uu}13uZ8sY>C#FkZ-P*2@ayj@`T{Jc4F! zaK!GXvF;o9;ae3;e;!ub22K|p@QqE(_NpZ5_2<(5CXn}6`6{$EO#Rynu(Xp^L4uvX zHUDb#*tW`W1~|7kynZE9=JC@Q)SIM${U`VN5eB$gm4C!V5v5V9t3)Rj?_mP|_@9zJ z5Q>b50DDnW!(V09w52j9Leua=6|Y9>wiVp zCD7Ch`#ThI93PiF3i?s1Cn!fZ1VoD1Ey@Vddld5eTdnhoL{iL1vA?`DT?vGHSDT0> z9sIU^C3s4=%fMl?-fh68j=<`Msr{sO3X7Ue4f4r^ay+K%J)d)_=7)*L{+ zJtiLG;%{>M;A5lJO7^B-eBGa7?q_jNO=PXR$NWM{IzEkf_eB-`56Ho(zGGxQ&)$Wnb8~{9|H-+repixq!VP# zh_>ITk>3fV=EM^h%{<8L<(fn#WOQ`1sHw5QJz2`%Fy9sDWb{)b2Zx&Hrvnc`eL7-a zVts4LpYkaP;mS0SHDRbE{$p)LfL_E`7%b7(oh}YpowNZmq(9k5 zq>_e0=MFpe?HN5xzZ5IdcJ15$>A2D8smi@zk^&^#z@R9et0UK_0hpql+ckzM)`f~Q z1<&hb{)qVat`V(=H<&wQ`FBM!3;<^P{kZ!I243UeoTC#LB8wp*DQRM6hL1um4a`a$ zWDI=&SP5ATjnJump8Y+JWM>Qd7B=jervY9LH0cn_-@pCCW{RX2R}@`cA8HTS(p|P?5PwL|SXttaPCWz18Y^$(XMKX{QCb(1^eN$Dx&3o9{ZE?_(q|2?e znA1FB!>1WlJI`CHKb{|Xe%zE^mZn&HT14uDA&E{^s9Ud^hwl*!G7EZ1DE@ayA<(T< zrlg_CZfs24-8BU4Aw&5+uy2c%on0?!7oJ!WbyTFurpBe{Gw}+NA+rQ|G{CrGx6-cF zQ^xzyc$MG&iJd!mq4vu(q%^B2D`qlFkeS)t$}J^x163?Zm6D!X+tlHXsor9#F(A3! zi`y|E^wj-t@ZR^YuQMd5*=7U>$HBOZ|G!x(RZG8r|31FF3<01p0C<=`zV^E30PfBK zpAQ7iYH3l2!SMdW5RseR-1s{$D2Q`nCj~7@XT3tL@p@3Q;lxAfV!N85!sddF&D=E> zTXRv+Qbib^ulcDVnhtjv7)Cmnl^n)89?<>j4abQ)H- z9`=c4%c`oXMi?YQfnwZ2r8miADs^E&l((TVPPv5`_kuV967^;f3}1RY4ZX?$+|x0F z>LQo1r3uCOf(QU)c>EQ*yh72&f%Uh{*yjR*ii#$*44=Tn9LO`{=+gK-kKP7^SsxO% z3rw+k-lmpUYp<3BHIKu`u*wO`F&!0QHk+mbksm&jH4s!N}BXad_=eeWB)~E=X!A=`X3TAj| z2^#h2C6T5PCql0Hkw%uCz>@!{3cHaj~wn0zp#v!l%{Kp zREDPuaCm^po&RMAwg9+#Eg#$LZL6v&>4)=6Y7#cH-Yi>Ec)S%N;8^}Oyf1IVal~3% zW3$9?@|l%+u)fXpZMB)%?cY|Evn4koZAw<=2_W3(B8Dbl^_8XkWuf|ii?({{I3_+` z4+pliwA6U|k%*vNw_JpW_;o?j6+NWc&ZPG7 zWO>7+YPGqCjN}5-{(CNc^8%<(PRcDVE&@fy{F)jJ1qEDu{Ort)QD(JbJJee3Bqnx`2}pNNdR!(b8XTge9wy~y zfU`=1Q;?0o^b4_PNKEtu`{x486Lt!S^pmwLX$my0$F zcbQiHxn&tcKRV#t6NE+z<8-lFs~$C!8r?w9&dNjnd+tH3Uy=fY;VmpI{@W4=*bE*f7_^a#+qJLk3cQzQmIiXOLa26&pJ zvZ=C(PLm%1EJG+NQj0qgD?DmkK=ydvLQKgg*$}GC8Wa>VbMnh}Sl%kb1Q3?V?ne{- zKc?O?EX!`|8om`#X{B4b8w4apy1TnUx*MdWySux)yBnmtySu;TzMs9{&x0S}pXIcnK3kGECl+{L%p@+43j@4i<@Md&x;$ zkG1&@+c>zp3${l9KqlEAQ+DtD{ftldHkyg00J+QKPD4qnG^oVdxwnTtp_FVyCBTFU zIz}Kt2?8{ZhZ?C30)RT}N^-Pe1QhNNwKN zxWRQ;LeYPNt)l7fXLv}@lF>8y_eBF0A!e(75AzAkhJD*5v{ciH~rL`EY^7{Vq zF3iO~ifyGUbO?{DHjdlvN+ETg>sP37^|_UK>kY+BvGbR-yCuzU#fRtxTpF#9s5EL- ziJ~;F+$`>|#i;lL%7nL@|nv~W1pv=0(Xqp=dvV>_EGAs;EY2HC0a5{$%e3Rqm z%IlG690`HC;`<rn56rQYO1q2 zj)ebn+MV0iZ{5|b5EY-3QQ0+`TmZAJtwZv!gy03rsL1&6KH;&mW0lQ{f?qy;1Q6ME zcx~-YtXk=JEe+|+)4iIdE+jlce8D?HZ*M+07;_6Yb5(?E|HHXlcBOcx_J`ZepXc;q z%EZi=BnCp+hWhPu|77_1a4v_<5@hssUBUUkDgQQgmiGY}>2)4r ziO2Q#H^*anKb4^w@R^Va634^kVYoEe1ayMe@O&P;uaruZrYg@CZ8LSd-uZ9#|4Im? z`}2i>=9{pjWZ$;qCZ0IqjA9?B<|D2{nSqTg*h+JBO zaos<;-tsVpn{u1UD)Zg@=!U~fbj1pRLlXKVX|q^HLo&s*w{U@lyW+?)rs&}>|H7R5 z;!$_D`N*bRbtF>Cv95SNPuvv|x_FRI%JH2DgK+sI0SFHi;3a<8gC;5sm~d z8SGPOX(gq*P##|*Rm%oqf@Ajir!ME**AqfV=2t(}*GCJcpYVk=53IB5iCSYBZD+r= zbyqUJiX|L-98ZwnJe@n&(j|GuA(S^|rRr-o#}qzjo*jnplAX4A=W%oT#$G#EcS+7> zWD5+$Hw2cg+$ks4a`ou49~59ObZ@roo^M;Yr$}mq4~^Hd-nNUiP)gi^0j-nxcN z6XU;JcuU&M;+GGr4-DcU4xK(jS6y*F?K^1hzSyy~9$emS&9;s_c{VxT+*5O)DT(!L z@Vj1f$1=1UXL1QFr?vG+zB>E3kA&(U^xbVEloD6nkGWo6-hLXqlB%#Irf!9CT4T&P z^0=}$f0?k6OXiM=@EXdenXEW9SufyrkZq)D=TFss*=2Vq-?#i?PCR;nb-J;6Z+=wa z_H=#2KJTj3>(YUCw;2Lct`tfWN4ME^^n97}bkS;P^jloFr>|@`C@on$_aTgjA3-%0 zM|atN8E{A{= z-MQFp=fMMPE{;cG zidIIq0=SE_-MZH$e~v8lh-!ne+^;zmUe~HjU2iZJMqlyvr&%tRzqp2r)3t<})c z-h^_NQg+-tX@`{TQe``4~K+BuOT#-PjCX!@V^cMlF8?RM%A)fTNuX-swHz05uh zF6{H%cZ3Ki9~>`6RqvO3bx?&+O-Db9AExOY6B4Rjd8eK2pNuS3?0jI zb)~t}!j0{xFBz56dgVV2ngpg*{TapF^Ns_Nh6!0!cg(OeGIZ^ zuKLr(Xx}&6`qT`{nRFp$s*5&88v)z|jStgRhL(bg+%T?)KN)z4mbyY8;^yu)A(Tem zO++N1U{ZZ&$8SO-D==iSxSooN+0Kop>d zD9%!zFWB{$!0bCF>N+JQ?DFqBW;91^1 zr4v=+6Us4`1;(6&cs96hyt;WZOb5zG(Am-1A_>cf!{UguNSi4{s+U==O16q#CJH*f z><86vo(S$uXjq&W>->X>r(Dcht%3V|p*UZ)C1Bq4`oZ+|#)XvtLn)cYk8ojP1u=ju zC0Dp0qH`mmlbB^`EbMgzMi&&s`C*v4|Mnw+P<}&L9{cEFMN5k<*RYejc&}#0oz}F! zOZ9qj>bO@0vE+Wun;#jt{7s1OL-=ohcKRF{QwgXZ1~KgR;PBsYc=$Lt@sz08=0;7o zqOQklGOccl&vNFkv|N_&WE%a1Nh7)^PV;ebI}4g`44X~EgX_`8tmY*aUGR}Mu!pU(Gc z*4F4~UTC*+Ex!#=f4aGK5mLRAZgoyY>C(niW$JB2RJ-b8cWRU6x2X50ZPU}$F#XW> z+B%G8-iDe~NS9o#RRIQi>C04IH7&WE>g#>E&9M#*p?c-X?eZTxAuh<lGn#V5>>4x^a~~lNo^FnXZyiE> z!rdEtg9!m+}tpN(L9u-ChJCrj_b7^5FvWGKU7{?1!+VhtG-O6i2 zKuDP>DP{;gHs-hW&AtsQ=9bD7!AmVLf z^e)8hQ)T{|F45&Nk5LHr2l50fa+YQf`c_LumjwaK(Rg07o7L6(V0im<{gI5?%1??E ze5wTAmp@@FO{CxR;u>gjMP2>D^JsM7)HQ&tqS4^@90BBfSGTuu+SU+QKh zd##9x)Km9I2bbiRO>_5a-d8`Z7R;s{1JSIvZ9^W+%(9e60mX}*Y?Hxs4x?|sy+38th~kr0;f8M%G(%)522KN}3YoS%m5 zLx8yY=%&u*8)P686DO>#4At~%Ng8%?+-?c z*5$52m{{wM`=EjZnS0tVbsk#bEgue?&elmC*Vfx2rZ0-hP&*J zK(kUhDyGr=;kjFX87ncE;$R7ZSL*w5_K7>yaE!g>5kTef<`Ppa$Jf|2WV2y=8g zB@AbKeo#uC?RI47>Y|eDwy2pytV3*XiFDX$PxHJ*?OJYqG5qn<3r&QO<=vS!pcZN3 zVDhE{md!neaz2W8@wnG+@+A60JnePTGEg=>Fe$nov^2Jax}13UcwfWSt4W}ar0^dH z7i{frhsQ(!MbCTj80ZX{g%pTdm?Y%lgs5SRsG)S&m>C{gzrW-4*Q&eByR3ZzoWDF} z?0E!2tAAu?okk@y#__Sq78dPGbb_+HtJ{F!fbGNTJx?C+vT?uhTRqtR1)Kz;BYu{KRMK)(Wx@SuR-qnofSZi$qs^aB&*9P@kp5bQ()-_Qvr6?mc(pxO3$K z18;$Q2Mi|z_Uv=Vmz6EL)u@266KyJt9O^&(W(vfWR}!3>qcozZqxvt&Dl;wh3Dk@B zQmb>ry^3|4wrm5V9GEhWOEjhml!g5KvHG^+9@N=FpWyv5phL!Ixqp`)BBSltZ08i! zTi(l{j-_!<#5pWrf{#2cHM_K%Nq($jw(9Yrxx zI~p1N9vzhcPdHYX4#?mdPM4c*fy`Le>gjJ1vR!V zE-vq`l1;2sQ;_8D3-YkoI!19Dot>fHHG$>TwzT}c9wALIfeu8KE;=cB$fS|L#chz< z60=i!XLfQxUs#h5kAXjIGHLZYgNd`2hs0nrB=GzJJMiypohY_!DLvoF%(o(e&`Op6Fo}a~he@4xHq1N*M$p9> zxCy8zmE<6&b$Fcm)O|g%Pg=KR#zqe8Xgml!y_X8 zdLSJf!d~0(#O!m8L;VpWgx-ly(TO8<(E+FGoGCNN+QEPQDlDWxrBb466&=Nj$=+SB zaxuc$&;0s_zjo@i6w4y@7+8VjQQDa&a*|QN7bZp~qFd-%S}KUnLld(VCJp(o0!BhV z#RT>4Ei62|3=rrIb_$X(Q(|Jia%F*$@J}y{S)NIF$zp%|a@N(fj8dwT+5M6T5> zqb-u;Cd7buS%3XfArWFEZ^AWI&DZRk!scr>L#lA)3Bzk%jPbS5*!=i6T_dNNcJ zQk8ks$F%KlXBg4HWQ3c5f-kRQ^rJ}HyLlU{$rQCwJyp%? zpPK2g%FN6H|5-9&FP3T0kY=s90RFwV|6F55NI0y42!5VDDvSZzSua22`a_B->v+#^ zgN}^7ZaWMIX=+6p>L2cAu4bWdlQRqaRBf?|vm`5fEhX3|Uxg@((&xIeW5r1N3`O{| zfB}k6KJ0`EG`j3H6b5?ndHF_3f2A1k-UA<0{y`I#v-l82*QpTjX%DP>DqJilM487S ztaqd5c4T-eGla*0qO`>KJZscY+2L}?YI(~nH*CViR zcA8H4a9f5!*z)de%T=F5mtCqsV<{4}@5gs-&6xfC!AtxqED1@#9}&D)L^sWtD%y9O+aClf8>j^ zmH8h(76oouAS^R5F#J$fp7*)-1?o(5GY2@9Sy>Qk)Jc%39P}z-SD(iyGdeRFCvkry z%8S+h=`*4V=9+_o42sA7*10AW{Io^ptnhhiPuoTX-)3j$4Y{9-V1>Y=Q6U0D@>hSA zssuNP_xcIUYA>!L2BUfg@N^@BTj#vhCvFiVGURAuG`%UN+Fi9Dw;Mj!;vNxVzp*%% zqiM{>ZgEHRSez8c#(4cRuO_u=P=EcAJxNeFd$NE$0%Px(AYJa#0&N73(K)=W)zPOl zUZm$=M* z!b_;_b4MujABqXe5hf>9yDEL>g+^2xURxy)p)fQD<0p;nCR z_x+r(YK*KtUKos3SLfsGQF9!?rg#pOeQHis^V9wmz!$3Asa>N2ybvHZ0_0%dgi|#A zAn6N38pN+qFjA_gIEHWUFgt~Ek~gX7x^VbuR84)|{h$$Hv&tntRsOFh!uG#xKs*tX zcowj~R8-Id`wMCF7avfs0z9N2P$G%eubm~Ap}O3v5%}l^<18~8(n>n)8*@j}3HpBU zG7PLg^C~gGkdw)N8)xOK{Uc0ZK_a`Opu1QV)pWA-YkxG?egHaFFSnnDruQ(sJbpg< zn>a_nKaCktVtc>dhQd}JGep>;Exf=lP%`#^WI{q8$?9hNUKi1I&_Lr1VTNr~s#VG! zhOvvLb!e93ULTgK5zzX8R}qXMm-Oa_MKzu|@Avo&eCQQ9_7V~wb(w+o0-3+YJWm&j zYy}V^WxDwIe-KkI`fpoe3ky$H>TDKkJ@2=}(>i*z z7x<5Aa?~1LB^)9gOy6~voonZ5w54AT8Q)FzTSF|f`H|y?NM3$1=$GohQjk?>4r#pM zVhc4w9;R$Z!XT<^_S>H#{AICzqSAZA4Q4 z7&%#-_A@l3QFLWPWo|6CL*Uj+jV)Y^tky500ql@>k==p>Mya-Hz32)0vIz~o^ev<2#o6Z;h~zCx$~o4yv4$Y83l{p5GM>7532Btx{8l}Hg-WYFEqpjfv(x+E{EzoJ~n;dsk(=7nuMwv!zCspX{8dyd#x(mQQ{NvnA{sS@>Q&%Ds7!YMl%cr+1QC=n!$e5dm@m*6#&@nhE5VeJVi(no|~UTU#52D~Img1?wyRBx@)Y?Op3Sd?tEnqVMjE8#;#?ik*zHX->ye&xGJpKK)|2UQ^ie@CZf)QgnxD{=lH!HRqe zAv|)5Kzu@Nf&zxX7O$XPrprGId2`W`{b@ERj8E{+*R0e@xZ94`X-NcWyD9z(xb*WVx*TIwu6%N{AJ7Nu8HLz{oR} z18>O>cr_mG;IYeYV=UQHKp{<93wv1TA;&4lYfD|B`LX;z(2p|mbHZMaG^HB^0Sjir zp(Tz1NDj$cM5Ox(!nv&ck>QDeiiQhrVh#^ihE*}WJMLG!E=d{26Li4Gj@;nH4wl6hq5p>u7} ze+rC2Pr$Z&L@C$!!a{(|GAH(~-lHTi4OIK-F=UC+ERSXX&TBVf{=vYb!mLY=749j< zAVHwp{!=!5;8W7?$UnBW1Ha~X+Dr4ZH;fqsC=FzYUAr2i_j0n{uY=Vdyhg7s~zdXSg82r9buU*GROBOGSBtS4K`zwwuMvr-y0dsh0 z&j7l((iUt*w9kB|Ry2>IED;j~YSbG}971gQ31W<%pPhIKbVg7c`ElYu zo!mcq(IF5=34^+?06s4;eHlCSzCvT!hzV300(c2LQ(#7UZl1k2)Mei;G$wL!lrC{` zZJ3xiU3|%$$0ez$Ia+O)LZD6xhnzyWxO?S@=fwopTeoEALrf%MlldfFp7(SK3C$*1 z^RBxPSl@P571}ztxCdef!o*mYzNlN6)2Uh|a5p6Rbr|)ozigo?n##&+y^cq;>B;3D zL?L6DZ*Qg-H?!cd2fK_&`@NYambb+<|jtNOAvvF8G;zV2RxAIAp#&|;D&uj z8u9DV;fdXbL=kaaI>>ZZK$)@PaP+)wqOGjeBM+pKSVzsWr0503+UP_HDJwNLZ0Yry z8|-TT*?QWk2}kKdBvF56W_0QnxgVo;K6!Wi8ruaaoGwLvyhYf0mdN}|PTssZlQzTe zf;VY>dSn@e6a{iWDWZQ1WPyUhW%IsmYhV`*oc_rlnGJ~};+jk)d~{W^`QsIC^hP7k ziKu$RrzkWozFfn_nY#DNppH|FsSt)yH&?Sfg z4gkC(;6%UV$PcGa;GPJ?dqOQNjFiX|&YJ>z<3E!qfEf>X7VFh$fK#=6@z~+L8_mg@ zq58Ru0@}0{fn&gP$rq`l!=9hX849S{5}3b3Ez6&g8?&qGtdX`yGfm@|{@*i55+Oo? z4=gN{k(Fh%fCv;Oi3$L9CjaOAYix90;U-y+BH;}HB|03qq!B`&f_i{KF@D4V09)`L znwCQ+$Rs4WBx3b&OICWXGnhxO)V8(Ui6y5`hV7L*!2m@J_hskgn{)G@Hf~2Z7Q^Wrx3(5FNMBp*o+Uv{PEm1cVS#O08s97MUVMrP2x$diJ_rFl ziU?7ZaIgR&O4$srbH1hYu|C`v`Ea`oJBPAml;Og=6+ln96Eazuv(At7X*=4eZ+l42CWpdVXQy4{6jJd0BpG z@M|J81*$a}=+U7EdkXX$Xj^St1AEG#%84R> zZ*NZtd3{(d8Z<8W0UUrlY$+sB1K|>R^a*1BB0+e6-HFpy`Xt!O;nu@#t`fjGXxcm?xX+v;66YnfDbmP!blsd+mo22 zMuh<$^nYuqQ00Z9s1tL=%^)$s4$hnUM~?vm4C@BD8K}4DT5s2)(`#7hDWMq~nvLTg zyrq4L)a`(g+m60e8mR^6SS%{I^jzWa5qqCiG=n;9_uzJenY~hdrWg_b|LX3s!3_nz zW4lhp+T}g!@yQ23I|nd+IwhgC~Xz2A+|dPK+Y*ML1W^FMMZ zG#-`=c&)k85VEYSz7#5#C_K4ydw%}~XwN72*GvzI6G3o;A_ja45eVqp6pCcJHmI7< z^@5`Rpm)MJAds3rKUy*&k?6PJbiMQW#d3skOGRy-M!X&YykreCt{)CYzxqsSE2f&v zrKvCDi8QwVt;65>WyvZgDEI-aVA(9CMDHocr@-w6i1<7&=!&Ja6>wI;_$&~~K&uWS zVRYE{V7UP`7u3UmBJuGuY)riqtaR^cnp?!CIvTkh>X~a-7CPzx{3jT3R+R1S9p2>Q zmeI*4kyg1jm?SGJ^La}5$A1+7y?MRw>)=Gv(xScT>6<&Y2Shgx4i113%^GDNDNcUK zPZxYAK!%PO(33)j%$oQ;wB4ywq4l4XyuXq)LjB_mD(&`=9l`}|NSRIgGcuP0)FR~! zxH8slMD!<{XRM>WkMsKLw$Dbk!(?M*Q;#bvK_@umciI9y(?m!CbejWo6}E4a21G*V zc|zv{da7Bcw1E{KAt^pSy{ZZcczm6l8d&dNs7bs7LHjg1^zPkD>IWn<@hK3)e7dxM zWPAdLn_n6{9XM_Crl8piu=ewv)qKYwN?3joX9}~ouHS^E)mRK$Jkrx&-$>G>)6A)X zwOC;rEgBJ&{u+|^)1kaI8-Gz>KgO{J@!fiBL88czQTWOk9@4ATU0z~+_()91q0$oLHmyoeb@7kF-@Diq zA3X9%7mga1d5&FmP{tfO{Z|PQ@u=Z!VFQ_bmG|THA_5o1G)I9U>vQNx0Urxf-?Woq z&|#qrzeft}@Zqfhu{DEab_hg)gA3Ps>L8OvVxCW^{(v%RY-|M8)j7q*rV|d3OO!yr z0sVA9OS_X3bHJvc*-Fu4h=A7t0M~o(H{iRB7<6r(YcVHDBSTgx+mg~4OgC)18cxRv z>C2VEE^P?LX|9LOatWH1&YkPhH2ql}mc(4uqhlKk4Xkl3(N05mhZbrqJ)Ecc@yVw_ za+={CuiFylai(#7NV^gO*fSY&(MoKd1WEbBLf_+tkIW0Br{2Sj5By=L}0%<*)C z0+Wd%3{g59pS7vzJB*%g7KJ#vwM?T+rMM?-vHd|Qo&A~u_MdGh<&AUM-Sc&uID^Lm z0BPzi2-534GNgW&mX;RiGr;t0!DEBJELmacz6$DC@B0nt{g94^#2NjlDYmHv^J;sJ zk|?k+uT~ogUJ;dsqHygH;>pIK7R)O9Bf;?|rzwT%=$8_w(8Aa9x*s4k)2H1fq+mO=$IUt)*L-NGe2?z*)&Q`sf=Ta&v6mJ6`>FDWs92{7H zGbTEAwC$7XtQ`nr>z0lb@lx_AK|Njosu@%PI*uMQBwmczp2=`#^^_2a4e9vGMwsD zPR{nV4md0C<*mQJwE^emcvu`IpC%+Px$KSkz%TA5kyw+;FAkCSWth{O>I%mtIVL(V?t zgl+N!U%YBoiW-*b_JbuBM8s!Xys-lVn|WyaM`o$GT_nZGciIt?6T8c&XFvl5(idQa z)3dYrl5Hit0|Gz~vc@wh(yT*J&;VGl0D&x@ANT-NkwifO=A{NFe?YGj z@M0LmooMz>Yb4x_SI{N8Jofj@7mr1$nf)gN_R4R^IVL-}lU)LmvQntV%68a`+J*x= z6T#*>u()BX{ zMCa7smY{zh!-~v~n#Ex9mG}=4{nw5dPgU$=R?*FIYB}+&_Shl#Qx)8+(ym>agqd`{ zPd-PJwm9NrOHO53`s=M`LF-p zD@uu)3CEQN-Ci){h(9BXc+J#s8u>4!evL|f84!bpf>MsOOu+fGrLe}#KJb;@N*TL; z1bzuz-3A|MdL%?-F@pT#g_c(yEIDvf7p&6Vijyk%KFW`!AF{ny&TUT=<>dh*jejaB zD~YB~ryS?;d@_hBJ%sJ)1z;``#N7QbSVDZ+D8&w>8g?bkX5_eUj}TOZ1?Z%WG*;D@ z9MoAU`H3PGoN1gfNpsSzi42O;wW7%H)?q-1%w{lt047lIv>tl#6$STS@iX^X6WBW- z>Fn0ue2>*b_Wm3P%Ed?UXAcPaHqzN(pse`;xI0d49=5~B8e z4NOggQ&Vw)XA)E;CtmN~b!G5z;HF_ZVg&V!+W~w=e{H~=6rr!|gV-4i6YOx=C0b@# zarz!h1ncf3(XiXKjB4CAve zreo5EaR={sXBYG|9i|9FtBTC>Sa8k@Ztp4*sQQKK*olbt85cRfs<%zqWkgIcE%dq6 zGdM;SL6q3~JqYPVW;0UYNuQpd>y1dv#8P#bSB{Q)qxn#Y6c~p(Xl`652||fo>4Xze zsP!BbEp$R`Q=TjB&aesKd?d}nK42ZGSc7CEeGn=%rmzvYp9v(Lms$vqLHZ1skS{nX zK8Xa0p;KHlBQc(+rEoQqNVr4^!n)CL=tNz|qaTHP@rKa#Aq>2Kw0=cv(rIbYm0}Q6 z8490Z(6faTpB=YN36ABN`igCUb&bni1bvu)dq-}!rAx0uhh^X%B%nSE#%gAlm4$6= z=zyYc!zV7Zs)6*(^73%dgaHGAf*}DGB$+})T!>=%g@NG8+_&AZWdjOEe!iSb&h_n0qw$BJatyZTMl z7++6$1FLf-}E>H*;zU<0LK)GgyD?L;-iNtA;;fcJ~Q zY+kq;##C6{?*{4vGJlgwfB{WOhN_p#@P>&&2xT$H-JVuG{VYj()*v#sz1n^g_%(Xi zJGQ-Jj_mZk#NPyXjqi)o40h|x*++zX7H#^#+EeT9X{Q@5Y{s0HR zil@V%GTdUMBTZHW0DHBdAdaLUj-VutBCI%_wiX}RMz_yDrWt}syMlZBFarG1LnP^9 zKTaTFX0tQ2^AY?|6OSCsjv!7*T!M~8k&}+w&BJetR4an1BwFV)S$Bi6)GXfsY3)nvZ+Lcszx*WhXGzVl8+337^6dqo4fu@ zboBbGbb{=ljVP{;zr%4c&8m7ZaE+GLVE={4dK*7@JpStiunoaksrh@YoKty~K09H_ z>@`Zz{TchP95=uE@CKCnSX0x)ZYfrlxS{~GJ92;!ntNCsY;T>tNtNeP%7B>GZopL4 zq5}tVO6io{l$atKFFMutS-Q=Z$JC*=$&gUYF*Lh}aADFh?60-fCO9w`m$?r2>5tGP z^X;vL)ErH=w7#{zDKapfu9-hEoIAb2D_?6_bMiuZjt_yhk3wnE$yt)_pY#$@K%J3| z+f9l6CJo{!7U3Jr52{9(=7vmMJfO2eWGKEU;@58)_KN0uEw zYT|HayIjg|)tLnhxit-d{PLvYqmrfJ%OTtjGb@9pYGry_-asLW(SlUUX4lP6 zo&g%x)Dp4ViWlGKDeN5$S(5Kq#b=E%%{PU1m1(Y)weT1M`*sX8r%`X@%rk9q)znda z#t@VDHvQw=dwgH8>XF$I6gk_c>=0!BvJb|ZbC#ybXh}CV<{r{1xvQy(gEPfHWywDK zesK>9f$kF)|CAkIz$zEpJgl`X$K6;uwYWG0S|e_6Z{ONQQn^}zj!##&x3a)X z;qLyz3HdQGH$o%_kU7935jn6WM+aELKNlg%$=JaH^rq_Z9)D$+3F}}a^*D4A=bn`B0*7RxeVb;3YL2Z(B`^c4+|LLxc2oxhc+ zn6C}RrvUL*zibXRoWbSNHvtr%$B4JfQk1l6ESbbm(0(Hb>gJ3oM2_F|tVLDB*0wgWTEdALo(u~T28d2Bryft*3b zPji`LnAQSY58Rl%JaDT@FX&jJabs8Nl1<>1(Q3E=n7-S;hdD+wKV&0%6X?m*@uXB-Cwl+_t%y=Q<$+87BB@%j`>RLAKG1egOs4X#l+7nd8ca?VXfa@_0c)ww{v< z@sxcIMnrqx&84NlsZd-%I6!d`9c6CjztYla+xAGMJ#8u4A(E0bs z=N&^V^fjF~h&tw9ys>wjl_8-ybLAT{BK-@{=`0i1=U7EATshRP{{fe)j1gMf2Q7Gi zWHz?b>Xa>)T@Aj75YrN+F2y*mVD3EI+!N~=J=>5j9K-uv(Xw$gjE#Fg!FvFo=?ACU z#v1XK!j#xLf@W_oMJ~0QPY_?aAXal3@~9T|M;eQ~>+VhsU%20Hwz!(~L_MtplG0&x z>)G?f(^%A`uAzyaPNJL`nw>MWRy@%wj9qTaN7yFMTHtQi#DeATRnnYnXHn$n80=gq zSOk#7(2$fSPV^mel~JWA0cHq5ow+X>kwjFeF#jQA&jYmMKZ@aX6ob4kBd%`uS%5z_Y^pYnn2}pC;~p6+ZR;wjz=MOF2Fr+K zTBJm%l5Qydueue~1KbNBH>Mf_J0p_}5W_&;P$;@)Y>O>D1YIcUxwt~dc9C#U0EZAE z7tF}1IKTSxChoyPhXGw#S*b5~@;!4j^O{|ZUQ@U7G}F?k?+b~9gJzCXHbl|H@WbSL z+|s4thsgKHR_ljIC#2c&6^2!I#X%lsuHG4YWJ!YxXCo+*RQ12!uJNoo_abV))STOC zm@Y_05QdHD>%c{ZyEVd}LXKS?jAZpk4$orY>YANLn#RS*BPg01;4yU4CLvtNOu1W^ zNSt3%e7x1B`n=I&^5|4_{O;V=%kc2_?5WZXrf_nDc&{mfX>`syW!9R#RBfMopW`vWlK6Gq)ybbyG=Z6pSobL7>%L5ff$pOe$K#9Yww zHDL9$Z(GH&FW<|O8#^!rq^ST%SsSM(AT-k0IHf1_cA!ewYii5xi!eujmD*2z#kok! zwK_vZd$h2uy`^9g^ak`&ZA_T~h>SBaRD`P}jTHu+!9K``B?xF$+f{8t?3yH^|_;( zYJj6j4}rIW{%@cq4Y82X8q0F_R69rUnU9|Ms$tB&_ul`?xt45bFLcH{cg?ORh~Q@ig?4*E3hUHCedmWJ(qAkzZ<7Fc zh(Fu+097c_y|JVFBY9{PoPWIqWXRL#q(4STm`(j9Hh1F_v`6iW$)DZ(O7+BYA^s^V zc>Cl`po=y}>T@VJAqAaJ)s3lAf%j%n;u;D1;Z~M6Wv_uQIb%87(0D-^@q}_P2 z+yZJI6#kC?@c#4(1_oz^9a`;&*P!L|H!%9yObBxQ1mx**^?|^>;B&}pmVDIES#Tmy z3ST3$LzX>vk}7) zyog~!mW#4LNkOX8Uf>Oc@RUtHGVa#3I=|KrTbZ{uUAIX%cD3n=g6$zS!Z!MgHttrL z-H@90t7ZkDJ8exc_P0#O?7&(8p=HyK_9*@AlA?OMa<(m?_8gb%qlN*v>M$?R`b=W* z#Qb60#Gf+v)q9b&f#|t?@8<@?l^!3hYk%Qil!hPu`%L4EgWK3Os%`G>n!h6F@)Y86MNj@~&kXj1{X1sOW zno#@m$!iE(--o}ivW$AMZtv~At17%l^$Dd|HUU63!7O<`0B|GWn0!GB>jUB=;O>B} zzFp3N&)l3QFjLG9Oz^n4uuo4<11oaz4ADm$_0;JR2z^Rrb-6Ji(_~d$ zo>JIaOZ{|T5RR76;loX=fDkxPw+(V__MILO}*AGEfH$P<8S-`5WE;yxT?4f^kLgA2a(w$I~zb~)p z5uI0QP2|Nf1gbW~4C?eI>Oc}*5a3u@mtA7ss?xYTCH1FdoVN8Ij;PhU#>i2)N%9Uc zQG0itXiYs#|9>=nbx>E`_qB@BNOwqgcO%{1E#2L%gmfd_Al*opG)PH8P&z31+;_gZVOHKXxpQCKw5Tea{XBdiJS;8b>8m&_Znf*d=SmfKi-1?jvVfg*ydoy%ag? zby3;D3_&<(Sip+3DXS4@hR|)zNSZl2-ub;RaNYR}bYJrF(Xh1O-GB=FM_)XtEn-1w z>bDl@=xm;@9$|a`SUj=a*2=FKm=<1Fgp|$ScJ4}>)VZw17_npWoeU|yHXlP8m#q-I z0UFtR?gVO1)7l`_9?t1cF4jIVRyk^1iXuv88HqBNkwxWNpaS_1JKs*tT98{rQV6j^ zq_L0sZAJa;dh>) z#Hu@3h#MiHvAGc69b~|G?(c9hr$r6jI@Y93vYQV7*31FnvJaQ1bb{azmE$fT0S{$E$5HUB{->%-GaS+RD*5MKl6S2i-}h#-gMw+37D3KYFCE`QGnfM{mwvQa2d6-geV5ups{Z00GNuk>hS4w%>f&}o_U+f#E zNgH?XC)F~4xkJ`|v0KSgWGm!bS%g2)g&T?(x2Zv|1t1#JFc$ zP;>q_a<}>77afj_%W|~r@bBqPlruCh?7 z;)M3^*$_^)9@i@*;7OMD&#B#G>Ab(+*WN+Ji@jAC?KbcGs9E=FfZz<4H93{O?q*Tw zM1xBy@wo22k%BdzJ;ZTP+g1YM|AwIYS2liZ{yqH(Oa4At(9K5T!vG##Ij#PzaeJB_ zNnIUi4~Db2K_LVNSNZv*pzD+`(<&h`{rO#x?e9wN5=TrxRu(L4f7Y+cf%iZKucCaij=Jpy5@`iTg9qc_ z)OpMMhOhl_sFr@55r}bu;yYf(G7szvUD{(4S2R8A+$8~3ht=G@M?DyXjT0TZu%SPA z5t!D|W5qlK*6)&MG*oqTTorRJ`#M)Lx&30eRt1OB)sbBCSDI*>GCR~W?slSs2oN)k z+$PcDix7GSL4^ekN*>$H;3+5nAI7!sxQA2e4nTqdFsmutgB>l%hyNOwTMhp3Vdj7o zKhTv`9hQ{wa%lcvqZUUFS3E5Z?h|0Xulg-`k~`qj>0p{1<^O3Az|xAfwRN2!mnh0E zTmKgkmQ=@#EP%@|YBj!7S5? zeHv=nm0g}HUT*c$;;sYJRD1N0g8t7Lxz{zY(t~R&wH)|YewEz^H6&{eZdGad& z*cY_9(Gtq)m_UBAbX@f7m#g*ufbVfqv!;1{+JCwcqjaEMAuT}(w)&45#`mvps2Myc z>QRrXI{Y8xf8r{$XW8msEGr^8&+&#_S|XX8ym0B10x(&F(36C<#LKtJ5|@r&N1zz? zTE`hry_X|hvHAyb&7gc}xh{ln%^rG0_4XV#YY*&zq(>_k(6B`t?%z$eZ0YsE<=$Vh zTz!>c(C%a0ptDf#LidPFv^Dk|y3lOTAt8D*Zx7MQte~#g_`D=th1?Vgq(*|K>_nSi z))7s@nJ4HMMeV9QBu=O*%L)@{u6$k)3Bma{PQw?)na7x|FLmVsK)p-J7Q1@O&LwtfCnQ+dLFMt`a{O3Y00TY4{&Y;)bMrmWFr@up4k?Oi?-PZC8^8Ty|!3<&9FUk z@#Js?rfC zl8~C~_6wnWSk6shF={-&*${ZEn%&00c)pH)sM71`ZkvsfsalMXhXgM@x-zFfB9%D_L2#OrA_@O zy~5&Pji9bh1vFyBuxv-2BJlF_%^d%v$uS{7O}0?i8ly|a$@}|EEXk8Jq-ccNosUtG z zv;4>4r^T^SmlSTN3q%`Dh75F=9zY&}PYb%BV42`Jm!yjq%)ugaNdGa0?g_t=joLgI zI&qinuZC(9+uhb--DZE>vafwsS7$T;@$u5^^p&E?^#P~=DWu?QxA834!2yA++R27l z4fYYpp=iJ+6&!sq@5W0JkFWv}ACMC3F{Z$h3kCtD>*?(@NbvxIBLA)c;rE#7ReAeO zp-2abr!9od!yf0ZXM!X^n}K4#Z1Hfc}EJ|hM& z?S{*Qf>ho;u}#F zj9xJ{)Aq--c&u_Zp$5tbqe;MCr@+`dJFP?8M5NSseNPdlP_=3ls)>JvbUjJJBk<>V zJ-X`bzzF$&n_u%zVS_MT{w7Fuf;!7}fC8i0hV7{vKU?A|ryba8uVnP3(>?;t!0N)K*LR>QQpeW&YbMq>EuguYzu zb3O7&anP`3VM9k^*Zoq!?_+l$+WNW#^T(@&$M-soYN5_*MZda}I-=)Kp#@UShl4!Xk{M_J?ToQt;d6gRSQtD(03N#KXFu|B^h4uMdDO3feI#f zWoaU7*mS$wF2l>^)yV(hQd7IW?Cl6abE`gpmPNtEC_dfxA4&T!fg%-YI)JtOkQb;< z)o3}uP4`0vyog~_RzT4?J39{z58p2nI`ph)SI(9G`~=K4awfPS*-KH`Mx>}_q_{@Z zoPR1OiMy3P1x>O@Y;GYA3`m)&>^&UEzy*<;#38Aknvt`5e;>`NBw+L2RR|3UR!(rD zafd(h0x;{J%#fK~uTn?ML@-&f^3~vhj)oex=gA|0q~9{G)-;S^r@W4hSvC5v^WLEE zYcUL*aj*5m_P1!;M$*{KjsAeR;gLtWY<=A!+ZWzi91K9Uon1tGz$si!;^XEodpRs| z!1r|E$bJVzs7x(c&cF7>L#c%ZKei2}U{6*SOeMKi*PWZ>KDuOv?w!_0o8E};-pLH5 zJIA7@wLTE28MS+h)@?-!Syowo{|X6&j!6<|W3r@$%X*zeVpCO!7!!bUD`>R;v?lyy z3kXd_U*sQHecC&rXyXmg8dRhfG32S1 zVgQ&J@S?y;GE1SLjJB){j}3sP@Xln?GvgdC;Tq zT%kae7zA(*WW|;2u@A(hglB&bypS&++)0 z>^cwamKm{qJnXiFUJU~#mSAEoir1bs=5*s$%&CBs%8C$SihYLhzp^7!MpN~1Rb-a^ zz}atG*QHK>N?)7aJbR%jlx$GJ`K}|;cC`j8k>+u!Aes9T;DxdiP9W*UPuLydCQZR{eW*`9*NC4V`&^OPHRiE?%))l}|wDtz+ zeX`zpP~w{p)xnL5Hsa6$z(CE6s&s9^S7!^qGk0wwgE~j|68ESHGYyUU88C?l-4{Rxh1HXD^e1UnE1uyb;JAq<2Ki_yRFyc!|4(K@a_PeBk!U+gRK#ic)6KBVm zS$D%!{h_O1ra+_4GtGuDMvhP8?n&+L(R|DE|Fru6=t|&WwPjykyxpGe_jz1_CvRKL9g*}KLboaS% zYgVSs&7h;sGk)EGsMSm6jCq0zN(A*5Ga&8*&0cF&WDtUp4p0P9CMW|*rkBRNz%%*i z_xyZcciY7wMS}-SDury5+ZYCqjw~vslwzW#k=N%~q0Q}n)B>m7KG2`K3j$m2ECH?7e!q${v7PYhWT&FP7H%%VSUc^k^(2F+1aOdi&Q#QO8KI`nFq56l^-f?w5rdwtUgffw#(7&AD8r&R-e^MG`;iw)k)r|a0N9Fn3zXvkodAmJ4ad>Q zEVAGwVW1AC05aj}>7aQZzL_?sEocye*wfSV*cq!^AgplB{vR^~s)RBkL~n#BUf*2~Q$qGn6hwTBVKA8ygix%* zazM^O`Cr{7pT#ftntuDU8XqNI~p{463L|7Te@vXPjc94L8H9)RJukJe^dN1|Wx*udgt%3b;E zl_4`7e7ZYd;a~P>;J)#4F!7p7xO5_jGi_d9XYq*jk&vf*!oWYV>t#e}%p3AeniHI> z7};kopeG?Ku)#SwI^k$hFZtir*Onu9U(JZu=!WC^wKp&{+1VY-0NB6dM$d7 z$Vq+1Nxzb7R6(~(` z>Ia5T=-OAj165Zv7c^?q^*fO&Xv?tMtl$FAP;Y0Y<3|e}wFwq+zmxF|-Okr8JBO9G zMz8U5xg;b@FjV)PI<2lHQyRvBK2fuRoQ)=b-xG@#1uI{Ta?Fx7cr5ifjub1_1za~X zb82;kjqnANL+G(58^=MCJWs2Swu{YJ;w_JGuSM78G;}n(4TfDK0}bWWLlXvEA;!#` ztV?0#(gWxu@D^6Gn!>4c0AOFnfm4E<*RcoOh(tiTE-+@*1*fd8Zw#03JF;bd^0;34 z8Tj72%~k7u8}q&uUOAkr_%ikfI);F6*u~I0$?ST%zF+{`EDo`Pp$zh2e;$;;|Gr(` z+Z*3E00jp(n#Lh|QA+OyaLETI9ld*d)L{P!NNIsOc6XwM!(K(+sq+;&6snkK)&(<& z{xa7?V5!|kE7?#y+{7QrE&1#BC+lQyT5v)GUHs;G=DfafIS>{AjtQV(K$`Z|BPNtF zka#qk$+fe}8aIFceQVX03PGy5pC#qj@SfIa{<=#$#*USs$-Ji<19$;Z){QSK1sSDu z>Bss~_H4tH&h#JA(#TOKB^Z4{Q~{-_c2QN;N9|;x>&CnO z_*xOZ9y`3?g|0}5YY!jiZe|s*H~p%0zE5cLw^ue2Z1WKOeH(D~?lg zpK|f*^bv6$C9a|b@S>-uEtN|LaDPG?2E~o948ezb_cgi{CbON3HU~EyJ+;#TWPR>V@XR@O)*cPZG_}> z{uu0&g2GzCpz~*PT|34-6B1(M;9^!20_a`-qqV5T=9*+)ib0*`ix*USBt_H{-T|*A zgBRmoeFNRciSw@p&!78rZCM=D zEe!Gads6(lpwL~=DSIQWvwHtF`XqEw9gga?GQ6%@a3I~84vpq}wZZOlB4?xTi0}wq zz~IE1V*H#Nu{giV;A(Y1P_=+gOgOB?>)NM_`hs~_?Pwgt*fU7LB_fj7CvU&`{AK=o zznhHC@vgP)yvrl}r3iXSt7m82;n7aq2o?m8?E!VP?)u>;OIQy$C^ouSn$As(;2 zIW=uJT(bGl3QraKI0zmr z;Wz!Andv!s7C+)sdViI+j=2pXrG7uxUT-zzhZ*=gf&w8d3f5#RSwv@vZ_s){Ggpn8 zr5vgG*`SqQV2d+`Sa<-cX-(EnlZ~<=Tgzp;|0?+0++Kmx$VkJ$|Jm*+rix@~EQc>t z{PJ?41w!nGByYmq)2&RCBveHhhUfzQ_y}jtU zKeD7gi2S=!u-cqTD#?*D9s6a-I#xwQI#pmk0CR{4);?9!o%pI(d2BLUI(-K7$ zBC>>D_LwRJCOs7Ox=vwyZ;!ogRh@@NG9)Y^1}|G}_$3!#{}4#)7%;ZD?8YT>#j;;} z{Zp{-Wn9DQ+L-Tk^Fuf~vDfqG3MBrb96NYWnfSd9ZJdindfZ?@bxqyquGdhzt(>4( zB}gXkjVXB-Ob%;AyU(Yc^Fe#61_*nbA~#%4Tz}tQEyK4$jglHm`Cn}WDPk(X4Gmn& zz=*TexWBmT-Oz6t;vl=j;s7&=0^bj zvsXY+)@1{cONk3!)x@_)zlBSp178@TfD(8n>jpf4tpm9Oh>PeO7)Z#@R*;h$#k6bd z=(v0L)>US#SwaPakZ(9IAHBk$B`L937W9kJ+oS1VbDWZbCVO#ldZ7VAOr@Ce5mz1+ z8-1*j4(swEJ(_?IEOW|YMV)J3<*9|G&O-moawq79|0HbB`cCDmK@LKtN|3q*(dmXB zIU{HK4_WMs6l_DYiEpGD)mr?Pd%FElxXR#I)?NwJ5u)oa(EzZYlvWZ~Qc|4$Wy=DsmkUw$X=ukK*Bn>MfQ zfhTf$k7tO%b(S-cMdkls;(NQlxQBmpIU)3v;4w}cXAC*pXYz}uSoNUc(;rE$CyF8B z>8mt+Kt-<1{NAnlryN*f8^~(o+eLe+z4Kiu(eps77vFjy-|qixS?7-vrNG=0 zp}~s2T+@c?(-M255GfjZK$)ouJi13B)0kAH$jAh7gyO zMUrcb*O=pL0Xe_TLH<;qZi0Eup<8=C;o~O)%I{k7S#C#9PCP8rkbGvVuW#zUkeM8? zzUu6N+nfp=z^W5RSX3k6v;94==% zLeAEp1GdT({kfqF(pZOk3V7m2;n)Y11gm{h5dA1mfxbv%i@HNd4+{DL#Bo9g?cVJ zdoKRca(3PF&z4(Uw1DoyvnAXrR%keIz@=TYHtlSSC8@I`Ud073mN82>ur#2?+L+QT z(b^d;3pHG0He%kF3t5nUa!F}4Ty(;@ZUa)Hqd4t6AUu>JG$sQsJkV zo$c1q=~`YsU-VKJGxj*a`aIvqv#llUxaELhP2F&Lz2E~TD$8bu@V#*rJb_}Vhodeu z>}dtHTU-Tu`d&6W=&7{pt5H~sfeUTlJwx_rBH2qTgS%b3WprR^k$4j3D|j1S9p`hx z-kOwVIzgb+A=wajD#(TzPzOh{zWWsOX|jF2-j~xEzpIn^8a)o~JwJDzVxeW}&ykgg zRnyNqfnVpvo1h-b__eeY0obuz|_RL|vO%?^E?J|x;8L5gm(rNja7Id6K(p zU4C4+yORMh&nj<)qb>L29Iis|bUQ&CZ=3ge%o;eds`BNswrjVRY>!S#yC;vUN*qiQx=6e%(_ zN5MxQE2<2!U8)WB@~UUXLzJ6H?+a|_(9eDj08-$soi_ik61fybnrU5ErJ^Z4k)ejY0W2uvLc!;8)r<`V?J^h-E` z`w=eg_N!m|=8oIEuDX2&JPSYNqP&;GgL=1)HacGP%8OoHJAX73lvF~2G$~OWn+bah-5p^A zhE=i1`a~GYHIb5=EyjOCLxEvBmHno$6s@xP{?GLUus&g-IeOBClM;aga!;d5#%P;3 zcW@|4I&!tBrq%5!zGm;PCxjIHqI6pv^5F6=ihuE`<4jqw8u}%11-!0RtdOuB$LO`! zVbwFFiH}@pRk@$<#>!eAxE5rxhA;Qy83a6VRS0+`H-;x#@#_yG{J6Z|Skq(`<&`Y% z2v!IQtxE5$Si0gQQlvDhlDSDKLLp=7rdgEAZcdn0g~oeB7e1OQT~`}FjJ{b@=9UVf zQfl0Ye7gO|x_qDnulM$yK9k%%331{;EwwVW37BYuU^#pEpc9IRSNQh4u}uB3k?(n`^RcZiY~hGh zB28Lh*KDoyWeG=HA~{6%B>RK#=eW0B$W1H>GrFHP49#_g;n%0dnMrg)FH52*iT`?V zIGCIw`~PwAk=ctt*kUt$`IP)UbE8-u;r`_r-D<5Cj)oY@+O_E8pGg0{UJw3AiL=Qi zOJcX{USGE|+zCE^#vBe<s{HQ;++4y_NR8vrh+BN>wz-eQPT(&uVWTCC}yQ+9w z7;OEQnUc>R*WKJE7w1G|C6WC@@S-(5HbhH=Z}_N%&Ugb>SbyX!3!ER!3Ja1Nbj5;= z3Z0+k%hn>uT(z(Yy!HfYw3y#MzX4!TFdTX+v(Y=?1oJl|Qz;8q_)YPeC=l#vvo+>0 zRL>9I=s$vFs*`p%o_uO!gnH+}gPo`2pIp=o;Ozs#@A?>y?sOMUBBt${|DU6)ZdZRUKAg^?)HWB6mr z9lvW`YQ%*v8AAXfTUq@cT;+;3I&7X)-h?)#FlT)z@b(pt_)~`WavGx9Vy68T;o?yS zhbcW}#6X=?r77 z3N&T77iUc7Bi|Pi5bjXX+2bVKTY5iXTM6YUj>`LJ$5@i{~acyq>GRblxIXeK6dH-0H^t07}>K zGLXmw!-UqnWz>16MFRuxL9#B1MsLZkT=F)F(liJzWi9gE2Ty(1$KsmxY-xIf6l2dLssKnf+`ilp!Uof!M||qsQ1&lO-?=xriiu_iNkqny`_l1EI6LQFh@a<(xWikcHZC%bEi z7dnYiRXn{aTn;tWTPf#t=G5sVD*&RtJPtC_d0ciU2>feij6H%I*}5|OaFYtzqO-74BswwK)aB7*)OhXbx}@T zUjTQ%R7_$a3>Mj>dzq)g$AeB%F_Y5AdoK5JKuo;O`d$Ql(*bp_f0Z`}YmMWy?e-!) z5$^VHc!NmAQ5rRfwiP7}2lriS>1jek>ofvLDc8wDlq(@Ia0o2aZchcCWRC|5e>a@Z zc8(O;Na)WG2$wB~SXF+WVHF_d#I6Pg;<*{_uK9B;1r-3jsfOXRy}r&KnTX4MybDn-AD_tQKPu>|5e_iv0i znRpF3R__AL8h25;0(_9?no-yTgV!M9q{&{f0nsx)KJg;P(#l!CPu;g}ydAG^rj*jh z4=i?BTI$lreh5C*;VDxW)c(w_%jP$h`AEj@lbR_IqW@#;ZZux5E)!B?gT^v#k*Ib9 zZ@6Z*{UWY-o+EUzB`NBf0I#+om*Gc66Dv6Qz=uTtIBIfbsNH{eUjc8o(U9|sJ(WVV zktZ%4_ElrKw{sfac*>2P=p4;Y5@+DAma%!x=HEpbc$Fz7zVZd1BeOp){=xElA|S+K zWiEIG(`}09TbtkAX((X{7lG5XzQowM2*|Sv>eKZCn9VC0Y*J&+!iM;q5II} zt3j#+c9!g=(6TaQ4%GzjssU(w?W8nETiJcMyr` zl1kJ`hgbuNN#Wo6s;oUniQH@?iYLK;;5xt?cMHdW7yg|)M*{oqqayO^R|i*d_+d%W zNzQSe=Ug2ATzwP_YIW54@*647u0Gyy z^P$EqZ@bDh+58C=tNN*Sb)M|LTMI38rXUcDhEsjoRZJlF6pO@QkG{weT{4wZ?{i9H|2k!i#(1=0)7Y$foL5X(K00HY?r9*)lbn>r~dJ6C%R)5&V&yD zfxL9+=Rcd3Tp+-cTtKq;!SVmK08wI33Q+NYb3AtI+D)6SzdQXcwk!0+k==qu+2yx$=G$s~5<0s5)w8kWI$}y|$oE^hm zU33^RdK!^5ZQ{#=3_P_e-y%b5xb$BSx}z^mIp@z70iyD|P*3g#&>9WNA%?HC5Ta*~ zlSh4Ih3fd4X1=@CwIb9_9vLkUC`tbtoTk@Whd)OrjfsA1^Y;&$pVrydUU5T&UOCpZ zpJegmc-3AE;E5h76f1^^dvZxh5r2m)wTI}`w zDljs&Uwaqx6m*JpGFW!Lbr@~2sJgaW+h1y_2Jf8h8*^Ialk6aLrFrBI8=X3lC=`&6 zNeROjQwd=zRy27uC+WKR5a*}RYMgS>P^^JAwfz~BD^%QQ$+MO{-OB|MuX6A4vYgzj z?^2JmrGqvfMQq4$9srvyR2#!3(^SXp#Hl#i?Bhy@aQAQFp`Pmgy2^dI|pI6>^=I(E%+z+ZUsY&Yc&Pr)(?&S%%L?LX(y=3xxVl>&0C~ zjaA>kzxa?-Alj2tO0&M68+NTPoKHU;g}zGMM0IP*N(M!Y^Jf3MaH;E=_TqiLOdYJX zmWhksu@>ZI4?WasU6xeVQ=sE&h*!i7zFh%Zz4bOh-qG5@PR3KdUyLmuRFJI3UObcx?A#;# z@lC1xZHS?Wk`+r>$AW;&mA3$GHKEVvQ0d|pV$bN0fy7Vm_6SZKs2Mg}4->Q+C|zZc zz)dMQ9MG|%hyLv|A*PxCJO8&v0Y=5a{dE)1>lQV#fSRBDdG?O!eS&fP9{0fxmEptxeUg zW6sGDyo8x^SpK7G=Ra9gH;{2E486VR@x;TL6GN( zk*t0&XL>rwk}OUaePNA$_Rvua!xcg<@iVD zB)!>mxzpqm6@a2=!d(6J&dmIqA9*5{Xz%*JVc&JPQ-$5977oGY<7J)qaLAY)&@F$( zk~Kw3S@=dflWM2=0HL0d5P4*B3WWEwd^MGd9-mpO{^;UM3I%1&l*MWV+v0hziiU+M zuk|Vlb;lR!`5gXg9$lV7R2hAxZn!aD|B$csp&>pj_}jb!YNA_-O=%b-`%_Q}j4Jy% zHk$>LSbv#%$+gb!sOwFC9eSuh^9GWQzVE?o{G>W2+(C0`7>HUT)log_A^*bQ8uV-R zu`x$5rH9}#d1WzrG5?`57>Vije77g2R|_~Rfu^;Ui~A;WRFxD-TkF2_h$eTo zzv=t8@7@+RDtJq@Un0lF@4I>gA>t`VpHRBmePrde6vNcW!Yyu^NHngXW~k0}ycMh~ zRy2A*!Q=)Qh)0D%j7GW9ZKtSbyWe$+v-#MUgQRfVrIwUSbq-M?lg(hY3+KAU7RZ}1 z2D<`hqM*qwH&WPl-m?qInjg_jo3COZ8qn+)SLg+A1w6>-lNoFts zDMy7rf9l5{y#1oI&!~ZTA^VLb0LfI_{JCwZq@v77x?8VDM3g!;MOMx9Jw9hg?9%bu z2e8{wtvAq}zon-3(T^}ZHqyMiU2k=*CDt!AHfGjJPvr9foluz?_2h?YIxfPu+Q!o@ z9Z%PHOT;6~X|-`al#EF57@yEGR{u=j$0nkt_uY^4zPMh=^RDP`2~;Q|{)yY?zl%-r z+==F>@VWQ$f4qAa)h!|>JP?1_DKd~w%4~I|_7A_NO|q#cbY@Aum>%^rj`kX?@aHoa zSa#RHG||~I;2Aho)k9~g1j&089BK#)Dp-nfkl>Li1msZlYk@rjzFVUF-qrrB@??{S zj|?n_SG5GV@phM(VrMVC{(un zOg^opJ@z)bu&ypXbkMiia?N_vVKhK(hH?Zn=uxNa!`ZmGSh9^q+2?`)DU;j*zK3v~A=!3o?QU)z|F?sxOU2Ac+nCi+97{5e*ksf#5<@x}hxEz_0N6i|f4rA)dq+YHk_1?% zh9s>Je{Y;@n9AbD4=@)=K#$0Nz~uq7kz>b?ujG>lzqT%XB%V{-cK(PIqTka3CP$1fk8PBLu);#}x>3lqrjA1Lpi$&P+|vmUT$+t5_Bv=Ph8df@R@TNxK>?xSFmc7BZ|I$emwfcf~Tps4ek z iYoU0*q6EW=QM3%g%Ck|8l1?5du=j`-dv(~PuqQ&FMvzo^I$3;jXoE6CGO+lxU z<@P@qP0bwq%;T;4IW@Ey42Dk5JBf578v zzvt-*^h(M`{?~d=|Es!3Yf8j`I}xC4twf%RSHIx^O9_+Hy_&{s&Fz=TIKR{=2@M8AF&{~o zfak&TBRX_3F0OCxeZ#t?A~M1iG_k9(9Et`ehmy|J1i6kCNRfKCt6*BposEmn z9Oo)a#3(YxPfc`px=9550^h@3oNtrKk5Mfq)LM@w{nGfmkJo`BGnx74C~brK=>@^< znf&^n7$7-%~M$@`N8slJtC<;SHxvzp{ z9pP?JuW+HGD{QJBlirX&XDCb-3B*HhkL#wGAl25GJ=%MFKMrsL_)0qs7vqHIvzPcz zoL})z@>)j&M#-40UEkTi%Gd?MO~o+M$x5_+x$|T4frF5a*((U8SB|P|MuqbBbKu2 z(%0KST!_?q$~%lEja+prDY$S^eD-D}XY?s->Ad1Gt70ES0h(4HZ|x={gpG~7(R4w# zznrx!%F6-s)~i~tM1zXS%uEhgSdrn1l?L6n{ugwO#|!e_)@bnk>xWDu*i2srtDtPX z0BKtMI5&(dGZ(aD&%iDjR)SXZp!3KNuGQvNKE1ZI6} zCdCcdGcu?avY7H6xy<6sEHv+eb}yupqP8vb+N*+yJl<$48Q1m4#eX4k#V80Y4;^^$ zPH%kzk$SdK4GG?AD-i%86n&T>x)zQJoQcg+j3G^Z>ot@{B1 z%_0|55;CwF*B({vKO%Ls^jKnhDy~9ZWmp(zMlKw}qmT)Sv# zDY68GN%|V>9fKVe`VmX^bQZc=0@JHfC-%Ck3Y3(Iv4lbbEQ&GQQxZR8xXJWphbh*B z*7QYPpG;3x@|J~hX`KZMd&~}m(3L(i=*)rajkhm<&{v8kRPM6Td=Cu$8wIEXBjZ4kRj{L9M zEUm(!tW$RxwA}5N)Q}Lz{9kYXwM|Sf3S_kJYy7!Af`p0wwwxjHJ|eJTx%i#GCp#w6 z|E4P0TSiuQ|G;%U2~jLql0=J48qYI#*Vr91G_H*pVJn2jG4}#?36Hhe#)&m~-Fx2c zGCly4ttVkoGaw<6VdobgVPA~#n6aB45wb6Z!_31cD^u-VQx_iMI5afLJ;xCDp!fH% zeQBgp^^{7}vtmCA{QJb=aTi>2!&<*fbe``_pc8Uj-7fDq*WYBx_YF!Ua#`%wJW~z~ zI*rtYw4Y675D0oFsE=S9xY7TYIu_F|t>NMT1DXo4{oYiRbneY(7`O|k&tRxf=hYKL zCM-xD;EAisCgQYP5x2C2l|{HvF8$ugvA^d^EQ>bxmc|r(?z40$XC0pedb6L!eRs2$ zpjR}@mFrD6_(3fn|1Q6j8kZd3dbwcB9S(e}TK~NKcqQQUDnCy&8bAwqDjq)HYJH6KeD;Vmn^$m92;ks2m z*1(3XN*pr{8n2GkfjgQK?OvH}&qg9Ml_@g~$N!`08>92=p0C@+c4Oy`ZKttqG>zHV zZe!z))wr>3+ji2}w%_adz3abLzO^5cbDcA@XJ*gdkOxmHBUXG42zX@Jp#6{AI*IaR%j{9Wa#kK$RSl%Sa@OseVKzQ)V{s}Sr<^Vw4y zR1nFDrg-RR9;+(q_5e4!y6&9R8`)L#6K8%4Elkx32^vd<;%Bdom?5VszBYG|jgE^x zW_7h=>aLtak4qYWEFj8j3>_}y46U90o_N<`v z$QXJRxrPGNzqR%ic}cxd{e5XYq=$Nl-+0oxg=}tE&ve$M`}=EIZG4*tMF{cs*cO z8!!6qAB+!};JwUbf$5!E>Iv++B-=pYu%cBplCkL+Z26|0)yxIe7mLdU%nkPxW+V48Nm4^gWRO&kr7$Dt1Y{~C{gT5)JD zV6qGA|4St2Tj{($Cet%iBncOzI1-59CwG*7!QO`Ss8kIi(L9C;1=>(Vri_Oq5`dug z-%3RDwK15j{Z0Eq3L|Ez^e7G(4Mc8;kP}zJ*GjN zvC*7y$j6}R4*q+~F3IZyG&oBXxM3AFlon`>>hkl>T&Gu0M6VZXDz(My)OUwosH*Yh z10M-67XuBQy^a{I`|MIfs*h16=@KpG&$#uzjNl-Vt-G)Pf~yOo>C2?=o?j18T$WvK z5J?+{#%z~&FGEnGgW}Cp@csVtgL(`5k;=-v1my+w|TIvB{=iYGi6uQsN8myc?E^WVlP6jH7PUK zPGwp;%qB9>-!wH*D%+os7f{&{_Q!=WD+K`$^k@?R{6=SRiw`ef#}V9f>>xdIFFPXV z=}4MA9xCYgLpH}LN6^-g%}mj7u-`XCJ=?WxUYL7r3HI3Jl<76tO9{dK0>mIxn+`rX zIhpClp&J3f&_bA~-+aXVC39T#K4;#-{q}dOL$ko^VRGkQ>gF49=j&P4(|Fb&^TCQY za##H~cIQUrqoTolmRQ2K?&As)Sils6jGSCrPR?YzFAVS?M#aVs0Xzr{m`Py209UTA zu~GHM4@GftsDgq5fS@!pHx~$4m7Ec^CS;KG&YsuYY&^B!dVU{^%ACkJq}dV3Plv8A z$|WI9-;Kq&Um!9!ACJ2tnu&^O&$td&ppCxRmeLk5N6yUCEeElv$g3tsRA_La#oJhj z-rZ(U|IHf=LFEcdsIwfCL+QS_+NKs7J{L`_lXV#T6DL-rE#9|F&zcuy5&M|^4;-j? z-hI>vCc==kDv`RIhCltTAL%emfrpg8$M~);JsuXT zZzoFSWQbSPaO?5rp9MI6vY^^mr%`Gm@Zfr!)9w8`nIHin&8fk%v(@ExNlba#6&7J(*GK^5TNU=oWmsq$u&KYW)YD;>ppJpq_ z#JOVyq?8=+ATpm}8{1cZbQfy@(4M^Wb7D~jqaHYtA~cj2VGEB*5E9YQ(4yU!9giVb zKpmM~F;e3KuSmHN;ePaEkjDqbsy8U@)D0I4V=d zM-yR{79|!tUHnyE&q`XtZ1%~gj^}K5Kmlog016jFMPz#@YvSQEOeoNuOzfA^l#<#n>Ws$II(cK($Xv}p`Gwa#m116>R_}q zj+jCLl2d?;kKfyiwc7kVx%3Q&_^9lx^T8B7lo@F+tH^)*dVlrdRw5R-9GWx;`i zJKZ~1z`mkG>pI|k`=1m0@iE}lovnB~WmSLZ%v-0!;MwlmH^DGeka1CF>~_ZT1>9$I z1l5hcu=7iW6pYW7*seUtv!>N^Un0uS>;a->v5@hC5=cDdV~X>&X7s4`nTU?YNOylR zzzVxTq~?pBLiM48#-y&-QTxqkML-6n0lG7nS#m4FQ4K}s|J*~VK-H}@*iFV{d35zy z5@A^jivRa8?d^$O$$o@tiW^jBD&tE4KPQ&LfK#u(5($@&i`iGPgbnt@pF63OS!yN?}$0!zMLo;DjjJhficP= zh)m>|i=4+Ivbv}DRl;>At4sHB9)R?BP42E*=eD%mVvGXx{eIG|$yz>nP-x@T*#OBD zCWhcZHp|al%Iz&ji6*g3Pot|<*Yz^q{JrZX$Sb5`jdYYi$OSrU@*^iOHiuiuFMPHf zOAN24iNohJ9!t|R*6zMUG3qd)qHy7i(uqZGL8Gynw+@hu0sbtXcKuIMfMg@uaPtCj zy3|gL>i%zoPl-0T1RDCT};uBXedL0YlVm19qGdW;3Q?5Lw&D zyV5}HpK*TCU#RVW`bS-)8U&q;Snk~XWr&(ZqK}26gQ-N1Cj8Kbw2zV^TauE7EgmQGSKk<} z8KNPtQ4c=PkCQHIc`|ZsMX}J}<(n^oxOYV=e`}}gMCL@->Tm-?bYL+YWAm+e*)>#V zRYT`o*ygk3Q+iQq#JX_$>mqR?t-|Kov@P%m@uRD~{*MdLM1hKFMaH@fHw|^ED|%Tf zHph!$NQyn;NIga&KSrjWCv}g8`hXo?1lm+P z;%)7io~~w7iFh2^LNIqJ$!3$}gkR13(5TiRA28EQ+bg(_;vWms|(LX)&v(O04b_J^RhI6rEwJPtcFYIYK{oTO>l=sBE zJ=;(o`IJjIZ3=A76Vzo_)1|_Cx+1KhV^^o$6EW zYygS@i9F%FX#-Xt1Fh3LPeA=JITRc4VFOl+fnmY#Z~t-+a~4mS;BoNet86#wRrV}) zwVY`DNvc>mvXpF?^S#;tMm14fciG`ErUrI(=R1XTl7*N!v;QG_9j6M@bP!a+v%Sjf zGf^rVw0E$&C)w<5XxpVyodk==#GZ0}j^11Tjo#x0IaUtu=T2K`_cs`PY0Jy;QNHuB2H1 zv+ykRxX=V&#TqTj+mBs1ys`$VvNuWT)S-d}Q_4tA{5S}@#Zoe<7JFQUKb(mM$}cCz zV#e7?g}aVb?-Ztl9A!+K!`Oc}gA_cR-ll9S8MobUw1FY)X#C9-w5Dl5B&n5h|5{Tq zc5j{AJQ4YdN$dIHuaqLGj=MPw_qPrN4_}`z-FvroDAg$;&hwpk@In4C7wrK+-r7ci zR6-$HzUOyOHZ>_t|}wk!3drT((n9AsPnZ@V-rJ3Y!zJ+3b>+ zh;)sZ!zvHE43;YSj6~haOo(u~MxI6~lQcFU@{Zk)(771{s2?2MOs}uY|0h@F_akBD z+jOpwsR>2yqM+qzsgOc_9SG|pQ`x^92ytfNv<p6<3j~hav z&SZ`X^>BDo^*L06%pR7q#eYx0V(aD!5b$wt*9W{3fJLaRNf`Su3*cQ$pWJcP+bgfm ziz$m{Dc{v3=+O(u-#SQs`YVwiPnaleD31nntQcny-cl@7$c3J}@J&yrDqJVFlx=(F zeLJ6L&bhwoYK?Ir5eq$+rH0J(T#9%?Oi%mT!+jz?_L1~PzVYS?Ma+d?oXhL9xvL20cyIhnN445X-k*eFHoO&YExKTuB&VoZI}G>N+V1GFXk8In36Ff?)Oan_*6O1 zi>TNsuVmWLgnsDoiuUq~mh+01R$HgVyMq;xh7a1tm*?;i+zcDY)vv@(9(5t}04{74 zaC0vn^5(4o%ti%b_B~Z;dpA;iGaOm5#>I=1){p`h4V;ks*Zr1@Bp&G)AiJN#W)?KN z#I>XVgiV&61~$cSX$d20&8E*!O|0*HHyHIqf34UL$cn$9$4rjmLuDzi>5B)0e&Ywf zeu+3=O?QFoSw`Q^L!L#A!}CG4W{`L$@?L+E2qejt>L|E4y%;&E=zK11EQxDdAVfiFKN_IsDl5 zdi`~Q(?z>)H~#%seL*^Jdyc}Ln|>tQcE zniUpqEiK$rT4Eui15GKyDdJ4wf*?AI)YB=Gdk#$H4P|mLrvKFBD@CzwE$1(5Xol=@ zLr`aNiW_nzDJ@APzrJTri!7IwrcQ@FGg+73sfq{kk{KkbDm=&u>X)Je3a-A-t zrCA+;6|xv_5)Be(4>r+UCk0M9V1B*7Y}X+&0xfe1YHM}K)Uif%7KbRczoJF-v`k^o8GvtG3ygdZz+@mP`=TQ7krTc-BVvEj%+L38 zXXnQcG4YP;%++U5QE@pHBjq)p*H#8CT$nsovom+OTsZMW_T??Hi=R)F9-|~i7uuC%J_a(iYGUWJ&oE)s*nk$lsguH?J+@ zgY+S)eLq9z3n}T9^svT4;+Yso({Vla2~ltmSt{^-G@s)-Vyu{bMR(Ymet+*3rO9*& zB!=tPAzepn4Pi&5BOX;ArmVcI_lH9_683B02dSE!nZ%6Nbz1ncPJK)c8sN0)=U$^q znjDuHC*f{E?Msn=QKS!y6=GSur8oni->Yb}rNgfD>P^t-gtS98{eFh`Hwt~F0QIqY zUv^!r?W+-5(e6bYLja?wzo1Bwa_)y@fgzKc_#`(1;wVpk%dLkO#oI>vW<72KWI(z1 z%AKD&aU>ocdytMXnyLG#dU8;)xT-m_rNYdNB5EM_Z2effaxr3jA*%Q2pO=%s;Cr3I z`$H;aGKK|v?&66j!xM$5gr^jl!(Z6z^ca=Rd0I+$I1!=i_zo}1l-wqpKBM>QH}M9I zvpwP6H9^NKo@uQiAX#+qCpW@t?A*3AlbIvO?*u=%YWdrPO`PbHkyC=^m&earzHH2R z54ec>3TN-nEx2aMt_h;h!7nN=sVMl|-_JhFJdobFb}{yvtxSH6_><8}^IRhu^_~8Y(O~BJLsu{Y90Ss#aVZ*SvBAxPk{IH0fhviju?5Oo} z0$YaOy_;Axu+%rEjzSr5-+yeT$Ld1+<_zjYT7VwyE6vMU45d_(Fl55oM#SVReXKn~ ze&IpnEg;>^h8^<*j3a2m{IL0;OAow(&S^!8ZcK3*C3<{XM;hBw3Yx=^PFFa8d)K#J zns>vv)HVKFvOj#6g6Xtwvu6(WJ5%BmX?dL=13qfWs}te9Cy!MoY^=NVQdvDv!x&2U zGodWPk3S^D%%+o;hv}Y(t2>OaX_B<|3*?W^swQZ&c6ZACCztf@ljfGpx&38eNB}j5n z#LL#kk}owo(g;B!zhw$U3TFYorm&bwDn=b09edtP;BT+fISY%~kw$FR^95qrPo5PG zc~f%%xWBM70qCB0eT!SpHI}0qCS876-k9m-5lIUg&N>W~wQ$m43v27%vn$lEc;OOx z-B$H8%a$M#l3%|*?S$pWP!Qr%G5W|tU*+3GQ-wv_QNCPT2Z<;ct77;)-ayQ8vEN&P zd-7RWx%o3Q>z{VH5}7F}VQTjWqZqLvw@$g~F0xfIB+<&aZsyJ#mlw7AMEQPfrDZ%J zMvaLvp0pNtZ~h%w>572Ss40K`^ffc=$NreH#Eb>zHL-7jB&x3!Tl~PxdDWFfH|-yx z%g@8Y)rhaSQA2OJRzlXJu4JUuCjSTq`b-{NrTnKV^I-kUJwJ9E#n#@|-+;dq*AK$1#E+=bq6KZk?t5FU2Tk z)U$v5yL3L!a>rmIaF1DQ`SNG!=4-O~q@l;2IDhp4!#R$_(_}8elf5kN1%bX~UVBson>jO^Wm%CY zdf+T(HYYQOA%%y0e;Lyxh=V%XGAz%}Id9nM_vFP+z_$Ep(Kr<)NdnCkd7t$du06kp zLz}X>!N25LHo$v2%nAYUhhMiXtgpuc&KD?_03KHk=srI-r+jZn2 zmyD+1=6>`WFm+lju3Ol-_K-pf2UVfa8zv2#9ML$?Y-e&Ue9{*`OOSCmMXbh@MScEV`>u(XkF-0I(R?`1E6BLq!xv<|r2AtiGQT=9oJdOVU#egAYt9Ox z26AK4mGafsd#h?i%fs^f=MG% z{%}8Mq&ZISxmI-;QB@MYVrK1{D-WnKPGn3|RRBrPuK-M!n#mviTw$h>Y;%zK8Uw3@ zKLjs-d^Y7N@9P9tN%RVtyf|Jj`jwf*Hl>L1NPN&s0}{%|BXZxhwR-i8ik4|*Wd*Rt zrAl%Gwn%1=#2AxjS5`)Xk??W&-I-HUQ#YmjyQ)n)u`=)Sp$0KZgxaT@gs@WOBy_!C zJlmti5%#a=*qCCIl0>Xz(0#LF%2!>LHGfR5E!W~OlLU;6&kT4`)5_d8!SF2%>>3$C^gaQ(OY!2nLT!5{)X@Q&H?mwS z5V`i&b6vdE+MxaiTbT?rW>TDLbi`068c4pA01731fA5sKh9jy!q+~H2Kq0a^xHOO9Xegj|G@#2o(cI}r+~pi z3X8FV&ihvKtD4SSWMd}_0Ak(HBW~Fywy)q< zGdU0d?H7@KdRBuV4wX;zf?b4(GYTUgN0%%CMFa2L=u3|h-CW@tH?R*+ z>4mSJi3FU9LtS|q_@0)Q??icMj{;JnhWU-3asbKHz(OX=W}gPuT*l0vtP{@{x03iZ z(1yc<|IZ60h7k-Ki!IKwVX@D?%yc8r1Q@oaHFMe{a$O+oJG-l5-r;8)&R8~IfJf+Q zw$j;_I&MvKFSJJ*MfQzUysjp(8Q~ECxAt#L!1Sj-=9|!wwvgBo`W9OxEKe5X=K~>5 z!rh%4Z~Vizv$o~bxupemA)UF%#hj++f+~La^4Yu4hp%%|(ZduAD^Y!JZUGQ~`z=BW zAS+Z{Tm?C2cA$cS)TJ+U>HPkEeK5)IHm;#Xruj>rPKXF);r#UP!3(T$HmIDK6DPl% zVPO^un0|Y9SL%YZdCZ1{|4u`6T=FRwfQ8>bStdcEk1HQ0@*-L>01L+fIuZKCqLnkb zs#cfMzQ9X8C8Am|e`a*cs#9hCmA$<|+3LkfJt+EV+J;{&cOglPPT7_a7 zlRFh1q~ZEO1$A!DMx3cdc0WldC{oTVY*kdjVG&WLGlA85o>wAYAf6TOhK}H8paHf7 z5P7z*Ta=4m)@Wi$V1G=Te~7618%e{3n;NY#1J|ke{AYGkJ9xW+7Rbi6?UX3o4R{K9 zO2$)%%q7k^YM!^W4EmiY>8Q{pl61XHq;%UWK4g)oKVcCW$s6SB3Yxg=0M!+`a1Y+O|q>&X9Nq4kK{)Ok%cxAoV6UN%p@Hsby* zm#g=^a!Z&8@&jit%*n^WK%Qq&XFe;461lx&ENK zEVin?{%@VUEtJmAh+&MuTC;TtfWLs9Arzkz;OPD@N7BN=VtZR0L95jkqH*J0_xx?0 zaIDi_!R}(j5@8{grO3ICd&S|2znw6e1a>oTl8UB7rd%mg3)wMa^`QI6W#_ut-g8~x zN2~JC?xC6vJ3NO@0d%=alt#{1Dpr5{aG<>)UERk@PZrNq@=#mt$n_uEpf<*d3r0l` z$dzW6jQfhIC?VB@>+>^aQ&w6ROLDaoDBkm1YU2PDsB=mv1|4WW{3}&19ABb_2RbqL zM|&h(50ACgHgzsUk9(d07I5%K&aTxYKu8@#5nT=OTJ=sYneY@8eCDwpaRme$o2Z?5 zBUlSD3}N5j@evLv3KydmFT{ZmqkLa!$p~CB{>y*lW$tz$w@nwmgUOT;7p}Lo8*>HY z>%OZ`O#(#Tf*#&!2mu1 zAhh8E6sjpAXa-e8#-3n!UrSC00y+^nPbNmWT=YpOP1WO7zr~9-yJby*cbzl3L0xr4 zSv0de_4)kk3Sp)gj))XWw7KsJCbVQekblo-kp!T&4rs|K;?hI(<$kSnJzsxsOL_SG zB;TKr#UFiIHMfC$k>Kn_;H_Vu?6TKNZ9&tYJ>wv~F9&otj*~SfgV+Y?JmN@2X*9`% zdS~~2t?b%w7_)pEzSirE2g_&Gx~@y4>FVMLx!#7^mB`Jj1Cp`3$xdsOLuza1zhBgSjKu)3(ZRIz+U|ut(|b&ZACeL@NbF0F2~o| zpLSHk1iiVDmU3aljCfWE?w*tuMSCN@^HC-b9dB(P-BfyR<0{amD7&@uC+^lyUH}7( z==H%E$Jw)vmmx}CK0#g0;l{>o>p^zu%$1g|l%}#sq+p}}RD1U6&W7u1#M-XrG^+8b z_u>Me^4#5@XQJ2ZMTt~&o%6V!lER8?QUVPEk_=Yh^qNRh>_wSVNu`0PE7m&uA4MgI z!E{aw-@zaJ;9BiB{MHHC7eoLIWc=k_KaqBdV4M-!l&1Bwv(m2W*rNq?pbX#$V^ zVP~L>WR!v*@rnRL^fw+kfXuq{AJKs9ONuQk?spH6cuyX_WUJg}6%a8d$0zH15C(L2^&=dh z5fX~KTfp);J=otME&c}~Y`#NilqSA;z!aC1fIvK9UB5nwh>FIJn$ml{5rTm-`7Eans2BT;EJVsIt-RDgn3yn5ck`+F@K%^zyF%F5v%@}$gAT489?fwtc>YNOh^9=#zeq=aas6xS6J&v`__|J;9 z@%@o@fU%mBK$jB79ZYl8I}9&QoL`(uoX^;!!{ z)xi?i(2!K_5BGWB1BLWXq9O(hd!0Iwl?;nL2h~7W@%~*qdv2j|6X`4|35B(O4L2yNDj~y z*m>BF_og<1S93J&zz1hKj+ zaTb{Fv2${up%M8mJe)WW$3F1eq5BSRj!wh+U;2psFEnJxQJz@ZulmWD0P&)>2k|ST zRBG2{=x1-`_826rW&$f-8A~rDS^#{md~2ieN0cRl5RC^COP&gK968@v{@=hrir*AZ z)gA;1K-^r?kuY?kx%H5|H70raf*-Ls(RvWOs!F5$f|C z`302mf07)xy|C0d0)w@tjua{|!JakDV2aFJE^HIdEr(`62$huaekrj1v`h|}m`B9s zyJ)ABiu;>BKvyQ|&Bnx1@t;}@1F``uVEbeqq(@0bOOg`H0z^3OB{dOa zH++VB*LyAkVFpd~GA<0ea0)fzKymy~aXT_C>mHyYDdHqa9tJ#g9zjAxoiRYs#3>0= zj!ah`jl4q03G6`tMVO(}@|CQhH<%cgRfWD9z-DCR+;L;EkYDB`rrksyvoKkCjxnUe z-)G&cYiGlI_i~FKsX1Jb9(@F@tgL}SAlCJ3(vO};Sx?1(-pur+LT`?i0}KgY z;9rua1N7yV+U>x*{@LCZQaEsS^Y5fMo7qaNAc5r8<-hj`{INaS z1qpPa%+MHyh-Thns2TcPdxRVW7WDf{H_BE&qvmwdi%zU0?i05?o8^KQCG+e&wd5{z_W?eQ=L$m<0J z?U*DT@l2{bZZu@VV{(C z16cijLIKbpao=A~_ShN6`lMyUnW3;424eQf1VoQc9&(jSroz$o{ihE8@B6h&08v$= z2nX}eMAwvBn=ez;x($I9V@^kD5VAS;S%t#NDQ8Q&Ya6hwm=%JjyAxL9+$3@Map;UrG_|{2kyXr7v5tL3hY!kd+x!T{ zq7&NHjayHX7mQW!N*P?$71 zFSay{O&rxc{2Ms`&pSH0FGU8C=46U7aK97?h+u?yF@#sX(d%IR*6FPtXd8+hK767F zqxYodobxohytKK$3C@Lg`1#wy!2=#A=!r5>{pgV2OvJcl3c{xh5F~bzeYE`j<$$I; zK#NvvK`B=Vm^L6G6}<2B;r`ATDIp-dpVhH^miq77<5Eg6(yF~E8$HnX8wCyU`#}mH z#skfu>OCS>rBAd`;7?J%xmCsNLMUGmkJNR53MZ2h-!-PTkkolI37j#cJGx2E^nuDU ztvuL~oFH{It|3ggUvEFRTt-8O}? z2WKC_Os12(uHC(1R{ihA0%J_pyp>RCGm(GkXPTGYLGPOS2~6b>$f&55na# z!vs=UMTPCBHbG*ALJXiazIc)Yys%ZLGM=Krot)z0)XOTRo?em9)Qo~7Te(IvvtT&Z zbT9Kk1yvw{Hx5dN3c`-NMap7B=3E>SCt`MJH277=xTYgGn~?=anWx~M%A2Y!wuTOk zbp2?~y8a4+>vgQkxYzfvtgJJPL=XX$h(P^!P^f{GaB3$k#Zh%UWzNln?SvCFVNqdb z*ZB@VH{)cbEooAZEO8(Z=N1-fuX`0?k>LIo7eFPCj>m1ITb3KjV4M5F=ixL68P)_B^i!{6>d3w@Y zfRK-tY|220gjrfs9#s6{$I5y#ZO`!pn3o zs&_T7|AhVr0K~UO!;%IVCjv0yN7sp6g~2y7JYt`kwC7-nKhGBk zh$9m{CY**-M~BDf0P|sXZAPYjHDEqTQe2$_Yfl~US^x8XAqyyeR-2x1nvJJSOpyls z@0Sm$MM$2MubQAw^7^l9I2eyfRKg`NU_;Dh|3Pk7O)U!55YYBk$hD-g-rX+)>>$B+ z{*aJba37Eyft&wQ=Xe;wa7t|<&S3$M9j(y4U2MMEU>5nAQ)aZ(9=+?)l8u?8>|h$^ zV;En?>T|-ksL$~WQoiwtjBajrAxI_{cCpKa-ayA`X$wO15;49 zJ?RbRI@PQDNzZj!M6E>77jL@v++pU-fkYa$jO#9Oqtn;q3TGiHeRKSh;vT>gLe5BTXA$mc}QhwD3cnORz2 zup5Z|qQ~q7ZE6YtyB!;&T=G;lYhKg6#4_E^Ft{CwJT+Q?%-NM3#nyN+R?zS_n$OpT zJS+_E=SE8usi;%aS<*>pRMh$W8xJAUcLrx}8yqzq`j+=;QBhRi^JjN(Zq&I56oe#h zM?r7l#pw8_APL1^JeVHeiR?OG(fQhUn%;Xp<77Sa#dHw##%`Ko7+v?q_VatVaC&9& z#^7H^C^598q+_=UTMx?fU%tRuOl+USy(Q!YM}?G$QNZN9w}n>Ze>T|-%zIlgBhn=V z;akCGu=wM&Te!~P>(%RO|DdDdu%WlykIxF&C#n~B4kIx+qJ3E)e^I5u4#jaF)5TK-AfibJ@FhPXs9SmD3ge{o*&U{E5<&k+0vpL zv0QIPj8@A8y0ab>tA8rhx<3-$1t;gj-K4M?l04U5e*E`jUhVM;(hj?r5oH((2sxaa zTBdb12uzh-&o)L+ z?8-^l*;4|7#QE<|BT~LVG##At;qp_rHo6_usV(DKIMe}!Q-Ji%xFsdF4^Kr>^erl)pxc$7%_7(@p{%^Wu)jh*(c8si&Xkt)mh#gZo!ewh^dEE_i+R~S6!N(V+vp8=@GM+aa}XsJT> z+a%U4@jc6fzeL{^0#CTV50DK!9p58hU?`|534Zx_CQ(=CpiY1XCQ|Ot&Db6%nGe+T z{32FXtn%Xw8C)J@n)<#p4sRyAhnn-tX_gIcto&pMwVc`i1NNA=R}|uy6bB0hU3{&e500>t^@b_-5AY(VNjC_@Kmr^%c_Es^fl7^z*;5=_%6wdJkw`oDS)z`Y18-&dI_p4NcO{b6n=JW< zK*q|X{+4QE=DoZm&RxVUhC1&;iC&5Ih^5V9t@6`iH+Y_;*c71`H!@aSKp!jmo;yp^@G^+Gb66_fp4Esw3RMQ*hd zlG7gDW;YSce>r9^qOS+-U%#NkI9?$w#^(Ar^l-GjzZND)rH-Ze!8uXsT5L9f_lW%z zazy&)BJ51=hbX-FM%~ZPAQI~F;lA4=xkZIZLO2uZcLy+?{i*uvcKdw0VQ+ftrQuW&Xeu(@Z_CjuYey8CocleXlnojhF zdv2~us!J1HrIkJQ1`He+Or#PB6VI7Hf7BE7_7!?KOGADl#80YisLOP146)C&*ayM- zPbK$524a{Zk~f~Cax_Q)Hp%FOSihoJu1yc@klwKJ()5xK zuMD7L^Yv|8L4mt}-nJ+rL=vAjRp)RS zl*m4&{l$h(OLdEig7@pmG|J=2-%k}vcyLP3Q zm`GXQk{SXMCxP`ivrjihd`gyIq~w5IV68#b)xVdkRqgzDkIG3CD8hg(&PnGVlidhE zlHNr*FE_|(htJN~rzRH~SmZN>RY$$*Wu>a|3Htq`G5c)0e_?Im84sSm-%3+lkJ_jdCTEsyTITgMzU9;e^js zj!a?x3RmvvBk{lotI-zDsv(Q~Mh z4=P%)0Z<=Gu9o273&57wd_>hDq9B+K7hnSHA(A&Rea85Q)Ey?miX^WRjp;AclbL-;K_@9pJR}Y+8XUYgllUz6arkhDFbTDB! zfmGVFCJ|1OgvqbeqMMJNfDv?)&y>%AW%-mf1&>wU=W>al1*XF6<|Ow!rHYSrc04#^ zrB$fN$Esh;7+{6x_8DONY;KEUQg28;V5YeJ4W!dc>99OwId|cX?To=rl|!*Q``3<%7h<)zxLEnRmZUf0iX5k1VyQU^R1QbHMm_s$EYd`k z-xCCq3q9g`nSvozy2N?*vxZ>Ru}2Zrru_+RM3)LP>EGafzc&FVm0bdDSF8scx-NpM zfHz#Xs;3TR>NM-&^>w*}ZVr0C3$}y^Dpcc9^EY$J*yg|JG>xk28hy8|wx$+RkPgAN zt~|UJRn1BhO^F})|0GSXRbQTX7lOvjP6XnWx%?)qKiq#InI`WbL>l+CLD3U>U;mCH z2(x1xh|5tcu7*608|^x<&*nbP$*WCJS=RB-FqV$6+?twjbEo&9!6?u}=8Fie-Hjzu z8?Yv(AGB;v^U&1q0g>Vl(=imBPJ1<7d5}9@yz?EHLv7iv1-Q=CQ}olo5~Pn0d@qnn zy?Q+5Es_>{syC*n*Zb^Py&#GTR5GeG2^1-0a5GR!GaB;gvoZ-Ry8uTyKJN0x&mF9r zqZFHv@=e94ClwwRVCVb*KPGYgtF2gB_$KOxP%P{KX)Qi0Cw$2C>2f^^;axyCRPFE?UwasT@ffq&n$@zGmE%be4bqriQsYp0` z?pXBM(8vXdOvsY@!+OEAMuFj8T|%6IykUi~Y_UAZRP^SNUn>X-jfmClRyn8A4{`4ddjhIS@m!2V(NQ3?kHj^GQtkq8pzfh+|M zL>vK!_xpYOt9fETU)+I%{@U|N(!{y=g7iF>&#urK=wWPt>O?@?$`@&-kZQzPTAzB@2s>tsz z!j`!DZVz?y;SM!mlXWxE{%}>9b3`B6j8(ha&A;GCf0PGHVUhnw^bFaEgZ9fUtHnl- zHIv}57awRq@7j7l7&=#(yTesovghPZY1XRu0H#?OApoL^TA(P*;4ot~#pLwgj%3!q z%2UD-=G;Y1$k z4=X|k5e85V!JHYqd;r@|QOZB5C_!L}z&=;?Z(}%@26j#)-WW)Z~m|Iu8C$)yJ?r-=Dbsh6*~TXH(LCsKQd-S0PF_al1c{!qb~SOC+> zsJ34oaaKL(J1okPt0%oX5V5gqwr%=CBwLB!R33}CFF&t;?%Z$W8Y^&E<`q12-cJ4o zZWG9Qd*o+LfakmOz{1=;xO{-A95`XvO>K|mrVSBD^dKmCU=z%b<{%umz+{!sWwj`g z+CF|sVpUrle}^G1Fx@usX2rFw#83F#XEtg0XCwl|n5y-IsMK25;{Vb1R$*~9OV}s` zcemi~?j9V1yCgtxclQMM!C}zg?(V_e3GVJNxbx4q_xbk!oXc}@ZdO0Ddd=!y-PP4q zZ&g>7hHXPu`l=r0iO?psdXw5$qvepYeH&h@2Oj9wlc_1)y`P&x11L1Gl!jjR8^))^ z{eDm~idObuqLAz1NTeE!Sf1!M`tu4tR8rFLCzE>!%T4B*t<~53>?J-eMN~4s9|$n^ zzLpWX2DH#3#+&Y=YWCO5aKv2ePO>I}B zNhJ-2%=&EcN%12lc1maVXys8o~noAFKR|S9rkL z#nvW4#G}qYxiYEwyaPu(6pn+4#DzIZ;w5Q-RzO&YNWleCw#c-iyD3D-KvqBU=ZVbd z>QtQ$3KR0-UnTtk{^rK2PJqF zsKj9|(kF!cAJlzw!+%Umd0ZWOjSPcST94hbJuUfRL4fe4Cna zDlzL=Kd_qh(}GG5_s7<2f_UFA_4BGf2vvSlVbiO-u8pCa zyIF1jcl}l3k7cK!=BK7}Wg2qr;SmzHpTptdAC23}RSOG}M)Cw=D-f_Dg}GYcUCM#e zhW}VmGg(FeL#KU*54$&>S5Ia-JDfT{+)Y(hLNOUne_?LumMa~ z{o(5S*9^u3VSt#)kG0osC#O;Jjg@WbeMsa8Ff`iQy$Xm^UJG0p_Cm);3K|c zXRD+pBTwD?y)pqqe^Zx0#j%IV4+WUE_Z%m^MndirPvdIo@QOJT`T>(PgG9YGeqKTz z?_RGG*~42=ReO=kBMr7XgPS>RzxDy8Y-Og8gDhLwQE)q(?pSTWhpRDa3GcyKZ~Et} zZlT+G)O3Ta-nBw)m5Bn1%D znynd~aM6+qeEf2%9|N1Z`N$@-dE^?GUV-P-P-!F!qlW=23V$-obr`CDm)#n<>*SC# z2Y@x`zX^VCcgW?d3UfWY^ve2Q&*ySfRuV?@$`6e}MCNx<0bAV5qAk`NU%>JmiEiJ* zg?*sMBD*j%jOmu$xY=^u$5pF4t~LvbgtJ?X&3V{stBt^ezNkvH=0}7jwl!=hP2x9? z@W2!ff$uyN-t=;i=y-&EI8m&}jYF5^k>42UPfN&YnPNQEO&!80;d`y(mK3o9CT^ryjJ(3B=_{`O{>TIUDaP z>BKq1*)m@>yxPl3>6nX){)Ul)&qah2uqDh7L#!pYo>d)5lL%)z(F;?TX0tFfT^1~v zkx__*W!{>29NATEU;UDp$5dR{g6t1v_+p*U_raE|sD$ktM~iA=oIqf)3%SyGED3ZK z))t^%J3r^r^nss5kO>3amqDHJ&;C-l#z+td{}r)KSF5UNE@6W}KEC(6Vm_9d1G;`i zS}r7P_)#U=+R5%VQ==}EaG`;X#R7eUMsP-Ah*P~bWmEK#=4G^e zxAS_}r^rWKF0C)1G1*J+oNl74xW*kU5%r^puKQ{sVMYYy8Bx;ivA7 zEWx7wX{Rle?APvM-BkWCT|2SpEWQwon_d3bX3^{ULpUo0{4r*l6sHdtP z+evlDo6Tx-jicJl^~wCx;q|6$SY=qlj#sAiknWxA_LLt!Px{x4sI^_xfuL0VQ8Ri& z$IUm^`u4S+esF%IW<2xXiRsI?OLjtSMNvPOT3-)lP6_gC%nn!4K&jgIJ930mQq3EE zC_wxBu4gXg?yeL>H6Zvf&-Z3FtcQz$>%|ZIJ(Vof^}u$|gEBeEvel*6$7)YkH`>r6 zq^CE|#YB~^3`Ia?KAWBtAy(^Umnsn}ChIpZ+K&lNwwvc}cJ7l$tffD++ALHK3+iir z%PM*zk2oG~?}0vZCyzr#Y}uV2pMS}==poiv1ueHeQ);=z9v<7&{WKTQYg4gad0fT0 zr0m{GeZ5)1hR{QNFh)_J;Tepcof~ZeHxX}CA7?i~c{unDpJXT3`OcXnpeO>#pgZcu z+hDK^$z6Tc+I0R(0onNVPPwQfKSjo6b4%6+CIIM3nV;|CEl9P^XlpMxbsmrkh-`Me zsfp4};wKKVOb5GkA;phsS-nC8{huCG%2&pZPaf zp*3vP0Vt7jeEXF+qe*mxla%DgA7)l()sKui8u&Mf5oddy)ybrJ^rrnL_NzcuUTD9t z-iI}HPajY9B7oYgTfJlinwrEdrl|Mb_xLMOq^1>bepOy-W0wKEuo7=P8=l%@l~WtC zxP^O~EAeYQu~nPWQe$LQU830!hTcJaZJ>{-4L_M7&FmMFj|&b(^}jx;cDl}&JUl$a zbL2_r311L-v#{+^AA%Eu<1*3J5RMDJ7-N1Vb2TCRfy^_w?wn{ha?%;gmEJY>))x#x z9!5kqymeT=P{EyGe)%@ew7l}ty!qhOx`Q0D8Sritc&I-R0t2Y4u8*G8<-B^Z-F+c; zTk|x-2@7}?^G|*Qdw#8aG9PE4y;b{4xcuT{|9C$|AOgbeV#^1LzE{Ca0WF-I=c-#B zJi?_G{nHb#S06`WGC&n+W5;upwl6(zdjZcG<8!2kjDUitBi;INQvN>z`6*~h$A=!@ zG(@^Ol5!8+xTJ1$gu0Uk6#*EfkMLt>crBIP!DyA)Jxdd4PNoO0xU9}sy&h<6hiz!_ zoSu}t+$>vBV?~^8Zb%*;e{TllVLfl>9)A11g?;~SD0!YVJys6e=`TCeD{QeYetlxo za@+e^`u$l^q@gSDR2gs+1DiNT5)k*21vCD174y3FDW+TKfv#DYf4r2nVt?aW{b`=t zaF6na3svY@qO1Er74_cKaguv;-zAm#z=88wJ&3UN4x{BH@Hkq?hY=0WH{wH(bu`h& zzt_(1(B(lpwZq)9BE+tAn0vV!V5R$Nyyz$7c|^dH>5fSX^b;Xy^QjxdWVOQQ8wWJ4 zMOc0F^%_YYAI;!crbcjD^I{|qQFuV#>7>(`g3rb`c%6 zDE=Nu`8ZgOBi_N?l(*|{b%d?n<{J#<@tRaTBs$bw-4Q>U$AE3aYY$M=&&8u8pfqDB zNtaIN8hC=lWhysoZAxf_+r^hZVE0K*oDIc;59>6YED=9_;@Nzkn6q79@8P!yDr!fV zPhsDkPgXeAw0gcv3|6GATBDyY^Z;!sI~+6(VV@{h7Q21G!Vaos`aZ!hv67O1Z;et~ zWV1V6^|YOXO-Pn9?T57@I4uG-FwO`8=asVtuD$ku^hXTXVrx>`f06RSk=J51QyTcR zGxe6q4EOn1Q}J4!L8rDMaCWfqjGlFC<*$XaIL4#<=HPl~CG=3vZ|5g8UB7FtdCf7M z+0}{cm-j!>NcS>JS9YNBIFi{oh*85P-4*jWs z|5XelJw2zFkv`>^(zAoo_iSYf-k#hkheE#s2nQ|LIo!XhhS0~7(ZO!6nq)6ITvQs| zq-|BiZ>46r1?s_Qq`&So=K~&mn2uIQ+ln3bCVQuT3kRUP9Z62Ufpo{$nnH_7+Cz$? z9JZ2fsH}_ct{OWlwCJrg_248kDa&aD~*nTeg(J+J;^`` z-!)U+Quh7+u@=wxsJJ1iVMs~ahBG1}e=_?Yrz9Qj zc!2lAW>1lp1jecl1bP1_{?I$FqEErDNl9WtcH54v2qoVSi1w&S+W#yt#(vtmto|xc~JsccuOB4GAnEL(WJW+HYW4_c9N6!QjKi z-g8T^;`!u(uC~*(Ef$rxMiUNly_W;WRkLq5&~!}C-+ONHX|C$)hx@Q>e9Ca;Kegljg53304TenL8LaO5fGJ zc$wpIcbCz@MNBZvmh*pNGJidi#9afClQ^tPeN+e-JRWndt-e7&z-6UjSz&)z*}lv( zMe2Jgtj;QBbOxWKid5I?cW+OguPf;KK^3RIz66*7EL^U^8G!4fWAp`=ms+E)e~_~% zdc!F;r8wdVdZWc%j+yI@5WOm05;{-?^A!z$`9dCyZp^WKAV1-$I9r4=snoR55dx)X zkK6s>%_1r$R!b|pihIxx(Wiw`?04V1=JjCr`p}4{QaKbclpv#xT&FlYLUr7Ll2(8M zH5Z9-!CXvLos!_2_={3?a8QwnQIWyw2c!;7X;Oq8bp!*+ju&HE!ubzA;qfMogwYl1 z7GWhG`xS|YVgKx-%l#UC*}Dh~gYX7U`)7pc^Zj3=GkgjOwf6lC#Wh1RQur>AKVUM=0n-%FY5l`BJ}o{<8}WOw$udzAg5Mr^^tZ4 zx6LX@KZEld&8%~w;5aP=81w;Mi1`%penp}K&V7G1P4e8^El;U0H)5OX;g3K^;Pc6A zU&lLa481*U_Hw6=)2xPbkdPD=*8{pX47`0p!~1W5PF6gWSYdpQM`RfuXNSE{ck|;0 z!%vm%ORm3DDPt6)V-MLq%!%tGBZ196Sgfud^@r1Bzzsd~^wpNT^y;g>t2}dmSCyA$ zM;J!(nx@0t9I*n*o*@=D-37ZpCeGJd4=jA266l(R)}-EVKV4s6Y#(%=e;83Q%{@I;Z>gPQd!WSmP%q9^&Px@#P^7XI#>a@psDzf;VV? ze5XH(7qr>z7aN7-(pkD@8PDggOHfy}u>ARP&R!d1YGT*j)T2uvp90yXhX2*RL6`4X zW5=bSYKs4!d6j5>wnAgDjX?FDy!Lt|NyT0t@5ZFm-ymqX?w-R*y&&DjpEsg!;M^#` z08OHAaioUVBA?e9GhZTD9ee5o)_Q!Nt{+5)E-t7xZmRa1a9rq|*2b4SM27xqOM>>Y z2JiyzL{0=RcfW{15`3mZWz~f-cyEf65okwlKSuSx4GDT(u!@UR-VNgQPcCP9Bas*J zA~t+`o09GNV0^W*r{|9qpM3Avs(QUOQ-F@ty#hHnkKNi5aWj@Ww1(JB3gR7Pj{IHx z-e+}3Vou%cIL9h7M(ts~t%^0T|E}5PJgKG@@WyKeW5^9mT91zvfzmK&F3LLF@EHFwl#R|*9eOo zJcveiSK+@biN*>`1BVGoLsLSX856`;+7NPbz3oE(Ga_CgUM z^tdT@m=~wN^LZ6GR{q#EqpCgRqB)+2B-52b&zK_0J8j>zsz7jN^{Zv^HE4Ut<1gO{ z`h(iLw?3wYziZlT-+DR$Ra{SqU*nVEMAIHaHhmvwhh~E}@ z*5eeTO7C6J_vHA_2eB%f7(O7!C_q3!;;IOVj9Cj!-zRBQ%y__UNFCIF-|(_v+XtK0#%$ggoGnQ6K51@s8&@{O@ZkLhREMA4QW9J}n} zNR-T%vke2EzJF4?gb&gXQtE|(AzUZ^vkS2rZc=K`b%!&cgKIu34mv9N2@FSjx>+J=0MMXoY@cVdum zaH}iyb!tTM9u|zh_ zH4@ef?YrQaY5nYg$G*xEfwr4{*6F+MbIAeFwF@mtb>d=EnwQsoM_%5WUBovjsfTB; z{WlpqQ#`ayC&uRL%RW14oyT9*SHEr;0HM%IyatEm+T7DbRf~2jB^G-sDhBd&tMXeo za4JNTiyf>e9-)8$9Y!&*%`D*jVeJvB+P^SQ@Cur!+N=Bd^m6Wa;A52MQ(5SR?^{Y@ zWZCZRQHQ}I=-KcaTS+=nz@Iy`YB%rKj~WN5hu2+;(lX2J?y04}YyPj* z!c8Yz`!eN8x=g?awME`yPy)K zj7l8Ell?;8-=6jl`~2~ZelT>9-EY~n9mRMTtKU_WUxb*Ez{Hd*@&GOV*zJep5I(PP ziyRvX33a;GwC{4#zPGC3>i!^)oD6OF7WLSJIj3rdt7$aCUuCvk(#uz1Db) z38jvZ$7Zkn0bhE1ye$|F$=hP-CMiU042MZI-OFgjhzbQvB{UFH!)v=+v^h z(jJxzYeFbcT%oR+BjKMZbXu#I1CVaV`;cyfCM13+P1pKx0_-hmQ6$?kJRf6yblW=< zvDs>TIF&`)vuJtG%=^@*K=Yg#UR&D}L>B}Tic~r$V<_j4XHM=w` zx^g>0q25v|%kFJ`_3y4P)Ey3RGP81EP7*{ZAjMB083xPlOCS?Q-F@I}ewiTxQba6vZ1E>ZwR{svb&^P%I#t(@`9B!$TrKdX`|OSL00P2;;dl(N ze0c|j9VoK>jJb7h&UXQXYXBJcl3MIM4a#GTFPxd@XieNiY|)S(rSp|iMI;Jmfo~no9sSZZ_fW~qA4qC*i_V;7@9c{j z+TJFc{1;sfJ4qXL@2d>Kg{_gY3$mGSuxXEil7arfpAugInv?99B~scAKtGSBKZz)`OvWzus@EI!0iaHn>XA_q8D?NFwvXQ3vu@2A3s3u#Ayq ze?q4F?n!Ye+DxK7I(4S5=ZK&EWWB`oZ4NZcjB?X$ZegQCnKRS3P_Eo7ocgvllMDWNgWH};x1q*4tZT&dAAL|(6$#mG@uX* zdghsN4!nP#%xX&zH=Hz0r3&^W9F|2Sk2Ogl$hT1@{p!Ut_y^j`f(EA4KK(od+C}rZ zIYvbZ!{5=!-_6V!#D}&?#(PWWJ!y}QNhq>3#k`8dZEG_6 zgb}Vs$LJA{qut%vPDZKci1Iocqh^vqIjbWF=A5SuUoIyVIN15VbSEggy`NS_fd*|k zm6XTOt0F1th(A|%DyNf>n*87jY%dA69Xh?((Zuw#<7z_V$gZhXb%a4m<8O!F%;7HGG2WHW7CT&UoKr5au*0&o)59}j?a^0nG zy*V7?QjIW35GC|z3uu?RoZtjKU=W_T8^Wce+;Fp9@!HY&(zHlS3-VDYt081K#9w~J z2yyQWIzrP;qvZJsNAGE=W(i7r_L@@Q4#^hF7Avr!U`AkDA&t8x6hLYT^!(X~5t`lY zkG2{ArV&`(2*e{<9^bGOrThw8s4o!=KsMHzSBb;Vo0H|lfO#k9!VrI@jOsrkUl6Iy z*oubWrWId&UnfF%q%%xbG`tic=`N1aJt$hEFADKJzdV(CQ9szmd_;dk zoN^`P?Q$XS2io$E^yI@9*<{m1bxhOaUT74>PK5&I@w3kq2{#=jt4wQ&j4T;m#24oKDxfhse&T$c#R5(r*K_?$mY>P*hFZt@N8ez|c1+pc z8aAp<`Ur&(+Pa9nyEhD@r1)dNAOR>fUcpq9M<%O)R^Lt=*xnM!FJ)#r^7I@115+^T zcXJ_Jrz>jf?!>J(ZoD@3@6tv<0ZeGNqFiezCx3r%A%>fUY7wBuf@}DibJARoCT(5D z(n(xkZSX<~jkEj{azoRPeZ1fN`YjFGp%CoeXr#suJ*vnPQU-R!^*0L7FV9xzM3jXG zY?WkkGRkR^S}2S~C!R!B>F>|j`eiwJ$4F_~W$2_ry$6+k3X*wLul@{b7;WkI^_`rd z5_hU1-PztBbT6yq)k0zO@$PEW11;+W8cYIN^%ie$Ty!|6`LzQ@Wg<~J0ir?ltOH$6 zpPSq`(!VCE3MDVQd_{<&6?9yro>!Pi?AA1%5y1LQgDa@sI^|}_&&I3b*bA|fzk(@8blI$v zHkyXw)&G+6jM&!LeM3V;r8_-t64HvIVrt$qQ_X>g z^Zq9DE>y%i;qx>$ej=cyx!CEQ8q0w@F7(_`(DiB6wAS?%A-Sstos@wekS<0eIw=aO`z1brvKG%*}ydVbFsbmHy%!dp{M zKM*-C#NlJY)f^TPW34gHLcvawYtk(yIWq!m3!XEUv0SQ&^$QJbw`Q@Jx-p6Y>`ZH7 zONq_hE$R!TnIck}?T#bwoI4b@(o4oeqI`4b++rr@t4%#@=Nz8ov|R4U$qOvS|C(<4 zbtqqkuOmOAw?aJhf#`SGr@#|dA}-jMT5L ztkahEkzYgmxu%m844Iv0%T_Aib9x*-kX|UBOikVDT^`t|UEW+ttf>6}XzFl$9hY;?yVEJ?-~Twk6% zBbksiHmFc;`HKUW#Zb&>PJpMNxc0T*Ry>H6&6bLt2+};;AG7|B?i;E8)P_54G_Q{a9gKU7%``(v1GX3bw5NWziH(xC(+_1CfW ziz>EjF;;5Tk1~T%a}CFh<5t^E*Em;oEWa{9I?kAm8g6d;5RHp%CQD@sa9>OSje$y9 zU@3>;AR+1iLl&)W`(2R>Wf7ABI2v7_vTM6BxZp=w5FfYG$+Cxfl?yy%i;t}@^kMB@ zzQYq?zw`qm^3Q{WQQ(NDgT*?l9Tj0(+8KZGlazUEJ8dMxZzsBx}iNz57qKxjnh?ovv~U2}4@E3t4E z1+0#AU{db3V~J&CexHQ@!b!2;Xd>QeK1+*N2nFD3qW*+eoN~z9R$+Z7 ziZb0K8$>{Y2oeWKF$s&!Iw$VWEd`h&d7N|1=znfY=sDZ>@-z<9>81@DaMN|=y%?%U zi)6((xVo3ob@@VlJXy%H7{oEFC~*m`87VhfiUE+Uo&6jN(_|L+HAANocjz zq2YxYAa8r}+i)vbU%8j@I%!7RRgkVhk_VC~b1W=~Hy5Y<2KK7B%`#WoqOD>p(UY}a zvVl&%29}8n#FM4mW4JT@1RIqFDse7+JOW`V-9rlO+x6|6LQa{a0%3m3*PqNs{bK9yjpjb&A&BwlMe^>@D~HI!JcqQa7a)6YY(~fh^MQ~?Ag)I+w+>48nx)fG?f}3MRpZo zo9A9>mFqq;*vaxmIimxO#oHdA3 zuw?lQv=RUvTHbutqt<;|U;YT7qBh5$BY;~-Q~y)xrC2fv7?I3dbL*+dSc zV3k1M?>C%rz0Um7 zCs`duR|%GaH;!4MDx^Kz16 z8t@=oS=s-NR)4!rfNPpeMvjHV3n~~Tapnlj)M`xn`*&;v1WnuC(X2VE;N(~m(~eq^ zpZmdvs#wg@o)BfNY$PT|Tvn#!9w8pyEc?HqhXO-D*Qr5Mj*czKE%86x-!-(fnJwJk z=RMwz0+Xz!@rZXyQznGgyOL)-gJ-{pFn&FB(waap^$}0h&qLp_qW}W{|DmQ!jO~8t zDUXY-h?I#2z}*i$9;B!f{#siSmz(1FV}!19Z|;I|u1+ioq0QDP6ynum{8P%UYj)Ov z&v<{cM;p$rM_5$hK|G0Z|E10FhqMJp-hY(yZ&Q%oG_bPYXl@X#byax){9beLt#2)E zho-4d%2I0Vp}R&r?ic0~L+)T|9&v^%nPl2c8kJ&VP7fK{PCw%aLH~dSOMU+tJP?VS zWlI)b`$J8ohbXa0Csiev+w$M>@$y`j;)J>%7|YpYEEDX@g&ZlFKd3~M=41t9`YO+k zMHOB=NuM?ptU1PXba`@MLhhiy4-K7AixXAT|Lq#9;F%TU=>5 zor_g+)JGc55F=k(P21j}_1`@TXy%&mBLM6~r1@SAi4x%VlUnC;uPKIJ&}?QXnwcZe zCQn!>`7?_Y9}<_!!?U;kuL-^x{te|_6{MHY*lCUxsY6dv2@o4(acbE(W|{ba!bI8c zr5u?m-o)Q?GNFAjRn`tqOSP_no&r6x#+e&O=;zxcdcEsl+sHJ|v5dAGqTg~73}We2 zCHUJTt(I{-W4Ep7!L*U{FMA-eU|P+yDhPU$U?#%1&UG*j--sX&HO|LRk?Z2kNUu;s z>{t$7gRB$s|D;4JVgbvt9#Lg!Sr%Gl&8LB)IK#%2*kJZ!g(lQ2fdj?(m@i%q0j!3f%aNicU$%nA=sN$4=v8G0Tfh_F#6zS)M{p3RXl8-J<1ody5;vKeB zBGMKGIXy@4+k4Pp@NstpVK6~;5EBE_9I=lBOpR7ImSjdNxTu;#rN?|4#QJ}oPEdVO z(ZreoKj&or>|8mv|iPaf!u2a|* zMo^hZCa@=HeV*fBV~PR~oDOV}S+0!$s-}eYU24&f7s}a12p#NnUU>+N8@;{~zUI=_N|F5dRe_!?gPu0=?I+Zv^ zg@G`K<)NB=DB*+UQ-fus*QXMPMJ1taaEVhe*cS~*^Bi-z>e!Gspy!u9Em5>jf$Lo_ z=%5bnm|X1cJ}c`g z_J=o8JZ~#f{gdkZ zRHd>b-Tf5HPn^&kpJ-9vcV(i6_YmTH(LRfSwiM>9bK9r8q1J$h;nU0(!szDny{YcD zM8maP34h;Hw5JP2-s`t-4%?F!gvYU;c3H2JbKZb24}cD9`Ilk6_bJvKW5Y2ml9p$S zj_H?b>^qN`fOifLk!NHRhuu4W*Tuxwy^PJBl~a)k?e6yM6!t`oQ}x$9xXpvp%}1Ke z=jQ-kqRO|Amn>49zT!op(I&{`I^ zfyi*0X829v!7*C0Bh2%GeC5_FlY{fiX_s&VDjcxemgcDq>aWpE;|)7(g1|*tVMQh; z#Ln%x-c$-Z-f=d*h@zBc4}5c-hX+*F?q@xJ?s|*AsynsEoAoiF3kHaOCiq_=G&R3y zs(>M|N6>nUus?35=O^8=0n0^Hf6&+vK2pVw3-2O0WYN!)bfNEk4_9DIYt}`-_S23y z8jGfwD%YRiE~n<7Ut~rW)R!XBG$A$BYcVBmxgO$1fl^Y_KWYNvAO#bxFX?86`Qn{2 zDB(~Og#+ka7!ap5VxlEQr$ldvyqQMNaEet(Tm#wr2M?P#Go2H7AE0ps`WhMpO4Cv! z=AviTSCwD>;P30&zZNz^&*Li+?;cH(^Y{e_nlZkU5?&1N08&5F?F3Kh`HxLr4<-SS zZ2nhhYfdgdIa8jG*H)w!@-V++bt2zCY?o!qYt;cZ9MRUZM4TmblN2XrRr2Hb^RISaM@ zGSfn!d50Mm;BDUsHI|>?^T__IvR{P!;knTS;Bu?=f~q`a4^uuHY<`qmgw-ZiYKEF9 z#XN6|GW7irOHV*VIy5&~viMypkUl5pZHb1q?m-!ZSG8+H8(p^@A?lLq#2}h=hur)D zLV)!vm$UE8x=1g7?7bt+r`yWC2{{+4ZA2*dqs;Xq>ADB%S^|7i9o}jQIJg3%K0nSk zd|LRZ3PHN)%5JTN%{FKcb%U$tE2NMH!37KhkB6TAc2+7>vY1t~N~${XD1A+<^+ZyB zs5Yk3m&=7ZvxE!qJF9;D*nPncMRS~*@KAjn%c(PUrF?k1Kq&IP*3QIkO@+(xOK57U z|D*jUth*twhc;jc0E-JM^u}qfBF6%ob?)Ud>Hafo&_A{M~@>!jqN2zsK zf)v*!9t8;H=*u71nioJriEztJyyGuj_na3`*5S4B=AqJaHPvCGV*x{?AFgm8s`Xhp zqSr*Hq<(Q-^$S;90RP^``ZppDrtyY|fWiImFX!JLcW@YWEDL41F1A3cq(-(Ea4mN0 zeZD)`r1mc8V`_4rc@%$9SG2y^+kZUEShk=0HxXG? zPtjG1>g`v^*Od%;#OG8*N<`9lQ*S#M4M7VG1 z+MrS;q!u;2hdAj(KCJ!U_b4+t*ax5C9ym{?tz?t0moxl_p#bmDQ*AM}ORr21?@g)7 zzK6;cFE`bX)saq^UWMa^wPBr5G_|ot;!ynGAD$RTCUT@5WC9=K`;uTZwdOT*6>k!C zw_ur&)r)PY#5rJourE9#vohoy^sWef3K_tzA~Aitz%_2m*r=!nxp}a!?e{OcAm+TB z6f%kE?r$4z4&|Q=ydG+5*VO5lP?#xgT&AG!7}ESJphA>I4jt`ZErdO7q`Ou4`NN$D zSqUjY1%)JG&+o#i6&g(Ht4ij=HYxX=!`R~d^}EW^2t-<*S(h~QVH_*MgG7yt zEZ4Qu-O{ky1baHYU(gD5`BS2F?&^G{4f`B9?4gMP(UEMCxXs$brgnsyHQ-|H2szoS zHaW#7zSx6JxvDIwh`eK6wH*nBfYtNIq1G&XJlYEv9&8bW0^3X^)0dik5R>0O34NJK zLUL@ASh}AfL20rxSw)P^zY(2w#Y5y7N$LrF{;E{z0wtD$b22X}gCG58Z8;g+3}TXE z5-B#<4SBZI@QYj*iYfa|Lbc05f>qL_&d8sQAfl7{WdVPYxv{8W?LbSPoSoKeYiFpj zQYQ8^%PcaEY*-DVSZwlYq%bTprNw(FY*u=~6~}oTs`fo>X;dC|kpwcXLgWBXV&yv= z4Ag7|bGopoGT7zj0|S~~FQySlL91apu+tv(zY^3ZnDt|-+1d!1fETPY&Z^yqfR+{ zEZ@nX;W~kk4gD4gmju1NVMkX66;|YIN!Png_fu}SMl9@tG7WM<=9!=tl4eQhfF^5~ zmb2?uZV4RQ@tP;?RO9I$-o)VDlEdTa6-|Uc(1>i+s8rQ# zyU2JqHR{$<1HDkOk?EeM&1FM+a&RD1;eYq<$wAoxf`|f8@Yho2v8`Ng(Y^aWWMO@X zI1+u9GkjRJ`T3~P{d`W;zYyp~obn>DQ-J2au5tP{-Qq(*a_NFW-`_&8N=blQ)!nZ| zAAf~|W}t-oDd)mZ{ZB?um+I~zt3FJypn}?mnW}f!=J0N&FE92O4ZTA{_~DKSL~)P^ zDM^aDErh$=Bm=b^RyLh%~2EK&VBW>IwkS#BK4xCZ5X+2#stlIs>^H5&mf$*7UCopzg!gCq%Z5? zy1eT6`^#TO$Ep|h=2z-*&3*P+bBI1Qe7i?x#h$eH$+_B`w}0 zPaJ#V;c|uRj(sS+3ho&HReTjlU?#T7dAp;f8a2UT#aB=PYAWrSSjvLHQeCmK@-d*6 zwvu8g+Qcz6_^^8+jF%~2Cp40Unx=-N{Wju(#_hD=S?{$O;fUU?{aX2iAQ-8{s zrl~4^HxFYP`f^MPU^CkvO5?4M^}<;;H9u5sauoRMrD+*NeAI)8o9T_?V&gmvIM01^ z6tuo~ZD^Sw(EdIy6~*AlU|%$mEp;FnOiua7ET=QGkQxS?DLrV$IgW%=cHPTxYxHT^ zl7%)mPfxs+QCEc4)s+jHMzE=g?Id&bsaRu6oR+UX*s}tVZ4fdi;)5_&CQkR$jy|mr zXPgy&Yd)3+zKu6%iwVu^FJqcIktDgKn-_D`f#)$_rm^0-ty0+pH7n;}T)LS5g@!d_ zc`57U0C!uW(IWPB2ciUu(W?v671a;{A37~pH~c@Ua);UG;~*~&WW>iYXetkWpvi14 z@xMCQr9gy|LB}Nt$%Yl?jr5g?k*+{GW?>B#R9{K1`@ldZ&+1DN+RV)&;ZqN#B2%k9 zN-8*sx7*N)=j%OTtD7N0YQVAR;}!PiYJ&-Rf33J`(&eZ8kGb6(GYpP(iT~gk;U1J8 z^ztH)0l+p-VGofmw6NWyQa=HLV#mSd%y!?;E8m1952BG;Dfpz1&c`t{(D*eOpFHh^ zE#$zCw4Nvga{on?z(P!T^Taps&vKvt;w0evJ85M9?wnx4j79htLiumizZe%E>~hM$ z48kg6nfF;$l+`M36AT^038TZW72Fh*A@4V^<{9;`dP$^ieCBnn+r)#GsHTCfSnN5o zT#0X}mnxK17?r;BgXg*702a zdJwW!Fi5EDqYUL&id{r2Inj~GZxS0+bs!z<`mE!tHqo6+0*2{-{oiI4XrygNwU|uI zjcD}Bk}be7xk9GtGgXR=sF0bkHS}eaQD!Nt0UBw@vl7srkk|QzjwU`|TN54^y z@b___?aER_zCC-YrunwzMo&GQOi4Csd(Ki6{~I<-b`b`lNN?1)Yzz5!21IqI!9iD3 zFER3dQObXZd~G1)^pztn1mr6`C^6#M_&G7v=P6 zHx}bI+V&(RXEfml>r~}8<=qmcgCt;ufE(=SMW<_v3sC#B#i~eD0)Z5Ckbp^14Nl9cX?`UJUj9jh0C+?q|SGR z#oblQ&(|u#b_m6(GC*1Pn)3lw@BCI|v_d+=wuEIbl25;!1PC(-Zl`u%u{bS7rhBsw zJ1g`=5{0A&a+jI(;M3J*L=Pn^+z36lnx_&Lu62E9D9R{R;kCBh-p@NdL5HD^XN2Sl zmtSBCBtp=4a^mCuAKcL-Ht@i4>yrx8^9$|pFcL;HtfjvZ@3{m9%{&$r zthXv5C&r>VDW(UwO(gM%3#Y@LP_M~CeNPc=`TjHOhftnsz=`!ic5WQW+Q^&o*&z26 zf{9-=Eh0RBBG~#~;0m`vBns&R&4n_w=T`$>S(*PMaT5hfrIz}P6bY@BK-N~LS{XB{N&uI02rbz~c33E#ImP^xL1%NbmL&pxsJ3odC9L5#R z<PosZK%4HA#9|_*NV2hk^7?Uq zQOsS&7`uD*fXuF#Cne9US+SC(Q`695EgvFI=V#YN=rJpfgsb*>u@PGgT|c5hZd`%p zV9IGby4BbmvwW*Z2<DjT11_eajG>9jzGL=MDB}{L?R)1?zhXDP9%ZJujOyOXGr) z#)}j+9u9t$vo4Sc6!?M5jK;H0DG*hbtg21c3T9EKT)f_?IlWoj8`Qugp$HfFk*jwC z2M~Th6)nNM9xs|6AGcaG^0oEvB@z^H<^P$(^@?tHd;R?H78e>PF1i-wt@(G4jK(%M zkl7bZ`-JqW1HZteie01?@8Kbl}x*AKTr{qB- z4%_@+eewFg!@bx0MD)d`1@Y|zg`0&J-|nr+_W!NHA-l(SZ~0%4F$|rMaCgEM?l#PF W>$C$LMb?CXRC>DlxvX?i>+u@T`$29 zfg>1_Fm^DsH@9^(x3PxYyhif?jN_rl#cgce?9ENh93h3oT>@Z~=tzg`;O*T z#t@zZ;%ne9*U*1awlQ&ZF|ap==-8srkK_NH+}y#?(f~Ya52K|iKq?r3QY`LZ#<2!Y&( zNJ)sPxF)Sld3X*jyxrWksrLIINO#XZn(li<+6yHyv8XGOEeXu9OR$fc<5qRn0?j(H zRAvVhbrXiha#hh?CR6)KF_nGpVp;-b4Z-&VKfMv3`)Jz~52<-bGb#S8dhzsOq#(`X z_S2n2y3_+i^eDsQ-rX*j9BZ%cs@~m`=iI!!ylCNokLW82N0-?&g`A78kn0q9XfA+H zlf*5@i{E?$n1J~Her_uEVO{*jkdcOc@tZpnEiEkzEp3LD4*3l66Yib@OoqaDy~O_t00553lfC{!i$5}nQ#YRHB6|GdS##8F@+<|0f>JF9KV7kqaJN`j%?v5Dw{ zF~u1f8(%tl-BlG`Dh6k6W*SCw4`ehi|C0B?^(|JoV9))P@W)Jm}s0Q-B zq@3>?n)XVI9WnN~8`5!kh!-vXv@E{f3>oF+C4Z?#nwoNsAl4svAbUOwxx-F{yzIYQ z9YTA8yNA4_92}RjEW3kxc~AEs$P}>UT)O1?kyoZd6oMD*!0tee9Y{84o~Kl*dVLur z?b%<2ZVK0`*M)6F(`5%IWi`qjCf#`jmpP#CT^Xi;e8>Oy;&+D>K9%Z&D-8&CUO{PG znZXS;>%}+Sut`hjTac-tNJ_^G5&3$rFZ>WxdA;*amvzS2If}!}VU;v0u||ULRgwjG zR1BjKX~|V#Yl?rSNh|V@a^;zqjhEACI=ZzpCc9dssgsSIDIi#wC!01SZ(0kTwQuef zoXMAGB7au@$&5}ceGRqNP5(mk*`y7t?+Qi-=+0L9CdwKQqB?rj5-I78HsZL&U(M{_ zZPR_rH5&QOTEXVyWi%I?UcU0#@nCnKEA>|Gks1(`+&BAE;4HM{_G66+Lhz`0?LtA2 zLmdY@3x~*~@Df2zVXbS5rP7~56=#1wp_gc3q7hIF=tmEz8c!*z4pIL7F*5pP))K~o zuu#$PQJE+Rd=`^=Jb6v1V((U@g8x{Bdklkel%*z#f9qi0o1rlB&!5AG4Keh$XvVahn*==aXv4oqQoQ|yhZ|I#4D zM4IU*k-tH{>Bn`?Hzn=DTnL!>8V-wcJ_q&svl92rSuboQtYt!sx_>=rzgD&3v)-S! zv>@m6vX}j^6e}Qjck&%ItIe^vSZ^H)CbFuWZBY~s6s&@(H1;;nh@8Qs2(!X_K6{5e~SAO$0INE9{I1qUm z2elHB8-sUvoPRN`>mB>2Ejlhe#@6Tf_b}dmXpxWZ>$IrPkp$9)p@0Eni=f zscQyYpMUh=yYlp$T-i$O_G_>H@pxz8u83Sc|4hr(4!E{7NkE=`#4O>AcVIoBXCZxw z%mcbcc)VhTGP0%JCA`P|8frSuV_~KuI)_qHzM;~7t?B7MVc0J|(@_{zIElSCGZbg= zfKc|9ut|&j=xSjJ?o+t!Ccc0}dQY_|sS8fthlx_#$^{@7$E+3mY~NAnYe^0#!U z8vd}>+I`={3Yqdb{)#74ZE*Se1}3-}%rzf97NhL+q?;4N9{i9CJWxmC`GRj7>Bdx6 zhf)^oNhOP38=71Jr517o5BmEcU#b2q1O5x z{v(0WbdTo_=QxdN58l|Ur;kaIV|xm_Tj!KgkG8Q?1e>&c?Bs&3R12JkPw>=jXTFdl zCUZ)@jyE1Z5ZgVqGD`3kzw2vJL+q*StN&eHU8S5e%`T`ok@R<9%K*j925&6%{n}vC zxFQ|1N3rEerG*QO&P{c(C)~?Cramz>O5EAXwq`!z0YA2T2xa#bE#(zcDe2hCwXNv4 zJNaGg(NR3ZZ|Uu$y7$(rJDEQljuCY`)l|^%iPKLwcWSK<9WPF~9F9G(Wgp{U)ZYEYUfOJ=RdKbI!p*+OhhX(w?=|@TKnH zU5kUt8^&F!%t7<4+qJK!v^HWYUpge>iSi@oO-iDy)V)KM3kuaVie9bSy1z(ttK>g# zaB9ETEx67mwE}0HGqL!_jhejFzM(l8=@q%6oWJbURaiXZGvB%4gxB>5ouBu~{NqJc3X>M)MQY{6au)SqNzy&n;ET#e3~NYc+sXC5%;4_}1kw%gh!%Q4f{dUA$_FV>WD6)ZnzmdpsNY$(oJy zKTu>?Uz}NNvXym>+oy|F)})^~T8hqf^pg3gYe2q{zj6K>Vw#%n{M_J|O1Lg7M#`s* zpTl3#u^N>#X59O^GR7m@GAN6Uy(c=xMk|fy{6SXCbEwfwrFLf#5p&y!eKTx4ubwfB z=Sros;Ch*nULptLQ2|9nR3zspZ4h1Ej*F%j;$>Np(-luyRXg6I_|(y->ikFc#<)+M znq3Jgxg~(f*DgMB?!)@SoB{A~|JrplNxp9pKN4+ zd2FY<-86My51dw66&1XSc8G|&e*5NYF_#e;G29RLEL!)~*b3vT9-_p)zy-5|Y8Qu;9bOM? zjfNlE4^(kncX83&HT^Vpf#b2Y(gc@7`98SgCaW7;w^xqPdpI+S=XcJ>L=9N-Sgy;VPojd7C!afMex7nh2zw9t4l zzTHTfb7j4rf(a2h_(r5tHJwYa&7p674QBmB{HnBVWj)f5gDge9vWnj;Lp3qT3??Cs zW;R(qXId6(bHwgANYB5n6nD_!u=?4p&|W#UYJ1f=h!-=XEPCGWLE^kJU9I zfMZZkeahaVzScrt5J@t%Z*k;-7TW(zSJiBU!wn{^x);@yG4Gg{wWfJRr_|Z96eP=| z1&`aaS!4Gs#(I2PagO=1m;Vzl*yS5o)9gG#&qTaDXUqHQ%|2%imyWzy|CPa8Hz)9g zBeKq%RQs-5`3`n+9XbHwN1BqO1Dh?W`d=$qS!^+7Ww1{IuF;u)Kf27tY3>l=ah@^e zys%l(VX=owj^tE7nXzA-wxnlNKyRg_5KrVzcTbF z$<9~%ww`Cq6Qg7Jr7=4usrWgiXdZ*WZ{`q3(hGUrXCnZv0>mm1ushFu2IMy-(a6Au zV|ADx zKx#s0wzfH0VgdDa;aa!xhM`^o7<}g2${^8Zq3d}vF?i`J*+XcCRKb*thl0@Y*2X%sJotoAH~c3;4$yJ-I_5-4UG=A&n#%vNM1zVv>Om z$zmk$-?7A^b8?@9{V)PqBRH;hK?Sfj-?k+aj*+yh@O^AAEL7^>9PX-&UTQ>UV+cwc zAmJL+tK${M#>ZTr-KacJrpFFIo7+%Ur%T8^W_}!oOV_3Uap`s!Y?*GQR7Ye`FKnHU zDTIG|?+zlD8dv=(&Pfdx*FTY3dYSKd3URr4D>#^({wc_B9MT8ST@`TEA=!s?C<&LL zcQp3hX%{3e2!m)xQc}+19<^oT@Gu^$S0Olg=yB**DSh&o6_F*@#1`_4)ha?lClBA> zz~aKg=uIL0^R^Y!DxsWjV$)l{V??~=8ilq3#qxspCa_DE!FTpA{O=#&{Cy;A`N?~w z|Gv7Wanp2VWei1utoN@HDITVNLh#Zk3H(5A?YF&8IY6%Y#PHa~{7>@J$LI-?IQT?J zBK7HsWaH=cJ)fv0*^gLx&)OVvo>h*b6jA5>Ht$jABlN$~zfoGCW?zIC~^N z{PALSXtc_oBIeTf+I)X$!3Q}JUT7SUkmeRy=A^f?UY0$X z4%Tz_C<0}j4!1+fvzj#>D-k6+o3rh3BTtJF>7v>dD2)cb=rX4Kgj12adGh|;yDdx{ zzEOW@391?_Gy*RI9?XH5pZQ_=HT{b=FrWtN4xoyqg8reQml;?-oL^X=Xndv!3JZ8{ zDWpZOR%9ZV{5^FbLg*UH%YQW%rkVJCUxpWkgnW#NgbIr({rLeb;l)h zOc8Q7?V$J_y2J{g44m5yK3$7ilBSH-ca91N36fgP25VLl_VGiEyJ)oi^Zg3Q7DrMy zj`H9ShfSQ5sL1&|E6x`dZ7ez)L4(bL{1R>LDB(h)C0 zEo%^~$&n_@JyMU6JAWuy*xbZQqBkG0nl!=r_wdnWt3*b59zi@`U5N|Fv+R(cpI>3x zOQou+3Ul+EZ4RJpolbqEevsQW{NF;_Mo}D=R)TYt{bN#S@q$TtCWH&?!Y0#RjlsR@ zh$x=){n=Zbs()u=mrbxbL|`qGV*p*+EBEuGC8uNL%3@=#Y z?xK@NLque@d&8_(gDzaAME%2tyAyt-3DjVR0=(TVNA2q!oG5{oG6W||CYHl|XTDup zMrKfkvw=>EjK@MHY^3XMY<{p^-f zB_x=b0|e7AE$dx4k~B^h`=7M~%q3Z~mkI!)Ea86|{_sy>Wu=<2v9S)dRgp7G@2Y~G zI)3Hx={RD0vq}2%?9LZjpLiz1 z63Pzss`j9|XFLLMZ$wu&w8EqChtHj&QM0`OIjT1#9nigf^ILwVnJ` zCn%MY3#$fb+B!z+D#zg?oyLk~ui4I%ZQMGbRrsAK`T5t23IR!)!}SgYQ$*#?b@k4q z6=#J47Kxc>@)ebqWeZPW`DgNF5Vub0EToYh&F$Di$LM9-k8~jI%MVuG*B+Z63Y9N= zZLO6S?B!olEBI9gR5yy8JK?1(dx5aLuM(9o#OXp3orV$X&seKe@xh zs9CkVdh%Hsj~H6qNk96c?onmoz)sn1`x@(0{oeM8}V>=fjI)_Ws>}r)O zz5&=?BsX3*t=Rk7tHre{qC&qFAmPpj;QEOFKQ=0ttr+mgt_%Xt?Y~8 z`~96Yth>h0GcvKC35Jmg(gmxJYNFGlnhOZ(M;s#R>niiR_Oee)Jw!m zt~SbM6~~V`UZn&{g~}p%1Z;p_y>nGMo`KRDCeeBt4}V4v>MHgpR9%&w!;kWY-F4Te z)o3SvAWj|bbP9K`=#{({tbEBY0vDs|rOKY#y*)Ogw=yHgAhjYLstjQ(yIpMrJ$}rg zv0{}{W&W}8YnP^ldTSXai|$zM$j-voqCJtAhS&S%onHI`US}YkSKTEUB--b%m|QhW z%vf=?sMINj!9m$v?x@&Fop~%lx`MFCxk9RESdCw+p~O>tBHk+Xpws-s)ZyM(ZFA9+ z!U*|kbA%5sos^bZdu{d^6UsC^E+g2B$cm+`J!PHqHyyhf*~lM= z6GAg|U&RC21*<$4!b{j{-JJ$4)OH`L=^YIy5jai09UbS_DR~ZsXHOpSRe5D}^Yo6d zheu}dN-_j3m^m3<(p!PS7tB#SJ!}I!&VfhLvReL>4(ry13RAV~Wk2`7%8d+%64ea} zj9OQvpsuduC%2TDnjV#(gdv>mWotAhW!d8vm*3>-A=cPOlM!F-waW$;`a)^z%1%?$ z9m=0qKA(1Wt26mq|2P*3q$sQ9|BlD~hwSfpXrG>nVD#vQ2`<)pFd{TV&dR0bO0&xk zEb1VWp5E|XzH@S+3eA%AKQ>Xeou=dUxjhG>Fl9HL>9lm{bT?vxa@Vq^|Jk;@Y3IWk z6ODw4)dV-Og`btIB5lm3{tr@<&3)wf^bD3xdP^2G-II01zlN+%jn|g!LWf`rth$4v zx%` ze7qhe?u?GlpUTD8cUTDH)lRO4+pm?KxD2^HrJCCQsZ17)65?ry2F?!t=u3fpSK}Ns zTD8Mv4EBUCbK$kIHGFMQ4W`{`ouI=k2;&mDhn-Y z$x?e&i^WDA>&wre%xykVpsH4Mk`>`~-aB2gS311kW@`o2Nxo&h&V4&mz2=3^pxkq| zppo|I`Ec0Eas{1MvChVK)v{WzvAUu2)b6CvHb=pobywN#O?@_wuNGcqs8l`F_So&B zO>2Cl0SP!P4lzNW--Av9TM!4>C-T=)JzqV>NgYD240g+3hKL1x`s6A-&<;Iw9Qjdt z0Xp>qXD>lJL+;SAd!7!+27l)QQ_ff4-H%6(2If^9-7!?)#&KxTF;|0fRxba$pDj` z^g(-4gbLo{65ChYhG^cy6i-D(ROiE;U{RZ8tTGYv!+w&e+!u>yiPm9(t46`|Q%Sju zuos93-uBw@v3hN^v(hrE*@vnLMpt#EN5p`Lg+?e$Gp~uAqDz1FFM8qbPzB-_YQnPT z=90ZlfOLdtikQFVb(aGN=h71mHCAimhY(-@9hWG;HuPGdTE@dlYDtdE3LkMKCCp^k z=ume{k{a!#JItsa+=eO})T&ud7S$Uo!8?bwH~7^#Vjr~Ad+hV*R?dEvw%^ghWAM2b zGno(J)*-zYtDV=(^Tp={F%A@vEE+SaCX0gSTc*6B zkXru-#b~DahVNSIa=L81=~fLOQh&+#Dn-R<&$#<%u;o3K3aL=Xy0t-pp3aCYbLJvE zx**Fda@o-!LKEFSNoD5v8CgD#I+4${bkK}e236vpb{3MKOO`t()~vkqtD9C&>Hy3V zD+O#ppT^wbE@AT@24^uWlAkq&Ho_eoQZ{R%<=uiP&h3iIZdG(y?beR|WI~@#C`i94 z=*=pWSdlt^mGQH`Obs!U*cww8{dsaH&n@v0?}BB6$ruC5fj!k2F}lho;@bzRdg$GJ zi1Q(xqzz(gzjs_%D4m_1jYjq1VkeH(-}zcg$JtK?;;ojfKtVi+O({tZx@a@J!~0R= zCfFCd;B1*1FC}X2wKXh0I;uG0kx#$M`jC5-4)l)3JiCjGmYR7R1vmf#hQFpznl<}Q zbwD!~6f(8R*X=ivOQ7hdC2uuMHgo7j#6E)-mCO-8{djFBD;nD>!EK6JLFw()aZnx9 zG^$>pzC4uG; ze*C2*C9UXJCksv=PU^*1i0h0#tM^#Zvr9@Bbk3*5WVA%EvF^ftSVY6j^O8Jg0_!S| zL%(p8y&SGvNHH1pi`KAUfe$RX!pxm&cXYaMXDlurPG=51Z(V&f<6cxusIILaEv`ec zzP_cqz{$T0z|59NIL(RDO!W_ojx|;e)oJ8Wwpqwud`qv%0ZrFjbl%&6)P_+0jbpxj zdCnGRciL;l8?h~6%D_SOTWySwm;ET-GZdV3X7AZA`aHV&B&TfsT*oYN$eUA#{I3rT(ku$!_mz!SpjrhTImS)sdOhMSTs%ONpJl z0AwZ=sKc~PdwS0j_Xd8P>loTShKT}jX2FwY=AUFGT~bi*d;+b@dmU=51^bOFSJ%%b z9ltno%vfphZJ;p5$zhS#)Liq2)`r>(hZi%Uk7oM&L0Ni0X&L6$odcVVh=!M}Jjt7% zI?bY3VKoXu2pA?l$nP#;XRj^_svDJ7XU9*JR@hwJ>rPFrnq;r(^hCw02<~MyvRT2s zb^K4=)cH*a?nhyoMXrX>`m33L)ILvEv#!#LWRM%)8x%HkidB;;gN+H9O7$oNc)T6q zrv6j$Q!RY6PVBwr;(VPY{6QWoAM=j9N*kS_`d0`^xz8VpS3|MSJ%E z>8KK?b2h6@%~j4BHR+hO+tO9Ml-m{UF>}-dt5+>g9%QpaHU4vI#ob*@c!gb3U$EB| zwnRUn8EbQ(`B~g;A;_!EQwvpG&=3odvrfr^+6-gdXG7%|gVm4Pg;8HoH3VaP$GVNx zvYKCq1|Iq#1bZ%VNk|wP8fK2spbZLgCIgBtp_GC-g`XJ4T3-THBH0wem;3)wFj7!aW7 z=~)lTO=+WFFM{;-J4DpNg`lpY*n=f{9TWO!>{f@EDf#W`3PUR|iRxhx>2fKk`Y$4S z2+4W7KwRz1#S{bFyFdk^EAAnf{h=Tp1j&!7Oi<W!t``8Ao`V+mA`~ws`oftRTD)~QMW?KcsjuT zx%4mg-vm)rRHTuTmX+n^zXl<&ydaMY0;-ewg@wVHMUd+_7i8!|?CYka<>XY2jIz+{ zHC+(xi?#Us+xx)4z=)PNXmu6E%#cPQ;;r2lN~x@=nE)P#cw@#zwQC)v&;eaeZaADq zyekwNvh{DK48W_K46=P6uH8h-)C|+Eg99lUEjT`Q$6(Vw358DBNdwdr&4=x!QSwdLl zCCKreeGUBVN)473W+VA$*Rvp-W3WC)$W%$FtqE&9ag+;bOHGGAy88q?yu83s zumS@Y_b1{JB!VEG~j@iDDG!ZjJ4q zci{PffdO!GYXFQ~l=Gs^(U)s>+m+jVfG&hma0I<8T})e^K}LSQG%2U9inMefnu!e< zRrxNeqoaf7S5wo!C)4thfd0c|WY~6nN+#r9@y76P4B;ZVFr2vGAgBnq?a)bTVPRO> zHv#-K6Yw!;MIdV)eFV9?e8~5=L^<=s-KV7oim9=qK-9ATVED1vRytZ|`wgX=u;5}1zqHUf@16vNrKVNXJCw(nHd~lM4?6Qg>hFOUb?x} zfEJsmxHvQP2Bj3QXIwqQ5eVc>mdH&)BI+^cl!>mV)c8>xAns#<} z=$#_PFzySRQ9h}!)UXZBtz}+}wdVj6>jWwfkOfG&d4bBOg<%Za8blPCYJ=vaUVbP)MO^5CzR!Z?!q5D-3xz@QPvdzoS!41QY}wYr=f zA$kr!jG{rSL6rfdmVhrgG~#}7l(?Xpf(eW~)l=3X)FQedAaS8hDiyPNc@=f_0ysPc zghq%s=2=y4@R5{c zgTm?x1c@o6m}RfjIw&eCqTeUDe)0Zqm;W1q^dbMsAlN^qBeRd!9OFSRO8(-c)G&9_ zK)(Z{z$vAW(T6vZ!OCl&w$G_io1f=y-CQ~G()D!yxtn|uwQ7$R6UE`Y5Xk6-LN#&K z<%@tbkj>TXfueDrV_Q)Nd7UrAdH65^+uFjxhc{{4mfs>4q5V#~j_R|rgyh^6lKh-{ zaJGM8V7wd#`ia#f{)@no#DuZEQ0Rg``bq*X^?0#3Ox3T^1Q||pthDN>anrh;9{>i`4=+Q~CjPgf?1BUCYrV#Td!8%g?wO}vZoQOz>}}yOnu0g``~gFT{CVgFG&dV@Uj1MOU)Q#(=spR{1<$Zg@ORRAc#aN!{ zxH6qJ5tUdf0nT~Xx3s0C0)Q{fo1Ztj8G$7_TB&|}1+*W*vezirMQ;CsJ*|6WEL$d= z>RGoT1J`kpt*vPr-Tpufyf+eyni?fr+(C@A9}5kSwNH*GO)WZ!TRlHrrDhO6t| zg!DDm^hOnct)rI*4T6sZ-t!1Cd08e^}Pbn$kHMyr?TGSj=n;YjmkYbI3{aQhDk1Qq!OE_7>~~668fCj z(CFNR2n?z>@@ez2z}+OLK7ISq9eOhc=xLLL7EvSUYDh%7w{W0u#|Q;fF$41Kl{U~G z@jk&*aQVc&XZOYb?}~{e0)06IG?VXXwiJi2KRwcx^%FjwwGl771JRcA0sHmxOaS{` z-h2!yEJ=q@im%}ul@uyE0ywBXHiMvCwAY5Xgl}Y_9+t0c;^(l+){)%3V zkVBpy0U5=2Bb}4E^eUumdl2Xo>dSO;X4fpyGPJp>$O6IE@j0K?2Teij2dA<>YL1f7 z74~J&heKBJJ6aOyy~jwS!w0%u9y7?RzHv+f{i@NR3#R$A9s17CGnGQRyt4Bz=$k!u zm739eJm-iV6=-kiS$?4)*}&7P)~U3jRG$}$;5Ct^xSZ0gpDTjCgFQpoRyH1b7lM+CVoZ@aCA?%`!~?Hg6tbf(KGy$Uf}^^3fojPmvZ|9 zcAA$Xienljo9<6*uf1Vu}2WmC+;ocpc3MI`x=-SJZh7Cw=5RO}CBvFC{w%!E1|7}c?-{9!Mf&GX zmPkIL8Y=v?LL+@UjyTji-&9(6ZQF^{JMPR%DCKPZdiEvAhoD!lTpfP|$-GZ-*=^1{ z-b)r43b|R#cVBh+Y_K?W)im`~c-c*)W=|2^Qh9`Z18X_#*>=O9x9z*pd}p1&0|sBu z#_K{~2b;?6T>+h{duGXRPaDv_gP@{lRh-@R=(BaN9%$L2YIjv|+23i@pYS;ON%gnu z>!7}Wou_gd6};FsbK|=T1oC)TMz^!XnLe$sumILbJcxX>j0$#`v_9JmSiZlpmogr-N7f)*jaZbs7g=a^fT{v!MkswHtz;Ff zjdpgZ>OIAl(7QIGWhsL08z0~YVq#Ssv5&7e@*%U*$cMCOu+mD7#D=q2Sko@kFmM99G5)a&(~q^`!$|bePv&wV|H$KMLU~45o`A+%Qc=hSJBlB?Un-< zQXH?M$|1#T$IIVL_lA)lakB9mN^&@dz+JWiFf7*XF}>>tZxlR)9zr1B#R2q<}$<=l&T!e2AB~hFBXxS_w*VI=3{9aGeTlN>5 zCYplpGF$PVhJuYiUR=%5uQmUE>+E2ChL0=ch^o#m9{!ML3%?F!(WpF;FU-wF;tNj` zoFS*nn=SAe$v`ZA6jtDD2kl>jtkWY!c6^t4!ZrzY&_Px0-I-oXV}y4J6>-@Ro@tn= zkCvWPBi|SPH9CMh<`&8*-AB&cMGYkhs5sizR1>cAxBgaHJOS6lva}4bQDyCoCy-kk zQ@4;wH;HW!e0&LGdmr}_c%AJP9BOyt3F&|)|E}_GRJKvu0KLlW5APjMouWYVu*0b} zaGl^gR+taK!6Tb4WT0#8I?I*R%eri5oxwI18(E2jvNwfW3CQ!>${TNQ9g0x8Yb8q0 zpf_i`51;^OsZ&>QKnGGD;QZg;h|fIyHUnMzstBe8-FDua-rY?SURpCu%N%+NWALf* zvvXc64``J$X`R#TyRmc#l99Ann_$(4kXq0)s&ewA;%z_|Y+*W=$JzBas*D||j!w0G zKe#OCn{wR!Hg+NZ^nO|?8q9=EZ{0>WQF}z1pnUc>gy12^U8E>REZLvQbd}LTMVBkm z)t(i!=)Zh_?bq#ecB;vso8uwmlPTHjz0t!{BObGhYvvyNSv`4GQ{&3in)?cTh>Gja zG#*>a7<{d{d(#%0e}y(yrQ)^o4QBP9A#~yM2W`Pwp9?$HD~;Osm(JW5KC*k6E`Gkj zeJs4|nflFZG+^fHdsRmXWp!x8*^skWAqgLY9hPUt&v@@Ey7{LXN)vP^({l8&rUJgz z9EW`en=>sgJ`3M|dTJBNR(aijga+ zBy1v4VINw$2rJG!>Dy_2aJcASFi3Hagd}7Hd!y|`n}GUEP<(9fOGECl_L^e{*XG?@ zJ-RQo3AZwOKT1x!lO5=KEIpBUAu%@l?QPq31d8X+_6%!Yiyw5&Jea9GaIr*m>DWiS zMHzLU`rnQ;g;mxHnO=gRp%AX=W|UflVJ(+`>7}A&qE6*p{R7b(2!3I z(b&1fj83;t+n}gxE^IXqLr9GM1!E>ZQ8U`H?#1v?eS16TKX?}$2ZW4J6V+{Zr1O1f zovvBCFsvTITi5=)$hf2W5C4Grklh#Y+RMx7JPkX=r4a%GwJ_{Nk)k0v~273(rRz^!-%yd?K6J1 z)N%>4wQ}6^@I|vvOoIj;irP(}_T+Mb3VY}}wi4QKS`JWN=N>Vn1`Y2(+v_BJ@ z+3hlXc#*(b;;B!g!p}8T22=cdi$6<={8y2 z_PAgvTwgBXL5DB`e?&i1-zORTp+(%sowgguM)A?Kup2}OE`k@597vjxadfK_kQLP^^0Wv44+4UfUVI;+}F=ZX-;l9p6H4le2Jk2;zbmu zKggJW>Y?Ci-l1Nk>@pD11%0(BL{FQ6RL0S}PIi!f)M+PkzGoh4GF$B>RoYi=&EY_w za3kW#$BU&3@1@Cfxa`Tty!&8M)1EN*ywyBq**=ob)#_oVQq}&=i_tEIQ?ukiarQN< z4sk4X-KzS2jfS4zE1^14PIv$^bj9R%*97`MsJI`c4UHL8A$&Bo`z4*8h#RgwdJ()D zYfz&6n_Qd@A^T?OjFbo-cysAh*q@gYQR`?1a8h`xnyuxkM;ZKpMIICv1<*aV`8DT5 z2#jukqQCjG*EIp!47;7KbKyUw$~EpB_u~)1znD*-29}T~o7a38d@NVG%|jU;>PbE@ zlDVm(`Z1qZY_-t8`~hwEqI%yi3$e)jXR4~)s!U(_=;k~r<$qN%8HO%cJLGNs%Jpk; zKPBmJ&f4&K?pkO@+}X|+@Ae~7yum!!=uJEP@>CZ^7u7;exoMcQ3~fT7#AdzoCd_4a zv3?jVcruk#MRtI#>DWsXQ2l=5U?t;0sX%6(_qxXg;U(;dgD zt;*znlZZAUuJ!<>Yc|<1Ivp^Pvz4Fdo4Bhsw;NOUp>=2XF&&T^tIZ3I9y8vG*+oQr z+5_5$OB_k0^0Y--NrW=qfH05kwYMU_CqF9k+yXjr>v*o8?_+B;d&4z#*+y-%Li}v^ zkBNc%nygW}qzc-2=4tp|-jJBhi_+@(j47b~iOtLDW8*h`qaNqK z3x4?=D>RcL@_LfNvh`SCq>Oae)a7{ z9y-+0nkr8&FZCU;k$UL)$K__hBX2tii?y24|ww`*tMCfCB5EN{Rnn$c*jv42D<^o=IK%EE2?Czq8+{-(ll}y zz^xuc8Dhr877!vQNNO?cFf670rPey-o`Zu4J%!8Rnw?tcO*y3uA%=3p>Fcu=dBg>p zM2PJgop)vQJ)X2z78kl&lRKN;6IpCTQd?g#gci#7{dvR+KW*ZDd2|V?Q&RSAJJO0t zEByTHC$pXFLj5tE4N{i=-dB1^Zd;7gF}ON)lr-J@;*GD?%uiGG#Be%W-tfIRq3ZRx zk*FVJ4uyaLO^W1JABa16@5OXS2%8TS=hJ)KmO}~|{II0W=(<^yruD>7SLr00SB6Wh zARM2C+0}QJn__unjrKjmZzOv)dBhfy>{1_T zbBS3f_TMTh(V>trUAz`TzIcN@LrMynQNC4AvtvE%gy+ee$hUlKJoE!gQgJzbiz*co z*u^Eb**}(X_xNKiftMh*RDFLpIZNye4fjTSdhFJD3vsivK!EY9cN=lIQ^cKSg(WY} zULF5V)Vb6a>i>29v07JXLT;znA4;O9ebblC+nHSj$hL>aiw^(v-l`_rTD?uu;yin5 zUhnkgwOQeE1oez94cR4CiwSzKM;UUmQMzYz0#C2HJSWWZB%No+%UWkqfnk}137+>n z2!rL~Zv-ky6p-4&hOj3nnF1;eP}VajRmq^v{4Bp;0Ia_?XNUMK6GnG&K;hFuUp{~E)8BFlcFY$L?=M3e+>U~E7Rep?1 zj!S2p&x+4(2_Ll-nR&Egvz4aL$2^LfQoNLC%p2N}|Jxt6#q4Q6IHGUg^OeW*l^3a= zmD8Ug*M{q~30x8-wli^BQLf>@82!Bl?^_@Xq{WWtnIuV%PdSi|(oB>;LXy!T*h410 z@}=U*akcyHv~uC0in{V?g-g^6haeoj7h(#gUkeC;^A$4Or-JR0?%~9|B{m)u=sn30$nLT^<% zJq+WeoQdv%)uvU%fyt++^{p!miM+MLxJB&aIDWnH7V@f!>;!PBPuobkqm1T(OlVuo zW}N?ErB{5DSe!06j($nEkKMzcbu8(9vDR|7l#n&$ZBFH5v=GEbcXW@6t>}|!ke)Cg zw?95SKFv6pPS=Z7D`zJmOEg?tjJ_XEya!!YeUT@l)B;~^+~gZWbJy%m_Oc1vWtWD( zs{r001b1vcNjWX-j+`Dpn|ΜcQBG%dh^|qm3N#r3uEXdHZq+sW|=Xv%QXH@9XdH z*5vRA2tw3H!!(CzCVW|msF=2CQ^8X77(U9xgRW9(izn5`|er4bp8{i&@ zj-ftwo~yovZaZ#Ui+iSYb1LyErNh;dAT#9)_&;$t8Oh8kL^OUcUyQpfEYZ$IuK3RMW@V3G85XsR+Ixl zp%;A8+()VXjc}dWACMk2@ekPJ)p6w2biaHv|3m=uA>rkm=-q(ZvK^C%ongSs*-DTO zrq|n_(R8u4&X&P)bdPJI7Hr3aUVB>LL=h5NE^cm42S7Pxrahm&nB2`A-v@-udr>Ym zPmg<(oa-g57SDgm(VN<4v?6H4)pNPHOisyjziUA0_TH-ZJiH&jJ>~6Qd@_* zx?|m~nP&)1u%>*AZuJ}8IJRnyJGsUul6&1K&k-TNaum_7?G`uY=k=vxV`BkW2K8nw zlY-{{GAPd^(socMDuKy2)qYlOjQ`@nx7<69CB7an67tGh*T&Ovown{A#pK7QN{t&) zF)}2$ms*)e{-R)P;Ur3pdn;sA^E^Gx$Wkj?ZO9ZqzVbUN>*_{+X3~@ zCM1N+&dy?|iGED`_;Kj@wea*sYnoU)%XFI7^}`#lqvg)HJuc`@_&Mdl<51Pmo zCDwsRf8nv2&cmVHQb5XPOf9pYorE{2#dO153JkzCAO_+wvsfzlSOA$u0*W?mxN z)>(5C7RC|Je7LW}36g&IB#S*U+uEe*wSZf~M~ zLkpER4#)PkdvI_H<`F|o2#R}fX<;xfb(UE0O=k5NfH&2RV*7cH3PM!fNnZ+tmCG0X z&}}VZDrpD*$+^)@m~6cK#`Hth=svMSVnxbxOvU;Lhn`xRTbA(Blkrn2}6OI*@ zHlrGvQo<7^w!Uyu4Og&?H1qu^``O|;+_eb0%a&}gzOi8)+y-Ic$>{sZGl5` zN#CSViZQ33Vo)Czs=CsAy)Vy4>)JJjg6rfL{|#3!nETT>fh;*F=%{EJxxRGExvO&$ zq>ZnbAsB^R_he?qaGuCQcRx^d;-NMETT}8no9#zvFNb5BBdAn}rSyM(o7DH*tHO?9 z(Qo7{N~_u=4LEQ|J!I)$#F;=_akCpk`x!1+H}7>kkci=L(Hkbz^I#e$uBrR}ll{!C zIfjw#V7OB-uhE_;Rr4(JV!~s}Oog5l4hp+8h1rYC$vRh=l=Nd~Zi#AcahtL>peO6d zjQvDf2kJVDSZqOi4&6MSuN3FNK@hSZ|Ai+-y>c{CMq>gxMwPqT5ncIxr52)|__T*I zwo3i;WG;woKgmmq_KeHDvM6?xKVIf%9ib7yZ@0xR6hys{0Y&vZy z(`=@}&s<9AdGHv5lvE;(z!K4I6s6bZj!TDj9?hz?6-{l!HP)2ITum-oUhxRij=~3R zN~Sq4E%WJ?Gd{hq&hqSn z%zDr|as?VnABdA;3U|adoGGuJLwU3&^0f#H+e~#{p^TQTl!8R(nn>P1!`Rl)UJ7`u z7w6D(Q@JZ@YAI8>#izIZ@HP0V<=EluPZ=|AF@6&27D}imKSBSQx6cBzhgDXkCsIGk zyi!J0SBL6b1(i#Nk;g!Qlj$p;ufS3*SmrCeebQ%e)S0`^_qXTWDO`}{1vAXUb{~aI zUP@y`JtSPG@n^14IwSoq$x$c*nGBRr*~eH00hH5t0y%fXW1i+Rk@@}xD2f`}nMzM| zS(aw51-_P@6G)d*5}K@uac3T&CtQQk#BaXe0A|bxamdh4@QjIcU;*8fzz*)$G~Lau zIAv|p3*o~GlyyomZ7X;~i42;nasP0USK^Uy0a6PDsRyC7bW84%1-MSZ?oxTGd;tdj zzgVf9>N*hlch3>7V>r%VRIO~hM2*62O6N{AvklwX_EfI$AT8lsle=h`xgb!Kdb%vH z+ZkUewGq(R3E%w^fBPl!aJ^t}&j_OXD}r9v0%di4#m7VqG71`AhaT;|2Rlf;6QQ$- z(+K&`gR=OJewqS>P-j{AWPYk7v?`L*+)=#B|zgOkg$RM|D`^b@+gy(=F+1y z1;YfBoM82PxUeLmUdtoTlt*=}K2@poV0FmrhJ|wOq^|9}?`m>gB2AsT@1>76l#ort zw=H$ia5!cB9{)K~VYnFB92GKYhF9!-SY^yS0d_xeivs%M0P`Pe4$H33jF6&Zn*|)= zOvKS{RwmCQtUt_ownpfV(u(LF@jy(xX`Zu{ch$dg90};4XO9u(^zyR(N;~q0h)$#o zz6Y?LdJ9sKiLz;kcau9MHbyW(bTvX_?i~e1eEQ)hnoaoDXCj)em7;9Y(3or8J0<#A zE8FVddp`-apoXfRYQ{A3SHnM7!*UDu5_4EJ%|b43B1eVb@eh+b(DbQIL1bK?)%Oxt z#ya_8;>k0RLLj`RcIawjaKKq{n(Q(BtsrmPKC`|7v$^-vp(MJS;e5WtfU9`*go$el z_x82`j7vVDp`1+SSNM7L>n4-83FbJ_-fw&<_8BiMM!MP6d0JI8(HqF7>xy2A#$Mv{ z)xe>%;3!<;5L>3?RnNdd#;0AlWl{rwqZ#>={H{)!e3b5G^#<2zX!ih@nAdySDUOXr zR_H@0Eh+S%{CfU0hXrXNm9>`1l9F-7+TJ=L-5M@w+xlTqIfor0J3@K|+GM^&(1VQ} z5AN}5Npyi{2a=9p zmKYrrO50=_UwbzJ^}hJo{`qZK2k$DJ01LgkI^SZTs%BJIG!D0Bmk3$C2mT8yGC%#m z^wULX0tTYow8_~Fl~$lB6l@b@@C1>wx`?TF#Nf|nzIqF&0FtH34Y=SOOHQiQBy$vn3qk$ zFN^ra3a(tFk1q@wg1X9(^`sMOaj?z0X1~6!wQYWFvHPlnE#^)P+qEo0x7UR6J7K|Y zrSyb9jRf>LPygT}==o~><(vM2#LvM0A4-pXJ(3*M)#P$AHQW=Dv+d1 zB3xhZZ|`*vk}ydl?`wRD3KQjd)eL=yW??{yml)bu2q{ypP5*aq9RTo z51V7`-f-^T+eu{TT||>uv3)l6!4;or^GiBaCWGvW)b*^tkDF4|x(g}~U$xE?yYh}^ z*W+y)7sGbOOsM%_`c}bEm8}9 zqvMw8nxG@zfSnK}_gQ@7&Jl3;{~`f<{wSRkuG75!SFih%Nz6^)3*QcIs1k5n30@o^ zi;PbMK$xre?sDVLirkrfI-(T;1A`F5>1<#&nF%}uDnzYEH<{ap?s5aFaOJ-5a>PW` zW)T<7?XDuCfybRM4Jq$^FF#-N<&*=c1sp2%C{-YIt)&Qy*mI*?=WvwH=j(cCxu)bo zOxfJ2V@8>d^?63ws?`=cSisvio#z~-He`ePd};Q(D`&J`mYrlPSn6l5LJZncT8i>!GEeQAB7;l?_Q`We^A4=-btUCZ+seH<6{T_!cO#^rHR#NJ zs3yU+1ItWa*@ga)C`4Lg__QyhprO81t7*BU^H4WJ-nWq)b@l`Ambz2dUbkAJj8v@R zUIDt+Q?0$Ko#NbF1sZ?oD@o7q;O{|QC0{D2^S2*SQWE=CjWhPwGRs&LoyTFSZ~H1a zN+q5yq}~%Oy;+ASHx!`qu4}`hux44;8uL+Kw=^F{d3#)#-8d~C0Zw_R3Lhfh>?%ID zupT^NQm#$lKU&zqr1uRsr9K*-NV!6~xewGNIu2q2x+f9_d~Y(v(pB?GpaH_*sSS(-R}` zPCbq5AQ1cAqU(lRS`zqRPM3mwV@K-_K1%)UNtbu%YYsRj zX2wdU{erlFi~shxL4UMm1h(sRW9rX@b>C03aJzt=`zx;$M>9&jzj$PUiw)qPVc7O# z8f($`0I41x5>mlFXcfb|FlOwJZ@SF*^QyuP(686~MBCYflyX4q`w(p?_5%DHhdizS z69Xk>ZxOy@{GyfY%jo8@iE#6?^K6F9qtkih4f~E2--J<~_&UU0VHxgDJwaC@%i`s< z6v4AwVjcaDzX(-aUii#^hnpDGi|-1h%{h`E#!mpHf>VEzNL=9a;nEB+CY>b9A>2{B z!-s)$`>J}+OwUN(G%OUdc$cX}=Zu_jZ7_*66qW&I;B_jlWbJ*BP5VmhTY;BSQd3Ja zo#!jB`VL-Ll3d%}iQX(UHT=SZUQBx4uzk6#sFJli&x-MZmp5O_eo9H1^ukh8-KfqG z(+YASdS6AApPh!QSbiM5<`{oyEc0kZOFU?B@y&l&0CP$8V*K96D~iOrA9#Dj3==K! zfJ*t@rTQ(eCuGr5wj7o9cQ7ubCuRUZSdz(KeBmHcZF0+ zsD-hI#hfUeUZ?WRweKOOr_Yz1&=GkeFStTiI^V&owj|$HIy5^)Ae!9JRlTYwTL`gP z=hyZW_wq@A@v9r?>OUJS#fhnsYP+1n3iHc}_NvH7kq`2;F_mmQZ&K}n_qayq$&S3* zjvx(pXG8vb7wRt&Ck?d{5`jx!U~YUvOaaR9Ww70T_n9JII`ZYOqu3ERP%@E9EGs$o zxmjEFSvuNDC~n(ean0rcac#MT!qTr1Y4JWxTYIo0-{JhAIXdIl9khbmiyt{!Nz67itLn~Pey5-B!t9RN`%?W%$ z+50#pkWEbPci**Z_(69~1f5Lge#0&1vfwQyZB&rH2t@- zprb_1hwe7sssy#1ZP4pm6&8*Lnh-I7IM%1L{i>a zqJhRGe;txT{2lWVJQWw1Tk0H+H0GR6gWT534o6%nZVmVYmpo|z!N)0g$VaYo_f(45 zQE4qZcNDT|rY)MPeXFF{P-^A-k8F$cRtI3bqAfd}dM(cB``NU+p04cZAEOj!l2PUE zj?uE@1_5%$uZN#9e2Zy(Xfa|!7BpLa@2o{p+;2BQNDG{c zc%9xu-pF8`2mrc!t1^#ED4zNToT?qRxIV&fxfby8olF^ZN!FZ?N?W)~IY9sj4>zsXmz zYcU?g;nP?^>n@0@^|~@+h-5Ci_qu*9wCM9_`;f_GdMIKx~93Cul$oOTeAI)Ued&w;93mpC&H&Oo1|Vw3fHwp z&=7l|qJ6hLLa!}c%wh<){?;t%3H4q)cLNdni@9NWlj(^}qT{1n^p^H^qGMG&pc^3q zvTKiPda8O*EbcaWRcfy0@nqt(vr>2=t-sPNg1n~&7^3MtIlz3z(ZaTBTQ@H!SK9{j zO98K{%?d4p4|-7*X~ffk$VlWJU{@C{*fY32VLPmeD3Nzi1HnogY0s5V3k5EM<+IMt z3#p~z5B)Vp`h&Y1dj~c1`c57Ot&Yf7N4c)^FJ&Xs^i_flret{GXeh6a=4F-$&2V-q zCgM5(Qm1yz6trh@3?NwRyyRUbzFWj&XTPU?+b7B!EuN0SCRHvA2F^;`xf;)_S#aA+ zxhOcT(5krz#*_ZsxPjRmjyxM4^QZ*%zrJ7t^Taj_%?(vBT|7OcbW#j<_{zszxB` zD9WA7O1&DgI3OfDgh?y_J!!4ue`7CLb)P4bI3~f2xvctW^~(3|rwf4JU}sNR*iw<^$-lf9zof6lcI5^~S)`*IDTrp<_RKLp=Slg;yLazI zQ^`GuhA4KssZ8>|pl#M)!^N@GF(7`##)e9rob|w8yc;?{JUQ%3#Go;YA9@`C_ER)h z)&`ni8CX#2*zkz!LIT|gHa%BNTZ4C0)@YhJ^yQmCja;gO_idH56Y=MbZhDsEZBsTE z()Fn{o4!0Or)RpqrQe+RubO^yn<^MF|#si|{cPr5cl)&r3Fvo_Ct!NESe~Y;Wl44Ja z&T9hEpH6(T`M^2_SUb3##|wT-OGf=)`Ek)6GyinblH!&{PZbJ{(nE)t(F`*iU}vZ; zG(^91frflv?5(>>bJwz8(`Ek3fr(Z!x-a3qJKMnLai&Kq==z|05b@6Q0a(m*H?|g- z^ZdS?W*mucSbxM)B>d9f;>Cs;HF0nY+g8uB3R!*`eS02QjI_W+G*`R~R*dDv%12%( zfXfM;tmA^2&uBm$Pam&`b4`{Hi~(7X7ry5WgDN{`J4JiNC?FcRdIgXT#K6~XmTpQpl0>nm zedFma>iFOcG!wuBx{;sH&R%DhuL`v3{+v)?Z%B*OvE)lwc{cA-EMm>_L4?R>`X?A&gCiAM)q<&a?Hgl`dH2+emoA#wE|m>*V5y1k6)=K<`xUa9SovANwzXbLObnrDAk2-xX95^rg2{G6GOAr@ z?+eZ40>X@~XpB5W+6L^H!;`y&qtRh5K*>w6D;Idk5fO{)X#E1Y-y@9JZAJZpD{4Gt!R21?{W2#qxQUk3o?M;VOq zjc%75959g#LWan@hZ#hJPX#~9T)XQJTI2Qi%Czm?Ec&9ECo8kh;N1w11qTPSd!AXd zI@4r2d>%Ls29^>6(|Sot9~vR$pOL8oBxc}vQ_OPWt+yL=qt}ADCdv9@as&s)0kEZ+ zb3cZiagO`5{Esj&j4yw$>2AwOt+2A&xxL$@X?(XC71{M}&WmdtjFnBFZixy_^9^@= zSTJlGL1}d~eyD`LCk{4>mBb}Y``@=*Z-wW-GQC+g>9du-{FMB?*$|!C5pBdn2y_y* z5AvSf4w}xtJ8g|9gh)uenmoX4IMO+YSV<~s@bO24&6^&gm2z{Xsctks5$r(Zh7;yL z!AU(iTLupJMShOBPu|+=j~7=EDLT8+CYHgUiajEr+*i)0jEtxKiCoCX8x_-ELpkjh z8uXnSZ%OZtONW-%B=eiL1{LcxUaUKRh+hcCWV=X?+xILm210ESAn0)C)Gs3Bp9Yt1 z2=d<2`N zrHTU>qK?W385Vq`a_#b39jqmG=OT!_xV0nD59#D0FuTB46oD;B*e@HF!|wnR?!mlK zW`2vL5$E-844?*DGiB04T^1KUK`#h^-0gn2UWtZ5ACF>Q*>kf#X4MVlb(ux>{1ri! z>R2@igN8;_8?`)Ym?OW*x)mG&UR(5`pqQ}Vc8UuVKf6t97XwJm43-?;URTzbp3$mH zNl~x=RzMa5!;*?i0l}hC1!VEWVYU^6G(=?&(u0BTUzi|ULZOgZ?a?*5b$;hkkt6XkS`14gD)d4dy*mb9^GCCU`r9&c z88;f8!z!r=E@A)|^HYN}>=GgsaH7ZSNo7qhLRB~OYwXiXTn{Xl^slOJ`{2a|VpR}r zS1K3uWDw@zMGAqN(MH+dZ#FFQo)f!Vf2Sqr88CC*X#2vdQ`M&A4-iU@39r&ws`wlj zG!9;Ur%sqrg;yVAtcSIe z(PA(|L$C7yMPjc?LevL%Ku%doY8@^Gh(WaQxsqF_2PrJv31D?s3;3pLB=PRVE0JAe zs=#u@mjk@h)vdLMJ7_${2#~FKM*D@)s5p^=!;Om*9qEjnnMhiyQ?)&MJx+n zWsFY+T!Sj_sZbpL=%{JOoL*vtn(YJs2P_Wo7Cj_Z>zc@5%6m3M-qn8Q0yOL+ZJ9)3ZMB{bFPOx>od*H9Cf=Z%5&k%Sw@4m!?bcJ=(no@bdT!7G4e-@fxlzyqnf3sD8o4XkbVx#ob-8eALddDZO+`EMZU}1 zX`S#_q0=s-Pki1nod|dnlCq1KypYDg4DMvY(=_8s(%$_(b2^ci#-+ePevbaU@yhIt z76%{aAib}_yp10H!t^6ttgrn8UpU}_YUp=8q0}L~h;m0V{Qjx~PCGl9WxtL_zbYGr z#!SNr{cmNqRbq`P!b0SfLQOaU{7FG{8FGhc+DwIaRg)?U zZ-Y#7!`E*PyZ2mB6psq*Oi)q@zWp$PyY>3GsFmp`db|9>GZJ<8%M3zu!+D>wz8qdD z0E_V|tECz~N!MczH&{xw0VjRt>S^Ei19mHlW`JW5Fa*KCW?Tp*2~~*Q!S|mZ1W)%| zlAt+CoRP8QAmlSv>|grZA5+U_gx%s}y3=+y53Ly`Eq@nVX~ymAr|J+?%agr!I?6U1 z;66>R_oL*Ug;#m057wPxAbshn*!Ve#5XuSY?yyy05hJB2vh4ZSRuGyr?dMnyC$#gr zEhEQF`$?oPU&$wPlWip*R?m!61fP0Hck?Iq#q%I4*`-6B$Roy!%tkq!)Pnbh1QvgU z>P5}nsz$Co&oRuh{+0AjOGk2`Sg#57+kj$ge6?Y~0EoU;6){?K;zx`N=E133NS(40 zeA5aOqRgZR-ce;H|3!00ajAFTCgIeb3CR!Jm@3T)Ouc1usznJ*J#_+XDkEqg>O-JI zQDSkZjStI2c0!_BEY!Wb7*Y!njR+LI=C$&9ij&ylaDFjvD~DqDaAwqEQ&h+hhVa830;Iw+1d{ z1F*mGcLf!Y$DzKgRJ7{#*Yn;yhO8I+^T|KmJ8V}cl$-8c(;OZr;$S#svX}mv6-JwS zc+i#5%%0fhCrFgsrSH>%ZLUnPL^WD7BO$oF5iwE6NZY2`LA0HpP@TpMn z%RnC4;7a?fPi?DJ5(ucwEr)wR`7iWZ=$GC6Nye;QAv*1%<|c#w!N^M(`d`A@_|CbS z=P6Ne@C+-KmS6mM{{C<>Ztz#n?c2w6%Cn=_f z%8}&FQC_4KqAe}+5vXbdV@=2$NZ2j=Bd`-Sp z63+t*&9?qNYx?40VoT)cr)nuUrLI`mDi4}5%zuy~7`&7QShD?i*ze@&<+uhy*I{$DQOAFTH_k;Lt*>Voc#8W(y zh4hi9d?09uzAxY44*#G}c%=uNiM|^TPp;AQH@6SOc}2o@9#ga5@X1Pv;P%uDrKb zv`^i;Um|1O`10H|yvr|hG@tcJ3-(F2!akZJvx-hH7ICm1YjzEpq_}#8f9OacD3R2&NYde4rdsbXXSyIvx9yEP?3(m&`+F?qL0cH)0&53meYx zDW_C+7;H}vys23oIOmL7Y~=Zn)+bzEQZwc^4R>Ki z;Vaq>btf2+-8k|WQK}Y$wFTxI$)UOUN+JZ;ImQh2; z(0UGQ^_%sx?r$xcyp4Yl1z9CL>N~SQ=~W&<8}^_gy2gexmT!O^OY+8KZN3!2&Cjpi z(>Re*AfY!!Lf(6GJiLE5oRAKa1Zx1nkz=u~WeEz7(4mcsb5D1}QLBT5 zdOP$7kF=sow_m-gYu`WYBX5rzFg~9frQSc!k3s7f{7o~eRx2q?PSwIhCuCdclWZgt zE+WJ3Mdw^KiB7OJU@?=qS&Sgz>c;cieGdDG&S$}R$p7S<_Vc_Kkm4~1kCQFO_`Fh0 zPqrfeWHKT&w9Em26Y$M?3f3ev$=)em{{K=b(i zment#TTuvmZ53k3hter`^Pc5sbmhS^ODB|GXV*xxsYp`9kjPL$KT1oap5x{c`%x*E zi_+Jh`oa$!)Vnr=@Cs#ASAVDeTvKxJz<5TmJKoHP2Os*?>*{*=nK3_BfV?W4cexhn zy`A9vXO_u8eJ0o}D$3A8%{oJLpyaV~7m2QvO3+?yhGI8g$8ehx64xOjsLrzNiqv4=A z0$kD&b>kV~p{v(FL2zB$_LC|mtL5yYamzv1ZSbAq)S_~7M;Et@?Ta`T z4px2N{x988_hcgDq-}tFTX}Q^AH=8>pcu72zru+lcZVhsLnI@=@5=xQnQGWB8}^uYJXrhUQ$T zu00uDC2dD8mCkAzb*hETAEJ1j*dw=IGilkDoX@MIx8iIz#To>>+YPoO%=o6K%ergp zEJOVuswog*`3Xpzpk%XuyMd!0{UWNdQD}Feg`(okK>J#Pqrh`+k>!&)1=Y>vvKPMn zZrxGmWaKaSWC)@610ij2XmZEc+ecq9B?D|tpQVRhIHrFzUU)he+WY229PxPeN^t|{L^s8-_Q&T?X|`UL#+A7_8|z90`FAJHTmmqSMNm?B zO5z&rU<|i*u4b5J5)R^j$Hj5gjPPSOEbDxG>lyh1N+*S2iB{7G0C^3b4kr)RxL@wX*9N#ZKzXtm6>3cP|A-Q6T zR5Qmok{3nKPIk_iEOw+M$~MGA=$)6EmZt@Z9h!BzJ)4&L)~Ys64(5%7r8_pvse-hJ zEs7E4jD9f%!*5icX%`x;X?#sB#Ki)>U2YE;qD(k%!qZ#bH6csvVBflI7fum ze>Hl%vJyFahNg8T$~Sj#nQ<=%*F|vmOxm!5%4r#xk;-UIyb758!FOoY^=Ha!9)OYhEDV^wFcUNR;cDB8@YZUx;hj!~q=5>~J;+W9R&E&}d&Af6(Jo6b zv+|R_owH(GhsBz8>|va&2b-Am2d83GJ*$;aH9srU9cP2nZhH zAx#v}pr(2KiVWnG@vA(h;XucT?%{<|q!1$vZmq}L2fPv=;n($TC{D@C?lQ_eOMs|P^3yf;ysbXcX z6d9D0Ggoy{H^e^juEbUs61^N$EJ-aa0v=e{k2t$#!G{DGSgo^ljxe{YBKOB0E{Is% zH!?*+ll*iO;0=KNEaC>g@&|&ldjEMVxjUn1#JiKFuwZT$?5Gjo2jp+8#)^~ORb@FFoR*Z}*P#DTO3Dw*iT_8_!GjG)j^+9$B^4eZxtvEHBf zh07cR)PnrFr3`w10P{+KpM}H`fKGQzEujemfc5-xxF{0qPZuIqNHYfAu8Zek%xv0I z8hy|IumGE1GHhP;Oe{r)a-4R%R84m17f$XdO0Mk~5JW>Cb$*NZ&ndZB)M=P@9UR_$q?lvJmsS z;*HUj)3_uS_D8~04%pB_X&(`|)MzVLKp(j^J{(VF;p!kJ&7z4Sts42c$9QV`C42b8 zbVXanHVSjg1M_s8p^M|gC$mN~glE=8%4ix#Z`JMO(p5`e`j;Avck^dlRPiArGZW6@ z*AC=E1z);Ft8I zlChR?62Mi72&E>Mm4%Hq0I1kH-(L-@nXFpS5Z=!iIZ2t~qt^&PQk7IhT};8OOLjSr z5(8=Br1XNnPP&+CyfFanN39=*sM`c^Kgp`E!7C`p%x?$hX7eIp5xVtE4o&%$nHt#3 z^wcv7o)KEBKPj$)I~1Q95Bi-_;L^DF*hciq$`XT`BC6B~xIN&A#?C&~|wmg(y zy==6t)tT`thB^7t8!$yK(nrVOXR1tUCOn46mjZ3F;KwPEr`3_IJ+jkKL>g~eT0+na ze6eCg@AyXd9{-%d+dFvk6W(b&%e=Uti7iE#!GK2rtZ`hJV7FH?ZDce*%P8CvzkPRD z;9;-!y(Rjnw?SX=!(ym$llv!{$-eH=Rt798uoQ4X2HO5RZnY%H7em(HtvfNK-_(1b zjZIY+2*ePGcsCR*57XAcr$D#(W3}RmJivMj>nHZINaL`Xvmb6Pr7V6 z1dwI@T$-sy@>W&D2f@hx(=L4BaINnpB3ziwLXe}2Kj{~n2h{yUJ?7jqe{02G&$G1w zWsz&I=^rZ;8;P}S6K&&ra2=E(F$@ysJ3dXeuG}^})k!+hs>&`J_508DUG5!x6^eDy`6tqo4B z+^w)OqnwdEH|yX#S{Qb%M6W!9SV2ddpN~|8R?EoT%UX$mIr;Rx=8pktm?OefU~vlD z?sqQBa~9Gv1+|95Z|Z?>$KGfNFRdQeOOCxY+Q6kiLZ*&;Y}HdS%>Pn;HcCii(-j8A zwGj*SA-5?I3ve`*!WpDD-m?0hGw++$$I-$U{fE6ed0*=P{Zp#(<-@I@AkKd`kkM8&P0F5Ou`pIY|IqCZi-kYe!q zWLRK5Ub+kq5}ehmhlh@6A45G4Ei?<_46{>b?P|-jm43n!7ok~p6h6+N_R@=B<1dj? z2W()6UFj-KM^`lZYzWFU3_s7hk$^q zUmA(FJ5wdkqm~hbqhcg48%PjV`Cj+Q-D3Hy7jFM^RF4xzbWM3-Jd+W&4;CjtF^P1D ze$+*fd;gV#f1E8#e?jv?icgK-g7N$N!FwOXmkp0JC*1{3Dqv1IR|+r4J4d!f-rpEs zc;nmf9Q>Jgy}>DH^W%Q#68MKD(#(uLTX;Ovb;Io2G=T_1*XD%Fb}K8uLOdw;d!MSd16$u^EOPm8BZ3$MIUi3v zVNJVjhw8WC@~C~?b8omIBMof3Lao2Td`ciA;h50j$p*4bb&P5FMAvlP& z{Vq2%Zq-Z`YM6k|4T+T0&PqI6Mi-7pBQiLE+i^UWVk?ztk}w19(`R+a$l(<}@W?Ay z6Q1QOVcC$79d5?V)S$QH)INE)Q#@0w@bHwX?br<4x!X+j)^t%};wl#FqpQt?lSvTKMQs%1WV zT|c}bBL(B?gRxFjxsEG?u4K$wmmqRGwjEI5MyW9PcpQQ4kUK-9R`=PJ5Q4+i=d0lf zGIx#_CXA1C`NE&YWVrnwAebf4Pnxnls*=&ln~<{$&N^quGFkTWiQi>nqg#}4BT_K! zjos}K9<9wFPU&N2|MWk5%;3@~G3h`Bd``SQ_B$=wRx?oDtw3wLz}E-KxS<^?MF&

Bn}l?q40#Hq|c*P;Dl4A%95Ei z*Y9;Nftqvd6cHAl2Rwg9#=pBWb)>7HxHUbkb3Fvi?%K?HaWe)dIa?{goj`g39!ao~ zF@!+rsHv%e^G>{71?cc_Z}iAv)bXXT5W}o|Yzvfdy=#dRoZbPuWJYLi@sG?b%UyS> z5b=`F0s2r)0@R>agp{SFjed1CJ@_9*HCZF!w2^3}#XaJT1V(xseB{Oj_Oe+wiZGVz{AA!TY2wDI6P{J%JvMw_6H&LV2s?*W4 z7#g+$b`zk80QUd<2qM;Wps0hz#Ky`w=hTghacc>UY_Kr6nA2^D{d*jHca(as_~%0h z6e3Ja58cg`m6u?h#47YelZ_n}=G@zSMNh=h97w^4#6d!SJehY6ztC!VRELOqI4Rh^rnS9Zs%VjN*Ldzo>D9W$BPF&0M3!-GAi zGD-unFq7zV_VZL~N8i(#_0>BEk(;TWZ>bA@`~R}JdeHMYdmJi>#zfQZVuX4Uh_omMx~nJUk;s~@O8FY zh&+^GHI*`K_0fEdZjPo~5Zn+Kj2vSYP}j3{=$L7_wAkn}(%!%G+;XI06TLZa<)oh^ z^mUUy+B_b7E;gh2TKkoL(;K1rQ{0}Pzu;9(Yc_$L7VkI?`M{~|4{b#&d*OyxU;~A>2 z3z}0Jf|?C?GULeijJM%FTQ**6TE}`-Z=K+1N|{W|1q&@tqy`!_0 zrAGSzWMtMKUWs{>MP2?%{L*H)Zp~aEG|p;bH>L$+Za7mM-$XZ&3hUYWtgC#vcV+E1 zu7UNUY}to%*)QGVhtoU|r3Zg>^Lf>?mDFcx=Kzc7 z>*wYy?`S+~3jgPbKJX1`1Q0_4%x1SD;|D}Y2$Qs%ia*}Q@h_`JU&WoP{YRm*JW5@)X`!51#e;xV^;MQtx0p+C-tmim z+~1@7_v0Uh8*py!b7dl_G4I#iSJ^dOTxKgtOb7wD=vvnKSdQ=`$l+)%%3dsT%#be^ z@F@BH8W&M7=(qF>Fhsf@7* z?>nLJJDUu~I>v3^b#vd(48vIVyN9+=!@UH!F&1jK1}m$=vrZj#|^ zU$o1S2gtqX(cwzJGH(x`qALDx4u~pAD`n?JE7BzmA%DhIsSe^whKT$;1{lFC_;4pP z`EKmKPk-=^X)Saz`h%puMp-8V8YI))(V%7g)k@)@!(((&|KW#!pk!(jr-ptzp=kr0prUT^G(X5Q|o)aGCS5B5|3*_I4GBJNk(b9=nZ+^`Ch2rz} z$IZ#<&QhE6W!Kch78i7zKRB$K&$;WgITWWvIL=`A(`QLCH`DFzK3@O{`2Ma75A^xb zlm!a|0x4wxw}3z<62Ra?0=Dl*8Y1onJ_7`jD+pc*fv8e};RP!DSTN)NA6{lqeO?k1 z69belg}1_YN8nRIhTkB@tefU4w93FKnmmTB|2MbN#~-A1=YM?vxqf5>_JdP9Yo3b- z=UFbLtn}9%)ZjJz=Cgb5X$V=9R>LZ0x!QxS>%Z2v_U(pC6h#$<{OI5>5Jn(-a#ZHa z7*xv^Wx+W}L`XBnu5v4Rgl+*sP)Nc3=-jBLcqWMf-Bfy!6D5u7A<|P<>NhtP-k1ao zy(xc-|SNZW|||8rtGPy%U^P1fOUQQ*}OIca67O1N>*{{b46kuLxM literal 53861 zcmbrlWl)??@GiPh0t5&I*8~k7+#$g&5D4zUT^F|qF2QZlpb74aFM;6hvba0J9nSDO z=U?}Hx^=7WR#EKED>Kv6)BW_*J;5Ipq%hEk(I5~AhK#hhG6eF-1Oj>Z@!3Pr@^w_Z z82m%Em)3NGKrsK_|2>Ff#3TWYC{URX5-7`Pz+M*O{sTguL?r^YAOCf3`CoToXGN~O|h82D|BvajoL2SZ$iwEn)Y$2L{0LMmyG zZhl3EO$iQ&mPhoMyE4-{{>=i)fsyK|J74>?EC+J zU$Ne=)EB}PiTj@~zBfDr{}voz$;rMKs|4tZl6sFp!$02e@bI(!c{>Y>vXvD&vRUH$ zyX|=}Ffg8eUmVJk68`Ta*>L-mWI-lZ*IVkA6}N7MJ|r zJw=QR4mJl!P;L!nb$n73GTAf!zuGZE6$KCe#wZGJ?(Q(;Z5{sy9>m`Oy(SJ3BiSRqIR=cydQXT^zdD@`Ua#R8?IaZZ%QtwBBDP zMM*`qK9D|d!O@>8kPsKwCKR2Rc;3xe!kZoUE_=*Uy+p51C^{+%n}}#L|5T%Mb>1HP zzrk+cP$wfg!wqv2g{7}7s;2MzY;Zf+8Y@uK)zH@Nv0AKkT30L4o1L6|CF(S9m5ZFPwyDT7+mDNQ}~39gG-$bZda8r%1RwQ|kn`oke^894ZsTL_Nkc!@cCo zs)Gdb+<2M-pIePn*GuBGz^R=It1K^Pk7}qf>cCuUi>3dBhK80h_GaLu6-(q9Il^H% zAbDNFal($bHT8ZNdjr2upw~C|AKlvlRZGh)@JQmslP6C=Z#aVC0+j@0WV>PU?hST` zn|SX=uM5Z1leNBN-67I~+AbcQNC7wo1TvFybV&fFY-wc`EKM7OLB>CNJe$m8S3bmC zig9G*`cSj@yud!PXhmde% zcel^mwfW0~2K|Rev0GbPC|Klgr9?$VK@Zkl9kp%;hN`M~*#7?hnzvG|WMOISCbD20 zXSzjdjOPN_cP22a?>6eeFYf|kx=Jd2?{5F=J+SZEaj3XK0w&*+)V`GLXVYHR;1%ftGxunw^{5598{AqH-r``rEWt z1Z@CCL%}3{p&$9zlhk!pAY#+fWUgZ|-u887N(yPzx}$EbqrW#9HumE3a%-xy>&>O} zpX<+EtWMpr^fEFsGsRrUVjQ|d47#8Gr@4w{r~l1n$p%dGS+OGgLf|O+EXVr%?%#YcqC&E)G%uyZV`wB}GJO7zY2MeeSTDB;~bJscB0mfHR{ww=jA zAt51;js604M_g_(UZp#OJzr%t5fUgtS?7L43zu1Ip~N;ZF~P&bOY%Ge(kZ`I49_bp z4D;@L?6GH;mMX{4GQ(Ptk@1R^RdKqY&~OjC_miciW#WX3PlCMW;aTRdU((kkl(%#W zYCeGvAQ_B~TemE^m0HXstciOud1)RYLAG-Znrdq8m_$9s><3qqr5|Ae)Hc(uZAFWe z!Yo~L#y}9QfmmkzAwV~4FV>DXN4}9UQ!ajSPk?_9!WiJUUw~ZkQ&BBXnWcLlZw!Im zJSnA^#7+ZrPM4!#%(9kDr6++E3mu&*6PUBpbD;ZAP?Xz5e$=$LOYY?v2~Tqj2(}7! z%tThwD6+nJ6ZGT9+DXBbSDfm-Y9{+8!CLc{Wo_!j!{hI1!hn%DZ_afLP_50*QoCbq|m zjHn(~sC@I5m5~XSh8iiaDT>?}?>+uBgQ@GXMrkKK9W6QnM)&*o?_M2wz0G|f=43ga zYF(4pw#JI`@+m@|+(#dhxvcOxUi3Cu?WUL9__AVB2=_MK?>$FH_K|9(EJU+^t(;(?t$#aQu#G(pmv_*VIov+90R- z5AyPr`B-srFc`zwj`G}dgu=)$Q0X0=FH6-a7rNznJ~lPNtT<5-5sKE<*5cxS zfgiEIJhtE-NfB@@E-dV=erNQ0@0eFF-tZKO=X$cGx+n6lLAG;7wcxa3Q4`>*orfBG zH6lhAhpP?qHv4mpQxo!JrZQSA{m?)h2jGO_*Cpmu5DMsnlTLA|_x+Mqe?Wmi9Ag?f z{~a6<@k2KTe~O8TicaFuS<@SJ2*nC4wckvXjl>O!t7vL=HT8FP+M6R1Fb3+}4k+Pi z3INAcyt>zbZ;jt)EX>qYTgw97n9V-{Sg=ORFgiYd=)(;5$m;DR!q@kAarp~Z(RJXx zB`9k+5OQG($aZb70L|cg5r-dATJ_G8{4C1ZMbdY$+-4TM6dj(kr9`jNo-Qm zUfmb1%yjfMk0;j(nEu|x;S9Bf5_~vAJw82MBdc7mH@=t;RY0m~X>~VMADsaltP6`h zfi~e#YB>8lFZ~S$rYsgtHh*!nJ~ctPZKIej>LkrvUh+uDaA|dapaxKk(yYC`y2IS{^5BVrWQtW%U021Gx3;Gv=$Qe}&D>?@S8} zv4O?``J>jiP`!QomWt}TYd_Erva-Fe6EgIZLp@70ZhC!W0iCRZ92_Gv>A!8%HEn^e z&tMqIv#tKwy==KBnG7w%^D`N4uJiBFh9AQ6Dxu_|RW~K*XhQuVo%MnEp;FQM3 z$IFE**ZWhK@qY)0h0WAB7y%Dkd)v9OVQy;|bKZgdr|2#PSd_Hh#IL%i12>DUfw}7d zVOj!{>+bG80~Ijoj!oh)3yGC1-(rZuVmwr{w%!3S#OeCnL2qZxd%)(Lg^mBl^Y!q( zi%q&(=Dw+@UTKZq_|Fk#l1EU8xHyvp1p$~$F603P2Ib3_FJMhvV0V)iQSm7|q`h0q z!rs6FpYztq#0wSx?K_#!H`4>aXtioWZ#lKO=+vy(1M_N~-JtpY$-2dmz>=oR5Db26 z3>eTA5Lzb5o9>+%AyrSU0NkC(0`E!;?d0}N*tzypQdd6%vLJdM02Z@;V4evCg?_39 zY9~BdQW4}0F|#J#oG-Yjl-&ZS!^@)5kB0; zWXR(3Q|$N@(<9fee!C2g|ImYfjoU3HuM_|~B~Po=3RZuJgba|~2jq%tEH|OA_-vh5 z0kmb-Yv2XJ*XF0fqM}uWY&m&(&QykbN~Zap-cB`$i2!Qr*A;wS!^5VA01EwuccpEQ ziJP07iD~Eh;>emtq8J#Rz<>akyfg_Uw}(sr>EOMkNvJQ3cq(OOYipYK)}qdN%OR_2x@+@X-HI2oS?af(PK|yXXH!?~tJP{}Blg zw*N2u!~f5R)1c0eAk8Mn{Fj11Tcdu_;8uy3UnSV)4eyfuVCtl+6)nGd1o`5W;fvku zv}tz`aSZ4o0U)i$*Q^iSipTM9qv#rShcLlf+JVug71XBrX2a7Nr@?&oFx8L`ka;L=H*NseOHtqUs#^qHz%F4a?i#e-sWZ@HxQ2@8zDdd zp5`;e9^QhBkMA!sze*7aJ&^nvdxjOVNO8X=8;U7Jm0{_P7YXnjiJ>{?0{BISq!2BWM-l_)i zpPi$O&mw#ye8s2lmq+aW!o|6gJ=0x=pY9i*&$u`PB5qz7k~v^dPr;yGQF?slLxh$! zMKfT^y4?MuxxOMfhPu%Z9Y+fRB`19hc&MNtFR?d*{=Wa@X~*K_oO}^)!83OmdQu$| z(oVi$fl0xO-iBzk%r}*cy`vkK9)CiZM){UOS64i5T;{(!Ufkbt7_B7FfB&5S@M`UO z)%CQHxQat0X35{CVW1P}?n6am8@37N-HCSvL$fZ;jSnJuR*09SUhIZ&WA*-0O038tbW`|0-D9BnM!^^oG6C zbevh@pH59~qm1Yj=O=g^BF^H@lK3623pZcthlIL_ax`|w$Qoz$;5F@o5y|Hy<&IM=zh8C;{32Rd++wu26aD&N3DqhmIBazM zr}^bG3K3YTT1E{P1R`xUmalr#w=tB3vTs~+Hs?8j7Y=2eu$xJ_OP)YnUWz*%Jv!j9 zo0z*{zmwLzi6|RV0`wk@4M(+4oq$na00k4FYjFYMY;1yVYs)v~Tsf@L1}rg!$QFS- z&yS-BD@CRBcZU?Tf2b~>j5K3ImwAP3ckQo-9@V)dYGEArqT>hxv(!uf=FNspfQ8=Q zYYB#-*uJ~IZM8nk-ixJoTXw!3Buv#K`K}_J)8@1I)_nS;Zp^#BP91#@vT^u7WHex6 zr)tq@Dzz_Yz~Uv?Yn!!A>NlDxZxeYTkeZOZ2q_Ms(3zD9^*OW8TMe2cbb**Y@qCW@ z^T&$LT?r_N+q^nIPn*iE3q|;K7ZPc_)pSzMZ99LtX}cFS_-CLA#%{Ou_u$bD%3CQ* zC|r(n-WEvzrv1ZSQiYlP?Z$W4UAsqLez!9EyY9x=8`S*_`Cd&u4CSuQJzregF$$OaJ)O#kWT|2a_f4a2$-*qXUOvpxJ+%NZH zla51Q8h2$SA-8c=poE>>RG#*2Y?))QG<TdHGe_tJBV0oBF>An~=$NImwao z#|%3!l-x1Nv=}}-Ax%ojH9_6EZ886q*~+;2PxiUuBS=ly`dS~2aU$|Qx^Kw^XA zRHj177UTYr!|7Ao+?g8Z1fjmpDbFt?C*#IU@NBjIpwD8$mj=wq^x9g_k*;f#BhMjD ziJfnFFAEuSgpR0@Z{Hfe?wf0$HwaMG6;G!d{Ov3q4uP;N)Vd$^T(|DXMt!|~G+x3s zHPI3VzTLm-YPl>XZ})e0YCTW7_l>d+wELP5UyqQ@bR{GQeTo9h+on7o?;ZadEfe>| z$j=-oy&^2{P3A^iBW~H?4k{i>`0uhNWf&dUu{44_tmFdj0p5+YM(+CV6g?&3Y7+K= z-`%$jm|X9b=gWEE_FVPWp~UZ_Dbx9)dUcoEXq!Gr>0iI97O{3)%_HM(OF)Ue|AE z8;?dOEi*#Cx9_!=>$Z%MK7cfv-VfD!Lnr$O(a>7->|FUNx{cLS*WcmPajg%SUdN2= z*qC;NVt4>yqTojrtH3(gejmg&rV^mq{mQIJwipnc=7^AmQ}I58NVkd|Ws2l!_g9bg zxo#r^XVR1&PmezrLEP?G$yJAQx9z?mBmEZAzMz7QPEX&l(-J%F$X^-z!&JIDUb8p@ z)ym?%umlq|1wui=_E+Zc?(QFKu`vkb)NObS!yd!dY;HBAfP3a^eQ{E~+BCxqI;*-4 zd=YbAy=uSVvl9ozdW}TX$whgJg<)2qNK_yRcx2Vr{(nEo*G)}_s6{bu_^;wt`4xMA zP;c51e8&E#3@XsIk{y)UERFVqX8r}L)(_1A%$CktVRC}|S@(=hI(O4B86^;GOWqT4_?L5HArJiw7%TT6FAPg zkf{}!{YldC`|!n((H4cM-rTTYD(a8VtRq3xTO{&|f-)YdQ!5NX!4aMjBM^HdR2kR{~sG`@jBdtAM^^8monnx>eHT1^v5*Gc5}9ZT-%O}*>CESzCQ!iWBy z#_!&AbWjCglvNNdd@ZJ+(WF58;XHa{)wAi#?W(65m=wlK8GPMBIvln|S?ByCKa_gT zdAehu#+LSNNKhw_p9eg=4aF~1HS{sW9;HC7Xv^;DA?5sP$aYD?W&8I)tSKr*!6BpG zU)UwrmZywPW^7VT_4cdH>iX*xEav7l1C1`-el1509|#-Yf6q=& z*K&vqsn}e#`GIB`Htl%1$C1ylb1gsr0xebYb48A(j7@%RT7KxS+{8VdNbA*bUe=^3 zlXpI?(x!*{xfrU)@626OWHMihJ%Ct$X)uq9$8YVQ)dvGJ8mNBr|KPYj*P0T$=}PAb zaBR!{MlW$&9CgzZT8l9o3Jv|~RRSxx4Csw@xj(W9s)BOCN zUUk}%!is5ZGsDs)>@zo49_#L;#-weI6lPmUBPJ$xbaJwrw=G#^v9UBhq{Qx8;dKB0 z2qjn3gDmyRj{(!ghn9*uE%xOb-tomoD-SZzEin28vB&U~(JOPl6$$mBRlBZE)t6E1 ze2g4_+*m*V?;O&_bfr;nFi?6?yN0fttBM1p0&uZ`&vWJHFd?JEnFKRGOrO(wbamm| zE8ln@&&7^_r~S;H$J>l|3BTA7+NaY&pMP@IA@$cNZrSgixr(#`?B$MdziD;0L+aq* z%nbemoDUYo-p0MxU9!%<2%s%=b~8(hppan74)Ryg6^{$txE$(d{auoMDa(MAVCQ?% z@$q9=s{k3E(lwO_*`{68dpjK-r-Im^U&X_-9p!BsoNZdCC`EPRF}a5+&2Qc%Abv9o zbx0Hh1>yd25VxdMek#CKS-VvWS#uk7J6;X3`W*_O|MiC?5jvw)9Avw_9H)uzT+Qwk z2@hiKEWLN;PrdWm;UQK!%Vj!FAN*Sam@+q|*XTEQRQaSmu)&UN?_BifD-EYw0L+pg z|Jwu85peY_v)E>tTi2?!UhFmrwLbs2uvYUs>a(JyaYt4y02*t|XsM=(97S0ZL#wR6 z4_|SiGoQRzB#=bI6B2?w%+f)S`qe+bj!&A5|mIBK5Fr7qp zyVI~P5OR@jh&1=h1OgXFa@)YidiVCs0Bq47J-Mp&>V@iT+3;`fQP?jOmemBju%Aa1 z$2N(`s`{&;NKr;J0eIWLisV_7G6yz3pip2MsU1WDFd50e7g zvi*{_C$f{b%PP9xAs%Rw!0m3Ja8>oVRK)Sx#fd)o_2s<=AVhOY8U_Nl=gCQg4aLSy ztA7}cx9@@=h?=Iias?BMLU<(r%igKc;{?WL)ZUlO)6?Az*mo%#s?h=AD{C*WYo`Gr zvqkR!`8-ec-#X?3z0;1}az8(_ep<0hg%68jON6{3hEK;Y{F+em@2`oLq|N(c@8Q7- zM7)A#6eqr5MG~gg{!4{HdCjs)e5>KQHXl>S%H}6KixAz1pHt=ZibW>H%CvMv(jV!i zJA?=m8Yqiy98(o4>^|vXjJS5`;3ia3e#lvvO%9BifWof5-PN~HYo_##Oq5MKP*A(3#veSdhaK-!66Djb?0{h9*k|9G+@`E|ge}o7tM2=} zAkN&W#Hz~AXW-#E``qz_a}aN~!TpHh?p(^v%}qI4f`+fr7&k`YJ?rpq=a#O*rB|w? zP!~(;m<0`8>)CH60D^`7s{7T7;Vt$nJ^DHz%9pTfC7P#pduXS}CNvaH`Ilj0^DpM{ z4IDp5wGVS!xXg4&i>lfwqA>>t%PN@D$JAscG5Ka}wC`F)`~qS&7I&$pJzLdp+iSma zYwKF`>sSv9I@<=+O%MMNp$D z#RgNoY=8p@xz~`}+RvY&3p{KK2hro%4@BQp-?laDa(-3PMXfKvzD%R{6?coFYvvg2 zbTSC_M~?m~h}*~>;;Xm4uRGgvwF)lw`kJ?Mky&zEvF$j7Ab-C=m+1Qe;M8Ya9 zX8M>Bb?RTZ{M91^El&h#v?srsGnz8H9E$7S=2j2HG*Ny~p0UJ@d=ppv=(6w$?4k^8mP`z5~A>b`UdZv;Sd=tZ=;+0#o zScz*>^QFLoc%|HQObp-h94&)ecx;ey02Fl6U}Iy8`*lv@jg5_|s;Y8vRrz9pQVm|$ zJsqq4Nt&+EQ1Sc?UgZLr?7%2yc-F_h4{G_y{QgAp!lBI|+?lu1y+rN8 z^2?|*XV43G8!|7(u&kzCl<9UIynH{rt~MfhLu;%YW5JT50i~ZXk}Q>E_sB0WSaq>r zr~-T^c&GcQCi`*qg$?3$3~9kgl<52HkH3c51^VD>sn1`<*`^WP4Fn)cOTOcNA1{$f zSg8g^u_Wi_D+xXzJv4X=N%_yGPOOIYKO}V&>{I|rJ-x(mqi31EU2DW8Xxyn%agkje zS9Aq@oJ{r`qY}MFJ+A|at90~!>RnL_$-km#o=HtWGLlqT)hU)en^0PeBuOzdfqdf3 zXRJgZ@{$%*(vI2%P+6fC&njGkQ$iHUO9s#NeW7AwAx<}F_0_$x6-RKwBwBMdDUXDdG*}u-j@SW?O zC83pO>zrno0=VsFiGt#YA+SX2>iwen9kUFTI+L#3MyG?ztJ|JyDy!SlnOo#H0ef*} zW5CAB^M@xSsr-s)gzSfw_U}dTHGMQrYM|}w0QGTh5JQnh~crQ^JO(08?AuAX037JGFFr1Wn zI(bm5*;PreUX)XvlvKMmv8mzA{$-`kNpGgA-rKTcGnF=R;rY}yrXbpz!6ZQfdjhGzHm zNq2F1>xVQ?a?clg-=-x!?n>*_O|-5K9F#|7HD)V@Nv5hes!(T}(Ds_teICFYq-fianF-qYU~9 zP-?t0PZRka1d*##!-nTfW+l|{CkZtGm5vu_*LunT2kJFdZqn7&6&)y{_Kvr2O2)}W zi&MMoXGpix8&-c|#f(qezm_sW;Rf-HZ+PP~;|EvH=;;IF&CUB2V5RYt_{0;kp6uK# zu$;cxys~{FYZUFPYoW#J$`bjso^YWM1Dc~u$&MS!q+Qp_WCmuTAMW7BSiAiM^`Fn! z=L$7OHXCu#R7JH+P1VZF9*~KY-)mhS@|4vl$=A=DjLkG#MVkR|+c1I6w*Y(zF#33U z_6Y01`A^^oqXdLBuS5ZpeRtdHS2bHcHg* zpJcep_*W%wDf~jG<`qk_a8DFhkTiPYQ)^YDJn0TH&H5Pa_Mgyy5i2DYG zoi?8GM)d5}^yb`nR5vT`<$6gV9~zzFlRX`#p|qedx?1q@yqfwJ%f`t55;wa?KUIk| zc1|r)DX##ZsI_{_7=p4j$V;C?O=xOq>fGz zt<`ZL1^5M?hjAFyq*M(~5s^LZi&GnGEX(cN!Lhq~nFZFUm{yy4@|N&4XZ#r6DsJ{u zL9BxA5%2r6-cVrsW|U?V3~4l=^5U-BdkzVCOq#KjV-I08p~{mDZu;}kjqT;=(eZ=R zc!`3vJ3wh)l!+hNMB>7q#9}y%? zOLzCygFof+F|kv&_Ca(NPuF2JAM_$L0$~it2@joVo~(vU8IM)?t5|4m{<%7IL{^I^ zwbK*@u`H^V;%7;B_9|PPI-E+e&Ccb#>^9h*o*`GB3K3HC@#=r6YLTQlM2Q@EgQJ%H z@@)6VzKd7!c^BlzgwR=pu*)H5{iqROmr?Gn_M_+HgF?_xWoo{yoXjIy1BL)<&moSU ztGx=nH+>BXvWXXqmvEX|X5J1En;@bdo|PvRV;A)4EcyZD zpZuf=!IH+8vGtE$e_1YNjKc63 zjw41lmt${?sC^w}&+I_U>)}2!k`?^RTTH~R7EkrHHin9-G*=rm>tkV-iv4vez39b^ z3e^AMJJ%7RBT61S_nvIc=$6*L&(V>Vn_-`1JwRaLyC5SqWoh;@~HIy9daq8@d5M82wlY3K<{7K(p=;foV8C%sC z5VzR9B!b%Hli4DKdM16vy6vscqZ*njA{>_oAq&jMPdA3ITRK_8-gKQ)2~2ygKjfO= zvqZ;FN};vOSkS1TYG{DpsY={HyH(snZ47 zSq@gmvV!k6?JSIYJxS=l>c^(;nze&T-c6zC7T3hrox2VTKWqN*CiA=sizHvVBujuG zY^=hn=l56>A8ylYPN%G?vGJ!ualQ&B^*i1n&%US0!besGiLV&^^PZ)=QXjn5>DHIW z(7IeTli~siYz5FEzqz%m_4zXw)QT0O`k7gDK*=-g_C2V3oSTmcXC2JQtCO|-mAN0G zCG?2>Rf?%CC$daEO>ExV^u(6M@k!UC;Lf^K1K2j8Us+a$(R-e7tH*X(?D-D=Gy#;4 zh)89z5CqacBy_X{Qi@ZQV>nC2!SVK}9Lx2GJ>RgR2Z5_4bI^uZlo6F};?L6a*iM-h zMY_SRh22qa60(Y8`;Cbc_(K0h1M=fZTcq8yu19??%79mH`exaLoygObGcj~3)GlYa;CG#$7B7hW;R>DX4lAEN zH=d<&{uKl&1tjj_*%OUpDqEgIt`2$xxz7r*;d+<-IEMR73`{p`d6(Hp;2~Ita?cK_ zXu*fgA2wt+75D&O<&i2jUh}v^`P%bg2iOni&;7#pm*C`9xE}!i3h*oMl}BAc z?uy`w-(-#yr4RAgKKN2LzaXQY;8*pGQfP*z&u30%IRiqilB_Hu)AZt?%(4=#>7VAW zO|y3MMHyyUu4fKO^Gh-;G_Q%`%j}ePw3VwLgN`~w$M5sW@9rL0>n{M*guLmR-wAWo z7Mbm1hQ$c7{wbz?So1&tjOM(Q+NC6yY5 z3{F=uyj^{9R=WyA6k>Shh;>(|+W#R2dtt928<&v;Mckh4D}c-I`XRgS}R2R z>|gQdFlk~&Dw!AtepV!3?6Tc+fdFa=`}A8y7(=;=Z682*A01{gg9w9l$g4+fa_--H zpE^TviGGajSo5*S7!8Q<(;8)fK1B#?geHYHGcYnD5x$6$5<4$1FL6I(#)BL~U-{z$ zD#YjGV{^1H97YWzj_+xhCAfqbXBa=b_Um&+SOxvlFbN1rC$={%?(iN~Yl0S}CddK@jl8EPN ztl+CdQhh2xrahXhC4}^8Y$E(|=6a6ca9ZX#{-T`66{>u0A#>gmVz6c`nyb+2SCskE zw=2PC8Ofr0l|vxUs>bAfqUeh}-H39)DgmUMPX*`f1bqJvMx0*eNbh>|Zu~TrFMVG~ z<3=p-Zq=h@JNS;vCR4>3|0gn$-J}~hYrqe63MpslNzHppPW;e<`$!aLED#d&!XCDy z*5zmMBCSuXEhfy9$7Ka$WD*XoYsYc~xAJi3xL-h;t2_jKt|!NAHVpT+ldJc8yDpX> zt{rBd<{FLXgc{SyHzw-gXMHg32=bemnHeUZb&w1N!0wx#63GtjGkc8yzr!t=r`uy)U1FzCz?%JX6PQc#F3`gDlK&jM-N+6TX%o5suC9m z`~aSl#Y>L49^L)S5sOos?t&rqJnSfCqJ+v!8(xhH8XE0B1gj?~E-{^sMX;8DQ#kz> zhFI)PdGh^QKPTbz+C?UO?vih!%-)W zm=SZhR*^|}rx!}|wC$sPA>;ZY*Tl#=t6Zr}n7^C5Qc2dpZb8uMvJ^UI-MYA>3wy?w z(`K{N?3&{g&N%b1?PD!DB<}q{%Bfiy;&y{ec8PXib`>@om8mv#&>9g>1)UVFzIu`P zgztava#7pWns0`}Msh4NaS(gXz-TDA^5ikM}PEn%dT^Wl7;Rqt&t>q07`uliIl7R}D$ zEdi4qN)sKktm=AivnTxFn?2=Idn}M6sV}kfa1}cRfsK1dW1~q$o?;q1+mG3%ed+g$ z^LL=u^iU3wxL-w9`1}^WQhRqJog?##(fk>h zNAhRJ;;EDLpr=OdG&F=L33&OnU9!%_)j}9rL;W?!^0ZH@=OxY!@+e+3S49#CINY@N z@eEJsARJ;mOF;l0EkPfuynb|fXDT0@&PJ0K#G(M27$Jw_4eYq#x)spKPM?+mA&Po;xld8-o7|U$dH8Qp%#@x5iU&w4v4H3F zjEwazyTnyF?VyyNK;O#&6rFO5ZJt^ulVJ$E>AlZBjPZ2PgAMuP1+UFjEl zSjC7%IL-@FxtHT;h!gj3|1^9Hz5?FHz||sQSe2xH>08anIqn}>N*{_;g*?ECG8SWR zG;UwBjq4VK{Gh6WNhc=*JFC*(M&0+JG~Zf5$3q*Q<*@b{*`Z>V_bg0C8>wJo?`eb^ z@@mbM#_dIO-)q(oKIqDMeicRONhJ~e(R!gq-A6Bs48?q=dyvh3zyBODW6`%qHq zYJax1ox~PYGLAON!z#PgQq@vpx9L^|husQPtt!T9PYWrAG*x_O(gvOlO1x%;RXJ?; zhikh!M1&D?uPAP-Ym+=?Uf*Tb1|;J*cPDORn>9>dyP3Le6y04w^Sk^NBOxY!fnWc! zac*lChT*}`pBwVsRM8-MX;NL6TQq+{N%i%Z*U0B^mkrKai(FMaDO%?-?^7)ds0+u3 z9!F;Z4Qr9aYAxtYrH$z4t7DO#kvN+P2ApB`muu{^-j+r2(gpo}ul$ov*y3@tzZedf zJ>JNVB=BEdrC9TC1NPdtX3vI>=^fFA$U+v@92v+uw5IboA;rXh1cd?jad%SUtNZEu zhsL@zAYFA;RUvT7LI?*Jm(#b&S^Lv?{K#)-(}}7YZhG+btm9XmbcTD#8y_A(YKg25 z%SlG*y8HI!i{_U=TN`>(%{%%}ty)h9sub@k5``uhaP$2*Ra<7RnTcvG%e}b`JegST z3H3)=Lc5PQ$|DJ$kP5hajMY=vM;I6Clml+jtopOk*7abdSuM%awN(lqN$iE7ubZ!d zniDPkQut)=S6*J;($WG-kWZz>#l^k68cIq^RL_RuhJWU?*wr%7R}=rrALLzPV&}b0 zky&3lle&#L$_eIc`6_6`7Lz7pqInht zNzM%Xl>Yt`j+=+-X1FLh@G;5J&3yN}RmSsIp(430lb(}mHf*L6rr%nIfkHICVm)L- z@>hrej4XV)pet3vi+!xDb4+k|em*~P+dMw=xlWLbCjomVT}3A9b8%^=oQnpiV?j^X zuJi@yUv%jLr63fHkxp)mlMeM+-t-}+R53-)8~7%rYEDka@9;K#c4fzKsSCWPQw=%& z{Vz0GTSPu2rNku}ELI6>jZ{q0%$Sl>#}lerY&vjFSr$29d3|~KbD5#s|l}5n_WhGGhfy}+h@e(^n z*CEblVvgU#&95vxUg0%CMsx!lmeQO3>L4c8VN-L{LG)}Xt&OR!`roumh#%f&mxJsn znli(3^oRhp=pU4-bPA?pHjWDZxj0{BKl1m&jT)p*aA$w`&o;t$9RUBG2*AF2Ddjs? z{2~4Mf9fP~1qOZJ0iHHoc`i+CT3Dhu5 zlpAciFwD*^c2+Wd6_%!ZJ3DVO*%LoLLUhW0g1X`xNf3XO@bwWy`r%dm*K}5pPUSKv(5% zCkuiWG?W!GBHb#EuuGEV^&0;1>7LIFUqyJwAxtW2EmCu78|S;2y0$1QT&;?iDNs|} z2ST~p?gML&&QMADXGXrj5eygQqV}h;U083r{+EXam7C3ln=$eQzGAM2eLVA|e2#uM zLk==gK`ozBl*sCuqFL58r+;qHaJ2vZbC8;?(WqeXz&Y<~#2zEn=4!Pl)#l-}j$+?Q z{9HIu^qLQ;ExI7nWN_>?E3r-Ibnjl#(k}CreJT>~qEDmNuij=M-<9J&FH9J> z*A9b)$t{z?aD(4i2DcKZj;bqfp7y)`_*q@W)O)8{;~Pc;-xZawCoBjBlo*R8I6sX2 znw5PIl+%rO=+(WU0mZy5))5&^hr%GIhXCe1k>aibW$Axv0j!|#J580PmMY!_b8u*l zh}}2{Z1Cl1O6+iXM{A8rLHf&p!Hp+?Yb$^gH8}mrjpvihL&}622)juOim=YrTdK!^ zve3W=Y4J*LGt4Uwz<|jS@Kudwu7U~y5$7d0m*~~@qWVaJdU#~yi@-UNS2JJ9)IG@X z%(P>1#qx%NsFlU1&NFhgx%D=lvGdVq7Ls6?J!yM^eZo!T!L9y*4AN}zQ85rqs0Wlx z-Z*S#;<}Qr=+;`lzPfa5t13TA(3!yBI3%qUDtoVJ#xs)Up6Vw-Arhh`inxW*BJ4ah zs52=FtP$hbw1ulBX`8X~3am^#EF0XZ`5Ou}&X8uYpT1F;-rgzN`R#q4JHRs@D(i4+ ze{(?gr$pRcN=WBHzx2Fjbs-GXTbfG^4SRB=XL_^*sxg72K?X<%NeuzqSsq7{iax!I!UkuE z7NrToG_NP79uyk;q#G9e*|JE5KyVI^4>myFv8E@}Ofh|D`c%UZ)b3IRRN0;BWL}K> zhd+3gsrD#!RvraE*k3{dmu3~v>SSEc`q@+OCRP)D9*@X^64CyZ&3pQI(u1Dc1Ju(I zaJM^tqWfW_pFZZb-VzTPjsK*F7Prgp`Awg&Z%(oT&SxC)zOl$8hJ*a)mfW9%<$TN5nUw3k*e1K|~*qyNc%Vxt8+?m*^yp8VlM^%UL{zQ78Q% zBl+MMR7YyF=BK&dKZq?njMQ#t8u>jm3rcRo1w=6x9)r@FYmr{ecRee(C)&h(isf^{ z)jyWMU1PeJksQ;)JPZzez{&9b#Ub|tu+CQ=%lO3aL*DDYadh|W(F+MTMQ8KLx~N9y zBCq=j>7DmgyBq-=mr`dioy1g+&r{XYpZsa7?g}1v8!<;3CWxE%nCtbBY1f|qc z>utokSEG4BY*{*!I3)K)plcGT#p6}s4+e%TGdPlVH^V{YCT(HP7ki7eF&*GtlkN%? zDq?ApKh@Xb$3!%TcY?9454lI}>QHC0s7L3P0Fo4T^&Udnk&)NR_`6zXfti&EaP2|< z(Lx1+fwCgl&wM?|u=8r*;Pi!G9onsr$J%2_)KOGBKn*F;seY}we5`C=_>RZSJ7NrMdiE9JfVlQS^xe=j`9$n@xS1g3fXa!q8^ z-sCk!0}Ps{%)Y6A9DPurJ)y1zJI##$cVy@!M5bYU;={ns_n~KLzWZ=;nqEr%)kDZe ztklHF@Bdg>`H5|P>vS?uW^y96(A+qtKKxap5+18fJBl`2AyIH zuk)gl_Wz>nEraTcns&hh2?V#`8r8oFN$-{+H0@ftL5pZd$FxCzw=}V7WH6&G6${E+$W62?uO-!6}rw$C8|Fa2!Naj z+{8QC6?csPP7K#klii?<;oUI{QqzK!%dV<~+3PtZGGDaola@V+6RLOX1*#nEIHN|x zTsaxTmb5>CXdLww$O@BjNHrH7UMSGoOkHTD_E`XdTbKtB3iHMFI&fm`6>!kG8-6+l zm_SMXty}=;!N#b`j#(W9#h1dVx;7-Wj2Et)nf|A-3_v%X=}w z&GI&Akl!|shj&dq`)f6x!2AU(xFtv0XLO-L1;t2bW?~s3(0Fbaz*sbP0*7-(ypa66|^$AFarLgd=xs2@qp#QyEJoit8Xl^c1LA;+2!+1{Ij4S zOuW$&6*y?VJGU>l5TJD(B=E<_>pD0K9bW=me4sYK#hE(msp!3s+MC86QkRw$j_&D4Z{mS>)jVUZ14bmHSSrMa2MU=QX98VC!^n0Bw1Ie}79XmQB3w zFvl)kK&{5N(|LaATT^Q{)q#{Jr4`#l;DV2wX-Q?ClqWZC^Z+9uQOkj1QDPrJa`tS1 z!Q=qS5G2l|RJaOx#Pn2+3HYH)uI}$A`rYv&Yp{#%>0MT)l0)CR=%E2+qNy?r0&#!? zMPHc87y#AxwKJ*Sihy{xn6?nW&ORACq%=yT@NnHKzgqEYQ)=^5b*AH;JSzAo5Ki60 zg4P8y`0(LD;ed91@bi^NCjF|69rRU>eD=I~yv6AHl5HR;-20j0u>M=x%7)&BZc%-* z4wt(gIcIHckCnB!4t*KrkBmba9XrEC#7Fue1sC8+pn$m`A!{!V(PwRu=0aPNHv1ls zgF|@qmM6IRZ1lTdubAR>X#ty5gUZWc8U?TkF6_~k+{&tedjr6#WvQsPAU_-MtqG7o zIV8Z>e19U6)Vg`CG2P*>!reLvd}u&Q?6?$VZR+8#5)H`j>b-IaxF3Pu4Q#9xNy^W* zr*M9hlXs|8%EhVD99nR*iUu3Bi~vj!%85>LzK3+a@!p?!Z%=0EPt|bk z$XBHj1?NWp&HU64fXjdeY*D#FYP5Z=xZhzzHI5S#+GY-c5i>o+IskXOv@&LZa+kKW zl4*yun)d)4#DO~7403Balc5?FrU5Fz3Lr4j8TjRpMHp?Nr}4>iq9v}ES%`?-zr4{V zr^PtjKmBzY*2lr1}8vFRezC)2VR-5T{cXS=Fh5-J7sOjMl(Q!062dip*rY z3BvJl>34<&r$&4B3M5^wWP9?I?8-VWq}*$K30c2!R+0+m%}oH|jXooZ&L*EW2xR_V zAXmeUaW57$3KY|^_B<2&gN@pg*&?0NmsRGygr(I#NhuTVVUt@N)G~OZ@hKoLk&E@s_Cl0~t*A0D7t4v|2b{-u z*KQ@VT~VtYaL_5j74XQ|^kWZ*u}sY@a~Dw`C2P=Xm0OH}WClFcXPs9?WpU*|R1`S{ zDUu8|^>+p>gy?o-c^4lYQ1}0Sf4bJlwS$`)r}Qx4y!IacNl(AHyZXU?l1q5TrLn$( z-U(O|wX+=ReAvuXnNZ>FEit9)yyHO#kR1i^s>h5|_8uwoTi$+nydo3$Ql8n;0-nZ6 zK{xeCg_FJ_adizRMUcN?**r3U&K(+*P?BjE+mRSQ1Wwe@4BTn}Y-jL)qhMP~OQ9@w zJMlEtJCf6<#86XE1`j$G9Wz%Kk7lt$itT!}Gi-6x+KLC?@)xo1jy_6$|MS(~>lu(} z09hcT0T;k{FF9<~kOq&f!J)uOxfjbD$*sGHQTQu}oh+Q6IiBD8+-mA}%{6)SS2UsA z!|Wd1Y7N)`D3?TjdnlOnF3xY6Q~lcjJ1sZ%;MgQsbq4y~0(p#|p@W(T-secVTDuFq z4FjZ=08%Jy=2S$N>@J?h(0j7a{J1o!1PY{$|328EArsfKmRuVlomq$_@Sp*;Ec&$X z8A4QL3{4iS30#0h{SE*bJTQZt2!PNc<47WQA+&&a8lRM7w&6wEn^c=$5+JeHE$8T{ zC8s@iQ&0p6Zt^nPeGsS*et*aed>O#*;6}3@eH6VoJ6jP^@%(L>6Vm^lXCul9DnW2> zlFPEs;{1Yplnyvr?`4`=4iNlf5>kMwI zr87Wx5PWWz{9eUa`u{{iZ@k^myDMtJZn4cyFHVnRp?bw&c8)Bf!!L~pXxf&BJt;0%>rB{fJ z?$73=qr?04XL2j)!y%7h&g4$zs0y=cPrm6+O?m=uq0_z?NJ@_f`+X$Tl5Zsd+{65- zF9OGPyC0cMax{stJ0JezJ`lQN8ds=D<weQ_wlkrKOgA+p`F%nc*UW zFu%nLF5Q}BUh1m@7-=lZ{^zt#51MQ{*q;lSIL$@;CH1)w=$rx^VP#(1cy{sMfqwJe zyNE=J*lHDu`3d_|=rkNFa{^vfs;wk2mw#k$M}IbUV$#G0;#>a_7uS8=kA4-QON|^h z%N(~2lKFxd#D3LKw+t@$7&4gjgrQ+7A(;c?!1FN_&=E~qI9A`83)3TIjf{+%oMi(m zcMcg<+qgVoU(UsDC>3mKR+s05$vX#-EuTF(vKA`*fR1k3X!VZK%{74$QAxn-`3U|U zAh{5tM1^t506fFjzh-EjAv^XH9Q;gloI@N<)=NdK%$F-{92Fz161KgcV;}@C&?+yw7c@&NX>dq&Vfo3D{}lq{&BGMpm64ERduu8r1B)Awe z3qY?4N=mGSQO-Fm^z%=F!Yfv4jg?RJ%LEY7Y#HkrUP1)V-HN?|b~^#=rvh zn_bRrM^dFe)qxrZVst(fn+e4fWq=920>D08A}9D0=x#Nkg0F~WrSEF0*dgmm=^ z?z;{MD=sZ1&e3W02yvxjnwK8Xf&d{*&320$IYKIu7?~L7_fc}Pn#2Ly( zX0(@H(pc+BqJ%{@85<~vP%%;bwY~)?o)+eE&C)V}4J0YI%cfc!E;VM+97YwPMBB$P zN;_$FH@gLB!U`LpMjQ>F&+8t5g@8UkUgKF`m$!i2KuJl-<;{)v)d+iI9{@%V4h|9# z5qWugr!N7`Der16W=dX7fc98FT$$cAa@fI4sVV@h?(981K597g0j&<-wFYqgKX*p_ zzw|kvY=P_lt*wEcF9rw{V*T<_~KKlvC|iUSVng5;gC99L>>Y1LZjdl$y_#vjRo~n3*4DnJZvIa*=(!cbMo^>%oCy__pS$ zeZD~0_s$F*W`F(o#`-;*fjbKbJLR_xcwZ6$D+2uT|Epz#o;S<;qa#n$8CY+1XQsa` zLyS@Td#^OHfcQ^!SW-XjmQ1g%5e$wc=o_c^`&eB! zUl4}meu}^+A zEcerZt}+B#`A^Npv(2|whrSv3IKU|ZhV+|xCo|2I1s~=fZ>hn$Yg@fH| zytgrzB^A3#iJo{DSVq4-z_7?lNT{b*e&&|}lC(Q-Rjy|n*2=0m9dn!>Lv_!;bQNf* z5z|17q_i-d$TEITLDDbCthiTc(rxfRuHk;!5XrZUL{AC#$ zl39jHY6Q??MXiPG#jm~yC**QO>c&{NjxF3p5#tdI)zJ*Z7*ikJUEIWu8fMap>9)4q zu3FB`)~T5mDw**$Y+>Kvp#`qJj!^QcZP$8FUyUxbrQ;+N<{MJ_Ul0jGWxIb5J7KU8 za_mYGfoSKQ;Z}y6@aoc6(_$FXmZS{FKo*1|4A{(_+jY^w&p15JY)bE0nB25FuyUcy zXV4J_K12$YbI({lfR}Yn;3oYXW>O_q9C)OSBnUNPID32YG{S~+Cu+(tJEv?3>R41< zGGfG(SwuK38`UeToTy=CSGNLXF(J`3YiMha+J|N_w<%vX8e>V>vlsX z3>bel=Isr(0qIpIrPe-bZ`_X<*r24D|Awltv`}9e6bokyTOeydU@2#fl>g1~dR!wX zj8)E|siBb6)0z+>GFMa$7j~JeRXMktur~nKaRBdfE6wS~ORv}R6G_nQb#gjMn$@Ef z5`=p~3vUuOatd0{W&crJC0kilH_fIFa)MOyPRC!=#2!Z9cL~?-OCR^^UYr~^`fd|E zv#7sy25DDgYrAgPYo76wX&zYa5nYYWcJJe>F#MYy19c#v5Q7bvx&M6?nN)T&|{bTMbi3TT)JpIR^)^wbx%Wb0!a zP(%UTJ$DX2vT?&lBK|E?*53H5S40@CGk@SIR{zwoB+<&7SXcuW3pR>%@2MRSV=vxm zf&>b+%V)s+c9P<`kL{eupF*HU=#zATm&cN+mSQ3F85zD{7N{Sts}c&SQcw99i{q^9 z(TeY6vUJ~#%szY!e4Y6}U$;H5l!nyauN~DBr&%dvP6^*od0(4aNS2wKf+``=SjOjH z+dRm|3Bjd<&6zsBHcuzOS`dCVH8B!F7Mxu96o4e@541qlYOo`ur$4*sBam~|-3{)p zqb_{Z?jla5Vu5u;Jvc-ZGlt)Fgw>J^(e3w(f>h)Vo znDUj;x+ss)+lbRz7u%+6k`-P_=>Lj2%5}4&cYHqQ@~p2bjj}7e`_xKqT*nRFzaK;Y z(ZclFvsxRltvtfJ82WqdRawn}_CLS88~62by1YD3q>^H9xfav?CFAO<2;P_bZ~K^R zU;bP>fH$%D4TVWh1WW`fd;hR=kxTNBnXgGZ?E>ufHW=F zVm*73wS+CYF$1u6)ML-uEw1Wxa0NNc)zDk-!(9m_ljSRAV5ZFxeT}HWHhZ~A>ayTxp+Z-wZ_Ngx!#^Xu)+(do_uUT zn*Z720t_Ee{_U1tY@1mVn?fOIedYAE^ktmoZ3~5*J;AYUeDd|#r9ZDX^BOGNbKo0sKD+w6o@UgvG^-P zt$mExm$-p{YsivlUgBDt0tEArN|u&Z%<#^lN`}DF{QVXhnEm}_(7l+=IY#pyc%!Vd{zNnzU1@3uHCYO|SZ z*ta7JUSV_L^%HGhL|P(78kGO{B2%K8@U&#dHufWLA`MkOfjG)emJCZ$3^yu1+1VXc zBR6?$cwoFQb(m=Bhu`)?-wbkftwCWuCgv7UJ>HO0^8-~kbcSmDFbdKH<6 z3QG2H;J?Lx5K+>${lm^4h(T^U>%x+3Jz+aB$C~oR33eZjjP7#kn=PADz~Y2O2j465 zcpZOBfk+{K`grB^-Dm&t&23&&K ziQ=_Pt>b)X@=YK>Y2O$y^1 z1^Q7u^{G5vSlLJf(!2hQV>@L=e~LQW(4kJmsVS%@YaL#7ih6P?g3Gwow3T^0;^{5$ zxSi#WI^EJqv@svmc6|G53I3wJ_jcpBY#GwzHE{Qad$jlU0BQfs0nZla<-9)Qs%m;Y zLu-5n$LXd?PV*6w_Y+8+de*eOf!B0~tg3{=oma#R|G(y_yD7b5%en$_m>K$WA(O{t z|Na1RYbAett$}yst5k_{Dn$s*f!tR!{LX*M-V0^_?2!MQm`@Hju%<>ZO|z^h$;&I* zO>6Zu3f%ivz<2H&t=;#no!Ox0TEt!3`Je+)rXRq^CRR#-TRoZ_#X~el~X~B10?1PvO-+}s$!;eFB zLzSJ!0AkMMI>mzW?cHj~$7WIPHT$;qKFc#yoo=xR2v@#>)pN{9`P@>N-Y`Jv?Xv7m zczauO`&X>~+(L17KV76PQDz1HKp`MkNZc!5N~yOgZQm;^?LOvdlDjuUIlm!ro1M|8 zdl-!Rqf#cf>4=;%^q);C2BF;=xkr%HkRwt?MK}MO*7t>&(z~gqCg=CA`Hi;RHGzlC zemX_~ga`1FR+`U-)Elduq?pTxWz5-;Qegix2*$&4I`CP9ICW@Tqq{4Q*6-I1^{`2b zkh1er^2=FkJf0eE0|Br5zh8C77XDaQlCpP(jN=A8fdR6a;;7ZPWX0dYOr%Dm_ST&V@ZJkR{!DOb+>zK8))+@3Ql)UCPZ!DbPee zl1Tdn41{v7?eTEbO^yJAh`!dW#Gzbu6pUk{n422YKUmkw*DdoV-ZA%dbOzVjEat{w zyD}TI*qh7}_G^4~lrE9~3yjya3;8j0y4&y8;hWs%}`v+q_q(}cc-ZMxE`)itq1sQ z8Q!JHDfItdW1P=dRogj4HYjp9@#!6nDb0ngJy@m;5@ACfPg6w`+}%oF;ivL?VgG@+ z( z#|T<)tjGbzR$`0Ku+xn(#N*aSiDNLWdG{4qA#-;5kUOaz&Blwa(WQntV0j;p)0wP| zpVK2qXv@cW-TN;tg>uQG&Li$>PbkXVJ>EwaTL+e|c-?GGM-#Z3TUU_JXla>KQUk|Z zrhNA~=PuY@%Po{;4ia|19oLahslb$OToWXj?06oV8J~8E=_=C^NU4c>QS89>B>WE- zAYhk!m_BC#7<5&y4h-ZsI^R&L!F=)Uuf3%dV4Oi6dKTqVLfiJQ7QwZx*1o|#=oVV0 z^IE!v7%coJKgP9Coo;SxPwen~iL2c8CMQGvx$E^KQr-2p|8}<3;XP{tOL&lwS#WCK zXjy-LWG*U;58dSPdDVdnoHUyDeo;!Bf4(Ep_i*7!CPbrDEhox{Snvvb7h{6PPL11Y zW3CS2s3AO6REcfCJ~)^AdeA{S$)*~AYqu!ToTVesPiFT&Hax!=?8@;f^JrH_Rab%bN9#Tk%{f2?K>qn1w_^TLmE{&`1n7_z}D8YS0t>o%BXZG_W9W< zmDG4qvmao$MB+TM?I!eqH1zzi^%gkSi-iqTpNXsRDiETsAaq{HW16d#e*#(JBvwyj z$wZXDUl9>xKV%b2qQ09%J#D#~%nMEmfyFs}RXyw3BUpc<$|Cs_7}b_iW~GaI*xXyd zgV1&->F`$Z%bc23*E7U-=)^Z-C|?1xKjLk4+X4Kzz}%M#RG;GG#JkGzSDkBQofx#8}d)we~J>BJB68)DJjyBZAN0 zQKp_sA@xsXu4)rw{yZ9KEKsvcN>MlL43n(ma9s*IU=$ctE*G^OLHju5&8;rX)#aLb z<%gF>qS!GM-K;A2urpuaEFMI?uqzIo@K43+{9;gGG z9|oxY#U`}9)7@1I@wllY2A2Cl_E)&pyFrkhXy}eYuEC>Zm@xH8I0DQz6{N13N>lgE z_a^1E@G=QiO8!Tihibi3K1byZhZ*xOtGzSlQX&+7F~-|}zv^qBcBK>&AJPes7 zgbnOUoNl?=1)|9CH#KC}z*KnnK5ighBI8U~>zgbwwS74Vh9!TYuffvWu2U=~rRisn zmH1WVm{})%^O@ttj!;%N_2)+~uLj6>N1>FRhb|_VYeev&ibrzeYaD@tvWiz{%vb`*X%=aA z3xeEW<^$e++tZS%;FOsF&(B{?t+pMKuz4|hWgUb$<{Y}TH}>n6Hjv=TaV!N3kGd30 zTkwRoMg%GROp4yd9lIEsC?;?jj$E3?)W}}w9}B$VgjIg)RPVb zYe9o`$#IA8%Th>2saj`;#uEZ<$ot9Z!s9Nc*WY%=(KU+L0~+Mhs!ybE zYPEx5*N0j_%TomNeiu*HeBCBAH}Cm&x2v+^n{WLIgA7u;6;Q1uDl;Ur5tIZ~yRX@< zI_s_+$CgXk8nw{vp=KFf&qR{>b`LnIjoEA@JjP>xbd#W_%^IWk5K4)i5HZAMct+u^ zq6#Ne=T5M3Ceyvt+$gX;bVHm{xTzjok&0#P2mW2GDe_N4#ssbL@N~Ii7;yvoJ_okm8>9uJ>P0brv4)FIbKxZZXURrYVwNxumL zwhvHUUB!`(Bgdb%c2g|8i{@qBAO?&m`!VC}T`yo2V!BLh%qCc74_LjbH)d8gdRDAe zywi2Ie%FQT!lWNY8aJs!LCAv>#e_ZhO9U|Hko>vyEW_d%Kt7f4&4HE(Arle z_0?A}&x)0^88Wj^r$DH(pTfu$TUm%p@UXRMcbinWK4RyN8q|q+mhtuA4Vf7zS26U= z`>v~pV@ySU^y+E^gE%6PDB~&+*2X7=!R53+-@HP!t8CQZRLF?Adnos6+2^#4$cU1L zt2bxW)$E(mZ}ZsfkxKNgY@K);eflt}4=pl*g-Qt%!PGf{HfQ2{5a#Z>svw|Ht%+!W zzVR#)N3|738rf}oKvV{ot2 zL8f;aNiT94rB^A8*8%!zTXi#BbGdv9Fjb$?#S4EMs(#Sd$E$3e!q9Q?o9yx4MfBR0 z%Ns@;J(0>ej>j=vyNH6_y|4EIj#Qy~9aM8Vs&$o(#~NX<#cR17-^y%p?q}X6q1hs| z0^m%uP!xqYx7Rmv@GNLTnk}#|g` zv~5${rao`3xNq^6)aJ&ge=UVWms@TS#priV0FR5WGPc?wcXvY7@Z`}6<<-n_P=6_2 z>4k11S_Um8kh2(Dz4`ibPP-3qnB0%*L&O!gk46e3FIEpHUVRg0a$}} z?d$0?B?Yx+&pYquq8g8GLo8jT}}1hfZIX)X&a~!i~LXaDIt9UVVE#^A_`bsa=q8AN)VPTJz+q?O3^8Iemj1 z)OTdYF~#+;CF?2Nc!C*EK@?}kmAA7mY^uUXfU>74y$fFZTRmp37LQP)<>?v!IZfga z30P*ep>7Hil$0>skHRXIucbgM$45tDq>J4dyR_UBRBC&)uJnBr0~4Sb zZ9EW-w!ex=wHY4uW3bP8{ob*$hWL8OU&#?%4gT8sweXO8t@@?xA_ampxvm8I-@GDQ zj)T;~#yc$Gk~5y+acY|7*!>#$cmq5E7C1s#d<1(nwOH``qwcVfk(m8>Xa7$}SG*K&Pv z!;Y9#B5nR(6lI2WY=;5g8txCJS^Dn|vE$_|KdNDJd^Rz?Fe1d|tj&gQAqA>H)p;84 zU^}`jtxR-7-9w1wprHXph;*&R=eLARn`nKg@4C-}U|C#BJ}NM^AY!0oak+- zMMS_|#M_GNbCa0fQ9!r*iF)P6km7vf5S{b3{B&CHN_nCQ%qiw+P3pXCEYH4~_9W%$d6p};*)u>8AGOCXs5)gwx6oUIbTnB?Vy~@;ZOxx#Y zPrUdbm~RU?OZ=H~edvA*_>~h>=|EGFidSw#=Kx@at0VkeA zIct~C(B4@%eUak>;1v92vsBm=kt7<@e6!PCLO4C?$X*!;$AGO3bS*S0jj8#J7H7J0 zqkXr;{{@Vmd7QQ7Y~pW@=v#i38)I+$8KVRK3P#l~uYt0X7AwcqEI*Ik_MX;ba_Zi% zWoweaOmEqfOQOUfFg+uqZQw8s-}`O?6HHcc5MhVxOYmkP#xlSA1av^Yx%$_NqeS|O zUqiiuU7raep4S_}KtN;Z2Tq~-)fnnn83Kk|oeTaetGR)xfSeu{+I&AUf!Av9dum-5 z-REPY1V4to>ph+|>tgZ>6Z4=bdo-C*Lk%Xex_ zOfb+8L9y?W^XeI5peG9i4Cly4vE=n4@wnuNF1LT0m;lf(0P3W|0YO_a;;V!QW5mE! zNOB~_FV10snxGt$ph99_74|#fGifxmDl4=pBaA65TqXx*E2L?gUI{h(7@>M=;KhST z?}^dMC-|@U>&X?rPFvy5V`3(CyQ$&6=Ehz1+bc89kR+6T0$qXb^MEtI zt;Xx1T;-F?3wUUdpYM4kfz&Dw$L!}&7-yz|OwZMKRFehq{vXV?3bSX@~uQg#0{^TN44^DlX3TDLu0UF`t1gs+|1AdwKtP?Rw6BRKbE2p0G`8U>wdk{W`? zi*`6y?Y!hH96#^tPQ`Q;1Q063%$s~oog^g+rTXlX?%N6moPi$)XE?@$GLYu{FX9t@ znvo@ZQ+uMhIzMzj@sih z+(Z;A7*01Z)B$~HFxzVv3~wIS+tJg3;K{TVMU4B>1KT3{4veNdqRDkklJGr%lloAl zhjK2{eByR|g}X^giAzn!kmy>N7FeV}661T?o0h7w3og=n_4=jz7k@hD=}9c(*E@_i zo$_B{6e*CPAi~G7l0nH}ER(oj9m$S1poZzKBOEA5ub1$(HW!&yqI9nXMGcw(L##F5 zm$7}Jx2NSJ+uO+S@FOF+$|$6uoE~G?9fya8bulF(V|9Lze#rf1ek11JF^C2}>=A_E z+I;u+p5BwriYY9%xw!+@<%=LPSP-Ukx$_1u0q)5X&M+J3M{#ts#of94H=^46GG=v&%+R5l5X334J$ShjQLCSZVT%6A!N$EkH|`IW3Bg za{MHhK7KmXb&TO#0yh-^EG|C0GfJb?z0UOXWy{3ui2$+7a=01Cz!rW5LxS-O$myM^ zBZqZK%l&&v;$#oQ=UK?m*#9eF9gURTGRKV+-F*@E6%`SF3gr{dEb88w343P>(Vs`8MpH; z+rA9_7BAD%8Z9dyTw7c1)BejKOprA1;Ot>0f!G3g3KV8ek@&&F@%WBt4c?8eadh$ z)VbJm^Y1p%U5XUrrEbu7q2{YuzJ714&63W65yy2Q#XV2Y*tQdny&s5t9A5W!R2s6B z?Q3rv!32M3n%%EL$X zr|kYYm1$7KvFMi$xkM5a=!&3>_b_{>j8<#;^JqI~*~y5EN$SY5NqNPT<+U2#Tpjtsv@*1%TVa@iSV|y}rDlUMKoiLDJbhL3F|+4oo&l0`g=TMNqrjRK zzI9alyD>(}3lx+~+fc0Y0Tt|a8{bUdb286gXwsEpt~%(Gh8**M4Z0ULkMW+GdZu%c zi(&VjL3Ba>xNZN)|KfKqDj58iX~C2|pGEC@fjbz&GCtrl3h0aN$q&^<7rQmAjYLAC zIO(Ult?bp^9n#hjb)|3LSh~@leN>3DPqlRKOW$yv;gwKnqlZM<%I4ssgvlPz6NjiP zl`?o}4_zAQbuPUZcL)WLU5rLbm|n5-1#5cL6t6^_pR&KJj_5?q$ss>tv|pAnZy(iM z^2Gnl@%y#DjwE$I18|`1^7#c646>kx9z&-mv3!c8f%L8<>rs{bx)MR?49lbZ&;A~# zXfQ*g2F#n=bF-hLn4#S)GpX>qWJ3*J#>X@+mJzucxf63In|;0AE67e+y+zeY)))NU zdf4n4xQ}Lf^SIcH_@1Xu{52f>bI)keTEp6o`~;~mO5qBBBx6(3<@FRV$9&vf@KM8t z{>!u&qGD0!3{^WN{aV>~346xeG;{f686sP|I<9K*n zo`K(%=9SZRl^A76y_Y)ndmT-3YN{y;fN+O$;;w)g*xcoRhSd{+iw0|B(#d*yDxND8 z^epQ!Mx|0>9wNk<_Y&~}%$g2Jz3M(RdTf=bu&XWtnZoq(zt{XVNd#PD@U6|ka&)1} zJpj;EwnUlc-T&5x5d;oo49-J-lqf67R&2tQ*-`eA1c9qU(FV0ALl`ASCA zsAjiU7cvKgp=1Y&gD3aZ;Vhh+>=IN&xZ*}q&u<=xova> zuD!k9VbE!hQKkPyaz)Cv)?J7-+;mx_qJctL0@B zqz_H2=w$-IO4u$gLKE3&u^|VRuRsAgwOHsD1W2{VBru~l)X4gnuTSe7`(KwiZ zS%F>{tGP9~Dii+=t{6BUpxW;1A#myxP?GJ=71V^HVIl67ekjymfc$tm1D1SX=h z=3Y+6AYGOj9(UXAI*Ic8l~)_JUz|*5gHB>0!=h=2@AqhEep1Y-$YP(1Oq*cXFyH~v zG6jSOO7Cb@N|;ik-9{I1>=tmObN8pPIUUav;wT;i7VKCY8V9yD?dOO}bnmTFkvWMOh2(q%XRlEsQNXo^W=eZ29LLMRsmHUD`Rmpy^&esE4YcbcG5p+}XygdBsZ3gJt#59Qkhf z6-Hb-3hfcu-}-k^m)=ahna8=mucA!uPE7Fbu8XDH^Sr*b?Sc+>Le~~^xQU~Y3uD5P zp;5JFA!dh5jqTcMSNe1SJ_q50xeaXm6TT*>`$jQ$V^?#Ds|;a1p*vhthBw}BNN<6_ zW?`|-+cOL;=COE>8s!{%O0a7svrv*z)Fgg2vMxd_PQzQ=Y?o66z(wBb4SUZ>@#r@; z3yWjI(kPbrcfEb6-#i|z`$~JQx%oyWD-P~IZv3&TQ`zaWnRN(Nq%8l&z*J06ZFzZ; zEkacCMUE&D;v1)dB*VH_m`;2qPL?^Ph}7(I8acw*v6do@c8#6i@9sE?p(9lVCj>%i zpNx4mVz!xsdvwXrys?+{6#6o>A!8a4^dBm4l!O~gNs+fbi5nqJj7!8E^Zv2Vrj$um zqze5!Oas5AH)ABU44T>-?y0nq02)}FMarRvq1cZFNH#~M?uG$3$WD=LIASplOuVU+ zsqsoS;IJ5O`_RX*x}Og0&qm!BjyQdEn3`cIHa=E$*|LSz3k4Ba4+(uTN-QKtN@I>) z+e83cp_~ARFH)QlMoGAYikP2!#Bueo+EtV$2r1N3`DP~MW2+GVgW&n5ZexAb9x8Fa zB=tSS!S}X`zbY6aBp89rFl6!Xkd-kKx@CANr0L%{G5w9PkHS{@>2}-_b5m1}zzK%m z#+0_T+j%_C#u7d!P@u;4g>jWXV~or(!cj+$qYS7SP^*&CX;R=hP0(yrXt2)K2f}XC zKYNPYiRj*u`pQ+R5~0T@^e528plwSLY0%Nd`Rr*feri{Ac=f-NBTuu%Jy(bmCNl(E zzeMw`kfceR0Ld$ocxNAI1d*b$+W3$Rp(I~Z$<%1)6X1+c$=p5uK=ul=D`CfE0wlzuS!ZrUJ0ZA!NX$0@9J&dX(+9|02@d(PN=sZzT~h|u z(?uSYO+t@$4V*syc}yQW6uz5hHk;98J!~w~61=6&#bf}V2w3_+=3TfBC%_|1rxwm$ zi20S{JmvgX4MQVlRqa+@%U)m11@e!6-$#V7ZZBa%EoD4}8tAEZ;N04vfA++t~9IlsP{gmM4_L?Pc6s zU?w<8ODgM_K4^!gw#Nu0^?%-- zOrM*F89&q)bP~L}_Ic;4f=MG`NJ7UVG6$zZVM> z>V6=SaOpuAODv65VNhip60wKup%BGe}5%3KwZSE=eZk(u^Cj$tPiIlXuB#r>>Zo z|Jfr4O@cx014d+Fhk)mv{d@PISR<_8^zOJg5jB$b5xq22S-BTTMdZ2;TouO?$R!pH z?M=H~FW=qJ!peEE9AC(XIdS65TE;6$dr7NFL_2jqg8TVzv!zPBbEr}@iRvIDQ4XOk zSz(pJfxxzPchFwUJxxuSChd~LX*=+5Q$$V{fSbou71v)BUfV-b?oS ze4aS~ay5g4A2wM!f!K#WNI^9#+=!Ad#UKs|`9Vl__Yy603Jn*_c-e-{DKdw|pnm{; zZ~N!;LrjjKM1^D;Z#Mp~wXsmr#$R?b3!HHO@ZNB*`z7&xbjHohFM@ zKajXj9-$JL4T8Q;!+XjJ2Cu?UOQslKLo?nqJjEvN4FmnE-9&gTWO2BJI&$f~H^j=Y zxljuD3I8GYc>vj#^E75r6rfZMqiX7j$;mx>j>5DTsmD*j>ExqG1NG0;Gdqbg}p%+UOz)y}(@HomLiezm+3KIdQGwtXj@A-5 zlhVL%V$cYiKiznB`u4i=YiIt~i@`5+N-(vqKLJ1eh(G~IkWf+-K}!q3VSi9a37~90 zvVf*#G3^6Wex3vOt&SqW(`F!{`RH7-WINJMD&*=r(1CFPYcl6~;FX8biMF+kaLHH7&kI7C*LmQ(IhY3X-|1oT)tOBk=6Ovu) zQ)Xl2xq}iRWy$RHm3Hyf0 z!2r+msAFj?zXr1K$Su`QocEKZSHVm$d9W*wXO*uwHXK6$hloMGcp7QqL&AO$PDLWU zdR(P81w9QCbv#jWT!MIS{M^NpdS+&LIONmg2e#(BXNWajxkq}ZufLR$*!ushGG|h} zIS1$74s|2iMp(}UJ$(4zX^)vR)jO=PQsUVcm%!-nTAG~J&M_NXwotB5Nlq`q|B^X8 zIEECzS{-ujI%F2>^uVcZmM7h zV7A(`ww|StVGV3p*j=*5L$0|KHeL`x-&eG};sNx$nF8~vKjxF1NNWT^ZH?zq zPxC$H<8y#nD~gxzav^OSkZTHbl8+!QaaTrT!u0zMCwe2qS;`0oEn~ zUOq0VV1W58r`6C}=Z^+@NYRKZ2H&e0rHq8yY-X9s9s-~SLc_ZM4=fxw$k@$ys;_oQ z3_$NGL#zPy=x*6^k(SN+Tk7kFEH|h(Zy;^hc`jfVuubO^TB_Q$c*ZZ5l61vC&$Vn3 z_2to@n*cBrTRL)@k(veN;S_Cdj~iY4C%Fy4VepwX(+Vv^X@%O)EagA3(*O+D7!Zfa6mvQ5$O=5J0+zQ29WNKk#3OgPyy*qDd`3Y>5y)a z?(UXu*n{tXcdy;A`)Rr6gW$|F=Xp-u_b=}A67Bkab#m~{rYG#m?kF@?u`1w9Y*%#UE{&Mp- zcN)({sDDN2clWn)p*8+rZ8_Ok@h?ZewF!BzuS}Bgos{y`3kkNdwnSn(a_@u9R$iOq zx^7~k&f$Xm>of0Mv9!Q$K(a?H=5fb;@kqYqt3JxljEollN$l*_QyB}S8P5T{;XVt* z;y^oi{6@UCZu+*PlAOEODVX>%x1Su|q=BZZXKZ4nQ7-LHE3v>lluotyO>&c;@ABH< z+>(v$@9+zr});#S~n zaSQ$B+B|Li1o97nFSb?J`hKD1E8fZtFifi(z8WRS+mv+kxoIHzGSEG(dGTd=YBYvuT#L2VjX6*|E;;UCreNX5z zC-0#ZAsJ9f#4RBP-lIt8v1s&n>YY#Cot?ME!W~bBdqTV*K}MeM@P*+yWZ2NsL1q|8 ztJymsPwD$2j@nm`fQ2b4kk%-2#(UtUL>DQYzv0pnQ)jTLEZ`Uj5e^wQ{12X|3>agP zz{yyokaUvQmi1ZTYKd?|{f(-^HvEs6pxSTt5z9{B%oPUC_i_lh?_wYuR&v02N!=bXhklxhN686e%@Q?=FisTE=Ir1Z1r zgbL1ChdBng#>@zC!$?REE?1X& znp>7${Ha9qA@_y*_)HJ(nLGy~yRc6V9PR7hFDJwmI1o7i(S|v|ey}3E^M-*^rO>WW zHJ@4c_J=SOqPM>pFJICk5(LX^0SxZ-$n2Q8zw42yf{ z&xBs6b~pco@Fk&r5@!jj{+3CN+5}ex`lAy{wMFA=K2CJ7EtCBQv?wu@VF^psjtq`e z2tR0q%6Z@p@k`Mx=ub6WZxo1fHD!%XYGtK9b&sg*aO0xX>lJJ|`>W7g79b_jYu8Ym z<=N-rGCjwHx5iM)i&M6tojS9T^1fq#J$gd%}} z_4_Vp``bqo(lvd`v~kkjhw3)CA8;TooiM)_`)3J^mSuifDQ_^Q(QhEr?)JWttB{+h zUncJFtLNg}5T6psQn>eNxfTZnFUtCPtIfZ2qNJXvE|)GNNJg*CAF-zWv1_UpZ(L@Z zGoxq>I+)+y7Z>5MS7^DAMJc&f(Wo55Exj?Vxt++0@*! za?{wm?(h3G@IN8UKra5iP!mm=ll)5{hxslJ+h6cxss52*%eOCc5o2u@<{Tc!LFncz zcUaoo#u9)_XWv)V$Ys?_oQ)~^S^4{|-nw!nuejmfQxUb|@=sRDcS?xCT=pWt<75rg z{Ee&=sQM=BRbSaG7sh+1Rn$^GDiO4Mc1BITRF=Jeg+b%NLKT^xGmC*VAPAoOkx*D{ zh4I{A@Q@Jexaw#7f!N8ky1AL(PlF*pmn>L-7=2`liUYmXr6Hp^MaC<=eNc&_^22jq z8Mi*OZve5PYu(jiltCXg!l7Vcw@m%1>NF&yIZo6r=Y3% zC|O=CEtC3avGfe+-_e0GA6~AjF-wUaI9Zl_ba)<0FV1p3=4qtNi8lAjDJS+F8gAvG ziJc=%13;pkTPQ_~>-&>Y%Ik72J9XjRnZIx?KXUDxT!zc*B(;80gQ3V(Q&V-i;v&g|}r7M?KQe|?%@Aje!q;lW73T8w)=7M`j=~3X|Gn6 z(ua22Ntx5Do@qJ$LrwqZ&9g#V%B=7GBVLOdEeR6C! zNV8aL)9P0SdvWv!*%N8VR^2^X8rde*w@)x8rG>1OdW+l!s5Iw*N;v4!wPp zxk@Os7-ypXJh@tT%Jl}=Qc{!{KF*mi0yo!E;lL9gVBxZywNOv;y#E3B8lU(VUlu5* zUpMKYksHgTRiIs`Ugi)<&LUUTi)lh9s)*c?i$VuUOMCUoD5dT5=l2_XG?{5L4c>fw zZbyppl!L|uK@oaEFR`LNchtdw3_y{-Qd^9Me=H@Z={1KCZQNGh!+HeRYA+>9KHrz1 z^4aw1*n2M%Px(y)5<8=t9I{q4r(T!s`keaxFg9%k6-t-*jwmDt-qCWkjN9wNW(H9oyQFdw0H0twYsw9UodUCyoxk@p{0 zhqT>GA|N=XtFhP8B(L~USPh6yEN3J|871P{xgAwV7l7zQ}aJ11XEZlfjbTAZrsv>d$iR%=i~8Xgac>c;ihr;?EH`)eTr z-*hhmc&%!hhe0dQ#>8KatVOfDf6os-QwW8tQ;SL%W@~x%9wG#6VEU64SPs9kI5|{L z^1cds=;yWB%-2hr_rCwK$lLG6kLKf>lZ_ql!Q}`A5nJku?tbs*ud(c-y;JIAXM6_ ztu-mYJ?9_RAg_K>39_&lF+jX+?@djDD77^|h3&KIA86|%B%fFU(2OITBr zY>+9H{tTQVvv4r@4yFcf`|#j&hVRLpj*>u1F!l+zrPK|)RSY(E1VRCmtQ2|r8%Kx7 z3?F!-{h>O8qM;(cv#+&euKoh7<045%=Z~~7d0Gzsip2+|$^vhXYc9ckVZWEQz9o$TPWM=g~ z4qsL@ifgaYj%!fq6BZjE!=-`y{C?>7N%Iz!Z%;Qi0M8yhuY~~esZcFqnIGYII}X_F zR{+?k+hG+X}q{_i4(!0x$k-Nb+=ANPmubNJHw+G?9^|W=U~OUSGCR?8pd8 zpk^@J%D6AJCB(lH6UIkIVwR}`CA&$j znrT=%rT!1I)(A`CFN~{1BsmYqm?z5;+9m)LgnLUKjQ0p%6#w@d6&-CMML?7e8b zPe@qO%@CQQ${G90A?+f;hLs=4VqH81yStgP*d9xPIH=$g5SUq7Vh4AG3*EaoIXTtU ze;ok|EJ-R?uR0N|2@T~x6TK|5QMKSO-(?atrV2;TA$LnL=Qhhi*~Y9 znSeVsnRj!WpYwV+U(cO;+v!ql9)T8F9%LK&N0FptXb_QSQd2+Z#j}_)9W~9?&!)Mx z;~Vp|ksv9#V(M|d?Vm8gpp?H3z^?6GPq!6uou2u!bxG-LRcQ=QWYaDbE^ zb4d`SpZRxXz$jF4x<;^tY2k@b;sPeS(0CJt9o_1&xW9i{5jL|WQ)X1is%Np6rQVQ! ztU1B4D;Z4X%Zh;iqkJ&cIk%o~SpFSl)LM9gR5n3M1i zeB6-|kZO7iHQO1L7!e#6()B3Sc0_5%ouNN36Pla9`Lmh}v)KJLjWs71^@8Un(4@5X zBCR^bOYbnEs}BN4kF_fLukgvU^tBq%G>bWo+uiebzlFM4l~?85g|4SOVKT!b9rpT& z5@vy??s6<{8`B4UYGW-+tV9lJ^*=7xa5kmfS(xbKRdnNjsnf8qMC0K|R#ZUQ>8PTE zFYDehqUw^ao<&ARF2y$e_G2D$O)5PZ`#Es%ls?Hwqt#7xg)#2Prq)K*V`}Z6Q~!mq z#7VbW9}*G^v8xa;U9c8iG<&n~9v^Ij^r!@un#~-MX9umM704!_lXO@`S$FI!Pqoo5 zpY&M&gIPV4*1_)OPhjNp);%@3eu>5~=BHN>%0>amT|VSv2a00D2`g1D4%GGQ53<;pN63bP)J=aG01sXoKK?Jkz5M$}mNiQK;o@QAvv}g{d`cZ1kYE8$vyyT%--!onFeO9D(86*QhH@D?EbBK0+>`ptlyr$RVRsE$uqbzP?dE z?)$r&_RZT~w6{+(Geai3+#1q*d9Xz#pfSSl8L%tq#ghwPGT>AyyWubqc0QJGcp;ph zK^JQ#X|#PHDou+5f(hQ~jFBib?InH@H3icU&;l~wmp+e0J08m+A^qFeo{?dr|2NHq zX$k*(B);+-|4pQ4>Hp6X8jqjL_*W?cTuSsYF!}#-AG#a4b82w*u+E5;-x_+BNFglNNgru0A%4 z6hRJ3E1;|`#}A>l>hh`>=tN(eFrE3H#K;BtLm*vW(_&$9<8%NIX)!JRm0i`texC40 zzWUQge22HI8`tKIox@FyEofp&v7XJmV@~}dokrg!m`AsEcS7gUjSp7;64bsD&u2M$82usj)T}}$y8JX zP#ygUbcI_uhrKy z!u&LyrSDG@Oiww7R|J8Sbeb4Nwq^KHvNPVIlRNwlR4;wA^skuCGb&`fpP>wOrjH}! z(PF<-LytYfDD!LetC0AO7qgZbC_D7zUsL}HCF63CTC(37gpw59tRB?oxPenLhR6R_ zw4&v_74Z2=^p#{%plu_B`FFs-B1+Gw#A&s)nY7tjLovIe^~NSYbyz?^0kE%Rz1cuo z6CK$MM%mYVwoZb8Xn};?f?BJUgi6^*Pp639&zw3z4o9{z@yvYN=W0}PNI@^64g_C= z!Z=_5-xaRp3Q~A%S3pfd1fOE9YG%z!;5U13O6bm4uYK?H_ru+09Cg_pO_~S0Hww0> zsCLM|wk2)=BaThel`$)R$ok4h)=O|63CUXr+VMtE!>sk{F??m0guxbpX$1nYtMzE} zM<3Po2DM_bXk>wXwt6lqK0f~V9@sDR9!LAVxBCU@*jVEx`YlD&Uj`o^wKlrbJe=89 zRc5&%Z9|F_cPop+!LP@c2Ic05+Vd&D-Z09t$mFUyIZe(diXVdW?86z~7;S1a4yl@T z?&S67H8vLSEA^A}9hFV!t7sl!y9KEJ#S21^P8DkES*GMgrg=vB`NHC@v#_0)pT+Y- zkEZ62l8KxaaV;NTlYeU)UR)&gTD`yb`quUyiuCpKJ|d*$u>|2qNeO9b?K%fKOmqwk zP>1&IZ6_#>YdkO^70)aq4NW5Qc?$||LK4go-v3e5SH{Id)HBDhL3Ck!tar#dZpz4( zQSGzp&_zKzxf1ZQtnvk3y3Q{4o%wpZcKW$e#L(|pN!hFUW48TA6a!%d) zl+gcuL`F{%yh--SD*h+9f1k=@r4qx&qiKzyBa%(zW)J(<#$LrZ{HIT!PDej^^5pT| z!YWEiN~74Y3D=P&DID<48b$4wpxhY-1_rFw&QHK~xfKx`k28`O{YJIAAA zxMB6D4E8hz_)SOR3^(ZmlyZiV$jY$5tl;Gr?!tm4vF9V}rc-(+ubS!#zM$4Nj?Kv* z&X(uYNiH?SPih~|@^39c!~8>4>o0_}HeTTpC0g{>J-AYQ zV-?hw<)gaoAWTm2Iwt!j*#lTkLmdb?hOH zaGp+wmNJCJLLk+rkCqCtu1*p-*&3!0wzXA`%2c5wSCY|*{p~7c*7UPYWnxSjUFCFO zw>!JjGxwxS`dc-~g0_+l*{8im-?x_s)MVw{FCEmy?D!= zqpne2#bBpuW?wZp#YJi0fd2D`sJcK8t4_@$BgPZD#o(D13J(hNZ&X)mUC1i+h~)XM zXn4dTe?YBzh*C1Yyr%!k%2tg>YQUb=^T2=)$4DIH$5qRUx-wv}D5Xqe?>x)2nxHBZ z;U=xZ!c1fFo72sknIBVDGuV)*B(;v~P8tYsvDX<5C=0bh7Iew7f$DJIj7x-Vyh0B< zYFNtqoeSg+IfCzB2tM4}b3xxyQ6YA84BHA5*kFm)kL#;>>QriR7c{c7OH=L{L+`(B z^dXe=LC{ZFMF)MHv?_dpR=;;Wu<%a<|aro4z5mU(ATM)@sY z`wxcAgYIzH{mB5-;jGn@ythYYkd0b&zZ|lH0#=R?{ZY5o-gtXum?9G`F5`z#eJh(g zo2KnrLHyzh5yq{98t;wOv^u^6zK+lJo+W>YhFBzr*r)}x-tKO$PtzgY${@&p8$tq0 z2O{3Ab&8PZ?rpqhrZF^o@Z3FR|AIJe{?^A-L1N>i&kiNtF#X`!3&`X0v@#WI?>r-T zzg@_3gLM6^%_cFjc&JBa$5L$@N=6#Qsk@1j#pHTsV#KidW98ZJC2%qj#5TWv_5R3H zXH)C?3#^yn1B34Ol*rBrNG2SeE#O6H86SZA?R4EeyS+Y-F3fG{i1*x0ZPY1o6PR7IqidLp( z-(0qo911?8X7wqv@&stuOe2zL)yHL-L(-vRf8E~vNgbL82c^Ea&RPjel=QFSr56`M-J7}9!bCZKr8ejl z*3-x1yeU5`gn8Sod=FGY3*0T(yfgPaD7z5tGFkBEViHf8?D%X|pW4ZTpJ4r$g=8g! zg*i?&Hfr9Qro5WBAcmpkEg_fYetXhx0k8O-UecCMPXX8!qKVO)vJ)DHLWqA|buX(f z(#!DM&?_|*m_EdX7G2Zveh+t1t2{oat11`9=VhNwiOyLGYQjEI*sJP;}vmn@1V$OV*5>Mnau{5y!)B_uP@z; zMrn%XqN**Qa3ec55gUw5qy)#=xUIA~mzIAXR~ww4{&nUt&gWNjL-CvAbHlSE(Xe26 zWJB^_zrlfZ83XzXw}#akby}{rhU2os))g^4C{THZZ;GT1kA4UNMVS*g;IW1;U!?ziY>_~33JH~h4| z$-u93A+^O>xB2hxjNjJav(cwuP~mi8CN)6#k+b#SDKHbwcM1>&@wTA~Xf9&4q&5Zl zCD=S+AM7~Pi=2!mKa}V@Dxi_k1xHKn-rv<8JcYpYR`9;=sS&W9?CG;&<$+$2c!^Z++hmi?0)Sn3zAh`)ZmZPjMYcgf=x`jFcwxg^vuUUlo zZNZKgaLGQgK*Y>?yirI0nF8!kt5z9#=hD@bn6^RuAE515VT91IZ#lnkh(pmDmIuZc zgehs1zq{63t^F~dR4SV=te8>Z3gl#f4I=+S`$(HBCn)qD?@d#Py#rP7s0vI{(PBk< zgvNKq>m~k(vDog|Fz1>b82@o?`nIm;r51Q%Gq!*AXN%v^ct`QQei^x1krXy$y|G5k zRGe_rN@xIm>S1J`8Yy=duCrK{K3Y{*$lIAE!R!PNMFh`2(x-;U%`Y+_fQLE!1KLqW z{F-T=&|I-;sVd(Mrj2IN(V6z1e$u8bMgEX8dl^G#+v|7z6<2j=FNe#~=jwJ`XD(E5 zu~oRY_6hhWF53b<=Ub&J;#K=oU|DB3??C%(F0eW8_p=vL-^ZC+T;Leoy-PTbz$5c= zStSqT>Jv+PkUDQ0h;3DW8j%-jf-LCzbzC;Qp zZYyG70TdHlSKGDoi#N8Q9K=_$ds{Et?4*|wit;1ry&^A@OO}AhM{0;ck74ZDQ zf;qK%CAwWY&P?nW|M_08E0hg>|n&O!PD`12;+=Lu#v75 zZVUUVpvT2d`n3gNU#KghnU*uNc~N8g`F#CJZ|);nx)O| zTK`%FYaxA`eh^uiN9fVvMSR2Ay*=m`gl`>S<2wkuX%RPA?_4Cs0y902pMrtA2@Dmm zX1x~gfq?#r+KunJa5VGEgxDgTi3VUirWdg}lV7UQ+&aDCUy-l)7R-Akaj4LGp*UMt zmA=?m|7{=Y#P72$9i|;D$u1&e#j|F|fQLkhjwrfb^wyF(r99Rio<3f$Hx$GYnsRgM zRqxk>f5@hN^s;YppPdcd@{n4*iW8JxL05XLg)YtKj&W+LjUNHRmppJB=jyJ9RGRh! z>YLZs){7CuxP7XFuCA+C>2VuMDJtIvvh0hFzR6=bGq`i7PEB^4zk1dfa+wj;zjACj zLGS4S!#gIImUv9hUU-TyUzCX*HmG*2PZRRNm&`?#zP-@<%Q4>)gXR2<6yt-#aet3l1qV;7vID`1-cX$h8$5KgX zQMCSFM*d#ARfZ&r)IHDfxP~`0)@ZeJ&Ntd%gzM{=CHyp#2_D(R%PuWU-Ml>Appg;kJ^P?)P3+{VYBdnPMaW)$wr&xU`&<%w z>L^7Dp5DLK1(DW~idBA+dbkr;(B3lo<2_=WZ4X-x&-p&-d)u=4h z&(OB4A0X*xk;LF!*2nL~WF@458BSsIgUiC*y}Ic<^}b%o)?j4OwX7Fdv&)nq%y|j2 zYW$A-uY-3_Q)a3UFYn*)F;b%2F7MIV$ZIt?FwQ@XU2uD-W!qCx{|;W+Qj!sP#Ux)v zsS@e@+dtnglf~cY&sw3y_~#>lz%(aiu2v#ltgI4NcZgCTzjKBxIs~45dCgS1pR@`qDjd#mta4e@unFB6!y^UBcJlfY4v7xQ_|3gAGrxD$QHdaKS*M$pWS?WrhtKoUON~1 zE1rgio$v}f4$u4cpaq(S`f=oAr4Tf6j0#DRDkx*#yll_((}&@jjH6Ta!!WDbOx^=; zRMy&L+1vqR_lLWS^`E93gxod@{5A^>dAjj$H!&6>ncsQ}2k9kC;S)?>FCNh8e=~}V zq^d=ZOo#n*d8GXerYbTy{6Paf!0=(lFFnsn~mm9*=m_6bVK$qn!Y z@?ocT1(Igzffl)qK^e^>#W68|5`HHG^Kk0t6g4@Z8QxcYu+EQf zDy5lQjn+)}8IvN5LF^ZK%d?aS0sC9?ywWMl?CdlLceK1wfA`VzMhx|6)(zgr@Hr?6 z#|JEM?ZmQqGdl4@nkM_-k{A$MTD&4Mv4=n06zAvU2N{IB+UsySXWjqQ!43@IPAn{> zkFlza%6yEk&*?FTl6u9sJ~~S-XsZqI?qJNuh({2kr-yF~6bu{`Qye$sTUr^3ZgH*s za8|?AS1QREGpv}UxIdHe$(AxM_R#Q*!y0ceO)kXXymon+d|PQlxY6Mv9n?QBi02+* zFgBxIGD?GRii+kXW)?+}$=?p5hp7jgL!CaB$g)ir`}qTue7#JSqrgqqXqY#4N6LpY zRcw{+?@FXInPk+qI2JNcD5aA`JF*c!W?|(OR|IkKUR9!yT_3g;ZtytXQ;Eu1M)c!z zO3uTd>Q={v&oLWETLGv zXnT8|$wSCRe*kT%&Tt{)Je;brrEr^Wrx?Q{6SKYIkNhykBtiMis6hrhaL+1?{{3rF zZAL5}@{ZyzWhFJLPfaVC4FYXR<_%9|D8;{anA5xjNu1w9wZj8NKnDJGf}*_uQN~K4 z$MtiIYOWanyVPP2=QU@yVdH7jlX`s*7^ydn&_17YI_xZaK})1SPRy28u1n=i59>%v zNx5!x_s*|xpa$x&K9_P)RV_Cs@lE^S!h+>NX1)T8&5QSqL)+UfYop$z5Apb)NKYoV z8U)m)m?X_V`iVQS99Nk;gxrNygA zdknNY4swDbpP*z@E1K=S;{C#sfh0shs?>yH|BKtsPB=TUdRF=CQbK@JVYb#Z8pdkI z=JiKtp>VzS!BirBK)_o*KDlI`qft4bo*{fRe^5VSAXQ*?+u?1BCZ5gh^5ECcPraJI zJvdiXhzNc5#=~XS#%D!e`)R}Z$~B>T4d1C&2;{`%$NDu2e4jrL4;#~D@SoMbh8{O< z@T|xLH%*wy%I}Uc@_zSBF~dfmP&|1a9NN!mq_g1lrnkxx=50>CV8|Seu{LjHHK}Lu zhuLd?rTt{%*EkM*u4VXh$IeKJ*He@FmAYMcYamu>@-VTnS4K{D(VR=Ma;>=L19$|<%8v6fStJ}}cb?TU49 zYbfQvQ?%zsw8Cwlty!j;vBF(h(1_Rw=i6j!X^W-K?kJ9N$%Fh>{ETxy49 zm{w@knSYmj!XmyN((QkQ?ux0e{1IOXp|kgvtz9(s3O(}!lR44~0xVWJdz`p4!_fA6 zJ9luo_?9CWF;df^(>M`YHnVP#!P zS(YoE#KV33**UxZdqbbn=%v-LJIQZQk zhrV+sUdED{sAhAEdma*4ezl3A3T5njeu~eLo+s!Hs0h^~Zdy$6bp|&l3$C{}LJWV6 z;CIzBO?mWSS~A&9Vh6vuVm;0sRj1u)KE=OyBGs46(gb`a@qMxvehe5>vH?q{>}WHBJVIOlK*Z+fNB zqLe@T@HRZa>Ap$H5utyruV-ZccHZNhhmFm4y*IWmp2eAm7%&S5hlkF!+Az+FX1 zJ0G6Zdnew`_)Iem9^SLfxV(gYLbp{q_5SQ>u|DN@dDsdz+P4|YRw2ZMt2&jg*r&*$ zE1XeC+A){D?bce7 z*&yt|yZx}B!ths4)Zwb0Jqt;w|f*ZyRUG+ zc_i(m-_P*D0AtE_)Ll?{qV7<`P{?{loRk{K^+=p5<^&rbQgr=-SS`YHl0$@P@4$ zw>}l+$pjo{#RX-oVWyx$bp}!n?c7(d$x&`y>gJ;#{H)tUdYbtlAt|MkWK9XOU%0wb z?nree%Z;{A2$Hz*18IYzv5_K(Vq!sehU+X($ke8*{?K?xvT-ZHh+~v3eb^K|4zIP3 z&fxi*eZ9}H*#wHS5&D1owysIxPR+~9D_wjPu9mWR>mYvB?{9K)@h9O!B9M#K1QDrJU_)=-6Z9-3coeyuoqun2RtQHOU~e{XLb z^i(csh_?fde5TGm^6$!CnT}RNBr7eI*zI9y$pXP?VSTg4^(ha@!+!PRAc|gR2mu^X zrU2neU}*&!xIuqKvI^w@%YL{%^%qRbT6vG58Ye$TVCVKHh~L@MsH zR_7me(|ar5LuNW!X_WoXO#>+GwA(K+d?JK@$v>6*vvuS$cb_q`LfLTn=6q>)RC97G z=_HGVjQ!z9QSKRQ~bagd+;rJCfNWa#t1-^Whxva~ZlQDdZ%nYQ{TN2Rs$^j(KmL9?c zVDBYWPse^O%*e^CQ4T#*k(0MjQ@-b5qVMVNo~XETXfod(We;`IeXseKxsO|5SlvA^ zV6ghs(RprC9n&!Ea5pMkTm5?n39No=ABmn@E_}yBip8DveQ?+B%9pobwmv3^h-qob zDcOQN%8qV?|5y@NshbtYSP6J3AdTKRm71~#VaHy!A znxYob>Bi=Dc`#nR;4Qm44VZwpiz8hmr8Dd!c1+)dLIp5WR($wd>z;)U|DDQMKq`LZ z7&50S7ix~ziO1uWiGHBsW{H(CC4`!WO-!$b(0qbVF^y#piZ?F%JGtQG-n~9C5>;5& z2cUzZ_9=ixT`n*)&Er13{`O!nd9h~;?!2s&*#&eZ?!Ch`LMTP%xwsef!u$4*`0Z})@QNAeKyvo)0vae|<*0oDPwv|AJVm0w;8>qnTfM2%lv{Y_ z{etU#W3@oq%l-Ie$PgZDY!YHb3Uv=$uc5UrOm@|h?k!9SVX zUzq8XJ#QjTV9QRtjr}@G3OW58K!g)@(DwD_~O2xZ5_C7E`koPr!D#8ed9j<)= zn!+`@TqdSK0z2NF$-TE7RkMsZ28cHii9>uTTLH4eG5$>}Ht+R?5n|K84M4bYe_E@jTd>ya!M`SK`XILtO#) z0_U?Tnpgu>f9(UMr`dAPKO8&o`ekb{REJ3a_40sm&kE3R=f7){w{RM0;yy+o%+%A) z^Ayf}Jo@tE_v4x;UG>l-IVG_wF94_js52mMJt;PWeoIa}+K(bhvh1{?Cv>zLR>t1cp zkh^a}$ZEa{rYk%Su2DZ*>k+WX5>^{xOq5<}ct1cnpNhBtP$ze7sG-aI#Zd4o^8(2-`8-)_bq|D88V!?@VqL)A%DdT%)vi1Ea!r+cJlnWgmgeyD&bU<_Yb z-M&A_%9{gtqwRPc|N7~YWuqCdYRPcb^~pC!H4R&~($`GNFbN;F$HO86zTDr0zismV zVI<{>(leDfpinAD>qh+rIq%oUKDe+$Hd3W4!d1Xi$lCe@oZqj;f+=e~rn+rJR0B9X zjc&fC(!#^*B?~^>-cryhWtgJ?S4Ed87ufW}D?8P~^!nj0=8cRz|ciiR|9mRTY|X}SXhl#&%o*cz+co~WqV-TaZL#B?6iRF%Y)N)U5?ki z7w(URY%CU=Hm{ce0)gc$z^bcn?onw8P@o+^6cRgu#lxtyT^@8VfEmWr-4hX;Ca}1h zuFDVoI6Gm*++muj4na@42t{2z@yO}5c*Xmmi?X&$|8R1^5U@DohSZ_HgR%+|e&lzx z2!5o)%7?|EIp1@DxWJBsly}Y?Pn4W|#Z^heF;??R;qgzF6~WN*KuQ#{a?w@A8MPID^UQ5MB{x=RQ!xT0zD{nvJq# zR#2{QXB@2L025muhp*mud)t+ewM`6({8ax$=-;|vE0HS8Y@fO7V=cYQUvwJCvMl1(oDgU zt#o3_t0q>}WVuev6gmkV+a_5NDrwFB%cPU$ij2Eb7t{u-PS$o<&*nz<82d{}}?k21HdDkP7LPVsG z6dzH%Qqw(?djUg6Xu;A~*vdHjTMzzK0uPBCnx}9io*oL|sL#IDiz*O%DtYV2o9o78 zS)Z3zCuJ#CLscwfxC&Fctt+Oi?(YcU^dq}gk@sHVFnA|507k1BkR}i2S8*yRT5@xr zf}Q}-wAi+#u^h*K?cB&!0}ni^F|$`Hzla@43Yxjrl3)^2jaW;zHD86&hrcFfd@P6p z!la^eHs6l2o>iWg1v?;z;Ky{m;pF0>-duwitboXnr24pd$}Bu?9Vcu2K#P&40q89b z8@$L|vf~s8u3`YZ4G5L47q|c!0uMvbW0H@>If%@5w#4KGu3m=gtx&499LEiNM$ENxuDjR@R55+!T=5Eb|%k>ZB7RP&vqXZ2%5vu~^7G@BVw|dnSWVP1%QO zTxmCd=L?VNaAOUdKxaG)X61!13|6p867$5&L0B}!1%zC6*%hAWkUCSQ3eFR5_F{CE zmuvI|1I0kk1|XKB-4;`D(lXnUWsYKq%V+$JBbP6#M8V^aN`OADPXMlc+&|l*&AaYWMW{A|_q z@N;T_>JLD0)jUd?>QhaTNjwQE&P1mHaW&J}0f-zD3+(BYc<_v+8LJnPcq%8^&qKR4q2d2ifsp*FCa?wDF#M zQF{3-^I^Z=kEQuR;i`YJ=``46vvYvF8<0E&(Ts#wF|8v-9a0s5`B|O~1A`3=!^Xju zQmt#|s`Z;TNvLu{n} zN0ANE>i*vpSx&wdwWh4EeXhl_(YOg1;chv1)F?;|ot;T(cT%J#5`xA-b-ceocA@meluu8*;mF#K1>S*1F;FBjaz&+9ksjB=Hme-wm4)RU0I z|GomQOLld#=HoPG;ER=*+10?5tGY-aJI$fv?)U?v0Of;}(&Ry=<73vl`aHRmPxYPy z4zjU}1o4@Aaj}{Sm%|^K)0qHpQ1{O@b%bBvvz_(0eIL-t=2vH4-n zl_iJ}ctBl2-kl;2H3#6D`AjXVUipeWYE*x7;LP#u^oBMi(3wD_oiV=o4};TNAQ}Bw z9I%Vjp;yCo_>cgjN4j-1rfb!|$iZaxkm%9gzso7h0yAnHr#FxN{qfm?DGU|j z8xtLOy_m*ud6Ija;e!6}U20)u>jUv|&>MQl>j^684Lp#XL0;!P-VG4D^E|!>q^{2& z)wU3b@7G5i83eNY-|^)CfB0`%{l7{WB>Xk@n}b%I(cYeq&1XF@9{3)cn3xFsL#e6O ztoS1%BZ^8&(b3T+{Rx;2WsrtX?))U=iu0t8pI(tQHm2?i zwo{jukdTm-Rh?I-Vxgv_%*x6FdI4Vq4&5i2cLHtTe)1!0R!$Bz6_wwNx&U~ixp@IQBlY8t{~Z3~+y0L| z;>d3E^Y)&6d-35M86&21GYpk=b$$7|t>*eIzwCS9Dk!cFq$EoQiq*~V+A&G7yGKXo z74VLXIQx6kxj+U49 Date: Wed, 3 Jun 2020 22:54:14 -0700 Subject: [PATCH 010/243] list manager sample --- sample-apps/list-manager/template-vpcrds.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sample-apps/list-manager/template-vpcrds.yml b/sample-apps/list-manager/template-vpcrds.yml index a60a3fcf..07b3ecc8 100644 --- a/sample-apps/list-manager/template-vpcrds.yml +++ b/sample-apps/list-manager/template-vpcrds.yml @@ -87,22 +87,6 @@ Resources: Properties: SubnetId: !Ref privateSubnetB RouteTableId: !Ref privateRouteTable - s3Endpoint: - Type: AWS::EC2::VPCEndpoint - Properties: - PolicyDocument: - Version: 2012-10-17 - Statement: - - Effect: Allow - Principal: "*" - Action: - - "s3:*" - Resource: - - "*" - RouteTableIds: - - !Ref privateRouteTable - ServiceName: !Sub com.amazonaws.${AWS::Region}.s3 - VpcId: !Ref privateVPC dynamoDBEndpoint: Type: AWS::EC2::VPCEndpoint Properties: From 16fd1e0c93f57b973fd40bcfc33cb0b9bcea8f67 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Thu, 4 Jun 2020 06:18:41 +0000 Subject: [PATCH 011/243] list manager sample app --- doc_source/applications-tutorial.md | 4 +- doc_source/best-practices.md | 18 +-- doc_source/build-pipeline.md | 2 +- doc_source/configuration-console.md | 2 +- doc_source/csharp-tracing.md | 4 +- doc_source/deploying-lambda-apps.md | 2 +- doc_source/golang-tracing.md | 4 +- doc_source/index.md | 3 +- doc_source/java-package.md | 2 +- doc_source/java-tracing.md | 8 +- doc_source/kinesis-tutorial-spec.md | 2 +- doc_source/lambda-releases.md | 2 +- doc_source/lambda-rolling-deployments.md | 2 +- doc_source/lambda-samples.md | 3 +- doc_source/nodejs-tracing.md | 8 +- doc_source/python-tracing.md | 8 +- doc_source/ruby-tracing.md | 8 +- doc_source/samples-blank.md | 4 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/samples-listmanager.md | 121 ++++++++++++++++++ doc_source/services-apigateway-template.md | 2 +- doc_source/services-cloudformation.md | 2 +- doc_source/services-xray.md | 4 +- .../with-kinesis-example-use-app-spec.md | 4 +- doc_source/with-s3-example-use-app-spec.md | 2 +- ...th-scheduledevents-example-use-app-spec.md | 2 +- doc_source/with-sqs-example-use-app-spec.md | 2 +- 27 files changed, 177 insertions(+), 54 deletions(-) create mode 100644 doc_source/samples-listmanager.md diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 61903688..625ee030 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -140,7 +140,7 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa ReadCapacityUnits: 1 WriteCapacityUnits: 1 helloFromLambdaFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: ./ Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler @@ -229,7 +229,7 @@ Next, update the function code to use the table\. The following code uses the Dy ``` ... helloFromLambdaFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: ./ Handler: src/handlers/index.handler diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index bb9d9513..73462434 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -1,14 +1,14 @@ -# Best Practices for Working with AWS Lambda Functions +# Best practices for working with AWS Lambda functions The following are recommended best practices for using AWS Lambda: **Topics** -+ [Function Code](#function-code) -+ [Function Configuration](#function-configuration) -+ [Alarming and Metrics](#alarming-metrics) -+ [Stream Event Invokes](#stream-events) ++ [Function code](#function-code) ++ [Function configuration](#function-configuration) ++ [Metrics and alarms](#alarming-metrics) ++ [Working with streams](#stream-events) -## Function Code +## Function code + **Separate the Lambda handler from your core logic\.** This allows you to make a more unit\-testable function\. In Node\.js this may look like: ``` @@ -34,7 +34,7 @@ The following are recommended best practices for using AWS Lambda: + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution context](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function concurrent execution limit to `0` immediately to throttle all invocations to the function, while you update the code\. -## Function Configuration +## Function configuration + **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: ``` @@ -50,11 +50,11 @@ The following are recommended best practices for using AWS Lambda: + In the case of **CreateFunction**, AWS Lambda will fail the function creation process\. + In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\. -## Alarming and Metrics +## Metrics and alarms + **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function execution time in order to address any bottlenecks or latencies attributable to your function code\. + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) -## Stream Event Invokes +## Working with streams + **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. [BatchSize](API_CreateEventSourceMapping.md#SSS-CreateEventSourceMapping-request-BatchSize) controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. diff --git a/doc_source/build-pipeline.md b/doc_source/build-pipeline.md index 832a1304..f7954782 100644 --- a/doc_source/build-pipeline.md +++ b/doc_source/build-pipeline.md @@ -131,7 +131,7 @@ Transform: AWS::Serverless-2016-10-31 Description: Outputs the time Resources: TimeFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs10.x diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 0cae09bd..a8e0e8cc 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -55,4 +55,4 @@ For example, to update a function's memory setting with the AWS CLI, use the `up $ aws lambda update-function-configuration --function-name my-function --memory-size 256 ``` -For function configuration best practices, see [Function Configuration](best-practices.md#function-configuration)\. \ No newline at end of file +For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. \ No newline at end of file diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index d41b0693..6f0802bf 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -105,7 +105,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -119,7 +119,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index b4cf0b26..3bc7c59b 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -13,4 +13,4 @@ The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI] + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) + [Common Lambda application types and use cases](applications-usecases.md) -+ [Best Practices for Working with AWS Lambda Functions](best-practices.md) \ No newline at end of file ++ [Best practices for working with AWS Lambda functions](best-practices.md) \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 69234fc1..b52361b8 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -81,7 +81,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -95,7 +95,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... diff --git a/doc_source/index.md b/doc_source/index.md index ec968ad6..afb21524 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -60,7 +60,7 @@ Amazon's trademarks and trade dress may not be used in + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) + [Common Lambda application types and use cases](applications-usecases.md) - + [Best Practices for Working with AWS Lambda Functions](best-practices.md) + + [Best practices for working with AWS Lambda functions](best-practices.md) + [Using AWS Lambda with other services](lambda-services.md) + [Using AWS Lambda with Alexa](services-alexa.md) + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) @@ -119,6 +119,7 @@ Amazon's trademarks and trade dress may not be used in + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) + + [List manager sample application for AWS Lambda](samples-listmanager.md) + [Building Lambda functions with Node.js](lambda-nodejs.md) + [AWS Lambda function handler in Node.js](nodejs-handler.md) + [AWS Lambda deployment package in Node.js](nodejs-package.md) diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 7a53e52f..e62b752c 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -264,7 +264,7 @@ Transform: 'AWS::Serverless-2016-10-31' Description: An AWS Lambda application that calls the Lambda API. Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: build/distributions/java-basic.zip Handler: example.Handler diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 50ba1327..d2aaf53f 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -88,7 +88,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -102,7 +102,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... @@ -119,7 +119,7 @@ The following example shows an `AWS::Serverless::LayerVersion` resource that sto ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: build/distributions/blank-java.zip Tracing: Active @@ -127,7 +127,7 @@ Resources: - !Ref libs ... libs: - Type: AWS::Serverless::LayerVersion + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) Properties: LayerName: blank-java-lib Description: Dependencies for the blank-java sample app. diff --git a/doc_source/kinesis-tutorial-spec.md b/doc_source/kinesis-tutorial-spec.md index 517aa765..7c16045e 100644 --- a/doc_source/kinesis-tutorial-spec.md +++ b/doc_source/kinesis-tutorial-spec.md @@ -11,7 +11,7 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: ProcessDynamoDBStream: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: handler Runtime: runtime diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 7b083dfe..316a10cf 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,7 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | -| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For details, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index 170ea8b6..4375f047 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -28,7 +28,7 @@ Description: A sample SAM template for deploying Lambda functions. Resources: # Details about the myDateTimeFunction Lambda function myDateTimeFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: myDateTimeFunction.handler Runtime: nodejs12.x diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 68e0ddd1..9b97a54e 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -59,4 +59,5 @@ To deploy a sample application, follow the instructions in its README file\. To **Topics** + [Blank function sample application for AWS Lambda](samples-blank.md) -+ [Error processor sample application for AWS Lambda](samples-errorprocessor.md) \ No newline at end of file ++ [Error processor sample application for AWS Lambda](samples-errorprocessor.md) ++ [List manager sample application for AWS Lambda](samples-listmanager.md) \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 9680316b..686fd8dc 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -109,7 +109,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -123,7 +123,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... @@ -140,7 +140,7 @@ The following example shows an `AWS::Serverless::LayerVersion` resource that sto ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: function/. Tracing: Active @@ -148,7 +148,7 @@ Resources: - !Ref libs ... libs: - Type: AWS::Serverless::LayerVersion + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 88060aea..e5c673f0 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -100,7 +100,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -114,7 +114,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... @@ -131,7 +131,7 @@ The following example shows an `AWS::Serverless::LayerVersion` resource that sto ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: function/. Tracing: Active @@ -139,7 +139,7 @@ Resources: - !Ref libs ... libs: - Type: AWS::Serverless::LayerVersion + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) Properties: LayerName: blank-python-lib Description: Dependencies for the blank-python sample app. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 2488dea9..a01f75eb 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -102,7 +102,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -116,7 +116,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... @@ -133,7 +133,7 @@ The following example shows an `AWS::Serverless::LayerVersion` resource that sto ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: CodeUri: function/. Tracing: Active @@ -141,7 +141,7 @@ Resources: - !Ref libs ... libs: - Type: AWS::Serverless::LayerVersion + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) Properties: LayerName: blank-ruby-lib Description: Dependencies for the blank-ruby sample app. diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 615ae7a4..79a3107a 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -205,7 +205,7 @@ You can install libraries locally and include them in the deployment package tha ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x @@ -221,7 +221,7 @@ Resources: Layers: - !Ref libs libs: - Type: AWS::Serverless::LayerVersion + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 5d5c6e5e..20830f04 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -8,7 +8,7 @@ Function code is available in the following files: + Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) to download, configure, and deploy it in your account\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor)\. **Topics** + [Architecture and event structure](#sample-errorprocessor-architecture) @@ -76,7 +76,7 @@ The processor function gets the request ID from the CloudWatch Logs event, and u ## AWS CloudFormation template and additional resources -The application is implemented in two Node\.js modules and deployed with an AWS CloudFormation template and supporting shell scripts\. The template creates the processor function, the random error function, and the following supporting resources\. +The application is implemented in two Node\.js modules and deployed with an AWS CloudFormation template and shell scripts\. The template creates the processor function, the random error function, and the following supporting resources\. + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Primer function – An additional function that invokes the random error function to create a log group\. + Custom resource – An AWS CloudFormation custom resource that invokes the primer function during deployment to ensure that the log group exists\. @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the template [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md new file mode 100644 index 00000000..f13a60a6 --- /dev/null +++ b/doc_source/samples-listmanager.md @@ -0,0 +1,121 @@ +# List manager sample application for AWS Lambda + +The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png) + +Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. + +In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) + +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager)\. + +**Topics** ++ [Architecture and event structure](#samples-listmanager-architecture) ++ [Instrumentation with AWS X\-Ray](#samples-listmanager-instrumentation) ++ [AWS CloudFormation templates and additional resources](#samples-listmanager-template) + +## Architecture and event structure + +The sample application uses the following AWS services: ++ Kinesis – Receives events from clients and stores them temporarily for processing\. ++ AWS Lambda – Reads from the Kinesis stream and sends events to the function's handler code\. ++ DynamoDB – Stores lists generated by the application\. ++ Amazon RDS – Stores a copy of processed records in a relational database\. ++ AWS Secrets Manager – Stores the database password\. ++ Amazon VPC – Provides a private local network for communication between the function and database\. + +**Pricing** +Standard charges apply for each service\. + +The application processes JSON documents from clients that contain information necessary to update a list\. It supports two types of list: tally and ranking\. A tally contains values that are added to the current value for key if it exists\. Each entry processed for a user increases the value of a key in the specified table\. + +The following example shows a document that increases the `xp` \(experience points\) value for a user's `stats` list\. + +**Example record – Tally type** + +``` +{ + "title": "stats", + "user": "bill", + "type": "tally", + "entries": { + "xp": 83 + } +} +``` + +A *ranking* contains a list of entries where the value is the order in which they are ranked\. A ranking can be updated with different values that overwrite the current value, instead of incrementing it\. The following example shows a ranking of favorite movies: + +**Example record – Ranking type** + +``` +{ + "title": "favorite movies", + "user": "mike", + "type": "rank", + "entries": { + "blade runner": 1, + "the empire strikes back": 2, + "alien": 3 + } +} +``` + +A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. + +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** + +``` +{ + "Records": [ + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "0", + "sequenceNumber": "49598630142999655949899443842509554952738656579378741250", + "data": "eyJ0aXRsZSI6ICJmYXZvcml0ZSBtb3ZpZXMiLCAidXNlciI6ICJyZGx5c2N0IiwgInR5cGUiOiAicmFuayIsICJlbnRyaWVzIjogeyJibGFkZSBydW5uZXIiOiAyLCAidGhlIGVtcGlyZSBzdHJpa2VzIGJhY2siOiAzLCAiYWxpZW4iOiAxfX0=", + "approximateArrivalTimestamp": 1570667770.615 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000000:49598630142999655949899443842509554952738656579378741250", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/list-manager-processorRole-7FYXMPLH7IUS", + "awsRegion": "us-east-2", + "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/list-manager-stream-87B3XMPLF1AZ" + }, + ... +``` + +When it's decoded, the data contains a record\. The function uses the record to update the user's list and an aggregate list that stores accumulated values across all users\. It also stores a copy of the event in the application's database\. + +## Instrumentation with AWS X\-Ray + +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the function communicating with two DynamoDB tables and a MySQL database\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) + +The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) + +The function uses the AWS SDK for JavaScript in Node\.js to read and write to two tables for each record\. The primary table stores the current state of each combination of list name and user\. The aggregate table stores lists that combine data from multiple users\. + +## AWS CloudFormation templates and additional resources + +The application is implemented in Node\.js modules and deployed with an AWS CloudFormation template and shell scripts\. The application template creates two functions, a Kinesis stream, DynamoDB tables and the following supporting resources\. + +**Application resources** ++ Execution role – An IAM role that grants the functions permission to access other AWS services\. ++ Lambda event source mapping – Reads records from the data stream and invokes the function\. + +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. + +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. + +**Infrastructure resources** ++ VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. ++ Database – An Amazon RDS database instance and a subnet group that connects it to the VPC\. \ No newline at end of file diff --git a/doc_source/services-apigateway-template.md b/doc_source/services-apigateway-template.md index e1218922..a7fffa3b 100644 --- a/doc_source/services-apigateway-template.md +++ b/doc_source/services-apigateway-template.md @@ -9,7 +9,7 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: LambdaFunctionOverHttps: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 3f030830..6ff099f0 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -62,7 +62,7 @@ The following example function invokes a second function\. If the call succeeds, Transform: 'AWS::Serverless-2016-10-31' Resources: primer: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index d1085314..3030c03f 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -91,7 +91,7 @@ To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudF ``` Resources: function: - Type: AWS::Lambda::Function + Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: TracingConfig: Mode: Active @@ -105,7 +105,7 @@ For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` ``` Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Tracing: Active ... diff --git a/doc_source/with-kinesis-example-use-app-spec.md b/doc_source/with-kinesis-example-use-app-spec.md index 28b3e4b8..1118ec5e 100644 --- a/doc_source/with-kinesis-example-use-app-spec.md +++ b/doc_source/with-kinesis-example-use-app-spec.md @@ -11,7 +11,7 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: LambdaFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x @@ -49,7 +49,7 @@ Transform: AWS::Serverless-2016-10-31 Description: A function that processes data from a Kinesis stream. Resources: function: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x diff --git a/doc_source/with-s3-example-use-app-spec.md b/doc_source/with-s3-example-use-app-spec.md index 156cac9b..84dc7760 100644 --- a/doc_source/with-s3-example-use-app-spec.md +++ b/doc_source/with-s3-example-use-app-spec.md @@ -11,7 +11,7 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: CreateThumbnail: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: handler Runtime: runtime diff --git a/doc_source/with-scheduledevents-example-use-app-spec.md b/doc_source/with-scheduledevents-example-use-app-spec.md index 045efa89..5b7a9ce0 100644 --- a/doc_source/with-scheduledevents-example-use-app-spec.md +++ b/doc_source/with-scheduledevents-example-use-app-spec.md @@ -14,7 +14,7 @@ Parameters: Type: String Resources: CheckWebsitePeriodically: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: LambdaFunctionOverHttps.handler Runtime: runtime diff --git a/doc_source/with-sqs-example-use-app-spec.md b/doc_source/with-sqs-example-use-app-spec.md index f187c610..1749c182 100644 --- a/doc_source/with-sqs-example-use-app-spec.md +++ b/doc_source/with-sqs-example-use-app-spec.md @@ -12,7 +12,7 @@ Transform: AWS::Serverless-2016-10-31 Description: Example of processing messages on an SQS queue with Lambda Resources: MySQSQueueFunction: - Type: AWS::Serverless::Function + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: Handler: index.handler Runtime: nodejs12.x From 4dba535262365c23c21962a04bdd07c6b7a548bd Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Thu, 4 Jun 2020 15:51:20 -0700 Subject: [PATCH 012/243] list manager sample --- sample-apps/list-manager/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample-apps/list-manager/README.md b/sample-apps/list-manager/README.md index fee53bb2..53c8aef3 100644 --- a/sample-apps/list-manager/README.md +++ b/sample-apps/list-manager/README.md @@ -35,6 +35,8 @@ A list of fields to increment. For example: - Expenses - Amounts spent on gasoline, meals out, and so on. - Character state - Stats such as health, experience points, and steps walked. +Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [List manager sample application for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/samples-listmanager.html) in the developer guide. + # Requirements To deploy the sample application, you need the following tools: From 870cac866e6ba1f0534e89482bd63d8c39423e8b Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 8 Jun 2020 18:05:00 +0000 Subject: [PATCH 013/243] Required URI parameters --- doc_source/API_AddLayerVersionPermission.md | 8 +++++--- doc_source/API_AddPermission.md | 5 +++-- doc_source/API_CreateAlias.md | 5 +++-- doc_source/API_DeleteAlias.md | 8 +++++--- doc_source/API_DeleteEventSourceMapping.md | 5 +++-- doc_source/API_DeleteFunction.md | 5 +++-- doc_source/API_DeleteFunctionConcurrency.md | 5 +++-- doc_source/API_DeleteFunctionEventInvokeConfig.md | 5 +++-- doc_source/API_DeleteLayerVersion.md | 8 +++++--- doc_source/API_DeleteProvisionedConcurrencyConfig.md | 8 +++++--- doc_source/API_GetAlias.md | 8 +++++--- doc_source/API_GetEventSourceMapping.md | 5 +++-- doc_source/API_GetFunction.md | 5 +++-- doc_source/API_GetFunctionConcurrency.md | 5 +++-- doc_source/API_GetFunctionConfiguration.md | 5 +++-- doc_source/API_GetFunctionEventInvokeConfig.md | 5 +++-- doc_source/API_GetLayerVersion.md | 8 +++++--- doc_source/API_GetLayerVersionByArn.md | 5 +++-- doc_source/API_GetLayerVersionPolicy.md | 8 +++++--- doc_source/API_GetPolicy.md | 5 +++-- doc_source/API_GetProvisionedConcurrencyConfig.md | 8 +++++--- doc_source/API_Invoke.md | 5 +++-- doc_source/API_InvokeAsync.md | 8 +++++--- doc_source/API_ListAliases.md | 5 +++-- doc_source/API_ListEventSourceMappings.md | 2 +- doc_source/API_ListFunctionEventInvokeConfigs.md | 5 +++-- doc_source/API_ListFunctions.md | 2 +- doc_source/API_ListLayerVersions.md | 5 +++-- doc_source/API_ListLayers.md | 2 +- doc_source/API_ListProvisionedConcurrencyConfigs.md | 5 +++-- doc_source/API_ListTags.md | 5 +++-- doc_source/API_ListVersionsByFunction.md | 5 +++-- doc_source/API_PublishLayerVersion.md | 5 +++-- doc_source/API_PublishVersion.md | 5 +++-- doc_source/API_PutFunctionConcurrency.md | 5 +++-- doc_source/API_PutFunctionEventInvokeConfig.md | 5 +++-- doc_source/API_PutProvisionedConcurrencyConfig.md | 8 +++++--- doc_source/API_RemoveLayerVersionPermission.md | 11 +++++++---- doc_source/API_RemovePermission.md | 8 +++++--- doc_source/API_TagResource.md | 5 +++-- doc_source/API_UntagResource.md | 8 +++++--- doc_source/API_UpdateAlias.md | 8 +++++--- doc_source/API_UpdateEventSourceMapping.md | 5 +++-- doc_source/API_UpdateFunctionCode.md | 5 +++-- doc_source/API_UpdateFunctionConfiguration.md | 5 +++-- doc_source/API_UpdateFunctionEventInvokeConfig.md | 5 +++-- 46 files changed, 162 insertions(+), 104 deletions(-) diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index 7c4c2bf9..53f38b1b 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -20,18 +20,20 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** -The version number\. +The version number\. +Required: Yes ## Request Body diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index b041fdbc..703a50e5 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -25,7 +25,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_AddPermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -36,7 +36,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_AddPermission_RequestSyntax) ** Specify a version or alias to add permissions to a published version of the function\. diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index daad8f65..31bbf7cf 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -24,7 +24,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_CreateAlias_RequestSyntax) ** The name of the Lambda function\. @@ -35,7 +35,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index 1170a96e..f114deeb 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -10,7 +10,7 @@ DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** The name of the Lambda function\. @@ -21,12 +21,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Name](#API_DeleteAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 5c0913cd..b6be76d0 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -12,10 +12,11 @@ DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. +The identifier of the event source mapping\. +Required: Yes ## Request Body diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index 2bba33d3..96f3b3f4 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** The name of the Lambda function or version\. @@ -23,7 +23,8 @@ The name of the Lambda function or version\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** Specify a version to delete\. You can't delete a version that's referenced by an alias\. diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 66a16851..9cd0fd8f 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -10,7 +10,7 @@ DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. @@ -21,7 +21,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 8f9510ed..95012343 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -12,7 +12,7 @@ DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifie ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -23,7 +23,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 184a3ee5..3ae903a4 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -10,15 +10,17 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** -The version number\. +The version number\. +Required: Yes ## Request Body diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index 37cf75d6..f108599a 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -10,7 +10,7 @@ DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qual ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. @@ -21,12 +21,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` +Pattern: `(|[a-zA-Z0-9$_-]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index cea3b081..5a7e9ec9 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -10,7 +10,7 @@ GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetAlias_RequestSyntax) ** The name of the Lambda function\. @@ -21,12 +21,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Name](#API_GetAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index 15164e1b..ea3fe46c 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -10,10 +10,11 @@ GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. +The identifier of the event source mapping\. +Required: Yes ## Request Body diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index e9314123..cf290a8c 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -10,7 +10,7 @@ GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetFunction_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -21,7 +21,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_GetFunction_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index c163edd6..b870817f 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -10,7 +10,7 @@ GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. @@ -21,7 +21,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 7257435d..f5fe70bd 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1. ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -23,7 +23,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index 01668807..a25069cf 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -12,7 +12,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -23,7 +23,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 428ced78..faf71be3 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -10,15 +10,17 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** -The version number\. +The version number\. +Required: Yes ## Request Body diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 660be980..04fb2bde 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -10,12 +10,13 @@ GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** The ARN of the layer version\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` +Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` +Required: Yes ## Request Body diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index f52ecff3..0d46a690 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -10,15 +10,17 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** -The version number\. +The version number\. +Required: Yes ## Request Body diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 3eae77f5..84c6477d 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -10,7 +10,7 @@ GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetPolicy_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -21,7 +21,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_GetPolicy_RequestSyntax) ** Specify a version or alias to get the policy for that resource\. diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 414a431d..daac78b9 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -10,7 +10,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. @@ -21,12 +21,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` +Pattern: `(|[a-zA-Z0-9$_-]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 15cb019c..713e1009 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -27,7 +27,7 @@ Payload ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [ClientContext](#API_Invoke_RequestSyntax) ** Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. @@ -41,7 +41,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [InvocationType](#API_Invoke_RequestSyntax) ** Choose from the following options\. diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index 112f8448..f7246f81 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -17,7 +17,7 @@ InvokeArgs ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** The name of the Lambda function\. @@ -28,14 +28,16 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body The request accepts the following binary data\. ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** -The JSON that you want to provide to your Lambda function as input\. +The JSON that you want to provide to your Lambda function as input\. +Required: Yes ## Response Syntax diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index bda44fc8..d0f9e136 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -10,7 +10,7 @@ GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&M ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_ListAliases_RequestSyntax) ** The name of the Lambda function\. @@ -21,7 +21,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** Specify a function version to only list aliases that invoke that version\. diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index fe3a08ec..f39688fc 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -10,7 +10,7 @@ GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionNam ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 07beda58..76176cbb 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -12,7 +12,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&Ma ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The name of the Lambda function\. @@ -23,7 +23,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index 7c048ede..4e495812 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterR ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** Set to `ALL` to include entries for all published versions of each function\. diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 0863a3ec..991bbc00 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -10,7 +10,7 @@ GET /2018-10-31/layers/LayerName/versions?CompatibleRuntime=CompatibleRuntime&Ma ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. @@ -19,7 +19,8 @@ Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [Marker](#API_ListLayerVersions_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 1f8273a9..7d25b1cc 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -10,7 +10,7 @@ GET /2018-10-31/layers?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItem ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index b78cb1eb..c200e5df 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -10,7 +10,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=M ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** The name of the Lambda function\. @@ -21,7 +21,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index ac77cc79..adb84c70 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -10,11 +10,12 @@ GET /2017-03-31/tags/ARN HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [ARN](#API_ListTags_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index aee1cdcd..df1b650b 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -10,7 +10,7 @@ GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** The name of the Lambda function\. @@ -21,7 +21,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 8794617d..96fe2f7c 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -25,12 +25,13 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ## Request Body diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 7bb20cf7..6142ec6a 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -21,7 +21,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_PublishVersion_RequestSyntax) ** The name of the Lambda function\. @@ -32,7 +32,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index 2c10afe3..328040ee 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -19,7 +19,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. @@ -30,7 +30,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 59c0bd25..a8eea115 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -28,7 +28,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -39,7 +39,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 4836442f..86ef1b9e 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -15,7 +15,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. @@ -26,12 +26,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` +Pattern: `(|[a-zA-Z0-9$_-]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index b4fde1af..0bad24c5 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -10,12 +10,13 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?Re ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` +Required: Yes ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. @@ -23,10 +24,12 @@ Only update the policy if the revision ID matches the ID specified\. Use this op ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** The identifier that was specified when the statement was added\. Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_]+)` +Pattern: `([a-zA-Z0-9-_]+)` +Required: Yes ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** -The version number\. +The version number\. +Required: Yes ## Request Body diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index 470cd6e4..6f877055 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -10,7 +10,7 @@ DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_RemovePermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -21,7 +21,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_RemovePermission_RequestSyntax) ** Specify a version or alias to remove permissions from a published version of the function\. @@ -34,7 +35,8 @@ Only update the policy if the revision ID matches the ID that's specified\. Use ** [StatementId](#API_RemovePermission_RequestSyntax) ** Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_.]+)` +Pattern: `([a-zA-Z0-9-_.]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index b16bb352..914df1aa 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -17,11 +17,12 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [ARN](#API_TagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index 124b1940..b1e30427 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -10,14 +10,16 @@ DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [ARN](#API_UntagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [TagKeys](#API_UntagResource_RequestSyntax) ** -A list of tag keys to remove from the function\. +A list of tag keys to remove from the function\. +Required: Yes ## Request Body diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index 6e99eef6..f615bf85 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -22,7 +22,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** The name of the Lambda function\. @@ -33,12 +33,14 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:MyFunction`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Name](#API_UpdateAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` +Required: Yes ## Request Body diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 9f9484a5..568b08fe 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -37,10 +37,11 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. +The identifier of the event source mapping\. +Required: Yes ## Request Body diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 8cfb015a..639573e1 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -23,7 +23,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** The name of the Lambda function\. @@ -34,7 +34,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index b8e9a9d7..b89561f1 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -44,7 +44,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the Lambda function\. @@ -55,7 +55,8 @@ The name of the Lambda function\. + **Partial ARN** \- `123456789012:function:my-function`\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ## Request Body diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index f1ce6698..3c196e8d 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -26,7 +26,7 @@ Content-type: application/json ## URI Request Parameters -The request requires the following URI parameters\. +The request uses the following URI parameters\. ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. @@ -37,7 +37,8 @@ The name of the Lambda function, version, or alias\. + **Partial ARN** \- `123456789012:function:my-function`\. You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. From 1e6a504f19362d8b895e3277deaff8895fa5c122 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 8 Jun 2020 18:05:32 +0000 Subject: [PATCH 014/243] Step Functions topic --- doc_source/index.md | 1 + doc_source/lambda-services.md | 2 +- doc_source/samples-listmanager.md | 4 +- doc_source/services-stepfunctions.md | 184 +++++++++++++++++++++++++++ 4 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 doc_source/services-stepfunctions.md diff --git a/doc_source/index.md b/doc_source/index.md index afb21524..bd43ec01 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -115,6 +115,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + + [Orchestrate Lambda functions with AWS Step Functions](services-stepfunctions.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 6bcfcb89..e424e91f 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -63,7 +63,7 @@ Other services invoke your function directly\. You grant the other service permi + [Amazon API Gateway](services-apigateway.md) + [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) + [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) -+ [AWS Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) ++ [AWS Step Functions](services-stepfunctions.md) + [Amazon Simple Storage Service Batch](services-s3-batch.md) For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [dead\-letter queue](invocation-async.md#dlq) that you configure\. diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index f13a60a6..5ac70cf1 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -1,6 +1,6 @@ # List manager sample application for AWS Lambda -The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. +The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png) @@ -30,7 +30,7 @@ The sample application uses the following AWS services: **Pricing** Standard charges apply for each service\. -The application processes JSON documents from clients that contain information necessary to update a list\. It supports two types of list: tally and ranking\. A tally contains values that are added to the current value for key if it exists\. Each entry processed for a user increases the value of a key in the specified table\. +The application processes JSON documents from clients that contain information necessary to update a list\. It supports two types of list: tally and ranking\. A *tally* contains values that are added to the current value for key if it exists\. Each entry processed for a user increases the value of a key in the specified table\. The following example shows a document that increases the `xp` \(experience points\) value for a user's `stats` list\. diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md new file mode 100644 index 00000000..204d3ad4 --- /dev/null +++ b/doc_source/services-stepfunctions.md @@ -0,0 +1,184 @@ +# Orchestrate Lambda functions with AWS Step Functions + +You can use AWS Step Functions to create state machines that orchestrate Lambda functions to create an application\. Step Functions manages the state of your application and provides a visual interface for defining workflows that involve Lambda functions, AWS Batch jobs, Amazon SNS topics, Amazon SQS queues and other common AWS resources\. Instead of defining your application logic in a program, you assemble components visually or with a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. Lambda functions in Step Functions are self\-contained, reusable services with a well defined interface that you can share with less technical users\. + +Step Functions invokes your function with an event document that you define\. You create a *task* state that invokes your function with the input to the state machine or any JSON document\. + +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** + +``` +{ + "max-depth": 10, + "current-depth": 0, + "error-rate": 0.05 +} +``` + +Step Functions makes it easy to [retry failed executions](#services-stepfunctions-exceptions) or branch your application logic based on the result of an invocation\. + +**Topics** ++ [Configuring a state machine as an event source](#services-stepfunctions-setup) ++ [Handling function and service errors](#services-stepfunctions-exceptions) ++ [AWS CloudFormation and AWS SAM](#services-stepfunctions-cloudformation) + +## Configuring a state machine as an event source + +You can use the [Step Functions console](https://console.aws.amazon.com/states/home) to generate a state that invokes a Lambda function, or define states directly in JSON\. The following example shows a task state that invokes version 1 of a function named `my-function` with an event payload that has 3 keys\. When the function returns a successful response, the state machine continues to the next task\. + +**Example state machine task** + +``` +"Invoke": { + "Type": "Task", + "Resource": "arn:aws:states:::lambda:invoke", + "Parameters": { + "FunctionName": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", + "Payload": { + "max-depth": 10, + "current-depth": 0, + "error-rate": 0.05 + } + }, + "Next": "NEXT_STATE", + "TimeoutSeconds": 25 +} +``` + +**Permissions** +Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) managed policy or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the AWS Step Functions Developer Guide\. + +The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event`: + +``` + "InvocationType": "Event" +``` + +Instead of hard coding the event payload in the state machine definition, you can use the input from the state machine execution\. The following example uses the input specified when you run the state machine as the event payload: + +``` + "Payload.$": "$" +``` + +You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, you set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. For more information, see [Invoke Lambda with Step Functions ](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the AWS Step Functions Developer Guide\. + +## Handling function and service errors + +When your function or the Lambda service returns an error, you can retry the invocation or continue to a different state based on the error type\. + +The following example shows an invoke task that retries on `5XX` series Lambda API exceptions \(`ServiceException`\), throttles \(`TooManyRequestsException`\), runtime errors \(`Lambda.Unknown`\), and a function\-defined error named `function.MaxDepthError`\. It also catches an error named `function.DoublesRolledError` and continues to a state named `CaughtException` when it occurs\. + +**Example invoke task – Retry and catch** + +``` + "Invoke": { + "Type": "Task", + "Resource": "arn:aws:states:::lambda:invoke", + "Retry": [ + { + "ErrorEquals": [ + "function.MaxDepthError", + "Lambda.TooManyRequestsException", + "Lambda.ServiceException", + "Lambda.Unknown" + ], + "MaxAttempts": 5 + } + ], + "Catch": [ + { + "ErrorEquals": [ "function.DoublesRolledError" ], + "Next": "CaughtException" + } + ], + "Parameters": { + "FunctionName": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", + ... +``` + +To catch or retry on function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. For details on throwing errors in each support language, see the following topics\. ++ [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) ++ [AWS Lambda function errors in Python](python-exceptions.md) ++ [AWS Lambda function errors in Ruby](ruby-exceptions.md) ++ [AWS Lambda function errors in Java](java-exceptions.md) ++ [AWS Lambda function errors in Go](golang-exceptions.md) ++ [AWS Lambda function errors in C\#](csharp-exceptions.md) ++ [AWS Lambda function errors in PowerShell](powershell-exceptions.md) + +For more information on error handling in Step Functions, see [Handling error conditions using a state machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html)\. + +## AWS CloudFormation and AWS SAM + +You can create a serverless application that includes a Step Functions state machine in a AWS CloudFormation template with the AWS Serverless Application Model \(AWS SAM\)\. With AWS SAM, you can define the state machine inline in the template or in separate file\. The following example shows a state machine that demonstrates invoking a Lambda function and handling errors\. It refers to a function resource defined in the same template \(not shown\)\. + +**Example template\.yml** + +``` +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that uses AWS Step Functions. +Resources: + statemachine: + Type: [AWS::Serverless::StateMachine](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html) + Properties: + DefinitionSubstitutions: + FunctionArn: !GetAtt function.Arn + Payload: | + { + "max-depth": 5, + "current-depth": 0, + "error-rate": 0.2 + } + Definition: + StartAt: Invoke + States: + Invoke: + Type: Task + Resource: arn:aws:states:::lambda:invoke + Parameters: + FunctionName: "${FunctionArn}" + Payload: "${Payload}" + InvocationType: Event + Retry: + - ErrorEquals: + - function.MaxDepthError + - function.MaxDepthError + - Lambda.TooManyRequestsException + - Lambda.ServiceException + - Lambda.Unknown + IntervalSeconds: 1 + MaxAttempts: 5 + Catch: + - ErrorEquals: + - function.DoublesRolledError + Next: CaughtException + - ErrorEquals: + - States.ALL + Next: UncaughtException + Next: Success + CaughtException: + Type: Pass + Result: The function returned an error. + End: true + UncaughtException: + Type: Pass + Result: Invocation failed. + End: true + Success: + Type: Pass + Result: Invocation succeeded! + End: true + Events: + scheduled: + Type: Schedule + Properties: + Description: Run every minute + Schedule: rate(1 minute) + Type: STANDARD + Policies: + - AWSLambdaRole + ... +``` + +This creates a state machine with the following structure: + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/services-stepfunctions-statemachine.png) \ No newline at end of file From 15bad941a3d0e55a709f023be70def220beaa2e9 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 9 Jun 2020 20:26:59 -0700 Subject: [PATCH 015/243] throw exception for max depth error --- sample-apps/error-processor/event.json | 2 +- sample-apps/error-processor/random-error/index.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sample-apps/error-processor/event.json b/sample-apps/error-processor/event.json index 49fe97ae..d12c7edb 100644 --- a/sample-apps/error-processor/event.json +++ b/sample-apps/error-processor/event.json @@ -1,5 +1,5 @@ { - "max-depth": 10, + "max-depth": 50, "current-depth": 0, "error-rate": 0.05 } \ No newline at end of file diff --git a/sample-apps/error-processor/random-error/index.js b/sample-apps/error-processor/random-error/index.js index 7728d1ba..ea6063f1 100644 --- a/sample-apps/error-processor/random-error/index.js +++ b/sample-apps/error-processor/random-error/index.js @@ -23,7 +23,6 @@ var myFunction = async function(event, context) { subsegment.addAnnotation('roll2', roll2) subsegment.addAnnotation('request_id', context.awsRequestId) }) - event["current-depth"] += 1 if (event["max-depth"] == event["current-depth"]) { @@ -47,6 +46,13 @@ var myFunction = async function(event, context) { else { response.depth +=1 } + if ( response.errorType == "function.MaxDepthError" ){ + var error = new Error(response.errorMessage) + error.name = "function.MaxDepthError" + console.log("ERROR") + throw error + } + return response } From 60c6f0a5f6550bab70abdcec0265952bb38ece7d Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 10 Jun 2020 20:50:38 -0400 Subject: [PATCH 016/243] Remove unused json import from logging examples The logging examples import the json library but don't use it. Should be removed --- doc_source/python-logging.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index bb6f6150..9ba8f458 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -7,7 +7,6 @@ To output logs from your function code, you can use [the `print` method](https:/ **Example lambda\_function\.py** ``` -import json import os def lambda_handler(event, context): @@ -154,7 +153,6 @@ Log groups aren't deleted automatically when you delete a function\. To avoid st For more detailed logs, use the [logging library](https://docs.python.org/3/library/logging.html)\. ``` -import json import os import logging logger = logging.getLogger() @@ -182,4 +180,4 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true -``` \ No newline at end of file +``` From 4e5c3c486b34f879c31107ff2e49c5244b4c18d0 Mon Sep 17 00:00:00 2001 From: Ryan Weland Date: Mon, 15 Jun 2020 12:08:30 -0400 Subject: [PATCH 017/243] Fixed .Net SDK links --- sample-apps/blank-csharp/README.md | 2 +- sample-apps/ec2-spot/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/blank-csharp/README.md b/sample-apps/blank-csharp/README.md index 891c1a03..75006ae5 100644 --- a/sample-apps/blank-csharp/README.md +++ b/sample-apps/blank-csharp/README.md @@ -11,7 +11,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [Managing Spot Instance Requests](https://docs.aws.amazon.com/lambda/latest/dg/services-ec2-tutorial.html) in the developer guide. # Requirements -- [.NET Core SDK 3.1](https://nodejs.org/en/download/releases/) +- [.NET Core SDK 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) - [AWS extensions for .NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). diff --git a/sample-apps/ec2-spot/README.md b/sample-apps/ec2-spot/README.md index 098c83a1..b49d9c54 100644 --- a/sample-apps/ec2-spot/README.md +++ b/sample-apps/ec2-spot/README.md @@ -11,7 +11,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [Managing Spot Instance Requests](https://docs.aws.amazon.com/lambda/latest/dg/services-ec2-tutorial.html) in the developer guide. # Requirements -- [.NET Core SDK 2.1](https://nodejs.org/en/download/releases/) +- [.NET Core SDK 2.1](https://dotnet.microsoft.com/download/dotnet-core/2.1) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). From 9e6f94b0eb831112f070d829f1a36e2423a26579 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Tue, 16 Jun 2020 19:43:32 -0700 Subject: [PATCH 018/243] doc updates for EFS on Lambda, plus other fixes --- doc_source/API_CreateFunction.md | 23 +++ doc_source/API_DeleteEventSourceMapping.md | 2 +- doc_source/API_FileSystemConfig.md | 27 ++++ doc_source/API_FunctionConfiguration.md | 6 + doc_source/API_GetFunction.md | 6 + doc_source/API_GetFunctionConfiguration.md | 11 ++ doc_source/API_Invoke.md | 16 +++ doc_source/API_ListFunctions.md | 6 + doc_source/API_ListVersionsByFunction.md | 6 + doc_source/API_PublishVersion.md | 11 ++ doc_source/API_Types.md | 1 + doc_source/API_UpdateEventSourceMapping.md | 2 +- doc_source/API_UpdateFunctionCode.md | 11 ++ doc_source/API_UpdateFunctionConfiguration.md | 23 +++ doc_source/configuration-aliases.md | 7 + doc_source/configuration-filesystem.md | 135 ++++++++++++++++++ doc_source/index.md | 3 + doc_source/invocation-scaling.md | 2 +- doc_source/lambda-functions.md | 1 + doc_source/lambda-releases.md | 1 + doc_source/lambda-services.md | 8 +- doc_source/security-dataprotection.md | 2 + doc_source/services-efs.md | 47 ++++++ doc_source/services-stepfunctions.md | 16 +-- doc_source/troubleshooting-invocation.md | 18 ++- doc_source/with-sns-example.md | 10 +- 26 files changed, 387 insertions(+), 14 deletions(-) create mode 100644 doc_source/API_FileSystemConfig.md create mode 100644 doc_source/configuration-filesystem.md create mode 100644 doc_source/services-efs.md diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 177d87b2..99d61f32 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -34,6 +34,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-CreateFunction-request-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionName](#SSS-CreateFunction-request-FunctionName)": "string", "[Handler](#SSS-CreateFunction-request-Handler)": "string", "[KMSKeyArn](#SSS-CreateFunction-request-KMSKeyArn)": "string", @@ -83,6 +89,12 @@ Required: No ** [Environment](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object +Required: No + + ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. Required: No ** [FunctionName](#API_CreateFunction_RequestSyntax) ** @@ -184,6 +196,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-CreateFunction-response-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](#SSS-CreateFunction-response-FunctionArn)": "string", "[FunctionName](#SSS-CreateFunction-response-FunctionName)": "string", "[Handler](#SSS-CreateFunction-response-Handler)": "string", @@ -246,6 +264,11 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. + ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index b6be76d0..601c99cc 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -129,7 +129,7 @@ One of the parameters in the request is invalid\. HTTP Status Code: 400 **ResourceInUseException** -The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. +The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 **ResourceNotFoundException** diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md new file mode 100644 index 00000000..2a18b234 --- /dev/null +++ b/doc_source/API_FileSystemConfig.md @@ -0,0 +1,27 @@ +# FileSystemConfig + +Details about the connection between a Lambda function and an Amazon EFS file system\. + +## Contents + + **Arn** +The Amazon Resource Name \(ARN\) of the Amazon EFS access point that provides access to the file system\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:access-point/fsap-[a-f0-9]{17}` +Required: Yes + + **LocalMountPath** +The path where the function can access the file system, starting with `/mnt/`\. +Type: String +Length Constraints: Maximum length of 160\. +Pattern: `^/mnt/[a-zA-Z0-9-_.]+$` +Required: Yes + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index fb5d59d6..ee92799c 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -28,6 +28,12 @@ Required: No **Environment** The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Required: No + + **FileSystemConfigs** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. Required: No **FunctionArn** diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index cf290a8c..fd83505a 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -63,6 +63,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index f5fe70bd..820049fc 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -57,6 +57,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-GetFunctionConfiguration-response-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](#SSS-GetFunctionConfiguration-response-FunctionArn)": "string", "[FunctionName](#SSS-GetFunctionConfiguration-response-FunctionName)": "string", "[Handler](#SSS-GetFunctionConfiguration-response-Handler)": "string", @@ -119,6 +125,11 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. + ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 713e1009..e982a0f1 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -117,6 +117,22 @@ HTTP Status Code: 502 AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 + **EFSIOException** +An error occured when reading from or writing to a connected file system\. +HTTP Status Code: 410 + + **EFSMountConnectivityException** +The function couldn't make a network connection to the configured file system\. +HTTP Status Code: 408 + + **EFSMountFailureException** +The function couldn't mount the configured file system due to a permission or configuration issue\. +HTTP Status Code: 403 + + **EFSMountTimeoutException** +The function was able to make a network connection to the configured file system, but the mount operation timed out\. +HTTP Status Code: 408 + **ENILimitReachedException** AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. HTTP Status Code: 502 diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index 4e495812..89533cee 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -57,6 +57,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index df1b650b..d566654d 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -60,6 +60,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 6142ec6a..d0ddf1a3 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -77,6 +77,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-PublishVersion-response-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](#SSS-PublishVersion-response-FunctionArn)": "string", "[FunctionName](#SSS-PublishVersion-response-FunctionName)": "string", "[Handler](#SSS-PublishVersion-response-Handler)": "string", @@ -139,6 +145,11 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. + ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index b8e837b4..fcfa5ba3 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -12,6 +12,7 @@ The following data types are supported: + [EnvironmentError](API_EnvironmentError.md) + [EnvironmentResponse](API_EnvironmentResponse.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) ++ [FileSystemConfig](API_FileSystemConfig.md) + [FunctionCode](API_FunctionCode.md) + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 568b08fe..5eeedeb7 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -220,7 +220,7 @@ The resource already exists, or another operation is in progress\. HTTP Status Code: 409 **ResourceInUseException** -The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. +The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 **ResourceNotFoundException** diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 639573e1..11139aaa 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -102,6 +102,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-UpdateFunctionCode-response-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](#SSS-UpdateFunctionCode-response-FunctionArn)": "string", "[FunctionName](#SSS-UpdateFunctionCode-response-FunctionName)": "string", "[Handler](#SSS-UpdateFunctionCode-response-Handler)": "string", @@ -164,6 +170,11 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. + ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index b89561f1..ea6e3590 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -24,6 +24,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-UpdateFunctionConfiguration-request-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[Handler](#SSS-UpdateFunctionConfiguration-request-Handler)": "string", "[KMSKeyArn](#SSS-UpdateFunctionConfiguration-request-KMSKeyArn)": "string", "[Layers](#SSS-UpdateFunctionConfiguration-request-Layers)": [ "string" ], @@ -76,6 +82,12 @@ Required: No ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object +Required: No + + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. Required: No ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -159,6 +171,12 @@ Content-type: application/json "string" : "string" } }, + "[FileSystemConfigs](#SSS-UpdateFunctionConfiguration-response-FileSystemConfigs)": [ + { + "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", + "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + } + ], "[FunctionArn](#SSS-UpdateFunctionConfiguration-response-FunctionArn)": "string", "[FunctionName](#SSS-UpdateFunctionConfiguration-response-FunctionName)": "string", "[Handler](#SSS-UpdateFunctionConfiguration-response-Handler)": "string", @@ -221,6 +239,11 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's environment variables\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +Connection settings for an Amazon EFS file system\. +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Array Members: Maximum number of 1 item\. + ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 119b9238..ef796d3d 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -27,11 +27,18 @@ To change an alias to point a new version of the function, use the `update-alias ``` $ aws lambda update-alias --function-name my-function --name alias-name --function-version version-number +``` + +To delete an alias, use the `delete-alias` command\. + +``` +$ aws lambda delete-alias --function-name my-function --name alias-name ``` The AWS CLI commands in the preceding steps correspond to the following AWS Lambda APIs: + [CreateAlias](API_CreateAlias.md) + [UpdateAlias](API_UpdateAlias.md) ++ [DeleteAlias](API_DeleteAlias.md) ## Using aliases diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md new file mode 100644 index 00000000..b10f366e --- /dev/null +++ b/doc_source/configuration-filesystem.md @@ -0,0 +1,135 @@ +# Configuring file system access for Lambda functions + +You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. + +A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. + +**Note** +If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. + +**To configure file system access** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **File system**, choose **Add file system**\. + +1. Configure the following properties: + + **EFS file system** – The access point for a file system in the same VPC\. + + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. + +**Pricing** +Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. +Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. + +For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. + +**Topics** ++ [Configuring a file system and access point](#configuration-filesystem-setup) ++ [Execution role and user permissions](#configuration-filesystem-permissions) ++ [Configuring file system access with the Lambda API](#configuration-filesystem-api) ++ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) + +## Configuring a file system and access point + +Create a file system in Amazon EFS with a mount target in every Availability Zone that your function connects to\. For performance and resilience, use at least two Availability Zones\. For example, in a simple configuration you could have a VPC with two private subnets in separate Availability Zones\. The function connects to both subnets and a mount target is available in each\. Ensure that NFS traffic \(port 2049\) is allowed by the security groups used by the function and mount targets\. + +**Note** +When you create a file system, you choose a performance mode that can't be changed later\. **General purpose** mode has lower latency, and **Max I/O** mode supports a higher maximum throughput and IOPS\. For help choosing, see [Amazon EFS performance](https://docs.aws.amazon.com/efs/latest/ug/performance.html) in the *Amazon Elastic File System User Guide*\. + +An access point connects each instance of the function to the right mount target for the Availability Zone it connects to\. For best performance, create an access point with a non\-root path, and limit the number of files that you create in each directory\. User and owner IDs are required, but they don't need to have a specific value\. The following example creates a directory named `my-function` on the file system and sets the owner ID to 1001 with standard directory permissions \(755\)\. + +**Example access point configuration** ++ **Name** – `files` ++ **User ID** – `1001` ++ **Group ID** – `1001` ++ **Path** – `/my-function` ++ **Permissions** – `755` ++ **Owner user ID** – `1001` ++ **Group user ID** – `1001` + +When a function uses the access point, it is given user ID 1001 and has full access to the directory\. + +For more information, see the following topics in the *Amazon Elastic File System User Guide*: ++ [Creating resources for Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html) ++ [Working with users, groups, and permissions](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions.html) + +## Execution role and user permissions + +Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): + +**Execution role permissions** ++ **elasticfilesystem:ClientMount** ++ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** + +These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. + +When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: + +**User permissions** ++ **elasticfilesystem:DescribeMountTargets** + +## Configuring file system access with the Lambda API + +Use the following API operations to connect your Lambda function to a file system: ++ [CreateFunction](API_CreateFunction.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + +To connect a function a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. + +``` +$ ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd +$ aws lambda update-function-configuration --function-name my-function \ + --fs-config FileSystemArn=$ARN,LocalMountPath=/mnt/efs0 +``` + +You can get the ARN of a file system's access point with the `describe-access-points` command\. + +``` +$ aws efs describe-access-points +{ + "AccessPoints": [ + { + "ClientToken": "console-aa50c1fd-xmpl-48b5-91ce-57b27a3b1017", + "Name": "lambda-ap", + "Tags": [ + { + "Key": "Name", + "Value": "lambda-ap" + } + ], + "AccessPointId": "fsap-015cxmplb72b405fd", + "AccessPointArn": "arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd", + "FileSystemId": "fs-aea3xmpl", + "RootDirectory": { + "Path": "/" + }, + "OwnerId": "123456789012", + "LifeCycleState": "available" + } + ] +} +``` + +## AWS CloudFormation and AWS SAM + +You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SAM\) to automate the creation of Lambda applications\. To enable a file system connection on an AWS SAM `AWS::Serverless::Function` resource, use the `FileSystemConfigs` property\. + +**Example template\.yml – File system configuration** + +``` + function: + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Properties: + CodeUri: function/. + Description: Use a file system. + FileSystemConfigs: + - LocalMountPath: "/mnt/efs0" + Arn: !GetAtt accessPoint.Arn + DependsOn: "my mount target" +``` + +You must add the `DependsOn` to ensure that the mount targets are fully created before the Lambda runs for the first time\. + +For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and fields are the same\. For more information, see [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md)\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index bd43ec01..aa1f01b2 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -38,6 +38,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring database access for a Lambda function](configuration-database.md) + + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Tagging Lambda Functions](configuration-tags.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) @@ -92,6 +93,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + + [Using Amazon EFS with Lambda](services-efs.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) @@ -258,6 +260,7 @@ Amazon's trademarks and trade dress may not be used in + [EnvironmentError](API_EnvironmentError.md) + [EnvironmentResponse](API_EnvironmentResponse.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) + + [FileSystemConfig](API_FileSystemConfig.md) + [FunctionCode](API_FunctionCode.md) + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index 9c0511bd..b1e131a6 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -34,7 +34,7 @@ When your function scales up, the first request served by each instance is impac + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -When provisioned concurrency is allocated, the function scales with the same burst behavior as standard concurrency\. After it's allocated, provisioned concurrency serves incoming requests with very low latency\. When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. +When you allocate provisioned concurrency, your function is ready to serve a burst of incoming requests with very low latency\. When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. Application Auto Scaling takes this a step further by providing autoscaling for provisioned concurrency\. With Application Auto Scaling, you can create a target tracking scaling policy that adjusts provisioned concurrency levels automatically, based on the utilization metric that Lambda emits\. [Use the Application Auto Scaling API](configuration-concurrency.md#configuration-concurrency-api) to register an alias as a scalable target and create a scaling policy\. diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index f77054dd..ac4573c1 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -19,4 +19,5 @@ To use your Lambda function with AWS resources in an Amazon VPC, configure it wi + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring database access for a Lambda function](configuration-database.md) ++ [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Tagging Lambda Functions](configuration-tags.md) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 316a10cf..092429cc 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | | [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index e424e91f..5f364b1f 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -66,7 +66,7 @@ Other services invoke your function directly\. You grant the other service permi + [AWS Step Functions](services-stepfunctions.md) + [Amazon Simple Storage Service Batch](services-s3-batch.md) -For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [dead\-letter queue](invocation-async.md#dlq) that you configure\. +For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. **Services that invoke Lambda functions asynchronously** + [Amazon Simple Storage Service](with-s3.md) @@ -81,4 +81,10 @@ For asynchronous invocation, Lambda queues the event before passing it to your f + [AWS IoT Events](services-iotevents.md) + [AWS CodePipeline](services-codepipeline.md) +Additionally, some services integrate with Lambda in other ways that don't involve invoking functions\. + +**Services that integrate with Lambda in other ways** ++ [Amazon Elastic File System](services-efs.md) ++ [AWS X\-Ray](services-xray.md) + See the topics in this chapter for more details about each service, and example events that you can use to test your function\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 5b19c204..a1b6f7a2 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -21,6 +21,8 @@ For more information about data protection, see the [AWS shared responsibility m Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console, AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. +When you [connect your function to a file system](configuration-filesystem.md), Lambda uses [Encryption in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) for all connections\. + For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. ## Encryption at rest diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md new file mode 100644 index 00000000..6f5a3941 --- /dev/null +++ b/doc_source/services-efs.md @@ -0,0 +1,47 @@ +# Using Amazon EFS with Lambda + +Lambda integrates with Amazon Elastic File System \(Amazon EFS\) to support secure, shared file system access for Lambda applications\. You can configure functions to mount a file system during initialization with the NFS protocol over the local network within a VPC\. Lambda manages the connection and encrypts all traffic to and from the file system\. + +The file system and the Lambda function must be in the same region\. A Lambda function in one account can mount a file system in a different account\. For this scenario, you configure VPC peering between the function VPC and the file system VPC\. + +**Note** +To configure a function to connect to a file system, see [Configuring file system access for Lambda functions](configuration-filesystem.md)\. + +Amazon EFS supports [file locking](https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html#consistency) to prevent corruption if multiple functions try to write to the same file system at the same time\. Locking in Amazon EFS follows the NFS v4\.1 protocol for advisory locking, and enables your applications to use both whole file and byte range locks\. + +Amazon EFS provides options to customize your file system based on your application's need to maintain high performance at scale\. There are three primary factors to consider: the number of connections, throughput \(in MiB per second\), and IOPS\. + +**Limits** +For detail on file system limits, see [Quotas for Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-fs-specific) in the *Amazon Elastic File System User Guide*\. + +To avoid issues with scaling, throughput, and IOPS, monitor the [metrics](https://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html) that Amazon EFS sends to Amazon CloudWatch\. For an overview of monitoring in Amazon EFS, see [Monitoring Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/monitoring_overview.html) in the *Amazon Elastic File System User Guide*\. + +**Topics** ++ [Connections](#services-efs-connections) ++ [Throughput](#services-efs-throughput) ++ [IOPS](#services-efs-iops) + +## Connections + +Amazon EFS supports up to 25,000 connections per file system\. During initialization, each instance of a function creates a single connection to its file system that persists across invocations\. This means that you can reach 25,000 concurrency across one or more functions connected to a file system\. To limit the number of connections a function creates, use [reserved concurrency](configuration-concurrency.md)\. + +However, when you make changes to your function's code or configuration at scale, there is a temporary increase in the number of function instances beyond the current concurrency\. Lambda provisions new instances to handle new requests and there is some delay before old instances close their connections to the file system\. To avoid hitting the maximum connections limit during a deployment, use [rolling deployments](lambda-rolling-deployments.md)\. With rolling deployments, you gradually shift traffic to the new version each time you make a change\. + +If you connect to the same file system from other services such as Amazon EC2, you should also be aware of the scaling behavior of connections in Amazon EFS\. A file system supports the creation of up to 3,000 connections in a burst, after which it supports 500 new connections per minute\. This matches [burst scaling](invocation-scaling.md) behavior in Lambda, which applies across all functions in a Region\. But if you are creating connections outside of Lambda, your functions may not be able to scale at full speed\. + +To monitor and trigger an alarm on connections, use the `ClientConnections` metric\. + +## Throughput + +At scale, it is also possible to exceed the maximum *throughput* for a file system\. In *bursting mode* \(the default\), a file system has a low baseline throughput that scales linearly with its size\. To allow for bursts of activity, the file system is granted burst credits that allow it to use 100 MiB/s or more of throughput\. Credits accumulate continually and are expended with every read and write operation\. If the file system runs out of credits, it throttles read and write operations beyond the baseline throughput, which can cause invocations to time out\. + +**Note** +If you use [provisioned concurrency](configuration-concurrency.md), your function can consume burst credits even when idle\. With provisioned concurrency, Lambda initializes instances of your function before it is invoked, and recycles instances every few hours\. If you use files on an attached file system during initialization, this activity can use all of your burst credits\. + +To monitor and trigger an alarm on throughput, use the `BurstCreditBalance` metric\. It should increase when your function's concurrency is low and decrease when it is high\. If it always decreases or does not accumulate enough during low activity to cover peak traffic, you may need to limit your function's concurrency or enable [provisioned throughput](https://docs.aws.amazon.com/efs/latest/ug/performance.html#throughput-modes)\. + +## IOPS + +Input/output operations per second \(IOPS\) is a measurement of the number of read and write operations processed by the file system\. In general purpose mode, IOPS is limited in favor of lower latency, which is beneficial for most applications\. + +To monitor and alarm on IOPS in general purpose mode, use the `PercentIOLimit` metric\. If this metric reaches 100%, your function can time out waiting for read and write operations to complete\. \ No newline at end of file diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index 204d3ad4..d6b12874 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -1,6 +1,6 @@ # Orchestrate Lambda functions with AWS Step Functions -You can use AWS Step Functions to create state machines that orchestrate Lambda functions to create an application\. Step Functions manages the state of your application and provides a visual interface for defining workflows that involve Lambda functions, AWS Batch jobs, Amazon SNS topics, Amazon SQS queues and other common AWS resources\. Instead of defining your application logic in a program, you assemble components visually or with a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. Lambda functions in Step Functions are self\-contained, reusable services with a well defined interface that you can share with less technical users\. +You can use AWS Step Functions to create state machines that orchestrate Lambda functions to create an application\. Step Functions manages the state of your application and provides a visual interface for defining workflows that involve Lambda functions, AWS Batch jobs, Amazon SNS topics, Amazon SQS queues and other common AWS resources\. Instead of defining your application logic in a program, you assemble components visually or with a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. Lambda functions in Step Functions are self\-contained, reusable services with a well\-defined interface that you can share with less technical users\. Step Functions invokes your function with an event document that you define\. You create a *task* state that invokes your function with the input to the state machine or any JSON document\. @@ -23,7 +23,7 @@ Step Functions makes it easy to [retry failed executions](#services-stepfunction ## Configuring a state machine as an event source -You can use the [Step Functions console](https://console.aws.amazon.com/states/home) to generate a state that invokes a Lambda function, or define states directly in JSON\. The following example shows a task state that invokes version 1 of a function named `my-function` with an event payload that has 3 keys\. When the function returns a successful response, the state machine continues to the next task\. +You can use the [Step Functions console](https://console.aws.amazon.com/states/home) to generate a state that invokes a Lambda function, or define states directly in JSON\. The following example shows a task state that invokes version 1 of a function named `my-function` with an event payload that has three keys\. When the function returns a successful response, the state machine continues to the next task\. **Example state machine task** @@ -45,9 +45,9 @@ You can use the [Step Functions console](https://console.aws.amazon.com/states/h ``` **Permissions** -Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) managed policy or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the AWS Step Functions Developer Guide\. +Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) managed policy or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the *AWS Step Functions Developer Guide*\. -The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event`: +The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event` as shown following: ``` "InvocationType": "Event" @@ -59,7 +59,7 @@ Instead of hard coding the event payload in the state machine definition, you ca "Payload.$": "$" ``` -You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, you set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. For more information, see [Invoke Lambda with Step Functions ](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the AWS Step Functions Developer Guide\. +You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, you set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. For more information, see [Invoke Lambda with Step Functions ](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the *AWS Step Functions Developer Guide*\. ## Handling function and service errors @@ -95,7 +95,7 @@ The following example shows an invoke task that retries on `5XX` series Lambda A ... ``` -To catch or retry on function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. For details on throwing errors in each support language, see the following topics\. +To catch or retry on function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. For details on throwing errors in each support language, see the following topics: + [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) + [AWS Lambda function errors in Python](python-exceptions.md) + [AWS Lambda function errors in Ruby](ruby-exceptions.md) @@ -104,11 +104,11 @@ To catch or retry on function errors, create a custom error type\. The name of t + [AWS Lambda function errors in C\#](csharp-exceptions.md) + [AWS Lambda function errors in PowerShell](powershell-exceptions.md) -For more information on error handling in Step Functions, see [Handling error conditions using a state machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html)\. +For more information on error handling in Step Functions, see [Handling error conditions using a state machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html) in the *AWS Step Functions Developer Guide*\. ## AWS CloudFormation and AWS SAM -You can create a serverless application that includes a Step Functions state machine in a AWS CloudFormation template with the AWS Serverless Application Model \(AWS SAM\)\. With AWS SAM, you can define the state machine inline in the template or in separate file\. The following example shows a state machine that demonstrates invoking a Lambda function and handling errors\. It refers to a function resource defined in the same template \(not shown\)\. +You can create a serverless application that includes a Step Functions state machine in a AWS CloudFormation template with the AWS Serverless Application Model \(AWS SAM\)\. With AWS SAM, you can define the state machine inline in the template or in a separate file\. The following example shows a state machine that demonstrates invoking a Lambda function and handling errors\. It refers to a function resource defined in the same template \(not shown\)\. **Example template\.yml** diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 5e4924b1..94523050 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -44,4 +44,20 @@ This typically occurs when your function manages resources in the same AWS servi **Error:** *KMSDisabledException: Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Please check the function's KMS key settings\.* -This error can occur if your KMS key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then reassign the custom key to recreate the grant\. \ No newline at end of file +This error can occur if your KMS key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then reassign the custom key to recreate the grant\. + +**Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* + +The mount request to the function's [file system](configuration-filesystem.md) was rejected\. Check the function's permissions, and confirm that its file system and access point exist and are ready for use\. + +**Error:** *EFSMountConnectivityException: The function couldn't connect to the Amazon EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\. Check your network configuration and try again\.* + +The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. + +**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out* + +The function was able to connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. + +**Error:** *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* + +A previous invocation timed out and Lambda was unable to terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index ffd55c3e..cf4b6cd7 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -106,12 +106,20 @@ $ aws lambda add-permission --function-name SNS-X-Account \ --statement-id sns-x-account --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB { - "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account\"}},\"Action\":[\"lambda:InvokeFunction\"],\"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"},\"Sid\":\"sns-x-account1\"}" + "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": + \"arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account\"}}, + \"Action\":[\"lambda:InvokeFunction\"], + \"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\", + \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, + \"Sid\":\"sns-x-account1\"}" } ``` Do not use the `--source-account` parameter to add a source account to the Lambda policy when adding the policy\. Source account is not supported for Amazon SNS event sources and will result in access being denied\. +**Note** +If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. + ## Create a subscription From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A, Amazon SNS invokes the `SNS-X-Account` function in account B\. From 2a77fd0e0138a07381e6a3e2860e825c9c9c63a7 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Thu, 18 Jun 2020 03:55:06 +0000 Subject: [PATCH 019/243] Amazon EFS sample app --- sample-apps/efs-nodejs/1-create-bucket.sh | 6 ++ sample-apps/efs-nodejs/2-deploy-vpc.sh | 3 + sample-apps/efs-nodejs/3-deploy.sh | 14 +++ sample-apps/efs-nodejs/4-invoke.sh | 10 ++ sample-apps/efs-nodejs/5-cleanup.sh | 38 +++++++ sample-apps/efs-nodejs/README.md | 90 ++++++++++++++++ sample-apps/efs-nodejs/event.json | 4 + sample-apps/efs-nodejs/function/index.js | 58 ++++++++++ sample-apps/efs-nodejs/template-vpcefs.yml | 119 +++++++++++++++++++++ sample-apps/efs-nodejs/template.yml | 44 ++++++++ 10 files changed, 386 insertions(+) create mode 100755 sample-apps/efs-nodejs/1-create-bucket.sh create mode 100755 sample-apps/efs-nodejs/2-deploy-vpc.sh create mode 100755 sample-apps/efs-nodejs/3-deploy.sh create mode 100755 sample-apps/efs-nodejs/4-invoke.sh create mode 100755 sample-apps/efs-nodejs/5-cleanup.sh create mode 100644 sample-apps/efs-nodejs/README.md create mode 100644 sample-apps/efs-nodejs/event.json create mode 100644 sample-apps/efs-nodejs/function/index.js create mode 100644 sample-apps/efs-nodejs/template-vpcefs.yml create mode 100644 sample-apps/efs-nodejs/template.yml diff --git a/sample-apps/efs-nodejs/1-create-bucket.sh b/sample-apps/efs-nodejs/1-create-bucket.sh new file mode 100755 index 00000000..55a9a5a3 --- /dev/null +++ b/sample-apps/efs-nodejs/1-create-bucket.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -eo pipefail +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME \ No newline at end of file diff --git a/sample-apps/efs-nodejs/2-deploy-vpc.sh b/sample-apps/efs-nodejs/2-deploy-vpc.sh new file mode 100755 index 00000000..8fbc72c1 --- /dev/null +++ b/sample-apps/efs-nodejs/2-deploy-vpc.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -eo pipefail +aws cloudformation deploy --template-file template-vpcefs.yml --stack-name efs-nodejs-vpc diff --git a/sample-apps/efs-nodejs/3-deploy.sh b/sample-apps/efs-nodejs/3-deploy.sh new file mode 100755 index 00000000..de00c5c4 --- /dev/null +++ b/sample-apps/efs-nodejs/3-deploy.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -eo pipefail +ARTIFACT_BUCKET=$(cat bucket-name.txt) +STACK=efs-nodejs +if [[ $# -eq 1 ]] ; then + STACK=$1 + echo "Deploying to stack $STACK" +fi +cd lib/nodejs && npm install && cd ../../ +aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml +aws cloudformation deploy --template-file out.yml --stack-name $STACK --capabilities CAPABILITY_NAMED_IAM + +# attach to different VPC +#aws cloudformation deploy --template-file out.yml --stack-name $STACK --capabilities CAPABILITY_NAMED_IAM --parameter-overrides vpcStackName=lambda-vpc diff --git a/sample-apps/efs-nodejs/4-invoke.sh b/sample-apps/efs-nodejs/4-invoke.sh new file mode 100755 index 00000000..9da0f12d --- /dev/null +++ b/sample-apps/efs-nodejs/4-invoke.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -eo pipefail +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name efs-nodejs --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) + +while true; do + aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + cat out.json + echo "" + sleep 2 +done diff --git a/sample-apps/efs-nodejs/5-cleanup.sh b/sample-apps/efs-nodejs/5-cleanup.sh new file mode 100755 index 00000000..ad33b9cd --- /dev/null +++ b/sample-apps/efs-nodejs/5-cleanup.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -eo pipefail +STACK=efs-nodejs +if [[ $# -eq 1 ]] ; then + STACK=$1 + echo "Deleting stack $STACK" +fi +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) +aws cloudformation delete-stack --stack-name $STACK +echo "Deleted $STACK stack." + +if [ -f bucket-name.txt ]; then + ARTIFACT_BUCKET=$(cat bucket-name.txt) + if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then + echo "Bucket was not created by this application. Skipping." + else + while true; do + read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response + case $response in + [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; rm bucket-name.txt; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac + done + fi +fi + +while true; do + read -p "Delete function log group (/aws/lambda/$FUNCTION)? (y/n)" response + case $response in + [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac +done + +rm -f out.yml out.json lib/nodejs/package-lock.json +rm -rf lib/nodejs/node_modules diff --git a/sample-apps/efs-nodejs/README.md b/sample-apps/efs-nodejs/README.md new file mode 100644 index 00000000..0514ee1e --- /dev/null +++ b/sample-apps/efs-nodejs/README.md @@ -0,0 +1,90 @@ +# Using Amazon EFS for file storage + +This application demonstrates the use of Amazon EFS with AWS Lambda. You can use Amazon EFS to create file systems that provide shared storage to Lambda functions and other compute resources. Your functions mount a folder in the file system to a local directory with the NFS protocol. The sample application creates a VPC network, file system, function, and supporting resources with AWS CloudFormation. + +The function takes a event with the following structure: + +``` +{ + "fileName": "test.bin", + "fileSize": 1048576 +} +``` + +The function creates a file of the specified size (1MB in this case) and then reads it into memory. + +The project source includes function code and supporting resources: + +- `dbadmin` - A Node.js function that reads and writes files. +- `lib` - A Lambda layer with the npm modules used by the application's function. +- `event.json` - A JSON document that can be used to test the application's function. +- `template.yml` - An AWS CloudFormation template that creates the application. +- `template-vpcefs.yml` - A template that creates the VPC and Amazon EFS file system. +- `1-create-bucket.sh`, `2-deploy-vpc.sh`, etc. - Shell scripts that use the AWS CLI to deploy and manage the application. + +Use the following instructions to deploy the sample application. + +# Requirements + +To deploy the sample application, you need the following tools: + +- [Node.js 10 with npm](https://nodejs.org/en/download/releases/). +- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. +- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). + +To run the sample application in AWS, you need permission to use Lambda and the following services. + +- Amazon EFS ([pricing](https://aws.amazon.com/efs/pricing/)) +- Amazon VPC ([pricing](https://aws.amazon.com/vpc/pricing/)) +- AWS Identity and Access Management +- AWS CloudFormation + +Standard charges apply for each service. + +# Setup + +Download or clone this repository. + + $ git clone https://github.com/awsdocs/aws-lambda-developer-guide.git + $ cd aws-lambda-developer-guide/sample-apps/efs-nodejs + +To create a new bucket for deployment artifacts, run `1-create-bucket.sh`. + + efs-nodejs$ ./1-create-bucket.sh + make_bucket: lambda-artifacts-a5e491dbb5b22e0d + +To create the VPC and EFS file system, run the `2-deploy-vpc.sh` script. + + efs-nodejs$ ./2-deploy-vpc.sh + +# Deploy + +To deploy the application, run `3-deploy.sh`. + + efs-nodejs$ ./3-deploy.sh + Uploading to e678bc216e6a0d510d661ca9ae2fd941 2678 / 2678.0 (100.00%) + Successfully packaged artifacts and wrote output template to file out.yml. + Waiting for changeset to be created.. + Waiting for stack create/update to complete + Successfully created/updated stack - efs-nodejs + +This script uses AWS CloudFormation to deploy the Lambda functions and an IAM role. If the AWS CloudFormation stack that contains the resources already exists, the script updates it with any changes to the template or function code. + +# Test + +To invoke the function with a test event, use the invoke script. + + efs-nodejs$ ./4-invoke.sh + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + {"writeTimeMs":3.316225,"readTimeMs":166.129772,"fileSizeBytes":1398104} + +Let the script invoke the function a few times and then press `CRTL+C` to exit. + +# Cleanup + +To delete the application, run the cleanup script. + + efs-nodejs$ ./5-cleanup.sh diff --git a/sample-apps/efs-nodejs/event.json b/sample-apps/efs-nodejs/event.json new file mode 100644 index 00000000..8fdc7054 --- /dev/null +++ b/sample-apps/efs-nodejs/event.json @@ -0,0 +1,4 @@ +{ + "fileName": "test.bin", + "fileSize": 1048576 +} diff --git a/sample-apps/efs-nodejs/function/index.js b/sample-apps/efs-nodejs/function/index.js new file mode 100644 index 00000000..b35724a4 --- /dev/null +++ b/sample-apps/efs-nodejs/function/index.js @@ -0,0 +1,58 @@ +var fs = require('fs').promises +const crypto = require('crypto') +const dir = process.env.mountPath + +exports.handler = async function(event) { + console.log("EVENT: %s", JSON.stringify(event, null, 2)) + const filePath = dir + "/" + event.fileName + const fileSize = event.fileSize + // generate file + const buffer = await crypto.randomBytes(fileSize) + // write operation + const writeTimeMs = await writeFile(filePath, buffer) + // read file + const readTimeMs = await readFile(filePath) + // stat file + const fileStat = await fs.stat(filePath) + const fileSizeBytes = fileStat.size + console.log("File size: %s bytes", fileSizeBytes) + // format response + var response = { + "writeTimeMs": writeTimeMs, + "readTimeMs": readTimeMs, + "fileSizeBytes": fileSizeBytes + } + return response +} + +var readFile = async function(filePath){ + console.log("Attempting to read file: %s", filePath) + const readstart = process.hrtime() + var fileContents + try { + fileContents = await fs.readFile(filePath, "utf8") + const readend = process.hrtime(readstart) + const readTimeMs = readend[0] * 1000 + readend[1] / 1000000 + console.log("Read completed in %dms", readTimeMs) + return readTimeMs + } catch (error){ + console.error(error) + return "Read error: " + error + } +} + +var writeFile = async function(filePath, buffer){ + console.log("Attempting to write file: %s", filePath) + var writestart = process.hrtime() + try { + const fileBase64 = buffer.toString('base64') + fs.writeFile(filePath, fileBase64) + var writeend = process.hrtime(writestart) + const writeTimeMs = writeend[0] * 1000 + writeend[1] / 1000000 + console.log("Write completed in %dms", writeTimeMs) + return writeTimeMs + } catch (error){ + console.error(error) + return "Write error: " + error + } +} \ No newline at end of file diff --git a/sample-apps/efs-nodejs/template-vpcefs.yml b/sample-apps/efs-nodejs/template-vpcefs.yml new file mode 100644 index 00000000..6eddd588 --- /dev/null +++ b/sample-apps/efs-nodejs/template-vpcefs.yml @@ -0,0 +1,119 @@ +AWSTemplateFormatVersion: 2010-09-09 +Resources: + fileSystem: + Type: AWS::EFS::FileSystem + mountTargetA: + Type: AWS::EFS::MountTarget + Properties: + FileSystemId: !Ref fileSystem + SubnetId: !Ref privateSubnetA + SecurityGroups: + - !GetAtt privateVPC.DefaultSecurityGroup + mountTargetB: + Type: AWS::EFS::MountTarget + Properties: + FileSystemId: !Ref fileSystem + SubnetId: !Ref privateSubnetB + SecurityGroups: + - !GetAtt privateVPC.DefaultSecurityGroup + accessPoint: + Type: AWS::EFS::AccessPoint + Properties: + FileSystemId: !Ref fileSystem + PosixUser: + Uid: "1001" + Gid: "1001" + RootDirectory: + CreationInfo: + OwnerGid: "1001" + OwnerUid: "1001" + Permissions: "755" + Path: "/efs-nodejs-storage" + privateVPC: + Type: AWS::EC2::VPC + Properties: + CidrBlock: 172.31.0.0/16 + Tags: + - Key: Name + Value: !Ref AWS::StackName + privateSubnetA: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref privateVPC + AvailabilityZone: + Fn::Select: + - 0 + - Fn::GetAZs: "" + CidrBlock: 172.31.3.0/24 + MapPublicIpOnLaunch: false + Tags: + - Key: Name + Value: !Join ["-", [!Ref "AWS::StackName","subnet-a"]] + privateSubnetB: + Type: AWS::EC2::Subnet + Properties: + VpcId: !Ref privateVPC + AvailabilityZone: + Fn::Select: + - 1 + - Fn::GetAZs: "" + CidrBlock: 172.31.2.0/24 + MapPublicIpOnLaunch: false + Tags: + - Key: Name + Value: !Join ["-", [!Ref "AWS::StackName","subnet-b"]] + privateRouteTable: + Type: AWS::EC2::RouteTable + Properties: + VpcId: !Ref privateVPC + privateSubnetARouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref privateSubnetA + RouteTableId: !Ref privateRouteTable + privateSubnetBRouteTableAssociation: + Type: AWS::EC2::SubnetRouteTableAssociation + Properties: + SubnetId: !Ref privateSubnetB + RouteTableId: !Ref privateRouteTable +Outputs: + privateVPCSecurityGroup: + Description: Default security for Lambda VPC + Value: !GetAtt privateVPC.DefaultSecurityGroup + Export: + Name: !Join ["-", [!Ref "AWS::StackName","vpc-sg"]] + privateVPCID: + Description: VPC ID + Value: !Ref privateVPC + Export: + Name: !Join ["-", [!Ref "AWS::StackName","vpc"]] + privateSubnetAID: + Description: Private Subnet A ID + Value: !Ref privateSubnetA + Export: + Name: !Join ["-", [!Ref "AWS::StackName","subnet-a"]] + privateSubnetBID: + Description: Private Subnet B ID + Value: !Ref privateSubnetB + Export: + Name: !Join ["-", [!Ref "AWS::StackName","subnet-b"]] + fileSystemId: + Description: File system ID + Value: !Ref fileSystem + Export: + Name: !Join ["-", [!Ref "AWS::StackName","filesystem"]] + mountTargetA: + Description: Mount point A ID + Value: !Ref mountTargetA + Export: + Name: !Join ["-", [!Ref "AWS::StackName","mounttarget-a"]] + mountTargetB: + Description: Mount point B ID + Value: !Ref mountTargetB + Export: + Name: !Join ["-", [!Ref "AWS::StackName","mounttarget-b"]] + accessPointArn: + Description: Access point ARN + Value: !GetAtt accessPoint.Arn + Export: + Name: !Join ["-", [!Ref "AWS::StackName","accesspoint"]] diff --git a/sample-apps/efs-nodejs/template.yml b/sample-apps/efs-nodejs/template.yml new file mode 100644 index 00000000..62293bc0 --- /dev/null +++ b/sample-apps/efs-nodejs/template.yml @@ -0,0 +1,44 @@ +AWSTemplateFormatVersion: 2010-09-09 +Description: An AWS Lambda application that connects to an EFS file system in the VPC to share files. +Transform: AWS::Serverless-2016-10-31 +Parameters: + vpcStackName: + Default: efs-nodejs-vpc + Description: VPC and file system stack name + Type: String + mountPath: + Default: "/mnt/efs0" + Description: File system mount path + Type: String +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: function/. + Description: Use a file system. + FileSystemConfigs: + - LocalMountPath: !Ref mountPath + Arn: + Fn::ImportValue: !Sub "${vpcStackName}-accesspoint" + Environment: + Variables: + mountPath: !Ref mountPath + MemorySize: 128 + Timeout: 15 + Runtime: nodejs12.x + Tracing: Active + Handler: index.handler + VpcConfig: + SecurityGroupIds: + - Fn::ImportValue: + !Sub "${vpcStackName}-vpc-sg" + SubnetIds: + - Fn::ImportValue: + !Sub "${vpcStackName}-subnet-a" + - Fn::ImportValue: + !Sub "${vpcStackName}-subnet-b" + # Function's execution role + Policies: + - AWSLambdaVPCAccessExecutionRole + - AmazonElasticFileSystemClientReadWriteAccess + - AWSXRayDaemonWriteAccess From 646063e398e78627379cc18c5241298d8c41c8c8 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Thu, 18 Jun 2020 04:14:52 +0000 Subject: [PATCH 020/243] EFS sample application, address feedback --- doc_source/build-pipeline.md | 2 +- doc_source/configuration-filesystem.md | 8 +++++++- doc_source/lambda-nodejs.md | 1 + doc_source/lambda-samples.md | 1 + doc_source/with-sns-example.md | 14 +++++++------- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/doc_source/build-pipeline.md b/doc_source/build-pipeline.md index f7954782..b7a07013 100644 --- a/doc_source/build-pipeline.md +++ b/doc_source/build-pipeline.md @@ -229,7 +229,7 @@ During the build stage, AWS CodeBuild needs permission to upload the build outpu 1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. -1. Choose **code\-build\-lamba\-pipeline\-service\-role**\. +1. Choose **codebuild\-lamba\-pipeline\-build\-service\-role**\. 1. Choose **Attach policies**\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index b10f366e..86c346f1 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -30,6 +30,7 @@ For more information about Lambda's integration with Amazon EFS, see [Using Amaz + [Execution role and user permissions](#configuration-filesystem-permissions) + [Configuring file system access with the Lambda API](#configuration-filesystem-api) + [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) ++ [Sample applications](#configuration-filesystem-samples) ## Configuring a file system and access point @@ -132,4 +133,9 @@ You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SA You must add the `DependsOn` to ensure that the mount targets are fully created before the Lambda runs for the first time\. -For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and fields are the same\. For more information, see [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md)\. \ No newline at end of file +For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and fields are the same\. For more information, see [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md)\. + +## Sample applications + +The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index f1449830..92a6800e 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -65,6 +65,7 @@ To get started with application development in your local environment, deploy on [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. +[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 9b97a54e..ca7883f4 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -9,6 +9,7 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. + [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. + [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. + [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. + [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index cf4b6cd7..023343e5 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -21,7 +21,7 @@ In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by ## Create an Amazon SNS topic -From account A, create the source Amazon SNS topic\. +From account A \(01234567891A\), create the source Amazon SNS topic\. ``` $ aws sns create-topic --name lambda-x-account --profile accountA @@ -31,7 +31,7 @@ Note the topic ARN that is returned by the command\. You will need it when you a ## Create the execution role -From account B, create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +From account B \(01234567891B\), create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. **To create an execution role** @@ -48,7 +48,7 @@ The **AWSLambdaBasicExecutionRole** policy has the permissions that the function ## Create a Lambda function -From account B, create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +From account B \(01234567891B\), create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. **Note** For sample code in other languages, see [Sample function code](with-sns-create-package.md)\. @@ -90,7 +90,7 @@ Note the function ARN that is returned by the command\. You will need it when yo ## Set up cross\-account permissions -From account A, grant permission to account B to subscribe to the topic: +From account A \(01234567891A\), grant permission to account B \(01234567891B\) to subscribe to the topic: ``` $ aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ @@ -98,7 +98,7 @@ $ aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ --action-name Subscribe ListSubscriptionsByTopic Receive --profile accountA ``` -From account B, add the Lambda permission to allow invocation from Amazon SNS\. +From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. ``` $ aws lambda add-permission --function-name SNS-X-Account \ @@ -122,7 +122,7 @@ If the account with the SNS topic is hosted in an opt\-in region, you need to sp ## Create a subscription -From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A, Amazon SNS invokes the `SNS-X-Account` function in account B\. +From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A \(01234567891A\), Amazon SNS invokes the `SNS-X-Account` function in account B \(01234567891B\)\. ``` $ aws sns subscribe --protocol lambda \ @@ -138,7 +138,7 @@ The output contains the ARN of the topic subscription\. ## Test subscription -From account A, test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: +From account A \(01234567891A\), test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: ``` $ aws sns publish --message file://message.txt --subject Test \ From 9db7991c203d2ba4a2bafe9ada4708a8936884a3 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 19 Jun 2020 08:21:57 -0700 Subject: [PATCH 021/243] Batch window now available for Kinesis HTTP/2 stream consumers --- doc_source/lambda-releases.md | 1 + doc_source/with-kinesis.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 092429cc..665f4f10 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | | [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 284866e4..328c905f 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -48,7 +48,7 @@ Lambda reads records from the data stream and invokes your function [synchronous If you have multiple applications that are reading records from the same stream, you can use Kinesis stream consumers instead of standard iterators\. Consumers have dedicated read throughput so they don't have to compete with other consumers of the same data\. With consumers, Kinesis pushes records to Lambda over an HTTP/2 connection, which can also reduce latency between adding a record and function invocation\. **Note** -Batch window, error handling, and concurrency settings are not available for HTTP/2 stream consumers\. +Error handling and concurrency settings are not available for HTTP/2 stream consumers\. By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. From 863928d0ae309508ab22f0a7bd049ad8e9fb2510 Mon Sep 17 00:00:00 2001 From: William Armiros <54150514+willarmiros@users.noreply.github.com> Date: Fri, 19 Jun 2020 17:50:47 -0500 Subject: [PATCH 022/243] Include more info on AWS X-Ray --- doc_source/services-xray.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 3030c03f..a9789cc9 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions. In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. @@ -64,6 +64,8 @@ Instead of sending trace data directly to the X\-Ray API, the X\-Ray SDK uses a The Lambda runtime allows the daemon to up to 3 percent of your function's configured memory or 16 MB, whichever is greater\. If your function runs out of memory during invocation, the runtime terminates the daemon process first to free up memory\. +Since the daemon process is fully managed by AWS Lambda, it cannot be configured by the user. This means that all segments generated from Lambda function invocations are recorded in the same account as the Lambda, and the daemon cannot be configured to redirect them to another account. + For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html) in the X\-Ray Developer Guide\. ## Enabling active tracing with the Lambda API @@ -109,4 +111,4 @@ Resources: Properties: Tracing: Active ... -``` \ No newline at end of file +``` From 063d700f019aaa371e46e086d4275f77cb95dd91 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Wed, 24 Jun 2020 18:08:53 -0700 Subject: [PATCH 023/243] Configuration for AWS CLI v2 --- sample-apps/blank-csharp/README.md | 10 +++++++++- sample-apps/blank-go/README.md | 10 +++++++++- sample-apps/blank-java/README.md | 10 +++++++++- sample-apps/blank-nodejs/README.md | 10 +++++++++- sample-apps/blank-powershell/README.md | 10 +++++++++- sample-apps/blank-python/README.md | 10 +++++++++- sample-apps/blank-ruby/README.md | 10 +++++++++- sample-apps/ec2-spot/README.md | 10 +++++++++- sample-apps/efs-nodejs/README.md | 10 +++++++++- sample-apps/error-processor/README.md | 10 +++++++++- sample-apps/java-basic/README.md | 10 +++++++++- sample-apps/java-events-v1sdk/README.md | 10 +++++++++- sample-apps/java-events/README.md | 10 +++++++++- sample-apps/list-manager/README.md | 10 +++++++++- sample-apps/nodejs-apig/README.md | 10 +++++++++- sample-apps/rds-mysql/README.md | 10 +++++++++- sample-apps/s3-java/README.md | 10 +++++++++- 17 files changed, 153 insertions(+), 17 deletions(-) diff --git a/sample-apps/blank-csharp/README.md b/sample-apps/blank-csharp/README.md index 75006ae5..230e901d 100644 --- a/sample-apps/blank-csharp/README.md +++ b/sample-apps/blank-csharp/README.md @@ -14,7 +14,15 @@ Use the following instructions to deploy the sample application. For more inform - [.NET Core SDK 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) - [AWS extensions for .NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-go/README.md b/sample-apps/blank-go/README.md index fc097d12..7a762a0e 100644 --- a/sample-apps/blank-go/README.md +++ b/sample-apps/blank-go/README.md @@ -13,7 +13,15 @@ Use the following instructions to deploy the sample application. # Requirements - [Go executable](https://golang.org/dl/). - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-java/README.md b/sample-apps/blank-java/README.md index ec93d04d..c5d8130d 100644 --- a/sample-apps/blank-java/README.md +++ b/sample-apps/blank-java/README.md @@ -17,7 +17,15 @@ Use the following instructions to deploy the sample application. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-nodejs/README.md b/sample-apps/blank-nodejs/README.md index b1b0854d..9f0136d1 100644 --- a/sample-apps/blank-nodejs/README.md +++ b/sample-apps/blank-nodejs/README.md @@ -23,7 +23,15 @@ Use the following instructions to deploy the sample application. For an in-depth # Requirements - [Node.js 10 with npm](https://nodejs.org/en/download/releases/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-powershell/README.md b/sample-apps/blank-powershell/README.md index 03daf849..3bc829e9 100644 --- a/sample-apps/blank-powershell/README.md +++ b/sample-apps/blank-powershell/README.md @@ -15,7 +15,15 @@ Use the following instructions to deploy the sample application. - [.NET Core 3.1](https://www.microsoft.com/net/download) - [AWSLambdaPSCore module 2.0](https://www.powershellgallery.com/packages/AWSLambdaPSCore/2.0.0.0) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-python/README.md b/sample-apps/blank-python/README.md index 19143adb..d33f2661 100644 --- a/sample-apps/blank-python/README.md +++ b/sample-apps/blank-python/README.md @@ -13,7 +13,15 @@ Use the following instructions to deploy the sample application. # Requirements - [Python 3.7](https://www.python.org/downloads/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/blank-ruby/README.md b/sample-apps/blank-ruby/README.md index 9e5df80d..a34c89de 100644 --- a/sample-apps/blank-ruby/README.md +++ b/sample-apps/blank-ruby/README.md @@ -13,7 +13,15 @@ Use the following instructions to deploy the sample application. # Requirements - [Ruby 2.5](https://www.ruby-lang.org/en/downloads/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/ec2-spot/README.md b/sample-apps/ec2-spot/README.md index b49d9c54..54c635ff 100644 --- a/sample-apps/ec2-spot/README.md +++ b/sample-apps/ec2-spot/README.md @@ -13,7 +13,15 @@ Use the following instructions to deploy the sample application. For more inform # Requirements - [.NET Core SDK 2.1](https://dotnet.microsoft.com/download/dotnet-core/2.1) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/efs-nodejs/README.md b/sample-apps/efs-nodejs/README.md index 0514ee1e..ba3252a1 100644 --- a/sample-apps/efs-nodejs/README.md +++ b/sample-apps/efs-nodejs/README.md @@ -30,7 +30,15 @@ To deploy the sample application, you need the following tools: - [Node.js 10 with npm](https://nodejs.org/en/download/releases/). - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. To run the sample application in AWS, you need permission to use Lambda and the following services. diff --git a/sample-apps/error-processor/README.md b/sample-apps/error-processor/README.md index 7ae0de8f..76fc4dbd 100644 --- a/sample-apps/error-processor/README.md +++ b/sample-apps/error-processor/README.md @@ -16,7 +16,15 @@ Use the following instructions to deploy the sample application. For more inform # Requirements - [Node.js 10 with npm](https://nodejs.org/en/download/releases/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/java-basic/README.md b/sample-apps/java-basic/README.md index 8885600c..2eac0425 100644 --- a/sample-apps/java-basic/README.md +++ b/sample-apps/java-basic/README.md @@ -16,7 +16,15 @@ Use the following instructions to deploy the sample application. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/java-events-v1sdk/README.md b/sample-apps/java-events-v1sdk/README.md index 3d9ab2ed..31e42f6d 100644 --- a/sample-apps/java-events-v1sdk/README.md +++ b/sample-apps/java-events-v1sdk/README.md @@ -18,7 +18,15 @@ Use the following instructions to deploy the sample application. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index 5b72d742..48533a0e 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -18,7 +18,15 @@ Use the following instructions to deploy the sample application. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/list-manager/README.md b/sample-apps/list-manager/README.md index 53c8aef3..4caa983a 100644 --- a/sample-apps/list-manager/README.md +++ b/sample-apps/list-manager/README.md @@ -43,7 +43,15 @@ To deploy the sample application, you need the following tools: - [Node.js 10 with npm](https://nodejs.org/en/download/releases/). - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. To run the sample application in AWS, you need permission to use Lambda and the following services: diff --git a/sample-apps/nodejs-apig/README.md b/sample-apps/nodejs-apig/README.md index 15e689e4..65ff46c3 100644 --- a/sample-apps/nodejs-apig/README.md +++ b/sample-apps/nodejs-apig/README.md @@ -17,7 +17,15 @@ Use the following instructions to deploy the sample application. # Requirements - [Node.js 10 with npm](https://nodejs.org/en/download/releases/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index f0b73fc8..c1d82810 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -32,7 +32,15 @@ To deploy the sample application, you need the following tools: - [Node.js 10 with npm](https://nodejs.org/en/download/releases/). - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. To run the sample application in AWS, you need permission to use Lambda and the following services. diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index 1ddcd98d..431ac34e 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -17,7 +17,15 @@ Use the following instructions to deploy the sample application. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI v1](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html). +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. # Setup Download or clone this repository. From 3c22cf79b3dae0ca307720b776fb3f31a0cba561 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 29 Jun 2020 14:20:46 -0700 Subject: [PATCH 024/243] various small updates and corrections --- doc_source/API_CreateEventSourceMapping.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 2 +- doc_source/csharp-handler.md | 5 +++++ doc_source/python-logging.md | 2 -- doc_source/with-ddb.md | 2 +- doc_source/with-kinesis.md | 4 ++-- doc_source/with-sqs.md | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 4a1021e7..93e0e48e 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -71,7 +71,7 @@ Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** -Disables the event source mapping to pause polling and invocation\. +If true, the event source mapping is active\. Set to false to pause polling and invocation\. Type: Boolean Required: No diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 5eeedeb7..7b16b933 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -67,7 +67,7 @@ Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** -Disables the event source mapping to pause polling and invocation\. +If true, the event source mapping is active\. Set to false to pause polling and invocation\. Type: Boolean Required: No diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 36a2cdfe..77ebef7a 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -90,6 +90,9 @@ public class ProductService{ } ``` +**Note** +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. + ## Handler signatures When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: @@ -127,6 +130,8 @@ If the method specified in your handler string is overloaded, you must provide t For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: + Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. +**Note** +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index bb6f6150..ab4edb47 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -7,7 +7,6 @@ To output logs from your function code, you can use [the `print` method](https:/ **Example lambda\_function\.py** ``` -import json import os def lambda_handler(event, context): @@ -154,7 +153,6 @@ Log groups aren't deleted automatically when you delete a function\. To avoid st For more detailed logs, use the [logging library](https://docs.python.org/3/library/logging.html)\. ``` -import json import os import logging logger = logging.getLogger() diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index c2b30994..10579b54 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -137,7 +137,7 @@ Lambda supports the following options for DynamoDB event sources\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. + **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. -+ **Enabled** – Disable the event source to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. ++ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. **Note** DynamoDB charges for read requests that Lambda makes to get records from the stream\. For pricing details, see [Amazon DynamoDB pricing](https://aws.amazon.com/dynamodb/pricing)\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 328c905f..80fb1969 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -69,7 +69,7 @@ You can also increase concurrency by processing multiple batches from each shard ## Configuring your data stream and function -Your Lambda function is a consumer application for your data stream\. It processes one batch of records at a time from each shard\. You can map a Lambda function to a data stream \(standard iterator\), or to a consumer of a stream \([enhanced fan\-out](https://docs.aws.amazon.com/kinesis/latest/dev/introduction-to-enhanced-consumers.html)\)\. +Your Lambda function is a consumer application for your data stream\. It processes one batch of records at a time from each shard\. You can map a Lambda function to a data stream \(standard iterator\), or to a consumer of a stream \([enhanced fan\-out](https://docs.aws.amazon.com/kinesis/latest/dev/enhanced-consumers.html)\)\. For standard iterators, Lambda polls each shard in your Kinesis stream for records at a base rate of once per second\. When more records are available, Lambda keeps processing batches until the function catches up with the stream\. The event source mapping shares read throughput with other consumers of the shard\. @@ -147,7 +147,7 @@ Lambda supports the following options for Kinesis event sources\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. + **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. -+ **Enabled** – Disable the event source to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. ++ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. **Note** Kinesis charges for each shard and, for enhanced fan\-out, data read from the stream\. For pricing details, see [Amazon Kinesis pricing](https://aws.amazon.com/kinesis/data-streams/pricing)\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 0f1e845e..a6d72b14 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -130,7 +130,7 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. + **Batch size** – The number of items to read from the queue in each batch, up to 10\. The event might contain fewer items if the batch that Lambda read from the queue had fewer items\. -+ **Enabled** – Disable the event source to stop processing items\. ++ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon Simple Queue Service pricing](https://aws.amazon.com/sqs/pricing)\. From c3685e00300200fc5a5c4bd8c5eb15e096124dbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:32:07 +0000 Subject: [PATCH 025/243] Bump log4j-core from 2.13.0 to 2.13.2 in /sample-apps/blank-java Bumps log4j-core from 2.13.0 to 2.13.2. Signed-off-by: dependabot[bot] --- sample-apps/blank-java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index b5c9d487..b1b40871 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.13.0 + 2.13.2 org.apache.logging.log4j From 2dd7a5464298726c5b26a95fd48f538e6f7708a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:34:03 +0000 Subject: [PATCH 026/243] Bump log4j-core from 2.13.0 to 2.13.2 in /sample-apps/java-basic Bumps log4j-core from 2.13.0 to 2.13.2. Signed-off-by: dependabot[bot] --- sample-apps/java-basic/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 83b6cd05..721a9cf7 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -31,7 +31,7 @@ org.apache.logging.log4j log4j-core - 2.13.0 + 2.13.2 test From a2a7e6675b1c338a9a8a2dda6097c5a61d506c17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:35:09 +0000 Subject: [PATCH 027/243] Bump log4j-core from 2.13.0 to 2.13.2 in /sample-apps/java-events Bumps log4j-core from 2.13.0 to 2.13.2. Signed-off-by: dependabot[bot] --- sample-apps/java-events/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 22df1f42..ec6141b0 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -36,7 +36,7 @@ org.apache.logging.log4j log4j-core - 2.13.0 + 2.13.2 test From bffc108727b5b05fbef52e8f008b78c9b5dc4b64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:36:33 +0000 Subject: [PATCH 028/243] Bump log4j-core from 2.13.0 to 2.13.2 in /sample-apps/java-events-v1sdk Bumps log4j-core from 2.13.0 to 2.13.2. Signed-off-by: dependabot[bot] --- sample-apps/java-events-v1sdk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index ded5248b..a5a095b8 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.13.0 + 2.13.2 org.apache.logging.log4j From 0d43964eb2084b04757e7a2eaad9b07739a569b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2020 19:37:19 +0000 Subject: [PATCH 029/243] Bump log4j-core from 2.13.0 to 2.13.2 in /sample-apps/s3-java Bumps log4j-core from 2.13.0 to 2.13.2. Signed-off-by: dependabot[bot] --- sample-apps/s3-java/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index ce4b7f06..b82a458e 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.13.0 + 2.13.2 org.apache.logging.log4j From 1e4ca33d77a68c9d5916a620bd88562fff91a297 Mon Sep 17 00:00:00 2001 From: Ali Vest <39536148+alivest@users.noreply.github.com> Date: Wed, 19 Aug 2020 11:43:15 -0700 Subject: [PATCH 030/243] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4d307c17..bd5728f6 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,7 @@ Table of contents: [index.md](/doc_source/index.md) The documentation is made available under the Creative Commons Attribution-ShareAlike 4.0 International License. See the [LICENSE](./LICENSE) file. The sample code within this documentation is made available under a modified MIT license. See the [LICENSE-SAMPLECODE](./LICENSE-SAMPLECODE) file. + +## Default branch +The default branch for this repo has changed to `main`. +If you have cloned the previous default branch, please update your local repo to use the `main` branch. From 613f6dc09e302fe5590a209e3bed7e9d9258e541 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Wed, 19 Aug 2020 18:54:12 +0000 Subject: [PATCH 031/243] Periodic update --- doc_source/API_AddLayerVersionPermission.md | 12 +- doc_source/API_AddPermission.md | 16 +- doc_source/API_CreateAlias.md | 24 +- doc_source/API_CreateEventSourceMapping.md | 102 ++++---- doc_source/API_CreateFunction.md | 136 +++++------ doc_source/API_DeleteEventSourceMapping.md | 48 ++-- .../API_EventSourceMappingConfiguration.md | 12 +- doc_source/API_GetAccountSettings.md | 18 +- doc_source/API_GetAlias.md | 14 +- doc_source/API_GetEventSourceMapping.md | 48 ++-- doc_source/API_GetFunction.md | 94 ++++---- doc_source/API_GetFunctionConcurrency.md | 2 +- doc_source/API_GetFunctionConfiguration.md | 80 +++---- .../API_GetFunctionEventInvokeConfig.md | 18 +- doc_source/API_GetLayerVersion.md | 22 +- doc_source/API_GetLayerVersionByArn.md | 22 +- doc_source/API_GetLayerVersionPolicy.md | 4 +- doc_source/API_GetPolicy.md | 4 +- .../API_GetProvisionedConcurrencyConfig.md | 12 +- doc_source/API_ListAliases.md | 18 +- doc_source/API_ListEventSourceMappings.md | 42 ++-- .../API_ListFunctionEventInvokeConfigs.md | 22 +- doc_source/API_ListFunctions.md | 84 +++---- doc_source/API_ListLayerVersions.md | 16 +- doc_source/API_ListLayers.md | 22 +- .../API_ListProvisionedConcurrencyConfigs.md | 18 +- doc_source/API_ListTags.md | 2 +- doc_source/API_ListVersionsByFunction.md | 84 +++---- doc_source/API_PublishLayerVersion.md | 38 +-- doc_source/API_PublishVersion.md | 86 +++---- doc_source/API_PutFunctionConcurrency.md | 4 +- .../API_PutFunctionEventInvokeConfig.md | 32 +-- .../API_PutProvisionedConcurrencyConfig.md | 14 +- doc_source/API_TagResource.md | 2 +- doc_source/API_UpdateAlias.md | 24 +- doc_source/API_UpdateEventSourceMapping.md | 83 ++++--- doc_source/API_UpdateFunctionCode.md | 94 ++++---- doc_source/API_UpdateFunctionConfiguration.md | 122 +++++----- .../API_UpdateFunctionEventInvokeConfig.md | 32 +-- doc_source/access-control-identity-based.md | 9 +- doc_source/applications-tutorial.md | 2 +- doc_source/best-practices.md | 4 +- doc_source/configuration-concurrency.md | 8 +- doc_source/configuration-filesystem.md | 55 ++++- doc_source/configuration-layers.md | 2 +- doc_source/configuration-vpc.md | 223 ++++++++++++++++-- doc_source/csharp-tracing.md | 2 +- doc_source/getting-started-create-function.md | 2 +- doc_source/getting-started.md | 2 +- doc_source/gettingstarted-concepts.md | 4 +- doc_source/gettingstarted-limits.md | 35 ++- doc_source/golang-package.md | 3 + doc_source/golang-tracing.md | 2 +- doc_source/index.md | 3 +- doc_source/invocation-eventsourcemapping.md | 3 +- doc_source/invocation-scaling.md | 4 +- doc_source/java-tracing.md | 2 +- doc_source/lambda-api-permissions-ref.md | 5 +- doc_source/lambda-intro-execution-role.md | 6 +- doc_source/lambda-java.md | 1 + doc_source/lambda-nodejs.md | 4 +- doc_source/lambda-python.md | 10 +- doc_source/lambda-releases.md | 8 +- doc_source/lambda-runtimes.md | 14 +- doc_source/lambda-services.md | 3 +- doc_source/logging-using-cloudtrail.md | 31 ++- doc_source/monitoring-metrics.md | 2 +- doc_source/nodejs-package.md | 6 +- doc_source/nodejs-tracing.md | 2 +- doc_source/python-logging.md | 2 +- doc_source/python-package.md | 2 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-tracing.md | 2 +- doc_source/runtimes-context.md | 2 +- doc_source/samples-blank.md | 2 +- doc_source/security-resilience.md | 2 +- doc_source/services-apigateway-tutorial.md | 8 +- doc_source/services-efs.md | 4 +- doc_source/services-xray.md | 6 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/with-ddb.md | 4 +- doc_source/with-kinesis.md | 28 ++- doc_source/with-msk.md | 164 +++++++++++++ doc_source/with-s3-example.md | 10 +- doc_source/with-sqs-example.md | 2 +- 85 files changed, 1364 insertions(+), 862 deletions(-) create mode 100644 doc_source/with-msk.md diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index 53f38b1b..cb84d5e2 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -11,10 +11,10 @@ POST /2018-10-31/layers/LayerName/versions/VersionNumber/policy?RevisionId=Revis Content-type: application/json { - "[Action](#SSS-AddLayerVersionPermission-request-Action)": "string", - "[OrganizationId](#SSS-AddLayerVersionPermission-request-OrganizationId)": "string", - "[Principal](#SSS-AddLayerVersionPermission-request-Principal)": "string", - "[StatementId](#SSS-AddLayerVersionPermission-request-StatementId)": "string" + "Action": "string", + "OrganizationId": "string", + "Principal": "string", + "StatementId": "string" } ``` @@ -71,8 +71,8 @@ HTTP/1.1 201 Content-type: application/json { - "[RevisionId](#SSS-AddLayerVersionPermission-response-RevisionId)": "string", - "[Statement](#SSS-AddLayerVersionPermission-response-Statement)": "string" + "RevisionId": "string", + "Statement": "string" } ``` diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index 703a50e5..35f57f17 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -13,13 +13,13 @@ POST /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 Content-type: application/json { - "[Action](#SSS-AddPermission-request-Action)": "string", - "[EventSourceToken](#SSS-AddPermission-request-EventSourceToken)": "string", - "[Principal](#SSS-AddPermission-request-Principal)": "string", - "[RevisionId](#SSS-AddPermission-request-RevisionId)": "string", - "[SourceAccount](#SSS-AddPermission-request-SourceAccount)": "string", - "[SourceArn](#SSS-AddPermission-request-SourceArn)": "string", - "[StatementId](#SSS-AddPermission-request-StatementId)": "string" + "Action": "string", + "EventSourceToken": "string", + "Principal": "string", + "RevisionId": "string", + "SourceAccount": "string", + "SourceArn": "string", + "StatementId": "string" } ``` @@ -98,7 +98,7 @@ HTTP/1.1 201 Content-type: application/json { - "[Statement](#SSS-AddPermission-response-Statement)": "string" + "Statement": "string" } ``` diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 31bbf7cf..0bef67af 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -11,11 +11,11 @@ POST /2015-03-31/functions/FunctionName/aliases HTTP/1.1 Content-type: application/json { - "[Description](#SSS-CreateAlias-request-Description)": "string", - "[FunctionVersion](#SSS-CreateAlias-request-FunctionVersion)": "string", - "[Name](#SSS-CreateAlias-request-Name)": "string", - "[RoutingConfig](#SSS-CreateAlias-request-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "Description": "string", + "FunctionVersion": "string", + "Name": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } @@ -74,13 +74,13 @@ HTTP/1.1 201 Content-type: application/json { - "[AliasArn](#SSS-CreateAlias-response-AliasArn)": "string", - "[Description](#SSS-CreateAlias-response-Description)": "string", - "[FunctionVersion](#SSS-CreateAlias-response-FunctionVersion)": "string", - "[Name](#SSS-CreateAlias-response-Name)": "string", - "[RevisionId](#SSS-CreateAlias-response-RevisionId)": "string", - "[RoutingConfig](#SSS-CreateAlias-response-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "AliasArn": "string", + "Description": "string", + "FunctionVersion": "string", + "Name": "string", + "RevisionId": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 93e0e48e..b510242c 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -6,12 +6,13 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) + [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html) + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) ++ [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. -+ `MaximumRecordAgeInSeconds` \- Discard records older than the specified age\. -+ `MaximumRetryAttempts` \- Discard records after the specified number of retries\. ++ `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 ++ `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\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. ## Request Syntax @@ -21,25 +22,26 @@ POST /2015-03-31/event-source-mappings/ HTTP/1.1 Content-type: application/json { - "[BatchSize](#SSS-CreateEventSourceMapping-request-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-CreateEventSourceMapping-request-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-CreateEventSourceMapping-request-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[Enabled](#SSS-CreateEventSourceMapping-request-Enabled)": boolean, - "[EventSourceArn](#SSS-CreateEventSourceMapping-request-EventSourceArn)": "string", - "[FunctionName](#SSS-CreateEventSourceMapping-request-FunctionName)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-CreateEventSourceMapping-request-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-CreateEventSourceMapping-request-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-CreateEventSourceMapping-request-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-CreateEventSourceMapping-request-ParallelizationFactor)": number, - "[StartingPosition](#SSS-CreateEventSourceMapping-request-StartingPosition)": "string", - "[StartingPositionTimestamp](#SSS-CreateEventSourceMapping-request-StartingPositionTimestamp)": number + "Enabled": boolean, + "EventSourceArn": "string", + "FunctionName": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "StartingPosition": "string", + "StartingPositionTimestamp": number, + "Topics": [ "string" ] } ``` @@ -56,6 +58,7 @@ The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -80,6 +83,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. + **Amazon Simple Queue Service** \- The ARN of the queue\. ++ **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: Yes @@ -105,13 +109,13 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. Required: No @@ -123,7 +127,7 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis and Amazon DynamoDB Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No @@ -131,6 +135,14 @@ Required: No ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp +Required: No + + ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No ## Response Syntax @@ -140,27 +152,28 @@ HTTP/1.1 202 Content-type: application/json { - "[BatchSize](#SSS-CreateEventSourceMapping-response-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-CreateEventSourceMapping-response-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-CreateEventSourceMapping-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[EventSourceArn](#SSS-CreateEventSourceMapping-response-EventSourceArn)": "string", - "[FunctionArn](#SSS-CreateEventSourceMapping-response-FunctionArn)": "string", - "[LastModified](#SSS-CreateEventSourceMapping-response-LastModified)": number, - "[LastProcessingResult](#SSS-CreateEventSourceMapping-response-LastProcessingResult)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-CreateEventSourceMapping-response-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-CreateEventSourceMapping-response-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-CreateEventSourceMapping-response-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-CreateEventSourceMapping-response-ParallelizationFactor)": number, - "[State](#SSS-CreateEventSourceMapping-response-State)": "string", - "[StateTransitionReason](#SSS-CreateEventSourceMapping-response-StateTransitionReason)": "string", - "[UUID](#SSS-CreateEventSourceMapping-response-UUID)": "string" + "EventSourceArn": "string", + "FunctionArn": "string", + "LastModified": number, + "LastProcessingResult": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "State": "string", + "StateTransitionReason": "string", + "Topics": [ "string" ], + "UUID": "string" } ``` @@ -207,12 +220,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. @@ -229,6 +242,13 @@ Type: String Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. Type: String + ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 99d61f32..d5dc6cf0 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -19,45 +19,45 @@ POST /2015-03-31/functions HTTP/1.1 Content-type: application/json { - "[Code](#SSS-CreateFunction-request-Code)": { - "[S3Bucket](API_FunctionCode.md#SSS-Type-FunctionCode-S3Bucket)": "string", - "[S3Key](API_FunctionCode.md#SSS-Type-FunctionCode-S3Key)": "string", - "[S3ObjectVersion](API_FunctionCode.md#SSS-Type-FunctionCode-S3ObjectVersion)": "string", - "[ZipFile](API_FunctionCode.md#SSS-Type-FunctionCode-ZipFile)": blob + "Code": { + "S3Bucket": "string", + "S3Key": "string", + "S3ObjectVersion": "string", + "ZipFile": blob }, - "[DeadLetterConfig](#SSS-CreateFunction-request-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-CreateFunction-request-Description)": "string", - "[Environment](#SSS-CreateFunction-request-Environment)": { - "[Variables](API_Environment.md#SSS-Type-Environment-Variables)": { + "Description": "string", + "Environment": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-CreateFunction-request-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionName](#SSS-CreateFunction-request-FunctionName)": "string", - "[Handler](#SSS-CreateFunction-request-Handler)": "string", - "[KMSKeyArn](#SSS-CreateFunction-request-KMSKeyArn)": "string", - "[Layers](#SSS-CreateFunction-request-Layers)": [ "string" ], - "[MemorySize](#SSS-CreateFunction-request-MemorySize)": number, - "[Publish](#SSS-CreateFunction-request-Publish)": boolean, - "[Role](#SSS-CreateFunction-request-Role)": "string", - "[Runtime](#SSS-CreateFunction-request-Runtime)": "string", - "[Tags](#SSS-CreateFunction-request-Tags)": { + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "Layers": [ "string" ], + "MemorySize": number, + "Publish": boolean, + "Role": "string", + "Runtime": "string", + "Tags": { "string" : "string" }, - "[Timeout](#SSS-CreateFunction-request-Timeout)": number, - "[TracingConfig](#SSS-CreateFunction-request-TracingConfig)": { - "[Mode](API_TracingConfig.md#SSS-Type-TracingConfig-Mode)": "string" + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[VpcConfig](#SSS-CreateFunction-request-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfig.md#SSS-Type-VpcConfig-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfig.md#SSS-Type-VpcConfig-SubnetIds)": [ "string" ] + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ] } } ``` @@ -181,58 +181,58 @@ HTTP/1.1 201 Content-type: application/json { - "[CodeSha256](#SSS-CreateFunction-response-CodeSha256)": "string", - "[CodeSize](#SSS-CreateFunction-response-CodeSize)": number, - "[DeadLetterConfig](#SSS-CreateFunction-response-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-CreateFunction-response-Description)": "string", - "[Environment](#SSS-CreateFunction-response-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-CreateFunction-response-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](#SSS-CreateFunction-response-FunctionArn)": "string", - "[FunctionName](#SSS-CreateFunction-response-FunctionName)": "string", - "[Handler](#SSS-CreateFunction-response-Handler)": "string", - "[KMSKeyArn](#SSS-CreateFunction-response-KMSKeyArn)": "string", - "[LastModified](#SSS-CreateFunction-response-LastModified)": "string", - "[LastUpdateStatus](#SSS-CreateFunction-response-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](#SSS-CreateFunction-response-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](#SSS-CreateFunction-response-LastUpdateStatusReasonCode)": "string", - "[Layers](#SSS-CreateFunction-response-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](#SSS-CreateFunction-response-MasterArn)": "string", - "[MemorySize](#SSS-CreateFunction-response-MemorySize)": number, - "[RevisionId](#SSS-CreateFunction-response-RevisionId)": "string", - "[Role](#SSS-CreateFunction-response-Role)": "string", - "[Runtime](#SSS-CreateFunction-response-Runtime)": "string", - "[State](#SSS-CreateFunction-response-State)": "string", - "[StateReason](#SSS-CreateFunction-response-StateReason)": "string", - "[StateReasonCode](#SSS-CreateFunction-response-StateReasonCode)": "string", - "[Timeout](#SSS-CreateFunction-response-Timeout)": number, - "[TracingConfig](#SSS-CreateFunction-response-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](#SSS-CreateFunction-response-Version)": "string", - "[VpcConfig](#SSS-CreateFunction-response-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ``` diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 601c99cc..1519f107 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -29,27 +29,28 @@ HTTP/1.1 202 Content-type: application/json { - "[BatchSize](#SSS-DeleteEventSourceMapping-response-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-DeleteEventSourceMapping-response-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-DeleteEventSourceMapping-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[EventSourceArn](#SSS-DeleteEventSourceMapping-response-EventSourceArn)": "string", - "[FunctionArn](#SSS-DeleteEventSourceMapping-response-FunctionArn)": "string", - "[LastModified](#SSS-DeleteEventSourceMapping-response-LastModified)": number, - "[LastProcessingResult](#SSS-DeleteEventSourceMapping-response-LastProcessingResult)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-DeleteEventSourceMapping-response-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-DeleteEventSourceMapping-response-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-DeleteEventSourceMapping-response-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-DeleteEventSourceMapping-response-ParallelizationFactor)": number, - "[State](#SSS-DeleteEventSourceMapping-response-State)": "string", - "[StateTransitionReason](#SSS-DeleteEventSourceMapping-response-StateTransitionReason)": "string", - "[UUID](#SSS-DeleteEventSourceMapping-response-UUID)": "string" + "EventSourceArn": "string", + "FunctionArn": "string", + "LastModified": number, + "LastProcessingResult": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "State": "string", + "StateTransitionReason": "string", + "Topics": [ "string" ], + "UUID": "string" } ``` @@ -96,12 +97,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. @@ -118,6 +119,13 @@ Type: String Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. Type: String + ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index f3682266..4e6ffa45 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -49,13 +49,13 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No **MaximumRecordAgeInSeconds** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. Required: No @@ -74,6 +74,14 @@ Required: No **StateTransitionReason** Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. Type: String +Required: No + + **Topics** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No **UUID** diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index 66703fc2..e87f8194 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -23,16 +23,16 @@ HTTP/1.1 200 Content-type: application/json { - "[AccountLimit](#SSS-GetAccountSettings-response-AccountLimit)": { - "[CodeSizeUnzipped](API_AccountLimit.md#SSS-Type-AccountLimit-CodeSizeUnzipped)": number, - "[CodeSizeZipped](API_AccountLimit.md#SSS-Type-AccountLimit-CodeSizeZipped)": number, - "[ConcurrentExecutions](API_AccountLimit.md#SSS-Type-AccountLimit-ConcurrentExecutions)": number, - "[TotalCodeSize](API_AccountLimit.md#SSS-Type-AccountLimit-TotalCodeSize)": number, - "[UnreservedConcurrentExecutions](API_AccountLimit.md#SSS-Type-AccountLimit-UnreservedConcurrentExecutions)": number + "AccountLimit": { + "CodeSizeUnzipped": number, + "CodeSizeZipped": number, + "ConcurrentExecutions": number, + "TotalCodeSize": number, + "UnreservedConcurrentExecutions": number }, - "[AccountUsage](#SSS-GetAccountSettings-response-AccountUsage)": { - "[FunctionCount](API_AccountUsage.md#SSS-Type-AccountUsage-FunctionCount)": number, - "[TotalCodeSize](API_AccountUsage.md#SSS-Type-AccountUsage-TotalCodeSize)": number + "AccountUsage": { + "FunctionCount": number, + "TotalCodeSize": number } } ``` diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index 5a7e9ec9..4b13be19 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -41,13 +41,13 @@ HTTP/1.1 200 Content-type: application/json { - "[AliasArn](#SSS-GetAlias-response-AliasArn)": "string", - "[Description](#SSS-GetAlias-response-Description)": "string", - "[FunctionVersion](#SSS-GetAlias-response-FunctionVersion)": "string", - "[Name](#SSS-GetAlias-response-Name)": "string", - "[RevisionId](#SSS-GetAlias-response-RevisionId)": "string", - "[RoutingConfig](#SSS-GetAlias-response-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "AliasArn": "string", + "Description": "string", + "FunctionVersion": "string", + "Name": "string", + "RevisionId": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index ea3fe46c..d34f0505 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -27,27 +27,28 @@ HTTP/1.1 200 Content-type: application/json { - "[BatchSize](#SSS-GetEventSourceMapping-response-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-GetEventSourceMapping-response-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-GetEventSourceMapping-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[EventSourceArn](#SSS-GetEventSourceMapping-response-EventSourceArn)": "string", - "[FunctionArn](#SSS-GetEventSourceMapping-response-FunctionArn)": "string", - "[LastModified](#SSS-GetEventSourceMapping-response-LastModified)": number, - "[LastProcessingResult](#SSS-GetEventSourceMapping-response-LastProcessingResult)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-GetEventSourceMapping-response-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-GetEventSourceMapping-response-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-GetEventSourceMapping-response-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-GetEventSourceMapping-response-ParallelizationFactor)": number, - "[State](#SSS-GetEventSourceMapping-response-State)": "string", - "[StateTransitionReason](#SSS-GetEventSourceMapping-response-StateTransitionReason)": "string", - "[UUID](#SSS-GetEventSourceMapping-response-UUID)": "string" + "EventSourceArn": "string", + "FunctionArn": "string", + "LastModified": number, + "LastProcessingResult": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "State": "string", + "StateTransitionReason": "string", + "Topics": [ "string" ], + "UUID": "string" } ``` @@ -94,12 +95,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. @@ -116,6 +117,13 @@ Type: String Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. Type: String + ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index fd83505a..247f695e 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -40,69 +40,69 @@ HTTP/1.1 200 Content-type: application/json { - "[Code](#SSS-GetFunction-response-Code)": { - "[Location](API_FunctionCodeLocation.md#SSS-Type-FunctionCodeLocation-Location)": "string", - "[RepositoryType](API_FunctionCodeLocation.md#SSS-Type-FunctionCodeLocation-RepositoryType)": "string" + "Code": { + "Location": "string", + "RepositoryType": "string" }, - "[Concurrency](#SSS-GetFunction-response-Concurrency)": { - "[ReservedConcurrentExecutions](API_Concurrency.md#SSS-Type-Concurrency-ReservedConcurrentExecutions)": number + "Concurrency": { + "ReservedConcurrentExecutions": number }, - "[Configuration](#SSS-GetFunction-response-Configuration)": { - "[CodeSha256](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSha256)": "string", - "[CodeSize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSize)": number, - "[DeadLetterConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "Configuration": { + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Description)": "string", - "[Environment](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", - "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", - "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", - "[KMSKeyArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-KMSKeyArn)": "string", - "[LastModified](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastModified)": "string", - "[LastUpdateStatus](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReasonCode)": "string", - "[Layers](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MasterArn)": "string", - "[MemorySize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MemorySize)": number, - "[RevisionId](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-RevisionId)": "string", - "[Role](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Role)": "string", - "[Runtime](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Runtime)": "string", - "[State](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-State)": "string", - "[StateReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReason)": "string", - "[StateReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReasonCode)": "string", - "[Timeout](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Timeout)": number, - "[TracingConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Version)": "string", - "[VpcConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } }, - "[Tags](#SSS-GetFunction-response-Tags)": { + "Tags": { "string" : "string" } } diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index b870817f..c0e7e63a 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -35,7 +35,7 @@ HTTP/1.1 200 Content-type: application/json { - "[ReservedConcurrentExecutions](#SSS-GetFunctionConcurrency-response-ReservedConcurrentExecutions)": number + "ReservedConcurrentExecutions": number } ``` diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 820049fc..2c53758b 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -42,58 +42,58 @@ HTTP/1.1 200 Content-type: application/json { - "[CodeSha256](#SSS-GetFunctionConfiguration-response-CodeSha256)": "string", - "[CodeSize](#SSS-GetFunctionConfiguration-response-CodeSize)": number, - "[DeadLetterConfig](#SSS-GetFunctionConfiguration-response-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-GetFunctionConfiguration-response-Description)": "string", - "[Environment](#SSS-GetFunctionConfiguration-response-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-GetFunctionConfiguration-response-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](#SSS-GetFunctionConfiguration-response-FunctionArn)": "string", - "[FunctionName](#SSS-GetFunctionConfiguration-response-FunctionName)": "string", - "[Handler](#SSS-GetFunctionConfiguration-response-Handler)": "string", - "[KMSKeyArn](#SSS-GetFunctionConfiguration-response-KMSKeyArn)": "string", - "[LastModified](#SSS-GetFunctionConfiguration-response-LastModified)": "string", - "[LastUpdateStatus](#SSS-GetFunctionConfiguration-response-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](#SSS-GetFunctionConfiguration-response-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode)": "string", - "[Layers](#SSS-GetFunctionConfiguration-response-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](#SSS-GetFunctionConfiguration-response-MasterArn)": "string", - "[MemorySize](#SSS-GetFunctionConfiguration-response-MemorySize)": number, - "[RevisionId](#SSS-GetFunctionConfiguration-response-RevisionId)": "string", - "[Role](#SSS-GetFunctionConfiguration-response-Role)": "string", - "[Runtime](#SSS-GetFunctionConfiguration-response-Runtime)": "string", - "[State](#SSS-GetFunctionConfiguration-response-State)": "string", - "[StateReason](#SSS-GetFunctionConfiguration-response-StateReason)": "string", - "[StateReasonCode](#SSS-GetFunctionConfiguration-response-StateReasonCode)": "string", - "[Timeout](#SSS-GetFunctionConfiguration-response-Timeout)": number, - "[TracingConfig](#SSS-GetFunctionConfiguration-response-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](#SSS-GetFunctionConfiguration-response-Version)": "string", - "[VpcConfig](#SSS-GetFunctionConfiguration-response-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ``` diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index a25069cf..171a7824 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -42,18 +42,18 @@ HTTP/1.1 200 Content-type: application/json { - "[DestinationConfig](#SSS-GetFunctionEventInvokeConfig-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[FunctionArn](#SSS-GetFunctionEventInvokeConfig-response-FunctionArn)": "string", - "[LastModified](#SSS-GetFunctionEventInvokeConfig-response-LastModified)": number, - "[MaximumEventAgeInSeconds](#SSS-GetFunctionEventInvokeConfig-response-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-GetFunctionEventInvokeConfig-response-MaximumRetryAttempts)": number + "FunctionArn": "string", + "LastModified": number, + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ``` diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index faf71be3..536b6eef 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -33,18 +33,18 @@ HTTP/1.1 200 Content-type: application/json { - "[CompatibleRuntimes](#SSS-GetLayerVersion-response-CompatibleRuntimes)": [ "string" ], - "[Content](#SSS-GetLayerVersion-response-Content)": { - "[CodeSha256](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSha256)": "string", - "[CodeSize](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSize)": number, - "[Location](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-Location)": "string" + "CompatibleRuntimes": [ "string" ], + "Content": { + "CodeSha256": "string", + "CodeSize": number, + "Location": "string" }, - "[CreatedDate](#SSS-GetLayerVersion-response-CreatedDate)": "string", - "[Description](#SSS-GetLayerVersion-response-Description)": "string", - "[LayerArn](#SSS-GetLayerVersion-response-LayerArn)": "string", - "[LayerVersionArn](#SSS-GetLayerVersion-response-LayerVersionArn)": "string", - "[LicenseInfo](#SSS-GetLayerVersion-response-LicenseInfo)": "string", - "[Version](#SSS-GetLayerVersion-response-Version)": number + "CreatedDate": "string", + "Description": "string", + "LayerArn": "string", + "LayerVersionArn": "string", + "LicenseInfo": "string", + "Version": number } ``` diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 04fb2bde..d0b8fba7 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -29,18 +29,18 @@ HTTP/1.1 200 Content-type: application/json { - "[CompatibleRuntimes](#SSS-GetLayerVersionByArn-response-CompatibleRuntimes)": [ "string" ], - "[Content](#SSS-GetLayerVersionByArn-response-Content)": { - "[CodeSha256](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSha256)": "string", - "[CodeSize](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSize)": number, - "[Location](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-Location)": "string" + "CompatibleRuntimes": [ "string" ], + "Content": { + "CodeSha256": "string", + "CodeSize": number, + "Location": "string" }, - "[CreatedDate](#SSS-GetLayerVersionByArn-response-CreatedDate)": "string", - "[Description](#SSS-GetLayerVersionByArn-response-Description)": "string", - "[LayerArn](#SSS-GetLayerVersionByArn-response-LayerArn)": "string", - "[LayerVersionArn](#SSS-GetLayerVersionByArn-response-LayerVersionArn)": "string", - "[LicenseInfo](#SSS-GetLayerVersionByArn-response-LicenseInfo)": "string", - "[Version](#SSS-GetLayerVersionByArn-response-Version)": number + "CreatedDate": "string", + "Description": "string", + "LayerArn": "string", + "LayerVersionArn": "string", + "LicenseInfo": "string", + "Version": number } ``` diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index 0d46a690..5f080c3f 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -33,8 +33,8 @@ HTTP/1.1 200 Content-type: application/json { - "[Policy](#SSS-GetLayerVersionPolicy-response-Policy)": "string", - "[RevisionId](#SSS-GetLayerVersionPolicy-response-RevisionId)": "string" + "Policy": "string", + "RevisionId": "string" } ``` diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 84c6477d..35421479 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -40,8 +40,8 @@ HTTP/1.1 200 Content-type: application/json { - "[Policy](#SSS-GetPolicy-response-Policy)": "string", - "[RevisionId](#SSS-GetPolicy-response-RevisionId)": "string" + "Policy": "string", + "RevisionId": "string" } ``` diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index daac78b9..0f08ee63 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -41,12 +41,12 @@ HTTP/1.1 200 Content-type: application/json { - "[AllocatedProvisionedConcurrentExecutions](#SSS-GetProvisionedConcurrencyConfig-response-AllocatedProvisionedConcurrentExecutions)": number, - "[AvailableProvisionedConcurrentExecutions](#SSS-GetProvisionedConcurrencyConfig-response-AvailableProvisionedConcurrentExecutions)": number, - "[LastModified](#SSS-GetProvisionedConcurrencyConfig-response-LastModified)": "string", - "[RequestedProvisionedConcurrentExecutions](#SSS-GetProvisionedConcurrencyConfig-response-RequestedProvisionedConcurrentExecutions)": number, - "[Status](#SSS-GetProvisionedConcurrencyConfig-response-Status)": "string", - "[StatusReason](#SSS-GetProvisionedConcurrencyConfig-response-StatusReason)": "string" + "AllocatedProvisionedConcurrentExecutions": number, + "AvailableProvisionedConcurrentExecutions": number, + "LastModified": "string", + "RequestedProvisionedConcurrentExecutions": number, + "Status": "string", + "StatusReason": "string" } ``` diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index d0f9e136..6440d010 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -47,21 +47,21 @@ HTTP/1.1 200 Content-type: application/json { - "[Aliases](#SSS-ListAliases-response-Aliases)": [ + "Aliases": [ { - "[AliasArn](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-AliasArn)": "string", - "[Description](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-Description)": "string", - "[FunctionVersion](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-FunctionVersion)": "string", - "[Name](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-Name)": "string", - "[RevisionId](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-RevisionId)": "string", - "[RoutingConfig](API_AliasConfiguration.md#SSS-Type-AliasConfiguration-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "AliasArn": "string", + "Description": "string", + "FunctionVersion": "string", + "Name": "string", + "RevisionId": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } } ], - "[NextMarker](#SSS-ListAliases-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index f39688fc..7a733ea3 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -17,6 +17,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. + **Amazon Simple Queue Service** \- The ARN of the queue\. ++ **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** @@ -49,32 +50,33 @@ HTTP/1.1 200 Content-type: application/json { - "[EventSourceMappings](#SSS-ListEventSourceMappings-response-EventSourceMappings)": [ + "EventSourceMappings": [ { - "[BatchSize](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-BatchSize)": number, - "[BisectBatchOnFunctionError](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[EventSourceArn](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-EventSourceArn)": "string", - "[FunctionArn](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-FunctionArn)": "string", - "[LastModified](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-LastModified)": number, - "[LastProcessingResult](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-LastProcessingResult)": "string", - "[MaximumBatchingWindowInSeconds](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-MaximumRetryAttempts)": number, - "[ParallelizationFactor](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-ParallelizationFactor)": number, - "[State](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-State)": "string", - "[StateTransitionReason](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-StateTransitionReason)": "string", - "[UUID](API_EventSourceMappingConfiguration.md#SSS-Type-EventSourceMappingConfiguration-UUID)": "string" + "EventSourceArn": "string", + "FunctionArn": "string", + "LastModified": number, + "LastProcessingResult": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "State": "string", + "StateTransitionReason": "string", + "Topics": [ "string" ], + "UUID": "string" } ], - "[NextMarker](#SSS-ListEventSourceMappings-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 76176cbb..4b865687 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -44,23 +44,23 @@ HTTP/1.1 200 Content-type: application/json { - "[FunctionEventInvokeConfigs](#SSS-ListFunctionEventInvokeConfigs-response-FunctionEventInvokeConfigs)": [ + "FunctionEventInvokeConfigs": [ { - "[DestinationConfig](API_FunctionEventInvokeConfig.md#SSS-Type-FunctionEventInvokeConfig-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[FunctionArn](API_FunctionEventInvokeConfig.md#SSS-Type-FunctionEventInvokeConfig-FunctionArn)": "string", - "[LastModified](API_FunctionEventInvokeConfig.md#SSS-Type-FunctionEventInvokeConfig-LastModified)": number, - "[MaximumEventAgeInSeconds](API_FunctionEventInvokeConfig.md#SSS-Type-FunctionEventInvokeConfig-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](API_FunctionEventInvokeConfig.md#SSS-Type-FunctionEventInvokeConfig-MaximumRetryAttempts)": number + "FunctionArn": "string", + "LastModified": number, + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ], - "[NextMarker](#SSS-ListFunctionEventInvokeConfigs-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index 89533cee..ae21f90a 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -40,64 +40,64 @@ HTTP/1.1 200 Content-type: application/json { - "[Functions](#SSS-ListFunctions-response-Functions)": [ + "Functions": [ { - "[CodeSha256](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSha256)": "string", - "[CodeSize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSize)": number, - "[DeadLetterConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Description)": "string", - "[Environment](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", - "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", - "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", - "[KMSKeyArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-KMSKeyArn)": "string", - "[LastModified](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastModified)": "string", - "[LastUpdateStatus](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReasonCode)": "string", - "[Layers](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MasterArn)": "string", - "[MemorySize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MemorySize)": number, - "[RevisionId](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-RevisionId)": "string", - "[Role](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Role)": "string", - "[Runtime](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Runtime)": "string", - "[State](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-State)": "string", - "[StateReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReason)": "string", - "[StateReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReasonCode)": "string", - "[Timeout](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Timeout)": number, - "[TracingConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Version)": "string", - "[VpcConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ], - "[NextMarker](#SSS-ListFunctions-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 991bbc00..430415ab 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -40,17 +40,17 @@ HTTP/1.1 200 Content-type: application/json { - "[LayerVersions](#SSS-ListLayerVersions-response-LayerVersions)": [ + "LayerVersions": [ { - "[CompatibleRuntimes](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-CompatibleRuntimes)": [ "string" ], - "[CreatedDate](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-CreatedDate)": "string", - "[Description](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-Description)": "string", - "[LayerVersionArn](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-LayerVersionArn)": "string", - "[LicenseInfo](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-LicenseInfo)": "string", - "[Version](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-Version)": number + "CompatibleRuntimes": [ "string" ], + "CreatedDate": "string", + "Description": "string", + "LayerVersionArn": "string", + "LicenseInfo": "string", + "Version": number } ], - "[NextMarker](#SSS-ListLayerVersions-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 7d25b1cc..c54b437d 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -34,21 +34,21 @@ HTTP/1.1 200 Content-type: application/json { - "[Layers](#SSS-ListLayers-response-Layers)": [ + "Layers": [ { - "[LatestMatchingVersion](API_LayersListItem.md#SSS-Type-LayersListItem-LatestMatchingVersion)": { - "[CompatibleRuntimes](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-CompatibleRuntimes)": [ "string" ], - "[CreatedDate](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-CreatedDate)": "string", - "[Description](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-Description)": "string", - "[LayerVersionArn](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-LayerVersionArn)": "string", - "[LicenseInfo](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-LicenseInfo)": "string", - "[Version](API_LayerVersionsListItem.md#SSS-Type-LayerVersionsListItem-Version)": number + "LatestMatchingVersion": { + "CompatibleRuntimes": [ "string" ], + "CreatedDate": "string", + "Description": "string", + "LayerVersionArn": "string", + "LicenseInfo": "string", + "Version": number }, - "[LayerArn](API_LayersListItem.md#SSS-Type-LayersListItem-LayerArn)": "string", - "[LayerName](API_LayersListItem.md#SSS-Type-LayersListItem-LayerName)": "string" + "LayerArn": "string", + "LayerName": "string" } ], - "[NextMarker](#SSS-ListLayers-response-NextMarker)": "string" + "NextMarker": "string" } ``` diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index c200e5df..5cb586fe 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -42,16 +42,16 @@ HTTP/1.1 200 Content-type: application/json { - "[NextMarker](#SSS-ListProvisionedConcurrencyConfigs-response-NextMarker)": "string", - "[ProvisionedConcurrencyConfigs](#SSS-ListProvisionedConcurrencyConfigs-response-ProvisionedConcurrencyConfigs)": [ + "NextMarker": "string", + "ProvisionedConcurrencyConfigs": [ { - "[AllocatedProvisionedConcurrentExecutions](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-AllocatedProvisionedConcurrentExecutions)": number, - "[AvailableProvisionedConcurrentExecutions](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-AvailableProvisionedConcurrentExecutions)": number, - "[FunctionArn](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-FunctionArn)": "string", - "[LastModified](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-LastModified)": "string", - "[RequestedProvisionedConcurrentExecutions](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-RequestedProvisionedConcurrentExecutions)": number, - "[Status](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-Status)": "string", - "[StatusReason](API_ProvisionedConcurrencyConfigListItem.md#SSS-Type-ProvisionedConcurrencyConfigListItem-StatusReason)": "string" + "AllocatedProvisionedConcurrentExecutions": number, + "AvailableProvisionedConcurrentExecutions": number, + "FunctionArn": "string", + "LastModified": "string", + "RequestedProvisionedConcurrentExecutions": number, + "Status": "string", + "StatusReason": "string" } ] } diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index adb84c70..e5e7d1d5 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -28,7 +28,7 @@ HTTP/1.1 200 Content-type: application/json { - "[Tags](#SSS-ListTags-response-Tags)": { + "Tags": { "string" : "string" } } diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index d566654d..cfdddb83 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -42,61 +42,61 @@ HTTP/1.1 200 Content-type: application/json { - "[NextMarker](#SSS-ListVersionsByFunction-response-NextMarker)": "string", - "[Versions](#SSS-ListVersionsByFunction-response-Versions)": [ + "NextMarker": "string", + "Versions": [ { - "[CodeSha256](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSha256)": "string", - "[CodeSize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-CodeSize)": number, - "[DeadLetterConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Description)": "string", - "[Environment](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionArn)": "string", - "[FunctionName](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-FunctionName)": "string", - "[Handler](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Handler)": "string", - "[KMSKeyArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-KMSKeyArn)": "string", - "[LastModified](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastModified)": "string", - "[LastUpdateStatus](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-LastUpdateStatusReasonCode)": "string", - "[Layers](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MasterArn)": "string", - "[MemorySize](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-MemorySize)": number, - "[RevisionId](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-RevisionId)": "string", - "[Role](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Role)": "string", - "[Runtime](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Runtime)": "string", - "[State](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-State)": "string", - "[StateReason](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReason)": "string", - "[StateReasonCode](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-StateReasonCode)": "string", - "[Timeout](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Timeout)": number, - "[TracingConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-Version)": "string", - "[VpcConfig](API_FunctionConfiguration.md#SSS-Type-FunctionConfiguration-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ] diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 96fe2f7c..79f808da 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -11,15 +11,15 @@ POST /2018-10-31/layers/LayerName/versions HTTP/1.1 Content-type: application/json { - "[CompatibleRuntimes](#SSS-PublishLayerVersion-request-CompatibleRuntimes)": [ "string" ], - "[Content](#SSS-PublishLayerVersion-request-Content)": { - "[S3Bucket](API_LayerVersionContentInput.md#SSS-Type-LayerVersionContentInput-S3Bucket)": "string", - "[S3Key](API_LayerVersionContentInput.md#SSS-Type-LayerVersionContentInput-S3Key)": "string", - "[S3ObjectVersion](API_LayerVersionContentInput.md#SSS-Type-LayerVersionContentInput-S3ObjectVersion)": "string", - "[ZipFile](API_LayerVersionContentInput.md#SSS-Type-LayerVersionContentInput-ZipFile)": blob + "CompatibleRuntimes": [ "string" ], + "Content": { + "S3Bucket": "string", + "S3Key": "string", + "S3ObjectVersion": "string", + "ZipFile": blob }, - "[Description](#SSS-PublishLayerVersion-request-Description)": "string", - "[LicenseInfo](#SSS-PublishLayerVersion-request-LicenseInfo)": "string" + "Description": "string", + "LicenseInfo": "string" } ``` @@ -71,18 +71,18 @@ HTTP/1.1 201 Content-type: application/json { - "[CompatibleRuntimes](#SSS-PublishLayerVersion-response-CompatibleRuntimes)": [ "string" ], - "[Content](#SSS-PublishLayerVersion-response-Content)": { - "[CodeSha256](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSha256)": "string", - "[CodeSize](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-CodeSize)": number, - "[Location](API_LayerVersionContentOutput.md#SSS-Type-LayerVersionContentOutput-Location)": "string" + "CompatibleRuntimes": [ "string" ], + "Content": { + "CodeSha256": "string", + "CodeSize": number, + "Location": "string" }, - "[CreatedDate](#SSS-PublishLayerVersion-response-CreatedDate)": "string", - "[Description](#SSS-PublishLayerVersion-response-Description)": "string", - "[LayerArn](#SSS-PublishLayerVersion-response-LayerArn)": "string", - "[LayerVersionArn](#SSS-PublishLayerVersion-response-LayerVersionArn)": "string", - "[LicenseInfo](#SSS-PublishLayerVersion-response-LicenseInfo)": "string", - "[Version](#SSS-PublishLayerVersion-response-Version)": number + "CreatedDate": "string", + "Description": "string", + "LayerArn": "string", + "LayerVersionArn": "string", + "LicenseInfo": "string", + "Version": number } ``` diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index d0ddf1a3..338fea3b 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -13,9 +13,9 @@ POST /2015-03-31/functions/FunctionName/versions HTTP/1.1 Content-type: application/json { - "[CodeSha256](#SSS-PublishVersion-request-CodeSha256)": "string", - "[Description](#SSS-PublishVersion-request-Description)": "string", - "[RevisionId](#SSS-PublishVersion-request-RevisionId)": "string" + "CodeSha256": "string", + "Description": "string", + "RevisionId": "string" } ``` @@ -62,58 +62,58 @@ HTTP/1.1 201 Content-type: application/json { - "[CodeSha256](#SSS-PublishVersion-response-CodeSha256)": "string", - "[CodeSize](#SSS-PublishVersion-response-CodeSize)": number, - "[DeadLetterConfig](#SSS-PublishVersion-response-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-PublishVersion-response-Description)": "string", - "[Environment](#SSS-PublishVersion-response-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-PublishVersion-response-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](#SSS-PublishVersion-response-FunctionArn)": "string", - "[FunctionName](#SSS-PublishVersion-response-FunctionName)": "string", - "[Handler](#SSS-PublishVersion-response-Handler)": "string", - "[KMSKeyArn](#SSS-PublishVersion-response-KMSKeyArn)": "string", - "[LastModified](#SSS-PublishVersion-response-LastModified)": "string", - "[LastUpdateStatus](#SSS-PublishVersion-response-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](#SSS-PublishVersion-response-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](#SSS-PublishVersion-response-LastUpdateStatusReasonCode)": "string", - "[Layers](#SSS-PublishVersion-response-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](#SSS-PublishVersion-response-MasterArn)": "string", - "[MemorySize](#SSS-PublishVersion-response-MemorySize)": number, - "[RevisionId](#SSS-PublishVersion-response-RevisionId)": "string", - "[Role](#SSS-PublishVersion-response-Role)": "string", - "[Runtime](#SSS-PublishVersion-response-Runtime)": "string", - "[State](#SSS-PublishVersion-response-State)": "string", - "[StateReason](#SSS-PublishVersion-response-StateReason)": "string", - "[StateReasonCode](#SSS-PublishVersion-response-StateReasonCode)": "string", - "[Timeout](#SSS-PublishVersion-response-Timeout)": number, - "[TracingConfig](#SSS-PublishVersion-response-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](#SSS-PublishVersion-response-Version)": "string", - "[VpcConfig](#SSS-PublishVersion-response-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ``` diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index 328040ee..c1ec66a8 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -13,7 +13,7 @@ PUT /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 Content-type: application/json { - "[ReservedConcurrentExecutions](#SSS-PutFunctionConcurrency-request-ReservedConcurrentExecutions)": number + "ReservedConcurrentExecutions": number } ``` @@ -50,7 +50,7 @@ HTTP/1.1 200 Content-type: application/json { - "[ReservedConcurrentExecutions](#SSS-PutFunctionConcurrency-response-ReservedConcurrentExecutions)": number + "ReservedConcurrentExecutions": number } ``` diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index a8eea115..7de52ada 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -13,16 +13,16 @@ PUT /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H Content-type: application/json { - "[DestinationConfig](#SSS-PutFunctionEventInvokeConfig-request-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[MaximumEventAgeInSeconds](#SSS-PutFunctionEventInvokeConfig-request-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-PutFunctionEventInvokeConfig-request-MaximumRetryAttempts)": number + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ``` @@ -81,18 +81,18 @@ HTTP/1.1 200 Content-type: application/json { - "[DestinationConfig](#SSS-PutFunctionEventInvokeConfig-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[FunctionArn](#SSS-PutFunctionEventInvokeConfig-response-FunctionArn)": "string", - "[LastModified](#SSS-PutFunctionEventInvokeConfig-response-LastModified)": number, - "[MaximumEventAgeInSeconds](#SSS-PutFunctionEventInvokeConfig-response-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-PutFunctionEventInvokeConfig-response-MaximumRetryAttempts)": number + "FunctionArn": "string", + "LastModified": number, + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ``` diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 86ef1b9e..09083ef0 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -9,7 +9,7 @@ PUT /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi Content-type: application/json { - "[ProvisionedConcurrentExecutions](#SSS-PutProvisionedConcurrencyConfig-request-ProvisionedConcurrentExecutions)": number + "ProvisionedConcurrentExecutions": number } ``` @@ -52,12 +52,12 @@ HTTP/1.1 202 Content-type: application/json { - "[AllocatedProvisionedConcurrentExecutions](#SSS-PutProvisionedConcurrencyConfig-response-AllocatedProvisionedConcurrentExecutions)": number, - "[AvailableProvisionedConcurrentExecutions](#SSS-PutProvisionedConcurrencyConfig-response-AvailableProvisionedConcurrentExecutions)": number, - "[LastModified](#SSS-PutProvisionedConcurrencyConfig-response-LastModified)": "string", - "[RequestedProvisionedConcurrentExecutions](#SSS-PutProvisionedConcurrencyConfig-response-RequestedProvisionedConcurrentExecutions)": number, - "[Status](#SSS-PutProvisionedConcurrencyConfig-response-Status)": "string", - "[StatusReason](#SSS-PutProvisionedConcurrencyConfig-response-StatusReason)": "string" + "AllocatedProvisionedConcurrentExecutions": number, + "AvailableProvisionedConcurrentExecutions": number, + "LastModified": "string", + "RequestedProvisionedConcurrentExecutions": number, + "Status": "string", + "StatusReason": "string" } ``` diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 914df1aa..7c144f26 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -9,7 +9,7 @@ POST /2017-03-31/tags/ARN HTTP/1.1 Content-type: application/json { - "[Tags](#SSS-TagResource-request-Tags)": { + "Tags": { "string" : "string" } } diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index f615bf85..609444f5 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -9,11 +9,11 @@ PUT /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 Content-type: application/json { - "[Description](#SSS-UpdateAlias-request-Description)": "string", - "[FunctionVersion](#SSS-UpdateAlias-request-FunctionVersion)": "string", - "[RevisionId](#SSS-UpdateAlias-request-RevisionId)": "string", - "[RoutingConfig](#SSS-UpdateAlias-request-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "Description": "string", + "FunctionVersion": "string", + "RevisionId": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } @@ -76,13 +76,13 @@ HTTP/1.1 200 Content-type: application/json { - "[AliasArn](#SSS-UpdateAlias-response-AliasArn)": "string", - "[Description](#SSS-UpdateAlias-response-Description)": "string", - "[FunctionVersion](#SSS-UpdateAlias-response-FunctionVersion)": "string", - "[Name](#SSS-UpdateAlias-response-Name)": "string", - "[RevisionId](#SSS-UpdateAlias-response-RevisionId)": "string", - "[RoutingConfig](#SSS-UpdateAlias-response-RoutingConfig)": { - "[AdditionalVersionWeights](API_AliasRoutingConfiguration.md#SSS-Type-AliasRoutingConfiguration-AdditionalVersionWeights)": { + "AliasArn": "string", + "Description": "string", + "FunctionVersion": "string", + "Name": "string", + "RevisionId": "string", + "RoutingConfig": { + "AdditionalVersionWeights": { "string" : number } } diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 7b16b933..b13f8eb0 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -5,8 +5,8 @@ Updates an event source mapping\. You can change the function that AWS Lambda in The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. -+ `MaximumRecordAgeInSeconds` \- Discard records older than the specified age\. -+ `MaximumRetryAttempts` \- Discard records after the specified number of retries\. ++ `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 ++ `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\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. ## Request Syntax @@ -16,22 +16,22 @@ PUT /2015-03-31/event-source-mappings/UUID HTTP/1.1 Content-type: application/json { - "[BatchSize](#SSS-UpdateEventSourceMapping-request-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-UpdateEventSourceMapping-request-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-UpdateEventSourceMapping-request-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[Enabled](#SSS-UpdateEventSourceMapping-request-Enabled)": boolean, - "[FunctionName](#SSS-UpdateEventSourceMapping-request-FunctionName)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-UpdateEventSourceMapping-request-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-UpdateEventSourceMapping-request-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-UpdateEventSourceMapping-request-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-UpdateEventSourceMapping-request-ParallelizationFactor)": number + "Enabled": boolean, + "FunctionName": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number } ``` @@ -52,6 +52,7 @@ The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -92,13 +93,13 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. Required: No @@ -116,27 +117,28 @@ HTTP/1.1 202 Content-type: application/json { - "[BatchSize](#SSS-UpdateEventSourceMapping-response-BatchSize)": number, - "[BisectBatchOnFunctionError](#SSS-UpdateEventSourceMapping-response-BisectBatchOnFunctionError)": boolean, - "[DestinationConfig](#SSS-UpdateEventSourceMapping-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "BatchSize": number, + "BisectBatchOnFunctionError": boolean, + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[EventSourceArn](#SSS-UpdateEventSourceMapping-response-EventSourceArn)": "string", - "[FunctionArn](#SSS-UpdateEventSourceMapping-response-FunctionArn)": "string", - "[LastModified](#SSS-UpdateEventSourceMapping-response-LastModified)": number, - "[LastProcessingResult](#SSS-UpdateEventSourceMapping-response-LastProcessingResult)": "string", - "[MaximumBatchingWindowInSeconds](#SSS-UpdateEventSourceMapping-response-MaximumBatchingWindowInSeconds)": number, - "[MaximumRecordAgeInSeconds](#SSS-UpdateEventSourceMapping-response-MaximumRecordAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-UpdateEventSourceMapping-response-MaximumRetryAttempts)": number, - "[ParallelizationFactor](#SSS-UpdateEventSourceMapping-response-ParallelizationFactor)": number, - "[State](#SSS-UpdateEventSourceMapping-response-State)": "string", - "[StateTransitionReason](#SSS-UpdateEventSourceMapping-response-StateTransitionReason)": "string", - "[UUID](#SSS-UpdateEventSourceMapping-response-UUID)": "string" + "EventSourceArn": "string", + "FunctionArn": "string", + "LastModified": number, + "LastProcessingResult": "string", + "MaximumBatchingWindowInSeconds": number, + "MaximumRecordAgeInSeconds": number, + "MaximumRetryAttempts": number, + "ParallelizationFactor": number, + "State": "string", + "StateTransitionReason": "string", + "Topics": [ "string" ], + "UUID": "string" } ``` @@ -183,12 +185,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum age of a record that Lambda sends to a function for processing\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum number of times to retry when the function returns an error\. +\(Streams\) 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\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. @@ -205,6 +207,13 @@ Type: String Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. Type: String + ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** + \(MSK\) The name of the Kafka topic\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 249\. +Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 11139aaa..39e26936 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -11,13 +11,13 @@ PUT /2015-03-31/functions/FunctionName/code HTTP/1.1 Content-type: application/json { - "[DryRun](#SSS-UpdateFunctionCode-request-DryRun)": boolean, - "[Publish](#SSS-UpdateFunctionCode-request-Publish)": boolean, - "[RevisionId](#SSS-UpdateFunctionCode-request-RevisionId)": "string", - "[S3Bucket](#SSS-UpdateFunctionCode-request-S3Bucket)": "string", - "[S3Key](#SSS-UpdateFunctionCode-request-S3Key)": "string", - "[S3ObjectVersion](#SSS-UpdateFunctionCode-request-S3ObjectVersion)": "string", - "[ZipFile](#SSS-UpdateFunctionCode-request-ZipFile)": blob + "DryRun": boolean, + "Publish": boolean, + "RevisionId": "string", + "S3Bucket": "string", + "S3Key": "string", + "S3ObjectVersion": "string", + "ZipFile": blob } ``` @@ -87,58 +87,58 @@ HTTP/1.1 200 Content-type: application/json { - "[CodeSha256](#SSS-UpdateFunctionCode-response-CodeSha256)": "string", - "[CodeSize](#SSS-UpdateFunctionCode-response-CodeSize)": number, - "[DeadLetterConfig](#SSS-UpdateFunctionCode-response-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-UpdateFunctionCode-response-Description)": "string", - "[Environment](#SSS-UpdateFunctionCode-response-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-UpdateFunctionCode-response-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](#SSS-UpdateFunctionCode-response-FunctionArn)": "string", - "[FunctionName](#SSS-UpdateFunctionCode-response-FunctionName)": "string", - "[Handler](#SSS-UpdateFunctionCode-response-Handler)": "string", - "[KMSKeyArn](#SSS-UpdateFunctionCode-response-KMSKeyArn)": "string", - "[LastModified](#SSS-UpdateFunctionCode-response-LastModified)": "string", - "[LastUpdateStatus](#SSS-UpdateFunctionCode-response-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](#SSS-UpdateFunctionCode-response-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](#SSS-UpdateFunctionCode-response-LastUpdateStatusReasonCode)": "string", - "[Layers](#SSS-UpdateFunctionCode-response-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](#SSS-UpdateFunctionCode-response-MasterArn)": "string", - "[MemorySize](#SSS-UpdateFunctionCode-response-MemorySize)": number, - "[RevisionId](#SSS-UpdateFunctionCode-response-RevisionId)": "string", - "[Role](#SSS-UpdateFunctionCode-response-Role)": "string", - "[Runtime](#SSS-UpdateFunctionCode-response-Runtime)": "string", - "[State](#SSS-UpdateFunctionCode-response-State)": "string", - "[StateReason](#SSS-UpdateFunctionCode-response-StateReason)": "string", - "[StateReasonCode](#SSS-UpdateFunctionCode-response-StateReasonCode)": "string", - "[Timeout](#SSS-UpdateFunctionCode-response-Timeout)": number, - "[TracingConfig](#SSS-UpdateFunctionCode-response-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](#SSS-UpdateFunctionCode-response-Version)": "string", - "[VpcConfig](#SSS-UpdateFunctionCode-response-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ``` diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index ea6e3590..90719883 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -15,35 +15,35 @@ PUT /2015-03-31/functions/FunctionName/configuration HTTP/1.1 Content-type: application/json { - "[DeadLetterConfig](#SSS-UpdateFunctionConfiguration-request-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-UpdateFunctionConfiguration-request-Description)": "string", - "[Environment](#SSS-UpdateFunctionConfiguration-request-Environment)": { - "[Variables](API_Environment.md#SSS-Type-Environment-Variables)": { + "Description": "string", + "Environment": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-UpdateFunctionConfiguration-request-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[Handler](#SSS-UpdateFunctionConfiguration-request-Handler)": "string", - "[KMSKeyArn](#SSS-UpdateFunctionConfiguration-request-KMSKeyArn)": "string", - "[Layers](#SSS-UpdateFunctionConfiguration-request-Layers)": [ "string" ], - "[MemorySize](#SSS-UpdateFunctionConfiguration-request-MemorySize)": number, - "[RevisionId](#SSS-UpdateFunctionConfiguration-request-RevisionId)": "string", - "[Role](#SSS-UpdateFunctionConfiguration-request-Role)": "string", - "[Runtime](#SSS-UpdateFunctionConfiguration-request-Runtime)": "string", - "[Timeout](#SSS-UpdateFunctionConfiguration-request-Timeout)": number, - "[TracingConfig](#SSS-UpdateFunctionConfiguration-request-TracingConfig)": { - "[Mode](API_TracingConfig.md#SSS-Type-TracingConfig-Mode)": "string" + "Handler": "string", + "KMSKeyArn": "string", + "Layers": [ "string" ], + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[VpcConfig](#SSS-UpdateFunctionConfiguration-request-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfig.md#SSS-Type-VpcConfig-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfig.md#SSS-Type-VpcConfig-SubnetIds)": [ "string" ] + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ] } } ``` @@ -156,58 +156,58 @@ HTTP/1.1 200 Content-type: application/json { - "[CodeSha256](#SSS-UpdateFunctionConfiguration-response-CodeSha256)": "string", - "[CodeSize](#SSS-UpdateFunctionConfiguration-response-CodeSize)": number, - "[DeadLetterConfig](#SSS-UpdateFunctionConfiguration-response-DeadLetterConfig)": { - "[TargetArn](API_DeadLetterConfig.md#SSS-Type-DeadLetterConfig-TargetArn)": "string" + "CodeSha256": "string", + "CodeSize": number, + "DeadLetterConfig": { + "TargetArn": "string" }, - "[Description](#SSS-UpdateFunctionConfiguration-response-Description)": "string", - "[Environment](#SSS-UpdateFunctionConfiguration-response-Environment)": { - "[Error](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Error)": { - "[ErrorCode](API_EnvironmentError.md#SSS-Type-EnvironmentError-ErrorCode)": "string", - "[Message](API_EnvironmentError.md#SSS-Type-EnvironmentError-Message)": "string" + "Description": "string", + "Environment": { + "Error": { + "ErrorCode": "string", + "Message": "string" }, - "[Variables](API_EnvironmentResponse.md#SSS-Type-EnvironmentResponse-Variables)": { + "Variables": { "string" : "string" } }, - "[FileSystemConfigs](#SSS-UpdateFunctionConfiguration-response-FileSystemConfigs)": [ + "FileSystemConfigs": [ { - "[Arn](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-Arn)": "string", - "[LocalMountPath](API_FileSystemConfig.md#SSS-Type-FileSystemConfig-LocalMountPath)": "string" + "Arn": "string", + "LocalMountPath": "string" } ], - "[FunctionArn](#SSS-UpdateFunctionConfiguration-response-FunctionArn)": "string", - "[FunctionName](#SSS-UpdateFunctionConfiguration-response-FunctionName)": "string", - "[Handler](#SSS-UpdateFunctionConfiguration-response-Handler)": "string", - "[KMSKeyArn](#SSS-UpdateFunctionConfiguration-response-KMSKeyArn)": "string", - "[LastModified](#SSS-UpdateFunctionConfiguration-response-LastModified)": "string", - "[LastUpdateStatus](#SSS-UpdateFunctionConfiguration-response-LastUpdateStatus)": "string", - "[LastUpdateStatusReason](#SSS-UpdateFunctionConfiguration-response-LastUpdateStatusReason)": "string", - "[LastUpdateStatusReasonCode](#SSS-UpdateFunctionConfiguration-response-LastUpdateStatusReasonCode)": "string", - "[Layers](#SSS-UpdateFunctionConfiguration-response-Layers)": [ + "FunctionArn": "string", + "FunctionName": "string", + "Handler": "string", + "KMSKeyArn": "string", + "LastModified": "string", + "LastUpdateStatus": "string", + "LastUpdateStatusReason": "string", + "LastUpdateStatusReasonCode": "string", + "Layers": [ { - "[Arn](API_Layer.md#SSS-Type-Layer-Arn)": "string", - "[CodeSize](API_Layer.md#SSS-Type-Layer-CodeSize)": number + "Arn": "string", + "CodeSize": number } ], - "[MasterArn](#SSS-UpdateFunctionConfiguration-response-MasterArn)": "string", - "[MemorySize](#SSS-UpdateFunctionConfiguration-response-MemorySize)": number, - "[RevisionId](#SSS-UpdateFunctionConfiguration-response-RevisionId)": "string", - "[Role](#SSS-UpdateFunctionConfiguration-response-Role)": "string", - "[Runtime](#SSS-UpdateFunctionConfiguration-response-Runtime)": "string", - "[State](#SSS-UpdateFunctionConfiguration-response-State)": "string", - "[StateReason](#SSS-UpdateFunctionConfiguration-response-StateReason)": "string", - "[StateReasonCode](#SSS-UpdateFunctionConfiguration-response-StateReasonCode)": "string", - "[Timeout](#SSS-UpdateFunctionConfiguration-response-Timeout)": number, - "[TracingConfig](#SSS-UpdateFunctionConfiguration-response-TracingConfig)": { - "[Mode](API_TracingConfigResponse.md#SSS-Type-TracingConfigResponse-Mode)": "string" + "MasterArn": "string", + "MemorySize": number, + "RevisionId": "string", + "Role": "string", + "Runtime": "string", + "State": "string", + "StateReason": "string", + "StateReasonCode": "string", + "Timeout": number, + "TracingConfig": { + "Mode": "string" }, - "[Version](#SSS-UpdateFunctionConfiguration-response-Version)": "string", - "[VpcConfig](#SSS-UpdateFunctionConfiguration-response-VpcConfig)": { - "[SecurityGroupIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SecurityGroupIds)": [ "string" ], - "[SubnetIds](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-SubnetIds)": [ "string" ], - "[VpcId](API_VpcConfigResponse.md#SSS-Type-VpcConfigResponse-VpcId)": "string" + "Version": "string", + "VpcConfig": { + "SecurityGroupIds": [ "string" ], + "SubnetIds": [ "string" ], + "VpcId": "string" } } ``` diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 3c196e8d..33509a9b 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -11,16 +11,16 @@ POST /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier Content-type: application/json { - "[DestinationConfig](#SSS-UpdateFunctionEventInvokeConfig-request-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[MaximumEventAgeInSeconds](#SSS-UpdateFunctionEventInvokeConfig-request-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-UpdateFunctionEventInvokeConfig-request-MaximumRetryAttempts)": number + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ``` @@ -79,18 +79,18 @@ HTTP/1.1 200 Content-type: application/json { - "[DestinationConfig](#SSS-UpdateFunctionEventInvokeConfig-response-DestinationConfig)": { - "[OnFailure](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnFailure)": { - "[Destination](API_OnFailure.md#SSS-Type-OnFailure-Destination)": "string" + "DestinationConfig": { + "OnFailure": { + "Destination": "string" }, - "[OnSuccess](API_DestinationConfig.md#SSS-Type-DestinationConfig-OnSuccess)": { - "[Destination](API_OnSuccess.md#SSS-Type-OnSuccess-Destination)": "string" + "OnSuccess": { + "Destination": "string" } }, - "[FunctionArn](#SSS-UpdateFunctionEventInvokeConfig-response-FunctionArn)": "string", - "[LastModified](#SSS-UpdateFunctionEventInvokeConfig-response-LastModified)": number, - "[MaximumEventAgeInSeconds](#SSS-UpdateFunctionEventInvokeConfig-response-MaximumEventAgeInSeconds)": number, - "[MaximumRetryAttempts](#SSS-UpdateFunctionEventInvokeConfig-response-MaximumRetryAttempts)": number + "FunctionArn": "string", + "LastModified": number, + "MaximumEventAgeInSeconds": number, + "MaximumRetryAttempts": number } ``` diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 1aeba39a..5e42653b 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -13,6 +13,7 @@ Managed policies grant permission to API actions without restricting the functio + [Function development](#permissions-user-function) + [Layer development and use](#permissions-user-layer) + [Cross\-account roles](#permissions-user-xaccount) ++ [Condition keys for VPC settings](#permissions-condition-keys) ## Function development @@ -233,4 +234,10 @@ You can apply any of the preceding policies and statements to a role, which you You can use cross\-account roles to give accounts that you trust access to Lambda actions and resources\. If you just want to grant permission to invoke a function or use a layer, use [resource\-based policies](access-control-resource-based.md) instead\. -For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *IAM User Guide*\. \ No newline at end of file +For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *IAM User Guide*\. + +## Condition keys for VPC settings + +You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. + +For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 625ee030..c853f521 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -277,7 +277,7 @@ For local development, AWS toolkits for integrated development environments \(ID As you develop your application, you will likely encounter the following types of errors\. + **Build errors** – Issues that occur during the build phase, including compilation, test, and packaging errors\. -+ **Deployment errors** – Issues that occur when AWS CloudFormation isn't able to update the application stack\. These include permissions errors, account limits, service issues, or template errors\. ++ **Deployment errors** – Issues that occur when AWS CloudFormation isn't able to update the application stack\. These include permissions errors, account quotas, service issues, or template errors\. + **Invocation errors** – Errors that are returned by a function's code or runtime\. For build and deployment errors, you can identify the cause of an error in the Lambda console\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 73462434..ee2227be 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -44,7 +44,7 @@ The following are recommended best practices for using AWS Lambda: By analyzing the `Max Memory Used:` field, you can determine if your function needs more memory or if you over\-provisioned your function's memory size\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. -+ **Be familiar with [AWS Lambda limits](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. ++ **Be familiar with [AWS Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. + **Delete Lambda functions that you are no longer using\.** By doing so, the unused functions won't needlessly count against your deployment package size limit\. + **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected execution time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. + In the case of **CreateFunction**, AWS Lambda will fail the function creation process\. @@ -57,6 +57,6 @@ The following are recommended best practices for using AWS Lambda: ## Working with streams + **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. [BatchSize](API_CreateEventSourceMapping.md#SSS-CreateEventSourceMapping-request-BatchSize) controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. - By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. + **Use [Amazon CloudWatch](https://docs.aws.amazon.com/streams/latest/dev/monitoring-with-cloudwatch.html)** on IteratorAge to determine if your Kinesis stream is being processed\. For example, configure a CloudWatch alarm with a maximum setting to 30000 \(30 seconds\)\. \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 2741577b..21a6d717 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -2,7 +2,7 @@ Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. -Concurrency is subject to a Regional [limit](gettingstarted-limits.md) that is shared by all functions in a Region\. To ensure that a function can always reach a certain level of concurrency, you can configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. +Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. To ensure that a function can always reach a certain level of concurrency, you can configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. When Lambda allocates an instance of your function, the [runtime](lambda-runtimes.md) loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function [scales up](invocation-scaling.md), this causes the portion of requests that are served by new instances to have higher latency than the rest\. @@ -10,7 +10,7 @@ To enable your function to scale without fluctuations in latency, use [provision Lambda also integrates with [Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/)\. You can configure Application Auto Scaling to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. To increase provisioned concurrency automatically as needed, use [the Application Auto Scaling API](#configuration-concurrency-api) to register a target and create a scaling policy\. -Provisioned concurrency counts towards a function's reserved concurrency and Regional limits\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \(`$LATEST`\), which prevents it from executing\. +Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \(`$LATEST`\), which prevents it from executing\. **Topics** + [Configuring reserved concurrency](#configuration-concurrency-reserved) @@ -82,7 +82,7 @@ In the following example, the `my-function-DEV` and `my-function-PROD` functions + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.unreserved.png) Unreserved concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.throttling.png) Throttling -Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling limits apply across all requests\. +Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) @@ -186,7 +186,7 @@ In the following example, a function scales between a minimum and maximum amount + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -To view your account's concurrency limits in a Region, use `get-account-settings`\. +To view your account's concurrency quotas in a Region, use `get-account-settings`\. ``` $ aws lambda get-account-settings diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 86c346f1..5edcd148 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -120,15 +120,52 @@ You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SA **Example template\.yml – File system configuration** ``` - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: function/. - Description: Use a file system. - FileSystemConfigs: - - LocalMountPath: "/mnt/efs0" - Arn: !GetAtt accessPoint.Arn - DependsOn: "my mount target" +Resources: + VPC: + Type: AWS::EC2::VPC + Properties: + CidrBlock: 10.0.0.0/16 + Subnet1: + Type: AWS::EC2::Subnet + Properties: + VpcId: + Ref: VPC + CidrBlock: 10.0.1.0/24 + AvailabilityZone: "eu-central-1a" + EfsSecurityGroup: + Type: AWS::EC2::SecurityGroup + Properties: + VpcId: + Ref: VPC + GroupDescription: "mnt target sg" + SecurityGroupEgress: + - IpProtocol: -1 + CidrIp: "0.0.0.0/0" + FileSystem: + Type: AWS::EFS::FileSystem + Properties: + PerformanceMode: generalPurpose + MountTarget1: + Type: AWS::EFS::MountTarget + Properties: + FileSystemId: + Ref: FileSystem + SubnetId: + Ref: Subnet1 + SecurityGroups: + - Ref: EfsSecurityGroup + MyFunctionWithEfs: + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Properties: + CodeUri: function/. + Description: Use a file system. + FileSystemConfigs: + - + Arn: !Sub + - "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/${ap}" + - {ap: !Ref AccessPoint} + LocalMountPath: "/mnt/efs0" + DependsOn: "MountTarget1" ``` You must add the `DependsOn` to ensure that the mount targets are fully created before the Lambda runs for the first time\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 6956bf03..85ebba15 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -5,7 +5,7 @@ You can configure your Lambda function to pull in additional code and content in Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. **Note** -A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [AWS Lambda limits](gettingstarted-limits.md)\. +A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [AWS Lambda quotas](gettingstarted-limits.md)\. You can create layers, or use layers published by AWS and other AWS customers\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/), or all accounts\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 3b4e6ca0..5c430b89 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -1,30 +1,32 @@ # Configuring a Lambda function to access resources in a VPC -You can configure a function to connect to private subnets in a virtual private cloud \(VPC\) in your account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources during execution\. +You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources during execution\. **To connect a function to a VPC** -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. 1. Choose a function\. 1. Under **VPC**, choose **Edit**\. -1. Choose **Custom VPC**\. +1. For **VPC connection**, choose **Custom VPC**\. 1. Choose a VPC, subnets, and security groups\. **Note** -Connect your function to private subnets to access private resources\. If your function needs internet access, use [NAT](#vpc-internet)\. Connecting a function to a public subnet does not give it internet access or a public IP address\. +Connect your function to private subnets to access private resources\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. 1. Choose **Save**\. -When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\. During this time, you cannot perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state transitions from `Pending` to `Active`\. For existing functions, you can still invoke the old version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\. -Multiple functions connected to the same subnets share network interfaces, so connecting additional functions to a subnet that already has a Lambda\-managed network interface is much quicker\. However, Lambda might create additional network interfaces if you have many functions or very busy functions\. +While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. -If your functions are not active for a long period of time, Lambda reclaims its network interfaces, and the function becomes `Idle`\. Invoke an idle function to reactivate it\. The first invocation fails and the function enters a pending state again until the network interface is available\. +Multiple functions connected to the same subnets share network interfaces\. Connecting additional functions to a subnet that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. -Lambda functions cannot connect directly to a VPC with [dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. +If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. + +Lambda functions can't connect directly to a VPC with [ dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. **VPC tutorials** + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) @@ -32,35 +34,36 @@ Lambda functions cannot connect directly to a VPC with [dedicated instance tenan **Topics** + [Execution role and user permissions](#vpc-permissions) -+ [Configuring Amazon VPC access with the Lambda API](#vpc-configuring) ++ [Configuring VPC access with the Lambda API](#vpc-configuring) ++ [Using IAM condition keys for VPC settings](#vpc-conditions) + [Internet and service access for VPC\-connected functions](#vpc-internet) + [Sample VPC configurations](#vpc-samples) ## Execution role and user permissions -Lambda uses your function's permissions to create and manage network interfaces\. To connect to a VPC, your function's execution role must have the following permissions\. +Lambda uses your function's permissions to create and manage network interfaces\. To connect to a VPC, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: **Execution role permissions** + **ec2:CreateNetworkInterface** + **ec2:DescribeNetworkInterfaces** + **ec2:DeleteNetworkInterface** -These permissions are included in the **AWSLambdaVPCAccessExecutionRole** managed policy\. +These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. -When you configure VPC connectivity, Lambda uses your permissions to verify network resources\. To configure a function to connect to a VPC, your IAM user need the following permissions\. +When you configure VPC connectivity, Lambda uses your permissions to verify network resources\. To configure a function to connect to a VPC, your AWS Identity and Access Management \(IAM\) user needs the following permissions: **User permissions** + **ec2:DescribeSecurityGroups** + **ec2:DescribeSubnets** + **ec2:DescribeVpcs** -## Configuring Amazon VPC access with the Lambda API +## Configuring VPC access with the Lambda API -You can connect a function to a VPC with the following APIs\. +To connect a Lambda function to a VPC, you can use the following API operations: + [CreateFunction](API_CreateFunction.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To connect your function to a VPC during creation with the AWS CLI, use the `vpc-config` option with a list of private subnet IDs and security groups\. The following example creates a function with a connection to a VPC with two subnets and one security group\. +To create a function and connect it to a VPC using the AWS Command Line Interface \(AWS CLI\), you can use the `create-function` command with the `vpc-config` option\. The following example creates a function with a connection to a VPC with two subnets and one security group\. ``` $ aws lambda create-function --function-name my-function \ @@ -69,7 +72,7 @@ $ aws lambda create-function --function-name my-function \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb ``` -To connect an existing function, use the `vpc-config` option with the `update-function-configuration` command\. +To connect an existing function to a VPC, use the `update-function-configuration` command with the `vpc-config` option\. ``` $ aws lambda update-function-configuration --function-name my-function \ @@ -83,19 +86,193 @@ $ aws lambda update-function-configuration --function-name my-function \ --vpc-config SubnetIds=[],SecurityGroupIds=[] ``` +## Using IAM condition keys for VPC settings + +You can use Lambda\-specific condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. + +Lambda supports the following condition keys in IAM policies: ++ **lambda:VpcIds** – Allow or deny one or more VPCs\. ++ **lambda:SubnetIds** – Allow or deny one or more subnets\. ++ **lambda:SecurityGroupIds** – Allow or deny one or more security groups\. + +The Lambda API operations [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) support these condition keys\. For more information about using condition keys in IAM policies, see [IAM JSON Policy Elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. + +**Tip** +If your function already includes a VPC configuration from a previous API request, you can send an `UpdateFunctionConfiguration` request without the VPC configuration\. + +### Example policies with condition keys for VPC settings + +The following examples demonstrate how to use condition keys for VPC settings\. After you create a policy statement with the desired restrictions, append the policy statement for the target IAM user or role\. + +#### Ensure that users deploy only VPC\-connected functions + +To ensure that all users deploy only VPC\-connected functions, you can deny function create and update operations that don't include a valid VPC ID\. + +Note that VPC ID is not an input parameter to the `CreateFunction` or `UpdateFunctionConfiguration` request\. Lambda retrieves the VPC ID value based on the subnet and security group parameters\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "EnforceVPCFunction", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Deny", + "Resource": "*", + "Condition": { + "Null": { + "lambda:VpcIds": "true" + } + } + } + ] +} +``` + +#### Deny users access to specific VPCs, subnets, or security groups + +To deny users access to specific VPCs, use `StringEquals` to check the value of the `lambda:VpcIds` condition\. The following example denies users access to `vpc-1` and `vpc-2`\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "EnforceOutOfVPC", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Deny", + "Resource": "*", + "Condition": { + "StringEquals": { + "lambda:VpcIds": ["vpc-1", "vpc-2"] + } + } + } +``` + +To deny users access to specific subnets, use `StringEquals` to check the value of the `lambda:SubnetIds` condition\. The following example denies users access to `subnet-1` and `subnet-2`\. + +``` +{ + "Sid": "EnforceOutOfSubnet", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Deny", + "Resource": "*", + "Condition": { + "ForAnyValue:StringEquals": { + "lambda:SubnetIds": ["subnet-1", "subnet-2"] + } + } + } +``` + +To deny users access to specific security groups, use `StringEquals` to check the value of the `lambda:SecurityGroupIds` condition\. The following example denies users access to `sg-1` and `sg-2`\. + +``` +{ + "Sid": "EnforceOutOfSecurityGroups", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Deny", + "Resource": "*", + "Condition": { + "ForAnyValue:StringEquals": { + "lambda:SecurityGroupIds": ["sg-1", "sg-2"] + } + } + } + ] +} +``` + +#### Allow users to create and update functions with specific VPC settings + +To allow users to access specific VPCs, use `StringEquals` to check the value of the `lambda:VpcIds` condition\. The following example allows users to access `vpc-1` and `vpc-2`\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "EnforceStayInSpecificVpc", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Allow", + "Resource": "*", + "Condition": { + "StringEquals": { + "lambda:VpcIds": ["vpc-1", "vpc-2"] + } + } + } +``` + +To allow users to access specific subnets, use `StringEquals` to check the value of the `lambda:SubnetIds` condition\. The following example allows users to access `subnet-1` and `subnet-2`\. + +``` +{ + "Sid": "EnforceStayInSpecificSubnets", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Allow", + "Resource": "*", + "Condition": { + "ForAllValues:StringEquals": { + "lambda:SubnetIds": ["subnet-1", "subnet-2"] + } + } + } +``` + +To allow users to access specific security groups, use `StringEquals` to check the value of the `lambda:SecurityGroupIds` condition\. The following example allows users to access `sg-1` and `sg-2`\. + +``` +{ + "Sid": "EnforceStayInSpecificSecurityGroup", + "Action": [ + "lambda:CreateFunction", + "lambda:UpdateFunctionConfiguration" + ], + "Effect": "Allow", + "Resource": "*", + "Condition": { + "ForAllValues:StringEquals": { + "lambda:SecurityGroupIds": ["sg-1", "sg-2"] + } + } + } + ] +} +``` + ## Internet and service access for VPC\-connected functions -By default, Lambda runs your functions in a secure VPC with access to AWS services and the internet\. The VPC is owned by Lambda and does not connect to your account's default VPC\. When you connect a function to a VPC in your account, it does not have access to the internet unless your VPC provides access\. +By default, Lambda runs your functions in a secure VPC with access to AWS services and the internet\. Lambda owns this VPC, which isn't connected to your account's [default VPC](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. **Note** -Several services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)\. You can use VPC endpoints to connect to AWS services from within a VPC without internet access\. +Several AWS services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)\. You can use VPC endpoints to connect to AWS services from within a VPC without internet access\. -Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a NAT gateway in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. For more information, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in the *Amazon VPC User Guide*\. +Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) ## Sample VPC configurations -Sample AWS CloudFormation templates for VPC configurations that you can use with Lambda functions are available in this guide's GitHub repository\. There are two templates: -+ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service and Amazon DynamoDB\. You can use this template to create a VPC for functions that do not need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDK, and access to database resources in the same VPC over a local network connection\. -+ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway by a route table\. +You can use the following sample AWS CloudFormation templates to create VPC configurations to use with Lambda functions\. There are two templates available in this guide's GitHub repository: ++ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. ++ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. -To use a template to create a VPC, choose **Create stack** in the [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation) and follow the instructions\. \ No newline at end of file +To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. \ No newline at end of file diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 6f0802bf..ba18fbec 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index fced5ed6..0b15520e 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -55,7 +55,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Run the Lambda function a few times to gather some metrics that you can view in the next step\. -1. Choose **Monitoring**\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. From the tabs near the top of the page, choose **Monitoring**\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index 8511486f..e6218c41 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -15,4 +15,4 @@ You can author functions in the Lambda console—or with an IDE toolkit, command + [AWS Lambda concepts](gettingstarted-concepts.md) + [AWS Lambda features](gettingstarted-features.md) + [Tools for working with AWS Lambda](gettingstarted-tools.md) -+ [AWS Lambda limits](gettingstarted-limits.md) \ No newline at end of file ++ [AWS Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 91c3c101..62deea10 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -18,7 +18,7 @@ For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. ## Qualifier -When you invoke or view a function, you can include a qualfier to specify a version or alias\. A version is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An alias is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. +When you invoke or view a function, you can include a qualifier to specify a version or alias\. A version is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An alias is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. For more information, see [AWS Lambda function versions](configuration-versions.md)\. @@ -65,7 +65,7 @@ For details on events from AWS services, see [Using AWS Lambda with other servic Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. -Concurrency is subject to limits at the region level\. You can also configure individual functions to limit their concurrency, or to ensure that they can reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +Concurrency is subject to quotas at the region level\. You can also configure individual functions to limit their concurrency, or to ensure that they can reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. ## Trigger diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 6a0bbc99..7943c5a0 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -1,20 +1,20 @@ -# AWS Lambda limits +# AWS Lambda quotas -AWS Lambda limits the amount of compute and storage resources that you can use to run and store functions\. The following limits apply per\-region and can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. +AWS Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per\-region and can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. -| Resource | Default limit | -| --- | --- | -| Concurrent executions | 1,000 | -| Function and layer storage | 75 GB | -| [Elastic network interfaces per VPC](configuration-vpc.md) | 250 | +| Resource | Default quota | Can Be Increased Up To | +| --- | --- | --- | +| Concurrent executions | 1,000 | Hundreds of thousands | +| Function and layer storage | 75 GB | Terabytes | +| [Elastic network interfaces per VPC](configuration-vpc.md) | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. -The following limits apply to function configuration, deployments, and execution\. They cannot be changed\. +The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. -| Resource | Limit | +| Resource | Quota | | --- | --- | | Function [memory allocation](configuration-console.md) | 128 MB to 3,008 MB, in 64 MB increments\. | | Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | @@ -22,13 +22,22 @@ The following limits apply to function configuration, deployments, and execution | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | 5 layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \([varies per region](invocation-scaling.md)\) | -| Invocation frequency per Region \(requests per second\) | 10 x concurrent executions limit \([synchronous](invocation-sync.md) – all sources\) 10 x concurrent executions limit \([asynchronous](invocation-async.md) – non\-AWS sources\) Unlimited \(asynchronous – [AWS service sources](lambda-services.md)\) | -| Invocation frequency per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This limit only applies to functions that use provisioned concurrency\. | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package](gettingstarted-features.md#gettingstarted-features-package) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | +| [Deployment package](gettingstarted-features.md#gettingstarted-features-package) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | | File descriptors | 1,024 | | Execution processes/threads | 1,024 | -Limits for other services, such as AWS Identity and Access Management, Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud, can impact your Lambda functions\. For more information, see [AWS service limits](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +The following quotas are associated with AWS Lambda API requests\. + + +| Resource | Quota | +| --- | --- | +| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md) – all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md) – non\-AWS sources\) Unlimited \(asynchronous – [AWS service sources](lambda-services.md)\) | +| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota only applies to functions that use provisioned concurrency\. | +| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | +| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | +| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | + +Quotas for other services, such as AWS Identity and Access Management, Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud, can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 0631c428..82f31ed1 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -6,6 +6,9 @@ After you create a deployment package, you may either upload it directly or uplo Download the Lambda library for Go with `go get`, and compile your executable\. +**Note** +Use version 1\.18\.0 or later of aws\-lambda\-go\. + ``` ~/my-function$ go get github.com/aws/aws-lambda-go/lambda ~/my-function$ GOOS=linux go build main.go diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index b52361b8..b4ef16c6 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/index.md b/doc_source/index.md index aa1f01b2..e093d91b 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -22,7 +22,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda concepts](gettingstarted-concepts.md) + [AWS Lambda features](gettingstarted-features.md) + [Tools for working with AWS Lambda](gettingstarted-tools.md) - + [AWS Lambda limits](gettingstarted-limits.md) + + [AWS Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) @@ -102,6 +102,7 @@ Amazon's trademarks and trade dress may not be used in + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 211a9727..af4b3d35 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -3,8 +3,9 @@ An event source mapping is an AWS Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. **Services that Lambda reads events from** -+ [Amazon Kinesis](with-kinesis.md) + [Amazon DynamoDB](with-ddb.md) ++ [Amazon Kinesis](with-kinesis.md) ++ [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index b1e131a6..ef5329f2 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -4,9 +4,9 @@ The first time you invoke your function, AWS Lambda creates an instance of the f Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. -**Burst concurrency limits** +**Burst concurrency quotas** + **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) -+ **1000** – Asia Pacific \(Tokyo\), Europe \(Frankfurt\) ++ **1000** – Asia Pacific \(Tokyo\), Europe \(Frankfurt\), US East \(Ohio\) + **500** – Other Regions After the initial burst, your functions' concurrency can scale by an additional 500 instances each minute\. This continues until there are enough instances to serve all requests, or until a concurrency limit is reached\. When requests come in faster than your function can scale, or when your function is at maximum concurrency, additional requests fail with a throttling error \(429 status code\)\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index d2aaf53f..03974c31 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index fdc14b48..0f5e5e6d 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -84,7 +84,7 @@ Actions that operate on a function can be restricted to a specific function by f | --- | --- | --- | | [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` | | [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | None | -| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:Layer` | +| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | | [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListAliases](API_ListAliases.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | None | | [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) [ListTags](API_ListTags.md) [TagResource](API_TagResource.md) [UntagResource](API_UntagResource.md) | `*` | None | @@ -107,6 +107,9 @@ For these actions, the resource is the event source mapping, so Lambda provides Layer actions let you restrict the layers that a user can manage or use with a function\. Actions related to layer use and permissions act on a version of a layer, while `PublishLayerVersion` acts on a layer name\. You can use either with wildcards to restrict the layers that a user can work with by name\. +**Note** +Note: the [GetLayerVersion](API_GetLayerVersion.md) action also covers [GetLayerVersionByArn](API_GetLayerVersionByArn.md)\. Lambda does not support `GetLayerVersionByArn` as an IAM action\. + **Layers** diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index e2c21758..b4ea5497 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -109,8 +109,9 @@ $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws The following managed policies provide permissions that are required to use Lambda features: + **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. -+ **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. + **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. ++ **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. ++ **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon MSK cluster\. + **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. + **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a VPC\. + **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. @@ -120,8 +121,9 @@ For some features, the Lambda console attempts to add missing permissions to you When you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function, Lambda uses the execution role to read event data\. For example, an event source mapping for Amazon Kinesis reads events from a data stream and sends them to your function in batches\. You can use event source mappings with the following services: **Services that Lambda reads events from** -+ [Amazon Kinesis](with-kinesis.md) + [Amazon DynamoDB](with-ddb.md) ++ [Amazon Kinesis](with-kinesis.md) ++ [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) In addition to the managed policies, the Lambda console provides templates for creating a custom policy that has the permissions related to additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index f75d8dae..e8d27f4e 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -10,6 +10,7 @@ Lambda supports the following Java runtimes\. | Name | Identifier | JDK | Operating system | | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | | Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 92a6800e..31e914a3 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,8 +9,8 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.631\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.631\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.721\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.721\.0 | Amazon Linux 2 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 268ebc9c..399f72a6 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -1,6 +1,6 @@ # Building Lambda functions with Python -You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Python that execute your code to process events\. Your code runs in an environment that includes the SDK for Python \(Boto 3\), with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Python that execute your code to process events\. Your code runs in an environment that includes the SDK for Python \(Boto3\), with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. Lambda supports the following Python runtimes\. @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 665f4f10..6e1cfc6d 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,7 +4,11 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | -| [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | +| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | +| [New event source to provide Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | +| [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | +| [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | +| [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | | [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | @@ -37,7 +41,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Application Load Balancer triggers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss) | Elastic Load Balancing now supports Lambda functions as a target for Application Load Balancers\. For details, see [Using Lambda with application load balancers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using AWS Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | -| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [AWS Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | +| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [AWS Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | | [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. For details, see [AWS GovCloud \(US\-East\) now open](https://aws.amazon.com/blogs/aws/aws-govcloud-us-east-now-open/?icmpid=docs_lambda_rss) on the AWS blog\. | November 12, 2018 | | [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index e5960ea3..191e3803 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,18 +19,18 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.631\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.631\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.721\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.721\.0 | Amazon Linux 2 | **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.12\.49 botocore\-1\.15\.49 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | **Ruby runtimes** @@ -46,6 +46,7 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | JDK | Operating system | | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | | Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | @@ -70,6 +71,7 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- | Name | Identifier | Operating system | | --- | --- | --- | +| Custom Runtime | `provided.al2` | Amazon Linux 2 | | Custom Runtime | `provided` | Amazon Linux | **Topics** diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 5f364b1f..8483a417 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -49,8 +49,9 @@ The Lambda runtime converts the event document into an object and passes it to y For services that generate a queue or data stream, you create an [event source mapping](invocation-eventsourcemapping.md) in Lambda and grant Lambda permission to access the other service in the [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. **Services that Lambda reads events from** -+ [Amazon Kinesis](with-kinesis.md) + [Amazon DynamoDB](with-ddb.md) ++ [Amazon Kinesis](with-kinesis.md) ++ [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index a08421c3..18f76a39 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -111,4 +111,33 @@ The `eventName` may include date and version information, such as `"GetFunction2 ## Using CloudTrail to track function invocations -CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. \ No newline at end of file +CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. + +### Using CloudTrail to troubleshoot disabled event sources + +One data event that can be encountered is a `LambdaESMDisabled` event\. There are five general categories of error that are associated with this event: + +**`RESOURCE_NOT_FOUND`** +The resource specified in the request does not exist\. + +**`FUNCTION_NOT_FOUND`** +The function attached to the event source does not exist\. + +**`REGION_NAME_NOT_VALID`** +A Region name provided to the event source or function is invalid\. + +**`AUTHORIZATION_ERROR`** +Permissions have not been set, or are misconfigured\. + +**`FUNCTION_IN_FAILED_STATE`** +The function code does not compile, has encountered an unrecoverable exception, or a bad deployment has occurred\. + +These errors are included in the CloudTrail event message within the `serviceEventDetails` entity\. + +**Example `serviceEventDetails` entity** + +``` + "serviceEventDetails":{ + "ESMDisableReason":"Lambda Function not found" +} +``` \ No newline at end of file diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 6b22de36..c19f5714 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -55,7 +55,7 @@ Performance metrics provide performance details about a single invocation\. For Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. **Concurrency metrics** -+ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions limit](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, additional invocation requests are throttled\. ++ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, additional invocation requests are throttled\. + `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on [provisioned concurrency](configuration-concurrency.md)\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. + `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, `.5` indicates that 50 percent of allocated provisioned concurrency is in use\. + `UnreservedConcurrentExecutions` – For an AWS Region, the number of events that are being processed by functions that don't have reserved concurrency\. \ No newline at end of file diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index e06816ec..86fb4720 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -45,10 +45,14 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the SDK for JavaScript, install them to a local directory with [npm](https://www.npmjs.com/), and include them in your deployment package\. You can also include the SDK for JavaScript if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. +If your function depends on libraries other than the SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, use an [Amazon Linux environment ](https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. + +You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. **To update a Node\.js function with dependencies** +1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. + 1. Install libraries in the node\_modules directory with the `npm install` command\. ``` diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 686fd8dc..fb82cafb 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 9ba8f458..ab4edb47 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -180,4 +180,4 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true -``` +``` \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 1c2033a3..236d0a99 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -61,7 +61,7 @@ To create or update a function with the Lambda API, create an archive that conta ## Updating a function with additional dependencies -If your function depends on libraries other than the SDK for Python \(Boto 3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. +If your function depends on libraries other than the SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. **Note** For libraries that use extension modules written in C or C\+\+, build your deployment package in an Amazon Linux environment\. You can use the [SAM CLI build command](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html), which uses Docker, or build your deployment package on Amazon EC2 or AWS CodeBuild\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index e5c673f0..bbe707bb 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index a01f75eb..8583a421 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index dcc433ba..29c5a2bd 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -6,7 +6,7 @@ It takes time to set up an execution context and do the necessary "bootstrapping After a Lambda function is executed, AWS Lambda maintains the execution context for some time in anticipation of another Lambda function invocation\. In effect, the service freezes the execution context after a Lambda function completes, and thaws the context for reuse, if AWS Lambda chooses to reuse the context when the Lambda function is invoked again\. This execution context reuse approach has the following implications: + Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We suggest adding logic in your code to check if a connection exists before creating one\. -+ Each execution context provides 512 MB of additional disk space in the `/tmp` directory\. The directory content remains when the execution context is frozen, providing transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For information on deployment limits, see [AWS Lambda limits](gettingstarted-limits.md)\. ++ Each execution context provides 512 MB of additional disk space in the `/tmp` directory\. The directory content remains when the execution context is frozen, providing transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For information on deployment limits, see [AWS Lambda quotas](gettingstarted-limits.md)\. + Background processes or callbacks initiated by your Lambda function that did not complete when the function ended resume if AWS Lambda chooses to reuse the execution context\. You should make sure any background processes or callbacks in your code are complete before the code exits\. When you write your Lambda function code, do not assume that AWS Lambda automatically reuses the execution context for subsequent function invocations\. Other factors may dictate a need for AWS Lambda to create a new execution context, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 79a3107a..743ac593 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -28,7 +28,7 @@ You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormati ## Architecture and handler code The sample application consists of function code, an AWS CloudFormation template, and supporting resources\. When you deploy the sample, you use the following AWS services: -+ AWS Lambda – Runs function code, sends logs to CloudWatch Logs, and sends trace data to X\-Ray\. The function also calls the Lambda API to get details about the account's limits and usage in the current Region\. ++ AWS Lambda – Runs function code, sends logs to CloudWatch Logs, and sends trace data to X\-Ray\. The function also calls the Lambda API to get details about the account's quotas and usage in the current Region\. + [AWS X\-Ray](https://aws.amazon.com/xray) – Collects trace data, indexes traces for search, and generates a service map\. + [Amazon CloudWatch](https://aws.amazon.com/cloudwatch) – Stores logs and metrics\. + [AWS Identity and Access Management \(IAM\)](https://aws.amazon.com/iam) – Grants permission\. diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 20c6de33..7d452d0a 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -6,7 +6,7 @@ For more information about AWS Regions and Availability Zones, see [AWS global i In addition to the AWS global infrastructure, Lambda offers several features to help support your data resiliency and backup needs\. + **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [AWS Lambda function versions](configuration-versions.md)\. -+ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [limit](gettingstarted-limits.md) that can be increased if needed\. For details, see [AWS Lambda function scaling](invocation-scaling.md)\. ++ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [AWS Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. + **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. + **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 5392046f..83e01839 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -325,7 +325,7 @@ Set `content-type` of the `POST` method response and integration response to JSO ``` $ aws apigateway put-method-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-models "{\"application/json"\":""\"Empty"\"}""" + --status-code 200 --response-models application/json=Empty { "statusCode": "200", "responseModels": { @@ -338,7 +338,7 @@ Set `content-type` of the `POST` method response and integration response to JSO ``` $ aws apigateway put-integration-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-templates "{\"application/json"\":""\"\"}"" + --status-code 200 --response-templates application/json="" { "statusCode": "200", "responseTemplates": { @@ -346,6 +346,8 @@ Set `content-type` of the `POST` method response and integration response to JSO } } ``` +**Note** +If you encounter an error running this command, you can use escape characters around the response template field for more clarity\. The text `application/json=""` becomes `"{\"application/json"\":""\"\"}""`\. ### Deploy the API @@ -473,4 +475,4 @@ Or, you can use the following Curl command: ``` $ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` +``` \ No newline at end of file diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md index 6f5a3941..3c8a288b 100644 --- a/doc_source/services-efs.md +++ b/doc_source/services-efs.md @@ -11,8 +11,8 @@ Amazon EFS supports [file locking](https://docs.aws.amazon.com/efs/latest/ug/how Amazon EFS provides options to customize your file system based on your application's need to maintain high performance at scale\. There are three primary factors to consider: the number of connections, throughput \(in MiB per second\), and IOPS\. -**Limits** -For detail on file system limits, see [Quotas for Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-fs-specific) in the *Amazon Elastic File System User Guide*\. +**Quotas** +For detail on file system quotas and limits, see [Quotas for Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-fs-specific) in the *Amazon Elastic File System User Guide*\. To avoid issues with scaling, throughput, and IOPS, monitor the [metrics](https://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html) that Amazon EFS sends to Amazon CloudWatch\. For an overview of monitoring in Amazon EFS, see [Monitoring Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/monitoring_overview.html) in the *Amazon Elastic File System User Guide*\. diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index a9789cc9..aa6d16d5 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -23,7 +23,7 @@ X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charge Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. @@ -64,7 +64,7 @@ Instead of sending trace data directly to the X\-Ray API, the X\-Ray SDK uses a The Lambda runtime allows the daemon to up to 3 percent of your function's configured memory or 16 MB, whichever is greater\. If your function runs out of memory during invocation, the runtime terminates the daemon process first to free up memory\. -Since the daemon process is fully managed by AWS Lambda, it cannot be configured by the user. This means that all segments generated from Lambda function invocations are recorded in the same account as the Lambda, and the daemon cannot be configured to redirect them to another account. +The daemon process is fully managed by Lambda and cannot be configured by the user\. All segments generated by function invocations are recorded in the same account as the Lambda function\. The daemon cannot be configured to redirect them to any other account\. For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html) in the X\-Ray Developer Guide\. @@ -111,4 +111,4 @@ Resources: Properties: Tracing: Active ... -``` +``` \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index fcc117b1..4c7a7053 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -1,6 +1,6 @@ # Troubleshoot execution issues in AWS Lambda -When the Lambda runtime executes your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur when during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. +When the Lambda runtime executes your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. Function execution errors can be caused by issues with your code, function configuration, downstream resources, or permissions\. If you invoke your function directly, you see function errors in the response from Lambda\. If you invoke your function asynchronously, with an event source mapping, or through another service, you might find errors in logs, a dead\-letter queue, or an on\-failure destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 10579b54..2941046f 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -73,7 +73,7 @@ Lambda reads records from the stream and invokes your function [synchronously](i Lambda polls shards in your DynamoDB stream for records at a base rate of 4 times per second\. When records are available, Lambda invokes your function and waits for the result\. If processing succeeds, Lambda resumes polling until it receives more records\. -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. @@ -237,7 +237,7 @@ $ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b1 The event source mapping that reads records from your DynamoDB stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. -If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry limit\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry limit\. +If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. If the error handling measures fail, Lambda discards the records and continues processing batches from the stream\. With the default settings, this means that a bad record can block processing on the affected shard for up to one day\. To avoid this, configure your function's event source mapping with a reasonable number of retries and a maximum record age that fits your use case\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 80fb1969..e0508133 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -1,6 +1,17 @@ # Using AWS Lambda with Amazon Kinesis -You can use an AWS Lambda function to process records in an [Amazon Kinesis data stream](https://docs.aws.amazon.com/kinesis/latest/dev/amazon-kinesis-streams.html)\. With Kinesis, you can collect data from many sources and process them with multiple consumers\. Lambda supports standard data stream iterators and HTTP/2 stream consumers\. +You can use an AWS Lambda function to process records in an [Amazon Kinesis data stream](https://docs.aws.amazon.com/kinesis/latest/dev/amazon-kinesis-streams.html)\. + +A Kinesis data stream is a set of [shards](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#shard)\. Each shard contains a sequence of data records\. A **consumer** is an application that processes the data from a Kinesis data stream\. You can map a Lambda function to a shared\-throughput consumer \(standard iterator\), or to a dedicated\-throughput consumer with [enhanced fan\-out](https://docs.aws.amazon.com/kinesis/latest/dev/enhanced-consumers.html)\. + +For standard iterators, Lambda polls each shard in your Kinesis stream for records using HTTP protocol\. The event source mapping shares read throughput with other consumers of the shard\. + +To minimize latency and maximize read throughput, you can create a data stream consumer with enhanced fan\-out\. Stream consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. The dedicated throughput can help if you have many applications reading the same data, or if you're reprocessing a stream with large records\. Kinesis pushes records to Lambda over HTTP/2\. + + For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. + +**Note** +Error handling is not available for HTTP/2 stream consumers\. Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. @@ -45,12 +56,7 @@ Lambda reads records from the data stream and invokes your function [synchronous } ``` -If you have multiple applications that are reading records from the same stream, you can use Kinesis stream consumers instead of standard iterators\. Consumers have dedicated read throughput so they don't have to compete with other consumers of the same data\. With consumers, Kinesis pushes records to Lambda over an HTTP/2 connection, which can also reduce latency between adding a record and function invocation\. - -**Note** -Error handling and concurrency settings are not available for HTTP/2 stream consumers\. - -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. @@ -73,9 +79,7 @@ Your Lambda function is a consumer application for your data stream\. It process For standard iterators, Lambda polls each shard in your Kinesis stream for records at a base rate of once per second\. When more records are available, Lambda keeps processing batches until the function catches up with the stream\. The event source mapping shares read throughput with other consumers of the shard\. -To minimize latency and maximize read throughput, create a data stream consumer\. Stream consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. The dedicated throughput can help if you have many applications reading the same data, or if you're reprocessing a stream with large records\. - -Stream consumers use HTTP/2 to reduce latency by pushing records to Lambda over a long\-lived connection and by compressing request headers\. You can create a stream consumer with the Kinesis [RegisterStreamConsumer](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html) API\. +To minimize latency and maximize read throughput, create a data stream consumer with enhanced fan\-out\. Enhanced fan\-out consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. Stream consumers use HTTP/2 to reduce latency by pushing records to Lambda over a long\-lived connection and by compressing request headers\. You can create a stream consumer with the Kinesis [RegisterStreamConsumer](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html) API\. ``` $ aws kinesis register-stream-consumer --consumer-name con1 \ @@ -92,7 +96,7 @@ $ aws kinesis register-stream-consumer --consumer-name con1 \ To increase the speed at which your function processes records, add shards to your data stream\. Lambda processes records in each shard in order\. It stops processing additional records in a shard if your function returns an error\. With more shards, there are more batches being processed at once, which lowers the impact of errors on concurrency\. -If your function can't scale up to handle the total number of concurrent batches, [request a limit increase](gettingstarted-limits.md) or [reserve concurrency](configuration-concurrency.md) for your function\. +If your function can't scale up to handle the total number of concurrent batches, [request a quota increase](gettingstarted-limits.md) or [reserve concurrency](configuration-concurrency.md) for your function\. ## Execution role permissions @@ -250,7 +254,7 @@ $ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b1 The event source mapping that reads records from your Kinesis stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. -If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry limit\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry limit\. +If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. If the error handling measures fail, Lambda discards the records and continues processing batches from the stream\. With the default settings, this means that a bad record can block processing on the affected shard for up to one week\. To avoid this, configure your function's event source mapping with a reasonable number of retries and a maximum record age that fits your use case\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md new file mode 100644 index 00000000..0f147483 --- /dev/null +++ b/doc_source/with-msk.md @@ -0,0 +1,164 @@ +# Using Lambda with Amazon MSK + +Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) is a managed service that enables you to build and run applications that use [Apache Kafka](http://aws.amazon.com/msk/what-is-kafka/) to process streaming data\. Apache Kafka is a distributed streaming platform that is conceptually similar to [Amazon Kinesis](http://aws.amazon.com/kinesis)\. With Amazon MSK, you can collect data from many sources and process them with multiple consumers\. + +You can use a Lambda function to process records in a Kafka topic\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads items from a topic and invokes the function\. Lambda polls across multiple partitions for new records and invokes your target function [synchronously](invocation-sync.md)\. + +The Amazon MSK event source mapping supports the following features: ++ Full compatibility with all Kafka versions that Amazon MSK supports\. For more information, see [Supported Apache Kafka versions](https://docs.aws.amazon.com/msk/latest/developerguide/supported-kafka-versions.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ Both plaintext and TLS encrypted brokers\. TLS brokers are not supported with a private certificate authority\. For more information, see the **Encryption in Transit** section of [Amazon MSK Encryption](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html#msk-encryption-in-transit) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ Configurable starting positions and batch sizes\. The configurable starting positions supported are `TRIM_HORIZON` and `LATEST`\. They are not timestamp\-based\. + +The following Kafka features are not supported: ++ Authentication – SSL and SASL authentication are not supported\. ++ Schema registry – You can host your own schema registry, but the Lambda API doesn't support this functionality\. For more information, see [Schema Management](https://docs.confluent.io/current/schema-registry/index.html) on the Confluent website\. + +**Topics** ++ [Lambda consumer group](#services-msk-configure) ++ [Execution role permissions](#events-kinesis-permissions) ++ [Configuring a topic as an event source](#services-msk-eventsourcemapping) ++ [Event source mapping API](#services-msk-api) ++ [Event source mapping errors](#services-msk-errors) + +## Lambda consumer group + +To interact with Amazon MSK, Lambda creates a consumer group which can read from multiple Kafka topics\. The consumer group is created with the same ID as an event source mapping UUID\. The Lambda created consumer group is also used for checkpointing\. The group's position in each topic partition is committed to Kafka after successful processing\. + +Lambda processes records from one or more partitions and then sends the payload to the target function\. When more records are available, Lambda continues processing batches until the function catches up with the topic\. The maximum supported function execution time is 14 minutes\. + +**Example Amazon MSK record event** + +``` +Received event:{ + "eventSource": "aws:kafka", + "eventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/ExampleMSKCluster/e9f754c6-d29a-4430-a7db-958a19fd2c54-4", + "records": { + "AWSKafkaTopic-0": [ + { + "topic": "AWSKafkaTopic", + "partition": 0, + "offset": 0, + "timestamp": 1595035749700, + "timestampType": "CREATE_TIME", + "key": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj", + "value": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj" + } + ] + } +} +``` + +**Note** +The key\-value set of an `aws:kafka` resource is base64\-encoded\. + +## Execution role permissions + +Your Lambda function's [execution role](lambda-intro-execution-role.md) needs the following permissions to read records from an Amazon MSK cluster: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +The AWS managed policy `AWSLambdaMSKExecutionRole` includes these permissions\. For more information, see [Managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. + +## Configuring a topic as an event source + +Create an [event source mapping](invocation-eventsourcemapping.md) to tell Lambda to send records from a Kafka topic to a Lambda function\. You can create multiple event source mappings to process the same data with multiple functions, or to process items from multiple topics with a single function\. + +To configure your function to read from Amazon MSK, create an **MSK** trigger in the Lambda console\. + +**To create a trigger** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **Designer**, choose **Add trigger**\. + +1. Choose a trigger type\. + +1. Configure the required options and then choose **Add**\. + +Lambda supports the following options for Amazon MSK event sources: ++ **MSK cluster** – Select the MSK cluster\. ++ **Topic name** – Enter the Kafka topic to consume\. ++ **Starting position** \(optional\) – Enter the position in the stream to begin reading records\. + + **Latest** – Read from the latest position in all the topic's partitions\. + + **Trim Horizon** – Read from the oldest position in all the topic partitions\. + + After processing any existing records, the function is caught up and continues to process new records\. ++ **Enable trigger** – Disable the trigger to stop processing records\. + +To enable or disable the trigger \(or delete it\), choose the **MSK** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API commands\. + +## Event source mapping API + +To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +The Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html) and doesn't need to be configured in the `create-event-source-mapping` setup\. + +The following AWS CLI example maps a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`, with the starting position set to `latest`: + +``` +$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +{ + "UUID": "6d9bce8e-836b-442c-8070-74e77903c815", + "BatchSize": 100, + "EventSourceArn": "arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2", + "FunctionArn": "arn:aws:lambda:us-west-2:111111111111:function:my-kafka-function", + "LastModified": 1580331394.363, + "State": "Creating", + "StateTransitionReason": "USER_INITIATED", + "LastProcessingResult": "OK", + "Topics": [ "AWSKafkaTopic" ] +} +``` + +Use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command to view the current status of your resource\. + +``` +$ aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +{ + "UUID": "6d9bce8e-836b-442c-8070-74e77903c815" + "BatchSize": 100, + "EventSourceArn": "arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2", + "FunctionArn": "arn:aws:lambda:us-west-2:111111111111:function:my-kafka-function", + "LastModified": 1580331394.363, + "State": "Enabled", + "StateTransitionReason": "User action", + "LastProcessingResult": "OK", + "Topics": [ "AWSKafkaTopic" ], +} +``` + +## Event source mapping errors + +When a Lambda function encounters an unrecoverable error, your Kafka topic consumer stops processing records\. Any other consumers may continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda failed to authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda does not have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The function's configuration is not valid\. + +Records will also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 04506db6..b24c3f6c 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -163,20 +163,16 @@ The deployment package is a \.zip file containing your Lambda function code and **To create a deployment package** +1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. + 1. Save the function code as `index.js` in a folder named `lambda-s3`\. -1. Install the Sharp library with npm\. For Linux, use the following command\. +1. Install the Sharp library with npm\. ``` lambda-s3$ npm install sharp ``` - For macOS, use the following command\. - - ``` - lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp - ``` - After you complete this step, you will have the following folder structure: ``` diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index dadd2f76..68e79f94 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -36,7 +36,7 @@ The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the funct ## Create the function -The following example code receives an Amazon SQS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +The following example shows how to process each Amazon SQS message in the event input\. See [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) for an example of an event with multiple messages\. In the example, the code writes each message to a log in CloudWatch Logs\. **Note** For sample code in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. From 2e25d965da9bc1afecb04e8db1c08f9c17f24478 Mon Sep 17 00:00:00 2001 From: JohnMMcD Date: Wed, 26 Aug 2020 12:57:04 -0400 Subject: [PATCH 032/243] Changed "Events" label to match the S3 UI --- doc_source/with-s3-example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index b24c3f6c..0383f365 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -304,7 +304,7 @@ This procedure configures the bucket to invoke your function every time an objec 1. Under **Events**, configure a notification with the following settings\. + **Name** – **lambda\-trigger**\. - + **Events** – **ObjectCreate \(All\)**\. + + **Events** – **All object create events**\. + **Send to** – **Lambda function**\. + **Lambda** – **CreateThumbnail**\. @@ -318,4 +318,4 @@ Now you can test the setup as follows: 1. Verify that the thumbnail was created in the target bucket using the `CreateThumbnail` function\. -1. View logs in the CloudWatch console\. \ No newline at end of file +1. View logs in the CloudWatch console\. From b1a45de85c9882b3e2f9f5f5f5a0f7f0e7d1d85b Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Sat, 19 Sep 2020 19:38:14 -0700 Subject: [PATCH 033/243] updates --- doc_source/API_CreateEventSourceMapping.md | 6 +- doc_source/API_CreateFunction.md | 4 +- doc_source/API_DeleteEventSourceMapping.md | 6 +- .../API_EventSourceMappingConfiguration.md | 6 +- doc_source/API_FunctionConfiguration.md | 2 +- doc_source/API_GetEventSourceMapping.md | 6 +- doc_source/API_GetFunctionConfiguration.md | 2 +- doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 4 +- doc_source/API_PublishVersion.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 6 +- doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/API_UpdateFunctionConfiguration.md | 4 +- doc_source/access-control-identity-based.md | 2 +- doc_source/access-control-resource-based.md | 22 +- doc_source/best-practices.md | 1 + doc_source/build-pipeline.md | 290 ------------------ doc_source/configuration-aliases.md | 100 +++--- doc_source/configuration-concurrency.md | 4 +- doc_source/configuration-envvars.md | 7 +- doc_source/configuration-versions.md | 51 +-- doc_source/gettingstarted-concepts.md | 2 +- doc_source/index.md | 11 +- doc_source/java-logging.md | 2 +- doc_source/java-package.md | 8 +- doc_source/lambda-api-permissions-ref.md | 112 ++++++- doc_source/lambda-functions.md | 4 +- doc_source/lambda-nodejs.md | 4 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-releases.md | 2 +- doc_source/lambda-runtimes.md | 12 +- doc_source/lambda-services.md | 1 - doc_source/lambda-stepfunctions.md | 8 + doc_source/python-package.md | 6 +- doc_source/ruby-handler.md | 2 +- doc_source/security-resilience.md | 2 +- .../security_iam_id-based-policy-examples.md | 2 +- doc_source/services-alexa.md | 2 +- doc_source/services-apigateway-tutorial.md | 48 ++- doc_source/services-codepipeline.md | 8 +- doc_source/services-rds-tutorial.md | 56 +++- doc_source/services-rds.md | 56 ++-- doc_source/services-stepfunctions.md | 77 +++-- doc_source/stepfunctions-lc.md | 63 ++++ doc_source/stepfunctions-patterns.md | 142 +++++++++ doc_source/troubleshooting-deployment.md | 2 +- doc_source/with-ddb-example.md | 38 ++- doc_source/with-ddb.md | 2 +- doc_source/with-msk.md | 4 + doc_source/with-s3-example.md | 44 ++- 54 files changed, 757 insertions(+), 508 deletions(-) delete mode 100644 doc_source/build-pipeline.md create mode 100644 doc_source/lambda-stepfunctions.md create mode 100644 doc_source/stepfunctions-lc.md create mode 100644 doc_source/stepfunctions-patterns.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index b510242c..90ad528c 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -189,7 +189,7 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -215,7 +215,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -230,7 +230,7 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index d5dc6cf0..f87bbbec 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -150,7 +150,7 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** @@ -335,7 +335,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 1519f107..bc2a66e2 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -66,7 +66,7 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -92,7 +92,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -107,7 +107,7 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 4e6ffa45..df9d1b6a 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -11,7 +11,7 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No **BisectBatchOnFunctionError** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean Required: No @@ -43,7 +43,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -61,7 +61,7 @@ Valid Range: Minimum value of 0\. Maximum value of 10000\. Required: No **ParallelizationFactor** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index ee92799c..2fa66b1c 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -115,7 +115,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **State** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index d34f0505..d8655214 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -64,7 +64,7 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -90,7 +90,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -105,7 +105,7 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 2c53758b..4d3a9dc4 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -196,7 +196,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 536b6eef..5db2459c 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -58,7 +58,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index d0b8fba7..b344bc74 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -54,7 +54,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 39ca87c0..645c53cd 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 430415ab..1e38e5f3 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index c54b437d..cf6939f7 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 79f808da..bf7cbd1b 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -96,7 +96,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 338fea3b..4e1749f3 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -216,7 +216,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index b13f8eb0..2b32da21 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -154,7 +154,7 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -180,7 +180,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -195,7 +195,7 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 39e26936..f0f55d47 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -241,7 +241,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 90719883..f4b2ea77 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -130,7 +130,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -310,7 +310,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 5e42653b..4b3e15f6 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -167,7 +167,7 @@ The permissions in the policy are organized into statements based on the [resour This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to Amazon S3 actions to manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. +When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. ## Layer development and use diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 3cf8961d..53de338b 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -1,8 +1,8 @@ # Using resource\-based policies for AWS Lambda -AWS Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other accounts on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function\. +AWS Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. -For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can add multiple statements to grant access to multiple accounts, or let any account invoke your function\. For functions that another AWS service invokes in response to activity in your account, you use the policy to [grant invoke permission to the service](#permissions-resource-serviceinvoke)\. +For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can add multiple statements to grant access to several accounts, or let any account invoke your function\. You can also use the policy to [grant invoke permission to an AWS service](#permissions-resource-serviceinvoke) that invokes a function in response to activity in your account\. **To view a function's resource\-based policy** @@ -15,10 +15,10 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc 1. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-resourcebased.png) -For Lambda layers, you use a resource\-based policy on a version of the layer to let other accounts use it\. In addition to policies that grant permission to a single account or all accounts, for layers, you can also grant permission to all accounts in an organization\. +For Lambda layers, you can only use a resource\-based policy on a specific layer version, instead of the entire layer\. In addition to policies that grant permission to a single account or multiple accounts, for layers, you can also grant permission to all accounts in an organization\. **Note** -You can only update resource\-based policies for Lambda resources within the scope of the [AddPermission](API_AddPermission.md) and [AddLayerVersionPermission](API_AddLayerVersionPermission.md) API actions\. You can't author policies for your Lambda resources in JSON, or use conditions that don't map to parameters for those actions\. +You can only update resource\-based policies for Lambda resources within the scope of the [AddPermission](API_AddPermission.md) and [AddLayerVersionPermission](API_AddLayerVersionPermission.md) API actions\. Currently, you can't author policies for your Lambda resources in JSON, or use conditions that don't map to parameters for those actions\. Resource\-based policies apply to a single function, version, alias, or layer version\. They grant permission to one or more services and accounts\. For trusted accounts that you want to have access to multiple resources, or to use API actions that resource\-based policies don't support, you can use [cross\-account roles](access-control-identity-based.md)\. @@ -30,10 +30,10 @@ Resource\-based policies apply to a single function, version, alias, or layer ve ## Granting function access to AWS services -When you [use an AWS service to invoke your function](lambda-services.md), you grant permission in a statement on a resource\-based policy\. You can apply the statement to the function, or limit it to a single version or alias\. +When you [use an AWS service to invoke your function](lambda-services.md), you grant permission in a statement on a resource\-based policy\. You can apply the statement to the entire function to be invoked or managed, or limit the statement to a single version or alias\. **Note** -When you add a trigger to your function with the Lambda console, the console updates the function's resource\-based policy to allow the service to invoke it\. To grant permissions to other accounts or services that aren't available in the Lambda console, use the AWS CLI\. +When you add a trigger to your function with the Lambda console, the console updates the function's resource\-based policy to allow the service to invoke it\. To grant permissions to other accounts or services that aren't available in the Lambda console, you can use the AWS CLI\. Add a statement with the `add-permission` command\. The simplest resource\-based policy statement allows a service to invoke a function\. The following command grants Amazon SNS permission to invoke a function named `my-function`\. @@ -43,7 +43,7 @@ $ aws lambda add-permission --function-name my-function --action lambda:InvokeFu {"Sid":"sns","Effect":"Allow","Principal":{"Service":"sns.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` -This lets Amazon SNS invoke the function, but it doesn't restrict the Amazon SNS topic that triggers the invocation\. To ensure that your function is only invoked by a specific resource, specify the Amazon Resource Name \(ARN\) of the resource with the `source-arn` option\. The following command only allows Amazon SNS to invoke the function for subscriptions to a topic named `my-topic`\. +This lets Amazon SNS call the `lambda:Invoke` API for the function, but it doesn't restrict the Amazon SNS topic that triggers the invocation\. To ensure that your function is only invoked by a specific resource, specify the Amazon Resource Name \(ARN\) of the resource with the `source-arn` option\. The following command only allows Amazon SNS to invoke the function for subscriptions to a topic named `my-topic`\. ``` $ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ @@ -81,11 +81,13 @@ $ aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:functi } ``` -You can then update the alias to point to new versions as needed\. When you update the alias, the other account doesn't need to change its code to use the new version, and it only has permission to invoke the version that you choose\. +The function owner can then update the alias to point to a new version without the caller needing to change the way they invoke your function\. This ensures that the other account doesn't need to change its code to use the new version, and it only has permission to invoke the version of the function associated with the alias\. You can grant cross\-account access for most API actions that [operate on an existing function](lambda-api-permissions-ref.md#permissions-resources-function)\. For example, you could grant access to `lambda:ListAliases` to let an account get a list of aliases, or `lambda:GetFunction` to let them download your function code\. Add each permission separately, or use `lambda:*` to grant access to all actions for the specified function\. **Cross\-account APIs** + +Currently, Lambda doesn’t currently support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: + [Invoke](API_Invoke.md) + [GetFunction](API_GetFunction.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) @@ -105,7 +107,7 @@ You can grant cross\-account access for most API actions that [operate on an exi + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) -To grant other accounts permission for multiple functions, or for actions that don't operate on a function, use [roles](access-control-identity-based.md)\. +To grant other accounts permission for multiple functions, or for actions that don't operate on a function, we recommend that you use [IAM roles](access-control-identity-based.md)\. ## Granting layer access to other accounts @@ -128,7 +130,7 @@ $ aws lambda add-layer-version-permission --layer-name my-layer \ b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" ``` -To grant permission to all AWS accounts, use `*` for the principal, and omit the organization ID\. For multiple accounts or organizations, add multiple statements\. +To grant permission to all AWS accounts, use `*` for the principal, and omit the organization ID\. For multiple accounts or organizations, you need to add multiple statements\. ## Cleaning up resource\-based policies diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index ee2227be..b51642ac 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -27,6 +27,7 @@ The following are recommended best practices for using AWS Lambda: + **Take advantage of execution context reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. To avoid potential data leaks across invocations, don’t use the execution context to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. ++ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. + **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. + **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [AWS Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. diff --git a/doc_source/build-pipeline.md b/doc_source/build-pipeline.md deleted file mode 100644 index b7a07013..00000000 --- a/doc_source/build-pipeline.md +++ /dev/null @@ -1,290 +0,0 @@ -# Building a continuous delivery pipeline for a Lambda application with AWS CodePipeline - -You can use AWS CodePipeline to create a continuous delivery pipeline for your Lambda application\. CodePipeline combines source control, build, and deployment resources to create a pipeline that runs whenever you make a change to your application's source code\. - -In this tutorial, you create the following resources\. -+ **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare an AWS Serverless Application Model \(AWS SAM\) template for deployment\. -+ **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the AWS SAM template from the build output, create a change set in AWS CloudFormation, and execute the change set to update the application's AWS CloudFormation stack\. -+ **AWS CloudFormation stack** – The deployment stage uses a template to create a stack in AWS CloudFormation\. The template is a YAML\-formatted document that defines the resources of the Lambda application\. The application includes a Lambda function and an Amazon API Gateway API that invokes it\. -+ **Roles** – The pipeline, build, and deployment each have a service role that allows them to manage AWS resources\. The console creates the pipeline and build roles when you create those resources\. You create the role that allows AWS CloudFormation to manage the application stack\. - -The pipeline maps a single branch in a repository to a single AWS CloudFormation stack\. You can create additional pipelines to add environments for other branches in the same repository\. You can also add stages to your pipeline for testing, staging, and manual approvals\. For more information about AWS CodePipeline, see [What is AWS CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html)\. - -For an alternate method of creating a pipeline with AWS Serverless Application Model and AWS CloudFormation, watch [Automate your serverless application deployments](https://www.youtube.com/watch?v=0o3urdBeoII) on the Amazon Web Services YouTube channel\. - -**Topics** -+ [Prerequisites](#with-pipeline-prepare) -+ [Create an AWS CloudFormation role](#with-pipeline-create-cfn-role) -+ [Set up a repository](#setup-repository) -+ [Create a pipeline](#create-pipeline1) -+ [Update the build stage role](#update-policy) -+ [Complete the deployment stage](#create-pipeline2) -+ [Test the application](#applications-pipeline-test) - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. - -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: - -``` -~/lambda-project$ this is a command -this is output -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. - -During the build phase, the build script uploads artifacts to Amazon Simple Storage Service \(Amazon S3\)\. You can use an existing bucket, or create a new bucket for the pipeline\. Use the AWS CLI to create a bucket\. - -``` -$ aws s3 mb s3://lambda-deployment-artifacts-123456789012 -``` - -## Create an AWS CloudFormation role - -Create a role that gives AWS CloudFormation permission to access AWS resources\. - -**To create an AWS CloudFormation role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS CloudFormation** - + **Permissions** – **AWSLambdaExecute** - + **Role name** – **cfn\-lambda\-pipeline** - -1. Open the role\. Under the **Permissions** tab, choose **Add inline policy**\. - -1. In **Create Policy**, choose the **JSON** tab and add the following policy\. - - ``` - { - "Statement": [ - { - "Action": [ - "apigateway:*", - "codedeploy:*", - "lambda:*", - "cloudformation:CreateChangeSet", - "iam:GetRole", - "iam:CreateRole", - "iam:DeleteRole", - "iam:PutRolePolicy", - "iam:AttachRolePolicy", - "iam:DeleteRolePolicy", - "iam:DetachRolePolicy", - "iam:PassRole", - "s3:GetObject", - "s3:GetObjectVersion", - "s3:GetBucketVersioning" - ], - "Resource": "*", - "Effect": "Allow" - } - ], - "Version": "2012-10-17" - } - ``` - -## Set up a repository - -Create an AWS CodeCommit repository to store your project files\. For more information, see [Setting up](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html) in the CodeCommit User Guide\. - -**To create a repository** - -1. Open the [Developer tools console](https://console.aws.amazon.com/codesuite/home)\. - -1. Under **Source**, choose **Repositories**\. - -1. Choose **Create repository**\. - -1. Follow the instructions to create and clone a repository named **lambda\-pipeline\-repo**\. - -Create the following files in the repository folder\. - -**Example index\.js** -A Lambda function that returns the current time\. - -``` -var time = require('time'); -exports.handler = (event, context, callback) => { - var currentTime = new time.Date(); - currentTime.setTimezone("America/Los_Angeles"); - callback(null, { - statusCode: '200', - body: 'The time in Los Angeles is: ' + currentTime.toString(), - }); -}; -``` - -**Example template\.yml** -The [AWS SAM template](gettingstarted-tools.md) that defines the application\. - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: Outputs the time -Resources: - TimeFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs10.x - CodeUri: ./ - Events: - MyTimeApi: - Type: Api - Properties: - Path: /TimeResource - Method: GET -``` - -**Example buildspec\.yml** -An [AWS CodeBuild build specification](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) that installs required packages and uploads the deployment package to Amazon S3\. Replace the highlighted text with the name of your bucket\. - -``` -version: 0.2 -phases: - install: - runtime-versions: - nodejs: 10 - build: - commands: - - npm install time - - export BUCKET=lambda-deployment-artifacts-123456789012 - - aws cloudformation package --template-file template.yml --s3-bucket $BUCKET --output-template-file outputtemplate.yml -artifacts: - type: zip - files: - - template.yml - - outputtemplate.yml -``` - -Commit and push the files to CodeCommit\. - -``` -~/lambda-pipeline-repo$ git add . -~/lambda-pipeline-repo$ git commit -m "project files" -~/lambda-pipeline-repo$ git push -``` - -## Create a pipeline - -Create a pipeline that deploys your application\. The pipeline monitors your repository for changes, runs an AWS CodeBuild build to create a deployment package, and deploys the application with AWS CloudFormation\. During the pipeline creation process, you also create the AWS CodeBuild build project\. - -**To create a pipeline** - -1. Open the [Developer tools console](https://console.aws.amazon.com/codesuite/home)\. - -1. Under **Pipeline**, choose **Pipelines**\. - -1. Choose **Create pipeline**\. - -1. Configure the pipeline settings and choose **Next**\. - + **Pipeline name** – **lambda\-pipeline** - + **Service role** – **New service role** - + **Artifact store** – **Default location** - -1. Configure source stage settings and choose **Next**\. - + **Source provider** – **AWS CodeCommit** - + **Repository name** – **lambda\-pipeline\-repo** - + **Branch name** – **master** - + **Change detection options** – **Amazon CloudWatch Events** - -1. For **Build provider**, choose **AWS CodeBuild**, and then choose **Create project**\. - -1. Configure build project settings and choose **Continue to CodePipeline**\. - + **Project name** – **lambda\-pipeline\-build** - + **Operating system** – **Ubuntu** - + **Runtime** – **Standard** - + **Runtime version** – **aws/codebuild/standard:2\.0** - + **Image version** – **Latest** - + **Buildspec name** – **buildspec\.yml** - -1. Choose **Next**\. - -1. Configure deploy stage settings and choose **Next**\. - + **Deploy provider** – **AWS CloudFormation** - + **Action mode** – **Create or replace a change set** - + **Stack name** – **lambda\-pipeline\-stack** - + **Change set name** – **lambda\-pipeline\-changeset** - + **Template** – **BuildArtifact::outputtemplate\.yml** - + **Capabilities** – **CAPABILITY\_IAM**, **CAPABILITY\_AUTO\_EXPAND** - + **Role name** – **cfn\-lambda\-pipeline** - -1. Choose **Create pipeline**\. - -The pipeline fails the first time it runs because it needs additional permissions\. In the next section, you add permissions to the role that's generated for your build stage\. - -## Update the build stage role - -During the build stage, AWS CodeBuild needs permission to upload the build output to your Amazon S3 bucket\. - -**To update the role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **codebuild\-lamba\-pipeline\-build\-service\-role**\. - -1. Choose **Attach policies**\. - -1. Attach **AmazonS3FullAccess**\. - -## Complete the deployment stage - -The deployment stage has an action that creates a change set for the AWS CloudFormation stack that manages your Lambda application\. A change set specifies the changes that are made to the stack, such as adding new resources and updating existing resources\. Change sets let you preview the changes that are made before making them, and add approval stages\. Add a second action that executes the change set to complete the deployment\. - -**To update the deployment stage** - -1. Open your pipeline in the [Developer tools console](https://console.aws.amazon.com/codesuite/home)\. - -1. Choose **Edit**\. - -1. Next to **Deploy**, choose **Edit stage**\. - -1. Choose **Add action group**\. - -1. Configure deploy stage settings and choose **Next**\. - + **Action name** – **execute\-changeset** - + **Action provider** – **AWS CloudFormation** - + **Input artifacts** – **BuildArtifact** - + **Action mode** – **Execute a change set** - + **Stack name** – **lambda\-pipeline\-stack** - + **Change set name** – **lambda\-pipeline\-changeset** - -1. Choose **Done**\. - -1. Choose **Save**\. - -1. Choose **Release change** to run the pipeline\. - -Your pipeline is ready\. Push changes to the master branch to trigger a deployment\. - -## Test the application - -The application includes an API Gateway API with a public endpoint that returns the current time\. Use the Lambda console to view the application and access the API\. - -**To test the application** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose **lambda\-pipeline\-stack**\. - -1. Under **Resources**, expand **ServerlessRestApi**\. - -1. Choose **Prod API endpoint**\. - -1. Add **/TimeResource** to the end of the URL\. For example, `https://l193nqxdjj.execute-api.us-east-2.amazonaws.com/Prod/TimeResource`\. - -1. Open the URL\. - -The API returns the current time in the following format\. - -``` -The time in Los Angeles is: Thu Jun 27 2019 16:07:20 GMT-0700 (PDT) -``` \ No newline at end of file diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index ef796d3d..05deef15 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -1,58 +1,70 @@ -# AWS Lambda function aliases +# Lambda function aliases -You can create one or more aliases for your AWS Lambda function\. A Lambda alias is like a pointer to a specific Lambda function version\. Users can access the function version using the alias ARN\. +You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. **To create an alias** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. -1. Choose a function\. +1. Choose the name of a function\. -1. In **Actions**, choose **Create alias**\. +1. On the function configuration page, choose **Actions**, **Create alias**\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-actions.png) -1. In the **Create a new alias** form, enter a name for the alias and an optional description\. Choose the function version for this alias\. +1. On the **Create alias** page, do the following: -To view the aliases that are currently defined for a function, choose **Qualifiers**, and choose the **Aliases** tab\. + 1. Enter a **Name** for the alias\. + + 1. \(Optional\) Enter a **Description** for the alias\. + + 1. For **Version**, choose a function version that you want the alias to point to\. + + 1. \(Optional\) To configure routing on the alias, expand **Weighted alias**\. For more information, see [Alias routing configuration](#configuring-alias-routing)\. + + 1. Choose **Save**\. + +To view the aliases that are currently defined for a function, on the function configuration page, choose **Qualifiers**, and then choose the **Aliases** tab\. ## Managing aliases with the Lambda API -To create an alias, use the `create-alias` command\. +To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. ``` -$ aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " +$ aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " ``` -To change an alias to point a new version of the function, use the `update-alias` command\. +To change an alias to point a new version of the function, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html) command\. ``` -$ aws lambda update-alias --function-name my-function --name alias-name --function-version version-number +$ aws lambda update-alias --function-name my-function --name alias-name --function-version version-number ``` -To delete an alias, use the `delete-alias` command\. +To delete an alias, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html) command\. ``` -$ aws lambda delete-alias --function-name my-function --name alias-name +$ aws lambda delete-alias --function-name my-function --name alias-name ``` - The AWS CLI commands in the preceding steps correspond to the following AWS Lambda APIs: + The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: + [CreateAlias](API_CreateAlias.md) + [UpdateAlias](API_UpdateAlias.md) + [DeleteAlias](API_DeleteAlias.md) ## Using aliases -Each alias has a unique ARN\. An alias can only point to a function version, not to another alias\. You can update an alias to point to a new version of the function\. +Each alias has a unique ARN\. An alias can point only to a function version, not to another alias\. You can update an alias to point to a new version of the function\. -Event sources such as Amazon S3 invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. +Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. -In a resource policy, you can grant permissions for event sources to use your Lambda function\. If you specify an alias ARN in the policy, you don't need to update the policy when the function version changes\. +In a resource policy, you can grant permissions for event sources to use your Lambda function\. If you specify an alias ARN in the policy, you don't need to update the policy when the function version changes\. ## Resource policies -When you use a [resource\-based policy](access-control-resource-based.md) to give a service, resource, or account access to your function, the scope of that permission depends on whether you applied it to an alias, to a version, or to the function\. If you use an alias name \(such as `helloworld:PROD`\), the permission is valid only for invoking the `helloworld` function using the alias ARN\. You get a permission error if you use a version ARN or the function ARN\. This includes the version ARN that the alias points to\. +You can use a [resource\-based policy](access-control-resource-based.md) to give a service, resource, or account access to your function\. The scope of that permission depends on whether you apply it to an alias, a version, or the entire function\. For example, if you use an alias name \(such as `helloworld:PROD`\), the permission allows you to invoke the `helloworld` function using the alias ARN \(`helloworld:PROD`\)\. -For example, the following AWS CLI command grants Amazon S3 permissions to invoke the PROD alias of the `helloworld` Lambda function\. Note that the `--qualifier` parameter specifies the alias name\. +If you attempt to invoke the function without an alias or a specific version, then you get a permission error\. This permission error still occurs even if you attempt to directly invoke the function version associated with the alias\. + +For example, the following AWS CLI command grants Amazon S3 permissions to invoke the PROD alias of the `helloworld` function when Amazon S3 is acting on behalf of `examplebucket`\. ``` $ aws lambda add-permission --function-name helloworld \ @@ -60,14 +72,14 @@ $ aws lambda add-permission --function-name helloworld \ --source-arn arn:aws:s3:::examplebucket --source-account 123456789012 ``` -In this case, Amazon S3 is now able to invoke the PROD alias\. Lambda can then execute the `helloworld` Lambda function version that the PROD alias references\. For this to work correctly, you must use the PROD alias ARN in the S3 bucket's notification configuration\. +For more information about using resource names in policies, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. ## Alias routing configuration -Use routing configuration on an alias to send a portion of traffic to a second function version\. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version\. +Use routing configuration on an alias to send a portion of traffic to a second function version\. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version\. You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: -+ Both versions must have the same IAM execution role\. ++ Both versions must have the same [execution role](lambda-intro-execution-role.md)\. + Both versions must have the same [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) configuration, or no dead\-letter queue configuration\. + Both versions must be published\. The alias cannot point to `$LATEST`\. @@ -75,57 +87,63 @@ You can point an alias to a maximum of two Lambda function versions\. The versio 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. -1. Choose a function\. +1. Choose the name of a function\. + +1. Verify that the function has at least two published versions\. On the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to display the list of versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. + +1. Choose **Actions**, **Create alias**\. + +1. On the **Create alias** page, do the following: -1. Verify that the function has at least two published versions\. To do this, choose **Qualifiers** and then choose **Versions** to display the list of versions\. If you need to create additional versions, follow the instructions in [AWS Lambda function versions](configuration-versions.md)\. + 1. Enter a **Name** for the alias\. -1. On the **Actions** menu, choose **Create alias**\. + 1. \(Optional\) Enter a **Description** for the alias\. -1. In the **Create a new alias** window, enter a value for **Name**, optionally enter a value for **Description**, and choose the **Version** of the Lambda function that the alias references\. + 1. For **Version**, choose the first function version that you want the alias to point to\. -1. Under **Additional version**, specify the following items: + 1. Expand **Weighted alias**\. - 1. Choose the second Lambda function version\. + 1. For **Additional version**, choose the second function version that you want the alias to point to\. - 1. Enter a weight value for the function\. *Weight* is the percentage of traffic that is assigned to that version when the alias is invoked\. The first version receives the residual weight\. For example, if you specify 10 percent to **Additional version**, the first version is assigned 90 percent automatically\. + 1. For **Weight \(%\)**, enter a weight value for the function\. *Weight* is the percentage of traffic that is assigned to that version when the alias is invoked\. The first version receives the residual weight\. For example, if you specify 10 percent to **Additional version**, the first version is assigned 90 percent automatically\. -1. Choose **Create**\. + 1. Choose **Save**\. ### Configuring alias routing -Use the `create-alias` and `update-alias` commands to configure the traffic weights between two function versions\. When you create or update the alias, you specify the traffic weight in the `routing-config` parameter\. +Use the `create-alias` and `update-alias` AWS CLI commands to configure the traffic weights between two function versions\. When you create or update the alias, you specify the traffic weight in the `routing-config` parameter\. -The following example creates an alias \(named **routing\-alias**\) for a Lambda function\. The alias points to version 1 of the function\. Version 2 of the function receives 3 percent of the traffic\. The remaining 97 percent of traffic is routed to version 1\. +The following example creates a Lambda function alias named **routing\-alias** that points to version 1 of the function\. Version 2 of the function receives 3 percent of the traffic\. The remaining 97 percent of traffic is routed to version 1\. ``` -$ aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ ---routing-config AdditionalVersionWeights={"2"=0.03} +$ aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ +--routing-config AdditionalVersionWeights={"2"=0.03} ``` Use the `update-alias` command to increase the percentage of incoming traffic to version 2\. In the following example, you increase the traffic to 5 percent\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ ---routing-config AdditionalVersionWeights={"2"=0.05} +$ aws lambda update-alias --name routing-alias --function-name my-function \ +--routing-config AdditionalVersionWeights={"2"=0.05} ``` -To route all traffic to version 2, use the `UpdateAlias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. +To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ ---function-version 2 --routing-config AdditionalVersionWeights={} +$ aws lambda update-alias --name routing-alias --function-name my-function \ +--function-version 2 --routing-config AdditionalVersionWeights={} ``` - The CLI commands in the preceding steps correspond to the following AWS Lambda API operations: + The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: + [CreateAlias](API_CreateAlias.md) + [UpdateAlias](API_UpdateAlias.md) ### Determining which version has been invoked When you configure traffic weights between two function versions, there are two ways to determine the Lambda function version that has been invoked: -+ **CloudWatch Logs** – Lambda automatically emits a `START` log entry that contains the invoked version ID to CloudWatch Logs for every function invocation\. The following is an example: ++ **CloudWatch Logs** – Lambda automatically emits a `START` log entry that contains the invoked version ID to Amazon CloudWatch Logs for every function invocation\. The following is an example: `19:44:37 START RequestId: request id Version: $version ` - For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the executed version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 21a6d717..07c3e74b 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -27,9 +27,9 @@ To manage reserved concurrency settings for a function, use the Lambda console\. 1. Choose a function\. -1. Under **Concurrency**, choose **Reserve concurrency**\. +1. Under **Concurrency**, choose **Edit**\. -1. Enter the amount of concurrency to reserve for the function\. +1. Choose **Reserve concurrency**\. Enter the amount of concurrency to reserve for the function\. 1. Choose **Save**\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index b5a91eec..6a6d01ac 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -1,8 +1,11 @@ # Using AWS Lambda environment variables -You can use environment variables to store secrets securely and adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. +You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. -You set environment variables on the unpublished version of your function by specifying a key and value\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. +**Note** +To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. + +You set environment variables on the unpublished version of your function by specifying a key and value\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. **To set environment variables in the Lambda console** diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index c674a767..edc943a1 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -1,32 +1,36 @@ -# AWS Lambda function versions +# Lambda function versions -You can use versions to manage the deployment of your AWS Lambda functions\. For example, you can publish a new version of a function for beta testing without affecting users of the stable production version\. +You can use versions to manage the deployment of your functions\. For example, you can publish a new version of a function for beta testing without affecting users of the stable production version\. Lambda creates a new version of your function each time that you publish the function\. The new version is a copy of the unpublished version of the function\. -The system creates a new version of your Lambda function each time that you publish the function\. The new version is a copy of the unpublished version of the function\. The function version includes the following information: +A function version includes the following information: + The function code and all associated dependencies\. -+ The Lambda runtime that executes the function\. ++ The Lambda runtime that invokes the function\. + All of the function settings, including the environment variables\. -+ A unique Amazon Resource Name \(ARN\) to identify this version of the function\. ++ A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to ensure a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the AWS Lambda console](configuration-console.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the AWS Lambda console](configuration-console.md)\. **To create a new version of a function** 1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. -1. Choose the function that you want to publish\. +1. Choose the name of the function that you want to publish\. -1. In **Actions**, choose **Publish new version**\. +1. On the function configuration page, choose **Actions**, **Publish new version**\. -After you publish the first version of a function, the Lambda console displays a drop\-down menu of the available versions\. The **Designer** panel displays a version qualifier at the end of the function name\. +1. \(Optional\) Enter a version description\. + +1. Choose **Publish**\. + +After you publish the first version of a function, the Lambda console displays a dropdown list of the available versions\. The **Designer** panel displays a version qualifier at the end of the function name\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-1-created.png) -To view the current versions of the function, choose a function, and then choose **Qualifiers**\. In the expanded **Qualifiers** menu, choose the **Versions** tab\. The **Versions** panel displays the list of versions for the selected function\. If you haven't published a version of the selected function, the **Versions** panel lists only the `$LATEST` version\. +To view the current versions of a function, on the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to see a list of versions for the function\. If you haven't published a new version of the function, the list only displays the `$LATEST` version\. ## Managing versions with the Lambda API -To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API action\. +To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API operation\. The following example publishes a new version of a function\. The response returns configuration information about the new version, including the version number and the function ARN with the version suffix\. @@ -45,31 +49,28 @@ $ aws lambda publish-version --function-name my-function ## Using versions -You reference your Lambda function using its ARN\. There are two ARNs associated with this initial version: -+ **Qualified ARN** – The function ARN with the version suffix\. +You can reference your Lambda function using either a qualified ARN or an unqualified ARN\. ++ **Qualified ARN** – The function ARN with a version suffix\. The following example refers to version 42 of the `helloworld` function\. ``` - arn:aws:lambda:aws-region:acct-id:function:helloworld:$LATEST + arn:aws:lambda:aws-region:acct-id:function:helloworld:42 ``` -+ **Unqualified ARN** – The function ARN without the version suffix\. ++ **Unqualified ARN** – The function ARN without a version suffix\. ``` arn:aws:lambda:aws-region:acct-id:function:helloworld ``` - You can use this unqualified ARN in all relevant operations\. However, you can't use it to create an alias\. +You can use a qualified or an unqualified ARN in all relevant API operations\. However, you can't use an unqualified ARN to create an alias\. -If you decide not to publish function versions, you can use either the qualified or unqualified ARN in your event source mapping to invoke the function\. +If you decide not to publish function versions, you can invoke the function using either the qualified or unqualified ARN in your [event source mapping](invocation-eventsourcemapping.md)\. When you invoke a function using an unqualified ARN, Lambda implicitly invokes $LATEST\. -Lambda only publishes a new function version if the code has never been published or if the code has changed compared to the most recently published version\. If there is no change, the function version remains at the most recently published version\. +Lambda publishes a new function version only if the code has never been published or if the code has changed from the last published version\. If there is no change, the function version remains at the last published version\. -Each Lambda function version has a unique ARN\. After you publish a version, you can't change the ARN or the function code\. +The qualified ARN for each Lambda function version is unique\. After you publish a version, you can't change the ARN or the function code\. -## Resource policies +## Granting permissions -When you use a [resource\-based policy](access-control-resource-based.md) to give a service, resource, or account access to your function, the scope of that permission depends on whether you applied it to a function or to one version of a function: -+ If you use a qualified function name \(such as `helloworld:1`\), the permission is valid for invoking the `helloworld` function version 1 *only* using its qualified ARN\. Using any other ARNs results in a permission error\. -+ If you use an unqualified function name \(such as `helloworld`\), the permission is valid only for invoking the `helloworld` function using the unqualified function ARN\. Using any other ARNs, including `$LATEST`, results in a permission error\. -+ If you use the `$LATEST` qualified function name \(such as `helloworld:$LATEST`\), the permission is valid for invoking the `helloworld` function *only* using its qualified ARN\. Using an unqualified ARN results in a permission error\. +You can use a [resource\-based policy](access-control-resource-based.md) or an [identity\-based policy](access-control-identity-based.md) to grant access to your function\. The scope of the permission depends on whether you apply the policy to a function or to one version of a function\. For more information about function resource names in policies, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. -You can simplify the management of event sources and resource policies by using function aliases\. For more information, see [AWS Lambda function aliases](configuration-aliases.md)\. \ No newline at end of file +You can simplify the management of event sources and AWS Identity and Access Management \(IAM\) policies by using function aliases\. For more information, see [Lambda function aliases](configuration-aliases.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 62deea10..a9f60b6c 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -20,7 +20,7 @@ For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. When you invoke or view a function, you can include a qualifier to specify a version or alias\. A version is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An alias is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. -For more information, see [AWS Lambda function versions](configuration-versions.md)\. +For more information, see [Lambda function versions](configuration-versions.md)\. ## Runtime diff --git a/doc_source/index.md b/doc_source/index.md index e093d91b..c8871814 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -33,8 +33,8 @@ Amazon's trademarks and trade dress may not be used in + [Configuring functions in the AWS Lambda console](configuration-console.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) - + [AWS Lambda function versions](configuration-versions.md) - + [AWS Lambda function aliases](configuration-aliases.md) + + [Lambda function versions](configuration-versions.md) + + [Lambda function aliases](configuration-aliases.md) + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring database access for a Lambda function](configuration-database.md) @@ -82,7 +82,6 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) - + [Building a continuous delivery pipeline for a Lambda application with AWS CodePipeline](build-pipeline.md) + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + [Using AWS Lambda with AWS Config](services-config.md) + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) @@ -104,7 +103,6 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) - + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) @@ -118,8 +116,11 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) - + [Orchestrate Lambda functions with AWS Step Functions](services-stepfunctions.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) ++ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) + + [State machine application patterns](stepfunctions-patterns.md) + + [Managing state machines in the Lambda console](stepfunctions-lc.md) + + [Orchestration examples with Step Functions](services-stepfunctions.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 5bd1703f..f26d1a23 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -271,7 +271,7 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' diff --git a/doc_source/java-package.md b/doc_source/java-package.md index e62b752c..4cc70fd3 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -15,7 +15,7 @@ These libraries are available through [Maven central repository](https://search. ``` dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' } ``` @@ -33,7 +33,7 @@ dependencies { com.amazonaws aws-lambda-java-events - 2.2.9 + 3.1.0 com.amazonaws @@ -95,7 +95,7 @@ dependencies { implementation platform('software.amazon.awssdk:bom:2.10.73') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' @@ -154,7 +154,7 @@ To build the deployment package, use the `mvn package` command\. [INFO] [INFO] --- maven-shade-plugin:3.2.2:shade (default) @ java-maven --- [INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.1 in the shaded jar. -[INFO] Including com.amazonaws:aws-lambda-java-events:jar:2.2.9 in the shaded jar. +[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.1.0 in the shaded jar. [INFO] Including joda-time:joda-time:jar:2.6 in the shaded jar. [INFO] Including com.google.code.gson:gson:jar:2.8.6 in the shaded jar. [INFO] Replacing original artifact with shaded artifact. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 0f5e5e6d..fc764aac 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -69,10 +69,118 @@ The condition requires that the principal is Amazon SNS and not another service For more information on resources and conditions for Lambda and other AWS services, see [Actions, resources, and condition keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_actions-resources-contextkeys.html) in the *IAM User Guide*\. **Topics** ++ [Function resource names](#function-resources) + [Functions](#permissions-resources-function) + [Event source mappings](#permissions-resources-eventsource) + [Layers](#permissions-resources-layers) +## Function resource names + +You reference a Lambda function in a policy statement using an Amazon Resource Names \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function, a function [version](configuration-versions.md), or an [alias](configuration-aliases.md)\. + +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter, or by setting a value in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. + +You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. + +### Best practices for using Deny statements with functions + +The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. + + +**Resource best practices** + +| Policy objective | Resource | +| --- | --- | +| Deny access to all versions of a function | `MyFunction*` | +| Deny access to a specific alias | `MyFunction:MyAlias` and `MyFunction` | +| Deny access to a specific version of a function | `MyFunction:1` and `MyFunction` | + +The following sections provide example policy statements for each of the policy objectives\. + +**Note** +You can use only identity\-based policies to deny specific function resources\. Currently, Lambda does not support the `Deny` effect in resource\-based policies\. + +For the action list in a policy statement, you can add any of the [ actions defined by Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) that act on a function resource\. + +#### Deny access to all function versions + +The following identity\-based policy statement denies access to the `lambda:GetFunctionConfiguration` action for all versions of the `my-function` function\. The wildcard character at the end of the function ARN ensures that this policy applies to all version and alias ARNs\. + +**Example identity\-based policy** + +``` +{ + "Version": "2020-07-20", + "Statement": [ + { + "Effect": "Deny", + "Action": [ + "lambda:GetFunctionConfiguration" + ], + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function*" + } + ] +} +``` + +#### Deny access to a specific function alias + +To deny access to a specific alias, you must specify both the alias ARN and the unqualified function ARN in the policy\. This prevents users from accessing the specific alias by passing the unqualified ARN as the `FunctionName` and the alias as the `Qualifier`\. + +**Note** +If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. + +The following identity\-based policy statement denies access to the `lambda:InvokeFunction` action in the `my-alias` alias of the `my-function` function\. + +**Example identity\-based policy** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "DenySpecificAlias", + "Effect": "Deny", + "Action": "lambda:InvokeFunction", + "Resource": [ + "arn:aws:lambda:us-west-2:123456789012:function:my-function:my-alias", + "arn:aws:lambda:us-west-2:123456789012:function:my-function" + ] + } + ] +} +``` + +#### Deny access to a specific function version + +To deny access to a specific version, you must specify both the qualified ARN and the unqualified ARN in the policy\. This prevents users from accessing the specific version by passing the unqualified ARN as the `FunctionName` and the version as the `Qualifier`\. + +**Note** +If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. + +The following identity\-based policy statement denies access to the invoke action in version 1 of the `my-function` function\. + +**Example identity\-based policy** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "DenySpecificFunctionVersion", + "Effect": "Deny", + "Action": [ + "lambda:InvokeFunction" + ], + "Resource": [ + "arn:aws:lambda:us-west-2:123456789012:function:my-function:1", + "arn:aws:lambda:us-west-2:123456789012:function:my-function" + ] + } + ] +} +``` + ## Functions Actions that operate on a function can be restricted to a specific function by function, version, or alias ARN, as described in the following table\. Actions that don't support resource restrictions can only be granted for all resources \(`*`\)\. @@ -116,5 +224,5 @@ Note: the [GetLayerVersion](API_GetLayerVersion.md) action also covers [GetLayer | Action | Resource | Condition | | --- | --- | --- | | [AddLayerVersionPermission](API_AddLayerVersionPermission.md) [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) [GetLayerVersion](API_GetLayerVersion.md) [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) [DeleteLayerVersion](API_DeleteLayerVersion.md) | Layer version | None | -| [PublishLayerVersion](API_PublishLayerVersion.md) | Layer | None | -| [ListLayers](API_ListLayers.md) [ListLayerVersions](API_ListLayerVersions.md) | `*` | None | \ No newline at end of file +| [ListLayerVersions](API_ListLayerVersions.md) [PublishLayerVersion](API_PublishLayerVersion.md) | Layer | None | +| [ListLayers](API_ListLayers.md) | `*` | None | \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index ac4573c1..cfb3607b 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -14,8 +14,8 @@ To use your Lambda function with AWS resources in an Amazon VPC, configure it wi + [Configuring functions in the AWS Lambda console](configuration-console.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) -+ [AWS Lambda function versions](configuration-versions.md) -+ [AWS Lambda function aliases](configuration-aliases.md) ++ [Lambda function versions](configuration-versions.md) ++ [Lambda function aliases](configuration-aliases.md) + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring database access for a Lambda function](configuration-database.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 31e914a3..5c32b71d 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,8 +9,8 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.721\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.721\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.712\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.712\.0 | Amazon Linux 2 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 399f72a6..5228aaeb 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 6e1cfc6d..1309aaa1 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -85,7 +85,7 @@ The following table describes the important changes in each release of the *AWS | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | | AWS Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambda functions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [AWS Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up AWS Lambda to invoke your code on a regular, scheduled basis using the AWS Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | +| Versioning support, Python for developing code for Lambda functions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up AWS Lambda to invoke your code on a regular, scheduled basis using the AWS Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | | AWS Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, AWS Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | | The AWS Lambda console now provides blueprints to easily create Lambda functions and test them\. | AWS Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the AWS Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with AWS Lambda](getting-started.md)\. | July 09, 2015 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 191e3803..480b011a 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,18 +19,18 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.721\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.721\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.712\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.712\.0 | Amazon Linux 2 | **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.5 botocore\-1\.17\.5 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | **Ruby runtimes** diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 8483a417..69224558 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -64,7 +64,6 @@ Other services invoke your function directly\. You grant the other service permi + [Amazon API Gateway](services-apigateway.md) + [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) + [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) -+ [AWS Step Functions](services-stepfunctions.md) + [Amazon Simple Storage Service Batch](services-s3-batch.md) For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. diff --git a/doc_source/lambda-stepfunctions.md b/doc_source/lambda-stepfunctions.md new file mode 100644 index 00000000..2119a930 --- /dev/null +++ b/doc_source/lambda-stepfunctions.md @@ -0,0 +1,8 @@ +# Orchestrating functions with Step Functions + +AWS Step Functions is an orchestration service that lets you connect Lambda functions together into serverless workflows, called state machines\. Use Step Functions to orchestrate serverless applications workflows \(for example, a store checkout process\), build long\-running workflows for IT automation and human\-approval use cases, or create high\-volume short\-duration workflows for streaming data processing and ingestion\. + +**Topics** ++ [State machine application patterns](stepfunctions-patterns.md) ++ [Managing state machines in the Lambda console](stepfunctions-lc.md) ++ [Orchestration examples with Step Functions](services-stepfunctions.md) \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 236d0a99..0eb25b48 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -41,7 +41,7 @@ To create or update a function with the Lambda API, create an archive that conta adding: lambda_function.py (deflated 17%) ``` -1. Use the `update-function-code` command to upload the package\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip @@ -103,7 +103,7 @@ In order for `--target` to work on [Debian\-based systems](https://github.com/py adding: lambda_function.py (deflated 56%) ``` -1. Update the function code\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip @@ -190,7 +190,7 @@ For Python 3\.3 and newer, you can use the built\-in [venv module](https://docs. adding: lambda_function.py (deflated 56%) ``` -1. Update the function code\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index ac53901f..f9e4709d 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -34,4 +34,4 @@ The two objects that the handler accepts are the invocation event and context\. The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution context, see [AWS Lambda execution context](runtimes-context.md)\. \ No newline at end of file +Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution context, see [AWS Lambda execution contextManaging state machines in the Lambda console](runtimes-context.md)\. \ No newline at end of file diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 7d452d0a..2f4dff9d 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -5,7 +5,7 @@ The AWS global infrastructure is built around AWS Regions and Availability Zones For more information about AWS Regions and Availability Zones, see [AWS global infrastructure](http://aws.amazon.com/about-aws/global-infrastructure/)\. In addition to the AWS global infrastructure, Lambda offers several features to help support your data resiliency and backup needs\. -+ **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [AWS Lambda function versions](configuration-versions.md)\. ++ **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. + **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [AWS Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. + **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md index 78c66425..8158f7b6 100644 --- a/doc_source/security_iam_id-based-policy-examples.md +++ b/doc_source/security_iam_id-based-policy-examples.md @@ -37,7 +37,7 @@ This example shows how you might create a policy that allows IAM users to view t "Action": [ "iam:GetUserPolicy", "iam:ListGroupsForUser", - "iam:ListAttachedUserPolicies", + "iam:ListAttachedUserPolicies", "iam:ListUserPolicies", "iam:GetUser" ], diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md index 341b96f2..a2daed09 100644 --- a/doc_source/services-alexa.md +++ b/doc_source/services-alexa.md @@ -29,4 +29,4 @@ The Alexa Skills Kit is available on GitHub\. } ``` -For more information, see [Getting started with Alexa Skills Kit](https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/getting-started-guide)\. \ No newline at end of file +For more information, see [ Host a custom skill as an AWS Lambda Function](https://developer.amazon.com/docs/alexa/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html) in the *Build Skills with the Alexa Skills Kit* guide\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 83e01839..56426ff8 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -475,4 +475,50 @@ Or, you can use the following Curl command: ``` $ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` \ No newline at end of file +``` + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the API** + +1. Open the [APIs page](https://console.aws.amazon.com/apigateway/main/apis) of the API Gateway console\. + +1. Select the API you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the DynamoDB table** + +1. Open the [Tables page](https://console.aws.amazon.com/dynamodb/home#tables:) of the DynamoDB console\. + +1. Select the table you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md index 9bc8fe94..bfa875ae 100644 --- a/doc_source/services-codepipeline.md +++ b/doc_source/services-codepipeline.md @@ -75,11 +75,11 @@ exports.handler = async (event) => { For asynchronous invocation, Lambda queues the message and [retries](invocation-retries.md) if your function returns an error\. Configure your function with a [destination](invocation-async.md#invocation-async-destinations) to retain events that your function could not process\. -For details on configuring a pipeline to invoke a Lambda function, see [Invoke an AWS Lambda function in a pipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html) in the AWS CodePipeline User Guide\. +For a tutorial on how to configure a pipeline to invoke a Lambda function, see [Invoke an AWS Lambda function in a pipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html) in the *AWS CodePipeline User Guide*\. -**Topics** -+ [Permissions](#services-codepipeline-permissions) -+ [Building a continuous delivery pipeline for a Lambda application with AWS CodePipeline](build-pipeline.md) +You can use AWS CodePipeline to create a continuous delivery pipeline for your Lambda application\. CodePipeline combines source control, build, and deployment resources to create a pipeline that runs whenever you make a change to your application's source code\. + +For an alternate method of creating a pipeline with AWS Serverless Application Model and AWS CloudFormation, watch [Automate your serverless application deployments](https://www.youtube.com/watch?v=0o3urdBeoII) on the Amazon Web Services YouTube channel\. ## Permissions diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 2424ff09..e13ec335 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -7,7 +7,7 @@ In this tutorial, you do the following: For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -## Prerequisites +### Prerequisites This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. @@ -22,7 +22,7 @@ For long commands, an escape character \(`\`\) is used to split a command over m On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -## Create the execution role +### Create the execution role Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. @@ -39,7 +39,7 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\. -## Create an Amazon RDS database instance +### Create an Amazon RDS database instance In this tutorial, the example Lambda function creates a table \(Employee\), inserts a few records, and then retrieves the records\. The table that the Lambda function creates has the following schema: @@ -64,9 +64,11 @@ You can launch an RDS MySQL instance using one of the following methods: Write down the database name, user name, and password\. You also need the host address \(endpoint\) of the DB instance, which you can get from the RDS console\. You might need to wait until the instance status is available and the Endpoint value appears in the console\. -## Create a deployment package +### Create a deployment package -The following example Python code runs a SELECT query against the Employee table in the MySQL RDS instance that you created in the VPC\. The code creates a table in the ExampleDB database, adds sample records, and retrieves those records\. +The following example Python code runs a SELECT query against the Employee table in the MySQL RDS instance that you created in the VPC\. The code creates a table in the ExampleDB database, adds sample records, and retrieves those records\. + +The following method for handling database credentials is for illustrative purposes only\. In a production environment, we recommend using AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. **Example app\.py** @@ -133,7 +135,7 @@ db_name = "ExampleDB" Install dependencies with Pip and create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. -## Create the Lambda function +### Create the Lambda function Create the Lambda function with the `create-function` command\. You can find the subnet IDs and security group ID for your default VPC in the [Amazon VPC console](https://console.aws.amazon.com/vpc)\. @@ -144,7 +146,7 @@ $ aws lambda create-function --function-name CreateTableAddRecordsAndRead --run --vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb ``` -## Test the Lambda function +### Test the Lambda function In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function executes, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. @@ -159,4 +161,42 @@ In this step, you invoke the Lambda function manually using the `invoke` command + Review the results in the AWS Lambda console\. + Verify the results in CloudWatch Logs\. -Now that you have created a Lambda function that accesses a database in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +Now that you have created a Lambda function that accesses a database in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. + +### Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the MySQL DB instance** + +1. Open the [Databases page](https://console.aws.amazon.com/rds/home#databases:) of the Amazon RDS console\. + +1. Select the database you created\. + +1. Choose **Actions**, **Delete**\. + +1. Clear the **Create final snapshot** check box\. + +1. Enter **delete me** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md index ed77a1d4..7fa38cb0 100644 --- a/doc_source/services-rds.md +++ b/doc_source/services-rds.md @@ -2,36 +2,50 @@ You can use AWS Lambda to process event notifications from an Amazon Relational Database Service \(Amazon RDS\) database\. Amazon RDS sends notifications to an Amazon Simple Notification Service \(Amazon SNS\) topic, which you can configure to invoke a Lambda function\. Amazon SNS wraps the message from Amazon RDS in its own event document and sends it to your function\. +## Example + **Example Amazon RDS message in an Amazon SNS event** ``` { - "Records": [ - { - "EventVersion": "1.0", - "EventSubscriptionArn": "arn:aws:sns:us-east-2:123456789012:rds-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "EventSource": "aws:sns", - "Sns": { - "SignatureVersion": "1", - "Timestamp": "2019-01-02T12:45:07.000Z", - "Signature": "tcc6faL2yUC6dgZdmrwh1Y4cGa/ebXEkAi6RibDsvpi+tE/1+82j...65r==", - "SigningCertUrl": "https://sns.us-east-2.amazonaws.com/SimpleNotificationService-ac565b8b1a6c5d002d285f9598aa1d9b.pem", - "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e", - "Message": "{\"Event Source\":\"db-instance\",\"Event Time\":\"2019-01-02 12:45:06.000\",\"Identifier Link\":\"https://console.aws.amazon.com/rds/home?region=eu-west-1#dbinstance:id=dbinstanceid\",\"Source ID\":\"dbinstanceid\",\"Event ID\":\"http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Events.html#RDS-EVENT-0002\",\"Event Message\":\"Finished DB Instance backup\"}", - "MessageAttributes": {}, - "Type": "Notification", - "UnsubscribeUrl": "https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:123456789012:test-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "TopicArn":"arn:aws:sns:us-east-2:123456789012:sns-lambda", - "Subject": "RDS Notification Message" - } + "Records": [ + { + "EventVersion": "1.0", + "EventSubscriptionArn": "arn:aws:sns:us-east-2:123456789012:rds-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", + "EventSource": "aws:sns", + "Sns": { + "SignatureVersion": "1", + "Timestamp": "2019-01-02T12:45:07.000Z", + "Signature": "tcc6faL2yUC6dgZdmrwh1Y4cGa/ebXEkAi6RibDsvpi+tE/1+82j...65r==", + "SigningCertUrl": "https://sns.us-east-2.amazonaws.com/SimpleNotificationService-ac565b8b1a6c5d002d285f9598aa1d9b.pem", + "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e", + "Message": "{\"Event Source\":\"db-instance\",\"Event Time\":\"2019-01-02 12:45:06.000\",\"Identifier Link\":\"https://console.aws.amazon.com/rds/home?region=eu-west-1#dbinstance:id=dbinstanceid\",\"Source ID\":\"dbinstanceid\",\"Event ID\":\"http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Events.html#RDS-EVENT-0002\",\"Event Message\":\"Finished DB Instance backup\"}", + "MessageAttributes": {}, + "Type": "Notification", + "UnsubscribeUrl": "https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:123456789012:test-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", + "TopicArn":"arn:aws:sns:us-east-2:123456789012:sns-lambda", + "Subject": "RDS Notification Message" + } + } + ] } - ] -} ``` -For instructions on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) in the Amazon Relational Database Service User Guide\. +## Configuring the function + +**Configuring the maximum concurrency of a function** + +If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. + +**Sending notifications from a database** + +For instructions on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) in the Amazon RDS User Guide\. + +**Using Amazon SNS as a trigger** For details on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. +## What's Next? + **Topics** + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) \ No newline at end of file diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index d6b12874..78802d24 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -1,8 +1,27 @@ -# Orchestrate Lambda functions with AWS Step Functions +# Orchestration examples with Step Functions -You can use AWS Step Functions to create state machines that orchestrate Lambda functions to create an application\. Step Functions manages the state of your application and provides a visual interface for defining workflows that involve Lambda functions, AWS Batch jobs, Amazon SNS topics, Amazon SQS queues and other common AWS resources\. Instead of defining your application logic in a program, you assemble components visually or with a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. Lambda functions in Step Functions are self\-contained, reusable services with a well\-defined interface that you can share with less technical users\. +All work in your Step Functions state machine is done by [https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html)\. A `Task` performs work by using an activity, a Lambda function, or by passing parameters to the API actions of other [Supported AWS Service Integrations for Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)\. -Step Functions invokes your function with an event document that you define\. You create a *task* state that invokes your function with the input to the state machine or any JSON document\. +**Topics** ++ [Configuring a Lambda function as a task](#services-stepfunctions-task) ++ [Configuring a state machine as an event source](#services-stepfunctions-setup) ++ [Handling function and service errors](#services-stepfunctions-exceptions) ++ [AWS CloudFormation and AWS SAM](#services-stepfunctions-cloudformation) + +## Configuring a Lambda function as a task + +Step Functions can invoke Lambda functions directly from a `Task` state in an [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) definition\. + +``` +... + "MyStateName":{ + "Type":"Task", + "Resource":"arn:aws:lambda:us-west-2:01234567890:function:my_lambda_function", + "End":true + ... +``` + +You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. **Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** @@ -14,20 +33,14 @@ Step Functions invokes your function with an event document that you define\. Yo } ``` -Step Functions makes it easy to [retry failed executions](#services-stepfunctions-exceptions) or branch your application logic based on the result of an invocation\. - -**Topics** -+ [Configuring a state machine as an event source](#services-stepfunctions-setup) -+ [Handling function and service errors](#services-stepfunctions-exceptions) -+ [AWS CloudFormation and AWS SAM](#services-stepfunctions-cloudformation) - ## Configuring a state machine as an event source -You can use the [Step Functions console](https://console.aws.amazon.com/states/home) to generate a state that invokes a Lambda function, or define states directly in JSON\. The following example shows a task state that invokes version 1 of a function named `my-function` with an event payload that has three keys\. When the function returns a successful response, the state machine continues to the next task\. +You can create a Step Functions state machine that invokes a Lambda function\. The following example shows a `Task` state that invokes version `1` of a function named `my-function` with an event payload that has three keys\. When the function returns a successful response, the state machine continues to the next task\. -**Example state machine task** +**Example state machine** ``` +... "Invoke": { "Type": "Task", "Resource": "arn:aws:states:::lambda:invoke", @@ -45,21 +58,23 @@ You can use the [Step Functions console](https://console.aws.amazon.com/states/h ``` **Permissions** -Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) managed policy or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the *AWS Step Functions Developer Guide*\. +Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the AWS managed policy [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the *AWS Step Functions Developer Guide*\. -The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event` as shown following: +The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event`: ``` - "InvocationType": "Event" +"InvocationType": "Event" ``` -Instead of hard coding the event payload in the state machine definition, you can use the input from the state machine execution\. The following example uses the input specified when you run the state machine as the event payload: +Instead of hard\-coding the event payload in the state machine definition, you can use the input from the state machine execution\. The following example uses the input specified when you run the state machine as the event payload: ``` - "Payload.$": "$" +"Payload.$": "$" ``` -You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, you set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. For more information, see [Invoke Lambda with Step Functions ](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the *AWS Step Functions Developer Guide*\. +You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. + +For more information, see [Invoke Lambda with Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the *AWS Step Functions Developer Guide*\. ## Handling function and service errors @@ -67,10 +82,11 @@ When your function or the Lambda service returns an error, you can retry the inv The following example shows an invoke task that retries on `5XX` series Lambda API exceptions \(`ServiceException`\), throttles \(`TooManyRequestsException`\), runtime errors \(`Lambda.Unknown`\), and a function\-defined error named `function.MaxDepthError`\. It also catches an error named `function.DoublesRolledError` and continues to a state named `CaughtException` when it occurs\. -**Example invoke task – Retry and catch** +**Example catch and retry pattern** ``` - "Invoke": { +... +"Invoke": { "Type": "Task", "Resource": "arn:aws:states:::lambda:invoke", "Retry": [ @@ -95,22 +111,15 @@ The following example shows an invoke task that retries on `5XX` series Lambda A ... ``` -To catch or retry on function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. For details on throwing errors in each support language, see the following topics: -+ [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) -+ [AWS Lambda function errors in Python](python-exceptions.md) -+ [AWS Lambda function errors in Ruby](ruby-exceptions.md) -+ [AWS Lambda function errors in Java](java-exceptions.md) -+ [AWS Lambda function errors in Go](golang-exceptions.md) -+ [AWS Lambda function errors in C\#](csharp-exceptions.md) -+ [AWS Lambda function errors in PowerShell](powershell-exceptions.md) +To catch or retry function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. -For more information on error handling in Step Functions, see [Handling error conditions using a state machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html) in the *AWS Step Functions Developer Guide*\. +For more information on error handling in Step Functions, see [Handling Error Conditions Using a Step Functions State Machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html) in the *AWS Step Functions Developer Guide*\. ## AWS CloudFormation and AWS SAM -You can create a serverless application that includes a Step Functions state machine in a AWS CloudFormation template with the AWS Serverless Application Model \(AWS SAM\)\. With AWS SAM, you can define the state machine inline in the template or in a separate file\. The following example shows a state machine that demonstrates invoking a Lambda function and handling errors\. It refers to a function resource defined in the same template \(not shown\)\. +You can define state machines using a AWS CloudFormation template with AWS Serverless Application Model \(AWS SAM\)\. Using AWS SAM, you can define the state machine inline in the template or in a separate file\. The following example shows a state machine that invokes a Lambda function that handles errors\. It refers to a function resource defined in the same template \(not shown\)\. -**Example template\.yml** +**Example branching pattern in template\.yml** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -118,7 +127,7 @@ Transform: 'AWS::Serverless-2016-10-31' Description: An AWS Lambda application that uses AWS Step Functions. Resources: statemachine: - Type: [AWS::Serverless::StateMachine](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html) + Type: AWS::Serverless::StateMachine Properties: DefinitionSubstitutions: FunctionArn: !GetAtt function.Arn @@ -181,4 +190,6 @@ Resources: This creates a state machine with the following structure: -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/services-stepfunctions-statemachine.png) \ No newline at end of file +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/services-stepfunctions-statemachine.png) + +For more information, see [AWS::Serverless::StateMachine](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md new file mode 100644 index 00000000..f5424229 --- /dev/null +++ b/doc_source/stepfunctions-lc.md @@ -0,0 +1,63 @@ +# Managing state machines in the Lambda console + +You can use the Lambda console to view details about your Step Functions state machines and the Lambda functions that they use\. + +**Topics** ++ [Viewing state machine details](#stepfunctions-configure) ++ [Editing a state machine](#stepfunctions-edit) ++ [Running a state machine](#stepfunctions-run) + +## Viewing state machine details + +The Lambda console displays a list of your state machines in the current AWS Region that contain at least one workflow step that invokes a Lambda function\. + +Choose a state machine to view a graphical representation of the workflow\. Steps highlighted in blue represent Lambda functions\. Use the graph controls to zoom in, zoom out, and center the graph\. + +**Note** +When a Lambda function is [dynamically referenced with JsonPath](https://docs.aws.amazon.com/step-functions/latest/dg/connect-parameters.html#connect-parameters-path) in the state machine definition, the function details cannot be shown in the Lambda console\. Instead, the function name is listed as a **Dynamic reference**, and the corresponding steps in the graph are grayed out\. + +**To view state machine details** + +1. Open the Lambda console [Step Functions state machines page](https://console.aws.amazon.com/lambda/home#/stepfunctions)\. + +1. Choose a state machine\. + + The Lambda console opens the **Details** page\. + +For more information, see [Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) in the *AWS Step Functions Developer Guide*\. + +## Editing a state machine + +When you want to edit a state machine, Lambda opens the **Edit definition** page of the Step Functions console\. + +**To edit a state machine** + +1. Open the Lambda console [Step Functions state machine page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a state machine\. + +1. Choose **Edit**\. + + The Step Functions console opens the **Edit definition** page\. + +1. Edit the state machine and choose **Save**\. + +For more information about editing state machines, see [Step Functions state machine language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) in the *AWS Step Functions Developer Guide*\. + +## Running a state machine + +When you want to run a state machine, Lambda opens the **New execution** page of the Step Functions console\. + +**To run a state machine** + +1. Open the Lambda console [Step Functions state machines page](https://console.aws.amazon.com/lambda/home#/stepfunctions)\. + +1. Choose a state machine\. + +1. Choose **Execute**\. + + The Step Functions console opens the **New execution** page\. + +1. \(Optional\) Edit the state machine and choose **Start execution**\. + +For more information about running state machines, see [Step Functions state machine execution concepts](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-executions.html) in the *AWS Step Functions Developer Guide*\. \ No newline at end of file diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md new file mode 100644 index 00000000..49d34e3d --- /dev/null +++ b/doc_source/stepfunctions-patterns.md @@ -0,0 +1,142 @@ +# State machine application patterns + +In Step Functions, you orchestrate your resources using state machines, which are defined using a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. + +**Topics** ++ [State machine components](#statemachine-components) ++ [State machine application patterns](#stepfunctions-application-patterns) ++ [Applying patterns to state machines](#stepfunctions-patterns-state-machines) ++ [Example branching application pattern](#statemachine-example) + +## State machine components + +State machines contain elements called [states](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-states.html) that make up your workflow\. The logic of each state determines which state comes next, what data to pass along, and when to terminate the workflow\. A state is referred to by its name, which can be any string, but which must be unique within the scope of the entire state machine\. + +To create a state machine that uses Lambda, you need the following components: + +1. An AWS Identity and Access Management \(IAM\) role for Lambda with one or more permissions policies \(such as [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) service permissions\)\. + +1. One or more Lambda functions \(with the IAM role attached\) for your specific runtime\. + +1. A state machine authored in Amazon States Language\. + +## State machine application patterns + +You can create complex orchestrations for state machines using application patterns such as: ++ **Chaining** – Connect functions into a series of steps, with the output of one step providing the input to the next step\. ++ **Catch and retry** – Handle errors using sophisticated catch\-and\-retry functionality\. ++ **Parallelism** – Run functions in parallel, or use dynamic parallelism to invoke a function for every member of any array\. ++ **Branching** – Design your workflow to choose different branches based on Lambda function output\. + +## Applying patterns to state machines + +The following shows how you can apply these application patterns to a state machine within an Amazon States Language definition\. + +**Catch and Retry** +A `Catch` field and a `Retry` field add catch\-and\-retry logic to a state machine\. [Catch](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html#error-handling-fallback-states) \(`"Type": "Catch"`\) is an array of objects that define a fallback state\. [Retry](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html#error-handling-retrying-after-an-error) \(`"Type": "Retry"`\) is an array of objects that define a retry policy if the state encounters runtime errors\. + +**Branching** +A `Choice` state adds branching logic to a state machine\. [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) \(`"Type": "Choice"`\) is an array of rules that determine which state the state machine transitions to next\. + +**Chaining** +A "chaining" pattern describes multiple Lambda functions connected together in a state machine\. You can use chaining to create reusable workflow invocations from a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html) \(`"Type": "Task"`\) state of a state machine\. + +**Parallelism** +A `Parallel` state adds parallelism logic to a state machine\. You can use a [Parallel](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html) state \(`"Type": "Parallel"`\) to create parallel branches of invocation in your state machine\. + +**Dynamic parallelism** +A `Map` state adds dynamic "for\-each" loop logic to a state machine\. You can use a [Map](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html) state \(`"Type": "Map"`\) to run a set of steps for each element of an input array in a state machine\. While the `Parallel` state invokes multiple branches of steps using the same input, a `Map` state invokes the same steps for multiple entries of the array\. + +In addition to application patterns, Step Functions supports various [service integration patterns](https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html), including the ability to pause a workflow for human approval, or to call a legacy system or other third party\. + +## Example branching application pattern + +In the following example, the `WhichCoat` state machine shows a branching application pattern with a [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) state \(`"Type": "Choice"`\)\. If the condition of one of the three `Choice` states is met, the Lambda function is invoked as a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html): + +1. The `WearHeavyCoat` state invokes the `wear_heavy_coat` Lambda function and returns a message\. + +1. The `WearLightJacket` state invokes the `wear_light_jacket` Lambda function and returns a message\. + +1. The `None` state invokes the `no_jacket` Lambda function and returns a message\. + +The `WhichCoat` state machine has the following structure: + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-stepfunctions-wearcoat.png) + +**Example Amazon States Language definition** +The following Amazon States Language definition uses a `Variable` [context object](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html) called `Weather`\. If one of the three conditions in `StringEquals` is met, the Lambda function defined in the [`Resource` field's Amazon Resource Name \(ARN\)](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#amazon-states-language-task-state-specifying-resource-arns) is invoked\. + +``` +{ + "Comment":"Coat Indicator State Machine", + "StartAt":"WhichCoat", + "States":{ + "WhichCoat":{ + "Type":"Choice", + "Choices":[ + { + "Variable":"$.Weather", + "StringEquals":"FREEZING", + "Next":"WearHeavyCoat" + }, + { + "Variable":"$.Weather", + "StringEquals":"COOL", + "Next":"WearLightJacket" + }, + { + "Variable":"$.Weather", + "StringEquals":"WARM", + "Next":"None" + } + ] + }, + "WearHeavyCoat":{ + "Type":"Task", + "Resource":"arn:aws:lambda:us-west-2:01234567890:function:wear_heavy_coat", + "End":true + }, + "WearLightJacket":{ + "Type":"Task", + "Resource":"arn:aws:lambda:us-west-2:01234567890:function:wear_light_jacket", + "End":true + }, + "None":{ + "Type":"Task", + "Resource":"arn:aws:lambda:us-west-2:01234567890:function:no_coat", + "End":true + } + } + } +``` + +**Example Python function** +The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." + +``` +from __future__ import print_function + +import datetime + + +def wear_heavy_coat(message, context): + print(message) + + response = {} + response['Weather'] = message['Weather'] + response['Timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S") + response['Message'] = 'You should wear a heavy coat today.' + + return response +``` + +**Example invocation data** +The following input data runs the `WearHeavyCoat` state that invokes the `wear_heavy_coat` Lambda function, when the `Weather` variable is equal to a string value of `FREEZING`\. + +``` +{ + "Weather":"FREEZING" +} +``` + +For more information, see [Creating a Step Functions State Machine That Uses Lambda](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-creating-lambda-state-machine.html) in the *AWS Step Functions Developer Guide*\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index b73fa3c4..973135dc 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -48,7 +48,7 @@ The name of the file or class in your function's handler configuration doesn't m **Error:** *undefined method `handler' for \#* -**Error:** *No public method named handleRequest with appropriate method signature found on class class function\.Handler* +**Error:** *No public method named handleRequest with appropriate method signature found on class function\.Handler* **Error:** *Unable to find method 'handleRequest' in type 'Function\.Handler' from assembly 'Function'* diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 4e1d089e..069f65b6 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -249,4 +249,40 @@ Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes 1. AWS Lambda polls the stream and when it detects updates to the stream, it invokes your Lambda function by passing in the event data it finds in the stream\. -1. Your function executes and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. \ No newline at end of file +1. Your function executes and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the DynamoDB table** + +1. Open the [Tables page](https://console.aws.amazon.com/dynamodb/home#tables:) of the DynamoDB console\. + +1. Select the table you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 2941046f..d7ed4df9 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -140,7 +140,7 @@ Lambda supports the following options for DynamoDB event sources\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. **Note** -DynamoDB charges for read requests that Lambda makes to get records from the stream\. For pricing details, see [Amazon DynamoDB pricing](https://aws.amazon.com/dynamodb/pricing)\. +You are not charged for GetRecords API calls invoked by Lambda as part of DynamoDB triggers\. To manage the event source configuration later, choose the trigger in the designer\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 0f147483..2b471d74 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -109,6 +109,10 @@ To manage event source mappings with the AWS CLI or AWS SDK, use the following A To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +The Amazon VPC security group rules you configure should have the following settings at minimum: ++ Inbound rules – Allow all traffic on all ports for the security group specified as your source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + The Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html) and doesn't need to be configured in the `create-event-source-mapping` setup\. The following AWS CLI example maps a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`, with the starting position set to `latest`: diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 0383f365..b10189f0 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -167,12 +167,18 @@ The deployment package is a \.zip file containing your Lambda function code and 1. Save the function code as `index.js` in a folder named `lambda-s3`\. -1. Install the Sharp library with npm\. +1. Install the Sharp library with npm\. For Linux, use the following command\. ``` lambda-s3$ npm install sharp ``` + For macOS, use the following command\. + + ``` + lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp + ``` + After you complete this step, you will have the following folder structure: ``` @@ -319,3 +325,39 @@ Now you can test the setup as follows: 1. Verify that the thumbnail was created in the target bucket using the `CreateThumbnail` function\. 1. View logs in the CloudWatch console\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the S3 buckets** + +1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) + +1. Select the source bucket you created\. + +1. Choose **Delete**\. + +1. Enter the name of the source bucket in the text box\. + +1. Choose **Confirm**\. \ No newline at end of file From 02b44d1fe68e7f5d71b773118ea941b48186a95d Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 29 Sep 2020 16:16:53 -0700 Subject: [PATCH 034/243] Update with-s3-example.md --- doc_source/with-s3-example.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index b10189f0..f4e03b6c 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -210,6 +210,8 @@ For the role parameter, replace the number sequence with your AWS account ID\. T $ aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 ``` +If using version 2 of the AWS CLI, the command also needs '--cli-binary-format raw-in-base64-out' + ## Test the Lambda function In this step, you invoke the Lambda function manually using sample Amazon S3 event data\. @@ -360,4 +362,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. \ No newline at end of file +1. Choose **Confirm**\. From 83ce1c5399d26047f1547ea30104933ed6f542fd Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 9 Oct 2020 08:56:06 -0700 Subject: [PATCH 035/243] Add content for Extensions API (preview) --- doc_source/applications-tutorial.md | 4 +- doc_source/applications-usecases.md | 2 +- doc_source/best-practices.md | 8 +- doc_source/configuration-console.md | 6 +- doc_source/configuration-envvars.md | 11 +- doc_source/configuration-filesystem.md | 3 +- doc_source/configuration-vpc.md | 68 ++-- doc_source/csharp-handler.md | 6 +- doc_source/csharp-package-toolkit.md | 2 +- doc_source/getting-started-create-function.md | 4 +- doc_source/gettingstarted-awscli.md | 4 +- doc_source/gettingstarted-concepts.md | 38 ++- doc_source/golang-context.md | 2 +- doc_source/golang-handler.md | 2 +- doc_source/index.md | 7 +- doc_source/lambda-api-permissions-ref.md | 12 +- doc_source/lambda-invocation.md | 1 + doc_source/lambda-java.md | 4 +- doc_source/lambda-monitoring.md | 2 +- doc_source/lambda-nodejs.md | 4 +- doc_source/lambda-python.md | 12 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-ruby.md | 4 +- doc_source/lambda-runtimes.md | 16 +- doc_source/nodejs-context.md | 2 +- doc_source/python-context.md | 2 +- doc_source/python-handler.md | 2 +- doc_source/ruby-handler.md | 2 +- doc_source/runtimes-api.md | 2 +- doc_source/runtimes-context.md | 67 +++- doc_source/runtimes-custom.md | 4 +- doc_source/runtimes-extensions-api.md | 294 ++++++++++++++++++ doc_source/runtimes-modify.md | 244 +++++++++++++++ doc_source/runtimes-walkthrough.md | 2 +- doc_source/security-dataprotection.md | 3 +- doc_source/security-iam.md | 2 +- doc_source/services-alb.md | 2 +- doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-cloudwatchevents.md | 2 +- doc_source/services-codepipeline.md | 4 +- doc_source/services-ec2-tutorial.md | 2 +- doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-rds-tutorial.md | 2 +- doc_source/services-s3-batch.md | 8 +- doc_source/stepfunctions-lc.md | 2 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/using-extensions.md | 75 +++++ doc_source/welcome.md | 4 +- doc_source/with-android-example.md | 4 +- doc_source/with-ddb-example.md | 8 +- doc_source/with-kinesis-example.md | 2 +- doc_source/with-s3-example-deployment-pkg.md | 2 +- doc_source/with-s3-example.md | 6 + doc_source/with-s3.md | 2 +- doc_source/with-sqs-example.md | 8 +- doc_source/with-sqs.md | 4 +- 57 files changed, 859 insertions(+), 135 deletions(-) create mode 100644 doc_source/runtimes-extensions-api.md create mode 100644 doc_source/runtimes-modify.md create mode 100644 doc_source/using-extensions.md diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index c853f521..372e7152 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -94,7 +94,7 @@ When the deployment process completes, invoke the function from the Lambda conso 1. Choose **Test**\. -The Lambda console executes your function and displays the result\. Expand the **Details** section under the result to see the output and execution details\. +The Lambda console runs your function and displays the result\. Expand the **Details** section under the result to see the output and execution details\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-result.png) @@ -326,7 +326,7 @@ You can continue to modify and use the sample to develop your own application\. 1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. -1. Delete the artifact bucket – **aws\-*us\-east\-2*\-*123456789012*\-my\-app\-pipe**\. +1. Delete the artifact bucket – ***us\-east\-2*\-*123456789012*\-my\-app\-pipe**\. 1. Return to the AWS CloudFormation console and delete the infrastructure stack – **serverlessrepo\-my\-app\-toolchain**\. diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md index 9de9c162..771016c8 100644 --- a/doc_source/applications-usecases.md +++ b/doc_source/applications-usecases.md @@ -24,7 +24,7 @@ The diagram illustrates the following sequence: 1. Amazon S3 invokes your Lambda function using the permissions provided by the [execution role](lambda-intro-execution-role.md)\. -1. AWS Lambda executes the Lambda function, specifying the event as a parameter\. +1. AWS Lambda runs the Lambda function, specifying the event as a parameter\. You configure Amazon S3 to invoke your function as a bucket notification action\. To grant Amazon S3 permission to invoke the function, update the function's [resource\-based policy](access-control-resource-based.md)\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index b51642ac..f527019c 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -16,23 +16,23 @@ The following are recommended best practices for using AWS Lambda: var foo = event.foo; var bar = event.bar; var result = MyLambdaFunction (foo, bar); - + callback(null, result); } - + function MyLambdaFunction (foo, bar) { // MyLambdaFunction logic here } ``` + **Take advantage of execution context reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. - To avoid potential data leaks across invocations, don’t use the execution context to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. + **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. + **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [AWS Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. + **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [AWS Lambda deployment package in Java](java-package.md) for instructions\. -+ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution context](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. ++ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function concurrent execution limit to `0` immediately to throttle all invocations to the function, while you update the code\. ## Function configuration diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index a8e0e8cc..5833009d 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -15,13 +15,13 @@ With the function node selected in the designer, you can modify the following se **Function settings** + **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, upload a [deployment package](gettingstarted-features.md#gettingstarted-features-package)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. -+ **Runtime** – The [Lambda runtime](lambda-runtimes.md) that executes your function\. -+ **Handler** – The method that the runtime executes when your function is invoked, such as `index.handler`\. The first value is the name of the file or module\. The second value is the name of the method\. ++ **Runtime** – The [Lambda runtime](lambda-runtimes.md) that runs your function\. ++ **Handler** – The method that the runtime runs when your function is invoked, such as `index.handler`\. The first value is the name of the file or module\. The second value is the name of the method\. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\. + **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. Tags apply to the entire function, including all versions and aliases\. -+ **Execution role** – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it executes your function\. ++ **Execution role** – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. + **Description** – A description of the function\. + **Memory**– The amount of memory available to the function during execution\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 6a6d01ac..a7098f68 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -27,10 +27,17 @@ You set environment variables on the unpublished version of your function by spe 1. Choose **Save**\. -Use environment variables to pass environment\-specific settings to your code\. For example, you can have two functions with the same code but different configuration\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. You might also set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. +Use environment variables to pass environment\-specific settings to your code\. For example, you can have two functions with the same code but different configuration\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. + +The following example shows how to define the database host and database name as environment variables\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-env.png) +If you want your test environment to generate more debug information than the production environment, you could set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. + +**Note** +Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in the function code\. + To retrieve environment variables in your function code, use the standard method for your programming language\. ------ @@ -99,6 +106,7 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i **Reserved environment variables** + `_HANDLER` – The handler location configured on the function\. ++ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. + `AWS_REGION` – The AWS Region where the Lambda function is executed\. + `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_`—for example, `AWS_Lambda_java8`\. + `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. @@ -120,7 +128,6 @@ The following additional environment variables aren't reserved and can be extend + `NODE_PATH` – \([Node\.js](lambda-nodejs.md)\) The Node\.js library path \(`/opt/nodejs/node12/node_modules/:/opt/nodejs/node_modules:$LAMBDA_RUNTIME_DIR/node_modules`\)\. + `PYTHONPATH` – \([Python 2\.7, 3\.6, 3\.8](lambda-python.md)\) The Python library path \(`$LAMBDA_RUNTIME_DIR`\)\. + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. -+ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 5edcd148..3b3594f0 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -162,8 +162,7 @@ Resources: FileSystemConfigs: - Arn: !Sub - - "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/${ap}" - - {ap: !Ref AccessPoint} + - "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" LocalMountPath: "/mnt/efs0" DependsOn: "MountTarget1" ``` diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 5c430b89..b6f7ba96 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,22 +2,6 @@ You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources during execution\. -**To connect a function to a VPC** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. - -1. Choose a function\. - -1. Under **VPC**, choose **Edit**\. - -1. For **VPC connection**, choose **Custom VPC**\. - -1. Choose a VPC, subnets, and security groups\. -**Note** -Connect your function to private subnets to access private resources\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. - -1. Choose **Save**\. - When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\. While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. @@ -28,15 +12,13 @@ If your functions aren't active for a long period of time, Lambda reclaims its n Lambda functions can't connect directly to a VPC with [ dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. -**VPC tutorials** -+ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) -+ [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) - **Topics** + [Execution role and user permissions](#vpc-permissions) -+ [Configuring VPC access with the Lambda API](#vpc-configuring) ++ [Configuring VPC access with the Lambda console](#vpc-configuring) ++ [Configuring VPC access with the Lambda API](#vpc-configuring-api) + [Using IAM condition keys for VPC settings](#vpc-conditions) + [Internet and service access for VPC\-connected functions](#vpc-internet) ++ [VPC tutorials](#vpc-tutorials) + [Sample VPC configurations](#vpc-samples) ## Execution role and user permissions @@ -57,7 +39,43 @@ When you configure VPC connectivity, Lambda uses your permissions to verify netw + **ec2:DescribeSubnets** + **ec2:DescribeVpcs** -## Configuring VPC access with the Lambda API +## Configuring VPC access with the Lambda console + +If your [IAM permissions](#vpc-conditions) allow you only to create Lambda functions that connect to your VPC, you must configure the VPC when you create the function\. If your IAM permissions allow you to create functions that aren't connected to your VPC, you can add the VPC configuration after you create the function\. + +**To configure a VPC when you create a function** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose **Create function**\. + +1. Under **Basic information**, for **Function name**, enter a name for your function\. + +1. Expand **Advanced settings**\. + +1. Under **Network**, choose a **VPC** for your function to access\. + +1. Choose subnets and security groups\. When you choose a security group, the console displays the inbound and outbound rules for that security group\. +**Note** +To access private resources, connect your function to private subnets\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. + +1. Choose **Create function**\. + +**To configure a VPC for an existing function** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **VPC**, choose **Edit**\. + +1. Choose a VPC, subnets, and security groups\. +**Note** +To access private resources, connect your function to private subnets\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. + +1. Choose **Save**\. + +## Configuring VPC access with the Lambda API To connect a Lambda function to a VPC, you can use the following API operations: + [CreateFunction](API_CreateFunction.md) @@ -269,6 +287,12 @@ Several AWS services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/lates Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) +## VPC tutorials + +In the following tutorials, you connect a Lambda function to resources in your VPC\. ++ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) ++ [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + ## Sample VPC configurations You can use the following sample AWS CloudFormation templates to create VPC configurations to use with Lambda functions\. There are two templates available in this guide's GitHub repository: diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 77ebef7a..cd35ebc2 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in C\# -When you create a Lambda function, you specify a handler that AWS Lambda can invoke when the service executes the function on your behalf\. +When you create a Lambda function, you specify a handler that AWS Lambda can invoke when the service runs the function on your behalf\. You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current execution, such as the name of the current function, the memory limit, execution time remaining, and logging\. @@ -169,7 +169,7 @@ Note that there are some restrictions on the handler signature\. ## Using async in C\# functions with AWS Lambda -If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda executes the function synchronously and waits for the function to return a response or for execution to [time out](configuration-console.md)\. +If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to [time out](configuration-console.md)\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) @@ -181,7 +181,7 @@ public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) If you use this pattern, there are some considerations you must take into account: + AWS Lambda does not support `async void` methods\. -+ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will execute while others won't\. Or some async actions won't complete before the function execution is complete\. ++ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function execution is complete\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event event) // Compiler warning diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index 2d46af23..265826f8 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -37,7 +37,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. In the **Upload Lambda Function** window, type a name for the function or select a previously published function to republish\. Then choose **Next** 1. In the **Advanced Function Details** window, configure the following options: - + **Role Name** \(required\) – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it executes your function\. + + **Role Name** \(required\) – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. + **Environment** – Key\-value pairs that Lambda sets in the execution environment\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\. + **Memory** – The amount of memory available to the function during execution\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 0b15520e..175d19ff 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,6 +1,6 @@ # Create a Lambda function with the console -In this Getting Started exercise you create a Lambda function using the AWS Lambda console\. Next, you manually invoke the Lambda function using sample event data\. AWS Lambda executes the Lambda function and returns results\. You then verify execution results, including the logs that your Lambda function created and various CloudWatch metrics\. +In this Getting Started exercise you create a Lambda function using the AWS Lambda console\. Next, you manually invoke the Lambda function using sample event data\. AWS Lambda runs the Lambda function and returns results\. You then verify execution results, including the logs that your Lambda function created and various CloudWatch metrics\. **To create a Lambda function** @@ -44,7 +44,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose **Create** and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. -1. AWS Lambda executes your function on your behalf\. The `handler` in your Lambda function receives and then processes the sample event\. +1. AWS Lambda runs your function on your behalf\. The `handler` in your Lambda function receives and then processes the sample event\. 1. Upon successful execution, view results in the console\. + The **Execution result** section shows the execution status as **succeeded** and also shows the function execution results, returned by the `return` statement\. diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index bf190cc7..2fe965e0 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -209,7 +209,7 @@ $ ./get-logs.sh ## List the Lambda functions in your account -Execute the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. +Run the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. ``` $ aws lambda list-functions --max-items 10 @@ -274,7 +274,7 @@ For more information, see [GetFunction](API_GetFunction.md)\. ## Clean up -Execute the following `delete-function` command to delete the `my-function` function\. +Run the following `delete-function` command to delete the `my-function` function\. ``` $ aws lambda delete-function --function-name my-function diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index a9f60b6c..6e338424 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,38 +1,54 @@ # AWS Lambda concepts -With AWS Lambda, you run functions to process events\. You can send events to your function by invoking it with the Lambda API, or by configuring an AWS service or resource to invoke it\. +With Lambda, you run functions to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. **Topics** + [Function](#gettingstarted-concepts-function) + [Qualifier](#gettingstarted-concepts-qualifier) ++ [Execution environment](#gettingstarted-concepts-ee) + [Runtime](#gettingstarted-concepts-runtimes) ++ [Extension](#gettingstarted-concepts-extensions) + [Event](#gettingstarted-concepts-event) + [Concurrency](#gettingstarted-concepts-concurrency) + [Trigger](#gettingstarted-concepts-trigger) ## Function -A function is a resource that you can invoke to run your code in AWS Lambda\. A function has code that processes events, and a runtime that passes requests and responses between Lambda and the function code\. You provide the code, and you can use the provided runtimes or create your own\. +A *function* is a resource that you can invoke to run your code in Lambda\. A function has code that processes events, and a [runtime](#gettingstarted-concepts-runtimes) that passes requests and responses between Lambda and the function code\. You provide the code, and you can use the provided runtimes or create your own\. For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. ## Qualifier -When you invoke or view a function, you can include a qualifier to specify a version or alias\. A version is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An alias is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. +When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. For more information, see [Lambda function versions](configuration-versions.md)\. +## Execution environment + +An *execution environment* provides a secure and isolated runtime environment where Lambda invokes your function\. An execution environment manages the runtime and other resources that are required to run your function\. The execution environment provides lifecycle support for the function's runtime and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. + +For more information, see [AWS Lambda execution environmentManaging state machines in the Lambda console](runtimes-context.md)\. + ## Runtime -Lambda runtimes allow functions in different languages to run in the same base execution environment\. You configure your function to use a runtime that matches your programming language\. The runtime sits in between the Lambda service and your function code, relaying invocation events, context information, and responses between the two\. You can use runtimes provided by Lambda, or build your own\. +The Lambda *runtime* provides a language\-specific environment that runs in the execution environment\. You configure your function to use a runtime that matches your programming language\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes provided by Lambda, or build your own\. For more information, see [AWS Lambda runtimes](lambda-runtimes.md)\. +## Extension + +Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools provided by [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/), or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. + +An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. + +For more information, see [Using AWS Lambda extensions](using-extensions.md)\. + ## Event -An event is a JSON formatted document that contains data for a function to process\. The Lambda runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. +An *event* is a JSON\-formatted document that contains data for a function to process\. The Lambda runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. -**Example custom event – Weather data** +**Example Custom event – Weather data** ``` { @@ -45,7 +61,7 @@ An event is a JSON formatted document that contains data for a function to proce When an AWS service invokes your function, the service defines the shape of the event\. -**Example service event – Amazon SNS notification** +**Example Service event – Amazon SNS notification** ``` { @@ -59,16 +75,16 @@ When an AWS service invokes your function, the service defines the shape of the ... ``` -For details on events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. +For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. ## Concurrency -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. +*Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. -Concurrency is subject to quotas at the region level\. You can also configure individual functions to limit their concurrency, or to ensure that they can reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. ## Trigger -A trigger is a resource or configuration that invokes a Lambda function\. This includes AWS services that can be configured to invoke a function, applications that you develop, and event source mappings\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. +A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that can be configured to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/golang-context.md b/doc_source/golang-context.md index 997387d5..e2898688 100644 --- a/doc_source/golang-context.md +++ b/doc_source/golang-context.md @@ -46,7 +46,7 @@ func main() { In the example above, `lc` is the variable used to consume the information that the context object captured and `log.Print(lc.Identity.CognitoIdentityPoolID)` prints that information, in this case, the CognitoIdentityPoolID\. -The following example introduces how to use the context object to monitor how long it takes to execute your Lambda function\. This allows you to analyze performance expectations and adjust your function code accordingly, if needed\. +The following example introduces how to use the context object to monitor how long your Lambda function takes to complete\. This allows you to analyze performance expectations and adjust your function code accordingly, if needed\. ``` package main diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 116c991b..2640568a 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -35,7 +35,7 @@ Note the following: + **name MyEvent**: An input type with a variable name of `name` whose value will be returned in the `return` statement\. + **string, error**: Returns two values: string for success and standard [error](https://golang.org/pkg/builtin/#error) information\. For more information on custom error handling, see [AWS Lambda function errors in Go](golang-exceptions.md)\. + **return fmt\.Sprintf\("Hello %s\!", name\), nil**: Simply returns a formatted "Hello" greeting with the name you supplied in the input event\. `nil` indicates there were no errors and the function executed successfully\. -+ **func main\(\)**: The entry point that executes your Lambda function code\. This is required\. ++ **func main\(\)**: The entry point that runs your Lambda function code\. This is required\. By adding `lambda.Start(HandleRequest)` between `func main(){}` code brackets, your Lambda function will be executed\. Per Go language standards, the opening bracket, `{` must be placed directly at end the of the `main` function signature\. diff --git a/doc_source/index.md b/doc_source/index.md index c8871814..fe11d4b9 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -47,14 +47,17 @@ Amazon's trademarks and trade dress may not be used in + [Monitoring the state of a function with the Lambda API](functions-states.md) + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + + [Using AWS Lambda extensions](using-extensions.md) + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) + [Sample function code](with-android-create-package.md) + [AWS Lambda runtimes](lambda-runtimes.md) - + [AWS Lambda execution context](runtimes-context.md) + [Runtime support policy](runtime-support-policy.md) + + [AWS Lambda execution environment](runtimes-context.md) + + [AWS Lambda runtime API](runtimes-api.md) + + [AWS Lambda Extensions API](runtimes-extensions-api.md) + + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) - + [AWS Lambda runtime interface](runtimes-api.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [AWS Lambda applications](deploying-lambda-apps.md) + [Managing applications in the AWS Lambda console](applications-console.md) diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index fc764aac..35515e6c 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -70,9 +70,9 @@ For more information on resources and conditions for Lambda and other AWS servic **Topics** + [Function resource names](#function-resources) -+ [Functions](#permissions-resources-function) -+ [Event source mappings](#permissions-resources-eventsource) -+ [Layers](#permissions-resources-layers) ++ [Function actions](#permissions-resources-function) ++ [Event source mapping actions](#permissions-resources-eventsource) ++ [Layer actions](#permissions-resources-layers) ## Function resource names @@ -181,7 +181,7 @@ The following identity\-based policy statement denies access to the invoke actio } ``` -## Functions +## Function actions Actions that operate on a function can be restricted to a specific function by function, version, or alias ARN, as described in the following table\. Actions that don't support resource restrictions can only be granted for all resources \(`*`\)\. @@ -196,7 +196,7 @@ Actions that operate on a function can be restricted to a specific function by f | [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListAliases](API_ListAliases.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | None | | [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) [ListTags](API_ListTags.md) [TagResource](API_TagResource.md) [UntagResource](API_UntagResource.md) | `*` | None | -## Event source mappings +## Event source mapping actions For event source mappings, delete and update permissions can be restricted to a specific event source\. The `lambda:FunctionArn` condition lets you restrict which functions a user can configure an event source to invoke\. @@ -211,7 +211,7 @@ For these actions, the resource is the event source mapping, so Lambda provides | [CreateEventSourceMapping](API_CreateEventSourceMapping.md) | `*` | `lambda:FunctionArn` | | [GetEventSourceMapping](API_GetEventSourceMapping.md) [ListEventSourceMappings](API_ListEventSourceMappings.md) | `*` | None | -## Layers +## Layer actions Layer actions let you restrict the layers that a user can manage or use with a function\. Actions related to layer use and permissions act on a version of a layer, while `PublishLayerVersion` acts on a layer name\. You can use either with wildcards to restrict the layers that a user can work with by name\. diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index c268c968..ad91489b 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -19,4 +19,5 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Monitoring the state of a function with the Lambda API](functions-states.md) + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) ++ [Using AWS Lambda extensions](using-extensions.md) + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index e8d27f4e..be40991d 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -1,6 +1,6 @@ # Building Lambda functions with Java -You can run Java code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Java that execute your code to process events\. Your code runs in an Amazon Linux environment that includes AWS credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +You can run Java code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Java that run your code to process events\. Your code runs in an Amazon Linux environment that includes AWS credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. Lambda supports the following Java runtimes\. @@ -50,7 +50,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Choose **Create**\. -1. To execute the function, choose **Test**\. +1. To invoke the function, choose **Test**\. The console creates a Lambda function with a handler class named `Hello`\. Since Java is a compiled language, you can't view or edit the source code in the Lambda console, but you can modify its configuration, invoke it, and configure triggers\. diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index 7ce323f9..b5c677af 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,6 +1,6 @@ # Monitoring and troubleshooting Lambda applications -AWS Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. It also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +AWS Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code while it is running, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. It also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 5c32b71d..96f52801 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -1,6 +1,6 @@ # Building Lambda functions with Node\.js -You can run JavaScript code with Node\.js in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Node\.js that execute your code to process events\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +You can run JavaScript code with Node\.js in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Node\.js that run your code to process events\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. Lambda supports the following Node\.js runtimes\. @@ -49,7 +49,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Choose **Create**\. -1. To execute the function, choose **Test**\. +1. To invoke the function, choose **Test**\. The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 5228aaeb..aec53ce7 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -1,6 +1,6 @@ # Building Lambda functions with Python -You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Python that execute your code to process events\. Your code runs in an environment that includes the SDK for Python \(Boto3\), with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Python that run your code to process events\. Your code runs in an environment that includes the SDK for Python \(Boto3\), with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. Lambda supports the following Python runtimes\. @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -51,7 +51,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Choose **Create**\. -1. To execute the function, choose **Test**\. +1. To invoke the function, choose **Test**\. The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 1309aaa1..cb2299df 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | | [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | | [New event source to provide Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | | [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 46914084..52abe3a8 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -1,6 +1,6 @@ # Building Lambda functions with Ruby -You can run Ruby code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Ruby that execute your code to process events\. Your code runs in an environment that includes the AWS SDK for Ruby, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +You can run Ruby code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Ruby that run your code to process events\. Your code runs in an environment that includes the AWS SDK for Ruby, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. Lambda supports the following Ruby runtimes\. @@ -49,7 +49,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Choose **Create**\. -1. To execute the function, choose **Test**\. +1. To invoke the function, choose **Test**\. The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 480b011a..1cc2858f 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -10,7 +10,7 @@ AWS Lambda supports multiple languages through the use of runtimes\. You choose + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and allows you to save resources like database connections and temporary files in the [execution context](runtimes-context.md) to avoid creating them every time your function runs\. +When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and allows you to save resources like database connections and temporary files in the [execution environment](runtimes-context.md) to avoid creating them every time your function runs\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -27,10 +27,10 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.17 botocore\-1\.17\.17 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | **Ruby runtimes** @@ -75,8 +75,10 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- | Custom Runtime | `provided` | Amazon Linux | **Topics** -+ [AWS Lambda execution context](runtimes-context.md) + [Runtime support policy](runtime-support-policy.md) ++ [AWS Lambda execution environment](runtimes-context.md) ++ [AWS Lambda runtime API](runtimes-api.md) ++ [AWS Lambda Extensions API](runtimes-extensions-api.md) ++ [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) -+ [AWS Lambda runtime interface](runtimes-api.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) \ No newline at end of file diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md index a89e311d..8740b68a 100644 --- a/doc_source/nodejs-context.md +++ b/doc_source/nodejs-context.md @@ -28,7 +28,7 @@ When Lambda runs your function, it passes a context object to the [handler](node + `env.model` + `env.locale` + `Custom` – Custom values that are set by the mobile application\. -+ `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) executes, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. ++ `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. The following example function logs context information and returns the location of the logs\. diff --git a/doc_source/python-context.md b/doc_source/python-context.md index e7c2d459..629eeb09 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -36,7 +36,7 @@ def get_my_log_stream(event, context):        print("Log group name:", context.log_group_name)    print("Request ID:",context.aws_request_id)    print("Mem. limits(MB):", context.memory_limit_in_mb) - # Code will execute quickly, so we add a 1 second intentional delay so you can see that in time remaining value. + # Code will run quickly, so we add a 1 second intentional delay so you can see that in time remaining value. time.sleep(1)    print("Time remaining (MS):", context.get_remaining_time_in_millis()) ``` diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 36a36163..aef85878 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Python -At the time you create a Lambda function, you specify a *handler*, which is a function in your code, that AWS Lambda can invoke when the service executes your code\. Use the following general syntax structure when creating a handler function in Python\. +At the time you create a Lambda function, you specify a *handler*, which is a function in your code, that AWS Lambda can invoke when the service runs your code\. Use the following general syntax structure when creating a handler function in Python\. ``` def handler_name(event, context): diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index f9e4709d..e6cd111d 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -34,4 +34,4 @@ The two objects that the handler accepts are the invocation event and context\. The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution context, see [AWS Lambda execution contextManaging state machines in the Lambda console](runtimes-context.md)\. \ No newline at end of file +Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environmentManaging state machines in the Lambda console](runtimes-context.md)\. \ No newline at end of file diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md index cea50763..da982192 100644 --- a/doc_source/runtimes-api.md +++ b/doc_source/runtimes-api.md @@ -1,4 +1,4 @@ -# AWS Lambda runtime interface +# AWS Lambda runtime API AWS Lambda provides an HTTP API for [custom runtimes](runtimes-custom.md) to receive invocation events from Lambda and send response data back within the Lambda [execution environment](lambda-runtimes.md)\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 29c5a2bd..46caed3f 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -1,12 +1,63 @@ -# AWS Lambda execution context +# AWS Lambda execution environment -When AWS Lambda executes your Lambda function, it provisions and manages the resources needed to run your Lambda function\. When you create a Lambda function, you specify configuration information, such as the amount of memory and maximum execution time that you want to allow for your Lambda function\. When a Lambda function is invoked, AWS Lambda launches an execution context based on the configuration settings you provide\. The execution context is a temporary runtime environment that initializes any external dependencies of your Lambda function code, such as database connections or HTTP endpoints\. This affords subsequent invocations better performance because there is no need to "cold\-start" or initialize those external dependencies, as explained below\. +Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](using-extensions.md) associated with your function\. -It takes time to set up an execution context and do the necessary "bootstrapping", which adds some latency each time the Lambda function is invoked\. You typically see this latency when a Lambda function is invoked for the first time or after it has been updated because AWS Lambda tries to reuse the execution context for subsequent invocations of the Lambda function\. +The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. -After a Lambda function is executed, AWS Lambda maintains the execution context for some time in anticipation of another Lambda function invocation\. In effect, the service freezes the execution context after a Lambda function completes, and thaws the context for reuse, if AWS Lambda chooses to reuse the context when the Lambda function is invoked again\. This execution context reuse approach has the following implications: -+ Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We suggest adding logic in your code to check if a connection exists before creating one\. -+ Each execution context provides 512 MB of additional disk space in the `/tmp` directory\. The directory content remains when the execution context is frozen, providing transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For information on deployment limits, see [AWS Lambda quotas](gettingstarted-limits.md)\. -+ Background processes or callbacks initiated by your Lambda function that did not complete when the function ended resume if AWS Lambda chooses to reuse the execution context\. You should make sure any background processes or callbacks in your code are complete before the code exits\. +![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Extensions-Concept-Diagram.png) -When you write your Lambda function code, do not assume that AWS Lambda automatically reuses the execution context for subsequent function invocations\. Other factors may dictate a need for AWS Lambda to create a new execution context, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file +When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. + +The function's runtime and each external extension are processes that run within the execution environment\. Permissions, resources, credentials, and environment variables are shared between the function and the extensions\. + +## Lambda execution environment lifecycle + +The lifecycle of the execution environment includes the following phases: ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. ++ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. + +![\[The Init phase is followed by one or more function invocations. When there are no invocation requests, Lambda initiates the SHutdown phase.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Successful-Invokes.png) + +Each phase starts with an event that Lambda sends to the runtime and to all registered extensions\. The runtime and each extension indicate completion by sending a `Next` API request\. Lambda freezes the execution environment when the runtime and each extension have completed and there are no pending events\. + +**Topics** ++ [Init phase](#runtimes-lifecycle-ib) ++ [Invoke phase](#runtimes-lifecycle-invoke) ++ [Shutdown phase](#runtimes-lifecycle-shutdown) + +### Init phase + +In the `Init` phase, Lambda performs three tasks: ++ Start all extensions \(`Extension init`\) ++ Bootstrap the runtime \(`Runtime init`\) ++ Run the function's static code \(`Function init`\) + +The `Init` phase ends when the runtime and all extensions signal that they are ready by sending a `Next` API request\. The `Init` phase is limited to 10 seconds\. If all three tasks do not complete within 10 seconds, Lambda retries the `Init` phase at the time of the first function invocation\. + +### Invoke phase + +When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension\. + +The function's timeout setting limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. + +The invoke phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. + +If there is a failure during `Invoke`, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. + +![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) + +### Shutdown phase + +When Lambda is about to shut down the runtime, it sends a `Shutdown` event to the runtime and to each external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is a response to a `Next` API request\. + +**Duration**: The entire `Shutdown` phase is capped at 2 seconds\. If the runtime or any extension does not respond, Lambda terminates it via a signal \(`SIGKILL`\)\. + +After the function and all extensions have completed, Lambda maintains the execution environment for some time in anticipation of another function invocation\. In effect, Lambda freezes the execution environment\. When the function is invoked again, Lambda thaws the environment for reuse\. Reusing the execution environment has the following implications: ++ Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We recommend adding logic in your code to check if a connection exists before creating a new one\. ++ Each execution environment provides 512 MB of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [AWS Lambda quotas](gettingstarted-limits.md)\. ++ Background processes or callbacks that were initiated by your Lambda function and did not complete when the function ended resume if Lambda reuses the execution environment\. Make sure that any background processes or callbacks in your code are complete before the code exits\. + +When you write your function code, do not assume that Lambda automatically reuses the execution environment for subsequent function invocations\. Other factors may dictate a need for Lambda to create a new execution environment, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index f93de3ee..49e9db3b 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -24,11 +24,11 @@ To use a custom runtime, set your function's runtime to `provided`\. The runtime ├── function.sh ``` -If there's a file named `bootstrap` in your deployment package, Lambda executes that file\. If not, Lambda looks for a runtime in the function's layers\. If the bootstrap file isn't found or isn't executable, your function returns an error upon invocation\. +If there's a file named `bootstrap` in your deployment package, Lambda runs that file\. If not, Lambda looks for a runtime in the function's layers\. If the bootstrap file isn't found or isn't executable, your function returns an error upon invocation\. ## Building a custom runtime -A custom runtime's entry point is an executable file named `bootstrap`\. The bootstrap file can be the runtime, or it can invoke another file that creates the runtime\. The following example uses a bundled version of Node\.js to execute a JavaScript runtime in a separate file named `runtime.js`\. +A custom runtime's entry point is an executable file named `bootstrap`\. The bootstrap file can be the runtime, or it can invoke another file that creates the runtime\. The following example uses a bundled version of Node\.js to run a JavaScript runtime in a separate file named `runtime.js`\. **Example bootstrap** diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md new file mode 100644 index 00000000..b921315f --- /dev/null +++ b/doc_source/runtimes-extensions-api.md @@ -0,0 +1,294 @@ +# AWS Lambda Extensions API + +You use the Extensions API to create Lambda extensions\. The Extensions API provides a simple way to extend the Lambda [ execution environment](runtimes-context.md)\. + +The Extensions API builds on the existing [Runtime API](runtimes-api.md), which provides an HTTP API for custom runtimes to receive invocation events from Lambda\. As an extension author, you can use the Extensions API to register for function and execution environment lifecycle events\. In response to these events, you can start new processes or run logic\. + +Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific environment variables and wrapper scripts, and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\.** + +** + +An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, they can be written in a different language than the function\. + +The following [Lambda runtimes](lambda-runtimes.md) support external extensions: ++ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) ++ Custom runtime \(`provided`\) ++ Custom runtime on Amazon Linux 2 \(`provided.al2`\) ++ Java 11 \(Corretto\) \(`java11`\) ++ Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 12\.x \(`nodejs12.x`\) ++ Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.8 \(`python3.8`\) ++ Python 3\.7 \(`python3.7`\) ++ Ruby 2\.7 \(`ruby2.7`\) ++ Ruby 2\.5 \(`ruby2.5`\) + +We recommend that you implement external extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. + +You share your extension as a [Lambda layer](configuration-layers.md) to make it available within your organization or to the entire community of Lambda developers\. Function developers can find, manage, and install extensions through layers\. + +You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. + +## Lambda execution environment lifecycle + +The lifecycle of the execution environment includes the following phases: ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. ++ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. + +Each phase starts with an event from the Lambda service to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) + +**Topics** ++ [Init phase](#runtimes-extensions-api-reg) ++ [Invoke phase](#runtimes-lifecycle-invoke) ++ [Shutdown phase](#runtimes-lifecycle-shutdown) ++ [Permissions and configuration](#runtimes-extensions-registration-api-e) ++ [Failure handling](#runtimes-extensions-api-failure) ++ [Troubleshooting extensions](#runtimes-extensions-api-trbl) + +### Init phase + +During the `Extension init` phase, each extension needs to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. + +You can register up to 10 extensions for a function\. This limit is enforced through the `Register` API call\. + +After each extension registers with Lambda, Lambda starts the `Runtime init` phase\. The runtime process calls functionInit to start the Function init phase\. + +The `Init` phase completes after the runtime and each registered extension indicate completion by sending a `Next` API request\. + +**Note** +Extensions can complete their initialization at any point in the `Init` phase\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Init-Phase.png) + +### Invoke phase + +When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension that is registered for the `Invoke` event\. + +During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or send logs, metrics, and traces to a location of your choice\. + +The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Invoke-Phase.png) + +**Event payload**: The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to the extensions carries only the headers\. Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. + +Here is an example payload: + +``` +{ + "eventType": "INVOKE", + "deadlineMs": 676051, + "requestId": "3da1f2dc-3222-475e-9205-e2e6c6318895", + "invokedFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:ExtensionTest", + "tracing": { + "type": "X-Amzn-Trace-Id", + "value": "Root=1-5f35ae12-0c0fec141ab77a00bc047aa2;Parent=2be948a625588e32;Sampled=1" + } + } +``` + +**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. + +**Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's execution duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function execution duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. + +To help identify the overhead introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. + +You can assess the performance impact of an extension by using the `PostRuntimeExecutionDuration` metric to measure the extra time an extension adds to the function execution\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + +Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. + +### Shutdown phase + +When Lambda is about to terminate the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. + +**Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: ++ 300 ms – a function with no registered extensions\. ++ 500 ms – a function with a registered internal extension\. ++ 2000 ms – a function with one or more registered external extensions\. + +For a function with external extensions, Lambda reserves up to 300 or 500 ms \(for a runtime without/with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2000 ms limit for external extensions to shut down\. + +If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda terminates the process using a `SIGKILL` signal\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Shutdown-Phase.png) + +**Event payload**: The `Shutdown` event contains the reason for the shutdown and the time remaining in milliseconds\. + + The `shutdownReason` includes the following values: ++ SPIN\-DOWN – Normal shutdown ++ TIMEOUT – Duration limit timed out ++ FAILURE – Error condition, such as an `out-of-memory` event + +``` +{ + "eventType": "SHUTDOWN", + "shutdownReason": "reason for shutdown", + "deadlineMs": "time remaining in milliseconds" +} +``` + +### Permissions and configuration + +Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and /tmp disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. + +**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional network egress rules, you must apply these rules to the function configuration\. + +**Note** +Because the function code directory is read\-only, extensions cannot modify the function code\. + +**Environment variables**: Extensions can access the function's [environment variables](configuration-envvars.md), except for the following variables that are specific to the runtime process: ++ `AWS_EXECUTION_ENV` ++ `AWS_LAMBDA_LOG_GROUP_NAME` ++ `AWS_LAMBDA_LOG_STREAM_NAME` ++ `AWS_XRAY_CONTEXT_MISSING` ++ `AWS_XRAY_DAEMON_ADDRESS` ++ `LAMBDA_RUNTIME_DIR` ++ `LAMBDA_TASK_ROOT` ++ `_AWS_XRAY_DAEMON_ADDRESS` ++ `_AWS_XRAY_DAEMON_PORT` ++ `_HANDLER` + +### Failure handling + +**Initialization failures**: If an extension fails, Lambda restarts the execution environment to enforce consistent behavior and encourage fail fast for extensions\. Also, for some customers, the extensions must meet mission\-critical needs such as logging, security, governance, and telemetry collection\. + +**Invoke failures** \(e\.g\. out of memory, function timeout\): Because extensions share resources with the runtime, they are affected by memory exhaustion\. When the runtime fails, all extensions and the runtime itself participate in the `Shutdown` phase\. In addition, the runtime is restarted—either automatically as part of the current invoke, or via a deferred re\-initialization mechanism\. + +If there is a failure \(such as a function timeout or runtime error\) during `Invoke`, the Lambda service performs a reset\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime, then it sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If this environment is used for a new invocation, the extension and runtime are re\-initialized as part of the next invocation\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) + +**Note** +Lambda does not automatically shut down extensions that repeatedly fail\. However, Lambda reports these errors through Amazon CloudWatch metrics and logs so that function developers and extension authors can understand and diagnose such failures\. + +**Extension logs**: Lambda sends the log output of extensions to CloudWatch Logs\. Lambda also generates an additional log event for each extension during `Init`\. The log event records the name and registration preference \(event, config\) on success, or the failure reason on failure\. + +### Troubleshooting extensions ++ If a `Register` request fails, make sure that the `Lambda-Extension-Name` header in the `Register` API call contains the full file name of the extension\. ++ If the `Register` request fails for an internal extension, make sure that the request does not register for the `Shutdown` event\. + +## Extensions API reference + +The OpenAPI specification for the extensions API version **2020\-01\-01** is available here: [extensions\-api\.zip](samples/extensions-api.zip) + +You can retrieve the value of the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send a `Register` request, use the prefix `2020-01-01/` before each API path\. For example: + +``` +http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register +``` + +**Topics** ++ [Register](#extensions-registration-api-a) ++ [Next](#extensions-api-next) ++ [Init error](#runtimes-extensions-init-error) ++ [Exit error](#runtimes-extensions-exit-error) + +### Register + +During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. + +Internal extensions are started and stopped by the runtime process, so they are not permitted to register for the `Shutdown` event\. + +**Path** – `/extension/register` + +**Method** – **POST** + +**Headers ** + +`Lambda-Extension-Name` – The full file name of the extension\. Required: yes\. Type: string\. + +**Body parameters ** + +`events` – Array of the events to register for\. Required: no\. Type: array of strings\. + +**Response headers** ++ `Lambda-Extension-Identifier` – Generated unique agent identifier \(UUID string\) that is required for all subsequent requests\. + +**Response codes** ++ 200 – Response body contains the function name, function version, and handler name\. ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + +### Next + +Extensions send a `Next` API request to receive the next event, which can be an `Invoke` event or a `Shutdown` event\. The response body contains the payload, which is a JSON document that contains event data\. + +The extension sends a `Next` API request to signal that it is ready to receive new events\. This is a blocking call\. + +Do not set a timeout on the GET call, as the extension can be suspended for a period of time until there is an event to return\. + +**Path** – `/extension/event/next` + +**Method** – **GET** + +**Parameters** + +`Lambda-Extension-Identifier` – Unique identifier for extension \(UUID string\)\. Required: yes\. Type: UUID string\. + +**Response header** ++ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. + +**Response codes** ++ 200 – Response contains information about the next event \(`EventInvoke` or `EventShutdown`\)\. ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + +### Init error + +The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. + +**Path** – `/extension/init/error` + +**Method** – **POST** + +**Headers ** + +`Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. + +`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(e\.g\. Fatal\.ConnectFailed\)\. + +**Body parameters** + +`ErrorRequest` – JSON object with the error type, error message, and stack trace\. + +**Response body** ++ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. + +**Response codes** ++ 202 – Accepted ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + +### Exit error + +The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. + +**Path** – `/extension/exit/error` + +**Method** – **POST** + +**Headers** + +`Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. + +`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(e\.g\. Fatal\.ConnectFailed\)\. + +**Body parameters** + +`ErrorRequest` – JSON object with the error type, error message, and stack trace\. + +**Response body** ++ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. + +**Response codes** ++ 202 – Accepted ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md new file mode 100644 index 00000000..ae6569c4 --- /dev/null +++ b/doc_source/runtimes-modify.md @@ -0,0 +1,244 @@ +# Modifying the runtime environment + +You can use [internal extensions](using-extensions.md) to modify the runtime process\. Internal extensions are not separate processes—they run as part of the runtime process\. + +Lambda provides language\-specific [environment variables](configuration-envvars.md) that you can set to add options and tools to the runtime\. Lambda also provides [wrapper scripts](#runtime-wrapper), which allow Lambda to delegate the runtime startup to your script\. You can create a wrapper script to customize the runtime startup behavior\. + +## Language\-specific environment variables + +Lambda supports configuration\-only ways to enable code to be pre\-loaded during function initialization through the following language\-specific environment variables: ++ `JAVA_TOOL_OPTIONS` – On Java 11 and Java 8 \(`java8.al2`\), Lambda supports this environment variable to set additional command\-line variables in Lambda\. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the `agentlib` or `javaagent` options\. ++ `NODE_OPTIONS` – On Node\.js 10x and above, Lambda supports this environment variable\. ++ `DOTNET_STARTUP_HOOKS` – On \.NET Core 3\.1 and above, Lambda can take a path to an assembly \(dll\) provided by this environment variable\. + +Using language\-specific environment variables is the preferred way to set startup properties\. + +### Example: Intercept Lambda invokes with `javaagent` + +The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and execute its `premain` method before the application's entry point\. + +The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. + +``` +import com.amazonaws.services.lambda.runtime.RequestStreamHandler; +import net.bytebuddy.agent.builder.AgentBuilder; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.matcher.ElementMatchers; + +import java.lang.instrument.Instrumentation; + +public class Agent { + + public static void premain(String agentArgs, Instrumentation inst) { + new AgentBuilder.Default() + .with(new AgentBuilder.InitializationStrategy.SelfInjection.Eager()) + .type(ElementMatchers.isSubTypeOf(RequestStreamHandler.class)) + .transform((builder, typeDescription, classLoader, module) -> builder + .method(ElementMatchers.nameContains("handleRequest")) + .intercept(Advice.to(TimerAdvice.class))) + .installOn(inst); + } +} +``` + +The agent in the preceding example uses the `TimerAdvice` method\. `TimerAdvice` measures how many milliseconds are spent with the method call and logs the method time and details, such as name and passed arguments\. + +``` +import static net.bytebuddy.asm.Advice.AllArguments; +import static net.bytebuddy.asm.Advice.Enter; +import static net.bytebuddy.asm.Advice.OnMethodEnter; +import static net.bytebuddy.asm.Advice.OnMethodExit; +import static net.bytebuddy.asm.Advice.Origin; + +public class TimerAdvice { + + @OnMethodEnter + static long enter() { + return System.currentTimeMillis(); + } + + @OnMethodExit + static void exit(@Origin String method, @Enter long start, @AllArguments Object[] args) { + StringBuilder sb = new StringBuilder(); + for (Object arg : args) { + sb.append(arg); + sb.append(", "); + } + System.out.println(method + " method with args: " + sb.toString() + " took " + (System.currentTimeMillis() - start) + " milliseconds "); + } +} +``` + +The `TimerAdvice` method above has the following dependencies\. + +``` +*'com.amazonaws'*, *name*: *'aws-lambda-java-core'*, *version*: *'1.2.1'* +*'net.bytebuddy'*, *name*: *'byte-buddy-dep'*, *version*: *'1.10.14'* +*'net.bytebuddy'*, *name*: *'byte-buddy-agent'*, *version*: *'1.10.14'* +``` + +After you create a layer that contains the agent JAR, you can pass the JAR name to the runtime's JVM by setting an environment variable\. + +``` +JAVA_TOOL_OPTIONS=-javaagent:"/opt/ExampleAgent-0.0.jar" +``` + +After invoking the function with `{key=lambdaInput}`, you can find the following line in the logs: + +``` +public java.lang.Object lambdainternal.EventHandlerLoader$PojoMethodRequestHandler.handleRequest + (java.lang.Object,com.amazonaws.services.lambda.runtime.Context) method with args: + {key=lambdaInput}, lambdainternal.api.LambdaContext@4d9d1b69, took 106 milliseconds +``` + +### Example: Adding a shutdown hook to the JVM runtime process + +When an extension is registered during a Shutdown event, the runtime process gets up to 500 ms to handle graceful shutdown\. You can hook into the runtime process, and when the JVM begins its shutdown process, it starts all registered hooks\. To register a shutdown hook, you must [register as an extension](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. You do not need to explicitly register for the Shutdown event, as that is automatically sent to the runtime\. + +``` +import java.lang.instrument.Instrumentation; + +public class Agent { + + public static void premain(String agentArgs, Instrumentation inst) { +// Register the extension. +// ... + +// Register the shutdown hook + addShutdownHook(); + } + + private static void addShutdownHook() { +// Shutdown hooks get up to 500 ms to handle graceful shutdown before the runtime is terminated. +// +// You can use this time to egress any remaining telemetry, close open database connections, etc. + Runtime.getRuntime().addShutdownHook(new Thread(() -> { +// Inside the shutdown hook's thread we can perform any remaining task which needs to be done. + })); + } + +} +``` + +### Example: Retrieving the InvokedFunctionArn + +``` + @OnMethodEnter + static long enter() { + String invokedFunctionArn = null; + for (Object arg : args) { + if (arg instanceof Context) { + Context context = (Context) arg; + invokedFunctionArn = context.getInvokedFunctionArn(); + } + } + } +``` + +## Wrapper scripts + +You can create a *wrapper script* to customize the runtime startup behavior of your Lambda function\. A wrapper script enables you to set configuration parameters that cannot be set through language\-specific environment variables\. + +**Note** +Invocations may fail if the wrapper script does not successfully start the runtime process\. + +The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: ++ Node\.js 12\.x ++ Node\.js 10\.x ++ Python 3\.8 ++ Ruby 2\.7 ++ Java 11 ++ Java 8 \(`java8.al2`\) ++ \.NET Core 3\.1 + +When you use a wrapper script for your function, Lambda starts the runtime using your script\. Lambda sends to your script the path to the interpreter and all of the original arguments for the standard runtime startup\. Your script can extend or transform the startup behavior of the program\. For example, the script can inject and alter arguments, set environment variables, or capture metrics, errors, and other diagnostic information\. + +You specify the script by setting the value of the `AWS_LAMBDA_EXEC_WRAPPER` environment variable as the file system path of an executable binary or script\. + +### Example: Create and use a wrapper script with Python 3\.8 + +In the following example, you create a wrapper script to start the Python interpreter with the `-X importtime` option\. When you run the function, Lambda generates a log entry to show the duration of the import time for each import\. + +**To create and use a wrapper script with Python 3\.8** + +1. To create the wrapper script, paste the following code into a file named `importtime_wrapper`: + + ``` + #!/bin/bash + + # the path to the interpreter and all of the originally intended arguments + args=("$@") + + # the extra options to pass to the interpreter + extra_args=("-X" "importtime") + + # insert the extra options + args=("${args[@]:0:$#-1}" "${extra_args[@]}" "${args[@]: -1}") + + # start the runtime with the extra options + exec "${args[@]}" + ``` + +1. To give the script executable permissions, enter `chmod +x importtime_wrapper` from the command line\. + +1. Deploy the script as a [Lambda layer](configuration-layers.md)\. + +1. Create a function using the Lambda console\. + + 1. Open the [Lambda console](https://console.aws.amazon.com/lambda/home)\. + + 1. Choose **Create function**\. + + 1. Under **Basic information**, for **Function name**, enter **wrapper\-test\-function**\. + + 1. For **Runtime**, choose **Python 3\.8**\. + + 1. Choose **Create function**\. + +1. Add the layer to your function\. + + 1. On the [configuration page](configuration-console.md), choose **Layers**\. + + 1. Choose **Add a layer**\. + + 1. Under **Choose a layer**, choose the **Name** and **Version** of the compatible layer that you created earlier\. + + 1. Choose **Add**\. + +1. Add the code and the environment variable to your function\. + + 1. In the function [code editor](code-editor.md), paste the following function code: + + ``` + import json + + def lambda_handler(event, context): + # TODO implement + return { + 'statusCode': 200, + 'body': json.dumps('Hello from Lambda!') + } + ``` + + 1. Choose **Save**\. + + 1. Under **Environment variables**, choose **Manage environment variables**\. + + 1. Choose **Add environment variable**\. + + 1. For **Key**, enter `AWS_LAMBDA_EXEC_WRAPPER`\. + + 1. For **Value**, enter `/opt/importtime_wrapper`\. + + 1. Choose **Save**\. + +1. To run the function, choose **Test**\. + + Because your wrapper script started the Python interpreter with the `-X importtime` option, the logs show the time required for each import\. For example: + + ``` + ... + 2020-06-30T18:48:46.780+01:00 import time: 213 | 213 | simplejson + 2020-06-30T18:48:46.780+01:00 import time: 50 | 263 | simplejson.raw_json + ... + ``` \ No newline at end of file diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index 3531cb0b..1507c331 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -58,7 +58,7 @@ do # Extract request ID by scraping response headers received above REQUEST_ID=$(grep -Fi Lambda-Runtime-Aws-Request-Id "$HEADERS" | tr -d '[:space:]' | cut -d: -f2) - # Execute the handler function from the script + # Run the handler function from the script RESPONSE=$($(echo "$_HANDLER" | cut -d. -f2) "$EVENT_DATA") # Send the response diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index a1b6f7a2..ea029e5d 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -4,10 +4,11 @@ AWS Lambda conforms to the AWS [shared responsibility model](http://aws.amazon.c For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\), so that each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: + Use multi\-factor authentication \(MFA\) with each account\. -+ Use SSL/TLS to communicate with AWS resources\. ++ Use SSL/TLS to communicate with AWS resources\. We recommend TLS 1\.2 or later\. + Set up API and user activity logging with AWS CloudTrail\. + Use AWS encryption solutions, along with all default security controls within AWS services\. + Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. ++ If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields or metadata such as function names and tags\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into metadata might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index a4f75681..b277ed66 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -30,7 +30,7 @@ To sign in directly to the [AWS Management Console](https://console.aws.amazon.c Regardless of the authentication method that you use, you might also be required to provide additional security information\. For example, AWS recommends that you use multi\-factor authentication \(MFA\) to increase the security of your account\. To learn more, see [Using Multi\-Factor Authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. -### AWS Account Root User +### AWS account root user When you first create an AWS account, you begin with a single sign\-in identity that has complete access to all AWS services and resources in the account\. This identity is called the AWS account *root user* and is accessed by signing in with the email address and password that you used to create the account\. We strongly recommend that you do not use the root user for your everyday tasks, even the administrative ones\. Instead, adhere to the [best practice of using the root user only to create your first IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)\. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks\. diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md index 8be1d583..8f88cac2 100644 --- a/doc_source/services-alb.md +++ b/doc_source/services-alb.md @@ -53,7 +53,7 @@ Your function processes the event and returns a response document to the load ba } ``` -To configure an Application Load Balancer as a function trigger, grant Elastic Load Balancing permission to execute the function, create a target group that routes requests to the function, and add a rule to the load balancer that sends requests to the target group\. +To configure an Application Load Balancer as a function trigger, grant Elastic Load Balancing permission to run the function, create a target group that routes requests to the function, and add a rule to the load balancer that sends requests to the target group\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 56426ff8..16027b2a 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -213,7 +213,7 @@ Invoke the function manually using the sample event data\. We recommend that you } ``` -1. Execute the following `invoke` command: +1. Run the following `invoke` command: ``` $ aws lambda invoke --function-name LambdaFunctionOverHttps \ diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 75bdda70..5304429e 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -31,7 +31,7 @@ CloudWatch Events invokes your function asynchronously with an event document th } ``` -You can also create a Lambda function and direct AWS Lambda to execute it on a regular schedule\. You can specify a fixed rate \(for example, execute a Lambda function every hour or 15 minutes\), or you can specify a Cron expression\. +You can also create a Lambda function and direct AWS Lambda to invoke it on a regular schedule\. You can specify a fixed rate \(for example, invoke a Lambda function every hour or 15 minutes\), or you can specify a Cron expression\. **Example CloudWatch Events message event** diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md index bfa875ae..366fc952 100644 --- a/doc_source/services-codepipeline.md +++ b/doc_source/services-codepipeline.md @@ -25,7 +25,7 @@ CodePipeline invokes your function asynchronously with an event that contains de "location": { "type": "S3", "s3Location": { - "bucketName": "aws-us-west-2-123456789012-my-pipeline", + "bucketName": "us-west-2-123456789012-my-pipeline", "objectKey": "my-pipeline/test-api-2/TdOSFRV" } } @@ -38,7 +38,7 @@ CodePipeline invokes your function asynchronously with an event that contains de "location": { "type": "S3", "s3Location": { - "bucketName": "aws-us-west-2-123456789012-my-pipeline", + "bucketName": "us-west-2-123456789012-my-pipeline", "objectKey": "my-pipeline/invokeOutp/D0YHsJn" } } diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 72666469..c47063e2 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -237,7 +237,7 @@ Run the code in Lambda as a starting point for creating a serverless application Lambda project successfully packaged: ec2spot.zip Uploading to ebd38e401cedd7d676d05d22b76f0209 1305107 / 1305107.0 (100.00%) Successfully packaged artifacts and wrote output template to file out.yaml. - Execute the following command to deploy the packaged template + Run the following command to deploy the packaged template aws cloudformation deploy --template-file out.yaml --stack-name Waiting for changeset to be created.. diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 07ccbebf..af4eab38 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -118,7 +118,7 @@ You can find the subnet IDs and the default security group ID of your VPC from t ## Test the Lambda function -In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function executes, it generates a UUID and writes it to the ElastiCache cluster that you specified in your Lambda code\. The Lambda function then retrieves the item from the cache\. +In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it generates a UUID and writes it to the ElastiCache cluster that you specified in your Lambda code\. The Lambda function then retrieves the item from the cache\. 1. Invoke the Lambda function with the `invoke` command\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index e13ec335..37f7c108 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -148,7 +148,7 @@ $ aws lambda create-function --function-name CreateTableAddRecordsAndRead --run ### Test the Lambda function -In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function executes, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. +In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. 1. Invoke the Lambda function with the `invoke` command\. diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 6c4dda1a..848b668a 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -6,7 +6,7 @@ To run a batch operation, you create an Amazon S3 [batch operations job](https:/ When the batch job starts, Amazon S3 invokes the Lambda function [synchronously](invocation-sync.md) for each object in the manifest\. The event parameter includes the names of the bucket and the object\. -The following example shows the event that Amazon S3 sends to the Lambda function for an object that is named **customerImage1\.jpg** in the **awsexamplebucket** bucket\. +The following example shows the event that Amazon S3 sends to the Lambda function for an object that is named **customerImage1\.jpg** in the **examplebucket** bucket\. **Example Amazon S3 batch request event** @@ -22,7 +22,7 @@ The following example shows the event that Amazon S3 sends to the Lambda functio "taskId": "dGFza2lkZ29lc2hlcmUK", "s3Key": "customerImage1.jpg", "s3VersionId": "1", - "s3BucketArn": "arn:aws:s3:us-east-1:0123456788:awsexamplebucket" + "s3BucketArn": "arn:aws:s3:us-east-1:0123456788:examplebucket" } ] } @@ -55,11 +55,11 @@ Note that you can't reuse an existing Amazon S3 event\-based function for batch In the [resource\-based policy](access-control-resource-based.md) that you create for the Amazon S3 batch job, ensure that you set permission for the job to invoke your Lambda function\. -In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it executes your function\. +In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. -When the job executes, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. +When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. If the Lambda function returns a `TemporaryFailure` response code, Amazon S3 retries the operation\. diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md index f5424229..c40dbb4b 100644 --- a/doc_source/stepfunctions-lc.md +++ b/doc_source/stepfunctions-lc.md @@ -14,7 +14,7 @@ The Lambda console displays a list of your state machines in the current AWS Reg Choose a state machine to view a graphical representation of the workflow\. Steps highlighted in blue represent Lambda functions\. Use the graph controls to zoom in, zoom out, and center the graph\. **Note** -When a Lambda function is [dynamically referenced with JsonPath](https://docs.aws.amazon.com/step-functions/latest/dg/connect-parameters.html#connect-parameters-path) in the state machine definition, the function details cannot be shown in the Lambda console\. Instead, the function name is listed as a **Dynamic reference**, and the corresponding steps in the graph are grayed out\. +When a Lambda function is [dynamically referenced with JsonPath](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html) in the state machine definition, the function details cannot be shown in the Lambda console\. Instead, the function name is listed as a **Dynamic reference**, and the corresponding steps in the graph are grayed out\. **To view state machine details** diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 973135dc..5c3bd3b2 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -52,7 +52,7 @@ The name of the file or class in your function's handler configuration doesn't m **Error:** *Unable to find method 'handleRequest' in type 'Function\.Handler' from assembly 'Function'* -The name of the handler method in your function's handler configuration doesn't match your code\. Each runtime defines a naming convention for handlers, such as *filename*\.*methodname*\. The handler is the method in your function's code that the runtime executes when your function is invoked\. +The name of the handler method in your function's handler configuration doesn't match your code\. Each runtime defines a naming convention for handlers, such as *filename*\.*methodname*\. The handler is the method in your function's code that the runtime runs when your function is invoked\. For some languages, Lambda provides a library with an interface that expects a handler method to have a specific name\. For details about handler naming for each language, see the following topics\. + [Building Lambda functions with Node\.js](lambda-nodejs.md) diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 4c7a7053..e867f0a9 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -1,6 +1,6 @@ # Troubleshoot execution issues in AWS Lambda -When the Lambda runtime executes your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. +When the Lambda runtime runs your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. Function execution errors can be caused by issues with your code, function configuration, downstream resources, or permissions\. If you invoke your function directly, you see function errors in the response from Lambda\. If you invoke your function asynchronously, with an event source mapping, or through another service, you might find errors in logs, a dead\-letter queue, or an on\-failure destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md new file mode 100644 index 00000000..e468d261 --- /dev/null +++ b/doc_source/using-extensions.md @@ -0,0 +1,75 @@ +# Using AWS Lambda extensions + +You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools provided by [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/), or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. + +Lambda supports internal and external extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, they can be written in a different language than the function\. + +An internal extension runs as part of the runtime process\. Your function accesses internal extensions by using wrapper scripts or in\-process mechanisms such as `JAVA_TOOL_OPTIONS`\. For more information, see [Modifying the runtime environment](runtimes-modify.md)\. + +You can add extensions to a function using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. + +The following [Lambda runtimes](lambda-runtimes.md) support external extensions: ++ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) ++ Custom runtime \(`provided`\) ++ Custom runtime on Amazon Linux 2 \(`provided.al2`\) ++ Java 11 \(Corretto\) \(`java11`\) ++ Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 12\.x \(`nodejs12.x`\) ++ Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.8 \(`python3.8`\) ++ Python 3\.7 \(`python3.7`\) ++ Ruby 2\.7 \(`ruby2.7`\) ++ Ruby 2\.5 \(`ruby2.5`\) + +You are charged for the execution time consumed by the extension \(in 100 ms increments\)\. For more information on pricing for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information about partner extensions, see those partners' websites\. There is no cost to install your own extensions\. + +## Execution environment + +Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and extensions\. + +The lifecycle of the execution environment includes the following phases: ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. ++ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. + +During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and start all extensions in parallel\. + +## Impact on performance and resources + +The size of your function's extensions counts towards the deployment package size limit\. The total unzipped size of the function and all extensions cannot exceed the unzipped deployment package size limit of 250 MB\. + +Extensions can impact the performance of your function because they share function resources such as CPU, memory, and storage\. For example, if an extension performs compute\-intensive operations, you may see your function’s execution duration increase\. + +Each extension must complete its initialization before Lambda invokes the function\. Therefore, an extension that consumes significant initialization time can increase the latency of the function invocation\. + +To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExecutionDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. + +## Permissions + +Extensions have access to the same resources as functions\. Because extensions are executed within the same environment as the function, permissions are shared between the function and the extension\. + +You can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. + +## Configuring extensions + +To use an external extension, you add the extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. + +You add the extension to your function using the same method as you would for any layer\. For more information, see [Configuring a function to use layers](configuration-layers.md#configuration-layers-using)\. + +**Add an extension to your function \(console\)** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. + +1. Choose a function\. + +1. Under **Designer**, choose **Layers**\. + +1. Under **Layers**, choose **Add a layer**\. + +1. For **Choose a layer**, choose **Specify an ARN**\. + +1. For **Specify an ARN**, enter the Amazon Resource Name \(ARN\) of an extension layer\. + +1. Choose **Add**\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index c6c2ce8a..bbf7a401 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -1,6 +1,6 @@ # What is AWS Lambda? - AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time you consume \- there is no charge when your code is not running\. With AWS Lambda, you can run code for virtually any type of application or backend service \- all with zero administration\. AWS Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that AWS Lambda supports](lambda-runtimes.md)\. + AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. AWS Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time you consume \- there is no charge when your code is not running\. With AWS Lambda, you can run code for virtually any type of application or backend service \- all with zero administration\. AWS Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that AWS Lambda supports](lambda-runtimes.md)\. You can use AWS Lambda to run your code in response to events, such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to easily build data processing triggers for AWS services like Amazon S3 and Amazon DynamoDB, process streaming data stored in Kinesis, or create your own back end that operates at AWS scale, performance, and security\. @@ -8,7 +8,7 @@ You can also build serverless applications composed of functions that are trigge ## When should I use AWS Lambda? -AWS Lambda is an ideal compute platform for many application scenarios, provided that you can write your application code in languages supported by AWS Lambda, and run within the AWS Lambda standard runtime environment and resources provided by Lambda\. +AWS Lambda is an ideal compute service for many application scenarios, provided that you can write your application code in languages supported by AWS Lambda, and run within the AWS Lambda standard runtime environment and resources provided by Lambda\. When using AWS Lambda, you are responsible only for your code\. AWS Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources\. This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes\. These constraints enable AWS Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 360ccbad..1469218f 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -87,7 +87,7 @@ Invoke the function manually using the sample event data\. { "firstName": "first-name", "lastName": "last-name" } ``` -1. Execute the following `invoke` command: +1. Run the following `invoke` command: ``` $ aws lambda invoke --function-name AndroidBackendLambdaFunction \ @@ -96,7 +96,7 @@ Invoke the function manually using the sample event data\. ## Create an Amazon Cognito identity pool -In this section, you create an Amazon Cognito identity pool\. The identity pool has two IAM roles\. You update the IAM role for unauthenticated users and grant permissions to execute the `AndroidBackendLambdaFunction` Lambda function\. +In this section, you create an Amazon Cognito identity pool\. The identity pool has two IAM roles\. You update the IAM role for unauthenticated users and grant permissions to run the `AndroidBackendLambdaFunction` Lambda function\. For more information about IAM roles, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *IAM User Guide*\. For more information about Amazon Cognito services, see the [Amazon Cognito](https://aws.amazon.com/cognito/) product detail page\. diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 069f65b6..c2f9c6ef 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -174,7 +174,7 @@ In this step, you invoke your Lambda function manually using the `invoke` AWS La } ``` -Execute the following `invoke` command\. +Run the following `invoke` command\. ``` $ aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt @@ -218,7 +218,7 @@ Write down the stream ARN\. You need this in the next step when you associate th Create an event source mapping in AWS Lambda\. This event source mapping associates the DynamoDB stream with your Lambda function\. After you create this event source mapping, AWS Lambda starts polling the stream\. -Run the following AWS CLI `create-event-source-mapping` command\. After the command executes, note down the UUID\. You'll need this UUID to refer to the event source mapping in any commands, for example, when deleting the event source mapping\. +Run the following AWS CLI `create-event-source-mapping` command\. After the command runs, note down the UUID\. You'll need this UUID to refer to the event source mapping in any commands, for example, when deleting the event source mapping\. ``` $ aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ @@ -243,13 +243,13 @@ $ aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords ## Test the setup -Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes event records to the stream\. As AWS Lambda polls the stream, it detects new records in the stream and executes your Lambda function on your behalf by passing events to the function\. +Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes event records to the stream\. As AWS Lambda polls the stream, it detects new records in the stream and invokes your Lambda function on your behalf by passing events to the function\. 1. In the DynamoDB console, add, update, and delete items to the table\. DynamoDB writes records of these actions to the stream\. 1. AWS Lambda polls the stream and when it detects updates to the stream, it invokes your Lambda function by passing in the event data it finds in the stream\. -1. Your function executes and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. +1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. ## Clean up your resources diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index bef0450e..05b9dddc 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -8,7 +8,7 @@ In this tutorial, you create a Lambda function to consume events from a Kinesis 1. AWS Lambda polls the stream and, when it detects new records in the stream, invokes your Lambda function\. -1. AWS Lambda executes the Lambda function by assuming the execution role you specified at the time you created the Lambda function\. +1. AWS Lambda runs the Lambda function by assuming the execution role you specified at the time you created the Lambda function\. ## Prerequisites diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index b191c637..9cf9c959 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -271,7 +271,7 @@ public class Handler implements } ``` -Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda executes the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. +Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda runs the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. **Dependencies** + `aws-lambda-java-core` diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index b10189f0..2f1e8f0a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -204,6 +204,12 @@ The deployment package is a \.zip file containing your Lambda function code and --role arn:aws:iam::123456789012:role/lambda-s3-role ``` +If you are using AWS CLI version 2, add the following command parameters: + +``` +--cli-binary-format raw-in-base64-out +``` + For the role parameter, replace the number sequence with your AWS account ID\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects you upload, you might need to increase the timeout value using the following AWS CLI command\. ``` diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index be8400dc..544463a5 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -3,7 +3,7 @@ You can use Lambda to process [event notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) from Amazon Simple Storage Service\. Amazon S3 can send an event to a Lambda function when an object is created or deleted\. You configure notification settings on a bucket, and grant Amazon S3 permission to invoke a function on the function's resource\-based permissions policy\. **Warning** -If your Lambda function uses the same bucket that triggers it, it could cause the function to execute in a loop\. For example, if the bucket triggers a function each time an object is uploaded, and the function uploads an object to the bucket, then the function indirectly triggers itself\. To avoid this, use two buckets, or configure the trigger to only apply to a prefix used for incoming objects\. +If your Lambda function uses the same bucket that triggers it, it could cause the function to run in a loop\. For example, if the bucket triggers a function each time an object is uploaded, and the function uploads an object to the bucket, then the function indirectly triggers itself\. To avoid this, use two buckets, or configure the trigger to only apply to a prefix used for incoming objects\. Amazon S3 invokes your function [asynchronously](invocation-async.md) with an event that contains details about the object\. The following example shows an event that Amazon S3 sent when a deployment package was uploaded to Amazon S3\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 68e79f94..0b5c00ad 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -102,7 +102,7 @@ If the handler returns normally without exceptions, Lambda considers the message } ``` -1. Execute the following `invoke` command\. +1. Run the following `invoke` command\. ``` $ aws lambda invoke --function-name ProcessSQSRecord \ @@ -125,11 +125,11 @@ Create an Amazon SQS queue that the Lambda function can use as an event source\. Create an event source mapping in AWS Lambda\. This event source mapping associates the Amazon SQS queue with your Lambda function\. After you create this event source mapping, AWS Lambda starts polling the queue\. -Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Queue Service writes messages to the queue\. AWS Lambda polls the queue, detects new records and executes your Lambda function on your behalf by passing events, in this case Amazon SQS messages, to the function\. +Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Queue Service writes messages to the queue\. AWS Lambda polls the queue, detects new records and invokes your Lambda function on your behalf by passing events, in this case Amazon SQS messages, to the function\. ## Configure the event source -To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command executes, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. +To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command runs, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. ``` $ aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ @@ -153,4 +153,4 @@ Now you can test the setup as follows: 1. AWS Lambda polls the queue and when it detects updates, it invokes your Lambda function by passing in the event data it finds in the queue\. -1. Your function executes and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. \ No newline at end of file +1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index a6d72b14..5b27aa7f 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -2,7 +2,7 @@ You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/fifo-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. -Lambda polls the queue and invokes your function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. +Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. **Example Amazon SQS message event \(standard queue\)** @@ -85,7 +85,7 @@ For FIFO queues, Lambda sends messages to your function in the order that it rec Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](https://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. -## Configuring a queue for use with Lambda +## Configuring a queue to use with Lambda [Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. From a56a2b3a14524876bbdbbccf69f92707172b2629 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 9 Oct 2020 09:09:41 -0700 Subject: [PATCH 036/243] minor update from pull request --- doc_source/with-s3-example.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index e7c9a23f..2f1e8f0a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -216,8 +216,6 @@ For the role parameter, replace the number sequence with your AWS account ID\. T $ aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 ``` -If using version 2 of the AWS CLI, the command also needs '--cli-binary-format raw-in-base64-out' - ## Test the Lambda function In this step, you invoke the Lambda function manually using sample Amazon S3 event data\. @@ -368,4 +366,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. +1. Choose **Confirm**\. \ No newline at end of file From 2029de002889f17ea8c4c7a255d250c99f98ab89 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Mon, 12 Oct 2020 18:53:43 +0000 Subject: [PATCH 037/243] Periodic update --- doc_source/access-control-resource-based.md | 2 +- doc_source/code-editor.md | 2 +- doc_source/configuration-aliases.md | 4 +- doc_source/configuration-concurrency.md | 4 +- doc_source/configuration-database.md | 2 +- doc_source/configuration-envvars.md | 6 +- doc_source/configuration-filesystem.md | 2 +- doc_source/configuration-tags.md | 4 +- doc_source/configuration-versions.md | 2 +- doc_source/configuration-vpc.md | 4 +- doc_source/csharp-tracing.md | 2 +- doc_source/getting-started-create-function.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/index.md | 1 + doc_source/invocation-async.md | 6 +- doc_source/java-exceptions.md | 2 +- doc_source/java-package.md | 2 +- doc_source/java-tracing.md | 2 +- doc_source/lambda-intro-execution-role.md | 33 ++-- doc_source/lambda-monitoring.md | 11 +- doc_source/monitoring-cloudwatchlogs.md | 2 +- .../monitoring-functions-access-metrics.md | 2 +- doc_source/monitoring-insights.md | 166 ++++++++++++++++++ doc_source/nodejs-tracing.md | 2 +- doc_source/python-package.md | 2 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-tracing.md | 2 +- doc_source/runtimes-extensions-api.md | 5 +- doc_source/services-apigateway.md | 2 +- .../services-cloudwatchevents-tutorial.md | 4 +- doc_source/services-cloudwatchevents.md | 2 +- doc_source/services-xray.md | 2 +- doc_source/using-extensions.md | 11 +- doc_source/welcome.md | 2 +- doc_source/with-ddb.md | 4 +- doc_source/with-kinesis.md | 4 +- doc_source/with-msk.md | 4 +- doc_source/with-sqs.md | 2 +- 38 files changed, 247 insertions(+), 68 deletions(-) create mode 100644 doc_source/monitoring-insights.md diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 53de338b..4fdcc7fd 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -6,7 +6,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc **To view a function's resource\-based policy** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index c3d782d9..6812db13 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -1,6 +1,6 @@ # Creating functions using the AWS Lambda console editor -The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. +The Lambda console provides a code editor for languages that do not require compiling, such as Node\.js or Python\. The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. The code editor includes the *menu bar*, *windows*, and the *editor pane*\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 05deef15..1faaea79 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -4,7 +4,7 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is **To create an alias** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the name of a function\. @@ -85,7 +85,7 @@ You can point an alias to a maximum of two Lambda function versions\. The versio **To configure routing on an alias** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the name of a function\. diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 07c3e74b..50a16513 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -23,7 +23,7 @@ To manage reserved concurrency settings for a function, use the Lambda console\. **To reserve concurrency for a function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -57,7 +57,7 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd **To reserve concurrency for an alias** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index f578c9e7..e4680547 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -4,7 +4,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for **To create a database proxy** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index a7098f68..35069949 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -9,7 +9,7 @@ You set environment variables on the unpublished version of your function by spe **To set environment variables in the Lambda console** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -141,7 +141,7 @@ When you provide the key, only users in your account with access to the key can **To use a customer managed CMK** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -192,7 +192,7 @@ You can also encrypt environment variable values on the client side before sendi **To encrypt environment variables on the client side** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 3b3594f0..c67febba 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -9,7 +9,7 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu **To configure file system access** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 3e17fd19..ce25badd 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -4,7 +4,7 @@ You can tag Lambda functions to organize them by owner, project or department\. **To add tags to a function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -19,7 +19,7 @@ You can filter functions based on the presence or value of a tag with the Lambda **To filter functions with tags** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Click within the search bar to see a list of function attributes and tag keys\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index edc943a1..f7b7528a 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -12,7 +12,7 @@ You can change the function code and settings only on the unpublished version of **To create a new version of a function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the name of the function that you want to publish\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index b6f7ba96..8cb42d7e 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -45,7 +45,7 @@ If your [IAM permissions](#vpc-conditions) allow you only to create Lambda funct **To configure a VPC when you create a function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -63,7 +63,7 @@ To access private resources, connect your function to private subnets\. If your **To configure a VPC for an existing function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index ba18fbec..a2e67e9a 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 175d19ff..f482769b 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -66,7 +66,7 @@ If you are done working with the example function, delete it\. You can also dele **To delete a Lambda function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index b4ef16c6..165be7a6 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/index.md b/doc_source/index.md index fe11d4b9..3f03d0bd 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -184,6 +184,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in PowerShell](powershell-exceptions.md) + [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Security in AWS Lambda](lambda-security.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index bdc486f6..c2bd2007 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -51,7 +51,7 @@ Use the Lambda console to configure error handling settings on a function, a ver **To configure error handling** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -83,7 +83,7 @@ Add destinations to your function in the Lambda console's function designer\. **To configure a destination for asynchronous invocation records** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -202,7 +202,7 @@ After creating the target and updating your function's execution role, add the d **To configure a dead\-letter queue** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index f7b5b503..a6509e90 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -72,7 +72,7 @@ To view error output in the Lambda console, invoke it with a test event\. **To invoke a function in the Lambda console** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 4cc70fd3..6f885c67 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -54,7 +54,7 @@ You can upload your deployment package by using the Lambda console, the Lambda A **To upload a deployment package with the Lambda console** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 03974c31..3ffb7d5a 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index b4ea5497..2bc02c54 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -1,19 +1,19 @@ # AWS Lambda execution role -An AWS Lambda function's execution role grants it permission to access AWS services and resources\. You provide this role when you create a function, and Lambda assumes the role when your function is invoked\. You can create an execution role for development that has permission to send logs to Amazon CloudWatch and upload trace data to AWS X\-Ray\. +A Lambda function's execution role is an AWS Identity and Access Management \(IAM\) role that grants the function permission to access AWS services and resources\. You provide this role when you create a function, and Lambda assumes the role when your function is invoked\. You can create an execution role for development that has permission to send logs to Amazon CloudWatch and to upload trace data to AWS X\-Ray\. **To view a function's execution role** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. 1. Choose **Permissions**\. -1. The resource summary shows the services and resources that the function has access to\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. +1. Under **Resource summary**, view the services and resources that the function can access\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-executionrole.png) -1. Choose a service from the drop\-down menu to see permissions related to that service\. +1. Choose a service from the dropdown list to see permissions related to that service\. You can add or remove permissions from a function's execution role at any time, or configure your function to use a different role\. Add permissions for any services that your function calls with the AWS SDK, and for services that Lambda uses to enable optional features\. @@ -21,11 +21,11 @@ When you add permissions to your function, make an update to its code or configu ## Creating an execution role in the IAM console -By default, Lambda creates an execution role with minimal permissions when you [create a function](getting-started-create-function.md) in the Lambda console\. You can also create an execution role in the IAM console\. +By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started-create-function.md)\. You can also create an execution role in the IAM console\. **To create an execution role in the IAM console** -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. 1. Choose **Create role**\. @@ -33,7 +33,7 @@ By default, Lambda creates an execution role with minimal permissions when you [ 1. Choose **Next: Permissions**\. -1. Under **Attach permissions policies**, choose the **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess** managed policies\. +1. Under **Attach permissions policies**, choose the AWS managed policies **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess**\. 1. Choose **Next: Tags**\. @@ -43,11 +43,11 @@ By default, Lambda creates an execution role with minimal permissions when you [ 1. Choose **Create role**\. -For detailed instructions, see [Creating a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the IAM User Guide\. +For detailed instructions, see [Creating a role for an AWS service \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the *IAM User Guide*\. ## Managing roles with the IAM API -An execution role is an IAM role that Lambda has permission to assume when you invoke a function\. To create an execution role with the AWS CLI, use the `create-role` command\. +To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. ``` $ aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json @@ -105,20 +105,21 @@ To add permissions to the role, use the `attach-policy-to-role` command\. Start $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` -## Managed policies for Lambda features +## AWS managed policies for Lambda features -The following managed policies provide permissions that are required to use Lambda features: +The following AWS managed policies provide permissions that are required to use Lambda features: + **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. + **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. + **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. -+ **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon MSK cluster\. ++ **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster\. + **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. -+ **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a VPC\. ++ **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. + **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. ++ **CloudWatchLambdaInsightsExecutionRolePolicy** – Permission to write runtime metrics to CloudWatch Lambda Insights\. -For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. Add the relevant managed policies to your execution role before enabling features to avoid creating extra policies\. +For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. -When you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function, Lambda uses the execution role to read event data\. For example, an event source mapping for Amazon Kinesis reads events from a data stream and sends them to your function in batches\. You can use event source mappings with the following services: +When you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function, Lambda uses the execution role to read event data\. For example, an event source mapping for Kinesis reads events from a data stream and sends them to your function in batches\. You can use event source mappings with the following services: **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) @@ -126,4 +127,4 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) -In addition to the managed policies, the Lambda console provides templates for creating a custom policy that has the permissions related to additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index b5c677af..a55b3cb8 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,27 +1,28 @@ # Monitoring and troubleshooting Lambda applications -AWS Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code while it is running, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. It also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. **To monitor a function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. 1. Choose **Monitoring**\. **Pricing** -CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For details, see [CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/)\. +CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. -Each time your function is invoked, Lambda records [metrics](monitoring-metrics.md) for the request, the function's response, and the overall state of the function\. You can use metrics to set alarms the are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current Region\. +Each time your function is invoked, Lambda records [metrics](monitoring-metrics.md) for the request, the function's response, and the overall state of the function\. You can use metrics to set alarms that are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current AWS Region\. To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. You can [view logs](monitoring-cloudwatchlogs.md) in the CloudWatch Logs console, in the Lambda console, or from the command line\. -In addition to monitoring logs and metrics in CloudWatch, you can use AWS X\-Ray to trace and debug requests served by your application\. For details, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. +In addition to monitoring logs and metrics in CloudWatch, you can use AWS X\-Ray to trace and debug requests served by your application\. For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. **Topics** + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) ++ [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) \ No newline at end of file diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 9660a4f7..9bf9d8e7 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -11,7 +11,7 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc **To view logs using the Lambda console** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 126b5a54..989d4b83 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -4,7 +4,7 @@ AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWa **To access the monitoring console** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Monitoring**\. ![\[Graphs of various CloudWatch metrics.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md new file mode 100644 index 00000000..1b4d6a41 --- /dev/null +++ b/doc_source/monitoring-insights.md @@ -0,0 +1,166 @@ +# Using Lambda Insights in Amazon CloudWatch + +Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. + +**Public preview** +Lambda Insights is in public preview\. The preview is open to all AWS accounts, and you do not need to request access\. Features may be added or changed before general availability\. + +**Topics** ++ [How Lambda Insights monitors serverless applications](#monitoring-insights-how) ++ [Pricing](#monitoring-insights-pricing) ++ [Supported runtimes](#monitoring-insights-runtimes) ++ [Region availability](#monitoring-insights-regions) ++ [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling) ++ [Using the Lambda Insights dashboard](#monitoring-insights-multifunction) ++ [Example workflow to detect function anomalies](#monitoring-insights-anomalies) ++ [Example workflow using queries to troubleshoot a function](#monitoring-insights-queries) + +## How Lambda Insights monitors serverless applications + +CloudWatch Lambda Insights is a monitoring and troubleshooting solution for serverless applications running on AWS Lambda\. The solution collects, aggregates, and summarizes system\-level metrics including CPU time, memory, disk and network usage\. It also collects, aggregates, and summarizes diagnostic information such as cold starts and Lambda worker shutdowns to help you isolate issues with your Lambda functions and resolve them quickly\. + +Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html)\. + +The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for the `/aws/lambda-insights/` log group\. + +## Pricing + +For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. + +## Supported runtimes + +You can use Lambda Insights with any of the following [Lambda function runtimes](lambda-runtimes.md): ++ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) ++ Custom runtime \(`provided`\) ++ Custom runtime on Amazon Linux 2 \(`provided.al2`\) ++ Java 11 \(Corretto\) \(`java11`\) ++ Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 12\.x \(`nodejs12.x`\) ++ Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.8 \(`python3.8`\) ++ Python 3\.7 \(`python3.7`\) ++ Ruby 2\.7 \(`ruby2.7`\) ++ Ruby 2\.5 \(`ruby2.5`\) + +## Region availability + +For this preview release, Lambda Insights is currently available in the following AWS Regions: ++ US East \(N\. Virginia\) ++ US East \(Ohio\) ++ US West \(N\. California\) ++ US West \(Oregon\) ++ Asia Pacific \(Mumbai\) ++ Asia Pacific \(Seoul\) ++ Asia Pacific \(Singapore\) ++ Asia Pacific \(Sydney\) ++ Asia Pacific \(Tokyo\) ++ Canada \(Central\) ++ Europe \(Frankfurt\) ++ Europe \(Ireland\) ++ Europe \(London\) ++ Europe \(Paris\) ++ Europe \(Stockholm\) ++ South America \(São Paulo\) + +## Enabling Lambda Insights in the Lambda console + +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you turn on Lambda Insights in the Lambda console, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to add the required permissions to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. + +**Note** +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\) or the AWS Cloud Development Kit \(AWS CDK\)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. + +**To enable Lambda Insights in the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose your function\. + +1. Choose the **Version configuration** tab\. + +1. On the **Monitoring tools** pane, choose **Edit**\. + +1. Under **Lambda Insights**, turn on **Enhanced monitoring**\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-enable.png) + +1. Choose **Save**\. + +## Using the Lambda Insights dashboard + +The Lambda Insights dashboard has two views: the multi\-function overview and the single\-function view\. The multi\-function overview aggregates the runtime metrics for the Lambda functions in the current AWS account and Region\. The single\-function view shows the available runtime metrics for a single Lambda function\. + +**To view the runtime metrics for all functions** + +You can use the Lambda Insights dashboard multi\-function overview to identify over\- and under\-utilized Lambda functions\. + +1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. \(Optional\) Choose **Add to dashboard** to add the widgets to your CloudWatch dashboard\. +![\[The multi-function overview on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-multifunction-view.png) + +**To view the runtime metrics of a single function** + +You can use the Lambda Insights dashboard single\-function view to troubleshoot individual requests\. + +1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) in the CloudWatch console\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. \(Optional\) Choose **Add to dashboard** to add the widgets to your CloudWatch dashboard\. +![\[The single-function view on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambainsights-singlefunction-view.png) + +For more information, see [Creating and working with widgets on CloudWatch dashboards](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-and-work-with-widgets.html)\. + +## Example workflow to detect function anomalies + +You can use the multi\-function overview on the Lambda Insights dashboard to identify and detect compute memory anomalies with your function\. For example, if the multi\-function overview indicates that a function is using a large amount of memory, you can view detailed memory utilization metrics in the **Memory Usage** pane\. You can then go to the Metrics dashboard to enable anomaly detection or create an alarm\. + +**To enable anomaly detection for a function** + +1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. + +1. Under **Function summary**, choose your function's name\. + + The single\-function view opens with the function runtime metrics\. +![\[The function summary pane on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-function-summary.png) + +1. On the **Memory Usage** pane, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard\. +![\[The menu on the Memory Usage pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-memory-usage.png) + +1. On the **Graphed metrics** tab, in the **Actions** column, choose the first icon to enable anomaly detection for the function\. +![\[The Graphed metrics tab of the Memory Usage pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-graphed-metrics.png) + +For more information, see [Using CloudWatch Anomaly Detection](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html)\. + +## Example workflow using queries to troubleshoot a function + +You can use the single\-function view on the Lambda Insights dashboard to identify the root cause of a spike in function duration\. For example, if the multi\-function overview indicates a large increase in function duration, you can pause on or choose each function in the **Duration** pane to determine which function is causing the increase\. You can then go to the single\-function view and review the **Application logs** to determine the root cause\. + +**To run queries on a function** + +1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. + +1. In the **Duration** pane, choose your function to filter the duration metrics\. +![\[A function chosen in the Duration pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-choose-function.png) + +1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions)\. + +1. Choose the **Filter metrics by function name** dropdown list, and then choose your function\. + +1. To view the **Most recent 1000 application logs**, choose the **Application logs** tab\. + +1. Review the **Timestamp** and **Message** to identify the invocation request that you want to troubleshoot\. +![\[The Most recent 1000 application logs.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-application-logs.png) + +1. To show the **Most recent 1000 invocations**, choose the **Invocations** tab\. + +1. Select the **Timestamp** or **Message** for the invocation request that you want to troubleshoot\. +![\[Selecting a recent invocation request.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-invocations-function-select.png) + +1. Choose the **View logs** dropdown list, and then choose **View performance logs**\. + + An autogenerated query for your function opens in the **Logs Insights** dashboard\. + +1. Choose **Run query** to generate a **Logs** message for the invocation request\. +![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index fb82cafb..335da619 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 0eb25b48..86efee75 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -64,7 +64,7 @@ To create or update a function with the Lambda API, create an archive that conta If your function depends on libraries other than the SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. **Note** -For libraries that use extension modules written in C or C\+\+, build your deployment package in an Amazon Linux environment\. You can use the [SAM CLI build command](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html), which uses Docker, or build your deployment package on Amazon EC2 or AWS CodeBuild\. +For libraries that use extension modules written in C or C\+\+, build your deployment package in an Amazon Linux environment\. You can use the [SAM CLI build command](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html), which uses Docker, or build your deployment package on Amazon EC2 or CodeBuild\. The following example shows how to create a deployment package that includes a common graphics library named Pillow\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index bbe707bb..fd8e58c3 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 8583a421..49ef4779 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index b921315f..1385a429 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -29,6 +29,9 @@ You share your extension as a [Lambda layer](configuration-layers.md) to make it You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. +**Note** +Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. + ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: @@ -111,7 +114,7 @@ When Lambda is about to terminate the runtime, it sends a `Shutdown` event to th + 500 ms – a function with a registered internal extension\. + 2000 ms – a function with one or more registered external extensions\. -For a function with external extensions, Lambda reserves up to 300 or 500 ms \(for a runtime without/with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2000 ms limit for external extensions to shut down\. +For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2000 ms limit for external extensions to shut down\. If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda terminates the process using a `SIGKILL` signal\. diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index a7cc9e75..a912d46e 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -4,7 +4,7 @@ You can create a web API with an HTTP endpoint for your Lambda function by using **To add a public endpoint to your Lambda function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index ce703c68..804a4a2b 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -43,7 +43,7 @@ CloudWatch Events emits an event every minute, based on the schedule expression\ Test the function with a sample event provided by the Lambda console\. -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **lambda\-canary**\. @@ -111,7 +111,7 @@ Update the function configuration to cause the function to return an error, whic **To trigger an alarm** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **lambda\-canary**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 5304429e..2c05d13f 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -52,7 +52,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re **To configure CloudWatch Events to invoke your function** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index aa6d16d5..4eb38a23 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index e468d261..615d3216 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -60,7 +60,7 @@ You add the extension to your function using the same method as you would for an **Add an extension to your function \(console\)** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -72,4 +72,11 @@ You add the extension to your function using the same method as you would for an 1. For **Specify an ARN**, enter the Amazon Resource Name \(ARN\) of an extension layer\. -1. Choose **Add**\. \ No newline at end of file +1. Choose **Add**\. + +## Next steps + +To learn more about extensions, we recommend the following resources: ++ To walk through a simple working example, see the [ Building Extensions for AWS Lambda](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) blog post\. ++ For information about extensions that are available from AWS Lambda Partners, see the [ Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) blog post\. ++ Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index bbf7a401..432c8801 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -4,7 +4,7 @@ You can use AWS Lambda to run your code in response to events, such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to easily build data processing triggers for AWS services like Amazon S3 and Amazon DynamoDB, process streaming data stored in Kinesis, or create your own back end that operates at AWS scale, performance, and security\. -You can also build serverless applications composed of functions that are triggered by events and automatically deploy them using CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +You can also build serverless applications composed of functions that are triggered by events and automatically deploy them using CodePipeline and CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. ## When should I use AWS Lambda? diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index d7ed4df9..30e5389d 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -111,7 +111,7 @@ To configure your function to read from DynamoDB Streams in the Lambda console, **To create a trigger** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -245,7 +245,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index e0508133..aae2f4a5 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -123,7 +123,7 @@ To configure your function to read from Kinesis in the Lambda console, create a **To create a trigger** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -262,7 +262,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 2b471d74..c22499ec 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -66,7 +66,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) needs th + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) -The AWS managed policy `AWSLambdaMSKExecutionRole` includes these permissions\. For more information, see [Managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. +The AWS managed policy `AWSLambdaMSKExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. ## Configuring a topic as an event source @@ -76,7 +76,7 @@ To configure your function to read from Amazon MSK, create an **MSK** trigger in **To create a trigger** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 5b27aa7f..d8ba94ed 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -115,7 +115,7 @@ To configure your function to read from Amazon SQS in the Lambda console, create **To create a trigger** -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions)\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. From cb769974339cd46b7264301ab4dbf45cdb7c51df Mon Sep 17 00:00:00 2001 From: William Armiros <54150514+willarmiros@users.noreply.github.com> Date: Tue, 20 Oct 2020 09:22:16 -0600 Subject: [PATCH 038/243] include configuration section --- doc_source/nodejs-tracing.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 335da619..f83d3794 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -29,6 +29,19 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) +**Configuration** + +The Lambda runtime sets some environment variables to configure the X-Ray SDK, including `AWS_XRAY_CONTEXT_MISSING`. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically. For more information, see [Runtime Environment Variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime). + +**Example initialization code** + +``` +const AWSXRay = require('aws-xray-sdk-core'); + +// Configure the context missing strategy to do nothing +AWSXRay.setContextMissingStrategy(() => {}); +``` + You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. **Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** @@ -159,4 +172,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. From 96e0cec42f4c485bccbb9989fe1c0c7f61d1669f Mon Sep 17 00:00:00 2001 From: Sourabh Agrawal Date: Tue, 20 Oct 2020 23:14:49 +0530 Subject: [PATCH 039/243] Reword incorrect flag/option account-id Apart from removing trailing whiltespaces at some places, the purpose of this pr is to reword a flag/option in the documentation which says following in context of invoking lambda function from s3 bucket: ```Use the `account-id` option to ensure that only resources in your account can invoke the function.``` **aws lambda cli** doesn't provide any such flag called `account-id`, which is misleading. I have updated the documenation with the correct flag `source-account`. --- doc_source/access-control-resource-based.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 4fdcc7fd..c174e5cc 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -50,7 +50,7 @@ $ aws lambda add-permission --function-name my-function --action lambda:InvokeFu --principal sns.amazonaws.com --source-arn arn:aws:sns:us-east-2:123456789012:my-topic ``` -Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `account-id` option to ensure that only resources in your account can invoke the function\. +Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option and specify `account-id` to ensure that only resources in your account can invoke the function\. ``` $ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ @@ -87,7 +87,7 @@ You can grant cross\-account access for most API actions that [operate on an exi **Cross\-account APIs** -Currently, Lambda doesn’t currently support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: +Currently, Lambda doesn’t currently support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: + [Invoke](API_Invoke.md) + [GetFunction](API_GetFunction.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) @@ -126,7 +126,7 @@ To grant permission to all accounts in an organization, use the `organization-id ``` $ aws lambda add-layer-version-permission --layer-name my-layer \ --statement-id engineering-org --version-number 3 --principal '*' \ ---action lambda:GetLayerVersion --organization-id o-t194hfs8cz --output text +--action lambda:GetLayerVersion --organization-id o-t194hfs8cz --output text b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" ``` @@ -160,4 +160,4 @@ $ aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 - b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" $ aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` \ No newline at end of file +``` From 0168ba0ea389592df2e41f9666850c4fa79ac6f1 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 23 Oct 2020 18:41:21 -0700 Subject: [PATCH 040/243] Periodic update. Also added Interface VPC endpoints for Lambda --- doc_source/access-control-resource-based.md | 32 ++++++- doc_source/best-practices.md | 8 +- doc_source/configuration-console.md | 2 +- doc_source/configuration-envvars.md | 7 ++ doc_source/configuration-vpc-endpoints.md | 94 +++++++++++++++++++ doc_source/configuration-vpc.md | 2 +- doc_source/csharp-package-toolkit.md | 2 +- doc_source/csharp-tracing.md | 2 +- doc_source/getting-started-create-function.md | 12 +-- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-limits.md | 5 +- doc_source/index.md | 1 + doc_source/invocation-sync.md | 2 +- doc_source/lambda-functions.md | 1 + doc_source/lambda-monitoring.md | 2 +- doc_source/monitoring-insights.md | 38 ++++---- doc_source/nodejs-tracing.md | 6 +- doc_source/python-handler.md | 26 +++-- doc_source/runtimes-extensions-api.md | 30 ++++-- doc_source/runtimes-modify.md | 2 +- .../services-cloudwatchevents-expressions.md | 2 +- .../services-cloudwatchevents-tutorial.md | 46 ++++++++- doc_source/services-elasticache-tutorial.md | 40 +++++++- doc_source/stepfunctions-patterns.md | 10 +- doc_source/with-msk.md | 6 +- 25 files changed, 308 insertions(+), 72 deletions(-) create mode 100644 doc_source/configuration-vpc-endpoints.md diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index c174e5cc..1b0b9cd0 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -13,7 +13,33 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc 1. Choose **Permissions**\. 1. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-resourcebased.png) +**Example Resource\-based policy** + + ``` + { + "Version": "2012-10-17", + "Id": "default", + "Statement": [ + { + "Sid": "lambda-allow-s3-my-function", + "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" + } + } + } + ] + } + ``` For Lambda layers, you can only use a resource\-based policy on a specific layer version, instead of the entire layer\. In addition to policies that grant permission to a single account or multiple accounts, for layers, you can also grant permission to all accounts in an organization\. @@ -50,7 +76,7 @@ $ aws lambda add-permission --function-name my-function --action lambda:InvokeFu --principal sns.amazonaws.com --source-arn arn:aws:sns:us-east-2:123456789012:my-topic ``` -Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option and specify `account-id` to ensure that only resources in your account can invoke the function\. +Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option with your account ID to ensure that only resources in your account can invoke the function\. ``` $ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ @@ -160,4 +186,4 @@ $ aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 - b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" $ aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` +``` \ No newline at end of file diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index f527019c..dcaf2f17 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -24,7 +24,7 @@ The following are recommended best practices for using AWS Lambda: // MyLambdaFunction logic here } ``` -+ **Take advantage of execution context reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. ++ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. @@ -33,7 +33,7 @@ The following are recommended best practices for using AWS Lambda: + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. + **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [AWS Lambda deployment package in Java](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. -+ **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function concurrent execution limit to `0` immediately to throttle all invocations to the function, while you update the code\. ++ **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. ## Function configuration + **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: @@ -47,12 +47,12 @@ The following are recommended best practices for using AWS Lambda: + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. + **Be familiar with [AWS Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. + **Delete Lambda functions that you are no longer using\.** By doing so, the unused functions won't needlessly count against your deployment package size limit\. -+ **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected execution time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. ++ **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected invocation time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. + In the case of **CreateFunction**, AWS Lambda will fail the function creation process\. + In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\. ## Metrics and alarms -+ **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function execution time in order to address any bottlenecks or latencies attributable to your function code\. ++ **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ## Working with streams diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 5833009d..120756da 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -23,7 +23,7 @@ With the function node selected in the designer, you can modify the following se Tags apply to the entire function, including all versions and aliases\. + **Execution role** – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. + **Description** – A description of the function\. -+ **Memory**– The amount of memory available to the function during execution\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. ++ **Memory**– The amount of memory available to the function while it is running\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. Lambda allocates CPU power linearly in proportion to the amount of memory configured\. At 1,792 MB, a function has the equivalent of one full vCPU \(one vCPU\-second of credits per second\)\. + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 35069949..02c34b38 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -55,6 +55,13 @@ import os region = os.environ['AWS_REGION'] ``` +**Note** +In some cases, you may need to use the following format: + +``` +region = os.environ.get('AWS_REGION') +``` + ------ #### [ Ruby ] diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md new file mode 100644 index 00000000..2c15b7c4 --- /dev/null +++ b/doc_source/configuration-vpc-endpoints.md @@ -0,0 +1,94 @@ +# Configuring interface VPC endpoints for Lambda + +If you use Amazon Virtual Private Cloud \(Amazon VPC\) to host your AWS resources, you can establish a connection between your VPC and Lambda\. You can use this connection to invoke your Lambda function without crossing the public internet\. + +To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. + +Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. + +## Considerations for Lambda interface endpoints + +Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. + +You can call any of the Lambda API operations from your VPC\. For example, you can invoke the Lambda function by calling the `Invoke` API from within your VPC\. For the full list of Lambda APIs, see [Actions](https://docs.aws.amazon.com/lambda/latest/dg/API_Operations.html) in the Lambda API reference\. + +### Keep\-alive for persistent connections + +Lambda purges idle connections over time, so you must use a keep\-alive directive to maintain persistent connections\. Attempting to reuse an idle connection when invoking a function results in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) in the *AWS SDK for JavaScript Developer Guide*\. + +### Billing Considerations + +There is no additional cost to access a Lambda function through an interface endpoint\. For more Lambda pricing information, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. + +Standard pricing for AWS PrivateLink applies to interface endpoints for Lambda\. Your AWS account is billed for every hour an interface endpoint is provisioned in each Availability Zone and for data processed through the interface endpoint\. For more interface endpoint pricing information, see [AWS PrivateLink pricing](http://aws.amazon.com/privatelink/pricing/)\. + +### VPC Peering Considerations + +You can connect other VPCs to the VPC with interface endpoints using [VPC peering](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html)\. VPC peering is a networking connection between two VPCs\. You can establish a VPC peering connection between your own two VPCs, or with a VPC in another AWS account\. The VPCs can also be in two different AWS Regions\. + +Traffic between peered VPCs stays on the AWS network and does not traverse the public internet\. Once VPCs are peered, resources like Amazon Elastic Compute Cloud \(Amazon EC2\) instances, Amazon Relational Database Service \(Amazon RDS\) instances, or VPC\-enabled Lambda functions in both VPCs can access the Lambda API through interface endpoints created in the one of the VPCs\. + +## Creating an interface endpoint for Lambda + +You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. + +**To create an interface endpoint for Lambda \(console\)** + +1. Open the [Endpoints page](https://console.aws.amazon.com/vpc/home?#Endpoints) of the Amazon VPC console\. + +1. Choose **Create Endpoint**\. + +1. For **Service category**, verify that **AWS services** is selected\. + +1. For **Service Name**, choose **com\.amazonaws\.*region*\.lambda**\. Verify that the **Type** is **Interface**\. + +1. Choose a VPC and subnets\. + +1. To enable private DNS for the interface endpoint, select the **Enable DNS Name** check box\. + +1. For **Security group**, choose one or more security groups\. + +1. Choose **Create endpoint**\. + +To use the private DNS option, you must set the `enableDnsHostnames` and `enableDnsSupportattributes` of your VPC\. For more information, see [Viewing and updating DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-updating) in the *Amazon VPC User Guide*\. If you enable private DNS for the interface endpoint, you can make API requests to Lambda using its default DNS name for the Region, for example, `lambda.us-east-1.amazonaws.com`\. For more service endpoints, see [Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html) in the *AWS General Reference*\. + +For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. + +For information about creating and configuring an endpoint using AWS CloudFormation, see the [AWS::EC2::VPCEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html) resource in the *AWS CloudFormation User Guide*\. + +**To create an interface endpoint for Lambda \(AWS CLI\)** +Use the `create-vpc-endpoint` command and specify the VPC ID, VPC endpoint type \(interface\), service name, subnets that will use the endpoint, and security groups to associate with the endpoint's network interfaces\. For example: + +``` +aws ec2 create-vpc-endpoint --vpc-id vpc-ec43eb89 --vpc-endpoint-type Interface --service-name \ + com.amazonaws.us-east-1.lambda --subnet-id subnet-abababab --security-group-id sg-1a2b3c4d +``` + +## Creating an interface endpoint policy for Lambda + +To control who can use your interface endpoint and which Lambda functions the user can access, you can attach an endpoint policy to your endpoint\. The policy specifies the following information: ++ The principal that can perform actions\. ++ The actions that the principal can perform\. ++ The resources on which the principal can perform actions\. + +For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. + +**Example: Interface endpoint policy for Lambda actions** +The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. + +``` +{ + "Statement":[ + { + "Principal": "arn:aws:iam::123412341234:user/MyUser", + "Effect":"Allow", + "Action":[ + "lambda:InvokeFunction" + ], + "Resource": [ + "arn:aws:lambda:us-east-2:123456789012:function:my-function” + ] + } + ] +} +``` \ No newline at end of file diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 8cb42d7e..0934bf38 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -1,6 +1,6 @@ # Configuring a Lambda function to access resources in a VPC -You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources during execution\. +You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources while the function is running\. When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\. diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index 265826f8..5895269f 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -39,7 +39,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. In the **Advanced Function Details** window, configure the following options: + **Role Name** \(required\) – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. + **Environment** – Key\-value pairs that Lambda sets in the execution environment\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\. - + **Memory** – The amount of memory available to the function during execution\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. + + **Memory** – The amount of memory available to the function while it is running\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a VPC](configuration-vpc.md)\. + **DLQ** – If your function is invoked asynchronously, [choose a queue or topic](invocation-async.md#dlq) to receive failed invocations\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index a2e67e9a..eb10367e 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -53,7 +53,7 @@ You can instrument your function code to record metadata and trace downstream ca ``` -To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initilization code\. +To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. **Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index f482769b..e4e73fe0 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,6 +1,6 @@ # Create a Lambda function with the console -In this Getting Started exercise you create a Lambda function using the AWS Lambda console\. Next, you manually invoke the Lambda function using sample event data\. AWS Lambda runs the Lambda function and returns results\. You then verify execution results, including the logs that your Lambda function created and various CloudWatch metrics\. +In this Getting Started exercise you create a Lambda function using the AWS Lambda console\. Next, you manually invoke the Lambda function using sample event data\. Lambda runs the Lambda function and returns results\. You then verify the results, including the logs that your Lambda function created and various Amazon CloudWatch metrics\. **To create a Lambda function** @@ -44,14 +44,12 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose **Create** and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. -1. AWS Lambda runs your function on your behalf\. The `handler` in your Lambda function receives and then processes the sample event\. +1. Lambda runs your function on your behalf\. The `handler` in your Lambda function receives and then processes the sample event\. -1. Upon successful execution, view results in the console\. - + The **Execution result** section shows the execution status as **succeeded** and also shows the function execution results, returned by the `return` statement\. +1. Upon successful completion, view results in the console\. + + The **Execution result** section \(below the **Test** button\) shows the execution status as succeeded\. Choose **Details** to view the function execution results\. Note that the **logs** link opens the Log groups page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log AWS Lambda generates for each execution\. These are the logs written to CloudWatch by the Lambda function\. The AWS Lambda console shows these logs for your convenience\. - - Note that the **Click here** link shows logs in the CloudWatch console\. The function then adds logs to Amazon CloudWatch in the log group that corresponds to the Lambda function\. + + The **Log output** section shows the log Lambda generates for each invocation\. These are the logs written to CloudWatch by the Lambda function\. The Lambda console shows these logs for your convenience\. Choose the **Click here** link to add logs to the CloudWatch log group and open the Log groups page in the CloudWatch console\. 1. Run the Lambda function a few times to gather some metrics that you can view in the next step\. diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index b1248b5a..3f889728 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -26,7 +26,7 @@ Initialization is billed as part of the duration for the first invocation proces Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. -The runtime captures **logging** output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when execution starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an **error**, the runtime returns that error to the invoker\. +The runtime captures **logging** output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an **error**, the runtime returns that error to the invoker\. **Note** Logging is subject to [CloudWatch Logs limits](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 7943c5a0..47c53a1e 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ AWS Lambda sets quotas for the amount of compute and storage resources that you | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage | 75 GB | Terabytes | -| [Elastic network interfaces per VPC](configuration-vpc.md) | 250 | Hundreds | +| [Elastic network interfaces per VPC](configuration-vpc.md) Note: quota shared with other services, such as EFS\. See [ Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html) | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -34,7 +34,8 @@ The following quotas are associated with AWS Lambda API requests\. | Resource | Quota | | --- | --- | -| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md) – all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md) – non\-AWS sources\) Unlimited \(asynchronous – [AWS service sources](lambda-services.md)\) | +| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md) – all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md) – non\-AWS sources\) | +| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | | Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota only applies to functions that use provisioned concurrency\. | | [GetFunction](API_GetFunction.md) API requests | 100 requests per second | | [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | diff --git a/doc_source/index.md b/doc_source/index.md index 3f03d0bd..98c22df2 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -37,6 +37,7 @@ Amazon's trademarks and trade dress may not be used in + [Lambda function aliases](configuration-aliases.md) + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Tagging Lambda Functions](configuration-tags.md) diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index 5692e547..d7cdd365 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -1,6 +1,6 @@ # Synchronous invocation -When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function execution ends, Lambda returns the response from the function's code with additional data, such as the version of the function that was executed\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. +When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function completes, Lambda returns the response from the function's code with additional data, such as the version of the function that was invoked\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. ``` $ aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index cfb3607b..3e56ef62 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -18,6 +18,7 @@ To use your Lambda function with AWS resources in an Amazon VPC, configure it wi + [Lambda function aliases](configuration-aliases.md) + [AWS Lambda layers](configuration-layers.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) ++ [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Tagging Lambda Functions](configuration-tags.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index a55b3cb8..e7654f60 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,6 +1,6 @@ # Monitoring and troubleshooting Lambda applications -Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the execution duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 1b4d6a41..ad3a8622 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -10,7 +10,8 @@ Lambda Insights is in public preview\. The preview is open to all AWS accounts, + [Pricing](#monitoring-insights-pricing) + [Supported runtimes](#monitoring-insights-runtimes) + [Region availability](#monitoring-insights-regions) -+ [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling) ++ [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling-console) ++ [Enabling Lambda Insights programmatically](#monitoring-insights-enabling-programmatically) + [Using the Lambda Insights dashboard](#monitoring-insights-multifunction) + [Example workflow to detect function anomalies](#monitoring-insights-anomalies) + [Example workflow using queries to troubleshoot a function](#monitoring-insights-queries) @@ -62,12 +63,9 @@ For this preview release, Lambda Insights is currently available in the followin + Europe \(Stockholm\) + South America \(São Paulo\) -## Enabling Lambda Insights in the Lambda console +## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you turn on Lambda Insights in the Lambda console, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to add the required permissions to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. - -**Note** -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\) or the AWS Cloud Development Kit \(AWS CDK\)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you turn on Lambda Insights in the Lambda console, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -75,24 +73,30 @@ You can also enable Lambda Insights using the AWS Command Line Interface \(AWS C 1. Choose your function\. -1. Choose the **Version configuration** tab\. +1. Choose the **Configuration** tab\. 1. On the **Monitoring tools** pane, choose **Edit**\. -1. Under **Lambda Insights**, turn on **Enhanced monitoring**\. +1. Under **Lambda Insights \(preview\)**, turn on **Enhanced monitoring**\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-enable.png) 1. Choose **Save**\. +## Enabling Lambda Insights programmatically + +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. + +For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. + ## Using the Lambda Insights dashboard -The Lambda Insights dashboard has two views: the multi\-function overview and the single\-function view\. The multi\-function overview aggregates the runtime metrics for the Lambda functions in the current AWS account and Region\. The single\-function view shows the available runtime metrics for a single Lambda function\. +The Lambda Insights dashboard has two views in the CloudWatch console: the multi\-function overview and the single\-function view\. The multi\-function overview aggregates the runtime metrics for the Lambda functions in the current AWS account and Region\. The single\-function view shows the available runtime metrics for a single Lambda function\. -**To view the runtime metrics for all functions** +You can use the Lambda Insights dashboard multi\-function overview in the CloudWatch console to identify over\- and under\-utilized Lambda functions\. You can use the Lambda Insights dashboard single\-function view in the CloudWatch console to troubleshoot individual requests\. -You can use the Lambda Insights dashboard multi\-function overview to identify over\- and under\-utilized Lambda functions\. +**To view the runtime metrics for all functions** -1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. +1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. 1. Choose from the predefined time ranges, or choose a custom time range\. @@ -101,9 +105,7 @@ You can use the Lambda Insights dashboard multi\-function overview to identify o **To view the runtime metrics of a single function** -You can use the Lambda Insights dashboard single\-function view to troubleshoot individual requests\. - -1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) in the CloudWatch console\. +1. Open the [Single\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) page in the CloudWatch console\. 1. Choose from the predefined time ranges, or choose a custom time range\. @@ -118,7 +120,7 @@ You can use the multi\-function overview on the Lambda Insights dashboard to ide **To enable anomaly detection for a function** -1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. +1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. 1. Under **Function summary**, choose your function's name\. @@ -139,12 +141,12 @@ You can use the single\-function view on the Lambda Insights dashboard to identi **To run queries on a function** -1. Open the [multi\-function overview](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) in the CloudWatch console\. +1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. 1. In the **Duration** pane, choose your function to filter the duration metrics\. ![\[A function chosen in the Duration pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-choose-function.png) -1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions)\. +1. Open the [Single\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) page\. 1. Choose the **Filter metrics by function name** dropdown list, and then choose your function\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index f83d3794..092f21a7 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -31,9 +31,9 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio **Configuration** -The Lambda runtime sets some environment variables to configure the X-Ray SDK, including `AWS_XRAY_CONTEXT_MISSING`. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically. For more information, see [Runtime Environment Variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime). + The Lambda runtime sets some environment variables to configure the X\-Ray SDK, including `AWS_XRAY_CONTEXT_MISSING`\. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically\. For more information, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. -**Example initialization code** +**Example initialization code** ``` const AWSXRay = require('aws-xray-sdk-core'); @@ -172,4 +172,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index aef85878..54e7d545 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -8,6 +8,16 @@ def handler_name(event, context): return some_value ``` +## Naming + +The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: ++ the name of the Python file in which the Lambda handler function is located ++ the name of the Python handler function + +If your handler function name is `call_amazon`, located in a file named `handler.py`\. The handler name you would specify when you create your Lambda function is `handler.call_amazon`\. + +## Syntax + In the syntax, note the following: + `event` – AWS Lambda uses this parameter to pass in event data to the handler\. This parameter is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or `NoneType` type\. @@ -19,15 +29,19 @@ In the syntax, note the following: + If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. + If you use the `Event` invocation type \(asynchronous execution\), the value is discarded\. +## Example + For example, consider the following Python example code\. ``` def my_handler(event, context): - message = 'Hello {} {}!'.format(event['first_name'], - event['last_name']) -  return { - 'message' : message - } + message = 'Hello {} {}!'.format(event['first_name'], + event['last_name']) +  return { + 'message' : message + } ``` -This example has one function called `my_handler`\. The function returns a message containing data from the event it received as input\. \ No newline at end of file +This example has one function called `my_handler`\. The function returns a message containing data from the event it received as input\. + +For more information, see the following Python code for the [Amazon Simple Queue Service](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-create-package.html#with-sqs-example-deployment-pkg-python)\. \ No newline at end of file diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 1385a429..447b47d6 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -1,12 +1,10 @@ # AWS Lambda Extensions API -You use the Extensions API to create Lambda extensions\. The Extensions API provides a simple way to extend the Lambda [ execution environment](runtimes-context.md)\. +You use the Extensions API to create Lambda extensions\. Extensions provide a new way for monitoring, security and other tools to integrate with the Lambda [ execution environment](runtimes-context.md)\. For additional information, see [ Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/)\. The Extensions API builds on the existing [Runtime API](runtimes-api.md), which provides an HTTP API for custom runtimes to receive invocation events from Lambda\. As an extension author, you can use the Extensions API to register for function and execution environment lifecycle events\. In response to these events, you can start new processes or run logic\. -Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific environment variables and wrapper scripts, and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\.** - -** +Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific environment variables and wrapper scripts, and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\. An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, they can be written in a different language than the function\. @@ -78,7 +76,13 @@ The `Invoke` phase ends after the runtime and all extensions signal that they ar ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Invoke-Phase.png) -**Event payload**: The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to the extensions carries only the headers\. Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. +**Event payload**: + +The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time remaining, the `RequestId`, the invoked function ARN, and tracing headers\. + +The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time remaining, the `RequestId`, the invoked function ARN, and tracing headers\. + +Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. Here is an example payload: @@ -97,7 +101,7 @@ Here is an example payload: **Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. -**Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's execution duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function execution duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. +**Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. To help identify the overhead introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. @@ -123,7 +127,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t **Event payload**: The `Shutdown` event contains the reason for the shutdown and the time remaining in milliseconds\. The `shutdownReason` includes the following values: -+ SPIN\-DOWN – Normal shutdown ++ SPINDOWN – Normal shutdown + TIMEOUT – Duration limit timed out + FAILURE – Error condition, such as an `out-of-memory` event @@ -207,7 +211,7 @@ Internal extensions are started and stopped by the runtime process, so they are **Body parameters ** -`events` – Array of the events to register for\. Required: no\. Type: array of strings\. +`events` – Array of the events to register for\. Required: no\. Type: array of strings\. Valid strings: `INVOKE`, `SHUTDOWN`\. **Response headers** + `Lambda-Extension-Identifier` – Generated unique agent identifier \(UUID string\) that is required for all subsequent requests\. @@ -218,6 +222,16 @@ Internal extensions are started and stopped by the runtime process, so they are + 403 – Forbidden + 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. +**Example response** + +``` + { + "functionName": "helloWorld", + "functionVersion": "$LATEST", + "handler": "lambda_function.lambda_handler" +} +``` + ### Next Extensions send a `Next` API request to receive the next event, which can be an `Invoke` event or a `Shutdown` event\. The response body contains the payload, which is a JSON document that contains event data\. diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index ae6569c4..c0860f8e 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -15,7 +15,7 @@ Using language\-specific environment variables is the preferred way to set start ### Example: Intercept Lambda invokes with `javaagent` -The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and execute its `premain` method before the application's entry point\. +The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index c8962962..2f1a84ca 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -36,7 +36,7 @@ cron(Minutes Hours Day-of-month Month Day-of-week Year) | 9:00 AM on the first Monday of each month | `cron(0 9 ? * 2#1 *)` | Note the following: -+ If you are using the Lambda console, do not include the `cron` prefix to your expression\. ++ If you are using the Lambda console, do not include the `cron` prefix in your expression\. + One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) in the *CloudWatch Events User Guide*\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 804a4a2b..fd43281b 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -121,4 +121,48 @@ Update the function configuration to cause the function to return an error, whic 1. Choose **Save**\. -Wait a minute, and then check your email for a message from Amazon SNS\. \ No newline at end of file +Wait a minute, and then check your email for a message from Amazon SNS\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the CloudWatch alarm** + +1. Open the [Alarms page](https://console.aws.amazon.com/cloudwatch/home#alarms:) of the CloudWatch console\. + +1. Select the alarm you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Amazon SNS subscription** + +1. Open the [Subscriptions page](https://console.aws.amazon.com/sns/home#subscriptions:) of the Amazon SNS console\. + +1. Select the subscription you created\. + +1. Choose **Delete**, **Delete**\. + +**To delete the Amazon SNS topic** + +1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. + +1. Select the topic you created\. + +1. Choose **Delete**\. + +1. Enter **delete me** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index af4eab38..e96793a3 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -46,9 +46,7 @@ Create an ElastiCache cluster in your default VPC\. 1. Run the following AWS CLI command to create a Memcached cluster\. ``` - $ aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest \ - --cache-node-type cache.m3.medium --engine memcached --num-cache-nodes 1 \ - --security-group-ids sg-0897d5f549934c2fb + $ aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de ``` You can look up the default VPC security group in the VPC console under **Security Groups**\. Your example Lambda function will add and retrieve an item from this cluster\. @@ -131,4 +129,38 @@ In this step, you invoke the Lambda function manually using the `invoke` command + Review the results in the AWS Lambda console\. + Verify the results in CloudWatch Logs\. -Now that you have created a Lambda function that accesses an ElastiCache cluster in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +Now that you have created a Lambda function that accesses an ElastiCache cluster in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the ElastiCache cluster** + +1. Open the [Memcached page](https://console.aws.amazon.com/elasticache/home#memcached:) of the ElastiCache console\. + +1. Select the cluster you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index 49d34e3d..9e48472f 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -23,10 +23,10 @@ To create a state machine that uses Lambda, you need the following components: ## State machine application patterns You can create complex orchestrations for state machines using application patterns such as: -+ **Chaining** – Connect functions into a series of steps, with the output of one step providing the input to the next step\. + **Catch and retry** – Handle errors using sophisticated catch\-and\-retry functionality\. -+ **Parallelism** – Run functions in parallel, or use dynamic parallelism to invoke a function for every member of any array\. + **Branching** – Design your workflow to choose different branches based on Lambda function output\. ++ **Chaining** – Connect functions into a series of steps, with the output of one step providing the input to the next step\. ++ **Parallelism** – Run functions in parallel, or use dynamic parallelism to invoke a function for every member of any array\. ## Applying patterns to state machines @@ -39,7 +39,7 @@ A `Catch` field and a `Retry` field add catch\-and\-retry logic to a state machi A `Choice` state adds branching logic to a state machine\. [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) \(`"Type": "Choice"`\) is an array of rules that determine which state the state machine transitions to next\. **Chaining** -A "chaining" pattern describes multiple Lambda functions connected together in a state machine\. You can use chaining to create reusable workflow invocations from a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html) \(`"Type": "Task"`\) state of a state machine\. +A "Chaining" pattern describes multiple Lambda functions connected together in a state machine\. You can use chaining to create reusable workflow invocations from a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html) \(`"Type": "Task"`\) state of a state machine\. **Parallelism** A `Parallel` state adds parallelism logic to a state machine\. You can use a [Parallel](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html) state \(`"Type": "Parallel"`\) to create parallel branches of invocation in your state machine\. @@ -51,7 +51,7 @@ In addition to application patterns, Step Functions supports various [service in ## Example branching application pattern -In the following example, the `WhichCoat` state machine shows a branching application pattern with a [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) state \(`"Type": "Choice"`\)\. If the condition of one of the three `Choice` states is met, the Lambda function is invoked as a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html): +In the following example, the `WhichCoat` state machine defined in the Amazon States Language \(ASL\) definition shows a branching application pattern with a [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) state \(`"Type": "Choice"`\)\. If the condition of one of the three `Choice` states is met, the Lambda function is invoked as a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html): 1. The `WearHeavyCoat` state invokes the `wear_heavy_coat` Lambda function and returns a message\. @@ -64,7 +64,7 @@ The `WhichCoat` state machine has the following structure: ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-stepfunctions-wearcoat.png) **Example Amazon States Language definition** -The following Amazon States Language definition uses a `Variable` [context object](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html) called `Weather`\. If one of the three conditions in `StringEquals` is met, the Lambda function defined in the [`Resource` field's Amazon Resource Name \(ARN\)](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#amazon-states-language-task-state-specifying-resource-arns) is invoked\. +The following Amazon States Language definition of the `WhichCoat` state machine uses a `Variable` [context object](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html) called `Weather`\. If one of the three conditions in `StringEquals` is met, the Lambda function defined in the [`Resource` field's Amazon Resource Name \(ARN\)](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#amazon-states-language-task-state-specifying-resource-arns) is invoked\. ``` { diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index c22499ec..3ce2361d 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -10,7 +10,7 @@ The Amazon MSK event source mapping supports the following features: + Configurable starting positions and batch sizes\. The configurable starting positions supported are `TRIM_HORIZON` and `LATEST`\. They are not timestamp\-based\. The following Kafka features are not supported: -+ Authentication – SSL and SASL authentication are not supported\. ++ Authentication – Mutual TLS and SASL authentication are not supported\. + Schema registry – You can host your own schema registry, but the Lambda API doesn't support this functionality\. For more information, see [Schema Management](https://docs.confluent.io/current/schema-registry/index.html) on the Confluent website\. **Topics** @@ -107,7 +107,9 @@ To manage event source mappings with the AWS CLI or AWS SDK, use the following A + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can do one of the following: ++ Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. ++ Create a connection between your Amazon VPC and Lambda\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. The Amazon VPC security group rules you configure should have the following settings at minimum: + Inbound rules – Allow all traffic on all ports for the security group specified as your source\. From 666cd6b725b060ba054a34a00b29b7570c1d6022 Mon Sep 17 00:00:00 2001 From: Angus McAllister Date: Mon, 26 Oct 2020 21:06:29 +0000 Subject: [PATCH 041/243] Fix typo in phrase 'an client' --- doc_source/lambda-invocation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index ad91489b..69c5f7a5 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -4,7 +4,7 @@ You can invoke Lambda functions directly [with the Lambda console](getting-start When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. -To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as an client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. +To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. From 3a8be295e4dabc4fedbdd26fe6f363a0a73a5c76 Mon Sep 17 00:00:00 2001 From: Praveen Sripati Date: Sat, 31 Oct 2020 18:44:48 +0530 Subject: [PATCH 042/243] Lambda is given additional permissions than required Lambda is given the permissions via the AWSLambdaExecute Policy which gives access to all the S3 buckets in the current AWS Account. The Lambda simply needs s3:GetObject permissions on the source S3 bucket , s3:PutObject permissions on the target S3 bucket and write permissions around the CloudWatch Logs. What is being done in this Lambda is a common scenario and I have given this page as a reference to a lot many and they might be blindly following the documentation to give the unnecessary permissions to the Lambda. So, the changes. --- doc_source/with-s3-example.md | 74 ++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 2f1e8f0a..d81665fa 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -36,6 +36,62 @@ Install npm to manage the function's dependencies\. The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +## Create buckets and upload a sample object + +Follow the steps to create buckets and upload an object\. + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. + +1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. + + When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. + +## Create the IAM Policy + +Create an IAM policy that defines the permissions for the Lambda. The required permissions are to get the object from the source S3 bucket, put the resized object to the target S3 bucket and permissions around the CloudWatch Logs\. + +**To create an IAM Policy** + +1. Open the [policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. + +1. Choose **Create policy**\. + +1. Under the JSON tab, copy the below JSON. Make sure the source and target bucket names match with the bucket names created in the previous step\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents", + "logs:CreateLogGroup", + "logs:CreateLogStream" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::mybucket/*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject" + ], + "Resource": "arn:aws:s3:::mybucket-resized/*" + } + ] +} +``` +1. Click on `Review policy`, specify the policy name as`AWSLambdaS3Policy` and finally create the policy\. + ## Create the execution role Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. @@ -48,22 +104,10 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Create a role with the following properties\. + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaExecute**\. + + **Permissions** – **AWSLambdaS3Policy**\. + **Role name** – **lambda\-s3\-role**\. -The **AWSLambdaExecute** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. - -## Create buckets and upload a sample object - -Follow the steps to create buckets and upload an object\. - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. - -1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. - - When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. +The **AWSLambdaS3Policy** has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. ## Create the function @@ -366,4 +410,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. \ No newline at end of file +1. Choose **Confirm**\. From 7c6025479fa9de337a2559c0ae0c04ce52716401 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Fri, 6 Nov 2020 22:03:15 +0000 Subject: [PATCH 043/243] Periodic update --- doc_source/best-practices.md | 2 +- doc_source/configuration-layers.md | 2 +- doc_source/configuration-preview.md | 109 +++++++++ doc_source/csharp-handler.md | 4 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/index.md | 2 + doc_source/invocation-eventsourcemapping.md | 3 +- doc_source/lambda-functions.md | 1 + doc_source/lambda-intro-execution-role.md | 2 + doc_source/lambda-monitoring.md | 2 +- doc_source/lambda-services.md | 1 + doc_source/powershell-handler.md | 2 +- doc_source/python-package.md | 136 ++++++----- doc_source/runtimes-extensions-api.md | 12 +- doc_source/security-dataprotection.md | 14 -- doc_source/with-ddb.md | 2 +- doc_source/with-kinesis.md | 2 +- doc_source/with-mq.md | 225 +++++++++++++++++++ doc_source/with-msk.md | 2 +- doc_source/with-s3-example-deployment-pkg.md | 36 +-- doc_source/with-s3-example.md | 80 +++---- doc_source/with-sqs.md | 2 +- 22 files changed, 475 insertions(+), 168 deletions(-) create mode 100644 doc_source/configuration-preview.md create mode 100644 doc_source/with-mq.md diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index dcaf2f17..bb818209 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -24,7 +24,7 @@ The following are recommended best practices for using AWS Lambda: // MyLambdaFunction logic here } ``` -+ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. ++ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves cost by reducing function run time\. To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 85ebba15..777dbe54 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -57,7 +57,7 @@ You must specify the version of each layer to use by providing the full ARN of t $ aws lambda update-function-configuration --function-name my-function --layers [] ``` -Your function can access the content of the layer during execution in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. +While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still existed\. However, when you update the layer configuration, you must remove the reference to the deleted version\. diff --git a/doc_source/configuration-preview.md b/doc_source/configuration-preview.md new file mode 100644 index 00000000..6dfba00a --- /dev/null +++ b/doc_source/configuration-preview.md @@ -0,0 +1,109 @@ +# Configuring functions in the AWS Lambda console \(preview\) + + +**Public preview** + +| | +| --- | +| Public preview The updated AWS Lambda console is in preview release and is subject to change\. The preview is available to AWS accounts on a region by region basis\. The changes include a new function\-level configuration page, increased visibility into versions and aliases, and a dedicated section for your code\. To provide feedback, visit the updated console \([https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\) and select **Tell us what you think**\. | + + You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console preview\. + +The text and workflows are subject to change throughout the preview\. + +**Topics** ++ [Manage preview settings](#configuration-preview-manage) ++ [Configure function settings](#configuration-preview-settings) ++ [Add and edit triggers and destinations](#configuration-preview-triggers) ++ [Edit and update code](#configuration-preview-code) + +## Manage preview settings + +![\[The toggle to update your console experience.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sidebar.png) + +To manage your active console experience, activate the **Updated console \(preview\)** toggle in the console's left\-hand navigation\. + +To protect unsaved changes the console experience can only be updated on Lambda console pages where you are not creating or editing a resource\. + +The feedback option is available after activating the updated console\. Select **Tell us what you think** at any time to write feedback\. The feedback form will also be provided when you deactivate the updated console preview\. + +## Configure function settings + +To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. + +Choose **Latest configuration** to view and manage your version's current configuration\. + +![\[The Latest configuration section of the updated console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/latest-config.png) + +Areas of configuration are broken into five sections, which encapsulate the following: + +**General** +Basic settings +Asynchronous invocation +Monitoring tools +VPC +Database proxies +File system +Concurrency + +**Runtime** +Environment variables +Layers + +**Triggers** +A list of existing triggers and options to create, enable, disable, fix, and delete triggers\. + +**Permissions** +Execution role +Resource summary +Resource\-based policy +Auditing and compliance + +**Destinations** +A list of existing destinations and options to create, remove, and edit destinations\. + +## Add and edit triggers and destinations + +Triggers and destinations now exist as subsets of your function's greater configuration settings\. Both resources are still visible in the function visualization, but are no longer accessed through interacting with it\. + +To see your lists of existing triggers or destinations, choose **Latest configuration** when viewing a version of your function and select either **Triggers** or **Destinations** from the left\-hand sections\. + +**To add a new trigger** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. + +1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. + +1. Choose **Latest configuration** and then **Triggers**\. + +1. Choose **Add trigger** and select the type of trigger from the list of available options\. + +1. The fields associated with that trigger will load in below\. Fill them in and choose **Add**\. + +1. To verify your trigger has been added, choose **Overview** and note the new trigger in the **Function visualization**\. + +To enable, disable, fix, or delete a trigger, choose the item in the list of triggers provided when you visit the **Triggers** section of **Latest configuration**\. To reconfigure the trigger, use the event source mapping API commands\. + +**To add a new destination** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. + +1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. + +1. Choose **Latest configuration** and then **Destinations**\. + +1. Choose **Add destination**\. + +1. Fill in the required fields and then choose **Save**\. + +1. To verify your destination has been added, choose **Overview** and note the new destination in the **Function visualization**\. + +To edit or remove the destination, choose the item in the list of destinations provided when you choose the **Destinations** section of **Latest configuration**\. + +## Edit and update code + +Function code now has its own primary section within your function's details\. To access your function code, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. + +Choose **Code** to view and manage your version's current code\. From this view you can edit inline, where possible, or choose **Upload from** to upload from a source\. + +Functionality has not changed for the development environment and test events\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index cd35ebc2..73d4aaa8 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -2,7 +2,7 @@ When you create a Lambda function, you specify a handler that AWS Lambda can invoke when the service runs the function on your behalf\. -You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current execution, such as the name of the current function, the memory limit, execution time remaining, and logging\. +You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. ``` returnType handler-name(inputType input, ILambdaContext context) { @@ -181,7 +181,7 @@ public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) If you use this pattern, there are some considerations you must take into account: + AWS Lambda does not support `async void` methods\. -+ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function execution is complete\. ++ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function invocation completes\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event event) // Compiler warning diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6e338424..13620df4 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -28,7 +28,7 @@ For more information, see [Lambda function versions](configuration-versions.md)\ An *execution environment* provides a secure and isolated runtime environment where Lambda invokes your function\. An execution environment manages the runtime and other resources that are required to run your function\. The execution environment provides lifecycle support for the function's runtime and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. -For more information, see [AWS Lambda execution environmentManaging state machines in the Lambda console](runtimes-context.md)\. +For more information, see [Execution environment](runtimes-context.md)\. ## Runtime diff --git a/doc_source/index.md b/doc_source/index.md index 98c22df2..da78e105 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -31,6 +31,7 @@ Amazon's trademarks and trade dress may not be used in + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) + [Configuring functions in the AWS Lambda console](configuration-console.md) + + [Configuring functions in the AWS Lambda console (preview)](configuration-preview.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) @@ -105,6 +106,7 @@ Amazon's trademarks and trade dress may not be used in + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + + [Using Lambda with Amazon MQ](with-mq.md) + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Using AWS Lambda with Amazon S3](with-s3.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index af4b3d35..995c79ec 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -5,12 +5,13 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 3e56ef62..92a9d52a 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -12,6 +12,7 @@ To use your Lambda function with AWS resources in an Amazon VPC, configure it wi **Topics** + [Configuring functions in the AWS Lambda console](configuration-console.md) ++ [Configuring functions in the AWS Lambda console \(preview\)](configuration-preview.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2bc02c54..c93c4684 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -111,6 +111,7 @@ The following AWS managed policies provide permissions that are required to use + **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. + **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. + **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. ++ **AWSLambdaMQExecutionRole** – Permission to read records from an Amazon MQ broker\. + **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster\. + **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. + **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. @@ -124,6 +125,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index e7654f60..902a99da 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,6 +1,6 @@ # Monitoring and troubleshooting Lambda applications -Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 69224558..77a2ee39 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -51,6 +51,7 @@ For services that generate a queue or data stream, you create an [event source m **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index df76d38b..e61f0096 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -4,7 +4,7 @@ When a Lambda function is invoked, the Lambda handler invokes the PowerShell scr When the PowerShell script is invoked, the following variables are predefined: + *$LambdaInput* – A PSObject that contains the input to the handler\. This input can be event data \(published by an event source\) or custom input that you provide, such as a string or any custom data object\. -+ *$LambdaContext* – An Amazon\.Lambda\.Core\.ILambdaContext object that you can use to access information about the current execution—such as the name of the current function, the memory limit, execution time remaining, and logging\. ++ *$LambdaContext* – An Amazon\.Lambda\.Core\.ILambdaContext object that you can use to access information about the current invocation—such as the name of the current function, the memory limit, execution time remaining, and logging\. For example, consider the following PowerShell example code\. diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 86efee75..09755f98 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -4,8 +4,10 @@ A deployment package is a ZIP archive that contains your function code and depen If you use the Lambda [console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. +You can also use the AWS SAM CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS SAM Developer Guide*\. + **Note** -You can use the AWS SAM CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. See [Building applications with dependencies](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the AWS SAM Developer Guide for instructions\. +We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. **Topics** + [Prerequisites](#python-package-prereqs) @@ -15,7 +17,7 @@ You can use the AWS SAM CLI `build` command to create a deployment package for y ## Prerequisites -These instructions assume that you already have a function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. +These instructions assume that you have already created a Lambda function and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: @@ -30,23 +32,22 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Updating a function with no dependencies -To create or update a function with the Lambda API, create an archive that contains your function code and upload it with the AWS CLI\. +To create or update a function with the Lambda API, create an deployment package that contains your function code and upload it with the AWS CLI\. **To update a Python function with no dependencies** -1. Create a ZIP archive\. +1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip function.zip lambda_function.py - adding: lambda_function.py (deflated 17%) + ~/my-function$ zip my-deployment-package.zip lambda_function.py ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", @@ -63,52 +64,54 @@ To create or update a function with the Lambda API, create an archive that conta If your function depends on libraries other than the SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. -**Note** -For libraries that use extension modules written in C or C\+\+, build your deployment package in an Amazon Linux environment\. You can use the [SAM CLI build command](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html), which uses Docker, or build your deployment package on Amazon EC2 or CodeBuild\. +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. The steps assume you are not using a virtual environment\. -The following example shows how to create a deployment package that includes a common graphics library named Pillow\. +**Note** +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. **To update a Python function with dependencies** -1. Install libraries in a new, project\-local `package` directory with `pip`'s `--target` option\. +1. Install libraries in a `package` directory with `pip`'s `--target` option\. ``` - ~/my-function$ pip install --target ./package Pillow - Collecting Pillow - Using cached https://files.pythonhosted.org/packages/62/8c/230204b8e968f6db00c765624f51cfd1ecb6aea57b25ba00b240ee3fb0bd/Pillow-5.3.0-cp37-cp37m-manylinux1_x86_64.whl - Installing collected packages: Pillow - Successfully installed Pillow-5.3.0 + ~/my-function$ pip install --target ./package requests ``` **Note** -In order for `--target` to work on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) like Ubuntu, you may also need to pass the `--system` flag to prevent `distutils` errors\. +You may need to pass the `--system` option on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) like Ubuntu to prevent `distutils` errors\. -1. Create a ZIP archive of the dependencies\. +1. Create a deployment package with the installed libraries at the root\. ``` ~/my-function$ cd package - ~/my-function/package$ zip -r9 ${OLDPWD}/function.zip . - adding: PIL/ (stored 0%) - adding: PIL/.libs/ (stored 0%) - adding: PIL/.libs/libfreetype-7ce95de6.so.6.16.1 (deflated 65%) - adding: PIL/.libs/libjpeg-3fe7dfc0.so.9.3.0 (deflated 72%) - adding: PIL/.libs/liblcms2-a6801db4.so.2.0.8 (deflated 67%) - ... + ~/my-function/package$ zip -r my-deployment-package.zip ./* ``` -1. Add your function code to the archive\. +1. Add function code files to the root of your deployment package\. ``` - ~/my-function/package$ cd $OLDPWD - ~/my-function$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 56%) + ~/my-function/package$ cd .. + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", @@ -123,79 +126,74 @@ In order for `--target` to work on [Debian\-based systems](https://github.com/py ## With a virtual environment -In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest/) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. +In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. + +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. + +**Note** +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. **To update a Python function with a virtual environment** 1. Create a virtual environment\. ``` - ~/my-function$ virtualenv v-env - Using base prefix '~/.local/python-3.7.0' - New python executable in v-env/bin/python3.8 - Also creating executable in v-env/bin/python - Installing setuptools, pip, wheel... - done. - ``` -**Note** -For Python 3\.3 and newer, you can use the built\-in [venv module](https://docs.python.org/3/library/venv.html) to create a virtual environment, instead of installing `virtualenv`\. - - ``` - ~/my-function$ python3 -m venv v-env + ~/my-function$ virtualenv myvenv ``` 1. Activate the environment\. ``` - ~/my-function$ source v-env/bin/activate - (v-env) ~/my-function$ + ~/my-function$ source myvenv/bin/activate ``` 1. Install libraries with pip\. ``` - (v-env) ~/my-function$ pip install Pillow - Collecting Pillow - Using cached https://files.pythonhosted.org/packages/62/8c/230204b8e968f6db00c765624f51cfd1ecb6aea57b25ba00b240ee3fb0bd/Pillow-5.3.0-cp37-cp37m-manylinux1_x86_64.whl - Installing collected packages: Pillow - Successfully installed Pillow-5.3.0 + (myvenv) ~/my-function$ pip install requests ``` 1. Deactivate the virtual environment\. ``` - (v-env) ~/my-function$ deactivate + (myvenv) ~/my-function$ deactivate ``` -1. Create a ZIP archive with the contents of the library\. +1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd v-env/lib/python3.8/site-packages - ~/my-function/v-env/lib/python3.8/site-packages$ zip -r9 ${OLDPWD}/function.zip . - adding: easy_install.py (deflated 17%) - adding: PIL/ (stored 0%) - adding: PIL/.libs/ (stored 0%) - adding: PIL/.libs/libfreetype-7ce95de6.so.6.16.1 (deflated 65%) - adding: PIL/.libs/libjpeg-3fe7dfc0.so.9.3.0 (deflated 72%) - ... + ~/my-function$ cd myvenv/lib/python3.8/site-packages + ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r my-deployment-package.zip . ``` +**Note** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. - Depending on the library, dependencies may appear in either `site-packages` or `dist-packages`, and the first folder in the virtual environment may be `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` -1. Add your function code to the archive\. + After you complete this step, you should have the following directory structure: ``` - ~/my-function/v-env/lib/python3.8/site-packages$ cd $OLDPWD - ~/my-function$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 56%) + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 447b47d6..7802529e 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -222,10 +222,18 @@ Internal extensions are started and stopped by the runtime process, so they are + 403 – Forbidden + 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. -**Example response** +**Example request body** ``` - { +{ + 'events': [ 'INVOKE', 'SHUTDOWN'] +} +``` + +**Example response body** + +``` +{ "functionName": "helloWorld", "functionVersion": "$LATEST", "handler": "lambda_function.lambda_handler" diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index ea029e5d..350da4ee 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -1,19 +1,5 @@ # Data protection in AWS Lambda -AWS Lambda conforms to the AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/), which includes regulations and guidelines for data protection\. AWS is responsible for protecting the global infrastructure that runs all the AWS services\. AWS maintains control over data hosted on this infrastructure, including the security configuration controls for handling customer content and personal data\. AWS customers and APN partners, acting either as data controllers or data processors, are responsible for any personal data that they put in the AWS Cloud\. - -For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\), so that each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: -+ Use multi\-factor authentication \(MFA\) with each account\. -+ Use SSL/TLS to communicate with AWS resources\. We recommend TLS 1\.2 or later\. -+ Set up API and user activity logging with AWS CloudTrail\. -+ Use AWS encryption solutions, along with all default security controls within AWS services\. -+ Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. -+ If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. - -We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields or metadata such as function names and tags\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into metadata might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. - -For more information about data protection, see the [AWS shared responsibility model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\. - **Topics** + [Encryption in transit](#security-privacy-intransit) + [Encryption at rest](#security-privacy-atrest) diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 30e5389d..29120a14 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -146,7 +146,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index aae2f4a5..9f538acb 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -160,7 +160,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md new file mode 100644 index 00000000..aeebd22b --- /dev/null +++ b/doc_source/with-mq.md @@ -0,0 +1,225 @@ +# Using Lambda with Amazon MQ + +Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. Lambda only supports Apache ActiveMQ\. A *message broker* allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. + +Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ brokers and by providing different network topologies and other infrastructure needs\. + +You can use a Lambda function to process records from your Amazon MQ message broker\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. + +The Amazon MQ event source mapping has the following configuration restrictions: ++ Authentication – Only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. User credentials associated with the broker are the only method of connection\. For more information about authentication, see [Messaging Authentication and Authorization for ActiveMQ](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. ++ Connection quota – Brokers have a maximum number of allowed connections per wire\-level protocol\. This quota is based on the broker instance type\. For more information, see the [Brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html#broker-limits) section of **Quotas in Amazon MQ** in the *Amazon MQ Developer Guide*\. ++ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to interact with the records\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. ++ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website\. ++ Network topology – Only one single\-instance or standby broker is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Amazon MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) in the *Amazon MQ Developer Guide*\. ++ Protocols – Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. + +Lambda automatically supports the latest versions of ActiveMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ Release Notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. + +**Note** +By default, Amazon MQ has a weekly maintenance window for brokers\. During that window of time, brokers are unavailable\. For brokers without standby, Lambda cannot process any messages during that window\. + +**Topics** ++ [Lambda consumer group](#services-mq-configure) ++ [Execution role permissions](#events-mq-permissions) ++ [Configuring a broker as an event source](#services-mq-eventsourcemapping) ++ [Event source mapping API](#services-mq-api) ++ [Event source mapping errors](#services-mq-errors) + +## Lambda consumer group + +To interact with Amazon MQ, Lambda creates a consumer group which can read from your Amazon MQ brokers\. The consumer group is created with the same ID as the event source mapping UUID\. + +Lambda will pull messages until it has processed a maximum of 6 MB, until timeout, or until the batch size is fulfilled\. When configured, batch size determines the maximum number of items to retrieve in a single batch\. Your batch is converted into a Lambda payload, and your target function is invoked\. Messages are neither persisted nor deserialized\. Instead, they are retrieved by the consumer group as a BLOB of bytes and are base64\-encoded for a JSON payload\. + +**Note** +The maximum function invocation time is 14 minutes\. + +Lambda processes all incoming batches concurrently and automatically scales the concurrency to meet demands\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. + +**Example Amazon MQ record event** + +``` +{ + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": { [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] + } +} +``` + +## Execution role permissions + +To read records from an Amazon MQ broker, your Lambda function needs the following permissions added to its [execution role](lambda-intro-execution-role.md): ++ [mq:DescribeBroker](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers-broker-id.html#brokers-broker-id-http-methods) ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) + +The AWS managed policy `AWSLambdaMQExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. + +**Note** +When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. + +## Configuring a broker as an event source + +Create an [event source mapping](invocation-eventsourcemapping.md) to tell Lambda to send records from an Amazon MQ broker to a Lambda function\. You can create multiple event source mappings to process the same data with multiple functions, or to process items from multiple sources with a single function\. + +To configure your function to read from Amazon MQ, create an **MQ** trigger in the Lambda console\. + +**To create a trigger** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Under **Designer**, choose **Add trigger**\. + +1. Choose a trigger type\. + +1. Configure the required options and then choose **Add**\. + +Lambda supports the following options for Amazon MQ event sources: ++ **MQ broker** – Select an Amazon MQ broker\. ++ **Batch size** – Set the maximum number of messages to retrieve in a single batch\. ++ **Queue name** – Enter the Amazon MQ queue to consume\. ++ **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. ++ **Enable trigger** – Disable the trigger to stop processing records\. + +To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API operations\. + +## Event source mapping API + +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. + +By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. + +For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon VPC access requirements, you can do one of the following: ++ Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. ++ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS STS and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. + +The Amazon Virtual Private Cloud \(Amazon VPC\) security group rules that you configure should have the following settings at minimum: ++ Inbound rules – For a broker without public accessibility, allow all traffic on all ports for the security group that's specified as your source\. For a broker with public accessibility, allow all traffic on all ports for all destinations\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + +The Amazon VPC configuration is discoverable through the [Amazon MQ API](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/resources.html) and does not need to be configured in the `create-event-source-mapping` setup\. + +The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. + +``` +$ aws lambda create-event-source-mapping \ +--event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ +--function-name MQ-Example-Function \ +--source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ +--queues ExampleQueue +{ + "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", + "BatchSize": 100, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601927898.741, + "LastProcessingResult": "No records processed", + "State": "Creating", + "StateTransitionReason": "USER_INITIATED", + "Queues": [ + "ExampleQueue" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt" + } + ] +} +``` + +Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. + +``` +$ aws lambda update-event-source-mapping \ +--uuid 91eaeb7e-c976-1234-9451-8709db01f137 \ +--batch-size 2 +{ + "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", + "BatchSize": 2, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601928393.531, + "LastProcessingResult": "No records processed", + "State": "Updating", + "StateTransitionReason": "USER_INITIATED" +} +``` + +Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. + +``` +$ aws lambda get-event-source-mapping \ +--uuid 91eaeb7e-c976-4939-9451-8709db01f137 +{ + "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", + "BatchSize": 2, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601928393.531, + "LastProcessingResult": "No records processed", + "State": "Enabled", + "StateTransitionReason": "USER_INITIATED" +} +``` + +## Event source mapping errors + +When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda failed to authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda does not have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The function's configuration is not valid\. + +Records also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website\. \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 3ce2361d..3fed5365 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -100,7 +100,7 @@ To enable or disable the trigger \(or delete it\), choose the **MSK** trigger in ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index 9cf9c959..93874d7f 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -314,38 +314,8 @@ def lambda_handler(event, context): s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) ``` -**Note** -The image library used by this code must be installed in a Linux environment in order to create a working deployment package\. +**Dependencies** ++ [Pillow](https://pypi.org/project/Pillow/) **To create a deployment package** - -1. Copy the sample code into a file named `lambda_function.py`\. - -1. Create a virtual environment\. - - ``` - s3-python$ virtualenv v-env - s3-python$ source v-env/bin/activate - ``` - -1. Install libraries in the virtual environment - - ``` - (v-env) s3-python$ pip install Pillow boto3 - ``` - -1. Create a deployment package with the contents of the installed libraries\. - - ``` - (v-env) s3-python$ cd $VIRTUAL_ENV/lib/python3.8/site-packages - (v-env) python-s3/v-env/lib/python3.8/site-packages$ zip -r9 ${OLDPWD}/function.zip . - ``` - -1. Add the handler code to the deployment package and deactivate the virtual environment\. - - ``` - (v-env) python-s3/v-env/lib/python3.8/site-packages$ cd ${OLDPWD} - (v-env) python-s3$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 55%) - (v-env) python-s3$ deactivate - ``` \ No newline at end of file ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index d81665fa..1ea5404d 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -48,49 +48,53 @@ Follow the steps to create buckets and upload an object\. When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. -## Create the IAM Policy +## Create the IAM Policy -Create an IAM policy that defines the permissions for the Lambda. The required permissions are to get the object from the source S3 bucket, put the resized object to the target S3 bucket and permissions around the CloudWatch Logs\. +Create an IAM policy that defines the permissions for the Lambda function\. The required permissions include: ++ Get the object from the source S3 bucket\. ++ Put the resized object into the target S3 bucket\. ++ Permissions related to the CloudWatch Logs\. **To create an IAM Policy** -1. Open the [policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. -1. Choose **Create policy**\. +1. Choose **Create policy** -1. Under the JSON tab, copy the below JSON. Make sure the source and target bucket names match with the bucket names created in the previous step\. +1. Under the **JSON** tab, copy the following policy\. Make sure the source and target bucket names match the bucket names that you created previously\. -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "logs:PutLogEvents", - "logs:CreateLogGroup", - "logs:CreateLogStream" - ], - "Resource": "arn:aws:logs:*:*:*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::mybucket/*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject" - ], - "Resource": "arn:aws:s3:::mybucket-resized/*" - } - ] -} -``` -1. Click on `Review policy`, specify the policy name as`AWSLambdaS3Policy` and finally create the policy\. + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents", + "logs:CreateLogGroup", + "logs:CreateLogStream" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::mybucket/*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject" + ], + "Resource": "arn:aws:s3:::mybucket-resized/*" + } + ] + } + ``` + +1. Choose **Review policy**, specify the policy name as `AWSLambdaS3Policy`, and create the policy\. ## Create the execution role @@ -107,7 +111,7 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func + **Permissions** – **AWSLambdaS3Policy**\. + **Role name** – **lambda\-s3\-role**\. -The **AWSLambdaS3Policy** has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. +The **AWSLambdaS3Policy** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. ## Create the function @@ -410,4 +414,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. +1. Choose **Confirm**\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d8ba94ed..9599f523 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -141,7 +141,7 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) From 42bf9210b7d9ae08876e78a98ff9d32ac8216cd9 Mon Sep 17 00:00:00 2001 From: Praveen Sripati Date: Sat, 7 Nov 2020 11:05:32 +0530 Subject: [PATCH 044/243] Policy has to be deleted in the clean up at the end Policy has to be deleted in the clean up at the end --- doc_source/with-s3-example.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 1ea5404d..614a72d3 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -394,6 +394,16 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. +**To delete the policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. Select the policy that you created\. + +1. Choose **Delete** under the **Policy actions**\. + +1. Choose **Delete**\. + **To delete the execution role** 1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. @@ -414,4 +424,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. \ No newline at end of file +1. Choose **Confirm**\. From 29323a369f7e6dcc85ca3e69ffa089e58c0050c6 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Sun, 15 Nov 2020 08:19:43 -0800 Subject: [PATCH 045/243] Added Runtime Logs API, other minor doc updates --- doc_source/API_CreateEventSourceMapping.md | 55 +++- doc_source/API_CreateFunction.md | 4 +- doc_source/API_DeleteEventSourceMapping.md | 27 +- .../API_EventSourceMappingConfiguration.md | 22 +- doc_source/API_FunctionConfiguration.md | 2 +- doc_source/API_GetEventSourceMapping.md | 27 +- doc_source/API_GetFunctionConfiguration.md | 2 +- doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListEventSourceMappings.md | 7 + doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 4 +- doc_source/API_PublishVersion.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 27 ++ doc_source/API_Types.md | 1 + doc_source/API_UpdateEventSourceMapping.md | 47 ++- doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/API_UpdateFunctionConfiguration.md | 4 +- doc_source/best-practices.md | 2 +- doc_source/configuration-layers.md | 2 +- doc_source/configuration-preview.md | 109 +++++++ doc_source/csharp-handler.md | 4 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/index.md | 4 + doc_source/invocation-eventsourcemapping.md | 3 +- doc_source/lambda-functions.md | 1 + doc_source/lambda-intro-execution-role.md | 2 + doc_source/lambda-invocation.md | 2 +- doc_source/lambda-monitoring.md | 2 +- doc_source/lambda-releases.md | 4 +- doc_source/lambda-runtimes.md | 1 + doc_source/lambda-services.md | 1 + doc_source/powershell-handler.md | 2 +- doc_source/python-package.md | 136 +++++---- doc_source/runtimes-context.md | 4 +- doc_source/runtimes-extensions-api.md | 18 +- doc_source/runtimes-logs-api.md | 279 ++++++++++++++++++ doc_source/security-dataprotection.md | 8 +- doc_source/security-iam.md | 55 ++-- .../security_iam_id-based-policy-examples.md | 8 +- doc_source/security_iam_troubleshoot.md | 12 +- doc_source/with-ddb.md | 2 +- doc_source/with-kinesis.md | 2 +- doc_source/with-mq.md | 225 ++++++++++++++ doc_source/with-msk.md | 3 +- doc_source/with-s3-example-deployment-pkg.md | 36 +-- doc_source/with-s3-example.md | 88 +++++- doc_source/with-sqs.md | 2 +- 50 files changed, 1049 insertions(+), 213 deletions(-) create mode 100644 doc_source/API_SourceAccessConfiguration.md create mode 100644 doc_source/configuration-preview.md create mode 100644 doc_source/runtimes-logs-api.md create mode 100644 doc_source/with-mq.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 90ad528c..ad941e89 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -6,6 +6,7 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) + [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html) + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) ++ [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): @@ -39,6 +40,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "StartingPosition": "string", "StartingPositionTimestamp": number, "Topics": [ "string" ] @@ -111,19 +119,35 @@ Required: No ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. +Required: No + + ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` +Required: No + + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -170,6 +194,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -222,18 +253,32 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. + ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` + + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. + ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String @@ -243,7 +288,7 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index f87bbbec..c4577d1f 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -150,7 +150,7 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** @@ -335,7 +335,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index bc2a66e2..44f1d88c 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -47,6 +47,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -99,18 +106,32 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. + ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` + + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. + ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String @@ -120,7 +141,7 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index df9d1b6a..9e78f5c5 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -51,19 +51,35 @@ Required: No **MaximumRecordAgeInSeconds** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No **ParallelizationFactor** \(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. +Required: No + + **Queues** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` +Required: No + + **SourceAccessConfigurations** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. Required: No **State** @@ -77,7 +93,7 @@ Type: String Required: No **Topics** - \(MSK\) The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 2fa66b1c..9abbf8f8 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -115,7 +115,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **State** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index d8655214..f073a04e 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -45,6 +45,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -97,18 +104,32 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. + ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` + + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. + ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String @@ -118,7 +139,7 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 4d3a9dc4..aae32762 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -196,7 +196,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 5db2459c..a5067bc9 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -58,7 +58,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index b344bc74..efe426fb 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -54,7 +54,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 645c53cd..1a114dde 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 7a733ea3..803b3be6 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -70,6 +70,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 1e38e5f3..ed2b84b1 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index cf6939f7..91720146 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index bf7cbd1b..fbef82be 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -96,7 +96,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 5 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 4e1749f3..d9d525b1 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -216,7 +216,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md new file mode 100644 index 00000000..8a21b665 --- /dev/null +++ b/doc_source/API_SourceAccessConfiguration.md @@ -0,0 +1,27 @@ +# SourceAccessConfiguration + + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` + +## Contents + + **Type** +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: String +Valid Values:` BASIC_AUTH` +Required: No + + **URI** +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index fcfa5ba3..ebedf4f7 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -25,6 +25,7 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) + [VpcConfig](API_VpcConfig.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 2b32da21..c6a09e35 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -31,7 +31,13 @@ Content-type: application/json "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, - "ParallelizationFactor": number + "ParallelizationFactor": number, + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ] } ``` @@ -95,19 +101,27 @@ Required: No ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. +Required: No + + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. Required: No ## Response Syntax @@ -135,6 +149,13 @@ Content-type: application/json "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, + "Queues": [ "string" ], + "SourceAccessConfigurations": [ + { + "Type": "string", + "URI": "string" + } + ], "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -187,18 +208,32 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 604800\. +Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams\) 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\. Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 10000\. +Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. + ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** + \(MQ\) The name of the Amazon MQ broker destination queue to consume\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Length Constraints: Minimum length of 1\. Maximum length of 1000\. +Pattern: `[\s\S]*` + + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Array Members: Fixed number of 1 item\. + ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String @@ -208,7 +243,7 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index f0f55d47..9be56f50 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -241,7 +241,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f4b2ea77..3cab11a5 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -130,7 +130,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -310,7 +310,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index dcaf2f17..bb818209 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -24,7 +24,7 @@ The following are recommended best practices for using AWS Lambda: // MyLambdaFunction logic here } ``` -+ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves execution time and cost\. ++ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves cost by reducing function run time\. To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 85ebba15..777dbe54 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -57,7 +57,7 @@ You must specify the version of each layer to use by providing the full ARN of t $ aws lambda update-function-configuration --function-name my-function --layers [] ``` -Your function can access the content of the layer during execution in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. +While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still existed\. However, when you update the layer configuration, you must remove the reference to the deleted version\. diff --git a/doc_source/configuration-preview.md b/doc_source/configuration-preview.md new file mode 100644 index 00000000..6dfba00a --- /dev/null +++ b/doc_source/configuration-preview.md @@ -0,0 +1,109 @@ +# Configuring functions in the AWS Lambda console \(preview\) + + +**Public preview** + +| | +| --- | +| Public preview The updated AWS Lambda console is in preview release and is subject to change\. The preview is available to AWS accounts on a region by region basis\. The changes include a new function\-level configuration page, increased visibility into versions and aliases, and a dedicated section for your code\. To provide feedback, visit the updated console \([https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\) and select **Tell us what you think**\. | + + You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console preview\. + +The text and workflows are subject to change throughout the preview\. + +**Topics** ++ [Manage preview settings](#configuration-preview-manage) ++ [Configure function settings](#configuration-preview-settings) ++ [Add and edit triggers and destinations](#configuration-preview-triggers) ++ [Edit and update code](#configuration-preview-code) + +## Manage preview settings + +![\[The toggle to update your console experience.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sidebar.png) + +To manage your active console experience, activate the **Updated console \(preview\)** toggle in the console's left\-hand navigation\. + +To protect unsaved changes the console experience can only be updated on Lambda console pages where you are not creating or editing a resource\. + +The feedback option is available after activating the updated console\. Select **Tell us what you think** at any time to write feedback\. The feedback form will also be provided when you deactivate the updated console preview\. + +## Configure function settings + +To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. + +Choose **Latest configuration** to view and manage your version's current configuration\. + +![\[The Latest configuration section of the updated console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/latest-config.png) + +Areas of configuration are broken into five sections, which encapsulate the following: + +**General** +Basic settings +Asynchronous invocation +Monitoring tools +VPC +Database proxies +File system +Concurrency + +**Runtime** +Environment variables +Layers + +**Triggers** +A list of existing triggers and options to create, enable, disable, fix, and delete triggers\. + +**Permissions** +Execution role +Resource summary +Resource\-based policy +Auditing and compliance + +**Destinations** +A list of existing destinations and options to create, remove, and edit destinations\. + +## Add and edit triggers and destinations + +Triggers and destinations now exist as subsets of your function's greater configuration settings\. Both resources are still visible in the function visualization, but are no longer accessed through interacting with it\. + +To see your lists of existing triggers or destinations, choose **Latest configuration** when viewing a version of your function and select either **Triggers** or **Destinations** from the left\-hand sections\. + +**To add a new trigger** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. + +1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. + +1. Choose **Latest configuration** and then **Triggers**\. + +1. Choose **Add trigger** and select the type of trigger from the list of available options\. + +1. The fields associated with that trigger will load in below\. Fill them in and choose **Add**\. + +1. To verify your trigger has been added, choose **Overview** and note the new trigger in the **Function visualization**\. + +To enable, disable, fix, or delete a trigger, choose the item in the list of triggers provided when you visit the **Triggers** section of **Latest configuration**\. To reconfigure the trigger, use the event source mapping API commands\. + +**To add a new destination** + +1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. + +1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. + +1. Choose **Latest configuration** and then **Destinations**\. + +1. Choose **Add destination**\. + +1. Fill in the required fields and then choose **Save**\. + +1. To verify your destination has been added, choose **Overview** and note the new destination in the **Function visualization**\. + +To edit or remove the destination, choose the item in the list of destinations provided when you choose the **Destinations** section of **Latest configuration**\. + +## Edit and update code + +Function code now has its own primary section within your function's details\. To access your function code, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. + +Choose **Code** to view and manage your version's current code\. From this view you can edit inline, where possible, or choose **Upload from** to upload from a source\. + +Functionality has not changed for the development environment and test events\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index cd35ebc2..73d4aaa8 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -2,7 +2,7 @@ When you create a Lambda function, you specify a handler that AWS Lambda can invoke when the service runs the function on your behalf\. -You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current execution, such as the name of the current function, the memory limit, execution time remaining, and logging\. +You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. ``` returnType handler-name(inputType input, ILambdaContext context) { @@ -181,7 +181,7 @@ public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) If you use this pattern, there are some considerations you must take into account: + AWS Lambda does not support `async void` methods\. -+ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function execution is complete\. ++ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function invocation completes\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event event) // Compiler warning diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6e338424..13620df4 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -28,7 +28,7 @@ For more information, see [Lambda function versions](configuration-versions.md)\ An *execution environment* provides a secure and isolated runtime environment where Lambda invokes your function\. An execution environment manages the runtime and other resources that are required to run your function\. The execution environment provides lifecycle support for the function's runtime and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. -For more information, see [AWS Lambda execution environmentManaging state machines in the Lambda console](runtimes-context.md)\. +For more information, see [Execution environment](runtimes-context.md)\. ## Runtime diff --git a/doc_source/index.md b/doc_source/index.md index 98c22df2..afdc547c 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -31,6 +31,7 @@ Amazon's trademarks and trade dress may not be used in + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) + [Configuring functions in the AWS Lambda console](configuration-console.md) + + [Configuring functions in the AWS Lambda console (preview)](configuration-preview.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) @@ -58,6 +59,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda runtime API](runtimes-api.md) + [AWS Lambda Extensions API](runtimes-extensions-api.md) + [Modifying the runtime environment](runtimes-modify.md) + + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [AWS Lambda applications](deploying-lambda-apps.md) @@ -105,6 +107,7 @@ Amazon's trademarks and trade dress may not be used in + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + + [Using Lambda with Amazon MQ](with-mq.md) + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Using AWS Lambda with Amazon S3](with-s3.md) @@ -280,6 +283,7 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) + [VpcConfig](API_VpcConfig.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index af4b3d35..995c79ec 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -5,12 +5,13 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 3e56ef62..92a9d52a 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -12,6 +12,7 @@ To use your Lambda function with AWS resources in an Amazon VPC, configure it wi **Topics** + [Configuring functions in the AWS Lambda console](configuration-console.md) ++ [Configuring functions in the AWS Lambda console \(preview\)](configuration-preview.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2bc02c54..c93c4684 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -111,6 +111,7 @@ The following AWS managed policies provide permissions that are required to use + **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. + **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. + **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. ++ **AWSLambdaMQExecutionRole** – Permission to read records from an Amazon MQ broker\. + **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster\. + **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. + **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. @@ -124,6 +125,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index ad91489b..69c5f7a5 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -4,7 +4,7 @@ You can invoke Lambda functions directly [with the Lambda console](getting-start When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. -To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as an client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. +To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index e7654f60..902a99da 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,6 +1,6 @@ # Monitoring and troubleshooting Lambda applications -Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code as it executes, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index cb2299df..6fa55542 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,9 +4,11 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | +| [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | | [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | | [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | -| [New event source to provide Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | +| [New event source for Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | | [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 1cc2858f..2bb97902 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -80,5 +80,6 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [AWS Lambda runtime API](runtimes-api.md) + [AWS Lambda Extensions API](runtimes-extensions-api.md) + [Modifying the runtime environment](runtimes-modify.md) ++ [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) \ No newline at end of file diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 69224558..77a2ee39 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -51,6 +51,7 @@ For services that generate a queue or data stream, you create an [event source m **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) ++ [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) + [Amazon Simple Queue Service](with-sqs.md) diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index df76d38b..e61f0096 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -4,7 +4,7 @@ When a Lambda function is invoked, the Lambda handler invokes the PowerShell scr When the PowerShell script is invoked, the following variables are predefined: + *$LambdaInput* – A PSObject that contains the input to the handler\. This input can be event data \(published by an event source\) or custom input that you provide, such as a string or any custom data object\. -+ *$LambdaContext* – An Amazon\.Lambda\.Core\.ILambdaContext object that you can use to access information about the current execution—such as the name of the current function, the memory limit, execution time remaining, and logging\. ++ *$LambdaContext* – An Amazon\.Lambda\.Core\.ILambdaContext object that you can use to access information about the current invocation—such as the name of the current function, the memory limit, execution time remaining, and logging\. For example, consider the following PowerShell example code\. diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 86efee75..09755f98 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -4,8 +4,10 @@ A deployment package is a ZIP archive that contains your function code and depen If you use the Lambda [console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. +You can also use the AWS SAM CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS SAM Developer Guide*\. + **Note** -You can use the AWS SAM CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. See [Building applications with dependencies](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the AWS SAM Developer Guide for instructions\. +We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. **Topics** + [Prerequisites](#python-package-prereqs) @@ -15,7 +17,7 @@ You can use the AWS SAM CLI `build` command to create a deployment package for y ## Prerequisites -These instructions assume that you already have a function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. +These instructions assume that you have already created a Lambda function and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: @@ -30,23 +32,22 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Updating a function with no dependencies -To create or update a function with the Lambda API, create an archive that contains your function code and upload it with the AWS CLI\. +To create or update a function with the Lambda API, create an deployment package that contains your function code and upload it with the AWS CLI\. **To update a Python function with no dependencies** -1. Create a ZIP archive\. +1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip function.zip lambda_function.py - adding: lambda_function.py (deflated 17%) + ~/my-function$ zip my-deployment-package.zip lambda_function.py ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", @@ -63,52 +64,54 @@ To create or update a function with the Lambda API, create an archive that conta If your function depends on libraries other than the SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. -**Note** -For libraries that use extension modules written in C or C\+\+, build your deployment package in an Amazon Linux environment\. You can use the [SAM CLI build command](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html), which uses Docker, or build your deployment package on Amazon EC2 or CodeBuild\. +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. The steps assume you are not using a virtual environment\. -The following example shows how to create a deployment package that includes a common graphics library named Pillow\. +**Note** +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. **To update a Python function with dependencies** -1. Install libraries in a new, project\-local `package` directory with `pip`'s `--target` option\. +1. Install libraries in a `package` directory with `pip`'s `--target` option\. ``` - ~/my-function$ pip install --target ./package Pillow - Collecting Pillow - Using cached https://files.pythonhosted.org/packages/62/8c/230204b8e968f6db00c765624f51cfd1ecb6aea57b25ba00b240ee3fb0bd/Pillow-5.3.0-cp37-cp37m-manylinux1_x86_64.whl - Installing collected packages: Pillow - Successfully installed Pillow-5.3.0 + ~/my-function$ pip install --target ./package requests ``` **Note** -In order for `--target` to work on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) like Ubuntu, you may also need to pass the `--system` flag to prevent `distutils` errors\. +You may need to pass the `--system` option on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) like Ubuntu to prevent `distutils` errors\. -1. Create a ZIP archive of the dependencies\. +1. Create a deployment package with the installed libraries at the root\. ``` ~/my-function$ cd package - ~/my-function/package$ zip -r9 ${OLDPWD}/function.zip . - adding: PIL/ (stored 0%) - adding: PIL/.libs/ (stored 0%) - adding: PIL/.libs/libfreetype-7ce95de6.so.6.16.1 (deflated 65%) - adding: PIL/.libs/libjpeg-3fe7dfc0.so.9.3.0 (deflated 72%) - adding: PIL/.libs/liblcms2-a6801db4.so.2.0.8 (deflated 67%) - ... + ~/my-function/package$ zip -r my-deployment-package.zip ./* ``` -1. Add your function code to the archive\. +1. Add function code files to the root of your deployment package\. ``` - ~/my-function/package$ cd $OLDPWD - ~/my-function$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 56%) + ~/my-function/package$ cd .. + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", @@ -123,79 +126,74 @@ In order for `--target` to work on [Debian\-based systems](https://github.com/py ## With a virtual environment -In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest/) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. +In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. + +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. + +**Note** +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. **To update a Python function with a virtual environment** 1. Create a virtual environment\. ``` - ~/my-function$ virtualenv v-env - Using base prefix '~/.local/python-3.7.0' - New python executable in v-env/bin/python3.8 - Also creating executable in v-env/bin/python - Installing setuptools, pip, wheel... - done. - ``` -**Note** -For Python 3\.3 and newer, you can use the built\-in [venv module](https://docs.python.org/3/library/venv.html) to create a virtual environment, instead of installing `virtualenv`\. - - ``` - ~/my-function$ python3 -m venv v-env + ~/my-function$ virtualenv myvenv ``` 1. Activate the environment\. ``` - ~/my-function$ source v-env/bin/activate - (v-env) ~/my-function$ + ~/my-function$ source myvenv/bin/activate ``` 1. Install libraries with pip\. ``` - (v-env) ~/my-function$ pip install Pillow - Collecting Pillow - Using cached https://files.pythonhosted.org/packages/62/8c/230204b8e968f6db00c765624f51cfd1ecb6aea57b25ba00b240ee3fb0bd/Pillow-5.3.0-cp37-cp37m-manylinux1_x86_64.whl - Installing collected packages: Pillow - Successfully installed Pillow-5.3.0 + (myvenv) ~/my-function$ pip install requests ``` 1. Deactivate the virtual environment\. ``` - (v-env) ~/my-function$ deactivate + (myvenv) ~/my-function$ deactivate ``` -1. Create a ZIP archive with the contents of the library\. +1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd v-env/lib/python3.8/site-packages - ~/my-function/v-env/lib/python3.8/site-packages$ zip -r9 ${OLDPWD}/function.zip . - adding: easy_install.py (deflated 17%) - adding: PIL/ (stored 0%) - adding: PIL/.libs/ (stored 0%) - adding: PIL/.libs/libfreetype-7ce95de6.so.6.16.1 (deflated 65%) - adding: PIL/.libs/libjpeg-3fe7dfc0.so.9.3.0 (deflated 72%) - ... + ~/my-function$ cd myvenv/lib/python3.8/site-packages + ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r my-deployment-package.zip . ``` +**Note** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. - Depending on the library, dependencies may appear in either `site-packages` or `dist-packages`, and the first folder in the virtual environment may be `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` -1. Add your function code to the archive\. + After you complete this step, you should have the following directory structure: ``` - ~/my-function/v-env/lib/python3.8/site-packages$ cd $OLDPWD - ~/my-function$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 56%) + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... ``` 1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { - "FunctionName": "my-function", + "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 46caed3f..fe6930e0 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -2,9 +2,9 @@ Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](using-extensions.md) associated with your function\. -The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. +The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. -![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Extensions-Concept-Diagram.png) +![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 447b47d6..cca60934 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -78,9 +78,7 @@ The `Invoke` phase ends after the runtime and all extensions signal that they ar **Event payload**: -The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time remaining, the `RequestId`, the invoked function ARN, and tracing headers\. - -The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time remaining, the `RequestId`, the invoked function ARN, and tracing headers\. +The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function ARN, and tracing headers\. Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. @@ -135,7 +133,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t { "eventType": "SHUTDOWN", "shutdownReason": "reason for shutdown", - "deadlineMs": "time remaining in milliseconds" + "deadlineMs": "the time and date that the function times out in Unix time milliseconds" } ``` @@ -222,10 +220,18 @@ Internal extensions are started and stopped by the runtime process, so they are + 403 – Forbidden + 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. -**Example response** +**Example request body** + +``` +{ + 'events': [ 'INVOKE', 'SHUTDOWN'] +} +``` + +**Example response body** ``` - { +{ "functionName": "helloWorld", "functionVersion": "$LATEST", "handler": "lambda_function.lambda_handler" diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md new file mode 100644 index 00000000..c3fad683 --- /dev/null +++ b/doc_source/runtimes-logs-api.md @@ -0,0 +1,279 @@ +# AWS Lambda Logs API + +Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. + +[Lambda extensions](runtimes-extensions-api.md) can use the Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda [execution environment](runtimes-context.md)\. Lambda streams the logs to the extension, and the extension can then process, filter, and send the logs to any preferred destination\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) + +The Logs API allows extensions to subscribe to three different logs streams: ++ Function logs that the Lambda function generates and writes to `stdout` or `stderr`\. ++ Lambda platform logs, such as the START, END, and REPORT logs\. ++ Extension logs that extension code generates\. + +**Note** +Lambda sends all logs to CloudWatch, even when an extension subscribes to one or more of the log streams\. + +**Topics** ++ [Subscribing to receive logs](#runtimes-logs-api-subscribing) ++ [Destination protocols](#runtimes-logs-api-dest) ++ [Buffering configuration](#runtimes-logs-api-buffering) ++ [Example subscription](#runtimes-logs-api-subs-example) ++ [Example log messages](#runtimes-logs-api-examples) ++ [Sample code for Logs API](#runtimes-logs-api-samples) ++ [Logs API reference](#runtimes-logs-api-ref) + +## Subscribing to receive logs + +A Lambda extension can subscribe to receive logs by sending a subscription request to the Logs API\. + +To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase is complete, Lambda does not process subscription requests\. + +**Note** +Logs API subscription is idempotent\. Duplicate subscribe requests do not result in duplicate subscriptions\. + +Memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store the logs\. To help optimize memory usage, you can adjust the [buffering configuration](#runtimes-logs-api-buffering)\. Buffer memory usage counts towards overall memory consumption in the execution environment\. + +## Destination protocols + +You can choose one of the following protocols to receive the logs: + +1. **HTTP** \(recommended\) – Logs are delivered to a local HTTP endpoint \(`http://sandbox:${PORT}/${PATH}`\) as an array of records in JSON format\. The $PATH parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. + +1. **TCP** – Logs are delivered to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. + +We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge that logs are delivered to the application layer\. Therefore, you may lose logs if your extension crashes\. HTTP does not share this limitation\. Also, in a TCP connection, you can unintentionally partition the NDJSON record incorrectly and corrupt the format\. If you choose to use TCP, wait until a newline arrives before flushing a record\. + +We also recommend setting up the local HTTP listener or the TCP port before subscribing to receive logs\. During setup, note the following: ++ Lambda sends logs only to destinations that are inside the execution environment\. ++ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in error\. If the log subscriber crashes, it will continue to receive logs after Lambda restarts the execution environment\. ++ Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. + +## Buffering configuration + +Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Lambda uses the default value for any field that you do not specify: ++ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 100\. Maximum: 30000\. ++ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262144\. Minimum: 262144\. Maximum: 1048576\. ++ **maxItems** – The maximum number of events to buffer in memory\. Default: 10000\. Minimum: 1000\. Maximum: 10000\. + +During buffering configuration, note the following points: ++ Lambda flushes the logs if any of the input streams are closed, for example, if the runtime crashes\. ++ Each subscriber can specify a different buffering configuration during the subscription request\. ++ Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2*maxBytes+metadata`, where `maxBytes` is configured in the subscribe request\. For example, Lambda adds the following metadata bytes to each record: + + ``` + { + "time": "2020-08-20T12:31:32.123Z", + "type": "function", + "record": "Hello World" + } + ``` ++ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda injects a `platform.logsDropped` record\. + +## Example subscription + +The following example shows a request to subscribe to the platform and function logs\. + +``` +POST http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe HTTP/1.1 +{"types": [ + "platform", + "function" + ], + "buffering": { + "maxItems": 1000, + "maxBytes": 10240, + "timeoutMs": 100 + } + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox:8080/lambda_logs" + } +} +``` + +If the request succeeds, the subscriber receives an HTTP 200 success response\. + +``` +HTTP/1.1 200 OK +"OK" +``` + +## Example log messages + +The following example shows platform start, end, and report logs\. + +``` + { + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.start", + "record": { + "requestId": "6f7f0961f83442118a7af6fe80b88d56" + } +} +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.end", + "record": { + "requestId": "6f7f0961f83442118a7af6fe80b88d56" + } +} +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.report", + "record": { + "requestId": "6f7f0961f83442118a7af6fe80b88d56", + "metrics": { + "durationMs": 101.51, + "billedDurationMs": 300, + "memorySizeMB": 512, + "maxMemoryUsedMB": 33, + "initDurationMs": 116.67 + } + } +} +``` + +The platform log captures runtime or execution environment errors\. The following example shows a platform fault log message\. + +``` +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.fault", + "record": "RequestId: d783b35e-a91d-4251-af17-035953428a2c Process exited before completing request" +} +``` + +The following example shows an Extensions API registration log message\. + +``` +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.extension", + "record": { + "name": "Foo.bar", + "state": "Ready", + "events": ["INVOKE", "SHUTDOWN"] + } +} +``` + +The following example shows a Logs API subscription log message\. + +``` +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.logsSubscription", + "record": { + "name": "Foo.bar", + "state": "Subscribed", + "types": ["function", "platform"], + } +} +``` + +The following example shows a `platform.logsDropped` log message\. + +``` +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "platform.logsDropped", + "record": { + "reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", + "droppedRecords": 123, + "droppedBytes" 12345 + } +} +``` + +The following example shows a function log message\. + +``` +{ + "time": "2020-08-20T12:31:32.123Z", + "type": "function", + "record": "ERROR something happened. Stack trace:\n\tfoo (line 10)\n" +} +``` + +## Sample code for Logs API + +The [ compute blog post entry](https://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations) for Logs API includes sample code showing how to send logs to a custom destination\. + +Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws-lambda-extensions) showing how to develop a basic extension and subscribe to the Logs API\. For more information about building a Lambda extension, see [AWS Lambda Extensions API](runtimes-extensions-api.md)\. + +## Logs API reference + +You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: + +``` +http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe +``` + +### Subscribe + +To subscribe to one or more of the log streams that are available in the Lambda execution environment, extensions send a Subscribe API request\. + +The OpenAPI specification for the Logs API subscription request, version **2020\-08\-15**, is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) + +**Path** – `/logs/subscribe` + +**Method** – **PUT** + +**Body parameters** + +`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. + +`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. + +`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. + +**Response parameters** + +The OpenAPI specifications for the subscription responses, version **2020\-08\-15**, are available for HTTP and TCP: ++ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) ++ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) + +**Response codes** ++ 200 – Request completed successfully ++ 202 – Request accepted\. Response to a subscription request during local testing\. ++ 4XX – Bad Request ++ 500 – Service error + +**Example subscription request** + +``` + POST http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe HTTP/1.1 + { + "types": [ + "platform", + "function" + ], + "buffering": { + "maxItems": 1000, + "maxBytes": 10240, + "timeoutMs": 100 + } + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox:8080/lambda_logs" + } +} +``` + +If the request succeeds, the subscriber receives an HTTP 200 success response\. + +``` +HTTP/1.1 200 OK +"OK" +``` + +If the request fails, the subscriber receives an error response\. + +``` +HTTP/1.1 400 OK +{ + "errorType": "Logs.ValidationError", + "errorMessage": URI port is not provided; types should not be empty" +} +``` \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index ea029e5d..fa2d1ad0 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -1,8 +1,8 @@ # Data protection in AWS Lambda -AWS Lambda conforms to the AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/), which includes regulations and guidelines for data protection\. AWS is responsible for protecting the global infrastructure that runs all the AWS services\. AWS maintains control over data hosted on this infrastructure, including the security configuration controls for handling customer content and personal data\. AWS customers and APN partners, acting either as data controllers or data processors, are responsible for any personal data that they put in the AWS Cloud\. +The AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/) applies to data protection in AWS Lambda\. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud\. You are responsible for maintaining control over your content that is hosted on this infrastructure\. This content includes the security configuration and management tasks for the AWS services that you use\. For more information about data privacy, see the [Data Privacy FAQ](http://aws.amazon.com/compliance/data-privacy-faq)\. For information about data protection in Europe, see the [AWS Shared Responsibility Model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\. -For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\), so that each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: +For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\)\. That way each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: + Use multi\-factor authentication \(MFA\) with each account\. + Use SSL/TLS to communicate with AWS resources\. We recommend TLS 1\.2 or later\. + Set up API and user activity logging with AWS CloudTrail\. @@ -10,9 +10,7 @@ For data protection purposes, we recommend that you protect AWS account credenti + Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. + If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. -We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields or metadata such as function names and tags\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into metadata might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. - -For more information about data protection, see the [AWS shared responsibility model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\. +We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into Lambda or other services might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. **Topics** + [Encryption in transit](#security-privacy-intransit) diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index b277ed66..2f776eab 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -12,7 +12,7 @@ AWS Identity and Access Management \(IAM\) is an AWS service that helps an admin ## Audience -How you use AWS Identity and Access Management \(IAM\) differs, depending on the work you do in Lambda\. +How you use AWS Identity and Access Management \(IAM\) differs, depending on the work that you do in Lambda\. **Service user** – If you use the Lambda service to do your job, then your administrator provides you with the credentials and permissions that you need\. As you use more Lambda features to do your work, you might need additional permissions\. Understanding how access is managed can help you request the right permissions from your administrator\. If you cannot access a feature in Lambda, see [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md)\. @@ -22,13 +22,13 @@ How you use AWS Identity and Access Management \(IAM\) differs, depending on the ## Authenticating with identities -Authentication is how you sign in to AWS using your identity credentials\. For more information about signing in using the AWS Management Console, see [The IAM Console and Sign\-in Page](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html) in the *IAM User Guide*\. +Authentication is how you sign in to AWS using your identity credentials\. For more information about signing in using the AWS Management Console, see [Signing in to the AWS Management Console as an IAM user or root user](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html) in the *IAM User Guide*\. -You must be *authenticated* \(signed in to AWS\) as the AWS account root user, an IAM user, or by assuming an IAM role\. You can also use your company's single sign\-on authentication, or even sign in using Google or Facebook\. In these cases, your administrator previously set up identity federation using IAM roles\. When you access AWS using credentials from another company, you are assuming a role indirectly\. +You must be *authenticated* \(signed in to AWS\) as the AWS account root user, an IAM user, or by assuming an IAM role\. You can also use your company's single sign\-on authentication or even sign in using Google or Facebook\. In these cases, your administrator previously set up identity federation using IAM roles\. When you access AWS using credentials from another company, you are assuming a role indirectly\. -To sign in directly to the [AWS Management Console](https://console.aws.amazon.com/), use your password with your root user email or your IAM user name\. You can access AWS programmatically using your root user or IAM user access keys\. AWS provides SDK and command line tools to cryptographically sign your request using your credentials\. If you don’t use AWS tools, you must sign the request yourself\. Do this using *Signature Version 4*, a protocol for authenticating inbound API requests\. For more information about authenticating requests, see [Signature Version 4 Signing Process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *AWS General Reference*\. +To sign in directly to the [AWS Management Console](https://console.aws.amazon.com/), use your password with your root user email address or your IAM user name\. You can access AWS programmatically using your root user or IAM users access keys\. AWS provides SDK and command line tools to cryptographically sign your request using your credentials\. If you don't use AWS tools, you must sign the request yourself\. Do this using *Signature Version 4*, a protocol for authenticating inbound API requests\. For more information about authenticating requests, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *AWS General Reference*\. -Regardless of the authentication method that you use, you might also be required to provide additional security information\. For example, AWS recommends that you use multi\-factor authentication \(MFA\) to increase the security of your account\. To learn more, see [Using Multi\-Factor Authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. +Regardless of the authentication method that you use, you might also be required to provide additional security information\. For example, AWS recommends that you use multi\-factor authentication \(MFA\) to increase the security of your account\. To learn more, see [Using multi\-factor authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. ### AWS account root user @@ -36,54 +36,63 @@ Regardless of the authentication method that you use, you might also be required ### IAM users and groups -An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity within your AWS account that has specific permissions for a single person or application\. An IAM user can have long\-term credentials such as a user name and password or a set of access keys\. To learn how to generate access keys, see [Managing Access Keys for IAM Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) in the *IAM User Guide*\. When you generate access keys for an IAM user, make sure you view and securely save the key pair\. You cannot recover the secret access key in the future\. Instead, you must generate a new access key pair\. +An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity within your AWS account that has specific permissions for a single person or application\. An IAM user can have long\-term credentials such as a user name and password or a set of access keys\. To learn how to generate access keys, see [Managing access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) in the *IAM User Guide*\. When you generate access keys for an IAM user, make sure you view and securely save the key pair\. You cannot recover the secret access key in the future\. Instead, you must generate a new access key pair\. An [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) is an identity that specifies a collection of IAM users\. You can't sign in as a group\. You can use groups to specify permissions for multiple users at a time\. Groups make permissions easier to manage for large sets of users\. For example, you could have a group named *IAMAdmins* and give that group permissions to administer IAM resources\. -Users are different from roles\. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it\. Users have permanent long\-term credentials, but roles provide temporary credentials\. To learn more, see [When to Create an IAM User \(Instead of a Role\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose) in the *IAM User Guide*\. +Users are different from roles\. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it\. Users have permanent long\-term credentials, but roles provide temporary credentials\. To learn more, see [When to create an IAM user \(instead of a role\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose) in the *IAM User Guide*\. ### IAM roles -An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity within your AWS account that has specific permissions\. It is similar to an IAM user, but is not associated with a specific person\. You can temporarily assume an IAM role in the AWS Management Console by [switching roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. You can assume a role by calling an AWS CLI or AWS API operation or by using a custom URL\. For more information about methods for using roles, see [Using IAM Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*\. +An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity within your AWS account that has specific permissions\. It is similar to an IAM user, but is not associated with a specific person\. You can temporarily assume an IAM role in the AWS Management Console by [switching roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. You can assume a role by calling an AWS CLI or AWS API operation or by using a custom URL\. For more information about methods for using roles, see [Using IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*\. IAM roles with temporary credentials are useful in the following situations: + **Temporary IAM user permissions** – An IAM user can assume an IAM role to temporarily take on different permissions for a specific task\. -+ **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, or a web identity provider\. These are known as *federated users*\. AWS assigns a role to a federated user when access is requested through an [identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)\. For more information about federated users, see [Federated Users and Roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html#intro-access-roles) in the *IAM User Guide*\. -+ **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM Roles Differ from Resource\-based Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. -+ **AWS service access** – A service role is an IAM role that a service assumes to perform actions in your account on your behalf\. When you set up some AWS service environments, you must define a role for the service to assume\. This service role must include all the permissions that are required for the service to access the AWS resources that it needs\. Service roles vary from service to service, but many allow you to choose your permissions as long as you meet the documented requirements for that service\. Service roles provide access only within your account and cannot be used to grant access to services in other accounts\. You can create, modify, and delete a service role from within IAM\. For example, you can create a role that allows Amazon Redshift to access an Amazon S3 bucket on your behalf and then load data from that bucket into an Amazon Redshift cluster\. For more information, see [Creating a Role to Delegate Permissions to an AWS Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. -+ **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. ++ **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, or a web identity provider\. These are known as *federated users*\. AWS assigns a role to a federated user when access is requested through an [identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)\. For more information about federated users, see [Federated users and roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html#intro-access-roles) in the *IAM User Guide*\. ++ **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. ++ **Cross\-service access** – Some AWS services use features in other AWS services\. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3\. A service might do this using the calling principal's permissions, using a service role, or using a service\-linked role\. + + **Principal permissions** – When you use an IAM user or role to perform actions in AWS, you are considered a principal\. Policies grant permissions to a principal\. When you use some services, you might perform an action that then triggers another action in a different service\. In this case, you must have permissions to perform both actions\. To see whether an action requires additional dependent actions in a policy, see [Actions, Resources, and Condition Keys for AWS Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) in the *Service Authorization Reference*\. + + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. Service roles provide access only within your account and cannot be used to grant access to services in other accounts\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + + **Service\-linked role** – A service\-linked role is a type of service role that is linked to an AWS service\. The service can assume the role to perform an action on your behalf\. Service\-linked roles appear in your IAM account and are owned by the service\. An IAM administrator can view, but not edit the permissions for service\-linked roles\. ++ **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM role to grant permissions to applications running on Amazon EC2 instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. -To learn whether to use IAM roles, see [When to Create an IAM Role \(Instead of a User\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose_role) in the *IAM User Guide*\. +To learn whether to use IAM roles or IAM users, see [When to create an IAM role \(instead of a user\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose_role) in the *IAM User Guide*\. ## Managing access using policies -You control access in AWS by creating policies and attaching them to IAM identities or AWS resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. AWS evaluates these policies when an entity \(root user, IAM user, or IAM role\) makes a request\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. +You control access in AWS by creating policies and attaching them to IAM identities or AWS resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. You can sign in as the root user or an IAM user, or you can assume an IAM role\. When you then make a request, AWS evaluates the related identity\-based or resource\-based policies\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. -An IAM administrator can use policies to specify who has access to AWS resources, and what actions they can perform on those resources\. Every IAM entity \(user or role\) starts with no permissions\. In other words, by default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. +Administrators can use AWS JSON policies to specify who has access to what\. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**\. + +Every IAM entity \(user or role\) starts with no permissions\. In other words, by default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. IAM policies define permissions for an action regardless of the method that you use to perform the operation\. For example, suppose that you have a policy that allows the `iam:GetRole` action\. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API\. ### Identity\-based policies -Identity\-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, role, or group\. These policies control what actions that identity can perform, on which resources, and under what conditions\. To learn how to create an identity\-based policy, see [Creating IAM Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*\. +Identity\-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role\. These policies control what actions users and roles can perform, on which resources, and under what conditions\. To learn how to create an identity\-based policy, see [Creating IAM policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*\. -Identity\-based policies can be further categorized as *inline policies* or *managed policies*\. Inline policies are embedded directly into a single user, group, or role\. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account\. Managed policies include AWS managed policies and customer managed policies\. To learn how to choose between a managed policy or an inline policy, see [Choosing Between Managed Policies and Inline Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#choosing-managed-or-inline) in the *IAM User Guide*\. +Identity\-based policies can be further categorized as *inline policies* or *managed policies*\. Inline policies are embedded directly into a single user, group, or role\. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account\. Managed policies include AWS managed policies and customer managed policies\. To learn how to choose between a managed policy or an inline policy, see [Choosing between managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#choosing-managed-or-inline) in the *IAM User Guide*\. ### Resource\-based policies -Resource\-based policies are JSON policy documents that you attach to a resource such as an Amazon S3 bucket\. Service administrators can use these policies to define what actions a specified principal \(account member, user, or role\) can perform on that resource and under what conditions\. Resource\-based policies are inline policies\. There are no managed resource\-based policies\. +Resource\-based policies are JSON policy documents that you attach to a resource\. Examples of resource\-based policies are IAM *role trust policies* and Amazon S3 *bucket policies*\. In services that support resource\-based policies, service administrators can use them to control access to a specific resource\. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions\. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource\-based policy\. Principals can include accounts, users, roles, federated users, or AWS services\. + +Resource\-based policies are inline policies that are located in that service\. You can't use AWS managed policies from IAM in a resource\-based policy\. ### Access control lists \(ACLs\) -Access control lists \(ACLs\) are a type of policy that controls which principals \(account members, users, or roles\) have permissions to access a resource\. ACLs are similar to resource\-based policies, although they do not use the JSON policy document format\. Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs\. To learn more about ACLs, see [Access Control List \(ACL\) Overview](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) in the *Amazon Simple Storage Service Developer Guide*\. +Access control lists \(ACLs\) control which principals \(account members, users, or roles\) have permissions to access a resource\. ACLs are similar to resource\-based policies, although they do not use the JSON policy document format\. + +Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs\. To learn more about ACLs, see [Access control list \(ACL\) overview](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) in the *Amazon Simple Storage Service Developer Guide*\. ### Other policy types AWS supports additional, less\-common policy types\. These policy types can set the maximum permissions granted to you by the more common policy types\. -+ **Permissions boundaries** – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity\-based policy can grant to an IAM entity \(IAM user or role\)\. You can set a permissions boundary for an entity\. The resulting permissions are the intersection of entity's identity\-based policies and its permissions boundaries\. Resource\-based policies that specify the user or role in the `Principal` field are not limited by the permissions boundary\. An explicit deny in any of these policies overrides the allow\. For more information about permissions boundaries, see [Permissions Boundaries for IAM Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*\. -+ **Service control policies \(SCPs\)** – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit \(OU\) in AWS Organizations\. AWS Organizations is a service for grouping and centrally managing multiple AWS accounts that your business owns\. If you enable all features in an organization, then you can apply service control policies \(SCPs\) to any or all of your accounts\. The SCP limits permissions for entities in member accounts, including each AWS account root user\. For more information about Organizations and SCPs, see [How SCPs Work](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html) in the *AWS Organizations User Guide*\. -+ **Session policies** – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user\. The resulting session's permissions are the intersection of the user or role's identity\-based policies and the session policies\. Permissions can also come from a resource\-based policy\. An explicit deny in any of these policies overrides the allow\. For more information, see [Session Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*\. ++ **Permissions boundaries** – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity\-based policy can grant to an IAM entity \(IAM user or role\)\. You can set a permissions boundary for an entity\. The resulting permissions are the intersection of entity's identity\-based policies and its permissions boundaries\. Resource\-based policies that specify the user or role in the `Principal` field are not limited by the permissions boundary\. An explicit deny in any of these policies overrides the allow\. For more information about permissions boundaries, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*\. ++ **Service control policies \(SCPs\)** – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit \(OU\) in AWS Organizations\. AWS Organizations is a service for grouping and centrally managing multiple AWS accounts that your business owns\. If you enable all features in an organization, then you can apply service control policies \(SCPs\) to any or all of your accounts\. The SCP limits permissions for entities in member accounts, including each AWS account root user\. For more information about Organizations and SCPs, see [How SCPs work](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html) in the *AWS Organizations User Guide*\. ++ **Session policies** – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user\. The resulting session's permissions are the intersection of the user or role's identity\-based policies and the session policies\. Permissions can also come from a resource\-based policy\. An explicit deny in any of these policies overrides the allow\. For more information, see [Session policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*\. ### Multiple policy types -When multiple types of policies apply to a request, the resulting permissions are more complicated to understand\. To learn how AWS determines whether to allow a request when multiple policy types are involved, see [Policy Evaluation Logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) in the *IAM User Guide*\. \ No newline at end of file +When multiple types of policies apply to a request, the resulting permissions are more complicated to understand\. To learn how AWS determines whether to allow a request when multiple policy types are involved, see [Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md index 8158f7b6..413ea770 100644 --- a/doc_source/security_iam_id-based-policy-examples.md +++ b/doc_source/security_iam_id-based-policy-examples.md @@ -12,10 +12,10 @@ To learn how to create an IAM identity\-based policy using these example JSON po ## Policy best practices Identity\-based policies are very powerful\. They determine whether someone can create, access, or delete Lambda resources in your account\. These actions can incur costs for your AWS account\. When you create or edit identity\-based policies, follow these guidelines and recommendations: -+ **Get Started Using AWS Managed Policies** – To start using Lambda quickly, use AWS managed policies to give your employees the permissions they need\. These policies are already available in your account and are maintained and updated by AWS\. For more information, see [Get Started Using Permissions With AWS Managed Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-use-aws-defined-policies) in the *IAM User Guide*\. -+ **Grant Least Privilege** – When you create custom policies, grant only the permissions required to perform a task\. Start with a minimum set of permissions and grant additional permissions as necessary\. Doing so is more secure than starting with permissions that are too lenient and then trying to tighten them later\. For more information, see [Grant Least Privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) in the *IAM User Guide*\. -+ **Enable MFA for Sensitive Operations** – For extra security, require IAM users to use multi\-factor authentication \(MFA\) to access sensitive resources or API operations\. For more information, see [Using Multi\-Factor Authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. -+ **Use Policy Conditions for Extra Security** – To the extent that it's practical, define the conditions under which your identity\-based policies allow access to a resource\. For example, you can write conditions to specify a range of allowable IP addresses that a request must come from\. You can also write conditions to allow requests only within a specified date or time range, or to require the use of SSL or MFA\. For more information, see [IAM JSON Policy Elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. ++ **Get started using AWS managed policies** – To start using Lambda quickly, use AWS managed policies to give your employees the permissions they need\. These policies are already available in your account and are maintained and updated by AWS\. For more information, see [Get started using permissions with AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-use-aws-defined-policies) in the *IAM User Guide*\. ++ **Grant least privilege** – When you create custom policies, grant only the permissions required to perform a task\. Start with a minimum set of permissions and grant additional permissions as necessary\. Doing so is more secure than starting with permissions that are too lenient and then trying to tighten them later\. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) in the *IAM User Guide*\. ++ **Enable MFA for sensitive operations** – For extra security, require IAM users to use multi\-factor authentication \(MFA\) to access sensitive resources or API operations\. For more information, see [Using multi\-factor authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. ++ **Use policy conditions for extra security** – To the extent that it's practical, define the conditions under which your identity\-based policies allow access to a resource\. For example, you can write conditions to specify a range of allowable IP addresses that a request must come from\. You can also write conditions to allow requests only within a specified date or time range, or to require the use of SSL or MFA\. For more information, see [IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. ## Using the Lambda console diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index c0539d71..57899272 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -44,13 +44,13 @@ Access keys consist of two parts: an access key ID \(for example, `AKIAIOSFODNN7 **Important** Do not provide your access keys to a third party, even to help [find your canonical user ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId)\. By doing this, you might give someone permanent access to your account\. -When you create an access key pair, you are prompted to save the access key ID and secret access key in a secure location\. The secret access key is available only at the time you create it\. If you lose your secret access key, you must add new access keys to your IAM user\. You can have a maximum of two access keys\. If you already have two, you must delete one key pair before creating a new one\. To view instructions, see [Managing Access Keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) in the *IAM User Guide*\. +When you create an access key pair, you are prompted to save the access key ID and secret access key in a secure location\. The secret access key is available only at the time you create it\. If you lose your secret access key, you must add new access keys to your IAM user\. You can have a maximum of two access keys\. If you already have two, you must delete one key pair before creating a new one\. To view instructions, see [Managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) in the *IAM User Guide*\. ## I'm an administrator and want to allow others to access Lambda To allow others to access Lambda, you must create an IAM entity \(user or role\) for the person or application that needs access\. They will use the credentials for that entity to access AWS\. You must then attach a policy to the entity that grants them the correct permissions in Lambda\. -To get started right away, see [Creating Your First IAM Delegated User and Group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. +To get started right away, see [Creating your first IAM delegated user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. ## I want to allow people outside of my AWS account to access my Lambda resources @@ -58,7 +58,7 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. -+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing Access to an IAM User in Another AWS Account That You Own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing Access to AWS Accounts Owned by Third Parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. -+ To learn how to provide access through identity federation, see [Providing Access to Externally Authenticated Users \(Identity Federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. -+ To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM Roles Differ from Resource\-based Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file ++ To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. ++ To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 30e5389d..29120a14 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -146,7 +146,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index aae2f4a5..9f538acb 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -160,7 +160,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md new file mode 100644 index 00000000..aeebd22b --- /dev/null +++ b/doc_source/with-mq.md @@ -0,0 +1,225 @@ +# Using Lambda with Amazon MQ + +Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. Lambda only supports Apache ActiveMQ\. A *message broker* allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. + +Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ brokers and by providing different network topologies and other infrastructure needs\. + +You can use a Lambda function to process records from your Amazon MQ message broker\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. + +The Amazon MQ event source mapping has the following configuration restrictions: ++ Authentication – Only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. User credentials associated with the broker are the only method of connection\. For more information about authentication, see [Messaging Authentication and Authorization for ActiveMQ](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. ++ Connection quota – Brokers have a maximum number of allowed connections per wire\-level protocol\. This quota is based on the broker instance type\. For more information, see the [Brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html#broker-limits) section of **Quotas in Amazon MQ** in the *Amazon MQ Developer Guide*\. ++ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to interact with the records\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. ++ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website\. ++ Network topology – Only one single\-instance or standby broker is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Amazon MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) in the *Amazon MQ Developer Guide*\. ++ Protocols – Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. + +Lambda automatically supports the latest versions of ActiveMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ Release Notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. + +**Note** +By default, Amazon MQ has a weekly maintenance window for brokers\. During that window of time, brokers are unavailable\. For brokers without standby, Lambda cannot process any messages during that window\. + +**Topics** ++ [Lambda consumer group](#services-mq-configure) ++ [Execution role permissions](#events-mq-permissions) ++ [Configuring a broker as an event source](#services-mq-eventsourcemapping) ++ [Event source mapping API](#services-mq-api) ++ [Event source mapping errors](#services-mq-errors) + +## Lambda consumer group + +To interact with Amazon MQ, Lambda creates a consumer group which can read from your Amazon MQ brokers\. The consumer group is created with the same ID as the event source mapping UUID\. + +Lambda will pull messages until it has processed a maximum of 6 MB, until timeout, or until the batch size is fulfilled\. When configured, batch size determines the maximum number of items to retrieve in a single batch\. Your batch is converted into a Lambda payload, and your target function is invoked\. Messages are neither persisted nor deserialized\. Instead, they are retrieved by the consumer group as a BLOB of bytes and are base64\-encoded for a JSON payload\. + +**Note** +The maximum function invocation time is 14 minutes\. + +Lambda processes all incoming batches concurrently and automatically scales the concurrency to meet demands\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. + +**Example Amazon MQ record event** + +``` +{ + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": { [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] + } +} +``` + +## Execution role permissions + +To read records from an Amazon MQ broker, your Lambda function needs the following permissions added to its [execution role](lambda-intro-execution-role.md): ++ [mq:DescribeBroker](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers-broker-id.html#brokers-broker-id-http-methods) ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) + +The AWS managed policy `AWSLambdaMQExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. + +**Note** +When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. + +## Configuring a broker as an event source + +Create an [event source mapping](invocation-eventsourcemapping.md) to tell Lambda to send records from an Amazon MQ broker to a Lambda function\. You can create multiple event source mappings to process the same data with multiple functions, or to process items from multiple sources with a single function\. + +To configure your function to read from Amazon MQ, create an **MQ** trigger in the Lambda console\. + +**To create a trigger** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Under **Designer**, choose **Add trigger**\. + +1. Choose a trigger type\. + +1. Configure the required options and then choose **Add**\. + +Lambda supports the following options for Amazon MQ event sources: ++ **MQ broker** – Select an Amazon MQ broker\. ++ **Batch size** – Set the maximum number of messages to retrieve in a single batch\. ++ **Queue name** – Enter the Amazon MQ queue to consume\. ++ **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. ++ **Enable trigger** – Disable the trigger to stop processing records\. + +To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API operations\. + +## Event source mapping API + +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. + +By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. + +For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon VPC access requirements, you can do one of the following: ++ Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. ++ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS STS and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. + +The Amazon Virtual Private Cloud \(Amazon VPC\) security group rules that you configure should have the following settings at minimum: ++ Inbound rules – For a broker without public accessibility, allow all traffic on all ports for the security group that's specified as your source\. For a broker with public accessibility, allow all traffic on all ports for all destinations\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + +The Amazon VPC configuration is discoverable through the [Amazon MQ API](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/resources.html) and does not need to be configured in the `create-event-source-mapping` setup\. + +The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. + +``` +$ aws lambda create-event-source-mapping \ +--event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ +--function-name MQ-Example-Function \ +--source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ +--queues ExampleQueue +{ + "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", + "BatchSize": 100, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601927898.741, + "LastProcessingResult": "No records processed", + "State": "Creating", + "StateTransitionReason": "USER_INITIATED", + "Queues": [ + "ExampleQueue" + ], + "SourceAccessConfigurations": [ + { + "Type": "BASIC_AUTH", + "URI": "arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt" + } + ] +} +``` + +Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. + +``` +$ aws lambda update-event-source-mapping \ +--uuid 91eaeb7e-c976-1234-9451-8709db01f137 \ +--batch-size 2 +{ + "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", + "BatchSize": 2, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601928393.531, + "LastProcessingResult": "No records processed", + "State": "Updating", + "StateTransitionReason": "USER_INITIATED" +} +``` + +Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. + +``` +$ aws lambda get-event-source-mapping \ +--uuid 91eaeb7e-c976-4939-9451-8709db01f137 +{ + "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", + "BatchSize": 2, + "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "LastModified": 1601928393.531, + "LastProcessingResult": "No records processed", + "State": "Enabled", + "StateTransitionReason": "USER_INITIATED" +} +``` + +## Event source mapping errors + +When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda failed to authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda does not have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The function's configuration is not valid\. + +Records also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website\. \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 3ce2361d..941c6dd0 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -100,7 +100,7 @@ To enable or disable the trigger \(or delete it\), choose the **MSK** trigger in ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -109,7 +109,6 @@ To manage event source mappings with the AWS CLI or AWS SDK, use the following A To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can do one of the following: + Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Create a connection between your Amazon VPC and Lambda\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. The Amazon VPC security group rules you configure should have the following settings at minimum: + Inbound rules – Allow all traffic on all ports for the security group specified as your source\. diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index 9cf9c959..93874d7f 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -314,38 +314,8 @@ def lambda_handler(event, context): s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) ``` -**Note** -The image library used by this code must be installed in a Linux environment in order to create a working deployment package\. +**Dependencies** ++ [Pillow](https://pypi.org/project/Pillow/) **To create a deployment package** - -1. Copy the sample code into a file named `lambda_function.py`\. - -1. Create a virtual environment\. - - ``` - s3-python$ virtualenv v-env - s3-python$ source v-env/bin/activate - ``` - -1. Install libraries in the virtual environment - - ``` - (v-env) s3-python$ pip install Pillow boto3 - ``` - -1. Create a deployment package with the contents of the installed libraries\. - - ``` - (v-env) s3-python$ cd $VIRTUAL_ENV/lib/python3.8/site-packages - (v-env) python-s3/v-env/lib/python3.8/site-packages$ zip -r9 ${OLDPWD}/function.zip . - ``` - -1. Add the handler code to the deployment package and deactivate the virtual environment\. - - ``` - (v-env) python-s3/v-env/lib/python3.8/site-packages$ cd ${OLDPWD} - (v-env) python-s3$ zip -g function.zip lambda_function.py - adding: lambda_function.py (deflated 55%) - (v-env) python-s3$ deactivate - ``` \ No newline at end of file ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 2f1e8f0a..81a6c42a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -1,6 +1,6 @@ # Tutorial: Using AWS Lambda with Amazon S3 -Suppose you want to create a thumbnail for each image file that is uploaded to a bucket\. You can create a Lambda function \(`CreateThumbnail`\) that Amazon S3 can invoke when objects are created\. Then, the Lambda function can read the image object from the source bucket and create a thumbnail image target bucket\. +Suppose you want to create a thumbnail for each image file that is uploaded to a bucket\. You can create a Lambda function \(`CreateThumbnail`\) that Amazon S3 can invoke when objects are created\. Then, the Lambda function can read the image object from the source bucket and create a thumbnail image to save in the target bucket\. Upon completing this tutorial, you will have the following Amazon S3, Lambda, and IAM resources in your account: @@ -36,6 +36,66 @@ Install npm to manage the function's dependencies\. The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +## Create buckets and upload a sample object + +Follow the steps to create buckets and upload an object\. + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. + +1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. + + When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. + +## Create the IAM Policy + +Create an IAM policy that defines the permissions for the Lambda function\. The required permissions include: ++ Get the object from the source S3 bucket\. ++ Put the resized object into the target S3 bucket\. ++ Permissions related to the CloudWatch Logs\. + +**To create an IAM Policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. + +1. Choose **Create policy** + +1. Under the **JSON** tab, copy the following policy\. Make sure the source and target bucket names match the bucket names that you created previously\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents", + "logs:CreateLogGroup", + "logs:CreateLogStream" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::mybucket/*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject" + ], + "Resource": "arn:aws:s3:::mybucket-resized/*" + } + ] + } + ``` + +1. Choose **Review policy**, specify the policy name as `AWSLambdaS3Policy`, and create the policy\. + ## Create the execution role Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. @@ -48,22 +108,10 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Create a role with the following properties\. + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaExecute**\. + + **Permissions** – **AWSLambdaS3Policy**\. + **Role name** – **lambda\-s3\-role**\. -The **AWSLambdaExecute** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. - -## Create buckets and upload a sample object - -Follow the steps to create buckets and upload an object\. - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. - -1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. - - When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. +The **AWSLambdaS3Policy** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. ## Create the function @@ -346,6 +394,16 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. +**To delete the policy that you created** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. Select the policy that you created\. + +1. From **Policy actions**, choose **Delete**\. + +1. Choose **Delete**\. + **To delete the execution role** 1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d8ba94ed..9599f523 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -141,7 +141,7 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API actions: +To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) From f84aca5420f09ac7a3adf16042b97c172e49ef47 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Sun, 15 Nov 2020 08:26:07 -0800 Subject: [PATCH 046/243] Added Runtime Logs API, other minor doc updates --- doc_source/runtimes-extensions-api.md | 30 +++++++++++----------- doc_source/security-dataprotection.md | 2 +- doc_source/with-s3-example.md | 36 +++++++++++++-------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 81225b66..cca60934 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -28,7 +28,7 @@ You share your extension as a [Lambda layer](configuration-layers.md) to make it You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. **Note** -Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. +Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. ## Lambda execution environment lifecycle @@ -57,7 +57,7 @@ During the `Extension init` phase, each extension needs to register with Lambda You can register up to 10 extensions for a function\. This limit is enforced through the `Register` API call\. -After each extension registers with Lambda, Lambda starts the `Runtime init` phase\. The runtime process calls functionInit to start the Function init phase\. +After each extension registers with Lambda, Lambda starts the `Runtime init` phase\. The runtime process calls functionInit to start the Function init phase\. The `Init` phase completes after the runtime and each registered extension indicate completion by sending a `Next` API request\. @@ -72,13 +72,13 @@ When a Lambda function is invoked in response to a `Next` API request, Lambda se During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or send logs, metrics, and traces to a location of your choice\. -The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. +The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Invoke-Phase.png) -**Event payload**: +**Event payload**: -The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function ARN, and tracing headers\. +The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function ARN, and tracing headers\. Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. @@ -125,15 +125,15 @@ If the runtime or an extension does not respond to the `Shutdown` event within t **Event payload**: The `Shutdown` event contains the reason for the shutdown and the time remaining in milliseconds\. The `shutdownReason` includes the following values: -+ SPINDOWN – Normal shutdown ++ SPINDOWN – Normal shutdown + TIMEOUT – Duration limit timed out + FAILURE – Error condition, such as an `out-of-memory` event ``` -{ - "eventType": "SHUTDOWN", - "shutdownReason": "reason for shutdown", - "deadlineMs": "the time and date that the function times out in Unix time milliseconds" +{ + "eventType": "SHUTDOWN", + "shutdownReason": "reason for shutdown", + "deadlineMs": "the time and date that the function times out in Unix time milliseconds" } ``` @@ -195,7 +195,7 @@ http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register ### Register -During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. +During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. Internal extensions are started and stopped by the runtime process, so they are not permitted to register for the `Shutdown` event\. @@ -216,9 +216,9 @@ Internal extensions are started and stopped by the runtime process, so they are **Response codes** + 200 – Response body contains the function name, function version, and handler name\. -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. **Example request body** @@ -314,4 +314,4 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index aa208a67..fa2d1ad0 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -36,4 +36,4 @@ For more information, see [Using AWS Lambda environment variables](configuration Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-features.md#gettingstarted-features-package) and [layer archives](configuration-layers.md)\. -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. +Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 727f90b4..81a6c42a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -2,7 +2,7 @@ Suppose you want to create a thumbnail for each image file that is uploaded to a bucket\. You can create a Lambda function \(`CreateThumbnail`\) that Amazon S3 can invoke when objects are created\. Then, the Lambda function can read the image object from the source bucket and create a thumbnail image to save in the target bucket\. -Upon completing this tutorial, you will have the following Amazon S3, Lambda, and IAM resources in your account: +Upon completing this tutorial, you will have the following Amazon S3, Lambda, and IAM resources in your account: ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/s3-admin-iser-walkthrough-10.png) @@ -34,7 +34,7 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 Install npm to manage the function's dependencies\. -The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) ## Create buckets and upload a sample object @@ -44,7 +44,7 @@ Follow the steps to create buckets and upload an object\. 1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. -1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. +1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. @@ -155,7 +155,7 @@ exports.handler = async (event, context, callback) => { return; } - // Download the image from the S3 source bucket. + // Download the image from the S3 source bucket. try { const params = { @@ -173,13 +173,13 @@ exports.handler = async (event, context, callback) => { const width = 200; // Use the Sharp module to resize the image and save in a buffer. - try { + try { var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - + } catch (error) { console.log(error); return; - } + } // Upload the thumbnail image to the destination bucket try { @@ -190,28 +190,28 @@ exports.handler = async (event, context, callback) => { ContentType: "image" }; - const putResult = await s3.putObject(destparams).promise(); - + const putResult = await s3.putObject(destparams).promise(); + } catch (error) { console.log(error); return; - } - + } + console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); + ' and uploaded to ' + dstBucket + '/' + dstKey); }; ``` Review the preceding code and note the following: -+ The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg or a \.png, the code creates a thumbnail and saves it to the target bucket\. ++ The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg or a \.png, the code creates a thumbnail and saves it to the target bucket\. + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. -The deployment package is a \.zip file containing your Lambda function code and dependencies\. +The deployment package is a \.zip file containing your Lambda function code and dependencies\. **To create a deployment package** -1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. 1. Save the function code as `index.js` in a folder named `lambda-s3`\. @@ -252,7 +252,7 @@ The deployment package is a \.zip file containing your Lambda function code and --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -If you are using AWS CLI version 2, add the following command parameters: +If you are using AWS CLI version 2, add the following command parameters: ``` --cli-binary-format raw-in-base64-out @@ -378,7 +378,7 @@ Now you can test the setup as follows: 1. Verify that the thumbnail was created in the target bucket using the `CreateThumbnail` function\. -1. View logs in the CloudWatch console\. +1. View logs in the CloudWatch console\. ## Clean up your resources @@ -424,4 +424,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Enter the name of the source bucket in the text box\. -1. Choose **Confirm**\. +1. Choose **Confirm**\. \ No newline at end of file From daec73297ee3a8ce29e856dc1c93baadb4d7c2f1 Mon Sep 17 00:00:00 2001 From: michaelsew Date: Mon, 16 Nov 2020 00:16:36 -0800 Subject: [PATCH 047/243] change blank-go link from master branch to main --- doc_source/lambda-golang.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 8894eb0b..ef66e92a 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -16,7 +16,7 @@ AWS Lambda provides the following libraries for Go: **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** + [AWS Lambda deployment package in Go](golang-package.md) @@ -25,4 +25,4 @@ To get started with application development in your local environment, deploy on + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) -+ [Using environment variables](golang-envvars.md) \ No newline at end of file ++ [Using environment variables](golang-envvars.md) From 2ec74df25d5479a223a55a3b99fd6c3d10e5f517 Mon Sep 17 00:00:00 2001 From: MatteoGioioso Date: Fri, 20 Nov 2020 16:01:31 +0700 Subject: [PATCH 048/243] fix golang tracing added example with 'WithContext' method, as a user it was not clear that in this case the 'WithContext' method is needed --- doc_source/golang-tracing.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 165be7a6..e0a0b943 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -41,6 +41,12 @@ To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. xray.AWS(s3.Client) ``` +Then you can trace your calls by using the `WithContext` version of the method\. + +``` + svc.ListBucketsWithContext(ctx, &s3.ListBucketsInput{}) +``` + The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) @@ -99,4 +105,4 @@ Resources: Properties: Tracing: Active ... -``` \ No newline at end of file +``` From c32740427a05fdef9783fb2d0c82b753410ee283 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Wed, 25 Nov 2020 20:56:44 +0000 Subject: [PATCH 049/243] Periodic update --- doc_source/API_CreateFunction.md | 4 +- doc_source/API_FunctionConfiguration.md | 2 +- doc_source/API_GetFunctionConfiguration.md | 2 +- doc_source/API_GetLayerVersion.md | 4 +- doc_source/API_GetLayerVersionByArn.md | 4 +- doc_source/API_LayerVersionsListItem.md | 4 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 8 +- doc_source/API_PublishVersion.md | 2 +- doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/API_UpdateFunctionConfiguration.md | 4 +- doc_source/configuration-codesigning.md | 192 ++++++++++++++++++ doc_source/configuration-database.md | 8 +- doc_source/configuration-envvars.md | 2 +- doc_source/configuration-filesystem.md | 4 +- doc_source/configuration-layers.md | 8 +- doc_source/golang-tracing.md | 4 +- doc_source/index.md | 2 + doc_source/java-context.md | 10 +- doc_source/java-exceptions.md | 10 +- doc_source/java-handler.md | 10 +- doc_source/java-logging.md | 10 +- doc_source/java-package.md | 10 +- doc_source/java-samples.md | 12 +- doc_source/java-tracing.md | 12 +- doc_source/lambda-csharp.md | 4 +- doc_source/lambda-functions.md | 14 +- doc_source/lambda-golang.md | 2 +- doc_source/lambda-nodejs.md | 16 +- doc_source/lambda-powershell.md | 2 +- doc_source/lambda-python.md | 10 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-ruby.md | 2 +- doc_source/lambda-runtimes.md | 15 +- doc_source/lambda-samples.md | 34 ++-- doc_source/monitoring-insights.md | 6 +- doc_source/monitoring-metrics.md | 3 +- doc_source/nodejs-tracing.md | 2 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-tracing.md | 2 +- doc_source/runtimes-avx2.md | 60 ++++++ doc_source/runtimes-extensions-api.md | 2 +- doc_source/runtimes-logs-api.md | 8 +- doc_source/runtimes-walkthrough.md | 2 +- doc_source/samples-blank.md | 16 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/services-apigateway.md | 2 +- doc_source/with-sqs.md | 11 +- 50 files changed, 403 insertions(+), 151 deletions(-) create mode 100644 doc_source/configuration-codesigning.md create mode 100644 doc_source/runtimes-avx2.md diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index c4577d1f..f87bbbec 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -150,7 +150,7 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** @@ -335,7 +335,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 9abbf8f8..2fa66b1c 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -115,7 +115,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **State** diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index aae32762..4d3a9dc4 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -196,7 +196,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index a5067bc9..d0469dc3 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -57,8 +57,8 @@ The following data is returned in JSON format by the service\. ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings -Array Members: Maximum number of 5 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Array Members: Maximum number of 15 items\. +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index efe426fb..46aaf325 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -53,8 +53,8 @@ The following data is returned in JSON format by the service\. ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings -Array Members: Maximum number of 5 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Array Members: Maximum number of 15 items\. +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 1a114dde..2e858f4a 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -7,8 +7,8 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam **CompatibleRuntimes** The layer's compatible runtimes\. Type: Array of strings -Array Members: Maximum number of 5 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Array Members: Maximum number of 15 items\. +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index ed2b84b1..1e38e5f3 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 91720146..cf6939f7 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index fbef82be..fcbe9f72 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -40,8 +40,8 @@ The request accepts the following data in JSON format\. ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings -Array Members: Maximum number of 5 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Array Members: Maximum number of 15 items\. +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -95,8 +95,8 @@ The following data is returned in JSON format by the service\. ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings -Array Members: Maximum number of 5 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Array Members: Maximum number of 15 items\. +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index d9d525b1..4e1749f3 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -216,7 +216,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 9be56f50..f0f55d47 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -241,7 +241,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 3cab11a5..f4b2ea77 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -130,7 +130,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -310,7 +310,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md new file mode 100644 index 00000000..73c356fd --- /dev/null +++ b/doc_source/configuration-codesigning.md @@ -0,0 +1,192 @@ +# Configuring code signing for AWS Lambda + +Code signing for AWS Lambda helps to ensure that only trusted code runs in your Lambda functions\. When you enable code signing for a function, Lambda checks every code deployment and verifies that the code package is signed by a trusted source\. + +To verify code integrity, use [AWS Signer](https://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html) to create digitally signed code packages for functions and layers\. When a user attempts to deploy a code package, Lambda performs validation checks on the code package before accepting the deployment\. Because code signing validation checks run at deployment time, there is no performance impact on function execution\. + +You also use AWS Signer to create *signing profiles*\. You use a signing profile to create the signed code package\. Use AWS Identity and Access Management \(IAM\) to control who can sign code packages and create signing profiles\. For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/signer/latest/developerguide/accessctrl-toplevel.html) in the *AWS Signer Developer Guide*\. + +To enable code signing for a function, you create a *code signing configuration* and attach it to the function\. A code signing configuration defines a list of allowed signing profiles and the policy action to take if any of the validation checks fail\. + +Lambda layers follow the same signed code package format as function code packages\. When you add a layer to a function that has code signing enabled, Lambda checks that the layer is signed by an allowed signing profile\. When you enable code signing for a function, all layers that are added to the function must also be signed by one of the allowed signing profiles\. + +Use IAM to control who can create code signing configurations\. Typically, you allow only specific administrative users to have this ability\. Additionally, you can set up IAM policies to enforce that developers only create functions that have code signing enabled\. + +You can configure code signing to log changes to AWS CloudTrail\. Successful and blocked deployments to functions are logged to CloudTrail with information about the signature and validation checks\. + +You can configure code signing for your functions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), AWS CloudFormation, and the AWS Serverless Application Model \(AWS SAM\)\. + +There is no additional charge for using AWS Signer or code signing for AWS Lambda\. + +**Topics** ++ [Signature validation](#config-codesigning-valid) ++ [Configuration prerequisites](#config-codesigning-prereqs) ++ [Creating code signing configurations](#config-codesigning-config-console) ++ [Updating a code signing configuration](#config-codesigning-config-update) ++ [Deleting a code signing configuration](#config-codesigning-config-delete) ++ [Enabling code signing for a function](#config-codesigning-function-console) ++ [Configuring IAM policies](#config-codesigning-policies) ++ [Configuring code signing with the Lambda API](#config-codesigning-api) + +## Signature validation + +Lambda performs the following validation checks when you deploy a signed code package to your function: + +1. Integrity – Validates that the code package has not been modified since it was signed\. Lambda compares the hash of the package with the hash from the signature\. + +1. Expiry – Validates that the signature of the code package has not expired\. + +1. Mismatch – Validates that the code package is signed with one of the allowed signing profiles for the Lambda function\. A mismatch also occurs if a signature is not present\. + +1. Revocation – Validates that the signature of the code package has not been revoked\. + +The signature validation policy defined in the code signing configuration determines which of the following actions Lambda takes if any of the validation checks fail: ++ Warn – Lambda allows the deployment of the code package, but issues a warning\. Lambda issues a new Amazon CloudWatch metric and also stores the warning in the CloudTrail log\. ++ Enforce – Lambda issues a warning \(the same as for the Warn action\) and blocks the deployment of the code package\. + +You can configure the policy for the expiry, mismatch, and revocation validation checks\. Note that you cannot configure a policy for the integrity check\. If the integrity check fails, Lambda blocks deployment\. + +## Configuration prerequisites + +Before you can configure code signing for a Lambda function, use AWS Signer to do the following: ++ Create one or more signing profiles\. ++ Use a signing profile to create a signed code package for your function\. + +For more information, see [Creating Signing Profiles \(Console\)](https://docs.aws.amazon.com/signer/latest/developerguide/ConsoleLambda.html) in the *AWS Signer Developer Guide*\. + +## Creating code signing configurations + +A code signing configuration defines a list of allowed signing profiles and the signature validation policy\. + +**To create a code signing configuration \(console\)** + +1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. + +1. Choose **Create configuration**\. + +1. For **Description**, enter a descriptive name for the configuration\. + +1. Under **Signing profiles**, add up to 20 signing profiles to the configuration\. + + 1. For **Signing profile version ARN**, choose a profile version's Amazon Resource Name \(ARN\), or enter the ARN\. + + 1. To add an additional signing profile, choose **Add signing profiles**\. + +1. Under **Signature validation policy**, choose **Warn** or **Enforce**\. + +1. Choose **Create configuration**\. + +## Updating a code signing configuration + +When you update a code signing configuration, the changes impact the future deployments of functions that have the code signing configuration attached\. + +**To update a code signing configuration \(console\)** + +1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. + +1. Select a code signing configuration to update, and then choose **Edit**\. + +1. For **Description**, enter a descriptive name for the configuration\. + +1. Under **Signing profiles**, add up to 20 signing profiles to the configuration\. + + 1. For **Signing profile version ARN**, choose a profile version's Amazon Resource Name \(ARN\), or enter the ARN\. + + 1. To add an additional signing profile, choose **Add signing profiles**\. + +1. Under **Signature validation policy**, choose **Warn** or **Enforce**\. + +1. Choose **Save changes**\. + +## Deleting a code signing configuration + +You can delete a code signing configuration only if no functions are using it\. + +**To delete a code signing configuration \(console\)** + +1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. + +1. Select a code signing configuration to delete, and then choose **Delete**\. + +1. To confirm, choose **Delete** again\. + +## Enabling code signing for a function + +To enable code signing for a function, you associate a code signing configuration with the function\. + +**To associate a code signing configuration with a function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the function for which you want to enable code signing\. + +1. Under **Code signing configuration**, choose **Edit**\. + +1. In **Edit code signing**, choose a code signing configuration for this function\. + +1. Choose **Save**\. + +## Configuring IAM policies + +To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for AWS Lambda](access-control-identity-based.md)\. + +The following example policy statement grants permission to create, update, and retrieve code signing configurations\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "lambda:CreateCodeSigningConfig", + "lambda:UpdateCodeSigningConfig", + "lambda:GetCodeSigningConfig" + ] + } + ] +} +``` + +Administrators can use the `CodeSigningConfig` condition key to specify the code signing configurations that developers must use to create or update your functions\. + +The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:codeSigningConfig` condition to specify the allowed code signing configuration\. Lambda blocks the `CreateFunction` API request if the `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AllowReferencingCodeSigningConfig", + "Effect": "Allow", + "Action": [ + "lambda:CreateFunction", + ], + "Resource": "*", + "Condition": { + "StringEquals": { + "lambda:codeSigningConfig: { + “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” + } + } + } + } + ] +} +``` + +## Configuring code signing with the Lambda API + +To manage code signing configurations with the AWS CLI or AWS SDK, use the following API operations: ++ [ListCodeSigningConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListCodeSigningConfigs.html) ++ [CreateCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateCodeSigningConfig.html) ++ [GetCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetCodeSigningConfig.html) ++ [UpdateCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateCodeSigningConfig.html) ++ [DeleteCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteCodeSigningConfig.html) + +To manage the code signing configuration for a function, use the following API operations: ++ [CreateFunction](API_CreateFunction.md) ++ [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) ++ [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) ++ [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) ++ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index e4680547..b8be6fdb 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -75,11 +75,11 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. ## Sample application Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) -+ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. + [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) ++ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) + [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 02c34b38..f2707f8e 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -271,4 +271,4 @@ Sample applications in this guide's GitHub repository demonstrate the use of env **Sample applications** + [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index c67febba..4ddb4433 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -77,7 +77,7 @@ Use the following API operations to connect your Lambda function to a file syste + [CreateFunction](API_CreateFunction.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To connect a function a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. +To connect a function to a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. ``` $ ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd @@ -174,4 +174,4 @@ For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and f ## Sample applications The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 777dbe54..1c0694fb 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -256,9 +256,9 @@ When you update your dependencies and deploy, AWS SAM creates a new version of t ## Sample applications The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index e0a0b943..d5a72ade 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -44,7 +44,7 @@ To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. Then you can trace your calls by using the `WithContext` version of the method\. ``` - svc.ListBucketsWithContext(ctx, &s3.ListBucketsInput{}) + svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) ``` The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. @@ -105,4 +105,4 @@ Resources: Properties: Tracing: Active ... -``` +``` \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index afdc547c..ea2cd98c 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -41,6 +41,7 @@ Amazon's trademarks and trade dress may not be used in + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + + [Configuring code signing for AWS Lambda](configuration-codesigning.md) + [Tagging Lambda Functions](configuration-tags.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) @@ -62,6 +63,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) + [AWS Lambda applications](deploying-lambda-apps.md) + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index cd12d375..000ea77c 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -99,10 +99,10 @@ For more information on logging, see [AWS Lambda function logging in Java](java- The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index a6509e90..32aa0879 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -218,10 +218,10 @@ For details on how other services handler errors, see the topics in the [Using A The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. \ No newline at end of file diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 207c584d..8d860e28 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -170,11 +170,11 @@ public class HandlerStream implements RequestStreamHandler { The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: + [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index f26d1a23..69806971 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -289,11 +289,11 @@ When you run your code locally for tests, the context object with the Lambda log The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 6f885c67..96df620b 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -297,8 +297,8 @@ aws cloudformation deploy --template-file out.yml --stack-name java-basic --capa For a complete working example, see the following sample applications\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index e0063db6..646898c8 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -3,15 +3,15 @@ The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. -[https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) +[https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 3ffb7d5a..ce129faf 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -138,18 +138,18 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application\. ## Tracing in sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 580726c9..44803fe9 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -28,8 +28,8 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. +[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** + [AWS Lambda Deployment Package in C\#](csharp-package.md) diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 92a9d52a..584003d9 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -10,16 +10,4 @@ As you add libraries and other dependencies to your function, creating and uploa To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. -**Topics** -+ [Configuring functions in the AWS Lambda console](configuration-console.md) -+ [Configuring functions in the AWS Lambda console \(preview\)](configuration-preview.md) -+ [Using AWS Lambda environment variables](configuration-envvars.md) -+ [Managing concurrency for a Lambda function](configuration-concurrency.md) -+ [Lambda function versions](configuration-versions.md) -+ [Lambda function aliases](configuration-aliases.md) -+ [AWS Lambda layers](configuration-layers.md) -+ [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) -+ [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) -+ [Configuring database access for a Lambda function](configuration-database.md) -+ [Configuring file system access for Lambda functions](configuration-filesystem.md) -+ [Tagging Lambda Functions](configuration-tags.md) \ No newline at end of file +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 8894eb0b..66118fbe 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -16,7 +16,7 @@ AWS Lambda provides the following libraries for Go: **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** + [AWS Lambda deployment package in Go](golang-package.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 96f52801..b3f275cf 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,8 +9,8 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.712\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.712\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -62,12 +62,12 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. +[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. +[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. +[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. +[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. +[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](nodejs-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index 8016c0d3..d83a1672 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -12,7 +12,7 @@ The following sections explain how common programming patterns and core concepts **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. +[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index aec53ce7..5f2bf072 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -64,7 +64,7 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 6fa55542..bd3a343b 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | | [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | | [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 52abe3a8..d4c81645 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -62,7 +62,7 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](ruby-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 2bb97902..60249ed1 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,18 +19,18 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.712\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.712\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.14\.40 botocore\-1\.17\.40 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | **Ruby runtimes** @@ -82,4 +82,5 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Modifying the runtime environment](runtimes-modify.md) + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) -+ [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) \ No newline at end of file ++ [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index ca7883f4..44f70e1e 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -6,53 +6,53 @@ The GitHub repository for this guide includes sample applications that demonstra #### [ Node\.js ] **Sample Lambda applications in Node\.js** -+ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -+ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -+ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -+ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ++ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. ++ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. ++ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. ++ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ------ #### [ Python ] **Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Ruby ] **Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Java ] **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ #### [ Go ] **Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ------ #### [ C\# ] **Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ------ #### [ PowerShell ] **Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index ad3a8622..a2f3091b 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -20,7 +20,7 @@ Lambda Insights is in public preview\. The preview is open to all AWS accounts, CloudWatch Lambda Insights is a monitoring and troubleshooting solution for serverless applications running on AWS Lambda\. The solution collects, aggregates, and summarizes system\-level metrics including CPU time, memory, disk and network usage\. It also collects, aggregates, and summarizes diagnostic information such as cold starts and Lambda worker shutdowns to help you isolate issues with your Lambda functions and resolve them quickly\. -Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html)\. +Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function for a supported runtime, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html)\. The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for the `/aws/lambda-insights/` log group\. @@ -65,7 +65,7 @@ For this preview release, Lambda Insights is currently available in the followin ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you turn on Lambda Insights in the Lambda console, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -84,7 +84,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index c19f5714..03a385ef 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -16,6 +16,7 @@ When your function finishes processing an event, Lambda sends metrics about the By default, graphs use the `Sum` statistic for all metrics\. To choose a different statistic and customize the graph, use the options on the **Graphed metrics** tab\. +**Note** The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the execution, this can be several minutes before the metric is emitted\. If, for example, your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. @@ -33,7 +34,7 @@ You should view the following metrics with the `Sum` statistic\. **Invocation metrics** + `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an [invocation error](API_Invoke.md#API_Invoke_Errors)\. This equals the number of requests billed\. -+ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. ++ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. + `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. + `DestinationDeliveryFailures` – For asynchronous invocation, the number of times Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. + `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with [TooManyRequestsException](API_Invoke.md#API_Invoke_Errors)\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 092f21a7..0ed581a2 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -172,4 +172,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index fd8e58c3..c3946e5a 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -150,4 +150,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 49ef4779..eae9eb8f 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -152,4 +152,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md new file mode 100644 index 00000000..7c0f280c --- /dev/null +++ b/doc_source/runtimes-avx2.md @@ -0,0 +1,60 @@ +# Using AVX2 vectorization in Lambda + +Advanced Vector Extensions 2 \(AVX2\) is a vectorization extension to the Intel x86 instruction set that can perform single instruction multiple data \(SIMD\) instructions over vectors of 256 bits\. For vectorizable algorithms with [highly parallelizable](https://en.wikipedia.org/wiki/Massively_parallel) operation, using AVX2 can enhance CPU performance, resulting in lower latencies and higher throughput\. Use the AVX2 instruction set for compute\-intensive workloads such as machine learning inferencing, multimedia processing, scientific simulations, and financial modeling applications\. + +To use AVX2 with your Lambda function, make sure that your function code is accessing AVX2\-optimized code\. For some languages, you can install the AVX2\-supported version of libraries and packages\. For other languages, you can recompile your code and dependencies with the appropriate compiler flags set \(if the compiler supports auto\-vectorization\)\. You can also compile your code with third\-party libraries that use AVX2 to optimize math operations\. For example, Intel Math Kernel Library \(Intel MKL\), OpenBLAS \(Basic Linear Algebra Subprograms\), and AMD BLAS\-like Library Instantiation Software \(BLIS\)\. Auto\-vectorized languages, such as Java, automatically use AVX2 for computations\. + +You can create new Lambda workloads or move existing AVX2\-enabled workloads to Lambda at no additional cost\. + +For more information about AVX2, see [Advanced Vector Extensions 2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) in Wikipedia\. + +## Compiling from source + +If your Lambda function uses a C or C\+\+ library to perform compute\-intensive vectorizable operations, you can set the appropriate compiler flags and recompile the function code\. Then, the compiler automatically vectorizes your code\. + +For the `gcc` or `clang` compiler, add `-march=haswell` to the command or set `-mavx2` as a command option\. + +``` +~ gcc -march=haswell main.c +or +~ gcc -mavx2 main.c + +~ clang -march=haswell main.c +or +~ clang -mavx2 main.c +``` + +To use a specific library, follow instructions in the library's documentation to compile and build the library\. For example, to build TensorFlow from source, you can follow the [ installation instructions](https://www.tensorflow.org/install/source) on the TensorFlow website\. Make sure to use the `-march=haswell` compile option\. + +## Enabling AVX2 for Intel MKL + +Intel MKL is a library of optimized math operations that implicitly use AVX2 instructions when the compute platform supports them\. Frameworks such as PyTorch [build with Intel MKL by default](https://software.intel.com/content/www/us/en/develop/articles/getting-started-with-intel-optimization-of-pytorch.html), so you don't need to enable AVX2\. + +Some libraries, such as TensorFlow, provide options in their build process to specify Intel MKL optimization\. For example, with TensorFlow, use the `--config=mkl` option\. + +You can also build popular scientific Python libraries, such as SciPy and NumPy, with Intel MKL\. For instructions on building these libraries with Intel MKL, see [Numpy/Scipy with Intel MKL and Intel Compilers](https://software.intel.com/content/www/us/en/develop/articles/numpyscipy-with-intel-mkl.html) on the Intel website\. + +For more information about Intel MKL and similar libraries, see [Math Kernel Library](https://en.wikipedia.org/wiki/Math_Kernel_Library) in Wikipedia, the [OpenBLAS website](https://www.openblas.net/), and the [AMD BLIS repository](https://github.com/amd/blis) on GitHub\. + +## AVX2 support in other languages + +If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. + +Python +Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. + +Node +For compute\-intensive workloads, use AVX2\-enabled or Intel MKL\-enabled versions of the libraries that you need\. + +Java +Java's JIT compiler can auto\-vectorize your code to run with AVX2 instructions\. For information about detecting vectorized code, see the [Code vectorization in the JVM](https://cr.openjdk.java.net/~vlivanov/talks/2019_CodeOne_MTE_Vectors.pdf) presentation on the OpenJDK website\. + +Go +The standard Go compiler doesn't currently support auto\-vectorization, but you can use [gccgo](https://golang.org/doc/install/gccgo), the GCC compiler for Go\. Set the `-mavx2` option: + +``` +gcc -o avx2 -mavx2 -Wall main.c +``` + +Intrinsics +It's possible to use [intrinsic functions](https://en.wikipedia.org/wiki/Intrinsic_function) in many languages to manually vectorize your code to use AVX2\. However, we don't recommend this approach\. Manually writing vectorized code takes significant effort\. Also, debugging and maintaining such code is more difficult than using code that depends on auto\-vectorization\. \ No newline at end of file diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index cca60934..026fbf71 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -103,7 +103,7 @@ Here is an example payload: To help identify the overhead introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. -You can assess the performance impact of an extension by using the `PostRuntimeExecutionDuration` metric to measure the extra time an extension adds to the function execution\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +You can assess the performance impact of an extension by using the `PostRuntimeExtensionsDuration` metric to measure the extra time an extension adds to the function execution\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index c3fad683..ddb7a422 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -75,7 +75,7 @@ During buffering configuration, note the following points: The following example shows a request to subscribe to the platform and function logs\. ``` -POST http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe HTTP/1.1 +PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 {"types": [ "platform", "function" @@ -207,7 +207,7 @@ Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe +http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ ``` ### Subscribe @@ -216,7 +216,7 @@ To subscribe to one or more of the log streams that are available in the Lambda The OpenAPI specification for the Logs API subscription request, version **2020\-08\-15**, is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) -**Path** – `/logs/subscribe` +**Path** – `/logs` **Method** – **PUT** @@ -243,7 +243,7 @@ The OpenAPI specifications for the subscription responses, version **2020\-08\-1 **Example subscription request** ``` - POST http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/subscribe HTTP/1.1 + PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 { "types": [ "platform", diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index 1507c331..1c1d87b4 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -127,7 +127,7 @@ runtime-tutorial$ aws lambda create-function --function-name bash-runtime \ Invoke the function and verify the response\. ``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt +runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt –cli-binary-format raw-in-base64-out { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 743ac593..b6f91318 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -7,17 +7,17 @@ The blank function sample application is a starter application that demonstrates Variants of this sample application are available for the following languages: **Variants** -+ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs)\. -+ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python)\. -+ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby)\. -+ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java)\. -+ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go)\. -+ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp)\. -+ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell)\. ++ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs)\. ++ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python)\. ++ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby)\. ++ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java)\. ++ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go)\. ++ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp)\. ++ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell)\. The examples in this topic highlight code from the Node\.js version, but the details are generally applicable to all variants\. -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. **Topics** + [Architecture and handler code](#samples-blank-architecture) diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 20830f04..ad43ed3b 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -8,7 +8,7 @@ Function code is available in the following files: + Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. **Topics** + [Architecture and event structure](#sample-errorprocessor-architecture) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 5ac70cf1..86415c56 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -10,7 +10,7 @@ In addition to the function that processes events, the application includes a se + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) + Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. **Topics** + [Architecture and event structure](#samples-listmanager-architecture) diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index a912d46e..7053003d 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -291,6 +291,6 @@ For more information, see [AWS Lambda integrations](https://docs.aws.amazon.com/ ## Sample applications The GitHub repository for this guide provides the following sample application for API Gateway\. -+ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. ++ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. Lambda also provides [blueprints](gettingstarted-features.md#gettingstarted-features-blueprints) and [templates](gettingstarted-features.md#gettingstarted-features-templates) that you can use to create an API Gateway application in the Lambda console\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 9599f523..68bb11dc 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -45,6 +45,8 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` +By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) is reached or full batch size is reached\. + For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. **Example Amazon SQS message event \(FIFO queue\)** @@ -129,7 +131,10 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of items to read from the queue in each batch, up to 10\. The event might contain fewer items if the batch that Lambda read from the queue had fewer items\. ++ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for synchronous invocation \(6 MB\)\. ++ **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. + + If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** @@ -148,14 +153,16 @@ To manage event source mappings with the AWS CLI or AWS SDK, use the following A + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5\. +The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. ``` $ aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ +--maximum-batching-window-in-seconds 60 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue { "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", "BatchSize": 5, + "MaximumBatchingWindowInSeconds": 60, "EventSourceArn": "arn:aws:sqs:us-east-2:123456789012:my-queue", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "LastModified": 1541139209.351, From 682401cbe5222517ce2789c69a2248cf0362ff41 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Wed, 2 Dec 2020 06:47:11 -0800 Subject: [PATCH 050/243] New features: container images, increased memory, 1ms billing granularity --- doc_source/.DS_Store | Bin 0 -> 133124 bytes doc_source/API_AllowedPublishers.md | 20 ++ doc_source/API_CodeSigningConfig.md | 47 +++ doc_source/API_CodeSigningPolicies.md | 20 ++ doc_source/API_CreateCodeSigningConfig.md | 99 ++++++ doc_source/API_CreateEventSourceMapping.md | 11 + doc_source/API_CreateFunction.md | 99 +++++- doc_source/API_DeleteCodeSigningConfig.md | 64 ++++ doc_source/API_DeleteEventSourceMapping.md | 11 + .../API_DeleteFunctionCodeSigningConfig.md | 78 +++++ .../API_EventSourceMappingConfiguration.md | 11 + doc_source/API_FunctionCode.md | 7 +- doc_source/API_FunctionCodeLocation.md | 10 + doc_source/API_FunctionConfiguration.md | 33 +- doc_source/API_GetCodeSigningConfig.md | 82 +++++ doc_source/API_GetEventSourceMapping.md | 11 + doc_source/API_GetFunction.md | 22 +- .../API_GetFunctionCodeSigningConfig.md | 96 ++++++ doc_source/API_GetFunctionConfiguration.md | 47 ++- doc_source/API_GetLayerVersion.md | 6 +- doc_source/API_GetLayerVersionByArn.md | 6 +- doc_source/API_ImageConfig.md | 31 ++ doc_source/API_ImageConfigError.md | 23 ++ doc_source/API_ImageConfigResponse.md | 23 ++ doc_source/API_Layer.md | 12 + doc_source/API_LayerVersionContentOutput.md | 10 + doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListCodeSigningConfigs.md | 86 ++++++ doc_source/API_ListEventSourceMappings.md | 2 + doc_source/API_ListFunctions.md | 18 +- .../API_ListFunctionsByCodeSigningConfig.md | 84 +++++ doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_ListVersionsByFunction.md | 18 +- doc_source/API_Operations.md | 9 + doc_source/API_PublishLayerVersion.md | 8 +- doc_source/API_PublishVersion.md | 47 ++- .../API_PutFunctionCodeSigningConfig.md | 116 +++++++ doc_source/API_Types.md | 6 + doc_source/API_UpdateCodeSigningConfig.md | 109 +++++++ doc_source/API_UpdateEventSourceMapping.md | 11 + doc_source/API_UpdateFunctionCode.md | 70 ++++- doc_source/API_UpdateFunctionConfiguration.md | 75 ++++- doc_source/access-control-resource-based.md | 2 +- doc_source/applications-tutorial.md | 4 +- doc_source/best-practices.md | 10 +- doc_source/configuration-aliases.md | 4 +- doc_source/configuration-codesigning.md | 5 +- doc_source/configuration-concurrency.md | 4 +- doc_source/configuration-console.md | 26 +- doc_source/configuration-database.md | 10 +- doc_source/configuration-envvars.md | 8 +- doc_source/configuration-filesystem.md | 4 +- doc_source/configuration-images.md | 202 ++++++++++++ doc_source/configuration-layers.md | 17 +- doc_source/configuration-memory.md | 19 ++ doc_source/configuration-preview.md | 15 +- doc_source/configuration-tags.md | 4 +- doc_source/configuration-versions.md | 4 +- doc_source/configuration-vpc.md | 4 +- doc_source/csharp-handler.md | 2 +- doc_source/csharp-image.md | 28 ++ doc_source/csharp-logging.md | 4 +- doc_source/csharp-package-cli.md | 32 +- doc_source/csharp-package-toolkit.md | 38 +-- doc_source/csharp-package.md | 10 +- doc_source/csharp-tracing.md | 4 +- doc_source/getting-started-create-function.md | 292 +++++++++++++++--- doc_source/getting-started.md | 23 +- doc_source/gettingstarted-awscli.md | 8 +- doc_source/gettingstarted-concepts.md | 46 ++- doc_source/gettingstarted-features.md | 56 ++-- doc_source/gettingstarted-limits.md | 36 ++- doc_source/gettingstarted-package.md | 41 +++ doc_source/gettingstarted-tools.md | 43 +-- doc_source/go-image.md | 26 ++ doc_source/golang-logging.md | 6 +- doc_source/golang-package.md | 22 +- doc_source/golang-tracing.md | 10 +- doc_source/images-create.md | 219 +++++++++++++ doc_source/images-test.md | 129 ++++++++ doc_source/index.md | 88 ++++-- doc_source/invocation-async.md | 6 +- doc_source/invocation-images.md | 26 ++ doc_source/invocation-sync.md | 2 +- doc_source/java-context.md | 10 +- doc_source/java-exceptions.md | 14 +- doc_source/java-handler.md | 10 +- doc_source/java-image.md | 40 +++ doc_source/java-logging.md | 14 +- doc_source/java-package.md | 48 +-- doc_source/java-samples.md | 12 +- doc_source/java-tracing.md | 16 +- doc_source/lambda-csharp.md | 7 +- doc_source/lambda-functions.md | 2 +- doc_source/lambda-golang.md | 5 +- doc_source/lambda-images.md | 13 + doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-invocation.md | 3 +- doc_source/lambda-java.md | 5 +- doc_source/lambda-monitoring.md | 2 +- doc_source/lambda-nodejs.md | 17 +- doc_source/lambda-powershell.md | 6 +- doc_source/lambda-python.md | 7 +- doc_source/lambda-releases.md | 5 +- doc_source/lambda-ruby.md | 7 +- doc_source/lambda-runtimes.md | 11 +- doc_source/lambda-samples.md | 34 +- doc_source/lambda-troubleshooting.md | 11 +- doc_source/monitoring-cloudwatchlogs.md | 2 +- .../monitoring-functions-access-metrics.md | 2 +- doc_source/monitoring-insights.md | 2 +- doc_source/monitoring-metrics.md | 2 +- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-image.md | 35 +++ doc_source/nodejs-logging.md | 4 +- doc_source/nodejs-package.md | 34 +- doc_source/nodejs-tracing.md | 6 +- doc_source/powershell-handler.md | 2 +- doc_source/powershell-logging.md | 4 +- doc_source/powershell-package.md | 30 +- doc_source/python-exceptions.md | 2 +- doc_source/python-image.md | 37 +++ doc_source/python-logging.md | 8 +- doc_source/python-package.md | 32 +- doc_source/python-tracing.md | 6 +- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-handler.md | 2 +- doc_source/ruby-image.md | 35 +++ doc_source/ruby-logging.md | 8 +- doc_source/ruby-package.md | 20 +- doc_source/ruby-tracing.md | 6 +- doc_source/runtime-support-policy.md | 6 +- doc_source/runtimes-context.md | 8 +- doc_source/runtimes-extensions-api.md | 67 ++-- doc_source/runtimes-images.md | 54 ++++ doc_source/runtimes-logs-api.md | 2 +- doc_source/runtimes-modify.md | 2 +- doc_source/runtimes-walkthrough.md | 6 +- doc_source/samples-blank.md | 16 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/security-configuration.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/security_iam_troubleshoot.md | 2 +- doc_source/services-apigateway-code.md | 6 +- doc_source/services-apigateway-tutorial.md | 4 +- doc_source/services-apigateway.md | 4 +- .../services-cloudwatchevents-tutorial.md | 6 +- doc_source/services-cloudwatchevents.md | 2 +- doc_source/services-cloudwatchlogs.md | 14 +- doc_source/services-ec2-tutorial.md | 2 +- doc_source/services-elasticache-tutorial.md | 6 +- doc_source/services-rds-tutorial.md | 6 +- doc_source/services-xray.md | 2 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 18 +- doc_source/troubleshooting-images.md | 13 + doc_source/troubleshooting-invocation.md | 2 +- doc_source/troubleshooting-networking.md | 2 +- doc_source/using-extensions.md | 71 +++-- doc_source/welcome.md | 34 +- doc_source/with-android-create-package.md | 4 +- doc_source/with-android-example.md | 4 +- doc_source/with-cloudtrail-create-package.md | 2 +- doc_source/with-cloudtrail-example.md | 2 +- doc_source/with-ddb-create-package.md | 10 +- doc_source/with-ddb-example.md | 4 +- doc_source/with-ddb.md | 4 +- doc_source/with-kinesis-create-package.md | 10 +- doc_source/with-kinesis-example.md | 4 +- doc_source/with-kinesis.md | 4 +- doc_source/with-mq.md | 2 +- doc_source/with-msk.md | 2 +- doc_source/with-s3-example-deployment-pkg.md | 2 +- doc_source/with-s3-example.md | 4 +- doc_source/with-sns-create-package.md | 8 +- doc_source/with-sns-example.md | 4 +- doc_source/with-sqs-create-package.md | 10 +- doc_source/with-sqs-example.md | 4 +- doc_source/with-sqs.md | 2 +- 181 files changed, 3398 insertions(+), 720 deletions(-) create mode 100644 doc_source/.DS_Store create mode 100644 doc_source/API_AllowedPublishers.md create mode 100644 doc_source/API_CodeSigningConfig.md create mode 100644 doc_source/API_CodeSigningPolicies.md create mode 100644 doc_source/API_CreateCodeSigningConfig.md create mode 100644 doc_source/API_DeleteCodeSigningConfig.md create mode 100644 doc_source/API_DeleteFunctionCodeSigningConfig.md create mode 100644 doc_source/API_GetCodeSigningConfig.md create mode 100644 doc_source/API_GetFunctionCodeSigningConfig.md create mode 100644 doc_source/API_ImageConfig.md create mode 100644 doc_source/API_ImageConfigError.md create mode 100644 doc_source/API_ImageConfigResponse.md create mode 100644 doc_source/API_ListCodeSigningConfigs.md create mode 100644 doc_source/API_ListFunctionsByCodeSigningConfig.md create mode 100644 doc_source/API_PutFunctionCodeSigningConfig.md create mode 100644 doc_source/API_UpdateCodeSigningConfig.md create mode 100644 doc_source/configuration-images.md create mode 100644 doc_source/configuration-memory.md create mode 100644 doc_source/csharp-image.md create mode 100644 doc_source/gettingstarted-package.md create mode 100644 doc_source/go-image.md create mode 100644 doc_source/images-create.md create mode 100644 doc_source/images-test.md create mode 100644 doc_source/invocation-images.md create mode 100644 doc_source/java-image.md create mode 100644 doc_source/lambda-images.md create mode 100644 doc_source/nodejs-image.md create mode 100644 doc_source/python-image.md create mode 100644 doc_source/ruby-image.md create mode 100644 doc_source/runtimes-images.md create mode 100644 doc_source/troubleshooting-images.md diff --git a/doc_source/.DS_Store b/doc_source/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b1b70589981823a0504723d49da4c43af9418972 GIT binary patch literal 133124 zcmeI5YjzyBnTCssXU4H*>qc1@%Qo$dJ(-iCW#{%=N+`!VM;Y^ovh&mCO_a=Q$fjid z(-N|TEFnwC60(FWAxoI|1^R2C(5NZ^RZKkoiaMnxy8%@7^8z1kAAqW=7JhTO^=Wmk z!q2Ofd0qJCe6?`rd{te(y~}Qhi+QS6fGujR&VElVgP5t8SaH`_)FZg)pDu z?~UrTdWv_q@cZ5B57k=r0G~*RyVVgsUBNvzJ3n8pet|oFf^ZM3&#QY#=U3I&)vv2x z;++-z{S`i4s~+L^kE>O@evWYWaL*Nd?mxx8dHP*E(P8x*`Lh1Z_OA(Y>Pa=hXImh^ z|JRYy|Bq*_s`v1{p5p1Bpv0Yk8q3{xhWZhd*v8+dc%QH9_)bSA)DiyP1iA5NBrp=t zOn|l@Kd-)SU&sGP0waNuz>EOx!xApO-kH9>w6Df=;6KxW!0Rh`+x*~n^aD(srRnRP z>FZ1TYN8@d6BVyE>cX^(v0$U){Urv+>z(QAOZ#f0R|__JwJ^Q&!nB97VD651OC~sa zH1>7;e&iEw#7EMi{%w9wJ~mE5o6pK9*p1h^05mSFH3y)pt5Z}P3-$J5>0xg1FhbR zYIP5uE_Q@-4f@D<+3!(W=rv*MGEHjrrzCpyObLozjVksTRAMc`F==f*r92{{L`E!7 zzc!=3VrmVJ=xl>FYmehvuSiq5$fqLoGh;#lSHn{QdUK66_t)_8Yhxj_lh}c=t4;iL z$C}&uL-uDRn)G4~tz1pwYcjh^jcX&y@$f|F?2JFVpWTTM4pE{wD`I=goGXdjNv-AW zY{-e4XOKG7b~83Cdu#`Cq{_`6Yt^!Zizt;H7dp7!<~>t$JvHU+0KQyyOi`27OJyOv zlfr|s8$XFNz6a*Ca>uG>jq<4o_sp13z|Hc-6?kZD(2*I9rEjpNTwlsY)F_G%O1HDCFQg1|I`29*@Dl|f?)rD4YTiTPi&(O^K*^l z6M3@Cn7EhoL2Vjekb7vDkxr)}#1mtH^xLz(KojW)u+^JNtw1>)QKB#fD08b-8SxI# zYoYt_5p{~wfIe=_D=ay#mL12ahT$Z7^=1y;+?dJlP;*UC%DAdcR@bbV_iP_|$Ma&- zP|uW+5p4=$LyZeFD<^7b^f~LMAe1{of~c!;EK#=1woGe{D+jdu+?LZ31qxGuGOo6< z%D8%>xi_Y%o!f_xs8gH<^l_t1R-dq5*Q7-%3*nv=9*lny*!z(2Xsw)AP3O9ze`^2# zodo4{d*}BfBqgawDkxvhA17|Z{Bat+eaHTkM6I4FC0In)N*H^S-StO0Em5$mMoLT( zO1>3X$kD$cpNXiF#S-kpR(TWq-(bx8E@m}!t(q>UBYG630A<1!d6P13{h+QjeSP?d zI>l)~pNoOj(yBuW2jSfr7F^v-pKXba{#95hp@93Tum6wVxyiFf?(e);GUDSA-k8--e*Z^P z32P@Hd|N_+qF?Hq-~3(7aJ@iVm^;1e*`YC&g^*1O560(bIn}jsHF0hG{=%{`4EQ+@ zCdco@>~}~nqx(}&BTYo}hzR41SfK7kupIUJZhW?7Lq9L>KS?Wmgmv{3RW_qPB~hnm zN>I#sL8K}6g;7hNWMBcVBt(gX(4gzq5sSTYbnAU^ zU93yE2>I-|(BY?Zxx93?PM1z+!A*1=JZW0?AR2Up1kw3^MrgNK z|A(zGO|^YLLZU>ERG^acSNH;>x1S-;a|JK`KXt9ZPvIcMJHyU#T?0{fLYk&LUS}2O z5a${R3$Cv9^abV`xRI93vFHhgJ@%hXyJGoNM48N(=(V?vgh;Aq)&Hmezw?0eJwWX4N%W3NIiXgb zvv*o}9_Mjn$MBgiPs~0}_8fanb~}}Y@J|X4#?BYukr{*I*^Zh|?9AaItdrw_xAR_X z=56!2&K-37@DV+V(||s1^}-{}YH?&**JyOx_ZPm6VQTi|OW2W#nS0f2x1DY1<{^BO z@m$w-7Q#7+9T+?RO+Vdn9MvC3?aN3s>6H$&a%*pVt=y=R-?AOg zb^W?3r6hXwSom|vf^I+B?}hg+?2_$}O4U()DRzTpN{(jfAy~z4Yk+x0iGKox`4oeAn!_$b&apZG@f6SVzml+G|bL zp^S`ZQ4qVc=A;dHhJWj@2fA8(?KwNnMU=>n3mx8WEfuVT+4JYFj&d@mrjk)kM>Hu+ z0m@u!Rp#kzpI}|(BcF;Wkr}g7fjwBK7bqLrEL1zk7?m^y=3;g#z?1Ij1AMHkwb-se zj7pjUb1|Vnd!543nQhe5Px1eAWn+_VE%rDUQ6ZZtbhz4D8(7aLT{S@-5n-PZ3)I`& zwp@Ea>;Dush_fV`T1I7LM1_LbP~+X!GVsjI&T>ri0KHQBv(mSCqD+^*j6|Vc>45xB z)wcfs8q{1&P*X~jJXLZWq<;zNpHxpwAM$86m&skHzeBE&lr_v{rjZcF38AOz`E*H@ z^D{?atI-}ZXQuKH(#dfmxtaNzc8s@QI6WtVqYDdUO ze%(WTyn}ysy^kiUVGfLw5V8rOL6@yq-`X6(8f;d(_%pwHzY#x5<>W&Gt%G^F$^4W2r!xik!af){Irq^p(26K+5v8Sku zemV_do*08?!GX5>q5uB}rmZqDa}~(BWo>4&r%a$8~gB!%{Y)M^XF) zO}LvBZKB<6dDMhHLaeJGcz)g&4}!CtYqy>EJby7cI>IWaDxMRr{1aHGRs#d|&) zYU(mFqD4V$sBx`B4H*y7RVMPOhzgl8p}^}JfhbxLU>Q=LmNXdnl~n^9{5J>8-nk-}j9**v0RM=t&*m9e-@e z{$h(qH1UglZ(%m~ z88}@roSvbj?(e?C`CqQOjH}a=m3=7A!0YpP z7=n|i(>pEbw%DMX8@tgp!kEKDbV!b4EROTxmRWgQ6N)90RQvS*uQsU4mJC}xTvO(B zl{;p{Le6Ol&ADanrlqfJ=Mm|m9^nY;mm8GTSf8b`5YkEE!T3V;Epjk-NRVCnG>*V_ zQxL8lAx*AzMBB#6H1t_7d%3HPh0sk3ALQEj2$=@DeqM}I5Uw2|LG%qzDc2s7dRha` zb^=1OB~*|vBcp{%MymYW7N;OIJ3@l!H7{S*M+mt>*RD^YceA!#WnCSUMn#Bc@(l8H z{a%`^gP&956oha`$bcyQE%q@wV0TB-N;FO(Ml=#KAQ~CzR%mzQ6k5++H5bc#kKyYAV_N2#Gd5Qh`br1C{(0mzuOl;UL62!-DIZ0ayA<(^6<++QmS4 zwuS@CD*?;-HDsEorqd9jm%q# zI16E$6dsH(1(rK9GpJWr?iIt{p|1S_!W`MeLI@{?Z(w|EPQlQ3 zLTQXyj71ycx$t0oZO%&2zx8Nt7dTxuIiHGf&x~p4%j&n=X0GtISN}<>rTu^I|92x$ z*p8F4?P7gu*he}vb+12~C3h}}jeEY0wEcakm(f<@oWJa3!B0=|ZLMzwcT>>RM=Pfz zsuZRGWp1H`H9v-Fce1vcJV)Pdg87ptQw?>M{62g{o#Hg0&qodV%+Gz(vt|?j*j}br z4_nSGPdvX{mu5pV6CDRl7uvqnpe^kpt>X^LoVIgxa+!!WS@FRBY6E+{r6!MvaLX(qS-3*TA6;x>?gmOY?&|M7Zwyhx2Fp`qPLr5pbiR9+^nj#IP!~7X1A&e73gYJbO zH#@%{O?`uI3PQCbWF)`V`(&D^hB+`!LdYhBMr)0|DA&%GxZkh-Kj;6$Z_~ayCn0ns zP1}#xd1^_$g%c+sxg(?-2@Sf}8rMo}m~j*C_M>kX+I%WPJu@a0xC#a4{WUbVU-O6v z`HWbgzSuyW9$njG z%;6!VljB5kbG%mg;oFY6^Aj=0;m-d%2T~UdE%s+P#}ux*vTN_{oS{CiyRw}Te)zeH zxg~8Sj+EWdkK7*-F{6w~k0Vh9z9dRK6zw@3J~!@{;h#0GX|(pbv0C*yHE!c22Zr@@ zB(%wY%!BmXcD}~k`{Wd?Io`wb?Z};Lh3Q4%yg21P1+j78o4DS>ef*t_cnUFhLYcs3 z^MoIJqWrO{@r}2^oV5`BTK3?bCOKZ%cZ5V*x6C!49(O?teVb%NNt?gL zJ79D*!kqIN^h0zzbPInCHQu|R@(#W~SKc&vM#k6S2qnp-JyO9lyoc*D)(O&w{0T~e z%ei)@K%1xJ5_r7t@i@V`UCYR&-+8t)t_$t>uCmqH?}OIO8ZFLHG8eg1OPbmhl7EZh z<771M-@k&=vxzg%?pA-m>1hv)MjK|X%K!Xdd-ht`Qiz|bCo~d5gL!h_RY_|$hlh|( zjsxDIDv{Qn3exTU|BE1X9@i_lZlX-CR`+qn;crn!IiI$M^16d|r}fES#k;o6TR#mz zL*4&x;PcUp&kERZT?E@gpP8P*CVscx9&vVj_WO%IfN6#9BS#NXT%)OtDT+BxgT z;Pc^3zX!(Xq=^+WE`v6am;KpF#**ju37AalylG3bHvf-;Yx@6JA|rzJ5mZfiGo6Oy%)}U={rVhf zO=O$Dy^w4O0dn}LcJ(HG+CK9_BO4qq-oo$nf5~n6 z*p|)M|Ig<(_W#$XZR@Z#%^g0+{(rrPVLgb){(owZZ0!HvHf5;pyVi#5-B+WFg5<;wULYF!pF~!=sqjBZB_U)JxJBsd?fHki z;v|~rMnXsEMs}c3ns?(Qn&?JC8(S;8!pl4wt@C#nv(?lyynz0k-5bA&f>7-U38I(1 zwA$Jc8b+E@SqR;v@IkKC>PyLXlFPMm3c|G`B#6G@rKPjI)lNW2wuB1urQSA{pWEUT zgl0#`fM}$Bprq#aImIc&h(gw989llT9-qNB5JY>sVszYQg|@F8OhCdEPyBYiC4T%Yh21kG$@MSkndgpOxOH< zEFZ^M2=k=yV7wT~_qN}nGq30H5Z1|Y8uB#H_}M}W@3FUsiJlR%dc787A)I4*dM-Q| zUyI~vo|Ci(k6rH6VE2vS`7N4i&U`AuJu@a0xQH6FzJCtSFXPTRyQ-L{a1hF!VZrsr z99Qnf!~A@Vd1JoHx--6`DR-BV5%vYK(eAdpWyHPxOZxwdP&jwzDftFj@uv6LMsDGH zGJ6K9o&DKIKH}a2EUU~*n(`1C<}mTuC&!zX;#hdum!Q7JPm=;Hhxueghl1Ep<7VWZ zc6BQK7!kLA)7HbTEBJ~WBdH)PMzCf30mc^d0ryYF!m6VV`xCD{LT&gy?{T0Q&N zb?K>DCB0$FgMXd4hJ&XKotIj4uJ1j%?5&{FSJw=|Np$R;7IeGS zq8sa~*v_AtT4sIth)%_6K%b8NeO1iy58eO246c_;bYZsLLnVTJV0HM48@cLASS~r6Q&qJrKBKrlz`} zoQ`Nzm;#h}FIgFuE<3ttOPVHy`co36dZv`A*eUEDXA;;R-cwbkayZ8+l_(ZT35wai zZMQYnRHAa3h#Fb(z}}AS)Y-dz{vVst!95W)?&?^|Mzko34^8YiL6atI!A&r3_5}5f zJ0HW2+ORdp@iphqrK!xE1vk-h@U)@xhmp30D|<~kPtb1HT5AnUOtc*^Rg}$7gB@ks z&!6}{pHDG#|DPwh*)f?s+a@+l^eRrHv%Yg>PJ9IA-WvSX+Uu)kHlj;Wd}tDDvq(Re zulx8%9}Z1gII7ttU)E_Arkpo2XXh4sBA z`sp-;d14HZzT7}sypuF>PGupKlfpMx75W(c93#(~+pjUp(8WdAXUByOu~{s8KTWy3 zn}RUz2-!&VF>K06)Thu+bQTgsWAi6$b6Bq}o_x!bhdJ7z+jb1WNmS{bRzpd!=eBAu z33Up>JZ4+GkjUlYasPcepK|E_KiB`~o%Sp2GGgH#vDv=eX&;6oqbKHkJdTt;LA#n> zQkrsXIUP}>Fog!2!E=4SQ>8%664WUO>5h;f8fz6E!$W|pTgR4meVnn2i%`#I+K{vD z{WRH@SbnWj5XK!LL3Ghr=DLFR#BF*m+ZixTY;$-B<>WXGIhb|h*t4lq5Vo-#?1cnT zyIw2I!SoY4LJQ>7tbUMrbzPLp$O!p@*ieJ(kGYzdr-0g3#LH-RaCOiNRjrQ{4nn#! zEVy#ywJA?8qaUy9gu-+h!ZJ0!93|ISUiuLdb$XSNwRLlB??X*3rgR!YKQRVKzlNO789eK|rE7G(>AMTX=;vVe zuD3dydlPM$wxwOEzlqjj4^8~D ztL46WOLjU9;hq=+r2Vt4Eomu78b)TCzrB!b2mx|_Td?jUG`1nce)MG|D)dSRTK%V2 zcZ6Ei?aH$0>$A7SJuZ*%dV>Ess;sG849QD094t-f>9_ma_0*(VJ{8d>GbR+c&{(20 z5$~oTggZilD93lWR`CgJ&VKbrRraRoy9>SO=V0d7&ik;`y7tg-{`SJHAq2=RdAaQn zqlR|QnfrBc1d%NmcZw40LVsLQQwbk}lc>=9Dhr{X6dsKI+M0|tF>U(p!Z7+dnEg-9lGs&?Td0G%x`TEt+^@-< zAvE?_Ia_g-{6xDmy9b`%uYFI@+TtplaVCnR&~sxjpq1HQRWi$+PepQeW=ts1(Vta9 zyqkg$?g$B@e$6oU|KS0QJS6m@Y{0Ccf2$<-HGg~I)(`^ZdiO<@Fdl-FsL?wumHqz@ zkXx(j9LjnH4}*no&Q}X}&SOy)t|eTb;Nst_xbRtZgzF`)KjHc_uD{^=E3Uuc`a72&UrmuIVuP^QEkN9GK z7Ho9HF;VeqqT+RF`uUyd>r4AOz4HPe4nGU#?s&D)VSc9XFHK+X*jKY_(b)fgj-Id` c@0J~Innu6RtZ(kMLeK0T(0uIwM`t$v5BtW0K>z>% literal 0 HcmV?d00001 diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md new file mode 100644 index 00000000..125a3a0e --- /dev/null +++ b/doc_source/API_AllowedPublishers.md @@ -0,0 +1,20 @@ +# AllowedPublishers + +List of signing profiles that can sign a code package\. + +## Contents + + **SigningProfileVersionArns** +The Amazon Resource Name \(ARN\) for each of the signing profiles\. A signing profile defines a trusted user who can sign a code package\. +Type: Array of strings +Array Members: Minimum number of 1 item\. Maximum number of 20 items\. +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: Yes + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md new file mode 100644 index 00000000..9014e737 --- /dev/null +++ b/doc_source/API_CodeSigningConfig.md @@ -0,0 +1,47 @@ +# CodeSigningConfig + +Details about a Code signing configuration\. + +## Contents + + **AllowedPublishers** +List of allowed publishers\. +Type: [AllowedPublishers](API_AllowedPublishers.md) object +Required: Yes + + **CodeSigningConfigArn** +The Amazon Resource Name \(ARN\) of the Code signing configuration\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + + **CodeSigningConfigId** +Unique identifer for the Code signing configuration\. +Type: String +Pattern: `csc-[a-zA-Z0-9-_\.]{17}` +Required: Yes + + **CodeSigningPolicies** +The code signing policy controls the validation failure action for signature mismatch or expiry\. +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Required: Yes + + **Description** +Code signing configuration description\. +Type: String +Length Constraints: Minimum length of 0\. Maximum length of 256\. +Required: No + + **LastModified** +The date and time that the Code signing configuration was last modified, in ISO\-8601 format \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String +Required: Yes + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md new file mode 100644 index 00000000..82ca2b40 --- /dev/null +++ b/doc_source/API_CodeSigningPolicies.md @@ -0,0 +1,20 @@ +# CodeSigningPolicies + +Code signing configuration policies specifies the validation failure action for signature mismatch or expiry\. + +## Contents + + **UntrustedArtifactOnDeployment** +Code signing configuration policy for deployment validation failure\. If you set the policy to `Enforce`, Lambda blocks the deployment request if signature validation checks fail\. If you set the policy to `Warn`, Lambda allows the deployment and creates a CloudWatch log\. +Default value: `Warn` +Type: String +Valid Values:` Warn | Enforce` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md new file mode 100644 index 00000000..e7f55a0a --- /dev/null +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -0,0 +1,99 @@ +# CreateCodeSigningConfig + +Creates a code signing configuration\. A [code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html) defines a list of allowed signing profiles and defines the code\-signing validation policy \(action to be taken if deployment validation checks fail\)\. + +## Request Syntax + +``` +POST /2020-04-22/code-signing-configs/ HTTP/1.1 +Content-type: application/json + +{ + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string" +} +``` + +## URI Request Parameters + +The request does not use any URI parameters\. + +## Request Body + +The request accepts the following data in JSON format\. + + ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** +Signing profiles for this code signing configuration\. +Type: [AllowedPublishers](API_AllowedPublishers.md) object +Required: Yes + + ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** +The code signing policies define the actions to take if the validation checks fail\. +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Required: No + + ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** +Descriptive name for this code signing configuration\. +Type: String +Length Constraints: Minimum length of 0\. Maximum length of 256\. +Required: No + +## Response Syntax + +``` +HTTP/1.1 201 +Content-type: application/json + +{ + "CodeSigningConfig": { + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningConfigArn": "string", + "CodeSigningConfigId": "string", + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string", + "LastModified": "string" + } +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 201 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** +The code signing configuration\. +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index ad941e89..4e9d29c7 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -201,6 +201,8 @@ Content-type: application/json "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -279,6 +281,15 @@ The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Fixed number of 1 item\. + ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp + ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index f87bbbec..c43edef3 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -8,6 +8,8 @@ A function has an unpublished version, and can have published versions and alias The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. + If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. @@ -20,11 +22,13 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob }, + "CodeSigningConfigArn": "string", "DeadLetterConfig": { "TargetArn": "string" }, @@ -42,9 +46,15 @@ Content-type: application/json ], "FunctionName": "string", "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, + "PackageType": "string", "Publish": boolean, "Role": "string", "Runtime": "string", @@ -75,6 +85,13 @@ The code for the function\. Type: [FunctionCode](API_FunctionCode.md) object Required: Yes + ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** +To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: No + ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object @@ -115,7 +132,12 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: Yes +Required: No + + ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** +Configuration values that override the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object +Required: No ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. @@ -131,9 +153,15 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + ** [PackageType](#API_CreateFunction_RequestSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. +Type: String +Valid Values:` Zip | Image` Required: No ** [Publish](#API_CreateFunction_RequestSyntax) ** @@ -150,8 +178,8 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: Yes +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. @@ -205,6 +233,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -213,14 +252,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -286,6 +330,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -307,7 +355,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -319,9 +367,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_CreateFunction_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -335,7 +388,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -349,7 +412,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -372,8 +435,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +HTTP Status Code: 400 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md new file mode 100644 index 00000000..73ee4ae7 --- /dev/null +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -0,0 +1,64 @@ +# DeleteCodeSigningConfig + +Deletes the code signing configuration\. You can delete the code signing configuration only if no function is using it\. + +## Request Syntax + +``` +DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 204 +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 44f1d88c..70fc74c8 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -54,6 +54,8 @@ Content-type: application/json "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -132,6 +134,15 @@ The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Fixed number of 1 item\. + ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp + ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md new file mode 100644 index 00000000..e1044a4d --- /dev/null +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -0,0 +1,78 @@ +# DeleteFunctionCodeSigningConfig + +Removes the code signing configuration from the function\. + +## Request Syntax + +``` +DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `MyFunction`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. ++ **Partial ARN** \- `123456789012:function:MyFunction`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 204 +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. + +## Errors + + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + **TooManyRequestsException** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 9e78f5c5..273f4109 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -80,6 +80,17 @@ To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "U The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Fixed number of 1 item\. +Required: No + + **StartingPosition** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` +Required: No + + **StartingPositionTimestamp** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp Required: No **State** diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index 8487a2d7..e3f4b32c 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -1,9 +1,14 @@ # FunctionCode -The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\. +The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **S3Bucket** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 850b4594..31347605 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,6 +4,11 @@ Details about a function's deployment package\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **Location** A presigned URL that you can use to download the deployment package\. Type: String @@ -12,6 +17,11 @@ Required: No **RepositoryType** The service that's hosting the file\. Type: String +Required: No + + **ResolvedImageUri** +The resolved URI for the image\. +Type: String Required: No ## See Also diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 2fa66b1c..0ca44457 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -54,6 +54,11 @@ The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + **ImageConfigResponse** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No **KMSKeyArn** @@ -81,7 +86,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` Required: No **Layers** @@ -96,9 +101,15 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **MemorySize** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + **PackageType** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` Required: No **RevisionId** @@ -115,7 +126,19 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No + + **SigningJobArn** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No **State** @@ -132,7 +155,7 @@ Required: No **StateReasonCode** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` Required: No **Timeout** diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md new file mode 100644 index 00000000..3910db03 --- /dev/null +++ b/doc_source/API_GetCodeSigningConfig.md @@ -0,0 +1,82 @@ +# GetCodeSigningConfig + +Returns information about the specified code signing configuration\. + +## Request Syntax + +``` +GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "CodeSigningConfig": { + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningConfigArn": "string", + "CodeSigningConfigId": "string", + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string", + "LastModified": "string" + } +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** +The code signing configuration +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f073a04e..b9dba866 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -52,6 +52,8 @@ Content-type: application/json "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -130,6 +132,15 @@ The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Fixed number of 1 item\. + ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp + ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 247f695e..f3d54f64 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -41,8 +41,10 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "Location": "string", - "RepositoryType": "string" + "RepositoryType": "string", + "ResolvedImageUri": "string" }, "Concurrency": { "ReservedConcurrentExecutions": number @@ -72,6 +74,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -80,14 +93,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md new file mode 100644 index 00000000..2a4604df --- /dev/null +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -0,0 +1,96 @@ +# GetFunctionCodeSigningConfig + +Returns the code signing configuration for the specified function\. + +## Request Syntax + +``` +GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `MyFunction`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. ++ **Partial ARN** \- `123456789012:function:MyFunction`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "CodeSigningConfigArn": "string", + "FunctionName": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` + + ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `MyFunction`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. ++ **Partial ARN** \- `123456789012:function:MyFunction`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Type: String +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + **TooManyRequestsException** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 4d3a9dc4..37864cf3 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -66,6 +66,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +85,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -147,6 +163,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -168,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -180,9 +200,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -196,7 +221,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -210,7 +245,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d0469dc3..a6908afd 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -37,7 +37,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -58,7 +60,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 46aaf325..a42e0458 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -33,7 +33,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -54,7 +56,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md new file mode 100644 index 00000000..8322a632 --- /dev/null +++ b/doc_source/API_ImageConfig.md @@ -0,0 +1,31 @@ +# ImageConfig + +Configuration values that override the container image Dockerfile\. See [Override Container settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images-settings.html)\. + +## Contents + + **Command** +Specifies parameters that you want to pass in with ENTRYPOINT\. +Type: Array of strings +Array Members: Maximum number of 1500 items\. +Required: No + + **EntryPoint** +Specifies the entry point to their application, which is typically the location of the runtime executable\. +Type: Array of strings +Array Members: Maximum number of 1500 items\. +Required: No + + **WorkingDirectory** +Specifies the working directory\. +Type: String +Length Constraints: Maximum length of 1000\. +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md new file mode 100644 index 00000000..b43ac4bc --- /dev/null +++ b/doc_source/API_ImageConfigError.md @@ -0,0 +1,23 @@ +# ImageConfigError + +Error response to GetFunctionConfiguration\. + +## Contents + + **ErrorCode** +Error code\. +Type: String +Required: No + + **Message** +Error message\. +Type: String +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md new file mode 100644 index 00000000..4b19ddeb --- /dev/null +++ b/doc_source/API_ImageConfigResponse.md @@ -0,0 +1,23 @@ +# ImageConfigResponse + +Response to GetFunctionConfiguration request\. + +## Contents + + **Error** +Error response to GetFunctionConfiguration\. +Type: [ImageConfigError](API_ImageConfigError.md) object +Required: No + + **ImageConfig** +Configuration values that override the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index df0d9d16..13cc1eab 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -14,6 +14,18 @@ Required: No **CodeSize** The size of the layer archive in bytes\. Type: Long +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 09f64516..99cecb7d 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -17,6 +17,16 @@ Required: No **Location** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String Required: No ## See Also diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 2e858f4a..69fd3776 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md new file mode 100644 index 00000000..517dbaf5 --- /dev/null +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -0,0 +1,86 @@ +# ListCodeSigningConfigs + +Returns a list of [code signing configurations](https://docs.aws.amazon.com/lambda/latest/dg/configuring-codesigning.html)\. A request returns up to 10,000 configurations per call\. You can use the `MaxItems` parameter to return fewer configurations per call\. + +## Request Syntax + +``` +GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** +Specify the pagination token that's returned by a previous request to retrieve the next page of results\. + + ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** +Maximum number of items to return\. +Valid Range: Minimum value of 1\. Maximum value of 10000\. + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "CodeSigningConfigs": [ + { + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningConfigArn": "string", + "CodeSigningConfigId": "string", + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string", + "LastModified": "string" + } + ], + "NextMarker": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** +The code signing configurations +Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects + + ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** +The pagination token that's included if more results are available\. +Type: String + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 803b3be6..2e76c132 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -77,6 +77,8 @@ Content-type: application/json "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index ae21f90a..e2f10d65 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -66,6 +66,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +85,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md new file mode 100644 index 00000000..39443594 --- /dev/null +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -0,0 +1,84 @@ +# ListFunctionsByCodeSigningConfig + +List the functions that use the specified code signing configuration\. You can use this method prior to deleting a code signing configuration, to verify that no functions are using it\. + +## Request Syntax + +``` +GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marker&MaxItems=MaxItems HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + + ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** +Specify the pagination token that's returned by a previous request to retrieve the next page of results\. + + ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** +Maximum number of items to return\. +Valid Range: Minimum value of 1\. Maximum value of 10000\. + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "FunctionArns": [ "string" ], + "NextMarker": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** +The function ARNs\. +Type: Array of strings +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + + ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** +The pagination token that's included if more results are available\. +Type: String + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 1e38e5f3..ed2b84b1 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index cf6939f7..91720146 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index cfdddb83..f5232b20 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -69,6 +69,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -77,14 +88,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 4dedc902..70a90b0c 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -4,19 +4,24 @@ The following actions are supported: + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) ++ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) ++ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) ++ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) ++ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -28,9 +33,11 @@ The following actions are supported: + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) ++ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) ++ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -38,6 +45,7 @@ The following actions are supported: + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) ++ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -46,6 +54,7 @@ The following actions are supported: + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) ++ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index fcbe9f72..2bd56784 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -75,7 +75,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -96,7 +98,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 4e1749f3..8d931a84 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -86,6 +86,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -94,14 +105,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -167,6 +183,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -188,7 +208,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -200,9 +220,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_PublishVersion_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -216,7 +241,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -230,7 +265,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md new file mode 100644 index 00000000..18cc1352 --- /dev/null +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -0,0 +1,116 @@ +# PutFunctionCodeSigningConfig + +Update the code signing configuration for the function\. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function\. + +## Request Syntax + +``` +PUT /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 +Content-type: application/json + +{ + "CodeSigningConfigArn": "string" +} +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `MyFunction`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. ++ **Partial ARN** \- `123456789012:function:MyFunction`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + +## Request Body + +The request accepts the following data in JSON format\. + + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "CodeSigningConfigArn": "string", + "FunctionName": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` + + ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `MyFunction`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. ++ **Partial ARN** \- `123456789012:function:MyFunction`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Type: String +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` + +## Errors + + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + **TooManyRequestsException** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index ebedf4f7..4bf0046a 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -5,6 +5,9 @@ The following data types are supported: + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) ++ [AllowedPublishers](API_AllowedPublishers.md) ++ [CodeSigningConfig](API_CodeSigningConfig.md) ++ [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -17,6 +20,9 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [ImageConfig](API_ImageConfig.md) ++ [ImageConfigError](API_ImageConfigError.md) ++ [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md new file mode 100644 index 00000000..c7f21012 --- /dev/null +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -0,0 +1,109 @@ +# UpdateCodeSigningConfig + +Update the code signing configuration\. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function\. + +## Request Syntax + +``` +PUT /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 +Content-type: application/json + +{ + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string" +} +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** +The The Amazon Resource Name \(ARN\) of the code signing configuration\. +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: Yes + +## Request Body + +The request accepts the following data in JSON format\. + + ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** +Signing profiles for this code signing configuration\. +Type: [AllowedPublishers](API_AllowedPublishers.md) object +Required: No + + ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** +The code signing policy\. +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Required: No + + ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** +Descriptive name for this code signing configuration\. +Type: String +Length Constraints: Minimum length of 0\. Maximum length of 256\. +Required: No + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "CodeSigningConfig": { + "AllowedPublishers": { + "SigningProfileVersionArns": [ "string" ] + }, + "CodeSigningConfigArn": "string", + "CodeSigningConfigId": "string", + "CodeSigningPolicies": { + "UntrustedArtifactOnDeployment": "string" + }, + "Description": "string", + "LastModified": "string" + } +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** +The code signing configuration +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object + +## Errors + + **InvalidParameterValueException** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + **ResourceNotFoundException** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + **ServiceException** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index c6a09e35..3aaf4d5f 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -156,6 +156,8 @@ Content-type: application/json "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], @@ -234,6 +236,15 @@ The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Fixed number of 1 item\. + ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp + ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index f0f55d47..09bff2e4 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -1,9 +1,12 @@ # UpdateFunctionCode -Updates a Lambda function's code\. +Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\. +**Note** +For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. + ## Request Syntax ``` @@ -12,6 +15,7 @@ Content-type: application/json { "DryRun": boolean, + "ImageUri": "string", "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", @@ -44,6 +48,11 @@ The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean +Required: No + + ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** +URI of a container image in the Amazon ECR registry\. +Type: String Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** @@ -111,6 +120,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -119,14 +139,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -192,6 +217,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -213,7 +242,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -225,9 +254,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -241,7 +275,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -255,7 +299,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -278,8 +322,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +HTTP Status Code: 400 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f4b2ea77..52a19ce9 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -31,6 +31,11 @@ Content-type: application/json } ], "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, @@ -95,6 +100,11 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** +Configuration values that override the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -111,9 +121,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -130,7 +140,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -180,6 +190,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -188,14 +209,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -261,6 +287,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -282,7 +312,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -294,9 +324,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -310,7 +345,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -324,7 +369,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -347,6 +392,18 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. +HTTP Status Code: 400 + **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 1b0b9cd0..58d81fc7 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -6,7 +6,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc **To view a function's resource\-based policy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 372e7152..d5b82cb2 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -29,9 +29,9 @@ The pipeline maps a single branch in a repository to a single application stack\ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index bb818209..ef4c0aaa 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -29,9 +29,9 @@ The following are recommended best practices for using AWS Lambda: To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. + **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. + **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. -+ **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [AWS Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. ++ **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. -+ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [AWS Lambda deployment package in Java](java-package.md) for instructions\. ++ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip file archives](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. @@ -43,9 +43,13 @@ The following are recommended best practices for using AWS Lambda: ``` By analyzing the `Max Memory Used:` field, you can determine if your function needs more memory or if you over\-provisioned your function's memory size\. + + **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. + + To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [Creating faster AWS Lambda functions with AVX2](https://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. -+ **Be familiar with [AWS Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. ++ **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. + **Delete Lambda functions that you are no longer using\.** By doing so, the unused functions won't needlessly count against your deployment package size limit\. + **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected invocation time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. + In the case of **CreateFunction**, AWS Lambda will fail the function creation process\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 1faaea79..52a4cc99 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -4,7 +4,7 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is **To create an alias** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose the name of a function\. @@ -85,7 +85,7 @@ You can point an alias to a maximum of two Lambda function versions\. The versio **To configure routing on an alias** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose the name of a function\. diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md index 73c356fd..05d3a723 100644 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -2,6 +2,9 @@ Code signing for AWS Lambda helps to ensure that only trusted code runs in your Lambda functions\. When you enable code signing for a function, Lambda checks every code deployment and verifies that the code package is signed by a trusted source\. +**Note** +Functions defined as container images do not support code signing\. + To verify code integrity, use [AWS Signer](https://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html) to create digitally signed code packages for functions and layers\. When a user attempts to deploy a code package, Lambda performs validation checks on the code package before accepting the deployment\. Because code signing validation checks run at deployment time, there is no performance impact on function execution\. You also use AWS Signer to create *signing profiles*\. You use a signing profile to create the signed code package\. Use AWS Identity and Access Management \(IAM\) to control who can sign code packages and create signing profiles\. For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/signer/latest/developerguide/accessctrl-toplevel.html) in the *AWS Signer Developer Guide*\. @@ -116,7 +119,7 @@ To enable code signing for a function, you associate a code signing configuratio **To associate a code signing configuration with a function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose the function for which you want to enable code signing\. diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 50a16513..db4c7904 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -23,7 +23,7 @@ To manage reserved concurrency settings for a function, use the Lambda console\. **To reserve concurrency for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -57,7 +57,7 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd **To reserve concurrency for an alias** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 120756da..02e7ef4f 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -1,33 +1,33 @@ -# Configuring functions in the AWS Lambda console +# Configuring functions in the console You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code\. -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. The function designer is at the top of the configuration page\. +To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. Under **Aliases**, choose `Latest`\. The function designer is near the top of the page\. ![\[The function designer in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -The designer shows an overview of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. +The designer shows an overview of your function and its upstream and downstream resources\. + +You can use it to configure triggers, layers, and destinations\. + **Triggers** – Triggers are services and resources that you have configured to invoke your function\. Choose **Add trigger** to create a Lambda [event source mapping](invocation-eventsourcemapping.md) or to configure a trigger in another service that the Lambda console integrates with\. For details about these services and others, see [Using AWS Lambda with other services](lambda-services.md)\. -+ **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies\. ++ **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a \.zip file archive that contains libraries, a custom runtime, or other dependencies\. + **Destinations** – Add a destination to your function to send details about invocation results to another service\. You can send invocation records when your function is invoked [asynchronously](invocation-async.md), or by an [event source mapping](invocation-eventsourcemapping.md) that reads from a stream\. -With the function node selected in the designer, you can modify the following settings\. +With the `Latest` function version selected, you can modify the following settings\. **Function settings** -+ **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, upload a [deployment package](gettingstarted-features.md#gettingstarted-features-package)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. ++ **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a [deployment package](gettingstarted-package.md)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. + **Runtime** – The [Lambda runtime](lambda-runtimes.md) that runs your function\. + **Handler** – The method that the runtime runs when your function is invoked, such as `index.handler`\. The first value is the name of the file or module\. The second value is the name of the method\. -+ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\. ++ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. + **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. Tags apply to the entire function, including all versions and aliases\. -+ **Execution role** – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. ++ **Execution role** – The [AWS Identity and Access Management \(IAM\) role](lambda-intro-execution-role.md) that Lambda assumes when it runs your function\. + **Description** – A description of the function\. -+ **Memory**– The amount of memory available to the function while it is running\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. - - Lambda allocates CPU power linearly in proportion to the amount of memory configured\. At 1,792 MB, a function has the equivalent of one full vCPU \(one vCPU\-second of credits per second\)\. -+ **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. -+ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a VPC](configuration-vpc.md)\. ++ **Memory**– The amount of memory available to the function at runtime\. To [set the memory for your function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html), enter a value between 128 MB and 10,240 MB in 1\-MB increments\. ++ **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. ++ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. + **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. + **Active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. + **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index b8be6fdb..c13a3714 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -4,7 +4,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for **To create a database proxy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -75,11 +75,11 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. ## Sample application Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) -+ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. + [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) ++ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) + [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index f2707f8e..e17e2131 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -9,7 +9,7 @@ You set environment variables on the unpublished version of your function by spe **To set environment variables in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -148,7 +148,7 @@ When you provide the key, only users in your account with access to the key can **To use a customer managed CMK** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -199,7 +199,7 @@ You can also encrypt environment variable values on the client side before sendi **To encrypt environment variables on the client side** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -271,4 +271,4 @@ Sample applications in this guide's GitHub repository demonstrate the use of env **Sample applications** + [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 4ddb4433..2a9a0a32 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -9,7 +9,7 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu **To configure file system access** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -174,4 +174,4 @@ For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and f ## Sample applications The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md new file mode 100644 index 00000000..35a6a8cd --- /dev/null +++ b/doc_source/configuration-images.md @@ -0,0 +1,202 @@ +# Configuring functions defined as container images + +You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. + +**Note** +You cannot convert an existing \.zip file archive function to use a container image\. You must create a new function\. + +When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. + +**Note** +In Amazon ECR, if you reassign the image tag to another image, Lambda does not update the image version\. + +**Topics** ++ [Function version $LATEST](#configuration-images-latest) ++ [Container image deployment](#configuration-images-optimization) ++ [Update the user permissions](#configuration-images-permissions) ++ [Override the container settings](#configuration-images-settings) ++ [Creating a function \(console\)](#configuration-images-create) ++ [Updating the function code \(console\)](#configuration-images-update) ++ [Overriding the image parameters \(console\)](#configuration-images-parms) ++ [Using the Lambda API](#configuration-images-api) ++ [AWS CloudFormation](#configuration-images-cloudformation) + +## Function version $LATEST + +When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. The unpublished version is named **$LATEST**\. To view the current function version, choose the function, then choose **Qualifiers**\. + +Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. + +For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. + +## Container image deployment + +When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. + +## Update the user permissions + +Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. + +For example, use the IAM console to create a role with the following policy: + +``` +{ + "Version": "2012-10-17", + "Statement": { + [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "ecr:SetRepositoryPolicy", + "ecr:GetRepositoryPolicy" + ], + "Resource": "arn:aws:ecr:::repository//" + } + ] + } +} +``` + +## Override the container settings + +You can use the Lambda console or the Lambda API to override the following container image settings: ++ ENTRYPOINT – Specifies the absolute path of the entry point to the application\. ++ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. ++ WORKDIR – Specifies the absolute path of the working directory\. ++ ENV – Specifies an environment variable for the Lambda function\. + +Any values that you provide in the Lambda console or the Lambda API override the values [in the Dockerfile](images-create.md#images-parms)\. + +## Creating a function \(console\) + +To create a function defined as a container image, you must first [create the image](images-create.md) and then store the image in the Amazon ECR repository\. + +**To create the function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose the **Container image** option\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter the function name\. + + 1. For **Container image URI**, enter the Amazon ECR image URI\. + + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. + + 1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: + + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: + + ``` + "/usr/bin/npx", "aws-lambda-ric" + ``` + + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: + + ``` + "app.handler" + ``` + + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: + + ``` + "/var/task" + ``` +**Note** +For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. + +1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. + +1. Choose **Create function**\. + +## Updating the function code \(console\) + +After you deploy a container image to a function, the image is read\-only\. To update the function code, you must first deploy a new image version\. [Create a new image version](images-create.md), and then store the image in the Amazon ECR repository\. + +**To configure the function to use an updated container image** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update\. + +1. Under **Image**, choose **Deploy new image**\. + +1. Choose **Browse images**\. + +1. In the **Select container image** dialog box, select the Amazon ECR repository from the dropdown list, and then select the new image version\. + +1. Choose **Save**\. + +## Overriding the image parameters \(console\) + +You can use the Lambda console to override the configuration values in the container image\. + +**To override the configuration values in the container image** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update\. + +1. Under **Image configuration**, choose **Edit**\. + +1. Enter new values for any of the override settings, and then choose **Save**\. + +1. \(Optional\) To add or override environment variables, under **Environment variables**, choose **Edit**\. + + For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. + +## Using the Lambda API + +To manage functions defined as container images, use the following API operations: ++ [CreateFunction](API_CreateFunction.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. + +``` +aws lambda create-function --region sa-east-1 --function-name my-function \ + --package-type Image \ + --code ImageUri= \ + --role arn:aws:iam::123456789012:role/lambda-ex +``` + +To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\. + +**Note** +You cannot change the `package-type` of a function\. + +``` +aws lambda update-function-code --region sa-east-1 --function-name my-function \ + --imageUri \ +``` + +To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--image-config '{"EntryPoint": ["/usr/bin/npx", "aws-lambda-ric"], \ + "Command": ["app.handler"] , \ + "WorkingDirectory": "/var/task"}' +``` + +## AWS CloudFormation + +You can use AWS CloudFormation to create Lambda functions defined as container images\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. + +In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a container image: ++ AWS::Lambda::Function + + PackageType – Set to `Image`\. + + Code – Enter your container image URI in the `ImageUri` field\. + + ImageConfig – \(Optional\) Override the container image configuration properties\. + +The `AWS::Lambda::Function::ImageConfig` resource contains the following fields: ++ Command – Specifies parameters that you want to pass in with `EntryPoint`\. ++ EntryPoint – Specifies the entry point to the application\. ++ WorkingDirectory – Specifies the working directory\. + +**Note** +If you declare an `ImageConfig` resource in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. + +For information about the `ImageConfig` resource, see [ImageConfig](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-imageconfig.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 1c0694fb..7178be02 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,11 +1,14 @@ # AWS Lambda layers -You can configure your Lambda function to pull in additional code and content in the form of layers\. A layer is a ZIP archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. +You can configure your Lambda function to pull in additional code and content in the form of layers\. A layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. + +**Note** +Functions defined as a container images do not support Lambda layers\. You can package your preferred runtimes and dependencies as a part of the container image when you build the image\. Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. **Note** -A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [AWS Lambda quotas](gettingstarted-limits.md)\. +A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. You can create layers, or use layers published by AWS and other AWS customers\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/), or all accounts\. @@ -63,7 +66,7 @@ The creator of a layer can delete the version of the layer that you're using\. W ## Managing layers -To create a layer, use the `publish-layer-version` command with a name, description, ZIP archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. +To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. ``` $ aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ @@ -256,9 +259,9 @@ When you update your dependencies and deploy, AWS SAM creates a new version of t ## Sample applications The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md new file mode 100644 index 00000000..1ecbcf60 --- /dev/null +++ b/doc_source/configuration-memory.md @@ -0,0 +1,19 @@ +# Configuring Lambda function memory + +AWS Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your function at runtime\. You can increase or decrease the memory and CPU power allocated to your Lambda function using the Memory \(MB\) setting\. To set the memory for your function, enter a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. This page describes how to update the memory allotted to your function on the Lambda console\. + +## Configuring function memory on the Lambda console + +You can configure the memory of your function in a text field on the Lambda console\. + +**To update the memory for an existing function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Edit** on the **Basic settings** pane\. + +1. Enter a value in the text box\. + +1. Choose **Save**\. \ No newline at end of file diff --git a/doc_source/configuration-preview.md b/doc_source/configuration-preview.md index 6dfba00a..2bebab89 100644 --- a/doc_source/configuration-preview.md +++ b/doc_source/configuration-preview.md @@ -7,26 +7,13 @@ | --- | | Public preview The updated AWS Lambda console is in preview release and is subject to change\. The preview is available to AWS accounts on a region by region basis\. The changes include a new function\-level configuration page, increased visibility into versions and aliases, and a dedicated section for your code\. To provide feedback, visit the updated console \([https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\) and select **Tell us what you think**\. | - You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console preview\. - -The text and workflows are subject to change throughout the preview\. + You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console\. **Topics** -+ [Manage preview settings](#configuration-preview-manage) + [Configure function settings](#configuration-preview-settings) + [Add and edit triggers and destinations](#configuration-preview-triggers) + [Edit and update code](#configuration-preview-code) -## Manage preview settings - -![\[The toggle to update your console experience.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sidebar.png) - -To manage your active console experience, activate the **Updated console \(preview\)** toggle in the console's left\-hand navigation\. - -To protect unsaved changes the console experience can only be updated on Lambda console pages where you are not creating or editing a resource\. - -The feedback option is available after activating the updated console\. Select **Tell us what you think** at any time to write feedback\. The feedback form will also be provided when you deactivate the updated console preview\. - ## Configure function settings To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index ce25badd..3aa5fcd3 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -4,7 +4,7 @@ You can tag Lambda functions to organize them by owner, project or department\. **To add tags to a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -19,7 +19,7 @@ You can filter functions based on the presence or value of a tag with the Lambda **To filter functions with tags** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Click within the search bar to see a list of function attributes and tag keys\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index f7b7528a..8bfe7d5d 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -8,11 +8,11 @@ A function version includes the following information: + All of the function settings, including the environment variables\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the AWS Lambda console](configuration-console.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the console](configuration-console.md)\. **To create a new version of a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose the name of the function that you want to publish\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 0934bf38..eea956ec 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -45,7 +45,7 @@ If your [IAM permissions](#vpc-conditions) allow you only to create Lambda funct **To configure a VPC when you create a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose **Create function**\. @@ -63,7 +63,7 @@ To access private resources, connect your function to private subnets\. If your **To configure a VPC for an existing function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 73d4aaa8..76ff9c4d 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -50,7 +50,7 @@ All other types, as listed below, require you to specify a serializer\. + For asynchronous invocations the return\-type will be ignored by Lambda\. The return type may be set to void in such cases\. + If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with AWS Lambda](#csharp-handler-async)\. -Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [AWS Lambda Deployment Package in C\#](csharp-package.md)\. +Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `project.json` file\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md new file mode 100644 index 00000000..da6dcc7e --- /dev/null +++ b/doc_source/csharp-image.md @@ -0,0 +1,28 @@ +# Deploy \.NET Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your \.NET function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for \.NET + +AWS provides the following base images for \.NET: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | +| core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | + +Docker Hub repository: amazon/aws\-lambda\-dotnet + +Amazon ECR repository: public\.ecr\.aws/lambda/dotnet + +## \.NET runtime interface clients + +Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 851bc1d0..ac5fd8e0 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -118,7 +118,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -168,7 +168,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index a53197ef..85cf3997 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -1,6 +1,6 @@ # \.NET Core CLI -The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes you have installed the \.NET Core CLI\. If you haven't, do so [here](https://www.microsoft.com/net/download/windows)\. +The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes that you have installed the \.NET Core CLI\. If you haven't, see [Download \.NET](https://dotnet.microsoft.com/download) on the Microsoft website\. In the \.NET CLI, you use the `new` command to create \.NET projects from a command line\. This is useful if you want to create a project outside of Visual Studio\. To view a list of the available project types, open a command line and navigate to where you installed the \.NET Core runtime and run the following command: @@ -21,22 +21,22 @@ Examples: dotnet new --help ``` -AWS Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) nuget package\. To install this package, run the following command: +Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) nuget package\. To install this package, run the following command: ``` dotnet new -i Amazon.Lambda.Templates ``` -Once the install is complete, the Lambda templates show up as part of `dotnet new`\. To examine details about a template, use the help option\. +Once the install is complete, the Lambda templates show up as part of `dotnet new`\. To examine details about a template, use the `help` option\. ``` dotnet new lambda.EmptyFunction --help ``` -The `lambda.EmptyFunction` template supports the following options\. -+ `--name` – The name of the function\. -+ `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html)\. -+ `--region` – The AWS Region to create the function in\. +The `lambda.EmptyFunction` template supports the following options: ++ `--name` – The name of the function ++ `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) ++ `--region` – The AWS Region to create the function in These options are saved to a file named `aws-lambda-tools-defaults.json`\. @@ -102,8 +102,8 @@ Under the `src/myfunction` directory, examine the following files: ``` + **Readme**: Use this file to document your Lambda function\. -Under the `myfunction/test directory, examine the following files:` -+ **myFunction\.Tests\.csproj**: As noted above, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, allowing you to seamlesssly integrate any Lambda templates required to test your function\. +Under the `myfunction/test` directory, examine the following files: ++ **myFunction\.Tests\.csproj**: As noted previously, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, allowing you to seamlessly integrate any Lambda templates required to test your function\. ``` @@ -145,33 +145,33 @@ Under the `myfunction/test directory, examine the following files:` } ``` -Once your function has passed its tests, you can build and deploy using the Amazon\.Lambda\.Tools \.NET Core Global Tool\. To install the \.NET Core Global Tool run the following command\. +Once your function has passed its tests, you can build and deploy using the Amazon\.Lambda\.Tools [\.NET Core Global Tool](http://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/)\. To install the \.NET Core Global Tool, run the following command: ``` dotnet tool install -g Amazon.Lambda.Tools ``` -If you already have the tool installed you can make sure you are using the latest version with the following command\. +If you already have the tool installed, you can make sure that it is the latest version using the following command: ``` dotnet tool update -g Amazon.Lambda.Tools ``` -For more information about the Amazon\.Lambda\.Tools \.NET Core Global see its [GitHub repository](https://github.com/aws/aws-extensions-for-dotnet-cli)\. +For more information about the Amazon\.Lambda\.Tools \.NET Core Global Tool, see the [AWS Extensions for \.NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) repository on GitHub\. -With the Amazon\.Lambda\.Tools installed you can deploy your function with the following command: +With the Amazon\.Lambda\.Tools installed, you can deploy your function using the following command: ``` dotnet lambda deploy-function MyFunction --function-role role ``` -After deployment, you can re\-test it in a production environment with the following command and pass in a different value to your Lambda function handler: +After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: ``` dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" ``` -Presuming everything was successful, you should see the following: +If everything is successful, you see the following: ``` dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" @@ -181,5 +181,5 @@ Payload: Log Tail: START RequestId: id Version: $LATEST END RequestId: id -REPORT RequestId: id Duration: 0.99 ms Billed Duration: 100 ms Memory Size: 256 MB Max Memory Used: 12 MB +REPORT RequestId: id Duration: 0.99 ms Billed Duration: 1 ms Memory Size: 256 MB Max Memory Used: 12 MB ``` \ No newline at end of file diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index 5895269f..e43ddef3 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -1,20 +1,20 @@ # AWS Toolkit for Visual Studio -You can build \.NET\-based Lambda applications using the Lambda plugin to the [AWS Toolkit for Visual Studio](https://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. +You can build \.NET\-based Lambda applications using the Lambda plugin to the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. -1. Launch Microsoft Visual Studio and choose **New project**\. +1. Launch Microsoft Visual Studio and choose **New project**\. - 1. From the **File** menu, choose **New**, and then choose **Project**\. + 1. From the **File** menu, choose **New**, and then choose **Project**\. - 1. In the **New Project** window, choose **AWS Lambda Project \(\.NET Core\)** and then choose **OK**\. + 1. In the **New Project** window, choose **AWS Lambda Project \(\.NET Core\)**, and then choose **OK**\. - 1. In the **Select Blueprint** window, you will be presented with the option of selecting from a list of sample applications that will provide you with sample code to get started with creating a \.NET\-based Lambda application\. + 1. In the **Select Blueprint** window, you can select from a list of sample applications that provide you with sample code to get started with creating a \.NET\-based Lambda application\. - 1. To create a Lambda application from scratch, choose **Empty Function** and then choose **Finish**\. + 1. To create a Lambda application from scratch, choose **Empty Function**, and then choose **Finish**\. -1. Examine the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which is read by the Lambda tooling by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: - + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html)\. - + **function\-handler** – This is where the `function handler` is specified, which is why you don't have to set it in the wizard\. However, whenever you rename the *Assembly*, *Namespace*, *Class* or *Function* in your function code, you will need to update the corresponding fields in the `aws-lambda-tools-defaults.json file`\. +1. Review the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which the Lambda tooling reads by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: + + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) + + **function\-handler** – This is where the `function handler` is specified, which is why you don't have to set it in the wizard\. However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. ``` { @@ -29,22 +29,22 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A } ``` -1. Open the **Function\.cs** file\. You will be provided with a template to implement your Lambda function handler code\. +1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambda-function.png) -1. Once you have written the code that represents your Lambda function, you can upload it by right\-clicking the **Project** node in your application and then choosing **Publish to AWS Lambda**\. +1. Once you have written the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. -1. In the **Upload Lambda Function** window, type a name for the function or select a previously published function to republish\. Then choose **Next** +1. In the **Upload Lambda Function** window, enter a name for the function, or select a previously published function to republish\. Then choose **Next**\. 1. In the **Advanced Function Details** window, configure the following options: - + **Role Name** \(required\) – The [IAM role](lambda-intro-execution-role.md) that AWS Lambda assumes when it runs your function\. - + **Environment** – Key\-value pairs that Lambda sets in the execution environment\. [ Use environment variables](configuration-envvars.md) to extend your function's configuration outside of code\. - + **Memory** – The amount of memory available to the function while it is running\. Choose an amount [between 128 MB and 3,008 MB](gettingstarted-limits.md) in 64\-MB increments\. - + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. - + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a VPC](configuration-vpc.md)\. - + **DLQ** – If your function is invoked asynchronously, [choose a queue or topic](invocation-async.md#dlq) to receive failed invocations\. + + **Role Name** \(required\) – The [AWS Identity and Access Management \(IAM\) role](lambda-intro-execution-role.md) that Lambda assumes when it runs your function\. + + **Environment** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. + + **Memory** – The amount of memory available to the function at runtime\. Choose an amount [between 128 MB and 10,240 MB](gettingstarted-limits.md) in 1\-MB increments\. + + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. + + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. + + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#dlq) to receive failed invocations\. + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. -1. Choose **Next** and then choose **Upload** to deploy your application\. +1. Choose **Next**, and then choose **Upload** to deploy your application\. For more information, see [Deploying an AWS Lambda Project with the \.NET Core CLI](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-cli-publish.html)\. \ No newline at end of file diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index cf75e455..39aaad94 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -1,8 +1,12 @@ -# AWS Lambda Deployment Package in C\# +# Deploy C\# Lambda functions with \.zip file archives -A \.NET Core Lambda deployment package is a zip file of your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the \.NET Core runtime\. The \.NET CLI’s `publish` command can create a folder with all of these files, but by default the `proj.runtimeconfig.json` will not be included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument: `/p:GenerateRuntimeConfigurationFiles=true to the publish command`\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -Although it is possible to create the deployment package with the `dotnet publish` command, we suggest you create the deployment package with either the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) or the [\.NET Core CLI](csharp-package-cli.md)\. These are tools optimized specifically for Lambda to ensure the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. +A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. + +A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. However, by default the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. + +Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. **Topics** + [\.NET Core CLI](csharp-package-cli.md) diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index eb10367e..f2ecd361 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index e4e73fe0..680423d6 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,28 +1,44 @@ # Create a Lambda function with the console -In this Getting Started exercise you create a Lambda function using the AWS Lambda console\. Next, you manually invoke the Lambda function using sample event data\. Lambda runs the Lambda function and returns results\. You then verify the results, including the logs that your Lambda function created and various Amazon CloudWatch metrics\. +In the following getting started exercises, you create Lambda functions using the console\. -**To create a Lambda function** +In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. -1. Open the [AWS Lambda console](https://console.aws.amazon.com/lambda/home)\. +In the next exercise, you create a function defined as a container image\. First, create a container image for your function code, and then use the Lambda console to create a function from the container image\. -1. Choose **Create a function**\. +**Topics** ++ [Create a Lambda function with default function code](#gettingstarted-zip-function) ++ [Create a function defined as a container image](#gettingstarted-images) -1. For **Function name**, enter **my\-function**\. +## Create a Lambda function with default function code + +In this getting started exercise, you create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. Next, you manually invoke the Lambda function using sample event data\. Lambda runs the function and returns results\. You then verify the results, including the logs that your Lambda function created and various Amazon CloudWatch metrics\. + +**To create a Lambda function with the console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter **my\-function**\. + + 1. For **Runtime**, confirm that **Node\.js 12\.x** is selected\. 1. Choose **Create function**\. -Lambda creates a Node\.js function and an execution role that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses it to create credentials for the AWS SDK and to read data from event sources\. +Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -## Use the designer +### Use the designer The **Designer** shows an overview of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. -![\[A Lambda function with an Amazon S3 trigger and Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) +![\[A Lambda function with an Amazon S3 trigger and an Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -Choose **my\-function** in the designer to return to the function's code and configuration\. For scripting languages, Lambda includes sample code that returns a success response\. You can edit your function code with the embedded [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/) editor as long as your source code doesn't exceed the 3 MB limit\. +Choose **my\-function** in the designer to return to the function's code and configuration\. For scripting languages, Lambda includes sample code that returns a success response\. You can edit your function code with the embedded [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html) editor as long as your source code doesn't exceed the 3 MB limit\. -## Invoke the Lambda function +### Invoke the Lambda function Invoke your Lambda function using the sample event data provided in the console\. @@ -30,66 +46,270 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. In the upper right corner, choose **Test**\. -1. In the **Configure test event** page, choose **Create new test event** and in **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: +1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: ``` { - "key3": "value3", - "key2": "value2", - "key1": "value1" - } + "key1": "value1", + "key2": "value2", + "key3": "value3" + } + ``` + + You can change keys and values in the sample JSON, but don't change the event structure\. If you do change any keys and values, you must update the sample code accordingly\. + +1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + + Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. + +1. Upon successful completion, view the results in the console\. + + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. + +1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + +### Clean up + +If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. + +**To delete a Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Actions**, **Delete**\. + +1. In the **Delete function** dialog box, choose **Delete**\. + +**To delete the log group** + +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. + +1. Select the function's log group \(`/aws/lambda/my-function`\)\. + +1. Choose **Actions**, **Delete log group\(s\)**\. + +1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management \(IAM\) console\. + +1. Select the function's role \(`my-function-role-31exxmpl`\)\. + +1. Choose **Delete role**\. + +1. In the **Delete role** dialog box, choose **Yes, delete**\. + +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. + +## Create a function defined as a container image + +In this getting started exercise, you use the Docker CLI to create a container image and then use the Lambda console to create a function from the container image\. + +**Topics** ++ [Prerequisites](#gettingstarted-images-prereq) ++ [Create the image](#gettingstarted-images-package) ++ [Update the user permissions](#gettingstarted-images-permissions) ++ [Create a Lambda function defined as a container image](#gettingstarted-images-function) ++ [Invoke the Lambda function](#get-started-invoke-function) ++ [Clean up](#gettingstarted-image-cleanup) + +### Prerequisites + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: + +``` +~/lambda-project$ this is a command +this is output +``` + +For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + +On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + +This exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. + +### Create the image + +AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. + +In the following commands, replace `123456789012` with your AWS account ID\. + +**To create an image using an AWS base image for Lambda** + +1. On your local machine, create a project directory for your new function\. + +1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: + + ``` + exports.handler = async (event) => { + // TODO implement + const response = { + statusCode: 200, + body: JSON.stringify('Hello from Lambda!'), + }; + return response; + }; + ``` + +1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: + + ``` + FROM public.ecr.aws/lambda/nodejs:12 + + # Copy function code and package.json + COPY app.js package.json ${LAMBDA_TASK_ROOT} + + # Install NPM dependencies for function + RUN npm install + + # Set the CMD to your handler + CMD [ "app.handler" ] ``` - You can change key and values in the sample JSON, but don't change the event structure\. If you do change any keys and values, you must update the sample code accordingly\. +1. Build your Docker image\. From your project directory, run the following command: + + ``` + docker build -t hello-world . + ``` + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Create a repository in Amazon ECR using the `aws ecr create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + +1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world-image:latest + ``` + +### Update the user permissions + +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* + +For example, use the IAM console to create a role with the following policy: -1. Choose **Create** and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Resource": "arn:aws:ecr:::repository//" + } + ] +} +``` -1. Lambda runs your function on your behalf\. The `handler` in your Lambda function receives and then processes the sample event\. +### Create a Lambda function defined as a container image -1. Upon successful completion, view results in the console\. - + The **Execution result** section \(below the **Test** button\) shows the execution status as succeeded\. Choose **Details** to view the function execution results\. Note that the **logs** link opens the Log groups page in the CloudWatch console\. +Use the Lambda console to create a function defined as a container image\. + +**To create the function with the console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose the **Container image** option\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter **my\-function**\. + + 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. + +1. Choose **Create function**\. + +Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. + +### Invoke the Lambda function + +Invoke your Lambda function using the sample event data provided in the console\. + +**To invoke a function** + +1. In the upper right corner, choose **Test**\. + +1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: + + ``` + { + "key1": "value1", + "key2": "value2", + "key3": "value3" + } + ``` + +1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + + Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. + +1. Upon successful completion, view the results in the console\. + + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log Lambda generates for each invocation\. These are the logs written to CloudWatch by the Lambda function\. The Lambda console shows these logs for your convenience\. Choose the **Click here** link to add logs to the CloudWatch log group and open the Log groups page in the CloudWatch console\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the Lambda function a few times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. -1. From the tabs near the top of the page, choose **Monitoring**\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. -## Clean up +### Clean up + +If you are done with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* -If you are done working with the example function, delete it\. You can also delete the execution role that the console created, and the log group that stores the function's logs\. +If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. **To delete a Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. -1. Choose **Actions**, and then choose **Delete function**\. +1. Choose **Actions**, **Delete**\. -1. Choose **Delete**\. +1. In the **Delete function** dialog box, choose **Delete**\. **To delete the log group** -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the Amazon CloudWatch console\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. -1. Choose the function's log group \(`/aws/lambda/my-function`\)\. +1. Select the function's log group \(`/aws/lambda/my-function`\)\. -1. Choose **Actions**, and then choose **Delete log group**\. +1. Choose **Actions**, **Delete log group\(s\)**\. -1. Choose **Yes, Delete**\. +1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. **To delete the execution role** -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. -1. Choose the function's role \(`my-function-role-31exxmpl`\) +1. Select the function's role \(`my-function-role-31exxmpl`\)\. 1. Choose **Delete role**\. -1. Choose **Yes, delete**\. +1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, roles, and log groups with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index e6218c41..5348ee05 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -1,18 +1,23 @@ -# Getting started with AWS Lambda +# Getting started with Lambda -To get started with AWS Lambda, use the Lambda console to create a function\. In a few minutes, you can create a function, invoke it, and view logs, metrics, and trace data\. +To get started with Lambda, use the Lambda console to create a function\. In a few minutes, you can create a function, invoke it, and then view logs, metrics, and trace data\. **Note** -To use Lambda and other AWS services, you need an AWS account\. If you don't have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For detailed instructions, see [Create and activate an AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/)\. -As a best practice, you should also create an AWS Identity and Access Management \(IAM\) user with administrator permissions and use that for all work that does not require root credentials\. Create a password for console access, and access keys to use command line tools\. See [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide* for instructions\. +To use Lambda and other AWS services, you need an AWS account\. If you don't have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) +As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. -You can author functions in the Lambda console—or with an IDE toolkit, command line tools, or SDKs\. The Lambda console provides a [code editor](code-editor.md) for noncompiled languages that lets you modify and test code quickly\. The [AWS CLI](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. +You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. + +You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: ++ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. **Topics** + [Create a Lambda function with the console](getting-started-create-function.md) + [Creating functions using the AWS Lambda console editor](code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) -+ [AWS Lambda concepts](gettingstarted-concepts.md) -+ [AWS Lambda features](gettingstarted-features.md) -+ [Tools for working with AWS Lambda](gettingstarted-tools.md) -+ [AWS Lambda quotas](gettingstarted-limits.md) \ No newline at end of file ++ [Lambda concepts](gettingstarted-concepts.md) ++ [Lambda features](gettingstarted-features.md) ++ [Lambda deployment packages](gettingstarted-package.md) ++ [Tools for working with Lambda](gettingstarted-tools.md) ++ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index 2fe965e0..f83328b5 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -6,9 +6,9 @@ In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command @@ -148,7 +148,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -198,7 +198,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 13620df4..4ddd4e47 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,4 +1,4 @@ -# AWS Lambda concepts +# Lambda concepts With Lambda, you run functions to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. @@ -6,7 +6,9 @@ With Lambda, you run functions to process events\. To send events to your functi + [Function](#gettingstarted-concepts-function) + [Qualifier](#gettingstarted-concepts-qualifier) + [Execution environment](#gettingstarted-concepts-ee) -+ [Runtime](#gettingstarted-concepts-runtimes) ++ [Deployment package](#gettingstarted-concepts-dp) ++ [Layer](#gettingstarted-concepts-layer) ++ [Runtime](#gettingstarted-concepts-runtime) + [Extension](#gettingstarted-concepts-extensions) + [Event](#gettingstarted-concepts-event) + [Concurrency](#gettingstarted-concepts-concurrency) @@ -14,41 +16,55 @@ With Lambda, you run functions to process events\. To send events to your functi ## Function -A *function* is a resource that you can invoke to run your code in Lambda\. A function has code that processes events, and a [runtime](#gettingstarted-concepts-runtimes) that passes requests and responses between Lambda and the function code\. You provide the code, and you can use the provided runtimes or create your own\. +A *function* is a resource that you can invoke to run your code in Lambda\. A function has code to process the [events](#gettingstarted-concepts-event) that you pass into the function or that other AWS services send to the function\. For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. ## Qualifier -When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that can be updated to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. +When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. For more information, see [Lambda function versions](configuration-versions.md)\. ## Execution environment -An *execution environment* provides a secure and isolated runtime environment where Lambda invokes your function\. An execution environment manages the runtime and other resources that are required to run your function\. The execution environment provides lifecycle support for the function's runtime and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. +An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. -For more information, see [Execution environment](runtimes-context.md)\. +For more information, see [AWS Lambda execution environment](runtimes-context.md)\. -## Runtime +## Deployment package -The Lambda *runtime* provides a language\-specific environment that runs in the execution environment\. You configure your function to use a runtime that matches your programming language\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes provided by Lambda, or build your own\. +You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: ++ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. -For more information, see [AWS Lambda runtimes](lambda-runtimes.md)\. +For more information, see [Lambda deployment packages](gettingstarted-package.md)\. + +## Layer + +A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information, see [AWS Lambda layers](configuration-layers.md)\. + +## Runtime + +The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. + +For more information, see [Lambda runtimes](lambda-runtimes.md)\. ## Extension -Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools provided by [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/), or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. +Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. -For more information, see [Using AWS Lambda extensions](using-extensions.md)\. +For more information, see [Using Lambda extensions](using-extensions.md)\. ## Event -An *event* is a JSON\-formatted document that contains data for a function to process\. The Lambda runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. +An *event* is a JSON\-formatted document that contains data for a Lambda function to process\. The runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. -**Example Custom event – Weather data** +**Example custom event – weather data** ``` { @@ -61,7 +77,7 @@ An *event* is a JSON\-formatted document that contains data for a function to pr When an AWS service invokes your function, the service defines the shape of the event\. -**Example Service event – Amazon SNS notification** +**Example service event – Amazon SNS notification** ``` { @@ -85,6 +101,6 @@ Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region l ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that can be configured to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. +A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 3f889728..2ecf9594 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -1,35 +1,34 @@ -# AWS Lambda features +# Lambda features -AWS Lambda provides a management console and API for managing and invoking functions\. It provides runtimes that support a standard set of features so that you can easily switch between languages and frameworks, depending on your needs\. In addition to functions, you can also create versions, aliases, layers, and custom runtimes\. +Lambda provides a management console and API for managing and invoking functions\. It provides runtimes that support a standard set of features so that you can easily switch between languages and frameworks, depending on your needs\. In addition to functions, you can also create versions, aliases, layers, and custom runtimes\. **Topics** + [Programming model](#gettingstarted-features-programmingmodel) -+ [Deployment package](#gettingstarted-features-package) -+ [Layers](#gettingstarted-features-layers) + [Scaling](#gettingstarted-features-scaling) + [Concurrency controls](#gettingstarted-features-concurrency) + [Asynchronous invocation](#gettingstarted-features-async) + [Event source mappings](#gettingstarted-features-eventsourcemapping) + [Destinations](#gettingstarted-features-destinations) + [Function blueprints](#gettingstarted-features-blueprints) ++ [Testing and deployment tools](#gettingstarted-features-tools) + [Application templates](#gettingstarted-features-templates) ## Programming model -Authoring specifics vary between runtimes, but all runtimes share a common programming model that defines the interface between your code and the runtime code\. You tell the runtime which method to run by defining a **handler** in the function configuration, and the runtime runs that method\. The runtime passes in objects to the handler that contain the invocation **event** and the **context**, such as the function name and request ID\. +Authoring specifics vary between runtimes, but all runtimes share a common programming model that defines the interface between your code and the runtime code\. You tell the runtime which method to run by defining a *handler* in the function configuration, and the runtime runs that method\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. -When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in **initialization code** can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. +When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. -Initialization is billed as part of the duration for the first invocation processed by an instance of your function\. When [X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. +Initialization is billed as part of the duration for the first invocation that an instance of your function processes\. When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. -The runtime captures **logging** output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an **error**, the runtime returns that error to the invoker\. +The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. **Note** -Logging is subject to [CloudWatch Logs limits](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. +Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. + [Building Lambda functions with Node\.js](lambda-nodejs.md) @@ -40,26 +39,7 @@ For a hands\-on introduction to the programming model in your preferred programm + [Building Lambda functions with C\#](lambda-csharp.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) -Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep the size of your deployment package and the amount of data that you transfer onto the execution environment to a minimum\. - -## Deployment package - -Your function's code consists of scripts or compiled programs and their dependencies\. When you author functions in the Lambda console or a toolkit, the client creates a ZIP archive of your code called a deployment package\. The client then sends the package to the Lambda service\. When you manage functions with the Lambda API, command line tools, or SDKs, you create the deployment package\. You also need to create a deployment package manually for compiled languages and to add dependencies to your function\. - -For language\-specific instructions, see the following topics\. -+ [AWS Lambda deployment package in Node\.js](nodejs-package.md) -+ [AWS Lambda deployment package in Python](python-package.md) -+ [AWS Lambda deployment package in Ruby](ruby-package.md) -+ [AWS Lambda deployment package in Java](java-package.md) -+ [AWS Lambda deployment package in Go](golang-package.md) -+ [AWS Lambda Deployment Package in C\#](csharp-package.md) -+ [AWS Lambda deployment package in PowerShell](powershell-package.md) - -## Layers - -Lambda layers are a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers let you manage your in\-development function code independently from the unchanging code and resources that it uses\. You can configure your function to use layers that you create, layers provided by AWS, or layers from other AWS customers\. - -For more information, see [AWS Lambda layers](configuration-layers.md)\. +Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. ## Scaling @@ -75,7 +55,7 @@ Use concurrency settings to ensure that your production applications are highly ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-reserved.png) -To enable functions to scale without fluctuations in latency, use *provisioned concurrency*\. For functions that take a long time to initialize, or require extremely low latency for all invocations, provisioned concurrency enables you to pre\-initialize instances of your function and keep them running at all times\. Lambda integrates with Application Auto Scaling to support autoscaling for provisioned concurrency based on utilization\. +To enable functions to scale without fluctuations in latency, use *provisioned concurrency*\. For functions that take a long time to initialize, or that require extremely low latency for all invocations, provisioned concurrency enables you to pre\-initialize instances of your function and keep them running at all times\. Lambda integrates with Application Auto Scaling to support autoscaling for provisioned concurrency based on utilization\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) @@ -93,11 +73,11 @@ For more information, see [Asynchronous invocation](invocation-async.md)\. ## Event source mappings -To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. +To process items from a stream or queue, you can create an *event source mapping*\. An event source mapping is a resource in Lambda that reads items from an Amazon Simple Queue Service \(Amazon SQS\) queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends the items to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png) -Event source mappings maintain a local queue of unprocessed items, and handle retries if the function returns an error or is throttled\. You can configure an event source mapping to customize batching behavior and error handling, or to send a record of items that fail processing to a [destination](#gettingstarted-features-destinations)\. +Event source mappings maintain a local queue of unprocessed items and handle retries if the function returns an error or is throttled\. You can configure an event source mapping to customize batching behavior and error handling, or to send a record of items that fail processing to a destination\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. @@ -113,14 +93,20 @@ For more information, see [Configuring destinations for asynchronous invocation] ## Function blueprints -When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. +When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. + +Blueprints are provided for use under the [Creative Commons Zero](https://spdx.org/licenses/CC0-1.0.html) license\. They are available only in the Lambda console\. + +## Testing and deployment tools + +Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use a rich tools ecosystem for authoring, building, and deploying your Lambda functions using AWS and popular community tools like the Docker command line interface \(CLI\)\. -Blueprints are provided for use under the [Creative Commons Zero](https://spdx.org/licenses/CC0-1.0.html) license\. They are only available in the Lambda console\. +For more information, see [Tools for working with Lambda](gettingstarted-tools.md)\. ## Application templates You can use the Lambda console to create an application with a continuous delivery pipeline\. Application templates in the Lambda console include code for one or more functions, an application template that defines functions and supporting AWS resources, and an infrastructure template that defines an AWS CodePipeline pipeline\. The pipeline has build and deploy stages that run every time you push changes to the included Git repository\. -Application templates are provided for use under the [MIT No Attribution](https://spdx.org/licenses/MIT-0.html) license\. They are only available in the Lambda console\. +Application templates are provided for use under the [MIT No Attribution](https://spdx.org/licenses/MIT-0.html) license\. They are available only in the Lambda console\. For more information, see [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 47c53a1e..88bccd4f 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -1,13 +1,14 @@ -# AWS Lambda quotas +# Lambda quotas -AWS Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per\-region and can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. +Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. -| Resource | Default quota | Can Be Increased Up To | +| Resource | Default quota | Can be increased up to | | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | -| Function and layer storage | 75 GB | Terabytes | -| [Elastic network interfaces per VPC](configuration-vpc.md) Note: quota shared with other services, such as EFS\. See [ Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html) | 250 | Hundreds | +| Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -16,29 +17,30 @@ The following quotas apply to function configuration, deployments, and execution | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-console.md) | 128 MB to 3,008 MB, in 64 MB increments\. | +| Function [memory allocation](configuration-console.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | | Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | 5 layers | -| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \([varies per region](invocation-scaling.md)\) | +| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package](gettingstarted-features.md#gettingstarted-features-package) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | +| [Container image](lambda-images.md) code package size | 10 GB | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | | File descriptors | 1,024 | | Execution processes/threads | 1,024 | -The following quotas are associated with AWS Lambda API requests\. +The following quotas are associated with Lambda API requests\. | Resource | Quota | | --- | --- | -| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md) – all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md) – non\-AWS sources\) | -| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | -| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota only applies to functions that use provisioned concurrency\. | -| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | -| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | -| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | - -Quotas for other services, such as AWS Identity and Access Management, Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud, can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | +| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | +| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | +| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | +| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | +| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | + +Quotas for other services, such as AWS Identity and Access Management \(IAM\), Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud \(Amazon VPC\), can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) in the *Amazon Web Services General Reference*, and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md new file mode 100644 index 00000000..3d7fc2fb --- /dev/null +++ b/doc_source/gettingstarted-package.md @@ -0,0 +1,41 @@ +# Lambda deployment packages + +Your Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. + +**Topics** ++ [Container images](#gettingstarted-package-images) ++ [\.zip file archives](#gettingstarted-package-zip) ++ [Layers](#gettingstarted-package-layers) + +## Container images + +A container image includes the base operating system, the runtime, Lambda extensions, your application code and it's dependencies\. You can also add static data, such as machine learning models, into the image\. + +Lambda provides a set of open\-source base images that you can use to build your container image\. To create and test container images, you can use the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) or native container tools such as the Docker CLI\. + +You upload your container images to Amazon Elastic Container Registry \(Amazon ECR\), a managed AWS container image registry service\. To deploy the image to your function, you specify the Amazon ECR image URL using the Lambda console, the Lambda API, command line tools, or the AWS SDKs\. + +For more information about Lambda container images, see [Using container images with Lambda](lambda-images.md)\. + +## \.zip file archives + +A \.zip file archive includes your application code and its dependencies\. When you author functions using the Lambda console or a toolkit, Lambda automatically creates a \.zip file archive of your code\. + +When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. + +For language\-specific instructions, see the following topics\. ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +## Layers + +If you deploy your function code using a \.zip file archive, you can use Lambda layers as a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers enable you to manage your in\-development function code independently from the unchanging code and resources that it uses\. You can configure your function to use layers that you create, layers that AWS provides, or layers from other AWS customers\. + +You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information about layers, see [AWS Lambda layers](configuration-layers.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-tools.md b/doc_source/gettingstarted-tools.md index 66ac099e..1880e4ac 100644 --- a/doc_source/gettingstarted-tools.md +++ b/doc_source/gettingstarted-tools.md @@ -1,46 +1,53 @@ -# Tools for working with AWS Lambda +# Tools for working with Lambda In addition to the Lambda console, you can use the following tools to manage and invoke Lambda resources\. **Topics** -+ [AWS Command Line Interface](#gettingstarted-tools-awscli) -+ [AWS Serverless Application Model](#gettingstarted-tools-awssam) -+ [SAM CLI](#gettingstarted-tools-samcli) ++ [AWS CLI](#gettingstarted-tools-awscli) ++ [AWS SAM](#gettingstarted-tools-awssam) ++ [AWS SAM CLI](#gettingstarted-tools-samcli) ++ [Tools for container images](#gettingstarted-tools-docker) + [Code authoring tools](#lambda-app-author) -## AWS Command Line Interface +## AWS CLI -Install the AWS Command Line Interface to manage and use Lambda functions from the command line\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API actions\. Some functionality is not available in the Lambda console and can only be accessed with the AWS CLI or the AWS SDK\. +To manage and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. To set up the AWS CLI, see the following topics in the *AWS Command Line Interface User Guide*\. -+ [Getting set up with the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html) -+ [Configuring the AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) ++ [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) ++ [Configuring the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -To verify that the AWS CLI is configured correctly, run the `list-functions` command to see a list of your Lambda functions in the current region\. +To verify that the AWS CLI is configured correctly, run the `list-functions` command to see a list of your Lambda functions in the current AWS Region\. ``` $ aws lambda list-functions ``` -## AWS Serverless Application Model +## AWS SAM -AWS SAM is an extension for the AWS CloudFormation template language that lets you define serverless applications at a higher level\. It abstracts away common tasks such as function role creation, which makes it easier to write templates\. AWS SAM is supported directly by AWS CloudFormation, and includes additional functionality through the AWS CLI and AWS SAM CLI\. +The AWS Serverless Application Model \(AWS SAM\) is an extension for the AWS CloudFormation template language that lets you define serverless applications at a higher level\. AWS SAM abstracts away common tasks such as function role creation, making it easier to write templates\. AWS SAM is supported directly by AWS CloudFormation, and includes additional functionality through the AWS CLI and AWS SAM CLI\. -For more information about AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +For more information about AWS SAM templates, see the [AWS SAM specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) in the *AWS Serverless Application Model Developer Guide*\. -## SAM CLI +## AWS SAM CLI -The AWS SAM CLI is a separate command line tool that you can use to manage and test AWS SAM applications\. In addition to commands for uploading artifacts and launching AWS CloudFormation stacks that are also available in the AWS CLI, the SAM CLI provides additional commands for validating templates and running applications locally in a Docker container\. +The AWS SAM CLI is a separate command line tool that you can use to manage and test AWS SAM applications\. In addition to commands for uploading artifacts and launching AWS CloudFormation stacks that are also available in the AWS CLI, the AWS SAM CLI provides commands for validating templates and running applications locally in a Docker container\. You can use the AWS SAM CLI to build functions deployed as \.zip file archives or container images\. To set up the AWS SAM CLI, see [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) in the *AWS Serverless Application Model Developer Guide*\. +## Tools for container images + +To create and test functions deployed as container images, you can use native container tools such as the Docker CLI\. + +To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. + ## Code authoring tools -You can author your Lambda function code in the languages that are supported by AWS Lambda\. For a list of supported languages, see [AWS Lambda runtimes](lambda-runtimes.md)\. There are tools for authoring code, such as the AWS Lambda console, Eclipse IDE, and Visual Studio IDE\. But the available tools and options depend on the following: -+ Language you choose to write your Lambda function code\. -+ Libraries that you use in your code\. AWS Lambda runtime provides some of the libraries and you must upload any additional libraries that you use\. +You can author your Lambda function code in the languages that Lambda supports\. For a list of supported languages, see [Lambda runtimes](lambda-runtimes.md)\. There are tools for authoring code, such as the Lambda console, Eclipse integrated development environment \(IDE\), and Visual Studio IDE\. But the available tools and options depend on: ++ The language that you use to write your Lambda function code\. ++ The libraries that you use in your code\. The Lambda runtimes provide some of the libraries, and you must upload any additional libraries that you use\. -The following table lists languages, and the available tools and options that you can use\. +The following table lists the languages that Lambda supports, and the tools and options that you can use with them\. **** diff --git a/doc_source/go-image.md b/doc_source/go-image.md new file mode 100644 index 00000000..cab732d2 --- /dev/null +++ b/doc_source/go-image.md @@ -0,0 +1,26 @@ +# Deploy Go Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Go function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for Go + +AWS provides the following base image for Go: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 1 | Go 1\.x | Amazon Linux 2018\.03 | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | + +Docker Hub repository: amazon/aws\-lambda\-go + +Amazon ECR repository: public\.ecr\.aws/lambda/go + +## Go runtime interface clients + +Download the runtime interface client for Go from the [AWS Lambda for Go](https://github.com/aws/aws-lambda-go) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 01571793..0f8004cc 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -44,7 +44,7 @@ START RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Version: $LATEST 2020/03/27 03:40:05 AWS_LAMBDA_FUNCTION_VERSION=$LATEST 2020/03/27 03:40:05 AWS_EXECUTION_ENV=AWS_Lambda_go1.x END RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 -REPORT RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Duration: 38.66 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 54 MB Init Duration: 203.69 ms +REPORT RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Duration: 38.66 ms Billed Duration: 39 ms Memory Size: 128 MB Max Memory Used: 54 MB Init Duration: 203.69 ms XRAY TraceId: 1-5e7d7595-212fxmpl9ee07c4884191322 SegmentId: 42ffxmpl0645f474 Sampled: true ``` @@ -103,7 +103,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -153,7 +153,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 82f31ed1..75c9aa48 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -1,13 +1,15 @@ -# AWS Lambda deployment package in Go +# Deploy Go Lambda functions with \.zip file archives -To create a Lambda function you first create a Lambda function deployment package, a \.zip file consisting of your code \(a Go executable\) and any dependencies\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -After you create a deployment package, you may either upload it directly or upload the \.zip file first to an Amazon S3 bucket in the same AWS region where you want to create the Lambda function, and then specify the bucket name and object key name when you create the Lambda function using the console or the AWS CLI\. +A \.zip file archive is a deployment package for your Lambda function that consists of your code \(a Go executable\) and any dependencies\. + +After you create the deployment package, you can upload it directly to an Amazon Simple Storage Service \(Amazon S3\) bucket in the AWS Region where you want to create the Lambda function\. Or, you can upload the \.zip file archive first and then specify the S3 bucket name and object key name when you create the function using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. Download the Lambda library for Go with `go get`, and compile your executable\. **Note** -Use version 1\.18\.0 or later of aws\-lambda\-go\. +Use `aws-lambda-go` version 1\.18\.0 or later``\. ``` ~/my-function$ go get github.com/aws/aws-lambda-go/lambda @@ -16,7 +18,7 @@ Use version 1\.18\.0 or later of aws\-lambda\-go\. Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. -Create a deployment package by packaging the executable in a ZIP file, and use the AWS CLI to create a function\. The handler parameter must match the name of the executable containing your handler\. +Create a deployment package by packaging the executable in a \.zip file, and use the AWS CLI to create a function\. The handler parameter must match the name of the executable containing your handler\. ``` ~/my-function$ zip function.zip main @@ -27,18 +29,18 @@ Create a deployment package by packaging the executable in a ZIP file, and use t ## Creating a deployment package on Windows -To create a \.zip that will work on AWS Lambda using Windows, we recommend installing the **build\-lambda\-zip** tool\. +To create a \.zip file archive that works on Lambda using Windows, we recommend installing the **build\-lambda\-zip** tool\. **Note** -If you have not already done so, you will need to install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. +If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. -To download the tool, run the following command: +To download the **build\-lambda\-zip** tool, run the following command: ``` go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip ``` -Use the tool from your `GOPATH`\. If you have a default installation of Go, the tool will typically be in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do the following: +Use the tool from your `GOPATH`\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: In cmd\.exe, run the following: @@ -48,7 +50,7 @@ go build -o main main.go %USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main ``` -In Powershell, run the following: +In PowerShell, run the following: ``` $env:GOOS = "linux" diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index d5a72ade..8ac7fe21 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) @@ -41,12 +41,6 @@ To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. xray.AWS(s3.Client) ``` -Then you can trace your calls by using the `WithContext` version of the method\. - -``` - svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) -``` - The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) diff --git a/doc_source/images-create.md b/doc_source/images-create.md new file mode 100644 index 00000000..e4ae11df --- /dev/null +++ b/doc_source/images-create.md @@ -0,0 +1,219 @@ +# Creating Lambda container images + +You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. + +AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. + +You can also use an alternative base image from another container registry\. Lambda provides open\-source runtime interface clients that you add to an alternative base image to make it compatible with Lambda\. + +**Topics** ++ [Image types](#images-types) ++ [Container tools](#images-tools) ++ [Lambda requirements for container images](#images-reqs) ++ [Container image settings](#images-parms) ++ [Create an image from an AWS base image for Lambda](#images-create-1) ++ [Create an image from an alternative base image](#images-create-2) ++ [Create an image using the AWS SAM toolkit](#images-create-sam) + +## Image types + +You can use an AWS provided base image or an alternative base image, such as Alpine or Debian\. Lambda supports any image that conforms to one of the following image manifest formats: ++ Docker image manifest V2, schema 2 \(used with Docker version 1\.10 and newer\) ++ Open Container Initiative \(OCI\) Specifications \(v1\.0\.0 and up\) + +Lambda supports images up to 10 GB in size\. + +## Container tools + +To create your container image, you can use any development tool that supports one of the following container image manifest formats: ++ Docker image manifest V2, schema 2 \(used with Docker version 1\.10 and newer\) ++ OCI Specifications \(v1\.0\.0 and up\) + +For example, you can use the Docker CLI to build, test, and deploy your container images\. + +## Lambda requirements for container images + +To deploy a container image to Lambda, note the following requirements: + +1. The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. + +1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. If you are using an image that requires a writable directory outside of `/tmp`, configure it to write to a directory under the `/tmp` directory\. + +1. The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. + +1. Lambda supports only Linux\-based container images\. + +## Container image settings + +Lambda supports the following container image settings in the Dockerfile: ++ ENTRYPOINT – Specifies the absolute path to the entry point of the application\. ++ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. ++ WORKDIR – Specifies the absolute path to the working directory\. ++ ENV – Specifies an environment variable for the Lambda function\. + +**Note** +Lambda ignores the values of any unsupported container image settings in the Dockerfile\. + +For more information about how Docker uses the container image settings, see [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) in the Dockerfile reference on the Docker Docs website\. For more information about using ENTRYPOINT and CMD, see [Demystifying ENTRYPOINT and CMD in Docker](http://aws.amazon.com/blogs/opensource/demystifying-entrypoint-cmd-docker/) on the AWS Open Source Blog\. + +You can specify the container image settings in the Dockerfile when you build your image\. You can also override these configurations using the Lambda console or Lambda API\. This allows you to deploy multiple functions that deploy the same container image but with different runtime configurations\. + +**Warning** +When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sure that you enter the absolute path\. Also, do not use symlinks as the entry point to the container\. + +## Create an image from an AWS base image for Lambda + +To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. + +**Note** +AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from Docker Hub\. To use the updated base image, you must rebuild your container image and [update the function code](configuration-images.md#configuration-images-update)\. + +**Prerequisites** ++ The AWS Command Line Interface \(AWS CLI\) + + The following instructions use the AWS CLI to call AWS service API operations\. To install the AWS CLI, see [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the *AWS Command Line Interface User Guide*\. ++ Docker Desktop + + The following instructions use Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. ++ Your function code + +**To create an image from an AWS base image for Lambda** + +1. On your local machine, create a project directory for your new function\. + +1. Create an app directory in the project directory, and then add your function handler code to the app directory\. + +1. Use a text editor to create a new Dockerfile\. + + The AWS base images provide the following environment variables: + + LAMBDA\_TASK\_ROOT=/var/task + + LAMBDA\_RUNTIME\_DIR=/var/runtime + + The following shows an example Dockerfile for Node\.js version 12: + + ``` + FROM public.ecr.aws/lambda/nodejs:12 + # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 + + COPY app.js package.json ${LAMBDA_TASK_ROOT} + + # Install NPM dependencies for function + RUN npm install + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.handler" ] + ``` + +1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. + + ``` + docker build -t hello-world . + ``` + +1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Deploy your function to Amazon ECR using the `docker push` command\. + + ``` + docker push 123456789012.dkr.ecr.sa-east-1.amazonaws.com/image-name:latest + ``` + +## Create an image from an alternative base image + +**Prerequisites** ++ The AWS CLI ++ Docker Desktop ++ Your function code + +**To create an image using an alternative base image** + +1. Choose a base image\. Lambda supports all Linux distributions, such as Alpine, Debian, and Ubuntu\. + +1. On your local machine, create a project directory for your new function\. + +1. Create an app directory in the project directory, and then add your function handler code to the app directory\. + +1. Use a text editor to create a new Dockerfile with the following configuration: + + Set the `FROM` property to the URI of the base image\. + + Add instructions to install the runtime interface client\. + + Set the `ENTRYPOINT` property to invoke the runtime interface client\. + + Set the `CMD` argument to specify the Lambda function handler\. + + The following example shows a Dockerfile for Python: + + ``` + # Define function directory + ARG FUNCTION_DIR="/function" + + FROM python:buster as build-image + + # Install aws-lambda-cpp build dependencies + RUN apt-get update && \ + apt-get install -y \ + g++ \ + make \ + cmake \ + unzip \ + libcurl4-openssl-dev + + # Include global arg in this stage of the build + ARG FUNCTION_DIR + # Create function directory + RUN mkdir -p ${FUNCTION_DIR} + + # Copy function code + COPY app/* ${FUNCTION_DIR} + + # Install the runtime interface client + RUN pip install \ + --target ${FUNCTION_DIR} \ + awslambdaric + + # Multi-stage build: grab a fresh copy of the base image + FROM python:buster + + # Include global arg in this stage of the build + ARG FUNCTION_DIR + # Set working directory to function root directory + WORKDIR ${FUNCTION_DIR} + + # Copy in the build image dependencies + COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR} + + ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ] + CMD [ "app.handler" ] + ``` + +1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. + + ``` + docker build -t hello-world . + ``` + +1. \(Optional\) Test your application locally using the [Runtime interface emulator](images-test.md)\. + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Deploy your function to Amazon ECR using the `docker push` command\. + + ``` + docker push 123456789012.dkr.ecr.sa-east-1.amazonaws.com/image-name:latest + ``` + +## Create an image using the AWS SAM toolkit + +You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create and deploy a function defined as a container image\. For a new project, you can use the AWS SAM CLI `init` command to set up the scaffolding for your project in your preferred runtime\. + +In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. + +For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/images-test.md b/doc_source/images-test.md new file mode 100644 index 00000000..853388d1 --- /dev/null +++ b/doc_source/images-test.md @@ -0,0 +1,129 @@ +# Testing Lambda container images locally + +The Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. + +The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. + +You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. + +**Topics** ++ [Guidelines for using the RIE](#images-test-limitations) ++ [Environment variables](#images-test-env) ++ [Test an image with RIE included in the image](#images-test-AWSbase) ++ [Build RIE into your base image](#images-test-alternative) ++ [Test an image without adding RIE to the image](#images-test-add) + +## Guidelines for using the RIE + +Note the following guidelines when using the Runtime Interface Emulator: ++ The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. ++ The emulator supports only Linux x84\-64 architectures\. ++ The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. + +## Environment variables + +The runtime interface emulator supports a subset of [environment variables](configuration-envvars.md) for the Lambda function in the local running image\. + +If your function uses security credentials, you can configure the credentials by setting the following environment variables: ++ `AWS_ACCESS_KEY_ID` ++ `AWS_SECRET_ACCESS_KEY` ++ `AWS_SESSION_TOKEN` ++ `AWS_REGION` + +To set the function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the function to run\. + +The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the function runs in the Lambda service: ++ `AWS_LAMBDA_FUNCTION_VERSION` ++ `AWS_LAMBDA_FUNCION_NAME` ++ `AWS_LAMBDA_MEMORY_SIZE` + +## Test an image with RIE included in the image + +The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps if you built the RIE into your alternative base image\. + +**To test your Lambda function with the emulator** + +1. Build your image locally using the `docker build` command\. + + ``` + docker build -t myfunction:latest . + ``` + +1. Run your container image locally using the `docker run` command\. + + ``` + docker run -p 9000:8080 myfunction:latest + ``` + + This command runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. + +1. Post an event to the following endpoint using a `curl` command: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + ``` + + This command invokes the function running in the container image and returns a response\. + +## Build RIE into your base image + +You can build RIE into a base image\. Download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. + +**To build the emulator into your image** + +1. Create a script and save it in your project directory\. The following example shows a typical script for a Node\.js function\. The presence of the `AWS_LAMBDA_RUNTIME_API` environment variable indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. + + ``` + #!/bin/sh + if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + else + exec /usr/bin/npx aws-lambda-ric + fi + ``` + +1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. + +1. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: + + ``` + ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie + ENTRYPOINT [ “/entry_script.sh” ] + ``` + +1. Build your image locally using the `docker build` command\. + + ``` + docker build -t myfunction:latest . + ``` + +## Test an image without adding RIE to the image + +You install the runtime interface emulator to your local machine\. When you run the image function, you set the entry point to be the emulator\. + +**To test an image without adding RIE to the image** + +1. From your project directory, run the following command to download the RIE from GitHub and install it on your local machine\. + + ``` + mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + ``` + +1. Run your Lambda image function using the `docker run` command\. + + ``` + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest + --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command> + ``` + + This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. + +1. Post an event to the following endpoint using a `curl` command: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + ``` + + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index ea2cd98c..b7f585bc 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -15,14 +15,15 @@ Amazon's trademarks and trade dress may not be used in ----- ## Contents + [What is AWS Lambda?](welcome.md) -+ [Getting started with AWS Lambda](getting-started.md) ++ [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) + [Creating functions using the AWS Lambda console editor](code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) - + [AWS Lambda concepts](gettingstarted-concepts.md) - + [AWS Lambda features](gettingstarted-features.md) - + [Tools for working with AWS Lambda](gettingstarted-tools.md) - + [AWS Lambda quotas](gettingstarted-limits.md) + + [Lambda concepts](gettingstarted-concepts.md) + + [Lambda features](gettingstarted-features.md) + + [Lambda deployment packages](gettingstarted-package.md) + + [Tools for working with Lambda](gettingstarted-tools.md) + + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) @@ -30,13 +31,15 @@ Amazon's trademarks and trade dress may not be used in + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) - + [Configuring functions in the AWS Lambda console](configuration-console.md) + + [Configuring functions in the console](configuration-console.md) + [Configuring functions in the AWS Lambda console (preview)](configuration-preview.md) + + [Configuring functions defined as container images](configuration-images.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) + [AWS Lambda layers](configuration-layers.md) + + [Configuring Lambda function memory](configuration-memory.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) @@ -50,26 +53,31 @@ Amazon's trademarks and trade dress may not be used in + [Monitoring the state of a function with the Lambda API](functions-states.md) + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) - + [Using AWS Lambda extensions](using-extensions.md) + + [Using Lambda extensions](using-extensions.md) + + [Invoking functions defined as container images](invocation-images.md) + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) + [Sample function code](with-android-create-package.md) -+ [AWS Lambda runtimes](lambda-runtimes.md) ++ [AWS Lambda applications](deploying-lambda-apps.md) + + [Managing applications in the AWS Lambda console](applications-console.md) + + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) + + [Common Lambda application types and use cases](applications-usecases.md) + + [Best practices for working with AWS Lambda functions](best-practices.md) ++ [Lambda runtimes](lambda-runtimes.md) + [Runtime support policy](runtime-support-policy.md) + [AWS Lambda execution environment](runtimes-context.md) + + [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) - + [AWS Lambda Extensions API](runtimes-extensions-api.md) + + [Lambda Extensions API](runtimes-extensions-api.md) + [Modifying the runtime environment](runtimes-modify.md) + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) -+ [AWS Lambda applications](deploying-lambda-apps.md) - + [Managing applications in the AWS Lambda console](applications-console.md) - + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) - + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) - + [Common Lambda application types and use cases](applications-usecases.md) - + [Best practices for working with AWS Lambda functions](best-practices.md) ++ [Using container images with Lambda](lambda-images.md) + + [Creating Lambda container images](images-create.md) + + [Testing Lambda container images locally](images-test.md) + [Using AWS Lambda with other services](lambda-services.md) + [Using AWS Lambda with Alexa](services-alexa.md) + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) @@ -85,7 +93,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) + [AWS SAM template for a CloudWatch Events application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) - + [Using AWS Lambda with Amazon CloudWatch Logs](services-cloudwatchlogs.md) + + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) @@ -136,54 +144,60 @@ Amazon's trademarks and trade dress may not be used in + [List manager sample application for AWS Lambda](samples-listmanager.md) + [Building Lambda functions with Node.js](lambda-nodejs.md) + [AWS Lambda function handler in Node.js](nodejs-handler.md) - + [AWS Lambda deployment package in Node.js](nodejs-package.md) + + [Deploy Node.js Lambda functions with .zip file archives](nodejs-package.md) + + [Deploy Node.js Lambda functions with container images](nodejs-image.md) + [AWS Lambda context object in Node.js](nodejs-context.md) + [AWS Lambda function logging in Node.js](nodejs-logging.md) + [AWS Lambda function errors in Node.js](nodejs-exceptions.md) + [Instrumenting Node.js code in AWS Lambda](nodejs-tracing.md) + [Building Lambda functions with Python](lambda-python.md) + [AWS Lambda function handler in Python](python-handler.md) - + [AWS Lambda deployment package in Python](python-package.md) + + [Deploy Python Lambda functions with .zip file archives](python-package.md) + + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) + [AWS Lambda function errors in Python](python-exceptions.md) + [Instrumenting Python code in AWS Lambda](python-tracing.md) + [Building Lambda functions with Ruby](lambda-ruby.md) + [AWS Lambda function handler in Ruby](ruby-handler.md) - + [AWS Lambda deployment package in Ruby](ruby-package.md) + + [Deploy Ruby Lambda functions with .zip file archives](ruby-package.md) + + [Deploy Ruby Lambda functions with container images](ruby-image.md) + [AWS Lambda context object in Ruby](ruby-context.md) + [AWS Lambda function logging in Ruby](ruby-logging.md) + [AWS Lambda function errors in Ruby](ruby-exceptions.md) + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) + [Building Lambda functions with Java](lambda-java.md) + [Java sample applications for AWS Lambda](java-samples.md) - + [AWS Lambda deployment package in Java](java-package.md) + [AWS Lambda function handler in Java](java-handler.md) + + [Deploy Java Lambda functions with .zip file archives](java-package.md) + + [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) + [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Building Lambda functions with Go](lambda-golang.md) - + [AWS Lambda deployment package in Go](golang-package.md) + + [Deploy Go Lambda functions with .zip file archives](golang-package.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) + + [Deploy Go Lambda functions with container images](go-image.md) + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) + [Using environment variables](golang-envvars.md) + [Building Lambda functions with C#](lambda-csharp.md) - + [AWS Lambda Deployment Package in C#](csharp-package.md) + + [AWS Lambda function handler in C#](csharp-handler.md) + + [Deploy C# Lambda functions with .zip file archives](csharp-package.md) + [.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) - + [AWS Lambda function handler in C#](csharp-handler.md) + + [Deploy .NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C#](csharp-context.md) + [AWS Lambda function logging in C#](csharp-logging.md) + [AWS Lambda function errors in C#](csharp-exceptions.md) + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) + [Setting Up a PowerShell Development Environment](powershell-devenv.md) - + [AWS Lambda deployment package in PowerShell](powershell-package.md) + + [Deploy PowerShell Lambda functions with .zip file archives](powershell-package.md) + [AWS Lambda function handler in PowerShell](powershell-handler.md) + [AWS Lambda context object in PowerShell](powershell-context.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) @@ -203,30 +217,36 @@ Amazon's trademarks and trade dress may not be used in + [Resilience in AWS Lambda](security-resilience.md) + [Infrastructure security in AWS Lambda](security-infrastructure.md) + [Configuration and vulnerability analysis in AWS Lambda](security-configuration.md) -+ [Troubleshooting issues in AWS Lambda](lambda-troubleshooting.md) - + [Troubleshoot deployment issues in AWS Lambda](troubleshooting-deployment.md) - + [Troubleshoot invocation issues in AWS Lambda](troubleshooting-invocation.md) - + [Troubleshoot execution issues in AWS Lambda](troubleshooting-execution.md) - + [Troubleshoot networking issues in AWS Lambda](troubleshooting-networking.md) ++ [Troubleshooting issues in Lambda](lambda-troubleshooting.md) + + [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) + + [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) + + [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) + + [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) + + [Troubleshoot container image issues in Lambda](troubleshooting-images.md) + [AWS Lambda releases](lambda-releases.md) + [API reference](API_Reference.md) + [Actions](API_Operations.md) + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) + + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) + + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) + + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) + + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) + + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -238,9 +258,11 @@ Amazon's trademarks and trade dress may not be used in + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) + + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) + + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -248,6 +270,7 @@ Amazon's trademarks and trade dress may not be used in + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) + + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -256,6 +279,7 @@ Amazon's trademarks and trade dress may not be used in + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) + + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) @@ -265,6 +289,9 @@ Amazon's trademarks and trade dress may not be used in + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) + + [AllowedPublishers](API_AllowedPublishers.md) + + [CodeSigningConfig](API_CodeSigningConfig.md) + + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -277,6 +304,9 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) + + [ImageConfig](API_ImageConfig.md) + + [ImageConfigError](API_ImageConfigError.md) + + [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index c2bd2007..c1fc2ff3 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -51,7 +51,7 @@ Use the Lambda console to configure error handling settings on a function, a ver **To configure error handling** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -83,7 +83,7 @@ Add destinations to your function in the Lambda console's function designer\. **To configure a destination for asynchronous invocation records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -202,7 +202,7 @@ After creating the target and updating your function's execution role, add the d **To configure a dead\-letter queue** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md new file mode 100644 index 00000000..5059ae08 --- /dev/null +++ b/doc_source/invocation-images.md @@ -0,0 +1,26 @@ +# Invoking functions defined as container images + +For a Lambda function defined as a container image, function behavior during invocation is very similar to a function defined as a \.zip file archive\. The following sections highlight the similarities and differences\. + +**Topics** ++ [Function lifecycle](#invocation-images-lifecycle) ++ [Invoking the function](#invocation-images-update) ++ [Image security](#invocation-images-security) + +## Function lifecycle + +Lambda optimizes a new or updated container image in preparation for the function to receive invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. + +If a function is not invoked for multiple weeks, Lambda reclaims its optimized version, and the function transitions to the `Inactive` state\. To reactivate the function, you must invoke it\. Lambda rejects the first invocation and the function enters the `Pending` state until Lambda re\-optimizes the image\. The function then returns to the `Active` state\. + +Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. + +You can use the Lambda API to get information about a function's state\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. + +## Invoking the function + +When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda calls the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. + +## Image security + +When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using customer managed AWS Key Management Service \(AWS KMS\) customer master keys \(CMKs\)\. To track and audit Lambda's usage of CMKs, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index d7cdd365..6e18c851 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -48,7 +48,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 000ea77c..faa7afe0 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -99,10 +99,10 @@ For more information on logging, see [AWS Lambda function logging in Java](java- The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 32aa0879..dd8bd376 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -72,7 +72,7 @@ To view error output in the Lambda console, invoke it with a test event\. **To invoke a function in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -122,7 +122,7 @@ java.lang.ArithmeticException: / by zero at example.HandlerDivide.handleRequest(HandlerDivide.java:13) END RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f -REPORT RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Duration: 4.20 ms Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 95 MB +REPORT RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Duration: 4.20 ms Billed Duration: 5 ms Memory Size: 512 MB Max Memory Used: 95 MB XRAY TraceId: 1-5e73162b-1919xmpl2592f4549e1c39be SegmentId: 3dadxmpl48126cb8 Sampled: true ``` @@ -218,10 +218,10 @@ For details on how other services handler errors, see the topics in the [Using A The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. \ No newline at end of file diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 8d860e28..e047265e 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -170,11 +170,11 @@ public class HandlerStream implements RequestStreamHandler { The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: + [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. diff --git a/doc_source/java-image.md b/doc_source/java-image.md new file mode 100644 index 00000000..f469e41a --- /dev/null +++ b/doc_source/java-image.md @@ -0,0 +1,40 @@ +# Deploy Java Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Java function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for Java + +AWS provides the following base images for Java: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | +| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | +| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | + +Docker Hub repository: amazon/aws\-lambda\-java + +Amazon ECR repository: public\.ecr\.aws/lambda/java + +## Java runtime interface clients + +Install the runtime interface client for Java using the Apache Maven package manager\. Add the following to your `pom.xml` file: + +``` + + com.amazonaws + aws-lambda-java-runtime-interface-client + 1.0.0 + +``` + +For package details, see [Lambda RIC](http://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. + +You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 69806971..0bc1d9e0 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -117,7 +117,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -167,7 +167,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], @@ -289,11 +289,11 @@ When you run your code locally for tests, the context object with the Lambda log The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 96df620b..194d4f9f 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -1,13 +1,15 @@ -# AWS Lambda deployment package in Java +# Deploy Java Lambda functions with \.zip file archives -A deployment package is a ZIP archive that contains your compiled function code and dependencies\. You can upload the package directly to Lambda, or you can use an Amazon S3 bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -AWS Lambda provides the following libraries for Java functions: -+ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library you need\. +A \.zip file archive is a deployment package that contains your compiled function code and dependencies\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. + +Lambda provides the following libraries for Java functions: ++ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. + [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. -+ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. ++ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. -These libraries are available through [Maven central repository](https://search.maven.org/search?q=g:com.amazonaws)\. Add them to your build definition as follows\. +These libraries are available through [Maven Central Repository](https://search.maven.org/search?q=g:com.amazonaws)\. Add them to your build definition as follows: ------ #### [ Gradle ] @@ -45,16 +47,16 @@ dependencies { ------ -To create a deployment package, compile your function code and dependencies into a single ZIP or Java Archive \(JAR\) file\. For Gradle, [use the Zip build type](#java-package-gradle)\. For Maven, [use the Maven Shade plugin](#java-package-maven)\. +To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers let you manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For details, see [AWS Lambda layers](configuration-layers.md)\. +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. -You can upload your deployment package by using the Lambda console, the Lambda API, or AWS SAM\. +You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. **To upload a deployment package with the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -72,7 +74,7 @@ You can upload your deployment package by using the Lambda console, the Lambda A ## Building a deployment package with Gradle -Use the `Zip` build type to create a deployment package with your function's code and dependencies\. +To create a deployment package with your function's code and dependencies, use the `Zip` build type\. **Example build\.gradle – Build task** @@ -86,7 +88,7 @@ task buildZip(type: Zip) { } ``` -This build configuration produces a deployment package in the `build/distributions` folder\. The `compileJava` task compiles your function's classes\. The `processResources` tasks copies libraries from the build's classpath into a folder named `lib`\. +This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies libraries from the build's classpath into a directory named `lib`\. **Example build\.gradle – Dependencies** @@ -106,7 +108,7 @@ dependencies { } ``` -Lambda loads JAR files in Unicode alphabetical order\. If multiple JAR files in the `lib` folder contain the same class, the first one is used\. You can use the following shell script to identify duplicate classes\. +Lambda loads JAR files in Unicode alphabetical order\. If multiple JAR files in the `lib` directory contain the same class, the first one is used\. You can use the following shell script to identify duplicate classes: **Example test\-zip\.sh** @@ -167,7 +169,7 @@ To build the deployment package, use the `mvn package` command\. [INFO] ------------------------------------------------------------------------ ``` -This command generates a JAR file in the `target` folder\. +This command generates a JAR file in the `target` directory\. If you use the appender library \(`aws-lambda-java-log4j2`\), you must also configure a transformer for the Maven Shade plugin\. The transformer library combines versions of a cache file that appear in both the appender library and in Log4j\. @@ -207,7 +209,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf ## Uploading a deployment package with the Lambda API -To update a function's code with the AWS CLI or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory\. +To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip @@ -227,7 +229,7 @@ To update a function's code with the AWS CLI or AWS SDK, use the [UpdateFunction } ``` -If your deployment package is larger than 50 MB, you can't upload it directly\. Upload it to an Amazon S3 bucket and point Lambda to the object\. The following example commands upload a deployment package to a bucket named `my-bucket` and use it to update a function's code\. +If your deployment package is larger than 50 MB, you can't upload it directly\. Upload it to an Amazon Simple Storage Service \(Amazon S3\) bucket and point Lambda to the object\. The following example commands upload a deployment package to an S3 bucket named `my-bucket` and use it to update a function's code: ``` ~/my-function$ aws s3 cp my-function.zip s3://my-bucket @@ -254,7 +256,7 @@ You can use this method to upload function packages up to 250 MB \(decompressed\ ## Uploading a deployment package with AWS SAM -You can use the AWS Serverless Application Model to automate deployments of your function code, configuration, and dependencies\. AWS SAM is an extension of AWS CloudFormation that provides a simplified syntax for defining serverless applications\. The following example template defines a function with a deployment package in the `build/distributions` directory that Gradle uses\. +You can use AWS SAM to automate deployments of your function code, configuration, and dependencies\. AWS SAM is an extension of AWS CloudFormation that provides a simplified syntax for defining serverless applications\. The following example template defines a function with a deployment package in the `build/distributions` directory that Gradle uses: **Example template\.yml** @@ -294,11 +296,11 @@ aws cloudformation package --template-file template.yml --s3-bucket MY_BUCKET -- aws cloudformation deploy --template-file out.yml --stack-name java-basic --capabilities CAPABILITY_NAMED_IAM ``` -For a complete working example, see the following sample applications\. +For a complete working example, see the following sample applications: **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 646898c8..453a9d39 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -3,15 +3,15 @@ The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. -[https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) +[https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index ce129faf..802605dd 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) @@ -138,18 +138,18 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. ## Tracing in sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 44803fe9..d033617b 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -28,12 +28,13 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. +[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** -+ [AWS Lambda Deployment Package in C\#](csharp-package.md) + [AWS Lambda function handler in C\#](csharp-handler.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy \.NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C\#](csharp-context.md) + [AWS Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function errors in C\#](csharp-exceptions.md) diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 584003d9..b474f5e5 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,6 @@ # Managing AWS Lambda functions -You can use the AWS Lambda API or console to configure settings on your Lambda functions\. [Basic function settings](configuration-console.md) include the description, role, and runtime that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to set things like the handler name, memory allocation, and security groups during creation\. +You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-console.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 66118fbe..751af969 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -16,12 +16,13 @@ AWS Lambda provides the following libraries for Go: **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** -+ [AWS Lambda deployment package in Go](golang-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) ++ [Deploy Go Lambda functions with container images](go-image.md) + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md new file mode 100644 index 00000000..5f7500d9 --- /dev/null +++ b/doc_source/lambda-images.md @@ -0,0 +1,13 @@ +# Using container images with Lambda + +You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to a container registry such as Amazon Elastic Container Registry \(Amazon ECR\)\. + +AWS provides a set of open\-source base images that you can use to build the container image for your function code\. You can also use alternative base images from other container registries\. AWS also provides an open\-source runtime client that you add to your alternative base image to make it compatible with the Lambda service\. + +Additionally, AWS provides a runtime interface emulator for you to test your functions locally using tools such as the Docker CLI\. + +There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. + +**Topics** ++ [Creating Lambda container images](images-create.md) ++ [Testing Lambda container images locally](images-test.md) \ No newline at end of file diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index c93c4684..0532a5c4 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -4,7 +4,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA **To view a function's execution role** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index 69c5f7a5..a446b1a4 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -19,5 +19,6 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Monitoring the state of a function with the Lambda API](functions-states.md) + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) -+ [Using AWS Lambda extensions](using-extensions.md) ++ [Using Lambda extensions](using-extensions.md) ++ [Invoking functions defined as container images](invocation-images.md) + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index be40991d..fd9d2667 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -59,7 +59,7 @@ To get started with application development in your local environment, deploy on The `Hello` class has a function named `handleRequest` that takes an event object and a context object\. This is the [handler function](java-handler.md) that Lambda calls when the function is invoked\. The Java function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `example.Hello::handleRequest`\. -To update the function's code, you create a deployment package, which is a ZIP archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](java-package.md) and updating your code at the command line\. +To update the function's code, you create a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](java-package.md) and updating your code at the command line\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](java-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. @@ -67,8 +67,9 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [Java sample applications for AWS Lambda](java-samples.md) -+ [AWS Lambda deployment package in Java](java-package.md) + [AWS Lambda function handler in Java](java-handler.md) ++ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index 902a99da..f5e0333c 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -6,7 +6,7 @@ The Lambda console provides a built\-in [monitoring dashboard](monitoring-functi **To monitor a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index b3f275cf..b99c110a 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -58,16 +58,16 @@ The Lambda console uses AWS Cloud9 to provide an integrated development environm The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a ZIP archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](nodejs-package.md) and updating your code at the command line\. +Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](nodejs-package.md) and updating your code at the command line\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. +[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. +[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. +[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. +[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. +[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](nodejs-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. @@ -75,7 +75,8 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [AWS Lambda function handler in Node\.js](nodejs-handler.md) -+ [AWS Lambda deployment package in Node\.js](nodejs-package.md) ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Node\.js Lambda functions with container images](nodejs-image.md) + [AWS Lambda context object in Node\.js](nodejs-context.md) + [AWS Lambda function logging in Node\.js](nodejs-logging.md) + [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index d83a1672..a2b7f8bd 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -12,15 +12,15 @@ The following sections explain how common programming patterns and core concepts **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. +[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. -To learn about how to use the AWSLambdaPSCore module to download sample PowerShell projects from templates, create PowerShell deployment packages, and deploy PowerShell functions to the AWS Cloud, see [AWS Lambda deployment package in PowerShell](powershell-package.md)\. +To learn about how to use the AWSLambdaPSCore module to download sample PowerShell projects from templates, create PowerShell deployment packages, and deploy PowerShell functions to the AWS Cloud, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. **Topics** + [Setting Up a PowerShell Development Environment](powershell-devenv.md) -+ [AWS Lambda deployment package in PowerShell](powershell-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + [AWS Lambda function handler in PowerShell](powershell-handler.md) + [AWS Lambda context object in PowerShell](powershell-context.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 5f2bf072..8fb03ceb 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -60,11 +60,11 @@ The Lambda console uses AWS Cloud9 to provide an integrated development environm The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a ZIP archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](python-package.md) and updating your code at the command line\. +Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](python-package.md) and updating your code at the command line\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. @@ -72,7 +72,8 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [AWS Lambda function handler in Python](python-handler.md) -+ [AWS Lambda deployment package in Python](python-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) + [AWS Lambda function errors in Python](python-exceptions.md) diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index bd3a343b..55ce258e 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | | [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | @@ -92,8 +93,8 @@ The following table describes the important changes in each release of the *AWS | Versioning support, Python for developing code for Lambda functions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up AWS Lambda to invoke your code on a regular, scheduled basis using the AWS Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | | AWS Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, AWS Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | -| The AWS Lambda console now provides blueprints to easily create Lambda functions and test them\. | AWS Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the AWS Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with AWS Lambda](getting-started.md)\. | July 09, 2015 | +| The AWS Lambda console now provides blueprints to easily create Lambda functions and test them\. | AWS Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the AWS Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | | AWS Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | | AWS Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | -| AWS Lambda now generally available with added support for mobile backends | AWS Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using AWS Lambda that scale automatically without provisioning or managing infrastructure\. AWS Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with AWS Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | +| AWS Lambda now generally available with added support for mobile backends | AWS Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using AWS Lambda that scale automatically without provisioning or managing infrastructure\. AWS Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | | Preview release | Preview release of the *AWS Lambda Developer Guide*\. | November 13, 2014 | \ No newline at end of file diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index d4c81645..4d67d391 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -58,11 +58,11 @@ The Lambda console uses AWS Cloud9 to provide an integrated development environm The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a ZIP archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](ruby-package.md) and updating your code at the command line\. +Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](ruby-package.md) and updating your code at the command line\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](ruby-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. @@ -70,7 +70,8 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [AWS Lambda function handler in Ruby](ruby-handler.md) -+ [AWS Lambda deployment package in Ruby](ruby-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Ruby Lambda functions with container images](ruby-image.md) + [AWS Lambda context object in Ruby](ruby-context.md) + [AWS Lambda function logging in Ruby](ruby-logging.md) + [AWS Lambda function errors in Ruby](ruby-exceptions.md) diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 60249ed1..277d0492 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -1,6 +1,8 @@ -# AWS Lambda runtimes +# Lambda runtimes -AWS Lambda supports multiple languages through the use of runtimes\. You choose a runtime when you create a function, and you can change runtimes by updating your function's configuration\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. +Lambda supports multiple languages through the use of runtimes\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. + +When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-console.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. **Amazon Linux** + Image – [amzn\-ami\-hvm\-2018\.03\.0\.20181129\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2) @@ -10,7 +12,7 @@ AWS Lambda supports multiple languages through the use of runtimes\. You choose + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and allows you to save resources like database connections and temporary files in the [execution environment](runtimes-context.md) to avoid creating them every time your function runs\. +When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the [execution environment](runtimes-context.md) to avoid creating them every time your function runs\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -77,8 +79,9 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- **Topics** + [Runtime support policy](runtime-support-policy.md) + [AWS Lambda execution environment](runtimes-context.md) ++ [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) -+ [AWS Lambda Extensions API](runtimes-extensions-api.md) ++ [Lambda Extensions API](runtimes-extensions-api.md) + [Modifying the runtime environment](runtimes-modify.md) + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 44f70e1e..aa51f020 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -6,53 +6,53 @@ The GitHub repository for this guide includes sample applications that demonstra #### [ Node\.js ] **Sample Lambda applications in Node\.js** -+ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -+ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -+ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -+ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ++ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. ++ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. ++ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. ++ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ------ #### [ Python ] **Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Ruby ] **Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Java ] **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service, Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ #### [ Go ] **Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ------ #### [ C\# ] **Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ------ #### [ PowerShell ] **Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md index 704883b0..61a9711e 100644 --- a/doc_source/lambda-troubleshooting.md +++ b/doc_source/lambda-troubleshooting.md @@ -1,11 +1,12 @@ -# Troubleshooting issues in AWS Lambda +# Troubleshooting issues in Lambda The following topics provide troubleshooting advice for errors and issues that you might encounter when using the Lambda API, console, or tools\. If you find an issue that is not listed here, you can use the **Feedback** button on this page to report it\. For more troubleshooting advice and answers to common support questions, visit the [AWS Knowledge Center](https://aws.amazon.com/premiumsupport/knowledge-center/#AWS_Lambda)\. **Topics** -+ [Troubleshoot deployment issues in AWS Lambda](troubleshooting-deployment.md) -+ [Troubleshoot invocation issues in AWS Lambda](troubleshooting-invocation.md) -+ [Troubleshoot execution issues in AWS Lambda](troubleshooting-execution.md) -+ [Troubleshoot networking issues in AWS Lambda](troubleshooting-networking.md) \ No newline at end of file ++ [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) ++ [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) ++ [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) ++ [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) ++ [Troubleshoot container image issues in Lambda](troubleshooting-images.md) \ No newline at end of file diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 9bf9d8e7..45a82007 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -11,7 +11,7 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc **To view logs using the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 989d4b83..837f8544 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -4,7 +4,7 @@ AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWa **To access the monitoring console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose **Monitoring**\. ![\[Graphs of various CloudWatch metrics.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index a2f3091b..64345390 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -69,7 +69,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu **To enable Lambda Insights in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose your function\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 03a385ef..e43e10e2 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -46,7 +46,7 @@ You should view the following metrics with the `Sum` statistic\. Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Max` statistic\. **Performance metrics** -+ `Duration` – The amount of time that your function code spends processing an event\. For the first event processed by an instance of your function, this includes [initialization time](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest 100 milliseconds\. ++ `Duration` – The amount of time that your function code spends processing an event\. For the first event processed by an instance of your function, this includes [initialization time](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index b1db8be0..4cccd0d9 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -54,7 +54,7 @@ $ aws lambda invoke --function-name my-function out.json --log-type Tail \ START RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Version: $LATEST 2019-06-05T22:11:27.082Z 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 ERROR Invoke Error {"errorType":"ReferenceError","errorMessage":"x is not defined","stack":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} END RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 -REPORT RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Duration: 76.85 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 74 MB +REPORT RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Duration: 76.85 ms Billed Duration: 77 ms Memory Size: 128 MB Max Memory Used: 74 MB ``` For more information about logs, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md new file mode 100644 index 00000000..604488c7 --- /dev/null +++ b/doc_source/nodejs-image.md @@ -0,0 +1,35 @@ +# Deploy Node\.js Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Node\.js function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for Node\.js + +AWS provides the following base images for Node\.js: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | +| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | + +Docker Hub repository: amazon/aws\-lambda\-nodejs + +Amazon ECR repository: public\.ecr\.aws/lambda/nodejs + +## Node\.js runtime interface clients + +Install the runtime interface client for Node\.js using the npm package manager: + +``` +npm install aws-lambda-ric +``` + +For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. + +You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 928f4da4..62a40104 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -94,7 +94,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -144,7 +144,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index 86fb4720..b15ec6d0 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -1,11 +1,13 @@ -# AWS Lambda deployment package in Node\.js +# Deploy Node\.js Lambda functions with \.zip file archives -A deployment package is a ZIP archive that contains your function code and dependencies\. You need to create a deployment package if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon S3 bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -If you use the Lambda [console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. +A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. + +If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers let you manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For details, see [AWS Lambda layers](configuration-layers.md)\. +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. **Topics** + [Updating a function with no dependencies](#nodejs-package-codeonly) @@ -13,17 +15,17 @@ To keep your deployment package size small, package your function's dependencies ## Updating a function with no dependencies -To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS CLI\. +To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. **To update a Node\.js function with no dependencies** -1. Create a ZIP archive\. +1. Create a \.zip file archive\. ``` ~/my-function$ zip function.zip index.js ``` -1. Use the `update-function-code` command to upload the package\. +1. To upload the package, use the `update-function-code` command\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip @@ -45,21 +47,21 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, use an [Amazon Linux environment ](https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. +If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. -You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. +You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. **To update a Node\.js function with dependencies** 1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. -1. Install libraries in the node\_modules directory with the `npm install` command\. +1. Install libraries in the node\_modules directory using the `npm install` command\. ``` ~/my-function$ npm install aws-xray-sdk ``` - This creates a folder structure that's similar to the following\. + This creates a folder structure that's similar to the following: ``` ~/my-function @@ -73,13 +75,13 @@ You can add the SDK for JavaScript to the deployment package if you need a newer ├── aws-xray-sdk-core ``` -1. Create a ZIP file that contains the contents of your project folder\. +1. Create a \.zip file that contains the contents of your project folder\. ``` ~/my-function$ zip -r function.zip . ``` -1. Use the `update-function-code` command to upload the package\. +1. Upload the package using the `update-function-code` command\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip @@ -99,6 +101,6 @@ You can add the SDK for JavaScript to the deployment package if you need a newer } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see the following: -+ [Running executables in AWS Lambda](https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) -+ [Using packages and native nodejs modules in AWS Lambda ](https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) \ No newline at end of file +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see the following on the AWS Compute Blog: ++ [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) ++ [Using Packages and Native nodejs Modules in AWS Lambda](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 0ed581a2..f33a5253 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) @@ -172,4 +172,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index e61f0096..2e5e7c32 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -16,7 +16,7 @@ Write-Host 'Function Name:' $LambdaContext.FunctionName This script returns the FunctionName property that's obtained from the $LambdaContext variable\. **Note** -You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [AWS Lambda deployment package in PowerShell](powershell-package.md)\. +You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://aws.amazon.com/documentation/powershell/?id=docs_gateway)\. ## Returning data diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 24a96cb8..1be2191b 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -106,7 +106,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -156,7 +156,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md index 91eb31fb..bd736767 100644 --- a/doc_source/powershell-package.md +++ b/doc_source/powershell-package.md @@ -1,20 +1,22 @@ -# AWS Lambda deployment package in PowerShell +# Deploy PowerShell Lambda functions with \.zip file archives -A PowerShell Lambda deployment package is a ZIP file that contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions\. +A \.zip file archive is a PowerShell Lambda deployment package that contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. + +The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions: **AWSLambdaPSCore cmdlets** + **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. + **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. + **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. -+ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that can be used in a CI/CD system for deployment\. ++ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. -To help get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to AWS Lambda\. Then you can test your script either through the command line or the console\. +To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. -To create a new PowerShell script, upload it, and test it, follow this procedure: +To create a new PowerShell script, upload it, and test it, do the following: -1. Run the following command to view the list of available templates: +1. To view the list of available templates, run the following command: ``` PS C:\> Get-AWSPowerShellLambdaTemplate @@ -26,7 +28,7 @@ To create a new PowerShell script, upload it, and test it, follow this procedure ... ``` -1. Run the following command to create a sample script based on the `Basic` template: +1. To create a sample script based on the `Basic` template, run the following command: ``` New-AWSPowerShellLambda -ScriptName MyFirstPSScript -Template Basic @@ -37,13 +39,13 @@ To create a new PowerShell script, upload it, and test it, follow this procedure You can see that the new file has the following contents: ``` - # PowerShell script file to be executed as a AWS Lambda function. + # PowerShell script file to run as a Lambda function # - # When executing in Lambda the following variables will be predefined. + # When executing in Lambda the following variables are predefined. # $LambdaInput - A PSObject that contains the Lambda function input data. # $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment. # - # The last item in the PowerShell pipeline will be returned as the result of the Lambda function. + # The last item in the PowerShell pipeline is returned as the result of the Lambda function. # # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement # indicating the module and version. @@ -54,7 +56,7 @@ To create a new PowerShell script, upload it, and test it, follow this procedure # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5) ``` -1. To see how log messages from your PowerShell script are sent to CloudWatch Logs, uncomment the `Write-Host` line of the sample script\. +1. To see how log messages from your PowerShell script are sent to Amazon CloudWatch Logs, uncomment the `Write-Host` line of the sample script\. To demonstrate how you can return data back from your Lambda functions, add a new line at the end of the script with `$PSVersionTable`\. This adds the `$PSVersionTable` to the PowerShell pipeline\. After the PowerShell script is complete, the last object in the PowerShell pipeline is the return data for the Lambda function\. `$PSVersionTable` is a PowerShell global variable that also provides information about the running environment\. @@ -65,7 +67,7 @@ To create a new PowerShell script, upload it, and test it, follow this procedure $PSVersionTable ``` -1. After editing the `MyFirstPSScript.ps1` file, change the directory to the script's location\. Then run the following command to publish the script to AWS Lambda: +1. After editing the `MyFirstPSScript.ps1` file, change the directory to the script's location\. Then run the following command to publish the script to Lambda: ``` Publish-AWSPowerShellLambda -ScriptPath .\MyFirstPSScript.ps1 -Name MyFirstPSScript -Region us-east-2 @@ -73,7 +75,7 @@ To create a new PowerShell script, upload it, and test it, follow this procedure Note that the `-Name` parameter specifies the Lambda function name, which appears in the Lambda console\. You can use this function to invoke your script manually\. -1. Invoke your function with the AWS CLI `invoke` command\. +1. Invoke your function using the AWS Command Line Interface \(AWS CLI\) `invoke` command\. ``` > aws lambda invoke --function-name MyFirstPSScript out diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 7e71b0ac..c8d129a4 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -50,7 +50,7 @@ $ aws lambda invoke --function-name my-function out.json --log-type Tail \ START RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Version: $LATEST     return x + 10/lambda_function.py", line 2, in lambda_handler END RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 -REPORT RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Duration: 12.33 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB +REPORT RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Duration: 12.33 ms Billed Duration: 13 ms Memory Size: 128 MB Max Memory Used: 56 MB ``` For more information about logs, see [AWS Lambda function logging in Python](python-logging.md)\. \ No newline at end of file diff --git a/doc_source/python-image.md b/doc_source/python-image.md new file mode 100644 index 00000000..c8cb47a4 --- /dev/null +++ b/doc_source/python-image.md @@ -0,0 +1,37 @@ +# Deploy Python Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for Python + +AWS provides the following base images for Python: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 3, 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | +| 3\.7 | Python 3\.7 | Amazon Linux 2 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | +| 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | +| 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | + +Docker Hub repository: amazon/aws\-lambda\-python + +Amazon ECR repository: public\.ecr\.aws/lambda/python + +## Python runtime interface clients + +Install the runtime interface client for Python using the pip package manager: + +``` +pip install awslambdaric +``` + +For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. + +You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index ab4edb47..ecca9be3 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -25,7 +25,7 @@ environ({'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/my-function', 'AWS_LAMBDA_LOG ## EVENT {'key': 'value'} END RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 -REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms +REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms XRAY TraceId: 1-5e34a614-10bdxmplf1fb44f07bc535a1 SegmentId: 07f5xmpl2d1f6f85 Sampled: true ``` @@ -85,7 +85,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -135,7 +135,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], @@ -178,6 +178,6 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST [INFO] 2020-01-31T22:12:58.535Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 {'key': 'value'} END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 -REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms +REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true ``` \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 09755f98..3d42e975 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,10 +1,12 @@ -# AWS Lambda deployment package in Python +# Deploy Python Lambda functions with \.zip file archives -A deployment package is a ZIP archive that contains your function code and dependencies\. You need to create a deployment package if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon S3 bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -If you use the Lambda [console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. +A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. -You can also use the AWS SAM CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS SAM Developer Guide*\. +If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. + +You can also use the AWS Serverless Application Model \(AWS SAM\) CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. **Note** We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. @@ -19,7 +21,7 @@ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serve These instructions assume that you have already created a Lambda function and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command @@ -32,7 +34,7 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Updating a function with no dependencies -To create or update a function with the Lambda API, create an deployment package that contains your function code and upload it with the AWS CLI\. +To create or update a function with the Lambda API, create a deployment package that contains your function code and upload it with the AWS Command Line Interface \(AWS CLI\)\. **To update a Python function with no dependencies** @@ -42,7 +44,7 @@ To create or update a function with the Lambda API, create an deployment package ~/my-function$ zip my-deployment-package.zip lambda_function.py ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip @@ -62,12 +64,12 @@ To create or update a function with the Lambda API, create an deployment package ## Updating a function with additional dependencies -If your function depends on libraries other than the SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. +If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. The steps assume you are not using a virtual environment\. +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with dependencies** @@ -77,7 +79,7 @@ If you are creating a deployment package used in a layer, see [Including library ~/my-function$ pip install --target ./package requests ``` **Note** -You may need to pass the `--system` option on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) like Ubuntu to prevent `distutils` errors\. +To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. 1. Create a deployment package with the installed libraries at the root\. @@ -106,7 +108,7 @@ You may need to pass the `--system` option on [Debian\-based systems](https://gi ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip @@ -128,10 +130,10 @@ You may need to pass the `--system` option on [Debian\-based systems](https://gi In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload to Lambda using the AWS CLI\. +The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with a virtual environment** @@ -188,7 +190,7 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary ZIP deployment package to Lambda and update the function code\. +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. ``` ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index c3946e5a..b64c3e30 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) @@ -150,4 +150,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 1d1826e0..1111c347 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -63,7 +63,7 @@ Error raised from handler method ] } END RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 -REPORT RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Duration: 22.74 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB +REPORT RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Duration: 22.74 ms Billed Duration: 23 ms Memory Size: 128 MB Max Memory Used: 18 MB ``` For more information about logs, see [AWS Lambda function logging in Ruby](ruby-logging.md)\. diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index e6cd111d..10345491 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -34,4 +34,4 @@ The two objects that the handler accepts are the invocation event and context\. The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environmentManaging state machines in the Lambda console](runtimes-context.md)\. \ No newline at end of file +Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environment](runtimes-context.md)\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md new file mode 100644 index 00000000..00171271 --- /dev/null +++ b/doc_source/ruby-image.md @@ -0,0 +1,35 @@ +# Deploy Ruby Lambda functions with container images + +You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Ruby function: ++ AWS base images for Lambda + + These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. ++ Open\-source runtime interface clients + + If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + +## AWS base images for Ruby + +AWS provides the following base images for Ruby: + + +| Tags | Runtime | Operating system | Dockerfile | +| --- | --- | --- | --- | +| 2, 2\.7 | Ruby 2\.7 | Amazon Linux 2 | [Dockerfile for Ruby 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.7/Dockerfile.ruby2.7) | +| 2\.5 | Ruby 2\.5 | Amazon Linux 2018\.03 | [Dockerfile for Ruby 2\.5 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.5/Dockerfile.ruby2.5) | + +Docker Hub repository: amazon/aws\-lambda\-ruby + +Amazon ECR repository: public\.ecr\.aws/lambda/ruby + +## Ruby runtime interface clients + +Install the runtime interface client for Ruby using the RubyGems\.org package manager: + +``` +gem install aws_lambda_ric +``` + +For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) on [RubyGems\.org](https://rubygems.org/pages/about)\. + +You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 988b0b17..46da0ba2 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -72,7 +72,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -97,7 +97,7 @@ AWS_Lambda_ruby2.5 key value END RequestId: 50aba555-xmpl-4b21-8358-644ee996a05f -REPORT RequestId: 50aba555-xmpl-4b21-8358-644ee996a05f Duration: 12.96 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 48 MB Init Duration: 117.86 ms +REPORT RequestId: 50aba555-xmpl-4b21-8358-644ee996a05f Duration: 12.96 ms Billed Duration: 13 ms Memory Size: 128 MB Max Memory Used: 48 MB Init Duration: 117.86 ms XRAY TraceId: 1-5e34a246-2a04xmpl0fa44eb60ea08c5f SegmentId: 454xmpl46ca1c7d3 Sampled: true ``` @@ -156,7 +156,7 @@ $ aws lambda invoke --function-name my-function out --log-type Tail \ START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 73 MB +REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. @@ -206,7 +206,7 @@ $ ./get-logs.sh }, { "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 100 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", + "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", "ingestionTime": 1559763018353 } ], diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index e6e03092..9b173859 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -1,11 +1,13 @@ -# AWS Lambda deployment package in Ruby +# Deploy Ruby Lambda functions with \.zip file archives -A deployment package is a ZIP archive that contains your function code and dependencies\. You need to create a deployment package if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon S3 bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. -If you use the Lambda [console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. +A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. + +If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers let you manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For details, see [AWS Lambda layers](configuration-layers.md)\. +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. **Topics** + [Updating a function with no dependencies](#ruby-package-codeonly) @@ -13,17 +15,17 @@ To keep your deployment package size small, package your function's dependencies ## Updating a function with no dependencies -To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS CLI\. +To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. **To update a Ruby function with no dependencies** -1. Create a ZIP archive\. +1. Create a \.zip file archive\. ``` ~/my-function$ zip function.zip function.rb ``` -1. Use the `update-function-code` command to upload the package\. +1. To upload the package, use the `update-function-code` command\. ``` ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip @@ -49,7 +51,7 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t **To update a Ruby function with dependencies** -1. Install libraries in the vendor directory with the `bundle` command\. +1. Install libraries in the vendor directory using the `bundle` command\. ``` ~/my-function$ bundle install --path vendor/bundle @@ -62,7 +64,7 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t The `--path` installs the gems in the project directory instead of the system location, and sets this as the default path for future installations\. To later install gems globally, use the `--system` option\. -1. Create a ZIP archive\. +1. Create a \.zip file archive\. ``` package$ zip -r function.zip function.rb vendor diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index eae9eb8f..eb33cef3 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -25,7 +25,7 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtimes)\. +When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) @@ -152,4 +152,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 13403556..da6e9f76 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -1,11 +1,11 @@ # Runtime support policy -[AWS Lambda runtimes](lambda-runtimes.md) are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When a component of a runtime is no longer supported for security updates, Lambda deprecates the runtime\. +[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When a component of a runtime is no longer supported for security updates, Lambda deprecates the runtime\. Deprecation occurs in two phases\. During the first phase, you can no longer create functions that use the deprecated runtime\. For at least 30 days, you can continue to update existing functions that use the deprecated runtime\. After this period, both function creation and updates are disabled permanently\. However, the function continues to be available to process invocation events\. **Note** -Python 2\.7 reached end\-of\-life on January 1st, 2020\. However, the Python 2\.7 runtime is still supported and is not scheduled to be deprecated at this time\. For details, see [Continued support for Python 2\.7 on AWS Lambda](https://aws.amazon.com/blogs/compute/continued-support-for-python-2-7-on-aws-lambda/)\. +Python 2\.7 reached end of life on January 1, 2020\. However, the Python 2\.7 runtime is still supported and is not scheduled to be deprecated at this time\. For details, see [Continued support for Python 2\.7 on AWS Lambda](http://aws.amazon.com/blogs/compute/continued-support-for-python-2-7-on-aws-lambda/) on the AWS Compute Blog\. The following runtimes have been deprecated: @@ -28,7 +28,7 @@ In most cases, the end\-of\-life date of a language version or operating system + **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) + **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/technetwork/java/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/technetwork/java/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/s/release) + **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index fe6930e0..50268a89 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -13,11 +13,11 @@ The function's runtime and each external extension are processes that run within ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ![\[The Init phase is followed by one or more function invocations. When there are no invocation requests, Lambda initiates the SHutdown phase.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Successful-Invokes.png) @@ -57,7 +57,7 @@ When Lambda is about to shut down the runtime, it sends a `Shutdown` event to th After the function and all extensions have completed, Lambda maintains the execution environment for some time in anticipation of another function invocation\. In effect, Lambda freezes the execution environment\. When the function is invoked again, Lambda thaws the environment for reuse\. Reusing the execution environment has the following implications: + Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We recommend adding logic in your code to check if a connection exists before creating a new one\. -+ Each execution environment provides 512 MB of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [AWS Lambda quotas](gettingstarted-limits.md)\. ++ Each execution environment provides 512 MB of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. + Background processes or callbacks that were initiated by your Lambda function and did not complete when the function ended resume if Lambda reuses the execution environment\. Make sure that any background processes or callbacks in your code are complete before the code exits\. When you write your function code, do not assume that Lambda automatically reuses the execution environment for subsequent function invocations\. Other factors may dictate a need for Lambda to create a new execution environment, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 026fbf71..f1ee7b01 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -1,12 +1,12 @@ -# AWS Lambda Extensions API +# Lambda Extensions API -You use the Extensions API to create Lambda extensions\. Extensions provide a new way for monitoring, security and other tools to integrate with the Lambda [ execution environment](runtimes-context.md)\. For additional information, see [ Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/)\. +You use the Extensions API to create Lambda extensions\. Extensions provide a method for monitoring, security, and other tools to integrate with the Lambda [execution environment](runtimes-context.md)\. For more information, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. The Extensions API builds on the existing [Runtime API](runtimes-api.md), which provides an HTTP API for custom runtimes to receive invocation events from Lambda\. As an extension author, you can use the Extensions API to register for function and execution environment lifecycle events\. In response to these events, you can start new processes or run logic\. -Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific environment variables and wrapper scripts, and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\. +Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific [environment variables and wrapper scripts](runtimes-modify.md), and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\. -An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, they can be written in a different language than the function\. +An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, you can write them in a different language than the function\. The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) @@ -28,16 +28,21 @@ You share your extension as a [Lambda layer](configuration-layers.md) to make it You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. **Note** -Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. +For example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. + +**Topics** ++ [Lambda execution environment lifecycle](#runtimes-extensions-api-lifecycle) ++ [Adding extensions to container images](#extensions-images) ++ [Extensions API reference](#runtimes-extensions-registration-api) ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. Each phase starts with an event from the Lambda service to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. @@ -57,7 +62,7 @@ During the `Extension init` phase, each extension needs to register with Lambda You can register up to 10 extensions for a function\. This limit is enforced through the `Register` API call\. -After each extension registers with Lambda, Lambda starts the `Runtime init` phase\. The runtime process calls functionInit to start the Function init phase\. +After each extension registers, Lambda starts the `Runtime init` phase\. The runtime process calls `functionInit` to start the `Function init` phase\. The `Init` phase completes after the runtime and each registered extension indicate completion by sending a `Next` API request\. @@ -76,9 +81,7 @@ The `Invoke` phase ends after the runtime and all extensions signal that they ar ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Invoke-Phase.png) -**Event payload**: - -The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function ARN, and tracing headers\. +**Event payload**: The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function's Amazon Resource Name \(ARN\), and tracing headers\. Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. @@ -112,11 +115,11 @@ Function developers can run different versions of their functions side by side t When Lambda is about to terminate the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. **Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: -+ 300 ms – a function with no registered extensions\. -+ 500 ms – a function with a registered internal extension\. -+ 2000 ms – a function with one or more registered external extensions\. ++ 300 ms – A function with no registered extensions ++ 500 ms – A function with a registered internal extension ++ 2,000 ms – A function with one or more registered external extensions -For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2000 ms limit for external extensions to shut down\. +For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2,000 ms limit for external extensions to shut down\. If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda terminates the process using a `SIGKILL` signal\. @@ -125,7 +128,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t **Event payload**: The `Shutdown` event contains the reason for the shutdown and the time remaining in milliseconds\. The `shutdownReason` includes the following values: -+ SPINDOWN – Normal shutdown ++ SPINDOWN – Normal shutdown + TIMEOUT – Duration limit timed out + FAILURE – Error condition, such as an `out-of-memory` event @@ -139,7 +142,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t ### Permissions and configuration -Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and /tmp disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. +Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and `/tmp` disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. **File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional network egress rules, you must apply these rules to the function configuration\. @@ -160,9 +163,9 @@ Because the function code directory is read\-only, extensions cannot modify the ### Failure handling -**Initialization failures**: If an extension fails, Lambda restarts the execution environment to enforce consistent behavior and encourage fail fast for extensions\. Also, for some customers, the extensions must meet mission\-critical needs such as logging, security, governance, and telemetry collection\. +**Initialization failures**: If an extension fails, Lambda restarts the execution environment to enforce consistent behavior and to encourage fail fast for extensions\. Also, for some customers, the extensions must meet mission\-critical needs such as logging, security, governance, and telemetry collection\. -**Invoke failures** \(e\.g\. out of memory, function timeout\): Because extensions share resources with the runtime, they are affected by memory exhaustion\. When the runtime fails, all extensions and the runtime itself participate in the `Shutdown` phase\. In addition, the runtime is restarted—either automatically as part of the current invoke, or via a deferred re\-initialization mechanism\. +**Invoke failures** \(such as out of memory, function timeout\): Because extensions share resources with the runtime, memory exhaustion affects them\. When the runtime fails, all extensions and the runtime itself participate in the `Shutdown` phase\. In addition, the runtime is restarted—either automatically as part of the current invocation, or via a deferred re\-initialization mechanism\. If there is a failure \(such as a function timeout or runtime error\) during `Invoke`, the Lambda service performs a reset\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime, then it sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If this environment is used for a new invocation, the extension and runtime are re\-initialized as part of the next invocation\. @@ -177,6 +180,14 @@ Lambda does not automatically shut down extensions that repeatedly fail\. Howeve + If a `Register` request fails, make sure that the `Lambda-Extension-Name` header in the `Register` API call contains the full file name of the extension\. + If the `Register` request fails for an internal extension, make sure that the request does not register for the `Shutdown` event\. +## Adding extensions to container images + +You can add internal and external extensions to your [container image](lambda-images.md)\. An internal extension runs in the main container process, and an external extension runs as an independent process in the container\. + +The ENTRYPOINT [container image setting](images-create.md#images-parms) specifies the main process for the container\. Configure the ENTRYPOINT and CMD settings in the Dockerfile, or as an override in the function configuration\. Internal extensions and other in\-process tools run in the process that the ENTRYPOINT specifies\. + +You can run multiple processes within a container\. Lambda provides a built\-in server that manages the lifecycle of the main process and any additional processes\. The server uses the Extensions API to communicate with each external extension\. + ## Extensions API reference The OpenAPI specification for the extensions API version **2020\-01\-01** is available here: [extensions\-api\.zip](samples/extensions-api.zip) @@ -195,7 +206,7 @@ http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register ### Register -During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. +During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. Internal extensions are started and stopped by the runtime process, so they are not permitted to register for the `Shutdown` event\. @@ -203,7 +214,7 @@ Internal extensions are started and stopped by the runtime process, so they are **Method** – **POST** -**Headers ** +**Headers** `Lambda-Extension-Name` – The full file name of the extension\. Required: yes\. Type: string\. @@ -216,9 +227,9 @@ Internal extensions are started and stopped by the runtime process, so they are **Response codes** + 200 – Response body contains the function name, function version, and handler name\. -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. **Example request body** @@ -270,11 +281,11 @@ The extension uses this method to report an initialization error to Lambda\. Cal **Method** – **POST** -**Headers ** +**Headers** `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(e\.g\. Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. **Body parameters** @@ -301,7 +312,7 @@ The extension uses this method to report an error to Lambda before exiting\. Cal `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(e\.g\. Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. **Body parameters** diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md new file mode 100644 index 00000000..2a097aed --- /dev/null +++ b/doc_source/runtimes-images.md @@ -0,0 +1,54 @@ +# Runtime support for Lambda container images + +AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. + +**Topics** ++ [AWS base images for Lambda](#runtimes-images-lp) ++ [Runtime interface clients](#runtimes-api-client) ++ [Runtime interface emulator](#runtimes-test-emulator) + +## AWS base images for Lambda + +You can use one of the AWS base images for Lambda to build the container image for your function code\. The base images are preloaded with a language runtime and other components required to run a container image on Lambda\. You add your function code and dependencies to the base image and then package it as a container image\. + +AWS will maintain and regularly update these images\. In addition, AWS will release an AWS base images when any new managed runtime becomes available\. + +Lambda provides base images for the following runtimes: ++ [Node\.js](nodejs-image.md) ++ [Python](python-image.md) ++ [Java](java-image.md) ++ [\.NET](csharp-image.md) ++ [Go](go-image.md) ++ [Ruby](ruby-image.md) + +### Base images for custom runtimes + +AWS provides base images that contain the required Lambda components and the Amazon Linux or Amazon Linux2 operating system\. You can add your preferred runtime, dependencies and code to these images\. + + +| Tags | Runtime | Operating system | +| --- | --- | --- | +| al2 | provided\.al2 | Amazon Linux 2 | +| alami | provided | Amazon Linux | + +DockerHub: amazon/aws\-lambda\-provided + +ECR Public: public\.ecr\.aws/lambda/provided + +## Runtime interface clients + +The runtime interface client in your container image manages the interaction between Lambda and your function code\. The [Runtime API](runtimes-api.md), along with the [ Extensions API](runtimes-extensions-api.md), defines a simple HTTP interface for runtimes to receive invocation events from Lambda and respond with success or failure indications\. + +Each of the AWS base images for Lambda include a runtime interface client\. If you choose an alternative base image, you need to add the appropriate runtime interface client\. + +For your convenience, Lambda provides an open source runtime interface client for each of the supported Lambda runtimes: ++ [Node\.js](nodejs-image.md#nodejs-image-clients) ++ [Python](python-image.md#python-image-clients) ++ [Java](java-image.md#java-image-clients) ++ [\.NET](csharp-image.md#csharp-image-clients) ++ [Go](go-image.md#go-image-clients) ++ [Ruby](ruby-image.md#ruby-image-clients) + +## Runtime interface emulator + +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index ddb7a422..4b41d6af 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -200,7 +200,7 @@ The following example shows a function log message\. The [ compute blog post entry](https://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations) for Logs API includes sample code showing how to send logs to a custom destination\. -Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws-lambda-extensions) showing how to develop a basic extension and subscribe to the Logs API\. For more information about building a Lambda extension, see [AWS Lambda Extensions API](runtimes-extensions-api.md)\. +Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws-lambda-extensions) showing how to develop a basic extension and subscribe to the Logs API\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. ## Logs API reference diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index c0860f8e..5e201871 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -9,7 +9,7 @@ Lambda provides language\-specific [environment variables](configuration-envvars Lambda supports configuration\-only ways to enable code to be pre\-loaded during function initialization through the following language\-specific environment variables: + `JAVA_TOOL_OPTIONS` – On Java 11 and Java 8 \(`java8.al2`\), Lambda supports this environment variable to set additional command\-line variables in Lambda\. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the `agentlib` or `javaagent` options\. + `NODE_OPTIONS` – On Node\.js 10x and above, Lambda supports this environment variable\. -+ `DOTNET_STARTUP_HOOKS` – On \.NET Core 3\.1 and above, Lambda can take a path to an assembly \(dll\) provided by this environment variable\. ++ `DOTNET_STARTUP_HOOKS` – On \.NET Core 3\.1 and above, this environment variable specifies a path to an assembly \(dll\) that Lambda can use\. Using language\-specific environment variables is the preferred way to set startup properties\. diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index 1c1d87b4..5e5b7623 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -4,9 +4,9 @@ In this tutorial, you create a Lambda function with a custom runtime\. You start ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command @@ -93,7 +93,7 @@ runtime-tutorial └ function.sh ``` -Make the files executable and add them to a ZIP archive\. +Make the files executable and add them to a \.zip file archive\. ``` runtime-tutorial$ chmod 755 function.sh bootstrap diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index b6f91318..743ac593 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -7,17 +7,17 @@ The blank function sample application is a starter application that demonstrates Variants of this sample application are available for the following languages: **Variants** -+ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs)\. -+ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python)\. -+ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby)\. -+ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java)\. -+ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go)\. -+ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp)\. -+ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell)\. ++ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs)\. ++ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python)\. ++ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby)\. ++ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java)\. ++ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go)\. ++ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp)\. ++ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell)\. The examples in this topic highlight code from the Node\.js version, but the details are generally applicable to all variants\. -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. **Topics** + [Architecture and handler code](#samples-blank-architecture) diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index ad43ed3b..20830f04 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -8,7 +8,7 @@ Function code is available in the following files: + Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor)\. **Topics** + [Architecture and event structure](#sample-errorprocessor-architecture) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 86415c56..5ac70cf1 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -10,7 +10,7 @@ In addition to the function that processes events, the application includes a se + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) + Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager)\. **Topics** + [Architecture and event structure](#samples-listmanager-architecture) diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md index 9b557af4..68aee0f3 100644 --- a/doc_source/security-configuration.md +++ b/doc_source/security-configuration.md @@ -2,6 +2,6 @@ AWS Lambda provides [runtimes](lambda-runtimes.md) that run your function code in an Amazon Linux–based execution environment\. Lambda is responsible for keeping software in the runtime and execution environment up to date, releasing new runtimes for new languages and frameworks, and deprecating runtimes when the underlying software is no longer supported\. -If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](gettingstarted-features.md#gettingstarted-features-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. +If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](getting-started-create-function.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime support policy](runtime-support-policy.md)\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index fa2d1ad0..4cc83fe3 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -34,6 +34,6 @@ Additionally, you can use the following features to customize how environment va For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-features.md#gettingstarted-features-package) and [layer archives](configuration-layers.md)\. +Lambda always encrypts files that you upload to Lambda, including [deployment packages](getting-started-create-function.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index 57899272..14169d60 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -59,6 +59,6 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. + To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. + To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. + To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index e5738b01..85847284 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -63,7 +63,7 @@ exports.handler = function(event, context, callback) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Python 3 @@ -110,7 +110,7 @@ def handler(event, context): raise ValueError('Unrecognized operation "{}"'.format(operation)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. ## Go @@ -137,4 +137,4 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 16027b2a..7d2445df 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -57,9 +57,9 @@ To learn more about these API Gateway features, see [Configure proxy integration ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 7053003d..23d9cf67 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -4,7 +4,7 @@ You can create a web API with an HTTP endpoint for your Lambda function by using **To add a public endpoint to your Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -291,6 +291,6 @@ For more information, see [AWS Lambda integrations](https://docs.aws.amazon.com/ ## Sample applications The GitHub repository for this guide provides the following sample application for API Gateway\. -+ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. ++ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. Lambda also provides [blueprints](gettingstarted-features.md#gettingstarted-features-blueprints) and [templates](gettingstarted-features.md#gettingstarted-features-templates) that you can use to create an API Gateway application in the Lambda console\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index fd43281b..e2322cf2 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -9,7 +9,7 @@ In this tutorial, you do the following: ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. ## Create a Lambda function @@ -43,7 +43,7 @@ CloudWatch Events emits an event every minute, based on the schedule expression\ Test the function with a sample event provided by the Lambda console\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose **lambda\-canary**\. @@ -111,7 +111,7 @@ Update the function configuration to cause the function to return an error, whic **To trigger an alarm** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose **lambda\-canary**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 2c05d13f..3c131066 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -52,7 +52,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re **To configure CloudWatch Events to invoke your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md index fb6d9739..59ffb2fa 100644 --- a/doc_source/services-cloudwatchlogs.md +++ b/doc_source/services-cloudwatchlogs.md @@ -1,10 +1,10 @@ -# Using AWS Lambda with Amazon CloudWatch Logs +# Using Lambda with CloudWatch Logs -You can use a Lambda function to monitor and analyze logs from an Amazon CloudWatch Logs log stream\. Create [subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/Subscriptions.html) for one or more log streams to invoke a function when logs are created or match an optional pattern\. Use the function to send a notification or persist the log to a database or storage\. +You can use a Lambda function to monitor and analyze logs from an Amazon CloudWatch Logs log stream\. Create [subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html) for one or more log streams to invoke a function when logs are created or match an optional pattern\. Use the function to send a notification or persist the log to a database or storage\. -CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64 encoded ZIP archive\. +CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.zip file archive\. -**Example Amazon CloudWatch Logs message event** +**Example CloudWatch Logs message event** ``` { @@ -14,9 +14,9 @@ CloudWatch Logs invokes your function asynchronously with an event that contains } ``` -When decoded and decompressed, the log data is a JSON document with the following structure\. +When decoded and decompressed, the log data is a JSON document with the following structure: -**Example Amazon CloudWatch Logs message data \(decoded\)** +**Example CloudWatch Logs message data \(decoded\)** ``` { @@ -31,7 +31,7 @@ When decoded and decompressed, the log data is a JSON document with the followin { "id": "34622316099697884706540976068822859012661220141643892546", "timestamp": 1552518348220, - "message": "REPORT RequestId: 6234bffe-149a-b642-81ff-2e8e376d8aff\tDuration: 46.84 ms\tBilled Duration: 100 ms \tMemory Size: 192 MB\tMax Memory Used: 72 MB\t\n" + "message": "REPORT RequestId: 6234bffe-149a-b642-81ff-2e8e376d8aff\tDuration: 46.84 ms\tBilled Duration: 47 ms \tMemory Size: 192 MB\tMax Memory Used: 72 MB\t\n" } ] } diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index c47063e2..581bb681 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -10,7 +10,7 @@ For more information about spot instances usage and best practices, see [Spot In ## Prerequisites -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index e96793a3..a256337e 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -9,9 +9,9 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command @@ -99,7 +99,7 @@ def handler(event, context): + [pymemcache](https://pypi.python.org/pypi/pymemcache) – The Lambda function code uses this library to create a `HashClient` object to set and get items from memcache\. + [elasticache\-auto\-discovery](https://pypi.python.org/pypi/elasticache-auto-discovery) – The Lambda function uses this library to get the nodes in your Amazon ElastiCache cluster\. -Install dependencies with Pip and create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. +Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. ## Create the Lambda function diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 37f7c108..45e85697 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -9,9 +9,9 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ### Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command @@ -133,7 +133,7 @@ db_name = "ExampleDB" **Dependencies** + `pymysql` – The Lambda function code uses this library to access your MySQL instance \(see [PyMySQL](https://pypi.python.org/pypi/PyMySQL)\) \. -Install dependencies with Pip and create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. +Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. ### Create the Lambda function diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 4eb38a23..ea817d2a 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 5c3bd3b2..aa94c9d3 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -1,4 +1,4 @@ -# Troubleshoot deployment issues in AWS Lambda +# Troubleshoot deployment issues in Lambda When you update your function, Lambda deploys the change by launching new instances of the function with the updated code or settings\. Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index e867f0a9..68f4219a 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -1,4 +1,4 @@ -# Troubleshoot execution issues in AWS Lambda +# Troubleshoot execution issues in Lambda When the Lambda runtime runs your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. @@ -33,14 +33,14 @@ Some libraries don't return promises but can be wrapped in code that does\. For **Issue:** *The AWS SDK included on the runtime updates automatically* Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: -+ [AWS Lambda deployment package in Node\.js](nodejs-package.md) -+ [AWS Lambda deployment package in Python](python-package.md) -+ [AWS Lambda deployment package in Ruby](ruby-package.md) -+ [AWS Lambda deployment package in Java](java-package.md) -+ [AWS Lambda deployment package in Go](golang-package.md) -+ [AWS Lambda Deployment Package in C\#](csharp-package.md) -+ [AWS Lambda deployment package in PowerShell](powershell-package.md) ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) **Issue:** \(Python\) *Some libraries don't load correctly from the deployment package* -Libraries with extension modules written in C or C\+\+ must be compiled in an environment with the same processor architecture as Lambda \(Amazon Linux\)\. For more information, see [AWS Lambda deployment package in Python](python-package.md)\. \ No newline at end of file +Libraries with extension modules written in C or C\+\+ must be compiled in an environment with the same processor architecture as Lambda \(Amazon Linux\)\. For more information, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md new file mode 100644 index 00000000..c02eca30 --- /dev/null +++ b/doc_source/troubleshooting-images.md @@ -0,0 +1,13 @@ +# Troubleshoot container image issues in Lambda + +**Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* + +Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. + +**Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* + +Retry the function invocation\. If the retry fails, validate that the files required to run the function code can be read by any user\. Lambda defines a default Linux user with least\-privileged permissions\. You need to verify that your application code does not rely on files that are restricted by other Linux users for execution\. + +**Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* + +Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 94523050..d4a71f52 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -1,4 +1,4 @@ -# Troubleshoot invocation issues in AWS Lambda +# Troubleshoot invocation issues in Lambda When you invoke a Lambda function, Lambda validates the request and checks for scaling capacity before sending the event to your function or, for asynchronous invocation, to the event queue\. Invocation errors can be caused by issues with request parameters, event structure, function settings, user permissions, resource permissions, or limits\. diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md index 743f0101..6436661f 100644 --- a/doc_source/troubleshooting-networking.md +++ b/doc_source/troubleshooting-networking.md @@ -1,4 +1,4 @@ -# Troubleshoot networking issues in AWS Lambda +# Troubleshoot networking issues in Lambda By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with VPC resources\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 615d3216..678a5bfc 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -1,8 +1,8 @@ -# Using AWS Lambda extensions +# Using Lambda extensions -You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools provided by [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/), or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. +You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. -Lambda supports internal and external extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, they can be written in a different language than the function\. +Lambda supports external and internal extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, you can write them in a different language than the function\. An internal extension runs as part of the runtime process\. Your function accesses internal extensions by using wrapper scripts or in\-process mechanisms such as `JAVA_TOOL_OPTIONS`\. For more information, see [Modifying the runtime environment](runtimes-modify.md)\. @@ -21,26 +21,34 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) -You are charged for the execution time consumed by the extension \(in 100 ms increments\)\. For more information on pricing for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information about partner extensions, see those partners' websites\. There is no cost to install your own extensions\. +You are charged for the execution time that the extension consumes \(in 1 ms increments\)\. For more pricing information for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information for partner extensions, see those partners' websites\. There is no cost to install your own extensions\. + +**Topics** ++ [Execution environment](#using-extensions-env) ++ [Impact on performance and resources](#using-extensions-reg) ++ [Permissions](#using-extensions-permissions) ++ [Configuring extensions \(\.zip file archive\)](#using-extensions-config) ++ [Using extensions in container images](#invocation-images-extensions) ++ [Next steps](#using-extensions-next) ## Execution environment -Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and extensions\. +Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(i\.e\. the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invokes if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init` and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invokes for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. -During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and start all extensions in parallel\. +During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and starts all extensions in parallel\. ## Impact on performance and resources -The size of your function's extensions counts towards the deployment package size limit\. The total unzipped size of the function and all extensions cannot exceed the unzipped deployment package size limit of 250 MB\. +The size of your function's extensions counts towards the deployment package size limit\. For a \.zip file archive, the total unzipped size of the function and all extensions cannot exceed the unzipped deployment package size limit of 250 MB\. -Extensions can impact the performance of your function because they share function resources such as CPU, memory, and storage\. For example, if an extension performs compute\-intensive operations, you may see your function’s execution duration increase\. +Extensions can impact the performance of your function because they share function resources such as CPU, memory, and storage\. For example, if an extension performs compute\-intensive operations, you may see your function's execution duration increase\. Each extension must complete its initialization before Lambda invokes the function\. Therefore, an extension that consumes significant initialization time can increase the latency of the function invocation\. @@ -50,17 +58,17 @@ To measure the extra time that the extension takes after the function execution, Extensions have access to the same resources as functions\. Because extensions are executed within the same environment as the function, permissions are shared between the function and the extension\. -You can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. +For a \.zip file archive, you can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. -## Configuring extensions +## Configuring extensions \(\.zip file archive\) -To use an external extension, you add the extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. +You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. You add the extension to your function using the same method as you would for any layer\. For more information, see [Configuring a function to use layers](configuration-layers.md#configuration-layers-using)\. **Add an extension to your function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -74,9 +82,36 @@ You add the extension to your function using the same method as you would for an 1. Choose **Add**\. +## Using extensions in container images + +You can add extensions to your [container image](lambda-images.md)\. An internal extension runs in the same process as the Lambda function, and an external extension runs as an independent process\. + +The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. Internal extensions and other in\-process tools run in the process that ENTRYPOINT specifies\. + +You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. + +### Example: Adding an external extension + +An external extension runs in a separate process from the Lambda function\. Lambda starts a process for each extension in the `/opt/extensions/` directory\. Lambda uses the Extensions API to manage the extension lifecycle\. After the function has run to completion, Lambda sends a `Shutdown` event to each external extension\. + +**Example of adding an external extension to a Python base image** + +``` +FROM public.ecr.aws/lambda/python:3.8 + +# Copy and install the app +COPY /app /app +WORKDIR /app +RUN pip install -r requirements.txt + +# Add an extension from the local directory into /opt +ADD my-extension.zip /opt +CMD python ./index.py +``` + ## Next steps To learn more about extensions, we recommend the following resources: -+ To walk through a simple working example, see the [ Building Extensions for AWS Lambda](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) blog post\. -+ For information about extensions that are available from AWS Lambda Partners, see the [ Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) blog post\. -+ Example extensions and wrapper scripts are available in the [GitHub repository of example extensions](https://github.com/aws-samples/aws-lambda-extensions/tree/main/custom-runtime-extension-demo)\. \ No newline at end of file ++ For a basic working example, see [Building Extensions for AWS Lambda](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. ++ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. ++ To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 432c8801..4d93f4fa 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -1,31 +1,37 @@ # What is AWS Lambda? - AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. AWS Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time you consume \- there is no charge when your code is not running\. With AWS Lambda, you can run code for virtually any type of application or backend service \- all with zero administration\. AWS Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that AWS Lambda supports](lambda-runtimes.md)\. +AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. With Lambda, you can run code for virtually any type of application or backend service, all with zero administration\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. -You can use AWS Lambda to run your code in response to events, such as changes to data in an Amazon S3 bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to easily build data processing triggers for AWS services like Amazon S3 and Amazon DynamoDB, process streaming data stored in Kinesis, or create your own back end that operates at AWS scale, performance, and security\. +You can use Lambda to run your code in response to events, such as changes to data in an Amazon Simple Storage Service \(Amazon S3\) bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or to invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to build data processing triggers for AWS services such as Amazon S3 and DynamoDB, process streaming data stored in Amazon Kinesis, or create your own backend that operates at AWS scale, performance, and security\. -You can also build serverless applications composed of functions that are triggered by events and automatically deploy them using CodePipeline and CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +You can also build serverless applications composed of functions that are triggered by events, and automatically deploy them using AWS CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. + +**Topics** ++ [When should I use AWS Lambda?](#when-to-use-cloud-functions) ++ [Are you a first\-time user of AWS Lambda?](#welcome-first-time-user) ## When should I use AWS Lambda? -AWS Lambda is an ideal compute service for many application scenarios, provided that you can write your application code in languages supported by AWS Lambda, and run within the AWS Lambda standard runtime environment and resources provided by Lambda\. +AWS Lambda is an ideal compute service for many application scenarios, provided that you can run your application code using the Lambda standard runtime environment and within the resources that Lambda provides\. -When using AWS Lambda, you are responsible only for your code\. AWS Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources\. This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes\. These constraints enable AWS Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions\. +When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources\. This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes\. These constraints enable Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions\. -If you need to manage your own compute resources, Amazon Web Services also offers other compute services to meet your needs\. -+ Amazon Elastic Compute Cloud \(Amazon EC2\) service offers flexibility and a wide range of EC2 instance types to choose from\. It gives you the option to customize operating systems, network and security settings, and the entire software stack, but you are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. -+ Elastic Beanstalk offers an easy\-to\-use service for deploying and scaling applications onto Amazon EC2 in which you retain ownership and full control over the underlying EC2 instances\. +If you need to manage your own compute resources, AWS also offers other compute services to meet your needs\. For example: ++ Amazon Elastic Compute Cloud \(Amazon EC2\) offers flexibility and a wide range of EC2 instance types to choose from\. It gives you the option to customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. ++ AWS Elastic Beanstalk enables you to deploy and scale applications onto Amazon EC2\. You retain ownership and full control over the underlying EC2 instances\. -Lambda is a highly available service\. For more information, see the [AWS Lambda service level agreement](https://aws.amazon.com/lambda/sla/)\. +Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. ## Are you a first\-time user of AWS Lambda? -If you are a first\-time user of AWS Lambda, we recommend that you read the following sections in order: +If you are a first\-time user of AWS Lambda, we recommend that you review the following in order: + +1. **Read the product overview and watch the introductory video on the [AWS Lambda webpage](http://aws.amazon.com/lambda/)\.** -1. **Read the product overview and watch the introductory video to understand sample use cases\.** These resources are available on the [AWS Lambda webpage](https://aws.amazon.com/lambda/)\. +1. **Try the console\-based getting started exercise\.** This exercise guides you through creating and testing a Lambda function using the AWS Management Console\. You also learn about the programming model and other Lambda concepts\. For instructions, see [Getting started with Lambda](getting-started.md)\. -1. **Try the console\-based getting started exercise\.** The exercise provides instructions for you to create and test your first Lambda function using the console\. You also learn about the programming model and other Lambda concepts\. For more information, see [Getting started with AWS Lambda](getting-started.md)\. +1. **Try the getting started exercise for container images\.** This exercise guides you through creating and testing a Lambda function defined as a container image\. For instructions, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. -1. **Read the [deploying applications with AWS Lambda](deploying-lambda-apps.md) section of this guide\. **This section introduces various AWS Lambda components you work with to create an end\-to\-end experience\. +1. **Read about deploying applications with Lambda\.** The [AWS Lambda applications](deploying-lambda-apps.md) section of this guide introduces various Lambda components that you work with to create an end\-to\-end experience\. -Beyond the Getting Started exercise, you can explore the various use cases, each of which is provided with a tutorial that walks you through an example scenario\. Depending on your application needs \(for example, whether you want event driven Lambda function invocation or on\-demand invocation\), you can follow specific tutorials that meet your specific needs\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +Beyond the getting started exercises, you can also explore the various use cases, each of which includes a tutorial that walks you through an example scenario\. Depending on your application needs \(for example, whether you want event\-driven Lambda function invocation or on\-demand invocation\), you can follow tutorials that meet your specific needs\. For more information on the various use cases, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md index e7348f2d..e03d66b9 100644 --- a/doc_source/with-android-create-package.md +++ b/doc_source/with-android-create-package.md @@ -22,7 +22,7 @@ exports.handler = function(event, context, callback) { } ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java @@ -100,4 +100,4 @@ public class HelloPojo { **Dependencies** + `aws-lambda-java-core` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. \ No newline at end of file +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 1469218f..0d7759f5 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -8,9 +8,9 @@ The mobile application retrieves AWS credentials from an Amazon Cognito identity ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-cloudtrail-create-package.md b/doc_source/with-cloudtrail-create-package.md index 9e2b54b5..eced5b66 100644 --- a/doc_source/with-cloudtrail-create-package.md +++ b/doc_source/with-cloudtrail-create-package.md @@ -88,4 +88,4 @@ exports.handler = function(event, context, callback) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. \ No newline at end of file diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md index b6f6a2d0..e14f3954 100644 --- a/doc_source/with-cloudtrail-example.md +++ b/doc_source/with-cloudtrail-example.md @@ -10,7 +10,7 @@ Use the following instructions to create a Lambda function that notifies you whe ## Requirements -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. Before you begin, make sure that you have the following tools: + [Node\.js 8 with `npm`](https://nodejs.org/en/download/releases/)\. diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md index 79f8d825..35a341e2 100644 --- a/doc_source/with-ddb-create-package.md +++ b/doc_source/with-ddb-create-package.md @@ -29,7 +29,7 @@ exports.lambda_handler = function(event, context, callback) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java 11 @@ -67,7 +67,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. ## C\# @@ -119,7 +119,7 @@ namespace DynamoDBStreams } ``` -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [AWS Lambda Deployment Package in C\#](csharp-package.md)\. +Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. ## Python 3 @@ -137,7 +137,7 @@ def lambda_handler(event, context): print('Successfully processed %s records.' % str(len(event['Records']))) ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. ## Go @@ -167,4 +167,4 @@ func handleRequest(ctx context.Context, e events.DynamoDBEvent) { } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index c2f9c6ef..43e12c54 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -4,9 +4,9 @@ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 29120a14..0fd2620e 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -111,7 +111,7 @@ To configure your function to read from DynamoDB Streams in the Lambda console, **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -245,7 +245,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md index 4dd15693..e3d1c76a 100644 --- a/doc_source/with-kinesis-create-package.md +++ b/doc_source/with-kinesis-create-package.md @@ -33,7 +33,7 @@ exports.handler = function(event, context) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java 11 @@ -70,7 +70,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. ## C\# @@ -119,7 +119,7 @@ namespace KinesisStreams } } ``` -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [AWS Lambda Deployment Package in C\#](csharp-package.md)\. +Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. ## Python 3 @@ -138,7 +138,7 @@ def lambda_handler(event, context): print("Decoded payload: " + str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. ## Go @@ -163,4 +163,4 @@ func handler(ctx context.Context, kinesisEvent events.KinesisEvent) { } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 05b9dddc..36310cac 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -12,9 +12,9 @@ In this tutorial, you create a Lambda function to consume events from a Kinesis ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 9f538acb..041cbc25 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -123,7 +123,7 @@ To configure your function to read from Kinesis in the Lambda console, create a **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. @@ -262,7 +262,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index aeebd22b..6b1e887c 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -100,7 +100,7 @@ To configure your function to read from Amazon MQ, create an **MQ** trigger in t **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 941c6dd0..9051ab88 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -76,7 +76,7 @@ To configure your function to read from Amazon MSK, create an **MSK** trigger in **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index 93874d7f..479ff27d 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -278,7 +278,7 @@ Amazon S3 invokes your Lambda function using the `Event` invocation type, where + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. ## Python 3 diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 81a6c42a..e18abe3c 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -19,9 +19,9 @@ Upon completing this tutorial, you will have the following Amazon S3, Lambda, an ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md index 8bfd510a..00c7fdb7 100644 --- a/doc_source/with-sns-create-package.md +++ b/doc_source/with-sns-create-package.md @@ -26,7 +26,7 @@ exports.handler = function(event, context, callback) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java 11 @@ -61,7 +61,7 @@ public class LogEvent implements RequestHandler { + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. ## Go @@ -91,7 +91,7 @@ func main() { } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. ## Python 3 @@ -111,4 +111,4 @@ def lambda_handler(event, context): return message ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 023343e5..eac2ef44 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -4,9 +4,9 @@ You can use a Lambda function in one AWS account to subscribe to an Amazon SNS t ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index e99ab0a1..1144ad8f 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -36,7 +36,7 @@ event.Records.forEach(function(record) { }; ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Node\.js](nodejs-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java @@ -70,7 +70,7 @@ public class Handler implements RequestHandler{ + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [AWS Lambda deployment package in Java](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. ## C\# @@ -108,7 +108,7 @@ namespace SQSLambdaFunction } ``` -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [AWS Lambda Deployment Package in C\#](csharp-package.md)\. +Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. ## Go @@ -142,7 +142,7 @@ func main() { } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [AWS Lambda deployment package in Go](golang-package.md)\. +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. ## Python @@ -162,4 +162,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [AWS Lambda deployment package in Python](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 0b5c00ad..2a3d1c55 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -4,9 +4,9 @@ In this tutorial, you create a Lambda function to consume messages from an [Amaz ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with AWS Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. -To follow the procedures in this guide, you will need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: ``` ~/lambda-project$ this is a command diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 68bb11dc..e97bac3b 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -117,7 +117,7 @@ To configure your function to read from Amazon SQS in the Lambda console, create **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. From 4748dce0920e3518a343acf5b4fbdc3980b19771 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Tue, 8 Dec 2020 12:35:02 -0800 Subject: [PATCH 051/243] periodic corrections and updates --- doc_source/API_CreateEventSourceMapping.md | 6 +-- doc_source/API_CreateFunction.md | 4 +- doc_source/API_DeleteEventSourceMapping.md | 2 +- .../API_EventSourceMappingConfiguration.md | 2 +- doc_source/API_FunctionConfiguration.md | 4 +- doc_source/API_GetEventSourceMapping.md | 2 +- doc_source/API_GetFunctionConfiguration.md | 4 +- doc_source/API_PublishVersion.md | 4 +- doc_source/API_UpdateEventSourceMapping.md | 6 +-- doc_source/API_UpdateFunctionCode.md | 4 +- doc_source/API_UpdateFunctionConfiguration.md | 4 +- doc_source/csharp-image.md | 4 +- doc_source/getting-started-create-function.md | 46 +++++++++++++++---- doc_source/go-image.md | 4 +- doc_source/images-create.md | 20 ++++---- doc_source/images-test.md | 2 + doc_source/java-image.md | 4 +- doc_source/lambda-golang.md | 4 +- doc_source/monitoring-insights.md | 8 +--- doc_source/nodejs-image.md | 2 +- doc_source/python-context.md | 16 ++++--- doc_source/python-image.md | 2 +- doc_source/python-package.md | 4 +- doc_source/ruby-image.md | 2 +- doc_source/runtimes-extensions-api.md | 4 +- doc_source/using-extensions.md | 4 +- 26 files changed, 97 insertions(+), 71 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 4e9d29c7..84606772 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -65,7 +65,7 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -111,7 +111,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: Yes ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -248,7 +248,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index c43edef3..84688eea 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -355,7 +355,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -412,7 +412,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 70fc74c8..cb47ca48 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -101,7 +101,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 273f4109..45bf6c8a 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -43,7 +43,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 0ca44457..e4d33f74 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -86,7 +86,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Layers** @@ -155,7 +155,7 @@ Required: No **StateReasonCode** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Timeout** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index b9dba866..b58b15d5 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -99,7 +99,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 37864cf3..453c1f46 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -188,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -245,7 +245,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 8d931a84..2241a33d 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -208,7 +208,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -265,7 +265,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 3aaf4d5f..1821e2f2 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -57,7 +57,7 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -93,7 +93,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -203,7 +203,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 09bff2e4..5c2b4326 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -242,7 +242,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -299,7 +299,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 52a19ce9..0470b867 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -312,7 +312,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -369,7 +369,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index da6dcc7e..664397c5 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -15,13 +15,13 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | Docker Hub repository: amazon/aws\-lambda\-dotnet -Amazon ECR repository: public\.ecr\.aws/lambda/dotnet +Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet ## \.NET runtime interface clients diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 680423d6..4b3cf6e3 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -116,7 +116,8 @@ In this getting started exercise, you use the Docker CLI to create a container i **Topics** + [Prerequisites](#gettingstarted-images-prereq) -+ [Create the image](#gettingstarted-images-package) ++ [Create the container image](#gettingstarted-images-package) ++ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) + [Update the user permissions](#gettingstarted-images-permissions) + [Create a Lambda function defined as a container image](#gettingstarted-images-function) + [Invoke the Lambda function](#get-started-invoke-function) @@ -137,13 +138,13 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 This exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. -### Create the image +### Create the container image AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. In the following commands, replace `123456789012` with your AWS account ID\. -**To create an image using an AWS base image for Lambda** +**To create an image using the AWS Node\.js 12 base image** 1. On your local machine, create a project directory for your new function\. @@ -166,7 +167,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. FROM public.ecr.aws/lambda/nodejs:12 # Copy function code and package.json - COPY app.js package.json ${LAMBDA_TASK_ROOT} + COPY app.js package.json /var/task/ # Install NPM dependencies for function RUN npm install @@ -175,29 +176,56 @@ In the following commands, replace `123456789012` with your AWS account ID\. CMD [ "app.handler" ] ``` +1. Create the `package.json` file\. From your project directory, run the `npm init` command\. Accept all of the default values: + + ``` + npm init + ``` + 1. Build your Docker image\. From your project directory, run the following command: ``` docker build -t hello-world . ``` +1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. + + 1. Run your Docker image\. From your project directory, run the `docker run` command: + + ``` + docker run -p 9000:8080 hello-world:latest + ``` + + 1. Test your Lambda function\. From your project directory, run a `curl` command to invoke your function: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + ``` + +### Upload the image to the Amazon ECR repository + 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` -1. Create a repository in Amazon ECR using the `aws ecr create-repository` command\. +1. Create a repository in Amazon ECR using the `create-repository` command\. ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE ``` -1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. +1. Tag your image to match your repository name using the `docker tag` command\. ``` docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world-image:latest + ``` + +1. Deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` ### Update the user permissions @@ -278,7 +306,7 @@ Invoke your Lambda function using the sample event data provided in the console\ ### Clean up -If you are done with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* +If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. diff --git a/doc_source/go-image.md b/doc_source/go-image.md index cab732d2..acad4993 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -15,11 +15,11 @@ AWS provides the following base image for Go: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 1 | Go 1\.x | Amazon Linux 2018\.03 | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | +| 1 | Go 1\.x | Amazon Linux 2018\.03 | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | Docker Hub repository: amazon/aws\-lambda\-go -Amazon ECR repository: public\.ecr\.aws/lambda/go +Amazon ECR repository: gallery\.ecr\.aws/lambda/go ## Go runtime interface clients diff --git a/doc_source/images-create.md b/doc_source/images-create.md index e4ae11df..e854576c 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -6,6 +6,8 @@ AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-ima You can also use an alternative base image from another container registry\. Lambda provides open\-source runtime interface clients that you add to an alternative base image to make it compatible with Lambda\. +For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. + **Topics** + [Image types](#images-types) + [Container tools](#images-tools) @@ -89,13 +91,13 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do + LAMBDA\_TASK\_ROOT=/var/task + LAMBDA\_RUNTIME\_DIR=/var/runtime - The following shows an example Dockerfile for Node\.js version 12: + The following shows an example Dockerfile for Node\.js version 12\. : ``` FROM public.ecr.aws/lambda/nodejs:12 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - COPY app.js package.json ${LAMBDA_TASK_ROOT} + COPY app.js package.json /var/task/ # Install NPM dependencies for function RUN npm install @@ -107,7 +109,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. ``` - docker build -t hello-world . + docker build -t hello-world . ``` 1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. @@ -118,10 +120,11 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` -1. Deploy your function to Amazon ECR using the `docker push` command\. +1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` - docker push 123456789012.dkr.ecr.sa-east-1.amazonaws.com/image-name:latest + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` ## Create an image from an alternative base image @@ -193,7 +196,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. ``` - docker build -t hello-world . + docker build -t hello-world . ``` 1. \(Optional\) Test your application locally using the [Runtime interface emulator](images-test.md)\. @@ -204,10 +207,11 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` -1. Deploy your function to Amazon ECR using the `docker push` command\. +1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` - docker push 123456789012.dkr.ecr.sa-east-1.amazonaws.com/image-name:latest + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` ## Create an image using the AWS SAM toolkit diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 853388d1..7c3da05a 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -6,6 +6,8 @@ The AWS base images for Lambda include the RIE component\. If you use an alterna You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. +For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/compute/new-for-aws-lambda-container-image-support/) on the AWS Compute Blog\. + **Topics** + [Guidelines for using the RIE](#images-test-limitations) + [Environment variables](#images-test-env) diff --git a/doc_source/java-image.md b/doc_source/java-image.md index f469e41a..458af4cd 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -21,7 +21,7 @@ AWS provides the following base images for Java: Docker Hub repository: amazon/aws\-lambda\-java -Amazon ECR repository: public\.ecr\.aws/lambda/java +Amazon ECR repository: gallery\.ecr\.aws/lambda/java ## Java runtime interface clients @@ -35,6 +35,6 @@ Install the runtime interface client for Java using the Apache Maven package man ``` -For package details, see [Lambda RIC](http://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. +For package details, see [Lambda RIC](https://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 702a97f7..751af969 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -16,7 +16,7 @@ AWS Lambda provides the following libraries for Go: **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) @@ -26,4 +26,4 @@ To get started with application development in your local environment, deploy on + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) -+ [Using environment variables](golang-envvars.md) ++ [Using environment variables](golang-envvars.md) \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 64345390..ef5bd61f 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -2,9 +2,6 @@ Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. -**Public preview** -Lambda Insights is in public preview\. The preview is open to all AWS accounts, and you do not need to request access\. Features may be added or changed before general availability\. - **Topics** + [How Lambda Insights monitors serverless applications](#monitoring-insights-how) + [Pricing](#monitoring-insights-pricing) @@ -45,7 +42,7 @@ You can use Lambda Insights with any of the following [Lambda function runtimes] ## Region availability -For this preview release, Lambda Insights is currently available in the following AWS Regions: +Lambda Insights is currently available in the following AWS Regions: + US East \(N\. Virginia\) + US East \(Ohio\) + US West \(N\. California\) @@ -77,8 +74,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu 1. On the **Monitoring tools** pane, choose **Edit**\. -1. Under **Lambda Insights \(preview\)**, turn on **Enhanced monitoring**\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-enable.png) +1. Under **Lambda Insights**, turn on **Enhanced monitoring**\. 1. Choose **Save**\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 604488c7..19c63b99 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -20,7 +20,7 @@ AWS provides the following base images for Node\.js: Docker Hub repository: amazon/aws\-lambda\-nodejs -Amazon ECR repository: public\.ecr\.aws/lambda/nodejs +Amazon ECR repository: gallery\.ecr\.aws/lambda/nodejs ## Node\.js runtime interface clients diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 629eeb09..652e7e8f 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -31,14 +31,16 @@ The following example shows a handler function that logs context information\. ``` import time -def get_my_log_stream(event, context):     - print("Log stream name:", context.log_stream_name) -   print("Log group name:", context.log_group_name) -   print("Request ID:",context.aws_request_id) -   print("Mem. limits(MB):", context.memory_limit_in_mb) - # Code will run quickly, so we add a 1 second intentional delay so you can see that in time remaining value. + +def lambda_handler(event, context): + print("Lambda function ARN:", context.invoked_function_arn) + print("CloudWatch log stream name:", context.log_stream_name) + print("CloudWatch log group name:", context.log_group_name) + print("Lambda Request ID:", context.aws_request_id) + print("Lambda function memory limits in MB:", context.memory_limit_in_mb) + # We have added a 1 second delay so you can see the time remaining in get_remaining_time_in_millis. time.sleep(1) -   print("Time remaining (MS):", context.get_remaining_time_in_millis()) + print("Lambda time remaining in MS:", context.get_remaining_time_in_millis()) ``` In addition to the options listed above, you can also use the AWS X\-Ray SDK for [Instrumenting Python code in AWS Lambda](python-tracing.md) to identify critical code paths, trace their performance and capture the data for analysis\. \ No newline at end of file diff --git a/doc_source/python-image.md b/doc_source/python-image.md index c8cb47a4..de094d08 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -22,7 +22,7 @@ AWS provides the following base images for Python: Docker Hub repository: amazon/aws\-lambda\-python -Amazon ECR repository: public\.ecr\.aws/lambda/python +Amazon ECR repository: gallery\.ecr\.aws/lambda/python ## Python runtime interface clients diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 3d42e975..3c0f5132 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -84,14 +84,12 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa 1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd package - ~/my-function/package$ zip -r my-deployment-package.zip ./* + ~/my-function$ zip -r my-deployment-package.zip ./package/ ``` 1. Add function code files to the root of your deployment package\. ``` - ~/my-function/package$ cd .. ~/my-function$ zip -g my-deployment-package.zip lambda_function.py ``` diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 00171271..d5eb5be9 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -20,7 +20,7 @@ AWS provides the following base images for Ruby: Docker Hub repository: amazon/aws\-lambda\-ruby -Amazon ECR repository: public\.ecr\.aws/lambda/ruby +Amazon ECR repository: gallery\.ecr\.aws/lambda/ruby ## Ruby runtime interface clients diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index f1ee7b01..5ca560d8 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -182,9 +182,7 @@ Lambda does not automatically shut down extensions that repeatedly fail\. Howeve ## Adding extensions to container images -You can add internal and external extensions to your [container image](lambda-images.md)\. An internal extension runs in the main container process, and an external extension runs as an independent process in the container\. - -The ENTRYPOINT [container image setting](images-create.md#images-parms) specifies the main process for the container\. Configure the ENTRYPOINT and CMD settings in the Dockerfile, or as an override in the function configuration\. Internal extensions and other in\-process tools run in the process that the ENTRYPOINT specifies\. +You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT [container image setting](images-create.md#images-parms) specifies the main process for the container\. Configure the ENTRYPOINT and CMD settings in the Dockerfile, or as an override in the function configuration\. You can run multiple processes within a container\. Lambda provides a built\-in server that manages the lifecycle of the main process and any additional processes\. The server uses the Extensions API to communicate with each external extension\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 678a5bfc..808fbc28 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -84,9 +84,7 @@ You add the extension to your function using the same method as you would for an ## Using extensions in container images -You can add extensions to your [container image](lambda-images.md)\. An internal extension runs in the same process as the Lambda function, and an external extension runs as an independent process\. - -The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. Internal extensions and other in\-process tools run in the process that ENTRYPOINT specifies\. +You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. From e6b57d5b16bc928cdebf51e3644c815ecf4080b9 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Thu, 17 Dec 2020 00:28:59 +0000 Subject: [PATCH 052/243] Periodic update --- doc_source/API_CreateEventSourceMapping.md | 69 ++++- doc_source/API_DeleteEventSourceMapping.md | 30 +- .../API_EventSourceMappingConfiguration.md | 26 +- doc_source/API_GetEventSourceMapping.md | 30 +- doc_source/API_ImageConfig.md | 2 +- doc_source/API_ListEventSourceMappings.md | 7 + doc_source/API_SelfManagedEventSource.md | 23 ++ doc_source/API_SourceAccessConfiguration.md | 18 +- doc_source/API_Types.md | 1 + doc_source/API_UpdateEventSourceMapping.md | 54 +++- doc_source/code-editor.md | 36 ++- doc_source/configuration-aliases.md | 4 +- doc_source/configuration-concurrency.md | 5 +- doc_source/csharp-handler.md | 2 +- doc_source/csharp-tracing.md | 2 +- doc_source/gettingstarted-concepts.md | 4 +- doc_source/gettingstarted-limits.md | 2 +- doc_source/gettingstarted-package.md | 2 +- doc_source/go-image.md | 144 ++++++++- doc_source/golang-handler.md | 2 + doc_source/golang-tracing.md | 2 +- doc_source/images-test.md | 2 +- doc_source/index.md | 13 +- doc_source/invocation-eventsourcemapping.md | 3 +- doc_source/java-handler.md | 2 +- doc_source/java-package-eclipse.md | 6 + doc_source/java-tracing.md | 2 +- doc_source/kafka-hosting.md | 29 ++ doc_source/kafka-smaa.md | 9 + doc_source/kafka-using-cluster.md | 56 ++++ doc_source/lambda-api-permissions-ref.md | 2 + doc_source/lambda-golang.md | 2 +- doc_source/lambda-intro-execution-role.md | 1 + doc_source/lambda-kafka.md | 13 + doc_source/lambda-rolling-deployments.md | 2 + doc_source/lambda-services.md | 1 + doc_source/msk-permissions.md | 42 +++ doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-tracing.md | 2 +- doc_source/python-handler.md | 119 +++++-- doc_source/python-package.md | 6 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-handler.md | 4 +- doc_source/ruby-tracing.md | 2 +- doc_source/runtimes-avx2.md | 2 + doc_source/runtimes-context.md | 2 + doc_source/runtimes-extensions-api.md | 6 +- doc_source/runtimes-modify.md | 2 +- doc_source/services-apigateway-tutorial.md | 2 + .../services-cloudwatchevents-tutorial.md | 2 + doc_source/services-ec2-tutorial.md | 2 + doc_source/services-msk-topic-add.md | 59 ++++ doc_source/services-smaa-topic-add.md | 57 ++++ doc_source/services-xray.md | 2 +- doc_source/smaa-permissions.md | 81 +++++ doc_source/stepfunctions-patterns.md | 1 + doc_source/with-ddb.md | 293 +++++++++++++++++- doc_source/with-kinesis.md | 224 ++++++++++++- doc_source/with-mq.md | 2 +- doc_source/with-msk.md | 168 +--------- doc_source/with-s3-example-deployment-pkg.md | 3 +- doc_source/with-sqs.md | 2 +- 62 files changed, 1426 insertions(+), 271 deletions(-) create mode 100644 doc_source/API_SelfManagedEventSource.md create mode 100644 doc_source/kafka-hosting.md create mode 100644 doc_source/kafka-smaa.md create mode 100644 doc_source/kafka-using-cluster.md create mode 100644 doc_source/lambda-kafka.md create mode 100644 doc_source/msk-permissions.md create mode 100644 doc_source/services-msk-topic-add.md create mode 100644 doc_source/services-smaa-topic-add.md create mode 100644 doc_source/smaa-permissions.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 84606772..1988ce23 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -8,6 +8,7 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) + [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -36,11 +37,17 @@ Content-type: application/json "Enabled": boolean, "EventSourceArn": "string", "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -49,7 +56,8 @@ Content-type: application/json ], "StartingPosition": "string", "StartingPositionTimestamp": number, - "Topics": [ "string" ] + "Topics": [ "string" ], + "TumblingWindowInSeconds": number } ``` @@ -67,6 +75,7 @@ The maximum number of items to retrieve in a single batch\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -94,7 +103,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: Yes +Required: No ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. @@ -110,6 +119,13 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` +Required: No + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer @@ -140,14 +156,17 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** +The Self\-Managed Apache Kafka cluster to send records\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -162,11 +181,17 @@ Type: Timestamp Required: No ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MSK\) The name of the Kafka topic\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -188,6 +213,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -195,6 +221,11 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -206,6 +237,7 @@ Content-type: application/json "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -239,6 +271,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -274,12 +312,14 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. @@ -299,12 +339,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index cb47ca48..c422cfc4 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -41,6 +41,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -48,6 +49,11 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -59,6 +65,7 @@ Content-type: application/json "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -92,6 +99,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -127,12 +140,14 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. @@ -152,12 +167,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 45bf6c8a..395a5f43 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -30,6 +30,13 @@ Required: No The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: No + + **FunctionResponseTypes** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No **LastModified** @@ -72,14 +79,17 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + **SelfManagedEventSource** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. Required: No **StartingPosition** @@ -104,11 +114,17 @@ Type: String Required: No **Topics** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + **TumblingWindowInSeconds** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No **UUID** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index b58b15d5..6a4ec54e 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -39,6 +39,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -46,6 +47,11 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -57,6 +63,7 @@ Content-type: application/json "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -90,6 +97,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -125,12 +138,14 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. @@ -150,12 +165,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index 8322a632..1b4f1fdd 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -1,6 +1,6 @@ # ImageConfig -Configuration values that override the container image Dockerfile\. See [Override Container settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images-settings.html)\. +Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html)\. ## Contents diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 2e76c132..38cf844a 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -64,6 +64,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -71,6 +72,11 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -82,6 +88,7 @@ Content-type: application/json "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ], diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md new file mode 100644 index 00000000..5ea2260c --- /dev/null +++ b/doc_source/API_SelfManagedEventSource.md @@ -0,0 +1,23 @@ +# SelfManagedEventSource + +The Self\-Managed Apache Kafka cluster for your event source\. + +## Contents + + **Endpoints** +The list of bootstrap servers for your Kafka brokers in the following format: `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`\. +Type: String to array of strings map +Map Entries: Maximum number of 2 items\. +Valid Keys:` KAFKA_BOOTSTRAP_SERVERS` +Array Members: Minimum number of 1 item\. Maximum number of 10 items\. +Length Constraints: Minimum length of 1\. Maximum length of 300\. +Pattern: `^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):[0-9]{1,5}` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 8a21b665..9d67d5af 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,21 +1,25 @@ # SourceAccessConfiguration - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +You can specify the authentication protocol, or the VPC components to secure access to your event source\. ## Contents **Type** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. ++ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. ++ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. Type: String -Valid Values:` BASIC_AUTH` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` Required: No **URI** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Length Constraints: Minimum length of 1\. Maximum length of 200\. +Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` Required: No ## See Also diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index 4bf0046a..aaa9f473 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -31,6 +31,7 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 1821e2f2..01660b10 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -28,6 +28,7 @@ Content-type: application/json }, "Enabled": boolean, "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, @@ -37,7 +38,8 @@ Content-type: application/json "Type": "string", "URI": "string" } - ] + ], + "TumblingWindowInSeconds": number } ``` @@ -59,6 +61,7 @@ The maximum number of items to retrieve in a single batch\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -90,6 +93,13 @@ The length constraint applies only to the full ARN\. If you specify only the fun Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: No + + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** @@ -117,11 +127,15 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. +Required: No + + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -143,6 +157,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -150,6 +165,11 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -161,6 +181,7 @@ Content-type: application/json "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -194,6 +215,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -229,12 +256,14 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 1 item\. Maximum number of 22 items\. ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. @@ -254,12 +283,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index 6812db13..2472dcff 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -4,6 +4,8 @@ The Lambda console provides a code editor for languages that do not require comp The code editor includes the *menu bar*, *windows*, and the *editor pane*\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. @@ -26,6 +28,8 @@ You can use the **Environment** window in the code editor to create, open, and m ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) + + **To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. **To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. @@ -33,9 +37,13 @@ You can use the **Environment** window in the code editor to create, open, and m **To create a new file**, do one of the following: + In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. + Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) + + **To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. **To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. @@ -48,6 +56,8 @@ You can use the **Environment** window in the code editor to create, open, and m **To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. @@ -58,17 +68,27 @@ Use the editor pane in the code editor to view and write code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) + + ### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) + + **To display an open file's contents**, do one of the following: + Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) + + **To close an open file**, do one of the following: + Choose the **X** icon in the file's tab\. + Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. @@ -83,12 +103,20 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) + + **To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) + + **To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) **To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. @@ -99,6 +127,8 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) + + ## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -107,6 +137,8 @@ To expand the code editor to the edges of the web browser window, choose the **T ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) + + To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 52a4cc99..31d4c28e 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -146,4 +146,6 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file ++ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. + + \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index db4c7904..a1e499ca 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -12,6 +12,9 @@ Lambda also integrates with [Application Auto Scaling](https://docs.aws.amazon.c Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \(`$LATEST`\), which prevents it from executing\. +**Note** +You can't allocate more provisioned concurrency than reserved concurrency for a function\. + **Topics** + [Configuring reserved concurrency](#configuration-concurrency-reserved) + [Configuring provisioned concurrency](#configuration-concurrency-provisioned) @@ -55,7 +58,7 @@ Setting per\-function concurrency can impact the concurrency pool that is availa To manage provisioned concurrency settings for a version or alias, use the Lambda console\. -**To reserve concurrency for an alias** +**To provision concurrency for an alias** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 76ff9c4d..bad3a2ad 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in C\# -When you create a Lambda function, you specify a handler that AWS Lambda can invoke when the service runs the function on your behalf\. +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index f2ecd361..fdce4a13 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -107,7 +107,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 4ddd4e47..24624f14 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -101,6 +101,4 @@ Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region l ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. - -For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 88bccd4f..4145bc38 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index 3d7fc2fb..fc5f489e 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -9,7 +9,7 @@ Your Lambda function's code consists of scripts or compiled programs and their d ## Container images -A container image includes the base operating system, the runtime, Lambda extensions, your application code and it's dependencies\. You can also add static data, such as machine learning models, into the image\. +A container image includes the base operating system, the runtime, Lambda extensions, your application code and its dependencies\. You can also add static data, such as machine learning models, into the image\. Lambda provides a set of open\-source base images that you can use to build your container image\. To create and test container images, you can use the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) or native container tools such as the Docker CLI\. diff --git a/doc_source/go-image.md b/doc_source/go-image.md index acad4993..548b1033 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -8,6 +8,12 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +**Topics** ++ [AWS base images for Go](#go-image-base) ++ [Go runtime interface clients](#go-image-clients) ++ [Deploying Go with the `provided.al2` base image](#go-image-al2) ++ [Deploying Go with an alternative base image](#go-image-other) + ## AWS base images for Go AWS provides the following base image for Go: @@ -23,4 +29,140 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/go ## Go runtime interface clients -Download the runtime interface client for Go from the [AWS Lambda for Go](https://github.com/aws/aws-lambda-go) repository on GitHub\. \ No newline at end of file +AWS does not provide a separate runtime interface client for Go\. The `aws-lambda-go/lambda` package includes an implementation of the runtime interface\. + +## Deploying Go with the `provided.al2` base image + +To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. + +You include the `aws-lambda-go/lambda` package with your Go handler\. This package implements the programming model for Go, including the runtime interface client\. The `provided.al2` base image also includes the runtime interface emulator\. + +**To build and deploy a Go function with the `provided.al2` base image\.** + +Note that the first three steps are identical whether you deploy your function as a \.zip file archive or as a container image\. + +1. On your local machine, create a project directory for your new function\. + +1. From your project folder, run the following command to install the required Lambda Go libraries\. + + ``` + go get github.com/aws/aws-lambda-go + ``` + + For a description of the Lambda Go libraries libraries, see [Building Lambda functions with Go](lambda-golang.md)\. + +1. Create your [Go handler code](golang-handler.md) and include the `aws-lambda-go/lambda` package\. + +1. Use a text editor to create a Dockerfile in your project directory\. The following example Dockerfile uses the AWS `provided.al2` base image\. + + ``` + FROM public.ecr.aws/lambda/provided:al2 as build + # install compiler + RUN yum install -y golang + RUN go env -w GOPROXY=direct + # cache dependencies + ADD go.mod go.sum ./ + RUN go mod download + # build + ADD . . + RUN go build -o /main + # copy artifacts to a clean image + FROM public.ecr.aws/lambda/provided:al2 + COPY --from=build /main /main + ENTRYPOINT [ "/main" ] + ``` + +1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. + + ``` + docker build -t hello-world . + ``` + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +## Deploying Go with an alternative base image + +You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. + +``` +FROM alpine as build +# install build tools +RUN apk add go git +# cache dependencies +ADD go.mod go.sum ./ +RUN go mod download GOPROXY=direct +# build +ADD . . +RUN go build -o /main +# copy artifacts to a clean image +FROM alpine +COPY --from=build /main /main +ENTRYPOINT [ "/main" ] +``` + +The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. + +**To add RIE to the image** + +1. In your Dockerfile, replace the ENTRYPOINT instruction with the following content: + + ``` + # (Optional) Add Lambda Runtime Interface Emulator and use a script in the ENTRYPOINT for simpler local runs + ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/bin/aws-lambda-rie + RUN chmod 755 /usr/bin/aws-lambda-rie + COPY entry.sh / + RUN chmod 755 /entry.sh + ENTRYPOINT [ "/entry.sh" ] + ``` + +1. Use a text editor to create file `entry.sh` in your project directory, containing the following content: + + ``` + #!/bin/sh + if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then + exec /usr/local/bin/aws-lambda-rie "$@" + else + exec "$@" + fi + ``` + +If you do not want to add the RIE to your image, you can test your image locally without adding RIE to the image\. + +**To test locally without adding RIE to the image** + +1. From your project directory, run the following command to download the RIE from GitHub and install it on your local machine\. + + ``` + mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + ``` + +1. Run your Lambda image function using the `docker run` command\. In the following example, `/main` is the path to the function entry point\. + + ``` + docker run -d -v ~/.aws-lambda-rie:/aws-lambda --entrypoint /aws-lambda/aws-lambda-rie -p 9000:8080 myfunction:latest /main + ``` + + This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. + +1. Post an event to the following endpoint using a `curl` command: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + ``` + + This command invokes the function running in the container image and returns a response\. + +For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 2640568a..6d9032d1 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -1,5 +1,7 @@ # AWS Lambda function handler in Go +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. + A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. ``` diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 8ac7fe21..94e19067 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -83,7 +83,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 7c3da05a..0bb78e1e 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -6,7 +6,7 @@ The AWS base images for Lambda include the RIE component\. If you use an alterna You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. -For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/compute/new-for-aws-lambda-container-image-support/) on the AWS Compute Blog\. +For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. **Topics** + [Guidelines for using the RIE](#images-test-limitations) diff --git a/doc_source/index.md b/doc_source/index.md index b7f585bc..d30ca936 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -118,7 +118,6 @@ Amazon's trademarks and trade dress may not be used in + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MQ](with-mq.md) - + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Using AWS Lambda with Amazon S3](with-s3.md) + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) @@ -138,6 +137,15 @@ Amazon's trademarks and trade dress may not be used in + [State machine application patterns](stepfunctions-patterns.md) + [Managing state machines in the Lambda console](stepfunctions-lc.md) + [Orchestration examples with Step Functions](services-stepfunctions.md) ++ [Using Lambda with an Apache Kafka cluster](lambda-kafka.md) + + [Hosting an Apache Kafka cluster](kafka-hosting.md) + + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) + + [Using Lambda with Amazon MSK](with-msk.md) + + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) + + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) + + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) + + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) + + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -177,9 +185,9 @@ Amazon's trademarks and trade dress may not be used in + [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Building Lambda functions with Go](lambda-golang.md) - + [Deploy Go Lambda functions with .zip file archives](golang-package.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) + + [Deploy Go Lambda functions with .zip file archives](golang-package.md) + [Deploy Go Lambda functions with container images](go-image.md) + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) @@ -315,6 +323,7 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + + [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 995c79ec..d926e1d3 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,11 +7,12 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index e047265e..6287d7cd 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Java -Your Lambda function's handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 5a74dc55..03935add 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -59,8 +59,12 @@ If you are following other tutorial topics in this guide, the specific tutorials 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. 1. In the **New Java Class** window, type the following values: + + + **Package**: **example** + **Name**: **Hello** + + **Note** If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. @@ -79,6 +83,8 @@ The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. 1. In the **Add Plugin** window, type the following values: + + + **Group Id:** org\.apache\.maven\.plugins + **Artifact Id:** maven\-shade\-plugin + **Version:** 3\.2\.2 diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 802605dd..6ed9517a 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -90,7 +90,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md new file mode 100644 index 00000000..096de4b5 --- /dev/null +++ b/doc_source/kafka-hosting.md @@ -0,0 +1,29 @@ +# Hosting an Apache Kafka cluster + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +This page describes the AWS and non\-AWS hosting options available for using your Kafka cluster as an for your Lambda function\. + +## Using a non\-AWS provider + +To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. + +When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. + +For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. + +## Using Amazon MSK + +To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. + +When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. + +To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. + +For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. + +## Using other AWS hosting options + +You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. + +For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md new file mode 100644 index 00000000..df8fc0ed --- /dev/null +++ b/doc_source/kafka-smaa.md @@ -0,0 +1,9 @@ +# Using Lambda with self\-managed Apache Kafka + +You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. + +This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. + +**Topics** ++ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) ++ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md new file mode 100644 index 00000000..61272809 --- /dev/null +++ b/doc_source/kafka-using-cluster.md @@ -0,0 +1,56 @@ +# Using an Apache Kafka cluster as an event source for Lambda + + + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +This page describes how to use your Kafka cluster as an event source for your Lambda function\. + +## Prerequisites ++ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster ++ A [Lambda execution role](lambda-intro-execution-role.md) + +## How it works + + + +When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. ++ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. ++ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. ++ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. ++ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. ++ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. + +For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. + +## Event source API operations + +When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. + +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +## Event source mapping errors + +When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. + +To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda couldn't authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda doesn't have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The Lambda function configuration is not valid\. + +**Note** +If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. \ No newline at end of file diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 35515e6c..3805a252 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -82,6 +82,8 @@ When making Lambda API calls, users can specify a version or alias by passing a You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. + + ### Best practices for using Deny statements with functions The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 751af969..4ed714e7 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -19,9 +19,9 @@ To get started with application development in your local environment, deploy on [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [Deploy Go Lambda functions with container images](go-image.md) + [AWS Lambda function logging in Go](golang-logging.md) + [AWS Lambda function errors in Go](golang-exceptions.md) diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 0532a5c4..a1a5cef1 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -127,6 +127,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md new file mode 100644 index 00000000..0cb6ab64 --- /dev/null +++ b/doc_source/lambda-kafka.md @@ -0,0 +1,13 @@ +# Using Lambda with an Apache Kafka cluster + +[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. + +Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. + +This section describes how to use an AWS or non\-AWS hosted Kafka cluster with Lambda\. + +**Topics** ++ [Hosting an Apache Kafka cluster](kafka-hosting.md) ++ [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) ++ [Using Lambda with Amazon MSK](with-msk.md) ++ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index 4375f047..ba58d856 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -16,6 +16,8 @@ In a rolling deployment, AWS SAM performs these tasks: + It detects when you create a new version of your Lambda function\. + It triggers CodeDeploy to start the deployment of the new version\. + + ## Example AWS SAM Lambda template The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 77a2ee39..960d08e1 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,6 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/msk-permissions.md b/doc_source/msk-permissions.md new file mode 100644 index 00000000..403f7af9 --- /dev/null +++ b/doc_source/msk-permissions.md @@ -0,0 +1,42 @@ +# Managing access and permissions for an Amazon MSK cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. + +## Required Lambda function permissions + +To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +## Adding a policy to your execution role + +Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. + +**To add an AWS managed policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. + +1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. + +1. Select your execution role from the list, and then choose **Attach policy**\. + +## Granting users access with an IAM policy + +By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +## Using SASL/SCRAM authentication + +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 815f5694..adeb8c95 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Node\.js -The handler is the method in your Lambda function that processes events\. When you invoke a function, the [runtime](lambda-runtimes.md) runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. The following example function logs the contents of the event object and returns the location of the logs\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index f33a5253..68794a93 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -124,7 +124,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 54e7d545..20ffb7da 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,6 +1,8 @@ # AWS Lambda function handler in Python -At the time you create a Lambda function, you specify a *handler*, which is a function in your code, that AWS Lambda can invoke when the service runs your code\. Use the following general syntax structure when creating a handler function in Python\. +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. + +You can use the following general syntax when creating a function handler in Python: ``` def handler_name(event, context): @@ -11,37 +13,108 @@ def handler_name(event, context): ## Naming The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: -+ the name of the Python file in which the Lambda handler function is located ++ the name of the file in which the Lambda handler function is located + the name of the Python handler function -If your handler function name is `call_amazon`, located in a file named `handler.py`\. The handler name you would specify when you create your Lambda function is `handler.call_amazon`\. +A function handler can be any name; however, the default on the Lambda console is `lambda_function.lambda_handler`\. This name reflects the function name as `lambda_handler`, and the file where the handler code is stored in `lambda_function.py`\. + +If you choose a different name for your function handler on the Lambda console, you must update the name on the **Runtime settings** pane\. The following example shows the Lambda function handler on the Lambda console: + +![\[The following image shows the function handler on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) + +## How it works + +When your function handler is invoked by Lambda, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: ++ The first argument is the [event object](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-event)\. An event is a JSON\-formatted document that contains data for a Lambda function to process\. The [Lambda runtime](lambda-runtimes.md) converts the event to an object and passes it to your function code\. It is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or the `NoneType` type\. + + The event object contains information from the invoking service\. When you invoke a function, you determine the structure and contents of the event\. When an AWS service invokes your function, the service defines the event structure\. For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. ++ The second argument is the [context object](python-context.md)\. A context object is passed to your function by Lambda at runtime\. This object provides methods and properties that provide information about the invocation, function, and runtime environment\. + +## Returning a value + +Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [Using AWS Lambda with other services](lambda-services.md)\. For example: ++ If you use the `RequestResponse` invocation type, such as [Synchronous invocation](invocation-sync.md), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function on the console, the console will display the returned value\. ++ If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. ++ If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. ++ If you use an `Event` an [Asynchronous invocation](invocation-async.md) invocation type, the value is discarded\. -## Syntax +## Examples -In the syntax, note the following: -+ `event` – AWS Lambda uses this parameter to pass in event data to the handler\. This parameter is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or `NoneType` type\. +The following section shows examples of Python functions you can use with Lambda\. If you use the Lambda console to author your function, you do not need to attach a [\.zip archive file](python-package.md) to run the functions in this section\. These functions use standard Python libraries which are included with the Lambda runtime you selected\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. - When you invoke your function, you determine the content and structure of the event\. When an AWS service invokes your function, the event structure varies by service\. For details, see [Using AWS Lambda with other services](lambda-services.md)\. -+ `context` – AWS Lambda uses this parameter to provide runtime information to your handler\. For details, see [AWS Lambda context object in Python](python-context.md)\. -+ Optionally, the handler can return a value\. What happens to the returned value depends on the invocation type you use when invoking the Lambda function: - + If you use the `RequestResponse` invocation type \(synchronous execution\), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function using the console, the console will display the returned value\. - + If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. - + If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. - + If you use the `Event` invocation type \(asynchronous execution\), the value is discarded\. +### Returning a message -## Example +The following example shows a function called `lambda_handler` that uses the `python3.8` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input of a first and last name, and returns a message that contains data from the event it received as input\. + +``` +def lambda_handler(event, context): + message = 'Hello {} {}!'.format(event['first_name'], event['last_name']) + return { + 'message' : message + } +``` + +You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): + +``` +{ + "first_name": "John", + "last_name": "Smith" +} +``` -For example, consider the following Python example code\. +The response shows the event data passed as input: ``` -def my_handler(event, context): - message = 'Hello {} {}!'.format(event['first_name'], - event['last_name']) -  return { - 'message' : message - } +{ + "message": "Hello John Smith!" +} ``` -This example has one function called `my_handler`\. The function returns a message containing data from the event it received as input\. +### Parsing a response -For more information, see the following Python code for the [Amazon Simple Queue Service](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs-create-package.html#with-sqs-example-deployment-pkg-python)\. \ No newline at end of file +The following example shows a function called `lambda_handler` that uses the `python3.8` [Lambda runtime](lambda-runtimes.md)\. The function uses event data passed by Lambda at runtime\. It parses the [environment variable](configuration-envvars.md) in `AWS_REGION` returned in the JSON response\. + +``` +import os +import json + +def lambda_handler(event, context): + json_region = os.environ['AWS_REGION'] + return { + "statusCode": 200, + "headers": { + "Content-Type": "application/json" + }, + "body": json.dumps({ + "Region ": json_region + }) + } +``` + +You can use any event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): + +``` +{ + "key1": "value1", + "key2": "value2", + "key3": "value3" +} +``` + +Lambda runtimes set several environment variables during initialization\. For more information on the environment variables returned in the response at runtime, see [Using AWS Lambda environment variables](configuration-envvars.md)\. + +The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke API Response Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax)\. + +### Returning a calculation + +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. + +You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): + +``` +{ + "action": "increment", + "number": 3 +} +``` \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 3c0f5132..d042952c 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -50,7 +50,7 @@ To create or update a function with the Lambda API, create a deployment package ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "lambda_function.lambda_handler", @@ -112,7 +112,7 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "lambda_function.lambda_handler", @@ -194,7 +194,7 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", "Runtime": "python3.8", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "lambda_function.lambda_handler", diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index b64c3e30..e9f25cda 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -102,7 +102,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index 10345491..ad7ff752 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -1,6 +1,8 @@ # AWS Lambda function handler in Ruby -Your Lambda function's handler is the method that Lambda calls when your function is invoked\. In the following example, the file `function.rb` defines a handler method named `handler`\. The handler function takes two objects as input and returns a JSON document\. +The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. + +In the following example, the file `function.rb` defines a handler method named `handler`\. The handler function takes two objects as input and returns a JSON document\. **Example function\.rb** diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index eb33cef3..a5224563 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -104,7 +104,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index 7c0f280c..a3fa3b30 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -40,6 +40,8 @@ For more information about Intel MKL and similar libraries, see [Math Kernel Lib If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. + + Python Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 50268a89..d0b9384c 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -4,6 +4,8 @@ Lambda invokes your function in an execution environment, which provides a secur The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. + + ![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 5ca560d8..f26f8fc8 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -48,6 +48,8 @@ Each phase starts with an event from the Lambda service to the runtime and to al ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) + + **Topics** + [Init phase](#runtimes-extensions-api-reg) + [Invoke phase](#runtimes-lifecycle-invoke) @@ -323,4 +325,6 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + + \ No newline at end of file diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 5e201871..ebcc6286 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -93,7 +93,7 @@ public java.lang.Object lambdainternal.EventHandlerLoader$PojoMethodRequestHandl ### Example: Adding a shutdown hook to the JVM runtime process -When an extension is registered during a Shutdown event, the runtime process gets up to 500 ms to handle graceful shutdown\. You can hook into the runtime process, and when the JVM begins its shutdown process, it starts all registered hooks\. To register a shutdown hook, you must [register as an extension](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. You do not need to explicitly register for the Shutdown event, as that is automatically sent to the runtime\. +When an extension is registered during a `Shutdown` event, the runtime process gets up to 500 ms to handle graceful shutdown\. You can hook into the runtime process, and when the JVM begins its shutdown process, it starts all registered hooks\. To register a shutdown hook, you must [register as an extension](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. You do not need to explicitly register for the `Shutdown` event, as that is automatically sent to the runtime\. ``` import java.lang.instrument.Instrumentation; diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 7d2445df..e7ada6ec 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -25,6 +25,8 @@ The request payload you send in the `POST` request identifies the DynamoDB opera ``` + The following is a sample request payload for a DynamoDB read item operation: + + ``` { "operation": "read", diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index e2322cf2..0683e11d 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -105,6 +105,8 @@ Configure an alarm in Amazon CloudWatch that monitors the Lambda function and se + Threshold – **Whenever Errors is >=****1**\. + **Send notification to** – **lambda\-canary\-notifications**\. + + ## Test the alarm Update the function configuration to cause the function to return an error, which triggers the alarm\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 581bb681..25f585f9 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -8,6 +8,8 @@ This tutorial provides code that performs these tasks and a sample application t For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\. + + ## Prerequisites To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md new file mode 100644 index 00000000..e91da77b --- /dev/null +++ b/doc_source/services-msk-topic-add.md @@ -0,0 +1,59 @@ +# Adding an Amazon MSK cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +## Prerequisites ++ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md)\. + +## VPC configuration + +To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: ++ Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +Your Amazon VPC security groups must be configured with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + +**Note** +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. + +## Adding an Amazon MSK cluster using the Lambda console + +Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an MSK trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Designer**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **MSK** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +## Adding an Amazon MSK cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. + +### Creating a trigger using the AWS CLI + +The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. + +``` +$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +### Viewing the status using the AWS CLI + +The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +$ aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +``` \ No newline at end of file diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md new file mode 100644 index 00000000..d76e8c26 --- /dev/null +++ b/doc_source/services-smaa-topic-add.md @@ -0,0 +1,57 @@ +# Adding a self\-managed Apache Kafka cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +## Prerequisites ++ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. + +## Adding a self\-managed Apache Kafka cluster using the Lambda console + +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an Apache Kafka trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Designer**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +## Adding a self\-managed Apache Kafka cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. + +### Using SASL/SCRAM + +If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +### Using a VPC + +If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +### Viewing the status + +The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +$ aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 +``` \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index ea817d2a..80ac78f1 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -95,7 +95,7 @@ Resources: function: Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) Properties: - TracingConfig: + TracingConfig: Mode: Active ... ``` diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md new file mode 100644 index 00000000..7da4dcd6 --- /dev/null +++ b/doc_source/smaa-permissions.md @@ -0,0 +1,81 @@ +# Managing access and permissions for a self\-managed Apache Kafka cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. + +## Required Lambda function permissions + +To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +## Optional Lambda function permissions + +Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. + +### Secrets Manager and AWS KMS permissions + +If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. + +Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) + +### VPC permissions + +If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + +## Adding permissions to your execution role + +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. + +By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. + +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" + } + ] + } +``` + +For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. + +## Adding users to an IAM policy + +By default, IAM users and roles don't have permission to perform [event source API operations](kafka-using-cluster.md#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. + +## Using SASL/SCRAM authentication + +User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + +To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: + +``` +{ + "username": "ab1c23de", + "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" +} +``` + +For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. \ No newline at end of file diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index 9e48472f..a38cdde0 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -110,6 +110,7 @@ The following Amazon States Language definition of the `WhichCoat` state machine } ``` + **Example Python function** The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 0fd2620e..45d67f48 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -85,6 +85,8 @@ You can also increase concurrency by processing multiple batches from each shard + [Event source mapping APIs](#services-dynamodb-api) + [Error handling](#services-dynamodb-errors) + [Amazon CloudWatch metrics](#events-dynamodb-metrics) ++ [Time windows](#services-ddb-windows) ++ [Reporting batch item failures](#services-ddb-batchfailurereporting) + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) @@ -146,7 +148,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -298,4 +300,291 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + +## Time windows + +Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. + +Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. + +### Tumbling windows + +Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. + +Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. + +### Aggregation and processing + +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: + +**Example `TimeWindowEventReponse` values** + +``` +{ + "state": { + "1": 282, + "2": 715 + }, + "batchItemFailures": [] +} +``` + +**Note** +For Java functions, we recommend using a Map to represent the state\. + +At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. + +At the end of your window, Lambda uses final processing for actions on the aggregation results\. Your final processing is synchronously invoked\. After successful invocation, your function checkpoints the sequence number and stream processing continues\. If invocation is unsuccessful, your Lambda function suspends further processing until a successful invocation\. + +**Example DynamodbTimeWindowEvent** + +``` +{ + "Records":[ + { + "eventID":"1", + "eventName":"INSERT", + "eventVersion":"1.0", + "eventSource":"aws:dynamodb", + "awsRegion":"us-east-1", + "dynamodb":{ + "Keys":{ + "Id":{ + "N":"101" + } + }, + "NewImage":{ + "Message":{ + "S":"New item!" + }, + "Id":{ + "N":"101" + } + }, + "SequenceNumber":"111", + "SizeBytes":26, + "StreamViewType":"NEW_AND_OLD_IMAGES" + }, + "eventSourceARN":"stream-ARN" + }, + { + "eventID":"2", + "eventName":"MODIFY", + "eventVersion":"1.0", + "eventSource":"aws:dynamodb", + "awsRegion":"us-east-1", + "dynamodb":{ + "Keys":{ + "Id":{ + "N":"101" + } + }, + "NewImage":{ + "Message":{ + "S":"This item has changed" + }, + "Id":{ + "N":"101" + } + }, + "OldImage":{ + "Message":{ + "S":"New item!" + }, + "Id":{ + "N":"101" + } + }, + "SequenceNumber":"222", + "SizeBytes":59, + "StreamViewType":"NEW_AND_OLD_IMAGES" + }, + "eventSourceARN":"stream-ARN" + }, + { + "eventID":"3", + "eventName":"REMOVE", + "eventVersion":"1.0", + "eventSource":"aws:dynamodb", + "awsRegion":"us-east-1", + "dynamodb":{ + "Keys":{ + "Id":{ + "N":"101" + } + }, + "OldImage":{ + "Message":{ + "S":"This item has changed" + }, + "Id":{ + "N":"101" + } + }, + "SequenceNumber":"333", + "SizeBytes":38, + "StreamViewType":"NEW_AND_OLD_IMAGES" + }, + "eventSourceARN":"stream-ARN" + } + ], + "window": { + "start": "2020-07-30T17:00:00Z", + "end": "2020-07-30T17:05:00Z" + }, + "state": { + "1": "state1" + }, + "shardId": "shard123456789", + "eventSourceARN": "stream-ARN", + "isFinalInvokeForWindow": false, + "isWindowTerminatedEarly": false +} +``` + +### Configuration + +You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. + +``` +$ aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +``` + +Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. + +Tumbling window aggregations do not support resharding\. When the shard ends, Lambda considers the window closed, and the child shards start their own window in a fresh state\. + +Tumbling windows fully support the existing retry policies `maxRetryAttempts` and `maxRecordAge`\. + +**Example Handler\.py – Aggregation and processing** +The following Python function demonstrates how to aggregate and then process your final state: + +``` +def lambda_handler(event, context): + print('Incoming event: ', event) + print('Incoming state: ', event['state']) + +#Check if this is the end of the window to either aggregate or process. + if event['isFinalInvokeForWindow']: + # logic to handle final state of the window + print('Destination invoke') + else: + print('Aggregate invoke') + +#Check for early terminations + if event['isWindowTerminatedEarly']: + print('Window terminated early') + + #Aggregation logic + state = event['state'] + for record in event['Records']: + state[record['dynamodb']['NewImage']['Id']] = state.get(record['dynamodb']['NewImage']['Id'], 0) + 1 + + print('Returning state: ', state) + return {'state': state} +``` + +## Reporting batch item failures + +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. + +To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. + +### Report syntax + +When configuring reporting on batch item failures, the `StreamsEventResponse` class is returned with a list of batch item failures\. You can use a `StreamsEventResponse` object to return the sequence number of the first failed record in the batch\. You can also create your own custom class using the correct response syntax\. The following JSON structure shows the required response syntax: + +``` +{ + "BatchItemFailures": [ + { + "ItemIdentifier": "" + } + ] +} +``` + +### Success and failure conditions + +Lambda treats a batch as a complete success if you return any of the following: ++ An empty `batchItemFailure` list ++ A null `batchItemFailure` list ++ An empty `EventResponse` ++ A null `EventResponse` + +Lambda treats a batch as a complete failure if you return any of the following: ++ An empty string `itemIdentifier` ++ A null `itemIdentifier` ++ An `itemIdentifier` with a bad key name + +Lambda retries failures based on your retry strategy\. + +### Bisecting a batch + +If your invocation fails and `BisectBatchOnFunctionError` is turned on, the batch is bisected regardless of your `ReportBatchItemFailures` setting\. + +When a partial batch success response is received and both `BisectBatchOnFunctionError` and `ReportBatchItemFailures` are turned on, the batch is bisected at the returned sequence number and Lambda retries only the remaining records\. + +------ +#### [ Java ] + +**Example Handler\.java – return new StreamsEventResponse\(\)** + +``` +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class ProcessDynamodbRecords implements RequestHandler { + + @Override + public Serializable handleRequest(DynamodbEvent input, Context context) { + + List batchItemFailures = new ArrayList<*gt;(); + String curRecordSequenceNumber = ""; + + for (DynamodbEvent.DynamodbEventRecord dynamodbEventRecord : input.getRecords()) { + try { + //Process your record + DynamodbEvent.Record dynamodbRecord = dynamodbEventRecord.getDynamodb(); + curRecordSequenceNumber = dynamodbRecord.getSequenceNumber(); + + } catch (Exception e) { + //Return failed record's sequence number + batchItemFailures.add(new StreamsEventResponse.BatchItemFailure(curRecordSequenceNumber)); + return new StreamsEventResponse(batchItemFailures); + } + } + + return new StreamsEventResponse(batchItemFailures); + } +} +``` + +------ +#### [ Python ] + +**Example Handler\.py – return batchItemFailures\[\]** + +``` +def handler(event, context): + records = event.get("Records") + curRecordSequenceNumber = ""; + + for record in records: + try: + # Process your record + curRecordSequenceNumber = record["dynamodb"]["sequenceNumber"] + except Exception as e: + # Return failed record's sequence number + return {"batchItemFailures":[{"itemIdentifier": curRecordSequenceNumber}]} + + return {"batchItemFailures":[]} +``` + +------ \ No newline at end of file diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 041cbc25..7a3f7eac 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -69,6 +69,8 @@ You can also increase concurrency by processing multiple batches from each shard + [Event source mapping API](#services-kinesis-api) + [Error handling](#services-kinesis-errors) + [Amazon CloudWatch metrics](#events-kinesis-metrics) ++ [Time windows](#services-kinesis-windows) ++ [Reporting batch item failures](#services-kinesis-batchfailurereporting) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) @@ -160,7 +162,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -315,4 +317,222 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + +## Time windows + +Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. + +Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. + +### Tumbling windows + +Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. + +Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. + +### Aggregation and processing + +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: + +**Example `TimeWindowEventReponse` values** + +``` +{ + "state": { + "1": 282, + "2": 715 + }, + "batchItemFailures": [] +} +``` + +**Note** +For Java functions, we recommend using a Map to represent the state\. + +At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. + +At the end of your window, Lambda uses final processing for actions on the aggregation results\. Your final processing is synchronously invoked\. After successful invocation, your function checkpoints the sequence number and stream processing continues\. If invocation is unsuccessful, your Lambda function suspends further processing until a successful invocation\. + +**Example KinesisTimeWindowEvent** + +``` +{ + "Records": [ + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", + "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "approximateArrivalTimestamp": 1607497475.000 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-kinesis-role", + "awsRegion": "us-east-1", + "eventSourceARN": "arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream" + } + ], + "window": { + "start": "2020-12-09T07:04:00Z", + "end": "2020-12-09T07:06:00Z" + }, + "state": { + "1": 282, + "2": 715 + }, + "shardId": "shardId-000000000006", + "eventSourceARN": "arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream", + "isFinalInvokeForWindow": false, + "isWindowTerminatedEarly": false +} +``` + +### Configuration + +You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. + +``` +$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +``` + +Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. + +Tumbling window aggregations do not support resharding\. When the shard ends, Lambda considers the window closed, and the child shards start their own window in a fresh state\. + +Tumbling windows fully support the existing retry policies `maxRetryAttempts` and `maxRecordAge`\. + +**Example Handler\.py – Aggregation and processing** +The following Python function demonstrates how to aggregate and then process your final state: + +``` +def lambda_handler(event, context): + print('Incoming event: ', event) + print('Incoming state: ', event['state']) + +#Check if this is the end of the window to either aggregate or process. + if event['isFinalInvokeForWindow']: + # logic to handle final state of the window + print('Destination invoke') + else: + print('Aggregate invoke') + +#Check for early terminations + if event['isWindowTerminatedEarly']: + print('Window terminated early') + + #Aggregation logic + state = event['state'] + for record in event['Records']: + state[record['kinesis']['partitionKey']] = state.get(record['kinesis']['partitionKey'], 0) + 1 + + print('Returning state: ', state) + return {'state': state} +``` + +## Reporting batch item failures + +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. + +To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. + +### Report syntax + +When configuring reporting on batch item failures, the `StreamsEventResponse` class is returned with a list of batch item failures\. You can use a `StreamsEventResponse` object to return the sequence number of the first failed record in the batch\. You can also create your own custom class using the correct response syntax\. The following JSON structure shows the required response syntax: + +``` +{ + "BatchItemFailures": [ + { + "ItemIdentifier": "" + } + ] +} +``` + +### Success and failure conditions + +Lambda treats a batch as a complete success if you return any of the following: ++ An empty `batchItemFailure` list ++ A null `batchItemFailure` list ++ An empty `EventResponse` ++ A null `EventResponse` + +Lambda treats a batch as a complete failure if you return any of the following: ++ An empty string `itemIdentifier` ++ A null `itemIdentifier` ++ An `itemIdentifier` with a bad key name + +Lambda retries failures based on your retry strategy\. + +### Bisecting a batch + +If your invocation fails and `BisectBatchOnFunctionError` is turned on, the batch is bisected regardless of your `ReportBatchItemFailures` setting\. + +When a partial batch success response is received and both `BisectBatchOnFunctionError` and `ReportBatchItemFailures` are turned on, the batch is bisected at the returned sequence number and Lambda retries only the remaining records\. + +------ +#### [ Java ] + +**Example Handler\.java – return new StreamsEventResponse\(\)** + +``` +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class ProcessKinesisRecords implements RequestHandler { + + @Override + public Serializable handleRequest(KinesisEvent input, Context context) { + + List batchItemFailures = new ArrayList<*gt;(); + String curRecordSequenceNumber = ""; + + for (KinesisEvent.KinesisEventRecord kinesisEventRecord : input.getRecords()) { + try { + //Process your record + KinesisEvent.Record kinesisRecord = kinesisEventRecord.getKinesis(); + curRecordSequenceNumber = kinesisRecord.getSequenceNumber(); + + } catch (Exception e) { + //Return failed record's sequence number + batchItemFailures.add(new StreamsEventResponse.BatchItemFailure(curRecordSequenceNumber)); + return new StreamsEventResponse(batchItemFailures); + } + } + + return new StreamsEventResponse(batchItemFailures); + } +} +``` + +------ +#### [ Python ] + +**Example Handler\.py – return batchItemFailures\[\]** + +``` +def handler(event, context): + records = event.get("Records") + curRecordSequenceNumber = ""; + + for record in records: + try: + # Process your record + curRecordSequenceNumber = record["kinesis"]["sequenceNumber"] + except Exception as e: + # Return failed record's sequence number + return {"batchItemFailures":[{"itemIdentifier": curRecordSequenceNumber}]} + + return {"batchItemFailures":[]} +``` + +------ \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 6b1e887c..3b1c539e 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -121,7 +121,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 9051ab88..b22063bb 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -1,169 +1,7 @@ # Using Lambda with Amazon MSK -Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) is a managed service that enables you to build and run applications that use [Apache Kafka](http://aws.amazon.com/msk/what-is-kafka/) to process streaming data\. Apache Kafka is a distributed streaming platform that is conceptually similar to [Amazon Kinesis](http://aws.amazon.com/kinesis)\. With Amazon MSK, you can collect data from many sources and process them with multiple consumers\. - -You can use a Lambda function to process records in a Kafka topic\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads items from a topic and invokes the function\. Lambda polls across multiple partitions for new records and invokes your target function [synchronously](invocation-sync.md)\. - -The Amazon MSK event source mapping supports the following features: -+ Full compatibility with all Kafka versions that Amazon MSK supports\. For more information, see [Supported Apache Kafka versions](https://docs.aws.amazon.com/msk/latest/developerguide/supported-kafka-versions.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ Both plaintext and TLS encrypted brokers\. TLS brokers are not supported with a private certificate authority\. For more information, see the **Encryption in Transit** section of [Amazon MSK Encryption](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html#msk-encryption-in-transit) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ Configurable starting positions and batch sizes\. The configurable starting positions supported are `TRIM_HORIZON` and `LATEST`\. They are not timestamp\-based\. - -The following Kafka features are not supported: -+ Authentication – Mutual TLS and SASL authentication are not supported\. -+ Schema registry – You can host your own schema registry, but the Lambda API doesn't support this functionality\. For more information, see [Schema Management](https://docs.confluent.io/current/schema-registry/index.html) on the Confluent website\. +[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK provides the control\-plane operations, such as those for creating, updating, and deleting clusters\. It supports multiple open\-source versions of Kafka\. **Topics** -+ [Lambda consumer group](#services-msk-configure) -+ [Execution role permissions](#events-kinesis-permissions) -+ [Configuring a topic as an event source](#services-msk-eventsourcemapping) -+ [Event source mapping API](#services-msk-api) -+ [Event source mapping errors](#services-msk-errors) - -## Lambda consumer group - -To interact with Amazon MSK, Lambda creates a consumer group which can read from multiple Kafka topics\. The consumer group is created with the same ID as an event source mapping UUID\. The Lambda created consumer group is also used for checkpointing\. The group's position in each topic partition is committed to Kafka after successful processing\. - -Lambda processes records from one or more partitions and then sends the payload to the target function\. When more records are available, Lambda continues processing batches until the function catches up with the topic\. The maximum supported function execution time is 14 minutes\. - -**Example Amazon MSK record event** - -``` -Received event:{ - "eventSource": "aws:kafka", - "eventSourceArn": "arn:aws:kafka:us-west-2:012345678901:cluster/ExampleMSKCluster/e9f754c6-d29a-4430-a7db-958a19fd2c54-4", - "records": { - "AWSKafkaTopic-0": [ - { - "topic": "AWSKafkaTopic", - "partition": 0, - "offset": 0, - "timestamp": 1595035749700, - "timestampType": "CREATE_TIME", - "key": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj", - "value": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj" - } - ] - } -} -``` - -**Note** -The key\-value set of an `aws:kafka` resource is base64\-encoded\. - -## Execution role permissions - -Your Lambda function's [execution role](lambda-intro-execution-role.md) needs the following permissions to read records from an Amazon MSK cluster: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -The AWS managed policy `AWSLambdaMSKExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. - -## Configuring a topic as an event source - -Create an [event source mapping](invocation-eventsourcemapping.md) to tell Lambda to send records from a Kafka topic to a Lambda function\. You can create multiple event source mappings to process the same data with multiple functions, or to process items from multiple topics with a single function\. - -To configure your function to read from Amazon MSK, create an **MSK** trigger in the Lambda console\. - -**To create a trigger** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Under **Designer**, choose **Add trigger**\. - -1. Choose a trigger type\. - -1. Configure the required options and then choose **Add**\. - -Lambda supports the following options for Amazon MSK event sources: -+ **MSK cluster** – Select the MSK cluster\. -+ **Topic name** – Enter the Kafka topic to consume\. -+ **Starting position** \(optional\) – Enter the position in the stream to begin reading records\. - + **Latest** – Read from the latest position in all the topic's partitions\. - + **Trim Horizon** – Read from the oldest position in all the topic partitions\. - - After processing any existing records, the function is caught up and continues to process new records\. -+ **Enable trigger** – Disable the trigger to stop processing records\. - -To enable or disable the trigger \(or delete it\), choose the **MSK** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API commands\. - -## Event source mapping API - -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. Fetching records from Amazon MSK brokers requires access to an Amazon Virtual Private Cloud \(Amazon VPC\) associated with your MSK cluster\. To meet the Amazon VPC access requirements, you can do one of the following: -+ Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -The Amazon VPC security group rules you configure should have the following settings at minimum: -+ Inbound rules – Allow all traffic on all ports for the security group specified as your source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -The Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html) and doesn't need to be configured in the `create-event-source-mapping` setup\. - -The following AWS CLI example maps a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`, with the starting position set to `latest`: - -``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function -{ - "UUID": "6d9bce8e-836b-442c-8070-74e77903c815", - "BatchSize": 100, - "EventSourceArn": "arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2", - "FunctionArn": "arn:aws:lambda:us-west-2:111111111111:function:my-kafka-function", - "LastModified": 1580331394.363, - "State": "Creating", - "StateTransitionReason": "USER_INITIATED", - "LastProcessingResult": "OK", - "Topics": [ "AWSKafkaTopic" ] -} -``` - -Use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command to view the current status of your resource\. - -``` -$ aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -{ - "UUID": "6d9bce8e-836b-442c-8070-74e77903c815" - "BatchSize": 100, - "EventSourceArn": "arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2", - "FunctionArn": "arn:aws:lambda:us-west-2:111111111111:function:my-kafka-function", - "LastModified": 1580331394.363, - "State": "Enabled", - "StateTransitionReason": "User action", - "LastProcessingResult": "OK", - "Topics": [ "AWSKafkaTopic" ], -} -``` - -## Event source mapping errors - -When a Lambda function encounters an unrecoverable error, your Kafka topic consumer stops processing records\. Any other consumers may continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: - -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. - -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda failed to authenticate the event source\. - -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda does not have the required permissions to access the event source\. - -**`FUNCTION_CONFIG_NOT_VALID`** -The function's configuration is not valid\. - -Records will also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. \ No newline at end of file ++ [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) ++ [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) \ No newline at end of file diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index 479ff27d..a75a2cf3 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -282,9 +282,10 @@ Build the code with the Lambda library dependencies to create a deployment packa ## Python 3 -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. **Example lambda\_function\.py** +Copy the sample code into a file named `lambda_function.py`\. ``` import boto3 diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index e97bac3b..d88bdf10 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -146,7 +146,7 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs -To manage event source mappings with the AWS CLI or AWS SDK, use the following API operations: +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) From 063dafdc4ea27d1fe03d5c5f498964845f054e5d Mon Sep 17 00:00:00 2001 From: javakidx Date: Thu, 31 Dec 2020 01:55:07 +0800 Subject: [PATCH 053/243] Updated function name and some new steps. --- doc_source/services-apigateway-blueprint.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index 2880d544..ca37351f 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -22,10 +22,11 @@ Follow the steps in this section to create a new Lambda function and an API Gate 1. Configure the following settings\. + **Name** – **lambda\-microservice**\. - + **Role** – **Create a new role from one or more templates**\. + + **Role** – **Create a new role from AWS policy templates**\. + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. + **API** – **Create a new API**\. + + **API type** - **REST API**\. + **Security** – **Open**\. Choose **Create function**\. @@ -40,7 +41,7 @@ In this step, you will use the console to test the Lambda function\. In addition **To test the API** -1. With your `MyLambdaMicroService` function still open in the console, choose the **Actions** tab and then choose **Configure test event**\. +1. With your `lambda-microservice` function still open in the console, choose **Configure test events** from the **Select a test event** dropdown list. 1. Replace the existing text with the following: @@ -53,4 +54,5 @@ In this step, you will use the console to test the Lambda function\. In addition } ``` -1. After entering the text above choose **Save and test**\. \ No newline at end of file +1. After entering the text above choose **Create**\. +1. Choose the event and choose **Test**\. From 58e119f4b734dd5c1d79d86afaaf449f50dea457 Mon Sep 17 00:00:00 2001 From: Eason Cao Date: Tue, 5 Jan 2021 17:56:14 +0800 Subject: [PATCH 054/243] Update lambda-images.md for cross account image When creating Lambda function, it doesn't support to use cross account ECR image. The URI of a container image in the Amazon ECR registry should be the same account otherwise you will see: ``` An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Image repository must be in the same account as the caller ``` --- doc_source/lambda-images.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md index 5f7500d9..58a0fa17 100644 --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-images.md @@ -8,6 +8,8 @@ Additionally, AWS provides a runtime interface emulator for you to test your fun There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. +**Note**: Using the container image currently only support for the image from Amazon ECR in the same AWS account. + **Topics** + [Creating Lambda container images](images-create.md) -+ [Testing Lambda container images locally](images-test.md) \ No newline at end of file ++ [Testing Lambda container images locally](images-test.md) From a6343887ee50e41bc26555ccd5d8f00db51a0f3c Mon Sep 17 00:00:00 2001 From: Guillermo Mansilla Date: Wed, 6 Jan 2021 20:28:00 -0500 Subject: [PATCH 055/243] Update images-test.md Following branding guidelines --- doc_source/images-test.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 0bb78e1e..2021a3cb 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -1,4 +1,4 @@ -# Testing Lambda container images locally +# Testing AWS Lambda container images locally The Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. @@ -26,15 +26,15 @@ Note the following guidelines when using the Runtime Interface Emulator: The runtime interface emulator supports a subset of [environment variables](configuration-envvars.md) for the Lambda function in the local running image\. -If your function uses security credentials, you can configure the credentials by setting the following environment variables: +If your Lambda function uses security credentials, you can configure the credentials by setting the following environment variables: + `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` + `AWS_SESSION_TOKEN` + `AWS_REGION` -To set the function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the function to run\. +To set the Lambda function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the Lambda function to run\. -The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the function runs in the Lambda service: +The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the Lambda function runs in the Lambda service: + `AWS_LAMBDA_FUNCTION_VERSION` + `AWS_LAMBDA_FUNCION_NAME` + `AWS_LAMBDA_MEMORY_SIZE` @@ -65,7 +65,7 @@ The AWS base images for Lambda include the runtime interface emulator\. You can curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the Lambda function running in the container image and returns a response\. ## Build RIE into your base image @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ## Test an image without adding RIE to the image -You install the runtime interface emulator to your local machine\. When you run the image function, you set the entry point to be the emulator\. +You install the runtime interface emulator to your local machine\. When you run the Lambda image function, you set the entry point to be the emulator\. **To test an image without adding RIE to the image** @@ -128,4 +128,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the Lambda function running in the container image and returns a response\. From a7fc78f60448d28e3d8ee58d1f8040c1991d9280 Mon Sep 17 00:00:00 2001 From: Robin Wood Date: Thu, 7 Jan 2021 12:47:05 +0000 Subject: [PATCH 056/243] Rogue . There was an extra . at the end of the curl command which caused curl to try to do a second call after the first to localhost. --- doc_source/getting-started-create-function.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 4b3cf6e3..90dc9733 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -199,7 +199,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Test your Lambda function\. From your project directory, run a `curl` command to invoke your function: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` ### Upload the image to the Amazon ECR repository @@ -340,4 +340,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. From 39a0fd7b277eadc12c4392c2a011cd6f683e1bef Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 7 Jan 2021 12:42:37 -0800 Subject: [PATCH 057/243] replace references to master branch with main. As per github issue #227 --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfeb4d27..440a6667 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,13 +25,13 @@ We look forward to receiving your pull requests for: To contribute, send us a pull request. For small changes, such as fixing a typo or adding a link, you can use the [GitHub Edit Button](https://blog.github.com/2011-04-26-forking-with-the-edit-button/). For larger changes: 1. [Fork the repository](https://help.github.com/articles/fork-a-repo/). -2. In your fork, make your change in a branch that's based on this repo's **master** branch. +2. In your fork, make your change in a branch that's based on this repo's **main** branch. 3. Commit the change to your fork, using a clear and descriptive commit message. 4. [Create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/), answering any questions in the pull request form. Before you send us a pull request, please be sure that: -1. You're working from the latest source on the **master** branch. +1. You're working from the latest source on the **main** branch. 2. You check [existing open](https://github.com/awsdocs/aws-lambda-developer-guide/pulls), and [recently closed](https://github.com/awsdocs/aws-lambda-developer-guide/pulls?q=is%3Apr+is%3Aclosed), pull requests to be sure that someone else hasn't already addressed the problem. 3. You [create an issue](https://github.com/awsdocs/aws-lambda-developer-guide/issues/new) before working on a contribution that will take a significant amount of your time. @@ -53,4 +53,4 @@ If you discover a potential security issue, please notify AWS Security via our [ ## Licensing -See the [LICENSE](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/LICENSE) file for this project's licensing. We will ask you to confirm the licensing of your contribution. We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. +See the [LICENSE](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/LICENSE) file for this project's licensing. We will ask you to confirm the licensing of your contribution. We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. From d80144367faf112f92194590bf3ad96492b50693 Mon Sep 17 00:00:00 2001 From: Christopher Watford Date: Mon, 11 Jan 2021 11:16:09 -0500 Subject: [PATCH 058/243] Fix assertEquals arguments Swap arguments to reflect expected and actual for assertEquals. --- sample-apps/java-events/src/test/java/example/InvokeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java-events/src/test/java/example/InvokeTest.java b/sample-apps/java-events/src/test/java/example/InvokeTest.java index cb7d949a..fdd010f8 100644 --- a/sample-apps/java-events/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-events/src/test/java/example/InvokeTest.java @@ -27,7 +27,7 @@ void invokeTest() { String requestId = context.getAwsRequestId(); Handler handler = new Handler(); APIGatewayV2ProxyResponseEvent result = handler.handleRequest(event, context); - assertEquals(result.getStatusCode(),200); + assertEquals(200, result.getStatusCode()); } } From 0bb4f8b7d2a25fd9c4c8653379a8f4d3cb2d9554 Mon Sep 17 00:00:00 2001 From: eanbyrne <46104948+eanbyrne@users.noreply.github.com> Date: Sun, 17 Jan 2021 10:21:04 +0000 Subject: [PATCH 059/243] Fix to VPC endpoint policy example Fixed the VPC endpoint policy example to show a correct version of how Principal should be used per the docs[1]. The previous example would return an error if you attempted to use a Principal in that manner. [1] https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-accounts --- doc_source/configuration-vpc-endpoints.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 2c15b7c4..af0834c1 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -80,7 +80,9 @@ The following is an example of an endpoint policy for Lambda\. When attached to { "Statement":[ { - "Principal": "arn:aws:iam::123412341234:user/MyUser", + "Principal": { + "AWS": "arn:aws:iam::123412341234:user/MyUser", + } "Effect":"Allow", "Action":[ "lambda:InvokeFunction" @@ -91,4 +93,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` \ No newline at end of file +``` From 865145029f6471daa0ec10697754e77b82cb5123 Mon Sep 17 00:00:00 2001 From: Amol Date: Wed, 27 Jan 2021 22:28:24 +0530 Subject: [PATCH 060/243] Update with-sns-example.md corrected line number 110. SourceARN should have SNS arn and not that of lambda function. --- doc_source/with-sns-example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index eac2ef44..6be99da0 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -107,7 +107,7 @@ $ aws lambda add-permission --function-name SNS-X-Account \ --principal sns.amazonaws.com --profile accountB { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account\"}}, + \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, \"Action\":[\"lambda:InvokeFunction\"], \"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, @@ -148,4 +148,4 @@ $ aws sns publish --message file://message.txt --subject Test \ This will return a message id with a unique identifier, indicating the message has been accepted by the Amazon SNS service\. Amazon SNS will then attempt to deliver it to the topic's subscribers\. Alternatively, you could supply a JSON string directly to the `message` parameter, but using a text file allows for line breaks in the message\. -To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. \ No newline at end of file +To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. From 5e56ef5b303e528fe9ed7f5aa06e1a7d4ce1100d Mon Sep 17 00:00:00 2001 From: Steve Beaumont Date: Sun, 31 Jan 2021 08:53:53 +0000 Subject: [PATCH 061/243] Update python-package.md I spent many hours tracking down why my Python modules were not importable. When I renamed the package folder in the console from A to B and back from B to A the issue resolved and this led me to the discovery that files and directories must be globally readable for the Lambda to run despite everything looking perfectly OK in the console. I think it is important to fix this flaw or let people know about it. --- doc_source/python-package.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc_source/python-package.md b/doc_source/python-package.md index d042952c..f3aa695c 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -62,6 +62,9 @@ To create or update a function with the Lambda API, create a deployment package } ``` +**Note** +In order for your Python modules can be imported at runtime, ensure the files in the zip produced are globally readable (o+r) and any directories are globally readable (o+x). + ## Updating a function with additional dependencies If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. @@ -204,4 +207,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", ... } - ``` \ No newline at end of file + ``` From 6e832e6c4660bf2f5f832d7ab2b9d00673c57256 Mon Sep 17 00:00:00 2001 From: Juan Manuel Olaya Ortiz Date: Tue, 2 Feb 2021 22:08:24 +0100 Subject: [PATCH 062/243] Fix configuration-codesigning.md * Fix IAM policy formatting to add required Resource * Fix condition StringEquals syntax --- doc_source/configuration-codesigning.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md index 05d3a723..c35cf82d 100644 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -145,7 +145,8 @@ The following example policy statement grants permission to create, update, and "lambda:CreateCodeSigningConfig", "lambda:UpdateCodeSigningConfig", "lambda:GetCodeSigningConfig" - ] + ], + "Resource": "*" } ] } @@ -168,7 +169,7 @@ The following example policy statement grants permission to create a function\. "Resource": "*", "Condition": { "StringEquals": { - "lambda:codeSigningConfig: { + "lambda:codeSigningConfig": “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” } } @@ -192,4 +193,4 @@ To manage the code signing configuration for a function, use the following API o + [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) + [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) + [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) -+ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file ++ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) From 33593b75d49ff672fb492d53fe7d1461daef326c Mon Sep 17 00:00:00 2001 From: Nitav Shah Date: Wed, 10 Feb 2021 13:56:42 +0530 Subject: [PATCH 063/243] 'RequestId' to 'RequestID' in Golang Example In the Golang Lambda Handler for API Gateway, the RequestContext has no field as RequestId, so based on https://github.com/aws/aws-lambda-go/blob/v1.22.0/events/apigw.go#L32, field needs to be changed to 'RequestID' --- doc_source/services-apigateway-code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 85847284..40225f51 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -125,7 +125,7 @@ import ( ) func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestId) + fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) fmt.Printf("Body size = %d.\n", len(request.Body)) fmt.Println("Headers:") @@ -137,4 +137,4 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. From 6c005f9f58dee6740643b068410fd0d165603894 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Wed, 24 Feb 2021 19:24:08 +0000 Subject: [PATCH 064/243] Periodic update --- doc_source/API_CreateEventSourceMapping.md | 86 +----- doc_source/API_CreateFunction.md | 99 +------ doc_source/API_DeleteEventSourceMapping.md | 43 +-- .../API_EventSourceMappingConfiguration.md | 39 +-- doc_source/API_FunctionCode.md | 7 +- doc_source/API_FunctionCodeLocation.md | 10 - doc_source/API_FunctionConfiguration.md | 33 +-- doc_source/API_GetEventSourceMapping.md | 43 +-- doc_source/API_GetFunction.md | 22 +- doc_source/API_GetFunctionConfiguration.md | 47 +-- doc_source/API_GetLayerVersion.md | 6 +- doc_source/API_GetLayerVersionByArn.md | 6 +- doc_source/API_Layer.md | 12 - doc_source/API_LayerVersionContentOutput.md | 10 - doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_ListEventSourceMappings.md | 9 - doc_source/API_ListFunctions.md | 18 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_ListVersionsByFunction.md | 18 +- doc_source/API_Operations.md | 9 - doc_source/API_PublishLayerVersion.md | 8 +- doc_source/API_PublishVersion.md | 47 +-- doc_source/API_SourceAccessConfiguration.md | 18 +- doc_source/API_Types.md | 7 - doc_source/API_UpdateEventSourceMapping.md | 71 +---- doc_source/API_UpdateFunctionCode.md | 70 +---- doc_source/API_UpdateFunctionConfiguration.md | 75 +---- doc_source/access-control-identity-based.md | 19 +- doc_source/access-control-resource-based.md | 69 ++++- doc_source/applications-tutorial.md | 23 +- doc_source/best-practices.md | 4 +- doc_source/code-editor.md | 36 +-- doc_source/configuration-aliases.md | 18 +- doc_source/configuration-codesigning.md | 13 +- doc_source/configuration-concurrency.md | 48 ++- doc_source/configuration-console.md | 2 +- doc_source/configuration-database.md | 12 +- doc_source/configuration-envvars.md | 16 +- doc_source/configuration-filesystem.md | 13 +- doc_source/configuration-images.md | 6 +- doc_source/configuration-layers.md | 128 +++++--- doc_source/configuration-memory.md | 32 +- doc_source/configuration-tags.md | 10 +- doc_source/configuration-versions.md | 7 +- doc_source/configuration-vpc-endpoints.md | 9 +- doc_source/configuration-vpc.md | 12 +- doc_source/csharp-exceptions.md | 123 +++++++- doc_source/csharp-handler.md | 33 +-- doc_source/csharp-image.md | 2 +- doc_source/csharp-logging.md | 170 ++++++----- doc_source/csharp-package.md | 6 +- doc_source/csharp-tracing.md | 14 +- doc_source/deploying-lambda-apps.md | 2 + doc_source/functions-states.md | 7 +- doc_source/getting-started-create-function.md | 21 +- doc_source/gettingstarted-awscli.md | 74 +++-- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-limits.md | 6 +- doc_source/gettingstarted-package.md | 51 +++- doc_source/gettingstarted-tools.md | 2 +- doc_source/go-image.md | 2 +- doc_source/golang-exceptions.md | 123 +++++++- doc_source/golang-handler.md | 4 +- doc_source/golang-logging.md | 94 ++++-- doc_source/golang-package.md | 141 ++++++--- doc_source/golang-tracing.md | 18 +- doc_source/images-create.md | 10 +- doc_source/images-test.md | 39 +-- doc_source/index.md | 33 +-- doc_source/invocation-async.md | 23 +- doc_source/invocation-eventsourcemapping.md | 9 +- doc_source/invocation-retries.md | 4 +- doc_source/invocation-sync.md | 43 ++- doc_source/java-context.md | 30 +- doc_source/java-exceptions.md | 278 +++++++++--------- doc_source/java-handler.md | 50 ++-- doc_source/java-image.md | 10 +- doc_source/java-logging.md | 110 ++++--- doc_source/java-package-eclipse.md | 6 - doc_source/java-package.md | 82 +++--- doc_source/java-samples.md | 16 +- doc_source/java-tracing.md | 26 +- doc_source/kafka-hosting.md | 4 +- doc_source/kafka-smaa.md | 6 +- doc_source/kafka-using-cluster.md | 6 +- doc_source/lambda-api-permissions-ref.md | 4 +- doc_source/lambda-csharp.md | 4 +- doc_source/lambda-golang.md | 23 +- doc_source/lambda-images.md | 6 +- doc_source/lambda-intro-execution-role.md | 15 +- doc_source/lambda-java.md | 2 +- doc_source/lambda-kafka.md | 2 +- doc_source/lambda-monitoring.md | 21 +- doc_source/lambda-nodejs.md | 19 +- doc_source/lambda-permissions.md | 2 +- doc_source/lambda-powershell.md | 7 +- doc_source/lambda-python.md | 10 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-rolling-deployments.md | 2 - doc_source/lambda-ruby.md | 3 +- doc_source/lambda-runtimes.md | 15 +- doc_source/lambda-samples.md | 39 +-- doc_source/lambda-security.md | 2 +- doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 39 ++- .../monitoring-functions-access-metrics.md | 69 ++++- doc_source/monitoring-insights.md | 36 +-- doc_source/monitoring-metrics.md | 30 +- doc_source/nodejs-exceptions.md | 145 +++++++-- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-image.md | 1 + doc_source/nodejs-logging.md | 92 ++++-- doc_source/nodejs-package.md | 55 +++- doc_source/nodejs-tracing.md | 18 +- doc_source/powershell-exceptions.md | 123 +++++++- doc_source/powershell-logging.md | 94 ++++-- doc_source/powershell-package.md | 19 +- doc_source/python-context.md | 2 +- doc_source/python-exceptions.md | 169 +++++++++-- doc_source/python-handler.md | 2 +- doc_source/python-image.md | 35 ++- doc_source/python-logging.md | 94 ++++-- doc_source/python-package.md | 130 ++++---- doc_source/python-tracing.md | 18 +- doc_source/ruby-exceptions.md | 139 +++++++-- doc_source/ruby-logging.md | 132 ++++----- doc_source/ruby-package.md | 59 +++- doc_source/ruby-tracing.md | 18 +- doc_source/runtime-support-policy.md | 1 + doc_source/runtimes-avx2.md | 2 - doc_source/runtimes-context.md | 2 - doc_source/runtimes-extensions-api.md | 11 +- doc_source/runtimes-modify.md | 3 +- doc_source/runtimes-walkthrough.md | 13 +- doc_source/samples-blank.md | 32 +- doc_source/samples-errorprocessor.md | 8 +- doc_source/samples-listmanager.md | 12 +- doc_source/security-iam.md | 2 +- doc_source/security_iam_troubleshoot.md | 23 +- doc_source/services-alb.md | 7 +- doc_source/services-apigateway-blueprint.md | 14 +- doc_source/services-apigateway-code.md | 2 +- doc_source/services-apigateway-tutorial.md | 107 +++++-- doc_source/services-apigateway.md | 20 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-tutorial.md | 4 +- doc_source/services-ec2-tutorial.md | 47 ++- doc_source/services-elasticache-tutorial.md | 17 +- doc_source/services-iot.md | 7 +- doc_source/services-iotevents.md | 7 +- doc_source/services-lex.md | 2 +- doc_source/services-msk-topic-add.md | 4 +- doc_source/services-rds-tutorial.md | 36 ++- doc_source/services-rds.md | 26 +- doc_source/services-smaa-topic-add.md | 18 +- doc_source/services-stepfunctions.md | 2 +- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 10 +- doc_source/stepfunctions-patterns.md | 1 - doc_source/troubleshooting-deployment.md | 4 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/troubleshooting-invocation.md | 49 ++- doc_source/using-extensions.md | 3 +- doc_source/with-android-create-package.md | 2 +- doc_source/with-android-example.md | 17 +- doc_source/with-cloudtrail-example.md | 14 +- doc_source/with-ddb-create-package.md | 2 +- doc_source/with-ddb-example.md | 23 +- doc_source/with-ddb.md | 32 +- doc_source/with-kinesis-create-package.md | 6 +- doc_source/with-kinesis-example.md | 70 ++++- doc_source/with-kinesis.md | 39 ++- doc_source/with-mq.md | 25 +- doc_source/with-s3-example-deployment-pkg.md | 227 ++++++++------ doc_source/with-s3-example.md | 51 +++- doc_source/with-sns-create-package.md | 6 +- doc_source/with-sns-example.md | 83 +++++- doc_source/with-sns.md | 17 +- doc_source/with-sqs-create-package.md | 15 +- doc_source/with-sqs-example.md | 59 +++- doc_source/with-sqs.md | 15 +- 183 files changed, 3561 insertions(+), 2330 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 1988ce23..ad941e89 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -8,7 +8,6 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) + [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -37,17 +36,11 @@ Content-type: application/json "Enabled": boolean, "EventSourceArn": "string", "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", @@ -56,8 +49,7 @@ Content-type: application/json ], "StartingPosition": "string", "StartingPositionTimestamp": number, - "Topics": [ "string" ], - "TumblingWindowInSeconds": number + "Topics": [ "string" ] } ``` @@ -73,9 +65,8 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. ++ **Amazon Simple Queue Service** \- Default 10\. Max 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -103,7 +94,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No +Required: Yes ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. @@ -119,15 +110,8 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` -Required: No - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -156,17 +140,14 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` -Required: No - - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** -The Self\-Managed Apache Kafka cluster to send records\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. +Array Members: Fixed number of 1 item\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -181,17 +162,11 @@ Type: Timestamp Required: No ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -213,7 +188,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -221,23 +195,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -271,12 +237,6 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -286,7 +246,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -312,23 +272,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -339,17 +288,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 84688eea..f87bbbec 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -8,8 +8,6 @@ A function has an unpublished version, and can have published versions and alias The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. - If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. @@ -22,13 +20,11 @@ Content-type: application/json { "Code": { - "ImageUri": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob }, - "CodeSigningConfigArn": "string", "DeadLetterConfig": { "TargetArn": "string" }, @@ -46,15 +42,9 @@ Content-type: application/json ], "FunctionName": "string", "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, - "PackageType": "string", "Publish": boolean, "Role": "string", "Runtime": "string", @@ -85,13 +75,6 @@ The code for the function\. Type: [FunctionCode](API_FunctionCode.md) object Required: Yes - ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** -To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: No - ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object @@ -132,12 +115,7 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** -Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object -Required: No +Required: Yes ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. @@ -153,15 +131,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - ** [PackageType](#API_CreateFunction_RequestSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No ** [Publish](#API_CreateFunction_RequestSyntax) ** @@ -178,8 +150,8 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: Yes ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. @@ -233,17 +205,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -252,19 +213,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -330,10 +286,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -355,7 +307,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -367,14 +319,9 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_CreateFunction_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -388,17 +335,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -412,7 +349,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -435,20 +372,8 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index c422cfc4..44f1d88c 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -41,7 +41,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -49,23 +48,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -99,12 +90,6 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -114,7 +99,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -140,23 +125,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -167,17 +141,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 395a5f43..9e78f5c5 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -30,13 +30,6 @@ Required: No The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - **FunctionResponseTypes** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` Required: No **LastModified** @@ -50,7 +43,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -79,28 +72,14 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` -Required: No - - **SelfManagedEventSource** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. -Required: No - - **StartingPosition** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` -Required: No - - **StartingPositionTimestamp** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. Required: No **State** @@ -114,17 +93,11 @@ Type: String Required: No **Topics** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - **TumblingWindowInSeconds** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No **UUID** diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index e3f4b32c..8487a2d7 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -1,14 +1,9 @@ # FunctionCode -The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. +The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\. ## Contents - **ImageUri** -URI of a container image in the Amazon ECR registry\. -Type: String -Required: No - **S3Bucket** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 31347605..850b4594 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,11 +4,6 @@ Details about a function's deployment package\. ## Contents - **ImageUri** -URI of a container image in the Amazon ECR registry\. -Type: String -Required: No - **Location** A presigned URL that you can use to download the deployment package\. Type: String @@ -17,11 +12,6 @@ Required: No **RepositoryType** The service that's hosting the file\. Type: String -Required: No - - **ResolvedImageUri** -The resolved URI for the image\. -Type: String Required: No ## See Also diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index e4d33f74..2fa66b1c 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -54,11 +54,6 @@ The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - **ImageConfigResponse** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No **KMSKeyArn** @@ -86,7 +81,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` Required: No **Layers** @@ -101,15 +96,9 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **MemorySize** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - **PackageType** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No **RevisionId** @@ -126,19 +115,7 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - **SigningJobArn** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - **SigningProfileVersionArn** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **State** @@ -155,7 +132,7 @@ Required: No **StateReasonCode** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` Required: No **Timeout** diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index 6a4ec54e..f073a04e 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -39,7 +39,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -47,23 +46,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -97,12 +88,6 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -112,7 +97,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -138,23 +123,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -165,17 +139,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index f3d54f64..247f695e 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -41,10 +41,8 @@ Content-type: application/json { "Code": { - "ImageUri": "string", "Location": "string", - "RepositoryType": "string", - "ResolvedImageUri": "string" + "RepositoryType": "string" }, "Concurrency": { "ReservedConcurrentExecutions": number @@ -74,17 +72,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -93,19 +80,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 453c1f46..4d3a9dc4 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -66,17 +66,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -85,19 +74,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -163,10 +147,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -188,7 +168,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -200,14 +180,9 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -221,17 +196,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -245,7 +210,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index a6908afd..d0469dc3 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -37,9 +37,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -60,7 +58,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index a42e0458..46aaf325 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -33,9 +33,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -56,7 +54,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 13cc1eab..df0d9d16 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -14,18 +14,6 @@ Required: No **CodeSize** The size of the layer archive in bytes\. Type: Long -Required: No - - **SigningJobArn** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - **SigningProfileVersionArn** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 99cecb7d..09f64516 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -17,16 +17,6 @@ Required: No **Location** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String -Required: No - - **SigningJobArn** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Required: No - - **SigningProfileVersionArn** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String Required: No ## See Also diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 69fd3776..2e858f4a 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 38cf844a..803b3be6 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -64,7 +64,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -72,23 +71,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ], diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index e2f10d65..ae21f90a 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -66,17 +66,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -85,19 +74,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index ed2b84b1..1e38e5f3 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 91720146..cf6939f7 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index f5232b20..cfdddb83 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -69,17 +69,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -88,19 +77,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 70a90b0c..4dedc902 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -4,24 +4,19 @@ The following actions are supported: + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) -+ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) -+ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) -+ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) -+ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -33,11 +28,9 @@ The following actions are supported: + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) -+ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) -+ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -45,7 +38,6 @@ The following actions are supported: + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) -+ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -54,7 +46,6 @@ The following actions are supported: + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) -+ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 2bd56784..fcbe9f72 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -75,9 +75,7 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "Location": "string" }, "CreatedDate": "string", "Description": "string", @@ -98,7 +96,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 2241a33d..4e1749f3 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -86,17 +86,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -105,19 +94,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -183,10 +167,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -208,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -220,14 +200,9 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_PublishVersion_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -241,17 +216,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -265,7 +230,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 9d67d5af..8a21b665 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,25 +1,21 @@ # SourceAccessConfiguration -You can specify the authentication protocol, or the VPC components to secure access to your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` ## Contents **Type** -The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. -+ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. -+ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` +Valid Values:` BASIC_AUTH` Required: No **URI** -The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: String -Length Constraints: Minimum length of 1\. Maximum length of 200\. -Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index aaa9f473..ebedf4f7 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -5,9 +5,6 @@ The following data types are supported: + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) -+ [AllowedPublishers](API_AllowedPublishers.md) -+ [CodeSigningConfig](API_CodeSigningConfig.md) -+ [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -20,9 +17,6 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) -+ [ImageConfig](API_ImageConfig.md) -+ [ImageConfigError](API_ImageConfigError.md) -+ [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -31,7 +25,6 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) -+ [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 01660b10..c6a09e35 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -28,7 +28,6 @@ Content-type: application/json }, "Enabled": boolean, "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, @@ -38,8 +37,7 @@ Content-type: application/json "Type": "string", "URI": "string" } - ], - "TumblingWindowInSeconds": number + ] } ``` @@ -59,9 +57,8 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. ++ **Amazon Simple Queue Service** \- Default 10\. Max 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -93,17 +90,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -127,15 +117,11 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. -Required: No - - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. +Array Members: Fixed number of 1 item\. Required: No ## Response Syntax @@ -157,7 +143,6 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -165,23 +150,15 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], - "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -215,12 +192,6 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -230,7 +201,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -256,23 +227,12 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. + \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` +The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 1 item\. Maximum number of 22 items\. - - ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp +Array Members: Fixed number of 1 item\. ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -283,17 +243,12 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. + \(MSK\) The name of the Kafka topic to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration of a processing window in seconds\. The range is between 1 second up to 15 minutes\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 5c2b4326..f0f55d47 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -1,12 +1,9 @@ # UpdateFunctionCode -Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. +Updates a Lambda function's code\. The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\. -**Note** -For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. - ## Request Syntax ``` @@ -15,7 +12,6 @@ Content-type: application/json { "DryRun": boolean, - "ImageUri": "string", "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", @@ -48,11 +44,6 @@ The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean -Required: No - - ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** -URI of a container image in the Amazon ECR registry\. -Type: String Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** @@ -120,17 +111,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -139,19 +119,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -217,10 +192,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -242,7 +213,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -254,14 +225,9 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -275,17 +241,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -299,7 +255,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -322,20 +278,8 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 0470b867..f4b2ea77 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -31,11 +31,6 @@ Content-type: application/json } ], "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, @@ -100,11 +95,6 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -121,9 +111,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. +Valid Range: Minimum value of 128\. Maximum value of 3008\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -140,7 +130,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -190,17 +180,6 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -209,19 +188,14 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" + "CodeSize": number } ], "MasterArn": "string", "MemorySize": number, - "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -287,10 +261,6 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -312,7 +282,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -324,14 +294,9 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The amount of memory available to the function at runtime\. +The memory that's allocated to the function\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` +Valid Range: Minimum value of 128\. Maximum value of 3008\. ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -345,17 +310,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -369,7 +324,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -392,18 +347,6 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - **CodeVerificationFailedException** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - **InvalidCodeSignatureException** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. -HTTP Status Code: 400 - **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 4b3e15f6..5a6a3318 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -1,13 +1,16 @@ -# Identity\-based IAM policies for AWS Lambda +# Identity\-based IAM policies for Lambda You can use identity\-based policies in AWS Identity and Access Management \(IAM\) to grant users in your account access to Lambda\. Identity\-based policies can apply to users directly, or to groups and roles that are associated with a user\. You can also grant users in another account permission to assume a role in your account and access your Lambda resources\. -Lambda provides managed policies that grant access to Lambda API actions and, in some cases, access to other services used to develop and manage Lambda resources\. Lambda updates the managed policies as needed, to ensure that your users have access to new features when they're released\. -+ **AWSLambdaFullAccess** – Grants full access to AWS Lambda actions and other services used to develop and maintain Lambda resources\. -+ **AWSLambdaReadOnlyAccess** – Grants read\-only access to AWS Lambda resources\. -+ **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. +Lambda provides AWS managed policies that grant access to Lambda API actions and, in some cases, access to other AWS services used to develop and manage Lambda resources\. Lambda updates these managed policies as needed to ensure that your users have access to new features when they're released\. -Managed policies grant permission to API actions without restricting the functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. +**Note** +The AWS managed policies **AWSLambdaFullAccess** and **AWSLambdaReadOnlyAccess** will be [deprecated](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) on March 1, 2021\. After this date, you cannot attach these policies to new IAM users\. For more information, see the related [troubleshooting topic](security_iam_troubleshoot.md#security_iam_troubleshoot-admin-deprecation)\. ++ **AWSLambdaFullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. ++ **AWSLambdaReadOnlyAccess** – Grants read\-only access to Lambda resources\. ++ **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. + +AWS managed policies grant permission to API actions without restricting the Lambda functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. **Topics** + [Function development](#permissions-user-function) @@ -147,7 +150,7 @@ The permissions in the policy are organized into statements based on the [resour ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" ``` -+ `ViewExecutionRolePolicies` – View the AWS\-provided managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. ++ `ViewExecutionRolePolicies` – View the AWS managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. ``` "Action": [ @@ -167,7 +170,7 @@ The permissions in the policy are organized into statements based on the [resour This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. +When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. ## Layer development and use diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 58d81fc7..0778a999 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -64,22 +64,27 @@ When you add a trigger to your function with the Lambda console, the console upd Add a statement with the `add-permission` command\. The simplest resource\-based policy statement allows a service to invoke a function\. The following command grants Amazon SNS permission to invoke a function named `my-function`\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns \ --principal sns.amazonaws.com --output text +``` + +You should see the following output: + +``` {"Sid":"sns","Effect":"Allow","Principal":{"Service":"sns.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` This lets Amazon SNS call the `lambda:Invoke` API for the function, but it doesn't restrict the Amazon SNS topic that triggers the invocation\. To ensure that your function is only invoked by a specific resource, specify the Amazon Resource Name \(ARN\) of the resource with the `source-arn` option\. The following command only allows Amazon SNS to invoke the function for subscriptions to a topic named `my-topic`\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ --principal sns.amazonaws.com --source-arn arn:aws:sns:us-east-2:123456789012:my-topic ``` Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option with your account ID to ensure that only resources in your account can invoke the function\. ``` -$ aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ +aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ --principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket-123456 --source-account 123456789012 ``` @@ -88,19 +93,29 @@ $ aws lambda add-permission --function-name my-function --action lambda:InvokeFu To grant permissions to another AWS account, specify the account ID as the `principal`\. The following example grants account `210987654321` permission to invoke `my-function` with the `prod` alias\. ``` -$ aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ +aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ --principal 210987654321 --output text +``` + +You should see the following output: + +``` {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` The resource\-based policy grants permission for the other account to access the function, but doesn't allow users in that account to exceed their permissions\. Users in the other account must have the corresponding [user permissions](access-control-identity-based.md) to use the Lambda API\. -To limit access to a user, group, or role in another account, specify the full ARN of the identity as the principal\. For example, `arn:aws:iam::123456789012:user/developer`\. +To limit access to a user or role in another account, specify the full ARN of the identity as the principal\. For example, `arn:aws:iam::123456789012:user/developer`\. The [alias](configuration-aliases.md) limits which version the other account can invoke\. It requires the other account to include the alias in the function ARN\. ``` -$ aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:function:my-function:prod out +aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:function:my-function:prod out +``` + +You should see the following output: + +``` { "StatusCode": 200, "ExecutedVersion": "1" @@ -140,19 +155,29 @@ To grant other accounts permission for multiple functions, or for actions that d To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` -$ aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` + +You should see the following output: + +``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions only apply to a single version of a layer\. Repeat the procedure each time you create a new layer version\. +Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. To grant permission to all accounts in an organization, use the `organization-id` option\. The following example grants all accounts in an organization permission to use version 3 of a layer\. ``` -$ aws lambda add-layer-version-permission --layer-name my-layer \ +aws lambda add-layer-version-permission --layer-name my-layer \ --statement-id engineering-org --version-number 3 --principal '*' \ --action lambda:GetLayerVersion --organization-id o-t194hfs8cz --output text +``` + +You should see the following output: + +``` b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" ``` @@ -163,27 +188,41 @@ To grant permission to all AWS accounts, use `*` for the principal, and omit the To view a function's resource\-based policy, use the `get-policy` command\. ``` -$ aws lambda get-policy --function-name my-function --output text +aws lambda get-policy --function-name my-function --output text +``` + +You should see the following output: + +``` {"Version":"2012-10-17","Id":"default","Statement":[{"Sid":"sns","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function","Condition":{"ArnLike":{"AWS:SourceArn":"arn:aws:sns:us-east-2:123456789012:lambda*"}}}]} 7c681fc9-b791-4e91-acdf-eb847fdaa0f0 ``` For versions and aliases, append the version number or alias to the function name\. ``` -$ aws lambda get-policy --function-name my-function:PROD +aws lambda get-policy --function-name my-function:PROD ``` To remove permissions from your function, use `remove-permission`\. ``` -$ aws lambda remove-permission --function-name example --statement-id sns +aws lambda remove-permission --function-name example --statement-id sns ``` -Use the `get-layer-version-policy` command to view the permissions on a layer\. Use `remove-layer-version-permission` to remove statements from the policy\. +Use the `get-layer-version-policy` command to view the permissions on a layer\. + +``` +aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 --output text +``` + +You should see the following output: ``` -$ aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 --output text b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" +``` + +Use `remove-layer-version-permission` to remove statements from the policy\. -$ aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org +``` +aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org ``` \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index d5b82cb2..7c4c9ddb 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -6,7 +6,7 @@ In this tutorial, you create the following resources\. + **Application** – A Node\.js Lambda function, build specification, and AWS Serverless Application Model \(AWS SAM\) template\. + **Pipeline** – An AWS CodePipeline pipeline that connects the other resources to enable continuous delivery\. + **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Trigger** – An Amazon CloudWatch Events rule that watches the master branch of the repository and triggers the pipeline\. ++ **Trigger** – An Amazon CloudWatch Events rule that watches the main branch of the repository and triggers the pipeline\. + **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare the application template for deployment\. + **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the processed AWS SAM template from the build output, and deploy the new version with AWS CloudFormation\. + **Bucket** – An Amazon Simple Storage Service \(Amazon S3\) bucket for deployment artifact storage\. @@ -29,12 +29,17 @@ The pipeline maps a single branch in a repository to a single application stack\ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -115,7 +120,7 @@ In the previous step, Lambda console created a Git repository that contains func 1. To clone the repository, use the `git clone` command\. ``` - ~$ git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo + git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo ``` To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTable` resource in the template\. @@ -160,8 +165,8 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa 1. Commit and push the change\. ``` - ~/my-app-repo$ git commit -am "Add DynamoDB table" - ~/my-app-repo$ git push + git commit -am "Add DynamoDB table" + git push ``` When you push a change, it triggers the application's pipeline\. Use the **Deployments** tab of the application screen to track the change as it flows through the pipeline\. When the deployment is complete, proceed to the next step\. @@ -239,8 +244,8 @@ Next, update the function code to use the table\. The following code uses the Dy 1. Commit and push the change\. ``` - ~/my-app-repo$ git add . && git commit -m "Use DynamoDB table" - ~/my-app-repo$ git push + git add . && git commit -m "Use DynamoDB table" + git push ``` After the code change is deployed, invoke the function a few times to update the DynamoDB table\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index ef4c0aaa..9e01a7db 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -27,11 +27,11 @@ The following are recommended best practices for using AWS Lambda: + **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves cost by reducing function run time\. To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. -+ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.amazonaws.cn/en_us/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. ++ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.aws.amazon.com//sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. + **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. + **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. -+ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip file archives](java-package.md) for instructions\. ++ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index 2472dcff..6812db13 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -4,8 +4,6 @@ The Lambda console provides a code editor for languages that do not require comp The code editor includes the *menu bar*, *windows*, and the *editor pane*\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. @@ -28,8 +26,6 @@ You can use the **Environment** window in the code editor to create, open, and m ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) - - **To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. **To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. @@ -37,13 +33,9 @@ You can use the **Environment** window in the code editor to create, open, and m **To create a new file**, do one of the following: + In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. + Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - - ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) - - **To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. **To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. @@ -56,8 +48,6 @@ You can use the **Environment** window in the code editor to create, open, and m **To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. @@ -68,27 +58,17 @@ Use the editor pane in the code editor to view and write code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) - - ### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) - - **To display an open file's contents**, do one of the following: + Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. - - ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) - - **To close an open file**, do one of the following: + Choose the **X** icon in the file's tab\. + Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. @@ -103,20 +83,12 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) - - **To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) - - **To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. - - ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) **To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. @@ -127,8 +99,6 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) - - ## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -137,8 +107,6 @@ To expand the code editor to the edges of the web browser window, choose the **T ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) - - To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 31d4c28e..0fa7f0a8 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -30,19 +30,19 @@ To view the aliases that are currently defined for a function, on the function c To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. ``` -$ aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " +aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " ``` To change an alias to point a new version of the function, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html) command\. ``` -$ aws lambda update-alias --function-name my-function --name alias-name --function-version version-number +aws lambda update-alias --function-name my-function --name alias-name --function-version version-number ``` To delete an alias, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html) command\. ``` -$ aws lambda delete-alias --function-name my-function --name alias-name +aws lambda delete-alias --function-name my-function --name alias-name ``` The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: @@ -67,7 +67,7 @@ If you attempt to invoke the function without an alias or a specific version, th For example, the following AWS CLI command grants Amazon S3 permissions to invoke the PROD alias of the `helloworld` function when Amazon S3 is acting on behalf of `examplebucket`\. ``` -$ aws lambda add-permission --function-name helloworld \ +aws lambda add-permission --function-name helloworld \ --qualifier PROD --statement-id 1 --principal s3.amazonaws.com --action lambda:InvokeFunction \ --source-arn arn:aws:s3:::examplebucket --source-account 123456789012 ``` @@ -116,21 +116,21 @@ Use the `create-alias` and `update-alias` AWS CLI commands to configure the traf The following example creates a Lambda function alias named **routing\-alias** that points to version 1 of the function\. Version 2 of the function receives 3 percent of the traffic\. The remaining 97 percent of traffic is routed to version 1\. ``` -$ aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ +aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ --routing-config AdditionalVersionWeights={"2"=0.03} ``` Use the `update-alias` command to increase the percentage of incoming traffic to version 2\. In the following example, you increase the traffic to 5 percent\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --routing-config AdditionalVersionWeights={"2"=0.05} ``` To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. ``` -$ aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --function-version 2 --routing-config AdditionalVersionWeights={} ``` @@ -146,6 +146,4 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. - - \ No newline at end of file ++ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md index c35cf82d..f61f5d92 100644 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -131,7 +131,7 @@ To enable code signing for a function, you associate a code signing configuratio ## Configuring IAM policies -To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for AWS Lambda](access-control-identity-based.md)\. +To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. The following example policy statement grants permission to create, update, and retrieve code signing configurations\. @@ -146,15 +146,15 @@ The following example policy statement grants permission to create, update, and "lambda:UpdateCodeSigningConfig", "lambda:GetCodeSigningConfig" ], - "Resource": "*" + "Resource": "*" } ] } ``` -Administrators can use the `CodeSigningConfig` condition key to specify the code signing configurations that developers must use to create or update your functions\. +Administrators can use the `CodeSigningConfigArn` condition key to specify the code signing configurations that developers must use to create or update your functions\. -The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:codeSigningConfig` condition to specify the allowed code signing configuration\. Lambda blocks the `CreateFunction` API request if the `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. +The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:CodeSigningConfigArn` condition to specify the allowed code signing configuration\. Lambda blocks any `CreateFunction` API request if its `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. ``` { @@ -169,9 +169,8 @@ The following example policy statement grants permission to create a function\. "Resource": "*", "Condition": { "StringEquals": { - "lambda:codeSigningConfig": + "lambda:CodeSigningConfigArn": “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” - } } } } @@ -193,4 +192,4 @@ To manage the code signing configuration for a function, use the following API o + [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) + [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) + [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) -+ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) ++ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index a1e499ca..03cd0ad3 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -1,8 +1,14 @@ # Managing concurrency for a Lambda function -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. +Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. -Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. To ensure that a function can always reach a certain level of concurrency, you can configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. +There are two types of concurrency available: ++ Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. + +This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see AWS Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. + +To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. When Lambda allocates an instance of your function, the [runtime](lambda-runtimes.md) loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function [scales up](invocation-scaling.md), this causes the portion of requests that are served by new instances to have higher latency than the rest\. @@ -95,7 +101,13 @@ Provisioned concurrency does not come online immediately after you configure it\ + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -Your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. + +To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. + +If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. + +For provisioned concurrency instances, your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. @@ -128,7 +140,12 @@ To manage concurrency settings and autoscaling with the AWS CLI or AWS SDK, use To configure reserved concurrency with the AWS CLI, use the `put-function-concurrency` command\. The following command reserves a concurrency of 100 for a function named `my-function`: ``` -$ aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions 100 +aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions 100 +``` + +You should see the following output: + +``` { "ReservedConcurrentExecutions": 100 } @@ -137,8 +154,13 @@ $ aws lambda put-function-concurrency --function-name my-function --reserved-con To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: ``` -$ aws lambda put-provisioned-concurrency-config --function-name my-function \ +aws lambda put-provisioned-concurrency-config --function-name my-function \ --qualifier BLUE --provisioned-concurrent-executions 100 +``` + +You should see the following output: + +``` { "Requested ProvisionedConcurrentExecutions": 100, "Allocated ProvisionedConcurrentExecutions": 0, @@ -150,7 +172,7 @@ $ aws lambda put-provisioned-concurrency-config --function-name my-function \ To configure Application Auto Scaling to manage provisioned concurrency, use the Application Auto Scaling to configure [target tracking scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. First, register a function's alias as a scaling target\. The following example registers the `BLUE` alias of a function named `my-function`: ``` -$ aws application-autoscaling register-scalable-target --service-namespace lambda \ +aws application-autoscaling register-scalable-target --service-namespace lambda \ --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ --scalable-dimension lambda:function:ProvisionedConcurrency ``` @@ -158,10 +180,15 @@ $ aws application-autoscaling register-scalable-target --service-namespace lambd Next, apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent: ``` -$ aws application-autoscaling put-scaling-policy --service-namespace lambda \ +aws application-autoscaling put-scaling-policy --service-namespace lambda \ --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ --policy-name my-policy --policy-type TargetTrackingScaling \ --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' +``` + +You should see the following output: + +``` { "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", "Alarms": [ @@ -192,7 +219,12 @@ In the following example, a function scales between a minimum and maximum amount To view your account's concurrency quotas in a Region, use `get-account-settings`\. ``` -$ aws lambda get-account-settings +aws lambda get-account-settings +``` + +You should see the following output: + +``` { "AccountLimit": { "TotalCodeSize": 80530636800, diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 02e7ef4f..9a05cc2c 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -52,7 +52,7 @@ To configure functions with the Lambda API, use the following actions: For example, to update a function's memory setting with the AWS CLI, use the `update-function-configuration` command\. ``` -$ aws lambda update-function-configuration --function-name my-function --memory-size 256 +aws lambda update-function-configuration --function-name my-function --memory-size 256 ``` For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index c13a3714..cc56da29 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -46,7 +46,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -75,11 +75,11 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. ## Sample application Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) -+ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. + [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) ++ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) + [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index e17e2131..5720a4a1 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -119,6 +119,8 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. + `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. + `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. + + `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. + `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. @@ -137,6 +139,7 @@ The following additional environment variables aren't reserved and can be extend + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. ++ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. @@ -230,7 +233,7 @@ To manage environment variables with the AWS CLI or AWS SDK, use the following A The following example sets two environment variables on a function named `my-function`\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" ``` @@ -239,7 +242,12 @@ When you apply environment variables with the `update-function-configuration` co To get the current configuration, use the `get-function-configuration` command\. ``` -$ aws lambda get-function-configuration --function-name my-function +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -261,7 +269,7 @@ To ensure that the values don't change between when you read the configuration a To configure a function's encryption key, set the `KMSKeyARN` option\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 ``` @@ -271,4 +279,4 @@ Sample applications in this guide's GitHub repository demonstrate the use of env **Sample applications** + [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file ++ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 2a9a0a32..29308b57 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -80,15 +80,20 @@ Use the following API operations to connect your Lambda function to a file syste To connect a function to a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. ``` -$ ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd -$ aws lambda update-function-configuration --function-name my-function \ +ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd +aws lambda update-function-configuration --function-name my-function \ --fs-config FileSystemArn=$ARN,LocalMountPath=/mnt/efs0 ``` You can get the ARN of a file system's access point with the `describe-access-points` command\. ``` -$ aws efs describe-access-points +aws efs describe-access-points +``` + +You should see the following output: + +``` { "AccessPoints": [ { @@ -174,4 +179,4 @@ For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and f ## Sample applications The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 35a6a8cd..5c252be0 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -23,7 +23,7 @@ In Amazon ECR, if you reassign the image tag to another image, Lambda does not u ## Function version $LATEST -When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. The unpublished version is named **$LATEST**\. To view the current function version, choose the function, then choose **Qualifiers**\. +When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. By default, the console displays configuration information for the unpublished version of the function\. To view the versions of a function, choose **Qualifiers**\. The unpublished version is named **$LATEST**\. Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. @@ -153,7 +153,7 @@ To manage functions defined as container images, use the following API operation + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. Note that you must create the function from the same account as the container registry in Amazon EFS\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ @@ -169,7 +169,7 @@ You cannot change the `package-type` of a function\. ``` aws lambda update-function-code --region sa-east-1 --function-name my-function \ - --imageUri \ + --image-uri \ ``` To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 7178be02..209a0076 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,39 +1,45 @@ -# AWS Lambda layers +# Lambda layers -You can configure your Lambda function to pull in additional code and content in the form of layers\. A layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. +You can configure your Lambda function to pull in additional code and content in the form of layers\. A *layer* is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. **Note** -Functions defined as a container images do not support Lambda layers\. You can package your preferred runtimes and dependencies as a part of the container image when you build the image\. +Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. **Note** -A function can use up to 5 layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. +A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. -You can create layers, or use layers published by AWS and other AWS customers\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/), or all accounts\. +You can create layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. Layers are extracted to the `/opt` directory in the function execution environment\. Each runtime looks for libraries in a different location under `/opt`, depending on the language\. [Structure your layer](#configuration-layers-path) so that function code can access libraries without additional configuration\. -You can also use AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Declaring serverless resources](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template.html) in the *AWS Serverless Application Model Developer Guide*\. +You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Configuring a function to use layers](#configuration-layers-using) -+ [Managing layers](#configuration-layers-manage) -+ [Including library dependencies in a layer](#configuration-layers-path) ++ [Configure a function to use layers](#configuration-layers-using) ++ [Create layers](#configuration-layers-create) ++ [Manage layers](#configuration-layers-manage) ++ [Include library dependencies in a layer](#configuration-layers-path) + [Layer permissions](#configuration-layers-permissions) + [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) + [Sample applications](#configuration-layers-samples) -## Configuring a function to use layers +## Configure a function to use layers -You can specify up to 5 layers in your function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. +You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see the following output: + +``` { "FunctionName": "test-layers", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -54,23 +60,52 @@ arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 } ``` -You must specify the version of each layer to use by providing the full ARN of the layer version\. When you add layers to a function that already has layers, the previous list is overwritten by the new one\. Include all layers every time you update the layer configuration\. To remove all layers, specify an empty list\. +You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. ``` -$ aws lambda update-function-configuration --function-name my-function --layers [] +aws lambda update-function-configuration --function-name my-function --layers [] ``` While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still existed\. However, when you update the layer configuration, you must remove the reference to the deleted version\. +The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Create layers + +You can create new layers in the Lambda console or using the Lambda API\. + +**To create a layer in the console** + +1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. + +1. Choose **Create layer**\. -## Managing layers +1. For **Name**, enter a name for your layer\. + +1. \(Optional\) For **Description**, enter a description for your layer\. + +1. To upload your layer code, do one of the following: + + To upload a \.zip file from your computer, choose **Upload a \.zip file**, choose your \.zip file, and then choose **Open**\. + + To upload a file from Amazon Simple Storage Service \(Amazon S3\), choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. + +1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. + +1. \(Optional\) For **License**, enter any necessary license information\. + +1. Choose **Create**\. + +**To create a layer using the API** To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. ``` -$ aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ +aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip --compatible-runtimes python3.6 python3.7 +``` + +You should see the following 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...", @@ -91,12 +126,19 @@ $ aws lambda publish-layer-version --layer-name my-layer --description "My layer } ``` -Each time you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +Each time that you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. + +## Manage layers + + To find layers that are compatible with your Lambda function's runtime, use the `list-layers` command\. - To find layers that are compatible with your function's runtime, use the `list-layers` command\. +``` +aws lambda list-layers --compatible-runtime python3.8 +``` + +You should see the following output: ``` -$ aws lambda list-layers --compatible-runtime python3.8 { "Layers": [ { @@ -118,10 +160,15 @@ $ aws lambda list-layers --compatible-runtime python3.8 } ``` -You can omit the runtime option to list all layers\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. +To list all layers, you can omit the runtime option\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. + +``` +aws lambda get-layer-version --layer-name my-layer --version-number 2 +``` + +You should see the following output: ``` -$ aws lambda get-layer-version --layer-name my-layer --version-number 2 { "Content": { "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-91e9ea6e-492d-4100-97d5-a4388d442f3f?versionId=GmvPV.309OEpkfN...", @@ -141,19 +188,21 @@ $ aws lambda get-layer-version --layer-name my-layer --version-number 2 } ``` -The link in the response lets you download the layer archive and is valid for 10 minutes\. To delete a layer version, use the `delete-layer-version` command\. +The link in the response lets you download the layer archive\. The link is valid for 10 minutes\. + +To delete a layer version, use the `delete-layer-version` command\. ``` -$ aws lambda delete-layer-version --layer-name my-layer --version-number 1 +aws lambda delete-layer-version --layer-name my-layer --version-number 1 ``` -When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never re\-used for a layer name\. +When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. -## Including library dependencies in a layer +## Include library dependencies in a layer -You can move runtime dependencies out of your function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. +You can move runtime dependencies out of your Lambda function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. -To include libraries in a layer, place them in one of the folders supported by your runtime, or modify that path variable for your language\. +To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. + **Node\.js** – `nodejs/node_modules`, `nodejs/node8/node_modules` \(`NODE_PATH`\) **Example AWS X\-Ray SDK for Node\.js** @@ -203,25 +252,30 @@ For more information about path settings in the Lambda execution environment, se ## Layer permissions -Layer usage permissions are managed on the resource\. To configure a function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. +Layer usage permissions are managed on the resource\. To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` -$ aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` + +You should see the following output: + +``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions only apply to a single version of a layer\. Repeat the procedure each time you create a new layer version\. +Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. ## AWS CloudFormation and AWS SAM -Use the AWS Serverless Application Model \(AWS SAM\) in your AWS CloudFormation templates to automate the creation and mapping of layers in your application\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your function configuration\. +To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -259,9 +313,9 @@ When you update your dependencies and deploy, AWS SAM creates a new version of t ## Sample applications The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md index 1ecbcf60..ee80ac23 100644 --- a/doc_source/configuration-memory.md +++ b/doc_source/configuration-memory.md @@ -1,19 +1,39 @@ # Configuring Lambda function memory -AWS Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your function at runtime\. You can increase or decrease the memory and CPU power allocated to your Lambda function using the Memory \(MB\) setting\. To set the memory for your function, enter a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. This page describes how to update the memory allotted to your function on the Lambda console\. +Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. -## Configuring function memory on the Lambda console +This page describes how to update the memory allotted to your function in the Lambda console\. -You can configure the memory of your function in a text field on the Lambda console\. +## Configuring function memory in the Lambda console -**To update the memory for an existing function** +You can configure the memory of your function in the Lambda console\. + +**To update the memory of a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. + +1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. + +1. Choose **Save**\. + +## Accepting function memory recommendations on the Lambda console + +If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. + +When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. + +**To accept a function memory recommendation** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. 1. Choose a function\. -1. Choose **Edit** on the **Basic settings** pane\. +1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. -1. Enter a value in the text box\. +1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. 1. Choose **Save**\. \ No newline at end of file diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 3aa5fcd3..7b97c72a 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -42,7 +42,7 @@ With AWS Billing and Cost Management, you can use tags to customize billing repo When you create a new Lambda function, you can include tags with the `--tags` option\. ``` -$ aws lambda create-function --function-name my-function +aws lambda create-function --function-name my-function --handler index.js --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-role \ --tags Department=Marketing,CostCenter=1234ABCD @@ -51,7 +51,7 @@ $ aws lambda create-function --function-name my-function To add tags to an existing function, use the `tag-resource` command\. ``` -$ aws lambda tag-resource \ +aws lambda tag-resource \ --resource arn:aws:lambda:us-east-2:123456789012:function:my-function \ --tags Department=Marketing,CostCenter=1234ABCD ``` @@ -59,7 +59,7 @@ $ aws lambda tag-resource \ To remove tags, use the `untag-resource` command\. ``` -$ aws lambda untag-resource --resource function arn \ +aws lambda untag-resource --resource function arn \ --tag-keys Department ``` @@ -67,12 +67,12 @@ If you want to view the tags that are applied to a specific Lambda function, you + [ListTags](API_ListTags.md) – You supply your Lambda function ARN \(Amazon Resource Name\) to view a list of the tags associated with this function: ``` - $ aws lambda list-tags --resource function arn + aws lambda list-tags --resource function arn ``` + [GetFunction](API_GetFunction.md) – You supply your Lambda function name to a view a list of the tags associated with this function: ``` - $ aws lambda get-function --function-name my-function + aws lambda get-function --function-name my-function ``` You can also use the AWS Tagging Service’s [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. For more information about the AWS Tagging Service, see [Working with Resource Groups](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/resource-groups.html)\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 8bfe7d5d..75d05619 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -35,7 +35,12 @@ To publish a version of a function, use the [PublishVersion](API_PublishVersion. The following example publishes a new version of a function\. The response returns configuration information about the new version, including the version number and the function ARN with the version suffix\. ``` -$ aws lambda publish-version --function-name my-function +aws lambda publish-version --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index af0834c1..7ac4795d 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -80,9 +80,10 @@ The following is an example of an endpoint policy for Lambda\. When attached to { "Statement":[ { - "Principal": { - "AWS": "arn:aws:iam::123412341234:user/MyUser", - } + "Principal": + { + "AWS": "arn:aws:iam::123412341234:user/MyUser" + }, "Effect":"Allow", "Action":[ "lambda:InvokeFunction" @@ -93,4 +94,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` +``` \ No newline at end of file diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index eea956ec..a592160d 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,7 +2,7 @@ You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources while the function is running\. -When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each combination of security group and subnet in your function's VPC configuration\. This process can take about a minute\. +When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each subnet in your function's VPC configuration\. This process can take about a minute\. While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. @@ -84,7 +84,7 @@ To connect a Lambda function to a VPC, you can use the following API operations: To create a function and connect it to a VPC using the AWS Command Line Interface \(AWS CLI\), you can use the `create-function` command with the `vpc-config` option\. The following example creates a function with a connection to a VPC with two subnets and one security group\. ``` -$ aws lambda create-function --function-name my-function \ +aws lambda create-function --function-name my-function \ --runtime nodejs12.x --handler index.js --zip-file fileb://function.zip \ --role arn:aws:iam::123456789012:role/lambda-role \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb @@ -93,14 +93,14 @@ $ aws lambda create-function --function-name my-function \ To connect an existing function to a VPC, use the `update-function-configuration` command with the `vpc-config` option\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb ``` To disconnect your function from a VPC, update the function configuration with an empty list of subnets and security groups\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --vpc-config SubnetIds=[],SecurityGroupIds=[] ``` @@ -296,7 +296,7 @@ In the following tutorials, you connect a Lambda function to resources in your V ## Sample VPC configurations You can use the following sample AWS CloudFormation templates to create VPC configurations to use with Lambda functions\. There are two templates available in this guide's GitHub repository: -+ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. -+ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. ++ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. ++ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. \ No newline at end of file diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3384f72a..dbb88487 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -1,10 +1,18 @@ # AWS Lambda function errors in C\# -When an exception occurs in your Lambda function, Lambda will report the exception information back to you\. Exceptions can occur in two different places: -+ Initialization \(Lambda loading your code, validating the handler string, and creating an instance of your class if it is non\-static\)\. -+ The Lambda function invocation\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -The serialized exception information is returned as the payload as a modeled JSON object and outputted to CloudWatch logs\. +This page describes how to view Lambda function invocation errors for the C\# runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#csharp-exceptions-syntax) ++ [How it works](#csharp-exceptions-how) ++ [Using the Lambda console](#csharp-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-exceptions-cli) ++ [Error handling in other AWS services](#csharp-exceptions-other-services) ++ [What's next?](#csharp-exceptions-next-up) + +## Syntax In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions ](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: @@ -116,4 +124,109 @@ The method in which error information is conveyed depends on the invocation type For example, if you invoke a Lambda function using the Lambda console, the `RequestResponse` is always the invocation type and the console displays the error information returned by AWS Lambda in the **Execution result** section of the console\. + `Event` invocation type \(that is, asynchronous execution\): In this case AWS Lambda does not return anything\. Instead, it logs the error information in CloudWatch Logs and CloudWatch metrics\. -Depending on the event source, AWS Lambda may retry the failed Lambda function\. For more information, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in C\#](csharp-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting C\# code in AWS Lambda](csharp-tracing.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index bad3a2ad..04b6de39 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -52,24 +52,23 @@ All other types, as listed below, require you to specify a serializer\. Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `project.json` file\. + To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `.csproj` file\. ``` -{ - "version": "1.0.0-*", - "dependencies":{ - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - }, - "Amazon.Lambda.Serialization.Json": "1.3.0" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50" - } - } -} + + + netcoreapp3.1 + true + AssemblyName + + + + + + + + + ``` The example below illustrates the flexibility you can leverage by specifying the default Json\.NET serializer on one method and another of your choosing on a different method: @@ -98,7 +97,7 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `buildOptions.outputName` setting in project\.json, the *ASSEMBLY* name will be the name of the folder that contains your project\.json file\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the name of the folder that contains your \.csproj file once the build is complete\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 664397c5..eabed738 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -15,7 +15,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/main/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index ac5fd8e0..e939a3ce 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -1,29 +1,40 @@ # AWS Lambda function logging in C\# -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Topics** ++ [Creating a function that returns logs](#csharp-logging-output) ++ [Using the Lambda console](#csharp-logging-console) ++ [Using the CloudWatch console](#csharp-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-logging-cli) ++ [Deleting logs](#csharp-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. + +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) + { + GetAccountSettingsResponse accountSettings; + try { - GetAccountSettingsResponse accountSettings; - try - { - accountSettings = await callLambda(); - } - catch (AmazonLambdaException ex) - { - throw ex; - } - AccountUsage accountUsage = accountSettings.AccountUsage; - LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); - LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); - LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); - return accountUsage; + accountSettings = await callLambda(); + } + catch (AmazonLambdaException ex) + { + throw ex; } + AccountUsage accountUsage = accountSettings.AccountUsage; + LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); + LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); + LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); + return accountUsage; + } ``` **Example Log format** @@ -32,32 +43,32 @@ public async Task FunctionHandler(SQSEvent invocationEvent, ILambd START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST ENVIRONMENT VARIABLES: { - "AWS_EXECUTION_ENV": "AWS_Lambda_dotnetcore2.1", - "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", - "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", - "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", - "AWS_LAMBDA_LOG_STREAM_NAME": "2020/03/27/[$LATEST]5296xmpl084f411d9fb73b258393f30c", - "AWS_LAMBDA_FUNCTION_NAME": "blank-csharp-function-WU56XMPLV2XA", - ... + "AWS_EXECUTION_ENV": "AWS_Lambda_dotnetcore2.1", + "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", + "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", + "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", + "AWS_LAMBDA_LOG_STREAM_NAME": "2020/03/27/[$LATEST]5296xmpl084f411d9fb73b258393f30c", + "AWS_LAMBDA_FUNCTION_NAME": "blank-csharp-function-WU56XMPLV2XA", + ... EVENT: { - "Records": [ - { - "MessageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "ReceiptHandle": "MessageReceiptHandle", - "Body": "Hello from SQS!", - "Md5OfBody": "7b270e59b47ff90a553787216d55d91d", - "Md5OfMessageAttributes": null, - "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:MyQueue", - "EventSource": "aws:sqs", - "AwsRegion": "us-west-2", - "Attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1523232000000", - "SenderId": "123456789012", - "ApproximateFirstReceiveTimestamp": "1523232000001" - }, - ... + "Records": [ + { + "MessageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", + "ReceiptHandle": "MessageReceiptHandle", + "Body": "Hello from SQS!", + "Md5OfBody": "7b270e59b47ff90a553787216d55d91d", + "Md5OfMessageAttributes": null, + "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:MyQueue", + "EventSource": "aws:sqs", + "AwsRegion": "us-west-2", + "Attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1523232000000", + "SenderId": "123456789012", + "ApproximateFirstReceiveTimestamp": "1523232000001" + }, + ... END RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d REPORT RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Duration: 4157.16 ms Billed Duration: 4200 ms Memory Size: 256 MB Max Memory Used: 99 MB Init Duration: 841.60 ms XRAY TraceId: 1-5e7e8131-7ff0xmpl32bfb31045d0a3bb SegmentId: 0152xmpl6016310f Sampled: true @@ -76,33 +87,43 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#csharp-logging-console) -+ [Using the AWS CLI](#csharp-logging-cli) -+ [Deleting logs](#csharp-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console + +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. + +**To view logs on the CloudWatch console** -## Viewing logs in the AWS Management Console +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -**To view your Lambda function's logs** +1. Choose a log stream\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -1. Choose the first stream in the list\. +## Using the AWS Command Line Interface \(AWS CLI\) -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -## Using the AWS CLI +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -110,23 +131,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -136,10 +160,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index 39aaad94..cf47126e 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -1,10 +1,6 @@ # Deploy C\# Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. - -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. - -A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. However, by default the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. +A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. By default, the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index fdce4a13..37704f8a 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -55,7 +57,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -90,7 +92,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -100,7 +102,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -114,7 +116,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 3bc7c59b..5e2b25a1 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -8,6 +8,8 @@ The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverle The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI](gettingstarted-tools.md#gettingstarted-tools-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. +When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. + **Topics** + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 8eb61de2..6ff428af 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -9,7 +9,12 @@ When you create a function, the function is initially in the `Pending` state\. W You can use the Lambda API to get information about a function's state\. State information is included in the [FunctionConfiguration](API_FunctionConfiguration.md) document returned by several API actions\. To view the function's state with the AWS CLI, use the `get-function-configuration` command\. ``` -$ aws lambda get-function-configuration --function-name my-function +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 90dc9733..77869296 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 12\.x** is selected\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. 1. Choose **Create function**\. @@ -125,10 +125,15 @@ In this getting started exercise, you use the Docker CLI to create a container i ### Prerequisites -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -185,7 +190,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Build your Docker image\. From your project directory, run the following command: ``` - docker build -t hello-world . + docker build -t hello-world . ``` 1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. @@ -196,7 +201,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. docker run -p 9000:8080 hello-world:latest ``` - 1. Test your Lambda function\. From your project directory, run a `curl` command to invoke your function: + 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: ``` curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' @@ -207,13 +212,13 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` 1. Create a repository in Amazon ECR using the `create-repository` command\. ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE ``` 1. Tag your image to match your repository name using the `docker tag` command\. @@ -340,4 +345,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index f83328b5..7d821b6d 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -1,17 +1,22 @@ # Using AWS Lambda with the AWS Command Line Interface -You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. +You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. -In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. +In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. For more information, see [What is the AWS CLI?](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) in the *AWS Command Line Interface User Guide*\. ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started-create-function.md)\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -26,7 +31,12 @@ This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service AP Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. To create an execution role with the AWS CLI, use the `create-role` command\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +``` + +You should see the following output: + +``` { "Role": { "Path": "/", @@ -72,13 +82,13 @@ The `trust-policy.json` file is a JSON file in the current directory that define You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` -$ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. @@ -104,15 +114,20 @@ exports.handler = async function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. Replace the highlighted text in the role ARN with your account ID\. ``` - $ aws lambda create-function --function-name my-function \ + aws lambda create-function --function-name my-function \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-ex + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -132,7 +147,12 @@ exports.handler = async function(event, context) { To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail +aws lambda invoke --function-name my-function out --log-type Tail +``` + +You should see the following output: + +``` { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -143,8 +163,13 @@ $ aws lambda invoke --function-name my-function out --log-type Tail You can use the `base64` utility to decode the logs\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` + +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 @@ -169,7 +194,12 @@ aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-na The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. ``` -$ ./get-logs.sh +./get-logs.sh +``` + +You should see the following output: + +``` { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -212,7 +242,12 @@ $ ./get-logs.sh Run the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. ``` -$ aws lambda list-functions --max-items 10 +aws lambda list-functions --max-items 10 +``` + +You should see the following output: + +``` { "Functions": [ { @@ -240,7 +275,7 @@ $ aws lambda list-functions --max-items 10 In response, Lambda returns a list of up to 10 functions\. If there are more functions you can retrieve, `NextToken` provides a marker you can use in the next `list-functions` request\. The following `list-functions` AWS CLI command is an example that shows the `--starting-token` parameter\. ``` -$ aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0= +aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0= ``` ## Retrieve a Lambda function @@ -248,7 +283,12 @@ $ aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxs The Lambda CLI `get-function` command returns Lambda function metadata and a presigned URL that you can use to download the function's deployment package\. ``` -$ aws lambda get-function --function-name my-function +aws lambda get-function --function-name my-function +``` + +You should see the following output: + +``` { "Configuration": { "FunctionName": "my-function", @@ -277,7 +317,7 @@ For more information, see [GetFunction](API_GetFunction.md)\. Run the following `delete-function` command to delete the `my-function` function\. ``` -$ aws lambda delete-function --function-name my-function +aws lambda delete-function --function-name my-function ``` Delete the IAM role you created in the IAM console\. For information about deleting a role, see [Deleting roles or instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_delete.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 24624f14..b9e05f9f 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -44,7 +44,7 @@ For more information, see [Lambda deployment packages](gettingstarted-package.md A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information, see [AWS Lambda layers](configuration-layers.md)\. +For more information, see [Lambda layers](configuration-layers.md)\. ## Runtime diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 2ecf9594..2c676ff4 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -19,7 +19,7 @@ Authoring specifics vary between runtimes, but all runtimes share a common progr When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. -Initialization is billed as part of the duration for the first invocation that an instance of your function processes\. When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. +When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 4145bc38..f6bca081 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -21,10 +21,10 @@ The following quotas apply to function configuration, deployments, and execution | Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | -| Function [layers](configuration-layers.md) | 5 layers | +| Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\), 512 KB maximum for an individual file | | [Container image](lambda-images.md) code package size | 10 GB | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index fc5f489e..388e7af3 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -1,11 +1,12 @@ # Lambda deployment packages -Your Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. **Topics** + [Container images](#gettingstarted-package-images) + [\.zip file archives](#gettingstarted-package-zip) + [Layers](#gettingstarted-package-layers) ++ [Using other AWS services to build a deployment package](#gettingstarted-package-awsother) ## Container images @@ -23,19 +24,61 @@ A \.zip file archive includes your application code and its dependencies\. When When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. -For language\-specific instructions, see the following topics\. +You can upload a \.zip file as your deployment package using the Lambda console, AWS Command Line Interface \(AWS CLI\), or to an Amazon Simple Storage Service \(Amazon S3\) bucket\. + +### Using the Lambda console + +The following steps demonstrate how to upload a \.zip file as your deployment package using the Lambda console\. + +**To upload a \.zip file on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Select a function\. + +1. Choose **Actions**, **Upload a \.zip file** in the **Function code** pane\. + +1. Choose **Upload** to select your local \.zip file\. + +1. Choose **Save**\. + +### Using the AWS CLI + +You can upload a \.zip file as your deployment package using the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) +### Using Amazon S3 + +You can upload a \.zip file as your deployment package using Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using other AWS services to build a deployment package](#gettingstarted-package-awsother)\. + ## Layers If you deploy your function code using a \.zip file archive, you can use Lambda layers as a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers enable you to manage your in\-development function code independently from the unchanging code and resources that it uses\. You can configure your function to use layers that you create, layers that AWS provides, or layers from other AWS customers\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information about layers, see [AWS Lambda layers](configuration-layers.md)\. \ No newline at end of file +For more information about layers, see [Lambda layers](configuration-layers.md)\. + +## Using other AWS services to build a deployment package + +The following section describes other AWS services you can use to package dependencies for your Lambda function\. + +### Deployment packages with C or C\+\+ libraries + +If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + +For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + +### Deployment packages over 50 MB + +If your deployment package is larger than 50 MB, we recommend uploading your function code and dependencies to an Amazon S3 bucket\. + +You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. + +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-tools.md b/doc_source/gettingstarted-tools.md index 1880e4ac..dcae16df 100644 --- a/doc_source/gettingstarted-tools.md +++ b/doc_source/gettingstarted-tools.md @@ -20,7 +20,7 @@ To set up the AWS CLI, see the following topics in the *AWS Command Line Interfa To verify that the AWS CLI is configured correctly, run the `list-functions` command to see a list of your Lambda functions in the current AWS Region\. ``` -$ aws lambda list-functions +aws lambda list-functions ``` ## AWS SAM diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 548b1033..4b8e4564 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -160,7 +160,7 @@ If you do not want to add the RIE to your image, you can test your image locally 1. Post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` This command invokes the function running in the container image and returns a response\. diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index b2af9e95..719cfd9c 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -1,8 +1,20 @@ # AWS Lambda function errors in Go -You can create custom error handling to raise an exception directly from your Lambda function and handle it directly\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -The following code samples demonstrate how to do this\. Note that custom errors in Go must import the `errors` module\. +This page describes how to view Lambda function invocation errors for the Go runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Creating a function that returns exceptions](#go-exceptions-createfunction) ++ [How it works](#go-exceptions-how) ++ [Using the Lambda console](#go-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#go-exceptions-cli) ++ [Error handling in other AWS services](#go-exceptions-other-services) ++ [What's next?](#go-exceptions-next-up) + +## Creating a function that returns exceptions + +The following code sample demonstrates custom error handling that raises an exception directly from a Lambda function and handles it directly\. Note that custom errors in Go must import the `errors` module\. ``` package main @@ -28,4 +40,109 @@ Which returns the following: "errorMessage": "something went wrong!", "errorType": "errorString" } -``` \ No newline at end of file +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Go code in AWS Lambda](golang-tracing.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Go](golang-logging.md) page\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 6d9032d1..5acc75f7 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -2,7 +2,7 @@ The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. +A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. ``` package main @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. ### Valid handler signatures diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 0f8004cc..a6175f9a 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -1,10 +1,21 @@ # AWS Lambda function logging in Go -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** +**Topics** ++ [Creating a function that returns logs](#golang-logging-output) ++ [Using the Lambda console](#golang-logging-console) ++ [Using the CloudWatch console](#golang-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#golang-logging-cli) ++ [Deleting logs](#golang-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. + +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { @@ -61,33 +72,43 @@ The Go runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#golang-logging-console) -+ [Using the AWS CLI](#golang-logging-cli) -+ [Deleting logs](#golang-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -95,23 +116,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -121,10 +145,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 75c9aa48..007e8ea5 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -1,61 +1,128 @@ # Deploy Go Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package for your Lambda function that consists of your code \(a Go executable\) and any dependencies\. +This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](gettingstarted-package.md)\. -After you create the deployment package, you can upload it directly to an Amazon Simple Storage Service \(Amazon S3\) bucket in the AWS Region where you want to create the Lambda function\. Or, you can upload the \.zip file archive first and then specify the S3 bucket name and object key name when you create the function using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. +**Topics** ++ [Prerequisites](#golang-package-prereqs) ++ [Tools and libraries](#golang-package-libraries) ++ [Sample applications](#golang-package-sample) ++ [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) ++ [Creating a \.zip file on Windows](#golang-package-windows) ++ [Creating the Lambda function using the AWS CLI](#golang-package-create) -Download the Lambda library for Go with `go get`, and compile your executable\. +## Prerequisites -**Note** -Use `aws-lambda-go` version 1\.18\.0 or later``\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -``` -~/my-function$ go get github.com/aws/aws-lambda-go/lambda -~/my-function$ GOOS=linux go build main.go -``` +## Tools and libraries -Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. +Lambda provides the following tools and libraries for the Go runtime: -Create a deployment package by packaging the executable in a \.zip file, and use the AWS CLI to create a function\. The handler parameter must match the name of the executable containing your handler\. +**Tools and libraries for Go** ++ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. ++ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. ++ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. -``` -~/my-function$ zip function.zip main -~/my-function$ aws lambda create-function --function-name my-function --runtime go1.x \ - --zip-file fileb://function.zip --handler main \ - --role arn:aws:iam::123456789012:role/execution_role -``` +For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. + +## Sample applications + +Lambda provides the following sample applications for the Go runtime: + +**Sample Lambda applications in Go** ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. + +## Creating a \.zip file on macOS and Linux + +The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. + +1. Download the **lambda** library from GitHub\. + + ``` + go get github.com/aws/aws-lambda-go/lambda + ``` + +1. Compile your executable\. + + ``` + GOOS=linux go build main.go + ``` + + Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. + +1. \(Optional\) If your `main` package consists of multiple files, use the following [go build](https://golang.org/cmd/go/) command to compile the package: + + ``` + GOOS=linux go build main + ``` -## Creating a deployment package on Windows +1. \(Optional\) You may need to compile packages with `CGO_ENABLED=0` set on Linux: -To create a \.zip file archive that works on Lambda using Windows, we recommend installing the **build\-lambda\-zip** tool\. + ``` + GOOS=linux CGO_ENABLED=0 go build main.go + ``` + + This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. + +1. Create a deployment package by packaging the executable in a \.zip file\. + + ``` + zip function.zip main + ``` + +## Creating a \.zip file on Windows + +The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. **Note** If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. -To download the **build\-lambda\-zip** tool, run the following command: +1. Download the **build\-lambda\-zip** tool from GitHub: -``` -go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip -``` + ``` + go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip + ``` -Use the tool from your `GOPATH`\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: +1. Use the tool from your `GOPATH` to create a \.zip file\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: -In cmd\.exe, run the following: +------ +#### [ cmd\.exe ] -``` -set GOOS=linux -go build -o main main.go -%USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main -``` + In cmd\.exe, run the following: + + ``` + set GOOS=linux + go build -o main main.go + %USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main + ``` + +------ +#### [ PowerShell ] + + In PowerShell, run the following: + + ``` + $env:GOOS = "linux" + $env:CGO_ENABLED = "0" + $env:GOARCH = "amd64" + go build -o main main.go + ~\Go\Bin\build-lambda-zip.exe -output main.zip main + ``` + +------ + +## Creating the Lambda function using the AWS CLI + +Lambda needs to know the [Lambda runtime](lambda-runtimes.md) environment to use for your function's code \(in `runtime`\), a name for your Lambda function \(in `function-name`\), the Lambda handler in your function code \(in `handler`\), and the [execution role](lambda-intro-execution-role.md) it can use to invoke your function \(in `role`\)\. -In PowerShell, run the following: +Use the [create\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html) command to create the Lambda function\. ``` -$env:GOOS = "linux" -$env:CGO_ENABLED = "0" -$env:GOARCH = "amd64" -go build -o main main.go -~\Go\Bin\build-lambda-zip.exe -output main.zip main +aws lambda create-function --function-name my-function --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::your-account-id:role/execution_role ``` \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 94e19067..ee119846 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -32,7 +34,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Go\. Download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: ``` -$ go get github.com/aws/aws-xray-sdk-go +go get github.com/aws/aws-xray-sdk-go ``` To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. @@ -41,6 +43,12 @@ To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. xray.AWS(s3.Client) ``` +Then you can trace your calls by using the `WithContext` version of the method\. + +``` + svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) +``` + The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) @@ -66,7 +74,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -76,7 +84,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -90,7 +98,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/images-create.md b/doc_source/images-create.md index e854576c..9b67b93f 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -1,6 +1,6 @@ # Creating Lambda container images -You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. +You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. Note that you must create the Lambda function from the same account as the container registry in Amazon ECR\. AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. @@ -112,7 +112,13 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker build -t hello-world . ``` -1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. +1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. From a new terminal window, post an event to the following endpoint using a `curl` command: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' + ``` + + This command invokes the function running in the container image and returns a response\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 2021a3cb..990b4999 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -1,10 +1,10 @@ -# Testing AWS Lambda container images locally +# Testing Lambda container images locally -The Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. +The AWS Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. -You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. +You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your Lambda function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, you can use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. @@ -19,25 +19,25 @@ For examples of how to use the RIE, see [Container image support for Lambda](htt Note the following guidelines when using the Runtime Interface Emulator: + The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. -+ The emulator supports only Linux x84\-64 architectures\. ++ The emulator supports only Linux x86\-64 architectures\. + The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. ## Environment variables The runtime interface emulator supports a subset of [environment variables](configuration-envvars.md) for the Lambda function in the local running image\. -If your Lambda function uses security credentials, you can configure the credentials by setting the following environment variables: +If your function uses security credentials, you can configure the credentials by setting the following environment variables: + `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY` + `AWS_SESSION_TOKEN` + `AWS_REGION` -To set the Lambda function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the Lambda function to run\. +To set the function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the function to run\. -The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the Lambda function runs in the Lambda service: +The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the function runs in the Lambda service: + `AWS_LAMBDA_FUNCTION_VERSION` -+ `AWS_LAMBDA_FUNCION_NAME` -+ `AWS_LAMBDA_MEMORY_SIZE` ++ `AWS_LAMBDA_FUNCTION_NAME` ++ `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` ## Test an image with RIE included in the image @@ -59,10 +59,10 @@ The AWS base images for Lambda include the runtime interface emulator\. You can This command runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. -1. Post an event to the following endpoint using a `curl` command: +1. From a new terminal window, post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` This command invokes the Lambda function running in the container image and returns a response\. @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ## Test an image without adding RIE to the image -You install the runtime interface emulator to your local machine\. When you run the Lambda image function, you set the entry point to be the emulator\. +You install the runtime interface emulator to your local machine\. When you run the container image, you set the entry point to be the emulator\. **To test an image without adding RIE to the image** @@ -109,15 +109,16 @@ You install the runtime interface emulator to your local machine\. When you run ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` -1. Run your Lambda image function using the `docker run` command\. +1. Run your Lambda function using the `docker run` command\. ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest - --entrypoint /aws-lambda/aws-lambda-rie <(optional) image command> + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ + --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ + <(optional) image command> ``` This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. @@ -125,7 +126,7 @@ You install the runtime interface emulator to your local machine\. When you run 1. Post an event to the following endpoint using a `curl` command: ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'. + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the Lambda function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index d30ca936..9e959188 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -27,7 +27,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) - + [Identity-based IAM policies for AWS Lambda](access-control-identity-based.md) + + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) @@ -38,7 +38,7 @@ Amazon's trademarks and trade dress may not be used in + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [AWS Lambda layers](configuration-layers.md) + + [Lambda layers](configuration-layers.md) + [Configuring Lambda function memory](configuration-memory.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) @@ -119,13 +119,14 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MQ](with-mq.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + [Using AWS Lambda with Amazon SES](services-ses.md) - + [Using AWS Lambda with Amazon SNS](with-sns.md) + + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) + [Using AWS Lambda with Amazon SQS](with-sqs.md) @@ -143,9 +144,9 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda with Amazon MSK](with-msk.md) + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + + [Using Lambda with Self-managed Apache Kafka](kafka-smaa.md) + + [Managing access and permissions for a Self-managed Apache Kafka cluster](smaa-permissions.md) + + [Adding a Self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -177,7 +178,7 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Java](lambda-java.md) + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) - + [Deploy Java Lambda functions with .zip file archives](java-package.md) + + [Deploy Java Lambda functions with .zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) @@ -217,7 +218,7 @@ Amazon's trademarks and trade dress may not be used in + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) - + [Identity and access management for AWS Lambda](security-iam.md) + + [Identity and access management for Lambda](security-iam.md) + [How AWS Lambda works with IAM](security_iam_service-with-iam.md) + [AWS Lambda identity-based policy examples](security_iam_id-based-policy-examples.md) + [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md) @@ -237,24 +238,19 @@ Amazon's trademarks and trade dress may not be used in + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) - + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) - + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) - + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) - + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) - + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -266,11 +262,9 @@ Amazon's trademarks and trade dress may not be used in + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) - + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) - + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -278,7 +272,6 @@ Amazon's trademarks and trade dress may not be used in + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) - + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -287,7 +280,6 @@ Amazon's trademarks and trade dress may not be used in + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) - + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) @@ -297,9 +289,6 @@ Amazon's trademarks and trade dress may not be used in + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) - + [AllowedPublishers](API_AllowedPublishers.md) - + [CodeSigningConfig](API_CodeSigningConfig.md) - + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -312,9 +301,6 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) - + [ImageConfig](API_ImageConfig.md) - + [ImageConfigError](API_ImageConfigError.md) - + [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -323,7 +309,6 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) - + [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index c1fc2ff3..8fbb60cd 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -9,7 +9,12 @@ The following diagram shows clients invoking a Lambda function asynchronously\. For asynchronous invocation, Lambda places the event in a queue and returns a success response without additional information\. A separate process reads events from the queue and sends them to your function\. To invoke a function asynchronously, set the invocation type parameter to `Event`\. ``` -$ aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +``` + +You should see the following output: + +``` { "StatusCode": 202 } @@ -147,8 +152,13 @@ To manage asynchronous invocation settings with the AWS CLI or AWS SDK, use the To configure asynchronous invocation with the AWS CLI, use the `put-function-event-invoke-config` command\. The following example configures a function with a maximum event age of 1 hour and no retries\. ``` -$ aws lambda put-function-event-invoke-config --function-name error \ +aws lambda put-function-event-invoke-config --function-name error \ --maximum-event-age-in-seconds 3600 --maximum-retry-attempts 0 +``` + +You should see the following output: + +``` { "LastModified": 1573686021.479, "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", @@ -164,8 +174,13 @@ $ aws lambda put-function-event-invoke-config --function-name error \ The `put-function-event-invoke-config` command overwrites any existing configuration on the function, version, or alias\. To configure an option without resetting others, use `update-function-event-invoke-config`\. The following example configures Lambda to send a record to an SQS queue named `destination` when an event can't be processed\. ``` -$ aws lambda update-function-event-invoke-config --function-name error \ +aws lambda update-function-event-invoke-config --function-name error \ --destination-config '{"OnFailure":{"Destination": "arn:aws:sqs:us-east-2:123456789012:destination"}}' +``` + +You should see the following output: + +``` { "LastModified": 1573687896.493, "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", @@ -217,7 +232,7 @@ After creating the target and updating your function's execution role, add the d To configure a dead\-letter queue with the AWS CLI, use the `update-function-configuration` command\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --dead-letter-config TargetArn=arn:aws:sns:us-east-2:123456789012:my-topic ``` diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index d926e1d3..b66cc774 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. @@ -22,8 +22,13 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 +``` + +You should see the following output: + +``` { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md index 11efc02b..7f165662 100644 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -33,9 +33,9 @@ When you invoke a function indirectly, you need to be aware of the retry behavio + **Event source mappings** – Event source mappings that read from streams retry the entire batch of items\. Repeated errors block processing of the affected shard until the error is resolved or the items expire\. To detect stalled shards, you can monitor the [Iterator Age](monitoring-metrics.md) metric\. For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. -+ **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. Services like API Gateway and Elastic Load Balancing, which proxy requests from an upstream user or client, can also choose to relay the error response back to the requestor\. ++ **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. For example, Amazon S3 batch operations retries the operation if the Lambda function returns a `TemporaryFailure` response code\. Services that proxy requests from an upstream user or client may have a retry strategy or may relay the error response back to the requestor\. For example, API Gateway always relays the error response back to the requestor\. - For asynchronous invocation, the behavior is the same as when you invoke the function asynchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. + For asynchronous invocation, the behavior is the same as when you invoke the function synchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. + **Other accounts and clients** – When you grant access to other accounts, you can use [resource\-based policies](access-control-resource-based.md) to restrict the services or resources they can configure to invoke your function\. To protect your function from being overloaded, consider putting an API layer in front of your function with [Amazon API Gateway](services-apigateway.md)\. To help you deal with errors in Lambda applications, Lambda integrates with services like Amazon CloudWatch and AWS X\-Ray\. You can use a combination of logs, metrics, alarms, and tracing to quickly detect and identify issues in your function code, API, or other resources that support your application\. For more information, see [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md)\. diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index 6e18c851..849c5b15 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -3,7 +3,12 @@ When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function completes, Lambda returns the response from the function's code with additional data, such as the version of the function that was invoked\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. ``` -$ aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json +aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json +``` + +You should see the following output: + +``` { "ExecutedVersion": "$LATEST", "StatusCode": 200 @@ -24,15 +29,31 @@ For functions with a long timeout, your client might be disconnected during sync If Lambda isn't able to run the function, the error is displayed in the output\. ``` -$ aws lambda invoke --function-name my-function --payload value response.json +aws lambda invoke --function-name my-function --payload value response.json +``` + +You should see the following output: + +``` An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Unrecognized token 'value': was expecting ('true', 'false' or 'null') at [Source: (byte[])"value"; line: 1, column: 11] ``` -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -40,18 +61,22 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` - -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. For more information about the `Invoke` API, including a full list of parameters, headers, and errors, see [Invoke](API_Invoke.md)\. diff --git a/doc_source/java-context.md b/doc_source/java-context.md index faa7afe0..bf682e40 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,13 +17,13 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -64,17 +64,17 @@ END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms ``` -The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. +The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); -import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); -import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); +import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); +import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) public class TestContext implements Context{ public TestContext() {} @@ -99,10 +99,10 @@ For more information on logging, see [AWS Lambda function logging in Java](java- The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index dd8bd376..270b0470 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -1,31 +1,99 @@ # AWS Lambda function errors in Java -When your function raises an error, Lambda returns details about the error to the invoker\. The body of the response that Lambda returns contains a JSON document with the error name, error type, and an array of stack frames\. The client or service that invoked the function can handle the error or pass it along to an end user\. You can use custom exceptions to return helpful information to users for client errors\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#java-exceptions-syntax) ++ [How it works](#java-exceptions-how) ++ [Creating a function that returns exceptions](#java-exceptions-createfunction) ++ [Using the Lambda console](#java-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#java-exceptions-cli) ++ [Error handling in other AWS services](#java-exceptions-other-services) ++ [Sample applications](#java-exceptions-samples) ++ [What's next?](#java-exceptions-next-up) + +## Syntax + +In the following example, the runtime fails to deserialize the event into an object\. The input is a valid JSON type, but it doesn't match the type expected by the handler method\. + +**Example Lambda runtime error** + +``` +{ + "errorMessage": "An error occurred during JSON parsing", + "errorType": "java.lang.RuntimeException", + "stackTrace": [], + "cause": { + "errorMessage": "com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", + "errorType": "java.io.UncheckedIOException", + "stackTrace": [], + "cause": { + "errorMessage": "Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", + "errorType": "com.fasterxml.jackson.databind.exc.InvalidFormatException", + "stackTrace": [ + "com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)", + "com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:907)", + ... + ] + } + } +} +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Creating a function that returns exceptions + +You can create a Lambda function that displays human\-readable error messages to users\. + +**Note** +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. + +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; -// Handler value: example.HandlerDivide -public class HandlerDivide implements RequestHandler, Integer>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public Integer handleRequest(List event, Context context) - { - LambdaLogger logger = context.getLogger(); - // process event - if ( event.size() != 2 ) + // Handler value: example.HandlerDivide + public class HandlerDivide implements RequestHandler, Integer>{ + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public Integer handleRequest(List event, Context context) { - throw new InputLengthException("Input must be an array that contains 2 numbers."); + LambdaLogger logger = context.getLogger(); + // process event + if ( event.size() != 2 ) + { + throw new InputLengthException("Input must be an array that contains 2 numbers."); + } + int numerator = event.get(0); + int denominator = event.get(1); + logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT TYPE: " + event.getClass().toString()); + return numerator/denominator; } - int numerator = event.get(0); - int denominator = event.get(1); - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - return numerator/denominator; } -} ``` When the function throws `InputLengthException`, the Java runtime serializes it into the following document\. @@ -34,16 +102,16 @@ When the function throws `InputLengthException`, the Java runtime serializes it ``` { - "errorMessage":"Input must contain 2 numbers.", - "errorType":"java.lang.InputLengthException", - "stackTrace": [ - "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", - "example.HandlerDivide.handleRequest(HandlerDivide.java:14)" - ] -} + "errorMessage":"Input must contain 2 numbers.", + "errorType":"java.lang.InputLengthException", + "stackTrace": [ + "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", + "example.HandlerDivide.handleRequest(HandlerDivide.java:14)" + ] + } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. @@ -57,20 +125,11 @@ This code can return an arithmetic error\. {"errorMessage":"/ by zero","errorType":"java.lang.ArithmeticException","stackTrace":["example.HandlerDivide.handleRequest(HandlerDivide.java:28)","example.HandlerDivide.handleRequest(HandlerDivide.java:13)"]} ``` -**Topics** -+ [Viewing error output](#java-exceptions-view) -+ [Understanding error types and sources](#java-exceptions-types) -+ [Error handling in clients](#java-exceptions-clients) -+ [Error handling in other AWS services](#java-exceptions-services) -+ [Error handling in sample applications](#java-exceptions-samples) +## Using the Lambda console -## Viewing error output +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. -You can invoke your function with a test payload and view error output in the Lambda console, from the command line, or with the AWS SDK\. Error output is also captured in the function's execution logs and, when [tracing](java-tracing.md) is enabled, in AWS X\-Ray\. - -To view error output in the Lambda console, invoke it with a test event\. - -**To invoke a function in the Lambda console** +**To invoke a function on the Lambda console** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -79,9 +138,11 @@ To view error output in the Lambda console, invoke it with a test event\. 1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) -1. Choose an **Event template** that matches the events that your function processes\. +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. -1. Enter a name for the test event and modify the event structure as needed\. +1. Enter the JSON for the test event\. 1. Choose **Create**\. @@ -89,103 +150,35 @@ To view error output in the Lambda console, invoke it with a test event\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +## Using the AWS Command Line Interface \(AWS CLI\) -``` -$ aws lambda invoke --function-name my-function out.json -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -View the output file to see the error document\. +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. -``` -$ cat out.json -{"errorMessage":"Input must contain 2 numbers.","errorType":"java.lang.InputLengthException","stackTrace": ["example.HandlerDivide.handleRequest(HandlerDivide.java:23)","example.HandlerDivide.handleRequest(HandlerDivide.java:14)"]} -``` +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +------ +#### [ mac OS/Linux OS ] ``` -$ aws lambda invoke --function-name my-function --payload "[100,0]" out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Version: $LATEST -EVENT: [ - 100, - 0 -]EVENT TYPE: class java.util.ArrayList/ by zero: java.lang.ArithmeticException -java.lang.ArithmeticException: / by zero - at example.HandlerDivide.handleRequest(HandlerDivide.java:28) - at example.HandlerDivide.handleRequest(HandlerDivide.java:13) - -END RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f -REPORT RequestId: 081f7522-xmpl-48e2-8f67-96686904bb4f Duration: 4.20 ms Billed Duration: 5 ms Memory Size: 512 MB Max Memory Used: 95 MB -XRAY TraceId: 1-5e73162b-1919xmpl2592f4549e1c39be SegmentId: 3dadxmpl48126cb8 Sampled: true +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -For more information about logs, see [AWS Lambda function logging in Java](java-logging.md)\. - -## Understanding error types and sources - -When you invoke a function, multiple subsystems handle the request, event, output, and response\. Errors can come from the Lambda service \(invocation errors\), or from an instance of your function\. Function errors include exceptions returned by your handler code and exceptions returned by the Lambda runtime\. - -The Lambda service receives the invocation request and validates it\. It checks permissions, verifies that the event document is a valid JSON document, and checks parameter values\. If the Lambda service encounters an error, it returns an exception type, message, and HTTP status code that indicate the cause of the error\. - -**Note** -For a full list of errors that the `Invoke` API operation can return, see [Invoke Errors](API_Invoke.md#API_Invoke_Errors) in the Lambda API reference\. - -A `4xx` series error from the Lambda service indicates an error that the invoker can fix by modifying the request, requesting permission, or trying again\. A `5xx` series error indicates an issue with the Lambda service, or an issue with the function's configuration or resources\. These issues can't be addressed by the invoker, but the function's owner might be able to fix them\. - -If a request passes validation, Lambda sends it to an instance of the function\. The runtime converts the event document into an object and passes it to your handler code\. Errors can occur during this process if, for example, the name of your handler method doesn't match the function's configuration, or if the invocation times out before your handler code returns a response\. Lambda runtime errors are formatted like errors that your code returns, but they are returned by the runtime\. - -In the following example, the runtime fails to deserialize the event into an object\. The input is a valid JSON type, but it doesn't match the type expected by the handler method\. - -**Example Lambda runtime error** +------ +#### [ Windows OS ] ``` -{ - "errorMessage": "An error occurred during JSON parsing", - "errorType": "java.lang.RuntimeException", - "stackTrace": [], - "cause": { - "errorMessage": "com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "java.io.UncheckedIOException", - "stackTrace": [], - "cause": { - "errorMessage": "Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "com.fasterxml.jackson.databind.exc.InvalidFormatException", - "stackTrace": [ - "com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)", - "com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:907)", - ... - ] - } - } -} -``` - -For Lambda runtime errors and other function errors, the Lambda service does not return an error code\. A `2xx` series status code indicates that the Lambda service accepted the request\. Instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -For asynchronous invocation, events are queued before Lambda sends them to your function\. For valid requests, Lambda returns a success response immediately and adds the event to the queue\. Lambda then reads events from the queue and invokes the function\. If an error occurs, Lambda retries with behavior that varies depending on the type of error\. For more information, see [Asynchronous invocation](invocation-async.md)\. - -## Error handling in clients - -Clients that invoke Lambda functions can choose to handle errors or pass them on to the end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. For example, if an invocation fails with an error code `429` \(too many requests\), the AWS CLI retries up to 4 times before showing an error to the user\. - -``` -$ aws lambda invoke --function-name my-function out.json -An error occurred (TooManyRequestsException) when calling the Invoke operation (reached max retries: 4): Rate Exceeded. +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -For other invocation errors, the correct behavior depends on the response code\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. A retry might or might not succeed\. `4xx` series errors other than `429` generally indicate an error with the request\. A retry is not likely to succeed\. +------ -For function errors, the client can process the error document and show the error message in a user\-friendly format\. A browser\-based application might show the error message and type, but omit the stack trace\. The AWS CLI saves the error object to the output file and displays a document generated from the response headers instead\. +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function --payload '[1000]' out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -193,35 +186,44 @@ $ aws lambda invoke --function-name my-function --payload '[1000]' out.json } ``` -**Example out\.json** +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -{"errorMessage":"Input must be an array that contains 2 numbers.","errorType":"example.InputLengthException","stackTrace":["example.HandlerDivide.handleRequest(HandlerDivide.java:22)","example.HandlerDivide.handleRequest(HandlerDivide.java:13)"]} +cat output.txt ``` -## Error handling in other AWS services +You should see the invocation response in your command prompt\. -When an AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. +``` +{"errorMessage":"Input must contain 2 numbers.","errorType":"java.lang.InputLengthException","stackTrace": ["example.HandlerDivide.handleRequest(HandlerDivide.java:23)","example.HandlerDivide.handleRequest(HandlerDivide.java:14)"]} +``` -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a 500 error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Java](java-logging.md)\. -To determine the source of an error and its cause, use AWS X\-Ray\. With X\-Ray, you can find out which component encountered an error and see details about exceptions\. The following example shows a function error that resulted in a 502 response from API Gateway\. +## Error handling in other AWS services -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. -Get started with X\-Ray by [enabling active tracing](java-tracing.md) on your functions\. +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. -For details on how other services handler errors, see the topics in the [Using AWS Lambda with other services](lambda-services.md) chapter\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Java code in AWS Lambda](java-tracing.md)\. -## Error handling in sample applications +## Sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. + +The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. -The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Java](java-logging.md) page\. \ No newline at end of file diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 6287d7cd..5bc8a0b4 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -4,13 +4,13 @@ The AWS Lambda function handler is the method in your function code that process In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -104,15 +104,15 @@ The output type can be an object or `void`\. The runtime serializes return value ## Handler interfaces -The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. +The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. **** -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,12 +125,12 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { @@ -170,18 +170,18 @@ public class HandlerStream implements RequestStreamHandler { The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 458af4cd..8ae09915 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -8,6 +8,10 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Java runtime interface clients](#java-image-clients) + ## AWS base images for Java AWS provides the following base images for Java: @@ -15,9 +19,9 @@ AWS provides the following base images for Java: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | -| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | -| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | +| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | +| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | +| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | Docker Hub repository: amazon/aws\-lambda\-java diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 0bc1d9e0..8babf997 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -1,6 +1,19 @@ # AWS Lambda function logging in Java -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. + +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#java-logging-output) ++ [Using the Lambda console](#java-logging-console) ++ [Using the CloudWatch console](#java-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#java-logging-cli) ++ [Deleting logs](#java-logging-delete) ++ [Advanced logging with Log4j 2 and SLF4J](#java-logging-log4j2) ++ [Sample logging code](#java-logging-samples) + +## Creating a function that returns logs To output logs from your function code, you can use methods on [java\.lang\.System](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html), or any logging module that writes to `stdout` or `stderr`\. The [aws\-lambda\-java\-core](java-package.md) library provides a logger class named `LambdaLogger` that you can access from the context object\. The logger class supports multiline logs\. @@ -73,35 +86,43 @@ The Java runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#java-logging-console) -+ [Using the AWS CLI](#java-logging-cli) -+ [Deleting logs](#java-logging-delete) -+ [Advanced logging with Log4j 2 and SLF4J](#java-logging-log4j2) -+ [Sample logging code](#java-logging-samples) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console -## Viewing logs in the AWS Management Console +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +**To view logs on the CloudWatch console** -**To view your Lambda function's logs** +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose a log stream\. -1. Choose the first stream in the list\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -## Using the AWS CLI +## Using the AWS Command Line Interface \(AWS CLI\) -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -109,23 +130,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -135,10 +159,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -186,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -233,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -259,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { @@ -289,11 +325,11 @@ When you run your code locally for tests, the context object with the Lambda log The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 03935add..5a74dc55 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -59,12 +59,8 @@ If you are following other tutorial topics in this guide, the specific tutorials 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. 1. In the **New Java Class** window, type the following values: - - + **Package**: **example** + **Name**: **Hello** - - **Note** If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. @@ -83,8 +79,6 @@ The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. 1. In the **Add Plugin** window, type the following values: - - + **Group Id:** org\.apache\.maven\.plugins + **Artifact Id:** maven\-shade\-plugin + **Version:** 3\.2\.2 diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 194d4f9f..2eb8094b 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -1,8 +1,24 @@ -# Deploy Java Lambda functions with \.zip file archives +# Deploy Java Lambda functions with \.zip or JAR file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your compiled function code and dependencies\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +This page describes how to create your deployment package as a \.zip file or Jar file, and then use the deployment package to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. + +**Topics** ++ [Prerequisites](#java-package-prereqs) ++ [Tools and libraries](#java-package-libraries) ++ [Building a deployment package with Gradle](#java-package-gradle) ++ [Building a deployment package with Maven](#java-package-maven) ++ [Uploading a deployment package with the Lambda API](#java-package-cli) ++ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) + +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Tools and libraries Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. @@ -50,27 +66,7 @@ dependencies { To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. - -You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. - -**To upload a deployment package with the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Under **Function code**, choose **Upload**\. - -1. Upload the deployment package\. - -1. Choose **Save**\. - -**Topics** -+ [Building a deployment package with Gradle](#java-package-gradle) -+ [Building a deployment package with Maven](#java-package-maven) -+ [Uploading a deployment package with the Lambda API](#java-package-cli) -+ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. ## Building a deployment package with Gradle @@ -88,7 +84,7 @@ task buildZip(type: Zip) { } ``` -This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies libraries from the build's classpath into a directory named `lib`\. +This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies the Java project resources into their target directory, potentially processing then\. The statement `into('lib')` then copies dependency libraries from the build's classpath into a folder named `lib`\. **Example build\.gradle – Dependencies** @@ -212,7 +208,12 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: ``` -~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip +aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -232,10 +233,23 @@ To update a function's code with the AWS Command Line Interface \(AWS CLI\) or A If your deployment package is larger than 50 MB, you can't upload it directly\. Upload it to an Amazon Simple Storage Service \(Amazon S3\) bucket and point Lambda to the object\. The following example commands upload a deployment package to an S3 bucket named `my-bucket` and use it to update a function's code: ``` -~/my-function$ aws s3 cp my-function.zip s3://my-bucket - upload: my-function.zip to s3://my-bucket/my-function - ~/my-function$ aws lambda update-function-code --function-name my-function \ +aws s3 cp my-function.zip s3://my-bucket +``` + +You should see the following output: + +``` +upload: my-function.zip to s3://my-bucket/my-function +``` + +``` +aws lambda update-function-code --function-name my-function \ --s3-bucket my-bucket --s3-key my-function.zip +``` + +You should see the following output: + +``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -299,8 +313,8 @@ aws cloudformation deploy --template-file out.yml --stack-name java-basic --capa For a complete working example, see the following sample applications: **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 453a9d39..3dc7ed56 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -3,19 +3,19 @@ The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. -[https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) +[https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 6ed9517a..dd48f6e2 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -73,7 +75,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -83,7 +85,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -97,7 +99,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -114,7 +116,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: @@ -138,18 +140,18 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application\. ## Tracing in sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md index 096de4b5..fe678e3a 100644 --- a/doc_source/kafka-hosting.md +++ b/doc_source/kafka-hosting.md @@ -10,7 +10,7 @@ To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud pro When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. +For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. ## Using Amazon MSK @@ -26,4 +26,4 @@ For more information about using an MSK cluster, see [Using Lambda with Amazon M You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file +For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md index df8fc0ed..11235148 100644 --- a/doc_source/kafka-smaa.md +++ b/doc_source/kafka-smaa.md @@ -1,9 +1,9 @@ -# Using Lambda with self\-managed Apache Kafka +# Using Lambda with Self\-managed Apache Kafka You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. **Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md) ++ [Adding a Self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 61272809..6a02ca8c 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -1,7 +1,5 @@ # Using an Apache Kafka cluster as an event source for Lambda - - You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. This page describes how to use your Kafka cluster as an event source for your Lambda function\. @@ -12,8 +10,6 @@ This page describes how to use your Kafka cluster as an event source for your La ## How it works - - When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. + If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. + If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. @@ -21,7 +17,7 @@ When you add your Apache Kafka cluster as a trigger for your Lambda function, th + Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +For Amazon MSK and Self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. ## Event source API operations diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 3805a252..93ea4ae9 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -82,8 +82,6 @@ When making Lambda API calls, users can specify a version or alias by passing a You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. - - ### Best practices for using Deny statements with functions The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. @@ -194,7 +192,7 @@ Actions that operate on a function can be restricted to a specific function by f | --- | --- | --- | | [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` | | [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | None | -| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | +| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | | [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListAliases](API_ListAliases.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | None | | [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) [ListTags](API_ListTags.md) [TagResource](API_TagResource.md) [UntagResource](API_UntagResource.md) | `*` | None | diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index d033617b..407b533d 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -28,8 +28,8 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. +[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** + [AWS Lambda function handler in C\#](csharp-handler.md) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 4ed714e7..319081ad 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -9,14 +9,21 @@ The following sections explain how common programming patterns and core concepts | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | -AWS Lambda provides the following libraries for Go: -+ **github\.com/aws/aws\-lambda\-go/lambda**: The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ **github\.com/aws/aws\-lambda\-go/lambdacontext**: Helpers for accessing execution context information from the [context object](golang-context.md)\. -+ **github\.com/aws/aws\-lambda\-go/events**: This library provides type definitions for common event source integrations\. - -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. +Lambda provides the following tools and libraries for the Go runtime: + +**Tools and libraries for Go** ++ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. ++ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. ++ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. + +For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. + +Lambda provides the following sample applications for the Go runtime: + +**Sample Lambda applications in Go** ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. **Topics** + [AWS Lambda function handler in Go](golang-handler.md) diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md index 58a0fa17..186814f5 100644 --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-images.md @@ -1,6 +1,6 @@ # Using container images with Lambda -You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to a container registry such as Amazon Elastic Container Registry \(Amazon ECR\)\. +You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. AWS provides a set of open\-source base images that you can use to build the container image for your function code\. You can also use alternative base images from other container registries\. AWS also provides an open\-source runtime client that you add to your alternative base image to make it compatible with the Lambda service\. @@ -8,8 +8,6 @@ Additionally, AWS provides a runtime interface emulator for you to test your fun There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. -**Note**: Using the container image currently only support for the image from Amazon ECR in the same AWS account. - **Topics** + [Creating Lambda container images](images-create.md) -+ [Testing Lambda container images locally](images-test.md) ++ [Testing Lambda container images locally](images-test.md) \ No newline at end of file diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index a1a5cef1..2213e8af 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -50,7 +50,12 @@ For detailed instructions, see [Creating a role for an AWS service \(console\)]( To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json +``` + +You should see the following output: + +``` { "Role": { "Path": "/", @@ -96,13 +101,13 @@ The `trust-policy.json` file is a JSON file in the current directory that define You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. ``` -$ aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` -$ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` ## AWS managed policies for Lambda features @@ -127,7 +132,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index fd9d2667..b843a7f6 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -68,7 +68,7 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti **Topics** + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md index 0cb6ab64..fbeb3491 100644 --- a/doc_source/lambda-kafka.md +++ b/doc_source/lambda-kafka.md @@ -10,4 +10,4 @@ This section describes how to use an AWS or non\-AWS hosted Kafka cluster with L + [Hosting an Apache Kafka cluster](kafka-hosting.md) + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) + [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file ++ [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index f5e0333c..c25149b1 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -1,25 +1,8 @@ # Monitoring and troubleshooting Lambda applications -Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. Lambda also publishes the associated CloudWatch metrics\. You can leverage these metrics to set CloudWatch custom alarms\. +AWS Lambda integrates with other AWS services to help you monitor and troubleshoot your Lambda functions\. Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. -The Lambda console provides a built\-in [monitoring dashboard](monitoring-functions-access-metrics.md) for each of your functions and applications\. - -**To monitor a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Monitoring**\. - -**Pricing** -CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. - -Each time your function is invoked, Lambda records [metrics](monitoring-metrics.md) for the request, the function's response, and the overall state of the function\. You can use metrics to set alarms that are triggered when function performance degrades, or when you are close to hitting concurrency limits in the current AWS Region\. - -To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. You can [view logs](monitoring-cloudwatchlogs.md) in the CloudWatch Logs console, in the Lambda console, or from the command line\. - -In addition to monitoring logs and metrics in CloudWatch, you can use AWS X\-Ray to trace and debug requests served by your application\. For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. +You can use other AWS services to troubleshoot your Lambda functions\. This section describes how to use these AWS services to monitor, trace, debug, and troubleshoot your Lambda functions and applications\. **Topics** + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index b99c110a..66466169 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,8 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -37,7 +38,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Configure the following settings: + **Name** – **my\-function**\. - + **Runtime** – **Node\.js 12\.x**\. + + **Runtime** – **Node\.js 14\.x**\. + **Role** – **Choose an existing role**\. + **Existing role** – **lambda\-role**\. @@ -62,12 +63,12 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. +[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. +[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. +[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. +[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. +[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](nodejs-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 800a57a1..7f3c461d 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -18,6 +18,6 @@ For more information about IAM, see [What is IAM?](https://docs.aws.amazon.com/I **Topics** + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource\-based policies for AWS Lambda](access-control-resource-based.md) -+ [Identity\-based IAM policies for AWS Lambda](access-control-identity-based.md) ++ [Identity\-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) \ No newline at end of file diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index a2b7f8bd..21bc2a35 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -10,9 +10,10 @@ The following sections explain how common programming patterns and core concepts | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. +Lambda provides the following sample applications for the PowerShell runtime: + +**Sample Lambda applications in PowerShell** ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 8fb03ceb..87978144 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -9,10 +9,10 @@ Lambda supports the following Python runtimes\. | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -64,7 +64,7 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 55ce258e..a9f5e883 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index ba58d856..4375f047 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -16,8 +16,6 @@ In a rolling deployment, AWS SAM performs these tasks: + It detects when you create a new version of your Lambda function\. + It triggers CodeDeploy to start the deployment of the new version\. - - ## Example AWS SAM Lambda template The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 4d67d391..ce4963c7 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -62,7 +62,8 @@ Each time you save your function code, the Lambda console creates a deployment p **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. +[Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](ruby-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 277d0492..93d6a5b7 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -1,6 +1,6 @@ # Lambda runtimes -Lambda supports multiple languages through the use of runtimes\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. +Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-console.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. @@ -21,18 +21,19 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | AWS SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 12 | `nodejs12.x` | 2\.771\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.771\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.15\.16 botocore\-1\.18\.16 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | **Ruby runtimes** diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index aa51f020..e7a4582c 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -6,53 +6,58 @@ The GitHub repository for this guide includes sample applications that demonstra #### [ Node\.js ] **Sample Lambda applications in Node\.js** -+ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -+ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -+ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -+ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ++ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. ++ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. ++ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. ++ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. ++ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. ------ #### [ Python ] **Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ------ #### [ Ruby ] **Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. ------ #### [ Java ] **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ #### [ Go ] +Lambda provides the following sample applications for the Go runtime: + **Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ++ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. ------ #### [ C\# ] **Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. ------ #### [ PowerShell ] +Lambda provides the following sample applications for the PowerShell runtime: + **Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md index ddfc4a94..738703b2 100644 --- a/doc_source/lambda-security.md +++ b/doc_source/lambda-security.md @@ -10,7 +10,7 @@ This documentation helps you understand how to apply the shared responsibility m **Topics** + [Data protection in AWS Lambda](security-dataprotection.md) -+ [Identity and access management for AWS Lambda](security-iam.md) ++ [Identity and access management for Lambda](security-iam.md) + [Compliance validation for AWS Lambda](security-compliance.md) + [Resilience in AWS Lambda](security-resilience.md) + [Infrastructure security in AWS Lambda](security-infrastructure.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 960d08e1..d8cfce11 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [Self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 45a82007..b17ff9c9 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -2,13 +2,29 @@ AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. -You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. To learn more about log groups and accessing them through the CloudWatch console, see the [Monitoring system, application, and custom log files](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html) in the *Amazon CloudWatch User Guide*\. +You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. -You can view logs for Lambda by using the Lambda console, the CloudWatch console, the AWS CLI, or the CloudWatch API\. The following procedure show you how to view the logs by using the Lambda console\. +You can view logs for Lambda functions using the Lambda console, the CloudWatch console, the AWS Command Line Interface \(AWS CLI\), or the CloudWatch API\. This page describes how to view logs using the Lambda console\. + +**Topics** ++ [Prerequisites](#monitoring-cloudwatchlogs-prereqs) ++ [Pricing](#monitoring-cloudwatchlogs-pricing) ++ [Using the Lambda console](#monitoring-cloudwatchlogs-console) ++ [Using the AWS CLI](#monitoring-cloudwatchlogs-cli) ++ [What's next?](#monitoring-cloudwatchlogs-next-up) + +## Prerequisites + +Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using an AWS managed policy provided by Lambda\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. + +## Pricing -**Note** There is no additional charge for using Lambda logs; however, standard CloudWatch Logs charges apply\. For more information, see [CloudWatch pricing\.](https://aws.amazon.com/cloudwatch/pricing/) +## Using the Lambda console + +The following section describes how to view logs for your function on the Lambda console\. + **To view logs using the Lambda console** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -22,4 +38,19 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc 1. Choose **View logs in CloudWatch**\. -Lambda uses your function's permissions to upload logs to CloudWatch Logs\. If you don't see logs in the console, check your [execution role permissions](lambda-intro-execution-role.md)\. \ No newline at end of file +**Note** +Logs may not be immediately available after invocation\. We recommend waiting 5 to 10 minutes before checking your execution role\. + +## Using the AWS CLI + +To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. For language\-specific instructions, see the following topics: ++ [AWS Lambda function logging in Node\.js](nodejs-logging.md) ++ [AWS Lambda function logging in Python](python-logging.md) ++ [AWS Lambda function logging in Ruby](ruby-logging.md) ++ [AWS Lambda function logging in Java](java-logging.md) ++ [AWS Lambda function logging in Go](golang-logging.md) ++ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [AWS Lambda function logging in PowerShell](powershell-logging.md) + +## What's next? ++ Learn more about log groups and accessing them through the CloudWatch console in [Monitoring system, application, and custom log files](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 837f8544..5d586b61 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -1,15 +1,28 @@ # Monitoring functions in the AWS Lambda console -AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The metrics include total requests, duration, and error rates\. The Lambda console creates graphs for these metrics and shows them on the **Monitoring** page for each function\. +AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. -**To access the monitoring console** +This page describes the basics of using the Lambda console to view function metrics, including total requests, duration, and error rates\. + +## Pricing + +CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. + +## Using the Lambda console + +You can use the Lambda console's monitoring dashboard to monitor your Lambda functions and applications\. + +**To monitor a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **Monitoring**\. -![\[Graphs of various CloudWatch metrics.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) +1. Choose a function\. + +1. Choose **Monitoring**\. + +## Types of monitoring graphs -The console provides the following graphs\. +The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** + **Invocations** – The number of times that the function was invoked in each 5\-minute period\. @@ -20,10 +33,48 @@ The console provides the following graphs\. + **Async delivery failures** – The number of errors that occurred when Lambda attempted to write to a destination or dead\-letter queue\. + **Concurrent executions** – The number of function instances that are processing events\. -To see the definition of a graph in CloudWatch, choose **View in metrics** from the menu in the top right of the graph\. For more information about the metrics that Lambda records, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +## Viewing graphs on the Lambda console + +The following section describes how to view CloudWatch monitoring graphs on the Lambda console, and open the CloudWatch metrics dashboard\. + +**To view monitoring graphs for a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. To see the definition of a graph in CloudWatch, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard in CloudWatch\. + +![\[An example monitoring definition on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-definition.png) + +## Viewing queries in the CloudWatch Logs console + +The following section describes how to view and add reports from CloudWatch Logs Insights to a custom dashboard on the CloudWatch Logs console\. + +**To view reports for a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose **View logs in CloudWatch**\. + +1. Choose **View in Logs Insights**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. Choose **Run query**\. -The console also shows reports from CloudWatch Logs Insights that are compiled from information in your function's logs\. You can add these reports to a custom dashboard in the CloudWatch Logs console\. Use the queries as a starting point for your own reports\. +1. \(Optional\) Choose **Save**\. -![\[AWS CloudWatch Logs Insights reports\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) +![\[The AWS CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) -To view a query, choose **View in CloudWatch Logs Insights** from the menu in the top right of the report\. \ No newline at end of file +## What's next? ++ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. ++ Learn how to use Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index ef5bd61f..69a62cef 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -1,17 +1,17 @@ # Using Lambda Insights in Amazon CloudWatch -Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. +Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. This page describes how to enable and use Lambda Insights to diagnose issues with your Lambda functions\. **Topics** + [How Lambda Insights monitors serverless applications](#monitoring-insights-how) + [Pricing](#monitoring-insights-pricing) + [Supported runtimes](#monitoring-insights-runtimes) -+ [Region availability](#monitoring-insights-regions) + [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling-console) + [Enabling Lambda Insights programmatically](#monitoring-insights-enabling-programmatically) + [Using the Lambda Insights dashboard](#monitoring-insights-multifunction) + [Example workflow to detect function anomalies](#monitoring-insights-anomalies) + [Example workflow using queries to troubleshoot a function](#monitoring-insights-queries) ++ [What's next?](#monitoring-console-next-up) ## How Lambda Insights monitors serverless applications @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see�[Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes @@ -40,29 +40,9 @@ You can use Lambda Insights with any of the following [Lambda function runtimes] + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) -## Region availability - -Lambda Insights is currently available in the following AWS Regions: -+ US East \(N\. Virginia\) -+ US East \(Ohio\) -+ US West \(N\. California\) -+ US West \(Oregon\) -+ Asia Pacific \(Mumbai\) -+ Asia Pacific \(Seoul\) -+ Asia Pacific \(Singapore\) -+ Asia Pacific \(Sydney\) -+ Asia Pacific \(Tokyo\) -+ Canada \(Central\) -+ Europe \(Frankfurt\) -+ Europe \(Ireland\) -+ Europe \(London\) -+ Europe \(Paris\) -+ Europe \(Stockholm\) -+ South America \(São Paulo\) - ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -80,7 +60,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. @@ -161,4 +141,8 @@ You can use the single\-function view on the Lambda Insights dashboard to identi An autogenerated query for your function opens in the **Logs Insights** dashboard\. 1. Choose **Run query** to generate a **Logs** message for the invocation request\. -![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) \ No newline at end of file +![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) + +## What's next? ++ Learn how to create a CloudWatch Logs dashboard in [Create a Dashboard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create_dashboard.html) in the *Amazon CloudWatch User Guide*\. ++ Learn how to add queries to a CloudWatch Logs dashboard in [Add Query to Dashboard or Export Query Results](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ExportQueryResults.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index e43e10e2..97d9062c 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,10 +1,20 @@ # Working with AWS Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Use dimensions to filter and sort function metrics by function name, alias, or version\. +When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. + +This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. + +**Topics** ++ [Viewing metrics in the CloudWatch console](#monitoring-metrics-console) ++ [Types of metrics](#monitoring-metrics-types) + +## Viewing metrics in the CloudWatch console + +You can use the CloudWatch console to filter and sort function metrics by function name, alias, or version\. **To view metrics in the CloudWatch console** -1. Open the [Amazon CloudWatch console Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\)\. +1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) on the CloudWatch console\. 1. Choose a dimension\. + **By Function Name** \(`FunctionName`\) – View aggregate metrics for all versions and aliases of a function\. @@ -21,12 +31,11 @@ The timestamp on a metric reflects when the function was invoked\. Depending on For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. -**Topics** -+ [Using invocation metrics](#monitoring-metrics-invocation) -+ [Using performance metrics](#monitoring-metrics-performance) -+ [Using concurrency metrics](#monitoring-metrics-concurrency) +## Types of metrics + +The following section describes the type of metrics available on the CloudWatch console\. -## Using invocation metrics +### Using invocation metrics Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of one minute\. @@ -41,17 +50,18 @@ You should view the following metrics with the `Sum` statistic\. + `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. -## Using performance metrics +### Using performance metrics Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Max` statistic\. **Performance metrics** -+ `Duration` – The amount of time that your function code spends processing an event\. For the first event processed by an instance of your function, this includes [initialization time](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. ++ `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. ++ `PostRuntimeExecutionDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. -## Using concurrency metrics +### Using concurrency metrics Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 4cccd0d9..4dbaf14d 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -1,34 +1,117 @@ # AWS Lambda function errors in Node\.js -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Node\.js runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#nodejs-exceptions-syntax) ++ [How it works](#nodejs-exceptions-how) ++ [Using the Lambda console](#nodejs-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-exceptions-cli) ++ [Error handling in other AWS services](#nodejs-exceptions-other-services) ++ [What's next?](#python-exceptions-next-up) + +## Syntax **Example index\.js file – Reference error** ``` exports.handler = async function() { - return x + 10 -} + return x + 10 + } ``` This code results in a reference error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. ``` { - "errorType": "ReferenceError", - "errorMessage": "x is not defined", - "trace": [ - "ReferenceError: x is not defined", - " at Runtime.exports.handler (/var/task/index.js:2:3)", - " at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)", - " at process._tickCallback (internal/process/next_tick.js:68:7)" - ] -} + "errorType": "ReferenceError", + "errorMessage": "x is not defined", + "trace": [ + "ReferenceError: x is not defined", + " at Runtime.exports.handler (/var/task/index.js:2:3)", + " at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)", + " at process._tickCallback (internal/process/next_tick.js:68:7)" + ] + } +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -36,27 +119,31 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorType":"ReferenceError","errorMessage":"x is not defined","trace":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. - -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +You should see the invocation response in your command prompt\. ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Version: $LATEST -2019-06-05T22:11:27.082Z 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 ERROR Invoke Error {"errorType":"ReferenceError","errorMessage":"x is not defined","stack":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} -END RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 -REPORT RequestId: 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 Duration: 76.85 ms Billed Duration: 77 ms Memory Size: 128 MB Max Memory Used: 74 MB +{"errorType":"ReferenceError","errorMessage":"x is not defined","trace":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} ``` -For more information about logs, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md)\. -Depending on the event source, AWS Lambda might retry the failed Lambda function\. For example, if Kinesis is the event source, AWS Lambda retries the failed invocation until the Lambda function succeeds or the records in the stream expire\. For more information on retries, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Node\.js](nodejs-logging.md) page\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index adeb8c95..24c8bd92 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler module, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` module that's exported by `index.js`\. +When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 19c63b99..98044798 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -15,6 +15,7 @@ AWS provides the following base images for Node\.js: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | +| 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | | 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 62a40104..5f73c122 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -1,8 +1,19 @@ # AWS Lambda function logging in Node\.js -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#node-logging-output) ++ [Using the Lambda console](#nodejs-logging-console) ++ [Using the CloudWatch console](#nodejs-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-logging-cli) ++ [Deleting logs](#nodejs-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example index\.js file – Logging** @@ -54,31 +65,43 @@ The Node\.js runtime logs the `START`, `END`, and `REPORT` lines for each invoca You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. -**Topics** -+ [Viewing logs in the AWS Management Console](#nodejs-logging-console) -+ [Using the AWS CLI](#nodejs-logging-cli) -+ [Deleting logs](#nodejs-logging-delete) +## Using the Lambda console -## Viewing logs in the AWS Management Console +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +## Using the CloudWatch console -**To view your Lambda function's logs** +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +**To view logs on the CloudWatch console** -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the first stream in the list\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +1. Choose a log stream\. -## Using the AWS CLI +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -86,23 +109,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -112,10 +138,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index b15ec6d0..f349ad9d 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -1,18 +1,25 @@ # Deploy Node\.js Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -**Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** ++ [Prerequisites](#node-package-prereqs) + [Updating a function with no dependencies](#nodejs-package-codeonly) + [Updating a function with additional dependencies](#nodejs-package-dependencies) +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + ## Updating a function with no dependencies To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. @@ -22,13 +29,18 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U 1. Create a \.zip file archive\. ``` - ~/my-function$ zip function.zip index.js + zip function.zip index.js ``` 1. To upload the package, use the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", @@ -47,18 +59,26 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. +If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. +If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + +For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + +As an alternative, you can create the deployment package using an Amazon EC2 instance that provides an Amazon Linux environment\. For instructions, see [Using Packages and Native nodejs Modules in AWS](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) in the AWS compute blog\. + **To update a Node\.js function with dependencies** 1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function>`\. + 1. Install libraries in the node\_modules directory using the `npm install` command\. ``` - ~/my-function$ npm install aws-xray-sdk + npm install aws-xray-sdk ``` This creates a folder structure that's similar to the following: @@ -75,16 +95,21 @@ You can add the SDK for JavaScript to the deployment package if you need a newer ├── aws-xray-sdk-core ``` -1. Create a \.zip file that contains the contents of your project folder\. +1. Create a \.zip file that contains the contents of your project folder\. Use the `r` \(recursive\) option to ensure that zip compresses the subfolders\. ``` - ~/my-function$ zip -r function.zip . + zip -r function.zip . ``` 1. Upload the package using the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -101,6 +126,4 @@ You can add the SDK for JavaScript to the deployment package if you need a newer } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see the following on the AWS Compute Blog: -+ [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) -+ [Using Packages and Native nodejs Modules in AWS Lambda](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) \ No newline at end of file +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 68794a93..44827ac0 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -44,7 +46,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/package.json)** ``` { @@ -66,7 +68,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -107,7 +109,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -117,7 +119,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -131,7 +133,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -148,7 +150,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: @@ -172,4 +174,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 1e1f8142..9b9c131d 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -1,6 +1,18 @@ # AWS Lambda function errors in PowerShell -If your Lambda function has a terminating error, AWS Lambda recognizes the failure, serializes the error information into JSON, and returns it\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#powershell-exceptions-syntax) ++ [How it works](#powershell-exceptions-how) ++ [Using the Lambda console](#powershell-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-exceptions-cli) ++ [Error handling in other AWS services](#powershell-exceptions-other-services) ++ [What's next?](#powershell-exceptions-next-up) + +## Syntax Consider the following PowerShell script example statement: @@ -47,4 +59,111 @@ The error is serialized like this: "errorMessage": "AccountNotFound", "errorType": "AccountNotFound" } -``` \ No newline at end of file +``` + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: + +``` +{ + "StatusCode": 200, + "FunctionError": "Unhandled", + "ExecutedVersion": "$LATEST" +} +``` + +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: + +``` +cat output.txt +``` + +You should see the invocation response in your command prompt\. + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in PowerShell](powershell-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in PowerShell](powershell-logging.md) page\. \ No newline at end of file diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 1be2191b..4c265319 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -1,10 +1,21 @@ # AWS Lambda function logging in PowerShell -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Topics** ++ [Creating a function that returns logs](#powershell-logging-output) ++ [Using the Lambda console](#powershell-logging-console) ++ [Using the CloudWatch console](#powershell-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-logging-cli) ++ [Deleting logs](#powershell-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. + +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} @@ -64,33 +75,43 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#powershell-logging-console) -+ [Using the AWS CLI](#powershell-logging-cli) -+ [Deleting logs](#powershell-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -98,23 +119,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -124,10 +148,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md index bd736767..09fdac4c 100644 --- a/doc_source/powershell-package.md +++ b/doc_source/powershell-package.md @@ -1,8 +1,14 @@ # Deploy PowerShell Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +A deployment package for the PowerShell runtime contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. -A \.zip file archive is a PowerShell Lambda deployment package that contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. +## Tools and libraries + +Lambda provides the following sample applications for the PowerShell runtime: + +**Tools and libraries for PowerShell** ++ [AWS Lambda and AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-lambda.html): the steps to install PowerShell, the \.NET Core 2\.1 SDK, and the `AWSLambdaPSCore` module\. ++ [aws\-lambda\-dotnet](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell): Lambda tools for Powershell on GitHub\. The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions: @@ -12,6 +18,15 @@ The AWSLambdaPSCore module has the following new cmdlets to help author and publ + **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. + **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. +## Sample applications + +Lambda provides the following sample applications for the PowerShell runtime: + +**Sample Lambda applications in PowerShell** ++ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. + +## Creating the Lambda function + To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. To create a new PowerShell script, upload it, and test it, do the following: diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 652e7e8f..b0770e46 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,6 +1,6 @@ # AWS Lambda context object in Python -When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. +When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [AWS Lambda function handler in Python](python-handler.md)\. **Context methods** + `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index c8d129a4..a4f8a519 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,30 +1,93 @@ # AWS Lambda function errors in Python -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. -**Example lambda\_function\.py file – Exception** +This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [How it works](#python-exceptions-how) ++ [Using the Lambda console](#python-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#python-exceptions-cli) ++ [Error handling in other AWS services](#python-exceptions-other-services) ++ [Error examples](#python-exceptions-examples) ++ [Sample applications](#python-exceptions-samples) ++ [What's next?](#python-exceptions-next-up) + +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] ``` -def lambda_handler(event, context): - return x + 10 +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -This code results in a name error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. +------ +#### [ Windows OS ] ``` -{ - "errorMessage": "name 'x' is not defined", - "errorType": "NameError", - "stackTrace": [ - " File \"/var/task/error_function.py\", line 2, in lambda_handler\n return x + 10\n" - ] -} +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -32,25 +95,77 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorMessage": "name 'x' is not defined", "errorType": "NameError", "stackTrace": [" File \"/var/task/error_function.py\", line 2, in lambda_handler\n return x + 10\n"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. +You should see the invocation response in your command prompt\. -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +``` +{"errorMessage": "'action'", "errorType": "KeyError", "stackTrace": [" File \"/var/task/lambda_function.py\", line 36, in lambda_handler\n result = ACTIONS[event['action']](event['number'])\n"]} +``` + +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Python](python-logging.md)\. + +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Python code in AWS Lambda](python-tracing.md)\. + +## Error examples + +The following section shows common errors you may receive when creating, updating, or invoking your function using the Python [Lambda runtimes](lambda-runtimes.md)\. + +**Example Runtime exception – ImportError** ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Version: $LATEST -     return x + 10/lambda_function.py", line 2, in lambda_handler -END RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 -REPORT RequestId: fc4f8810-88ff-4800-974c-12cec018a4b9 Duration: 12.33 ms Billed Duration: 13 ms Memory Size: 128 MB Max Memory Used: 56 MB +{ + "errorMessage": "Unable to import module 'lambda_function': Cannot import name '_imaging' from 'PIL' (/var/task/PIL/__init__.py)", + "errorType": "Runtime.ImportModuleError" +} ``` -For more information about logs, see [AWS Lambda function logging in Python](python-logging.md)\. \ No newline at end of file +This error is a result of using the AWS Command Line Interface \(AWS CLI\) to upload a deployment package that contains a C or C\+\+ library\. For example, the [Pillow \(PIL\)](https://pypi.org/project/Pillow/), [numpy](https://pypi.org/project/numpy/), or [pandas](https://pypi.org/project/pandas/) library\. + +We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create your deployment package\. Using the AWS SAM CLI with this option creates a Docker container with a Lambda\-like environment that is compatible with Lambda\. + +**Example JSON serialization error – Runtime\.MarshalError** + +``` +{ + "errorMessage": "Unable to marshal response: Object of type AttributeError is not JSON serializable", + "errorType": "Runtime.MarshalError" +} +``` + +This error can be the result of the base64\-encoding mechanism you are using in your function code\. For example: + +``` +import base64 +encrypted_data = base64.b64encode(payload_enc).decode("utf-8") +``` + +This error can also be the result of not specifying your \.zip file as a binary file when you created or updated your function\. We recommend using the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) command option to upload your deployment package \(\.zip file\)\. + +``` +aws lambda create-function --function-name my-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex +``` + +## Sample applications + +The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. + +**Sample Lambda applications in Python** ++ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. + +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Python](python-logging.md) page\. \ No newline at end of file diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 20ffb7da..d4e4c1d3 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -108,7 +108,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-image.md b/doc_source/python-image.md index de094d08..0f5b3e34 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -16,7 +16,7 @@ AWS provides the following base images for Python: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | | 3, 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | -| 3\.7 | Python 3\.7 | Amazon Linux 2 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | +| 3\.7 | Python 3\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | | 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | @@ -34,4 +34,35 @@ pip install awslambdaric For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. -You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. \ No newline at end of file +You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. + +## Deploying Python with an AWS base image + +When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. + +**To build and deploy a Python function with the `python:3.8` base image\.** + +1. On your local machine, create a project directory for your new function\. + +1. In your project directory, add a file named `app.py` containing your function code\. The following example shows a simple Python handler\. + + ``` + import sys + def handler(event, context): + return 'Hello from AWS Lambda using Python' + sys.version + '!' + ``` + +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + COPY app.py ./ + CMD ["app.handler"] + ``` + +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-1.title)\. + +## Create a Python image from an alternative base image + +For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index ecca9be3..3211a16b 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,8 +1,20 @@ # AWS Lambda function logging in Python -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use [the `print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#python-logging-output) ++ [Using the Lambda console](#python-logging-console) ++ [Using the CloudWatch console](#python-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#python-logging-cli) ++ [Deleting logs](#python-logging-delete) ++ [Logging library](#python-logging-lib) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.py** @@ -42,34 +54,43 @@ The Python runtime logs the `START`, `END`, and `REPORT` lines for each invocati + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#python-logging-console) -+ [Using the AWS CLI](#python-logging-cli) -+ [Deleting logs](#python-logging-delete) -+ [Logging library](#python-logging-lib) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. + +## Using the CloudWatch console + +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -## Viewing logs in the AWS Management Console +**To view logs on the CloudWatch console** -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -**To view your Lambda function's logs** +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Choose a log stream\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -1. Choose the first stream in the list\. +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +## Using the AWS Command Line Interface \(AWS CLI\) -## Using the AWS CLI +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -77,23 +98,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -103,10 +127,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/python-package.md b/doc_source/python-package.md index f3aa695c..ceeba98a 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,53 +1,49 @@ # Deploy Python Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -You can also use the AWS Serverless Application Model \(AWS SAM\) CLI `build` command to create a deployment package for your Python function code and dependencies\. The AWS SAM CLI also provides an option to build your deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. - -**Note** -We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** + [Prerequisites](#python-package-prereqs) + [Updating a function with no dependencies](#python-package-codeonly) + [Updating a function with additional dependencies](#python-package-dependencies) -+ [With a virtual environment](#python-package-venv) ++ [Using a virtual environment](#python-package-venv) ## Prerequisites -These instructions assume that you have already created a Lambda function and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: - -``` -~/lambda-project$ this is a command -this is output -``` +The following steps assume that you have created a Lambda function, and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) ## Updating a function with no dependencies -To create or update a function with the Lambda API, create a deployment package that contains your function code and upload it with the AWS Command Line Interface \(AWS CLI\)\. +The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. **To update a Python function with no dependencies** 1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip my-deployment-package.zip lambda_function.py + zip my-deployment-package.zip lambda_function.py + ``` + +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -62,38 +58,54 @@ To create or update a function with the Lambda API, create a deployment package } ``` -**Note** -In order for your Python modules can be imported at runtime, ensure the files in the zip produced are globally readable (o+r) and any directories are globally readable (o+x). +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. ## Updating a function with additional dependencies -If your Lambda function depends on libraries other than the AWS SDK for Python \(Boto3\), install them to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package\. +If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. + +**Note** +Make sure that the files and directories in the deployment package have their permissions set to be globally readable, so that Lambda can import your Python modules at runtime\. -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with dependencies** 1. Install libraries in a `package` directory with `pip`'s `--target` option\. ``` - ~/my-function$ pip install --target ./package requests + pip install --target ./package requests ``` **Note** To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. +1. Navigate to the `package` directory\. + + ``` + cd package + ``` + 1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ zip -r my-deployment-package.zip ./package/ + zip -r ../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. + +1. Navigate back to the `my-function` directory\. + + ``` + cd.. ``` 1. Add function code files to the root of your deployment package\. ``` - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + zip -g my-deployment-package.zip lambda_function.py ``` After you complete this step, you should have the following directory structure: @@ -109,10 +121,15 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + ``` + + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -127,55 +144,61 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa } ``` -## With a virtual environment +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. -In some cases, you may need to use a [virtual environment](https://virtualenv.pypa.io/en/latest) to install dependencies for your function\. This can occur if your function or its dependencies have dependencies on native libraries, or if you used Homebrew to install Python\. +## Using a virtual environment -The following example shows how to create a deployment package that contains the [requests](https://pypi.org/project/requests/) library and upload it to Lambda using the AWS CLI\. +If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are using the [virtualenv](https://docs.python.org/3/library/venv.html) module for a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with a virtual environment** 1. Create a virtual environment\. ``` - ~/my-function$ virtualenv myvenv + virtualenv myvenv ``` +**Note** +The [virtualenv](https://docs.python.org/3/library/venv.html) module uses Python 2\.7 by default\. You may need to add a local export path to your command line profile, such as `export VIRTUALENV_PYTHON=/usr/bin/python3.8` when using the *virtualenv* module with Python 3 and pip 3\. 1. Activate the environment\. ``` - ~/my-function$ source myvenv/bin/activate + source myvenv/bin/activate ``` 1. Install libraries with pip\. ``` - (myvenv) ~/my-function$ pip install requests + pip install requests ``` 1. Deactivate the virtual environment\. ``` - (myvenv) ~/my-function$ deactivate + deactivate ``` -1. Create a deployment package with the installed libraries at the root\. +1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r my-deployment-package.zip . + cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . ``` -**Note** + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. 1. Add function code files to the root of your deployment package\. ``` - ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + cd ../../../../ + zip -g my-deployment-package.zip lambda_function.py ``` After you complete this step, you should have the following directory structure: @@ -191,10 +214,15 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ... ``` -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file deployment package to Lambda and update the function code\. +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + ``` + + You should see the following output: ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", @@ -208,3 +236,5 @@ A library may appear in `site-packages` or `dist-packages` and the first folder ... } ``` + +The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index e9f25cda..35b517d7 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -40,7 +42,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -85,7 +87,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -95,7 +97,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -109,7 +111,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -126,7 +128,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: @@ -150,4 +152,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 1111c347..be98e869 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -1,6 +1,19 @@ # AWS Lambda function errors in Ruby -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. +You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. + +This page describes how to view Lambda function invocation errors for the Ruby runtime using the Lambda console and the AWS CLI\. + +**Topics** ++ [Syntax](#ruby-exceptions-syntax) ++ [How it works](#ruby-exceptions-how) ++ [Using the Lambda console](#ruby-exceptions-console) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-exceptions-cli) ++ [Error handling in other AWS services](#ruby-exceptions-other-services) ++ [Sample applications](#ruby-exceptions-samples) ++ [What's next?](#ruby-exceptions-next-up) + +## Syntax **Example function\.rb** @@ -25,10 +38,81 @@ This code results in a type error\. Lambda catches the error and generates a JSO } ``` -When you invoke the function from the command line, the AWS CLI splits the response into two documents\. To indicate that a function error occurred, the response displayed in the terminal includes a `FunctionError` field\. The response or error returned by the function is written to the output file\. +## How it works + +When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. + +If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. + +If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. + +The following list describes the range of status codes you can receive from Lambda\. + +**`2xx`** +A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. + +**`4xx`** +A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. + +**`5xx`** +A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. + +For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. + +## Using the Lambda console + +You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. + +**To invoke a function on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) + +1. Choose an **Event template** from the dropdown list\. + +1. Enter a name for the test event\. + +1. Enter the JSON for the test event\. + +1. Choose **Create**\. + +1. Choose **Test**\. + +The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. + +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. + +The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. + +------ +#### [ mac OS/Linux OS ] + +``` +aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ +#### [ Windows OS ] + +``` +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +``` + +------ + +You should see the AWS CLI response in your command prompt: ``` -$ aws lambda invoke --function-name my-function out.json { "StatusCode": 200, "FunctionError": "Unhandled", @@ -36,36 +120,37 @@ $ aws lambda invoke --function-name my-function out.json } ``` -View the output file to see the error document\. +You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: ``` -$ cat out.json -{"errorMessage":"no implicit conversion of String into Integer","errorType":"Function","stackTrace":["/var/task/function.rb:3:in `first'","/var/task/function.rb:3:in `handler'"]} +cat output.txt ``` -**Note** -The 200 \(success\) status code in the response from Lambda indicates that there wasn't an error with the request that you sent to Lambda\. For issues that result in an error status code, see [Errors](API_Invoke.md#API_Invoke_Errors)\. - -Lambda also records up to 256 KB of the error object in the function's logs\. To view logs when you invoke the function from the command line, use the `--log-type` option and decode the base64 string in the response\. +You should see the invocation response in your command prompt\. ``` -$ aws lambda invoke --function-name my-function out.json --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Version: $LATEST -Processing event... -Error raised from handler method -{ - "errorMessage": "no implicit conversion of String into Integer", - "errorType": "Function", - "stackTrace": [ - "/var/task/function.rb:3:in `first'", - "/var/task/function.rb:3:in `handler'" - ] -} -END RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 -REPORT RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Duration: 22.74 ms Billed Duration: 23 ms Memory Size: 128 MB Max Memory Used: 18 MB +{"errorMessage":"no implicit conversion of String into Integer","errorType":"Function","stackTrace":["/var/task/function.rb:3:in `first'","/var/task/function.rb:3:in `handler'"]} ``` -For more information about logs, see [AWS Lambda function logging in Ruby](ruby-logging.md)\. +## Error handling in other AWS services + +When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. + +For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. + +We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) + +For more information, see [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md)\. + +## Sample applications + +The following sample code is available for the Ruby runtime\. + +**Sample Lambda applications in Ruby** ++ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. ++ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. -Depending on the event source, AWS Lambda might retry the failed Lambda function\. For example, if Kinesis is the event source, AWS Lambda retries the failed invocation until the Lambda function succeeds or the records in the stream expire\. For more information on retries, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file +## What's next? ++ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Ruby](ruby-logging.md) page\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 46da0ba2..1eb563fa 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -1,8 +1,19 @@ # AWS Lambda function logging in Ruby -Your Lambda function comes with a CloudWatch Logs log group, with a log stream for each instance of your function\. The runtime sends details about each invocation to the log stream, and relays logs and other output from your function's code\. +AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. -To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. +This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. + +**Topics** ++ [Creating a function that returns logs](#ruby-logging-output) ++ [Using the Lambda console](#ruby-logging-console) ++ [Using the CloudWatch console](#ruby-logging-cwconsole) ++ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-logging-cli) ++ [Deleting logs](#ruby-logging-delete) + +## Creating a function that returns logs + +After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.rb** @@ -41,44 +52,6 @@ I, [2019-10-26T10:04:01.689856 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- I, [2019-10-26T10:04:01.689874 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- : {"key1"=>"value1", "key2"=>"value2", "key3"=>"value3"} ``` -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. - -**To view your Lambda function's logs** - -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. - -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. - -1. Choose the first stream in the list\. - -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -``` -$ aws lambda invoke --function-name my-function out --log-type Tail -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -You can use the `base64` utility to decode the logs\. - -``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` - -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. - **Example log format** ``` @@ -114,33 +87,43 @@ The Ruby runtime logs the `START`, `END`, and `REPORT` lines for each invocation + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. +## Using the Lambda console -**Topics** -+ [Viewing logs in the AWS Management Console](#python-logging-console) -+ [Using the AWS CLI](#python-logging-cli) -+ [Deleting logs](#python-logging-delete) +You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. -## Viewing logs in the AWS Management Console +## Using the CloudWatch console -The Lambda console shows log output when you test a function on the function configuration page\. To view logs for all invocations, use the CloudWatch Logs console\. +You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. -**To view your Lambda function's logs** +**To view logs on the CloudWatch console** -1. Open the [Logs page of the CloudWatch console](https://console.aws.amazon.com/cloudwatch/home?#logs:)\. +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. -1. Choose the log group for your function \(**/aws/lambda/*function\-name***\)\. +1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. -1. Choose the first stream in the list\. +1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. New streams appear when you update your function and when additional instances are created to handle multiple concurrent invocations\. To find logs for specific invocations, you can instrument your function with X\-Ray, and record details about the request and log stream in the trace\. For a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. -## Using the AWS CLI +To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. +## Using the AWS Command Line Interface \(AWS CLI\) + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. + +**Example retrieve a log ID** +The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. + +``` +aws lambda invoke --function-name my-function out --log-type Tail +``` +You should see the following output: ``` -$ aws lambda invoke --function-name my-function out --log-type Tail { "StatusCode": 200, "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", @@ -148,23 +131,26 @@ $ aws lambda invoke --function-name my-function out --log-type Tail } ``` -You can use the `base64` utility to decode the logs\. +**Example decode the logs** +In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. ``` -$ aws lambda invoke --function-name my-function out --log-type Tail \ +aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text | base64 -d +``` +You should see the following output: + +``` START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", +"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB ``` +The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. +**Example get\-logs\.sh script** +In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. ``` #!/bin/bash @@ -174,10 +160,22 @@ sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 ``` -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. +**Example macOS and Linux \(only\)** +In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. + +``` +chmod -R 755 get-logs.sh +``` + +**Example retrieve the last five log events** +In the same command prompt, run the following script to get the last five log events\. + +``` +./get-logs.sh +``` +You should see the following output: ``` -$ ./get-logs.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -215,6 +213,6 @@ $ ./get-logs.sh } ``` -## Deleting logs +## Deleting logs Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 9b173859..7144e0d4 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -1,18 +1,33 @@ # Deploy Ruby Lambda functions with \.zip file archives -To create a container image to deploy your function code, see [Using container images with Lambda](lambda-images.md)\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -A \.zip file archive is a deployment package that contains your function code and dependencies\. You must create a \.zip file archive if you use the Lambda API to manage functions, or if you need to include libraries and dependencies other than the AWS SDK\. You can upload the package directly to Lambda, or you can use an Amazon Simple Storage Service \(Amazon S3\) bucket, and then upload it to Lambda\. If the deployment package is larger than 50 MB, you must use Amazon S3\. +You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. ++ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. ++ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. ++ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. -If you use the [Lambda console editor](code-editor.md) to author your function, the console manages the deployment package\. You can use this method as long as you don't need to add any libraries\. You can also use it to update a function that already has libraries in the deployment package, as long as the total size doesn't exceed 3 MB\. - -**Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [AWS Lambda layers](configuration-layers.md)\. +This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. **Topics** ++ [Prerequisites](#ruby-package-prereqs) ++ [Tools and libraries](#ruby-package-libraries) + [Updating a function with no dependencies](#ruby-package-codeonly) + [Updating a function with additional dependencies](#ruby-package-dependencies) +## Prerequisites + +The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Tools and libraries + +Lambda provides the following tools and libraries for the Ruby runtime: + +**Tools and libraries for Ruby** ++ [AWS SDK for Ruby](https://github.com/aws/aws-sdk-ruby): the official AWS SDK for the Ruby programming language\. + ## Updating a function with no dependencies To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. @@ -22,13 +37,18 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U 1. Create a \.zip file archive\. ``` - ~/my-function$ zip function.zip function.rb + zip function.zip function.rb ``` 1. To upload the package, use the `update-function-code` command\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", @@ -54,7 +74,12 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Install libraries in the vendor directory using the `bundle` command\. ``` - ~/my-function$ bundle install --path vendor/bundle + bundle install --path vendor/bundle + ``` + + You should see the following output: + + ``` Fetching gem metadata from https://rubygems.org/.............. Resolving dependencies... Fetching aws-eventstream 1.0.1 @@ -67,8 +92,13 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Create a \.zip file archive\. ``` - package$ zip -r function.zip function.rb vendor - adding: function.rb (deflated 37%) + zip -r function.zip function.rb vendor + ``` + + You should see the following output: + + ``` + adding: function.rb (deflated 37%) adding: vendor/ (stored 0%) adding: vendor/bundle/ (stored 0%) adding: vendor/bundle/ruby/ (stored 0%) @@ -82,7 +112,12 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Update the function code\. ``` - ~/my-function$ aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip + ``` + + You should see the following output: + + ``` { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index a5224563..55ffaa4e 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -31,7 +33,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -44,7 +46,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -87,7 +89,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -97,7 +99,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -111,7 +113,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -128,7 +130,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: @@ -152,4 +154,4 @@ Resources: With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby) sample application\. \ No newline at end of file +Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index da6e9f76..c03b0a65 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -21,6 +21,7 @@ The following runtimes have been deprecated: | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | April 30, 2019 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | August 12, 2019 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | March 6, 2020 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 28, 2021 | In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime\. In some cases, such as security issues that require a backwards\-incompatible update, or software that doesn't support a long\-term support \(LTS\) schedule, advance notice might not be possible\. diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index a3fa3b30..7c0f280c 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -40,8 +40,6 @@ For more information about Intel MKL and similar libraries, see [Math Kernel Lib If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. - - Python Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index d0b9384c..50268a89 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -4,8 +4,6 @@ Lambda invokes your function in an execution environment, which provides a secur The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. - - ![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index f26f8fc8..c498b4ab 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -14,6 +14,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Custom runtime on Amazon Linux 2 \(`provided.al2`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) + Python 3\.8 \(`python3.8`\) @@ -48,8 +49,6 @@ Each phase starts with an event from the Lambda service to the runtime and to al ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) - - **Topics** + [Init phase](#runtimes-extensions-api-reg) + [Invoke phase](#runtimes-lifecycle-invoke) @@ -106,9 +105,7 @@ Here is an example payload: **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. -To help identify the overhead introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. - -You can assess the performance impact of an extension by using the `PostRuntimeExtensionsDuration` metric to measure the extra time an extension adds to the function execution\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. @@ -325,6 +322,4 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - - \ No newline at end of file ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index ebcc6286..432d4f33 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -17,7 +17,7 @@ Using language\-specific environment variables is the preferred way to set start The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. -The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. +The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. ``` import com.amazonaws.services.lambda.runtime.RequestStreamHandler; @@ -143,6 +143,7 @@ You can create a *wrapper script* to customize the runtime startup behavior of y Invocations may fail if the wrapper script does not successfully start the runtime process\. The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: ++ Node\.js 14\.x + Node\.js 12\.x + Node\.js 10\.x + Python 3\.8 diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index 5e5b7623..bb0ab2f1 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -4,12 +4,17 @@ In this tutorial, you create a Lambda function with a custom runtime\. You start ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -127,7 +132,7 @@ runtime-tutorial$ aws lambda create-function --function-name bash-runtime \ Invoke the function and verify the response\. ``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt –cli-binary-format raw-in-base64-out +runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 743ac593..a2357ac0 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -7,17 +7,17 @@ The blank function sample application is a starter application that demonstrates Variants of this sample application are available for the following languages: **Variants** -+ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs)\. -+ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-python)\. -+ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-ruby)\. -+ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-java)\. -+ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-go)\. -+ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-csharp)\. -+ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-powershell)\. ++ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs)\. ++ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python)\. ++ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby)\. ++ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java)\. ++ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go)\. ++ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp)\. ++ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell)\. The examples in this topic highlight code from the Node\.js version, but the details are generally applicable to all variants\. -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. **Topics** + [Architecture and handler code](#samples-blank-architecture) @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -78,7 +78,7 @@ The application template uses an AWS Serverless Application Model \(AWS SAM\) re The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 20830f04..19a44d70 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,10 +5,10 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/processor/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/error-processor)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. **Topics** + [Architecture and event structure](#sample-errorprocessor-architecture) @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 5ac70cf1..a7247d54 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,10 +7,10 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/dbadmin/index.js) -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/list-manager)\. +You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. **Topics** + [Architecture and event structure](#samples-listmanager-architecture) @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index 2f776eab..21dd686a 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -1,4 +1,4 @@ -# Identity and access management for AWS Lambda +# Identity and access management for Lambda AWS Identity and Access Management \(IAM\) is an AWS service that helps an administrator securely control access to AWS resources\. IAM administrators control who can be *authenticated* \(signed in\) and *authorized* \(have permissions\) to use Lambda resources\. IAM is an AWS service that you can use with no additional charge\. diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index 14169d60..e2e7810d 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -7,6 +7,7 @@ Use the following information to help you diagnose and fix common issues that yo + [I am not authorized to perform iam:PassRole](#security_iam_troubleshoot-passrole) + [I want to view my access keys](#security_iam_troubleshoot-access-keys) + [I'm an administrator and want to allow others to access Lambda](#security_iam_troubleshoot-admin-delegate) ++ [I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated](#security_iam_troubleshoot-admin-deprecation) + [I want to allow people outside of my AWS account to access my Lambda resources](#security_iam_troubleshoot-cross-account-access) ## I am not authorized to perform an action in Lambda @@ -52,6 +53,26 @@ To allow others to access Lambda, you must create an IAM entity \(user or role\) To get started right away, see [Creating your first IAM delegated user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. +## I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated + +After March 1, 2021, the AWS managed policies **AWSLambdaReadOnlyAccess** and **AWSLambdaFullAccess** will be deprecated and can no longer be attached to new IAM users\. For more information about policy deprecations, see [Deprecated AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) in the *IAM User Guide*\. + +Lambda has introduced two new AWS managed policies: ++ The **AWSLambda\_ReadOnlyAccess** policy grants read\-only access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. ++ The **AWSLambda\_FullAccess** policy grants full access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. + +### Using the AWS managed policies + +We recommend using the newly launched managed policies to grant users, groups, and roles access to Lambda; however, review the permissions granted in the policies to ensure they meet your requirements\. ++ To review the permissions of the **AWSLambda\_ReadOnlyAccess** policy, see the [AWSLambda\_ReadOnlyAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess$jsonEditor) policy page in the IAM console\. ++ To review the permissions of the **AWSLambda\_FullAccess** policy, see the [AWSLambda\_FullAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_FullAccess$jsonEditor) policy page in the IAM console\. + +After reviewing the permissions, you can attach the policies to an IAM identity \(groups, users, or roles\)\. For instructions about attaching an AWS managed policy, see [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html) in the *IAM User Guide*\. + +### Using customer managed policies + +If you need more fine\-grained access control or would like to add permissions, you can create your own [customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies)\. For more information, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. + ## I want to allow people outside of my AWS account to access my Lambda resources You can create a role that users in other accounts or people outside of your organization can use to access your resources\. You can specify who is trusted to assume the role\. For services that support resource\-based policies or access control lists \(ACLs\), you can use those policies to grant people access to your resources\. @@ -59,6 +80,6 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. + To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. + To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. + To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md index 8f88cac2..5bd0b328 100644 --- a/doc_source/services-alb.md +++ b/doc_source/services-alb.md @@ -58,9 +58,14 @@ To configure an Application Load Balancer as a function trigger, grant Elastic L Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name alb-function \ +aws lambda add-permission --function-name alb-function \ --statement-id load-balancer --action "lambda:InvokeFunction" \ --principal elasticloadbalancing.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"load-balancer\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"elasticloadbalancing.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:alb-function\"}" } diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index ca37351f..cb626549 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -26,7 +26,6 @@ Follow the steps in this section to create a new Lambda function and an API Gate + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. + **API** – **Create a new API**\. - + **API type** - **REST API**\. + **Security** – **Open**\. Choose **Create function**\. @@ -35,15 +34,17 @@ When you complete the wizard and create your function, Lambda creates a proxy re A proxy resource has an `AWS_PROXY` integration type and a catch\-all method `ANY`\. The `AWS_PROXY` integration type applies a default mapping template to pass through the entire request to the Lambda function and transforms the output from the Lambda function to HTTP responses\. The `ANY` method defines the same integration setup for all the supported methods, including `GET`, `POST`, `PATCH`, `DELETE `and others\. -## Test sending an HTTPS request +## Test sending an HTTP request -In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, send an HTTPS request to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) +In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) **To test the API** -1. With your `lambda-microservice` function still open in the console, choose **Configure test events** from the **Select a test event** dropdown list. +1. With your `lambda-microservice` function still open in the console, in the upper right hand corner of the console, choose **Test**\. -1. Replace the existing text with the following: +1. In **Event name**, enter a name for the test event\. + +1. In the text entry panel, replace the existing text with the following: ``` { @@ -55,4 +56,5 @@ In this step, you will use the console to test the Lambda function\. In addition ``` 1. After entering the text above choose **Create**\. -1. Choose the event and choose **Test**\. + +1. Choose the event that you created and choose **Test**\. \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 40225f51..594b4580 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -137,4 +137,4 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( } ``` -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. +Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index e7ada6ec..344eb18f 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -25,8 +25,6 @@ The request payload you send in the `POST` request identifies the DynamoDB opera ``` + The following is a sample request payload for a DynamoDB read item operation: - - ``` { "operation": "read", @@ -59,12 +57,17 @@ To learn more about these API Gateway features, see [Configure proxy integration ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -186,13 +189,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. +1. Create a Lambda function with the `create-function` command\. For the `role` parameter, enter the ARN of the execution role that you created earlier\. ``` - $ aws lambda create-function --function-name LambdaFunctionOverHttps \ + aws lambda create-function --function-name LambdaFunctionOverHttps \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` @@ -218,7 +221,7 @@ Invoke the function manually using the sample event data\. We recommend that you 1. Run the following `invoke` command: ``` - $ aws lambda invoke --function-name LambdaFunctionOverHttps \ + aws lambda invoke --function-name LambdaFunctionOverHttps \ --payload fileb://input.txt outputfile.txt ``` @@ -233,7 +236,12 @@ First, you create an API \(`DynamoDBOperations`\) using Amazon API Gateway with Run the following `create-rest-api` command to create the `DynamoDBOperations` API for this tutorial\. ``` -$ aws apigateway create-rest-api --name DynamoDBOperations +aws apigateway create-rest-api --name DynamoDBOperations +``` + +You should see the following output: + +``` { "id": "bs8fqo6bp0", "name": "DynamoDBOperations", @@ -250,8 +258,13 @@ $ aws apigateway create-rest-api --name DynamoDBOperations Save the API ID for use in further commands\. You also need the ID of the API root resource\. To get the ID, run the `get-resources` command\. ``` -$ API=bs8fqo6bp0 -$ aws apigateway get-resources --rest-api-id $API +API=bs8fqo6bp0 +aws apigateway get-resources --rest-api-id $API +``` + +You should see the following output: + +``` { "items": [ { @@ -269,8 +282,13 @@ At this time you only have the root resource, but you add more resources in the Run the following `create-resource` command to create a resource \(`DynamoDBManager`\) in the API that you created in the preceding section\. ``` -$ aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ +aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ --parent-id e8kitthgdb +``` + +You should see the following output: + +``` { "path": "/DynamoDBManager", "pathPart": "DynamoDBManager", @@ -286,9 +304,14 @@ Note the ID in the response\. This is the ID of the `DynamoDBManager` resource t Run the following `put-method` command to create a `POST` method on the `DynamoDBManager` resource in your API\. ``` -$ RESOURCE=iuig5w -$ aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ +RESOURCE=iuig5w +aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ --http-method POST --authorization-type NONE +``` + +You should see the following output: + +``` { "apiKeyRequired": false, "httpMethod": "POST", @@ -303,11 +326,16 @@ We specify `NONE` for the `--authorization-type` parameter, which means that una Run the following command to set the Lambda function as the integration point for the `POST` method\. This is the method Amazon API Gateway invokes when you make an HTTP request for the `POST` method endpoint\. This command and others use ARNs that include your account ID and region\. Save these to variables \(you can find your account ID in the role ARN that you used to create the function\)\. ``` -$ REGION=us-east-2 -$ ACCOUNT=123456789012 -$ aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ +REGION=us-east-2 +ACCOUNT=123456789012 +aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ --http-method POST --type AWS --integration-http-method POST \ --uri arn:aws:apigateway:$REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:$REGION:$ACCOUNT:function:LambdaFunctionOverHttps/invocations +``` + +You should see the following output: + +``` { "type": "AWS", "httpMethod": "POST", @@ -325,9 +353,14 @@ Set `content-type` of the `POST` method response and integration response to JSO + Run the following command to set the `POST` method response to JSON\. This is the response type that your API method returns\. ``` - $ aws apigateway put-method-response --rest-api-id $API \ + aws apigateway put-method-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-models application/json=Empty + ``` + + You should see the following output: + + ``` { "statusCode": "200", "responseModels": { @@ -338,9 +371,14 @@ Set `content-type` of the `POST` method response and integration response to JSO + Run the following command to set the `POST` method integration response to JSON\. This is the response type that Lambda function returns\. ``` - $ aws apigateway put-integration-response --rest-api-id $API \ + aws apigateway put-integration-response --rest-api-id $API \ --resource-id $RESOURCE --http-method POST \ --status-code 200 --response-templates application/json="" + ``` + + You should see the following output: + + ``` { "statusCode": "200", "responseTemplates": { @@ -356,7 +394,12 @@ If you encounter an error running this command, you can use escape characters ar In this step, you deploy the API that you created to a stage called `prod`\. ``` -$ aws apigateway create-deployment --rest-api-id $API --stage-name prod +aws apigateway create-deployment --rest-api-id $API --stage-name prod +``` + +You should see the following output: + +``` { "id": "20vgsz", "createdDate": 1539820012 @@ -370,10 +413,15 @@ Now that you have an API created using Amazon API Gateway and you've deployed it To do this, you need to add a permission to the permissions policy associated with your Lambda function\. Run the following `add-permission` AWS Lambda command to grant the Amazon API Gateway service principal \(`apigateway.amazonaws.com`\) permissions to invoke your Lambda function \(`LambdaFunctionOverHttps`\)\. ``` -$ aws lambda add-permission --function-name LambdaFunctionOverHttps \ +aws lambda add-permission --function-name LambdaFunctionOverHttps \ --statement-id apigateway-test-2 --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/*/POST/DynamoDBManager" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/*/POST/DynamoDBManager\"}}}" } @@ -387,10 +435,15 @@ If your function and API are in different regions, the region identifier in the Now, run the same command again, but this time you grant to your deployed API permissions to invoke the Lambda function\. ``` -$ aws lambda add-permission --function-name LambdaFunctionOverHttps \ +aws lambda add-permission --function-name LambdaFunctionOverHttps \ --statement-id apigateway-prod-2 --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/prod/POST/DynamoDBManager" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-prod-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/prod/POST/DynamoDBManager\"}}}" } @@ -440,7 +493,7 @@ The Lambda function supports using the `create` operation to create an item in y Save the test input to a file named `create-item.json`\. Run the `test-invoke-method` Amazon API Gateway command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint\. ``` -$ aws apigateway test-invoke-method --rest-api-id $API \ +aws apigateway test-invoke-method --rest-api-id $API \ --resource-id $RESOURCE --http-method POST --path-with-query-string "" \ --body file://create-item.json ``` @@ -448,7 +501,7 @@ $ aws apigateway test-invoke-method --rest-api-id $API \ Or, you can use the following Curl command: ``` -$ curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager +curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager ``` To send request for the `echo` operation that your Lambda function supports, you can use the following request payload: @@ -468,7 +521,7 @@ To send request for the `echo` operation that your Lambda function supports, you Save the test input to a file named `echo.json`\. Run the `test-invoke-method` Amazon API Gateway CLI command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint using the preceding JSON in the request body\. ``` -$ aws apigateway test-invoke-method --rest-api-id $API \ +aws apigateway test-invoke-method --rest-api-id $API \ --resource-id $RESOURCE --http-method POST --path-with-query-string "" \ --body file://echo.json ``` @@ -476,7 +529,7 @@ $ aws apigateway test-invoke-method --rest-api-id $API \ Or, you can use the following Curl command: ``` -$ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager +curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager ``` ## Clean up your resources diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 23d9cf67..0644383b 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -34,7 +34,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -79,7 +79,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -168,10 +168,15 @@ You can manage function policy permissions manually with the following API opera To grant invocation permission to an existing API, use the `add-permission` command\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id apigateway-get --action lambda:InvokeFunction \ --principal apigateway.amazonaws.com \ --source-arn "arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET/" +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET\"}}}" } @@ -193,13 +198,16 @@ For details on viewing the policy and removing statements, see [Cleaning up reso API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a 500 error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502\. In both cases, the body of the response from API Gateway is `{"message": "Internal server error"}`\. +**Note** +API Gateway does not retry any Lambda invocations\. If Lambda returns an error, API Gateway returns an error response to the client\. + The following example shows an X\-Ray trace map for a request that resulted in a function error and a 502 from API Gateway\. The client receives the generic error message\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -247,7 +255,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { @@ -291,6 +299,6 @@ For more information, see [AWS Lambda integrations](https://docs.aws.amazon.com/ ## Sample applications The GitHub repository for this guide provides the following sample application for API Gateway\. -+ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. ++ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. Lambda also provides [blueprints](gettingstarted-features.md#gettingstarted-features-blueprints) and [templates](gettingstarted-features.md#gettingstarted-features-templates) that you can use to create an API Gateway application in the Lambda console\. \ No newline at end of file diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6ff099f0..6b2ba087 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 0683e11d..a592cf3a 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -9,7 +9,7 @@ In this tutorial, you do the following: ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. ## Create a Lambda function @@ -105,8 +105,6 @@ Configure an alarm in Amazon CloudWatch that monitors the Lambda function and se + Threshold – **Whenever Errors is >=****1**\. + **Send notification to** – **lambda\-canary\-notifications**\. - - ## Test the alarm Update the function configuration to cause the function to return an error, which triggers the alarm\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 25f585f9..e0f41bf8 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -8,14 +8,17 @@ This tutorial provides code that performs these tasks and a sample application t For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\. +## Prerequisites +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: -## Prerequisites +``` +this is a command +``` -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -31,7 +34,7 @@ To use the sample code you need the following tools: + **Lambda \.NET Core Global Tool** – To build the deployment package for Lambda, install the [\.NET Core global tool](https://dotnet.microsoft.com/download/dotnet-core/2.1) with the \.NET Core CLI\. ``` - $ dotnet tool install -g [Amazon\.Lambda\.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) + dotnet tool install -g [Amazon\.Lambda\.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) ``` The code in this tutorial manages spot requests that launch Amazon EC2 instances\. To run the code locally, you need SDK credentials with permission to use the following APIs\. @@ -48,11 +51,11 @@ Standard charges apply for each service\. ## Review the code -Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. +Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. The `Function` class includes a `FunctionHandler` method that calls other methods to create spot requests, check their status, and clean up\. It creates an Amazon EC2 client with the AWS SDK for \.NET in a static constructor to allow it to be used throughout the class\. -**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** +**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; @@ -180,13 +183,18 @@ Run the code on your local machine to create a spot instance request\. After the 1. Navigate to the `ec2Spot.Tests` directory\. ``` - $ cd test/ec2Spot.Tests + cd test/ec2Spot.Tests ``` 1. Use the \.NET CLI to run the project's unit tests\. ``` - test/ec2Spot.Tests$ dotnet test + dotnet test + ``` + + You should see the following output: + + ``` Starting test execution, please wait... sir-x5tgs5ij open @@ -216,20 +224,30 @@ Run the code in Lambda as a starting point for creating a serverless application 1. Set your region to `us-east-2`\. ``` - $ export AWS_DEFAULT_REGION=us-east-2 + export AWS_DEFAULT_REGION=us-east-2 ``` 1. Create a bucket for deployment artifacts\. ``` - $ ./create-bucket.sh + ./create-bucket.sh + ``` + + You should see the following output: + + ``` make_bucket: lambda-artifacts-63d5cbbf18fa5ecc ``` 1. Create a deployment package and deploy the application\. ``` - $ ./deploy.sh + ./deploy.sh + ``` + + You should see the following output: + + ``` Amazon Lambda Tools for .NET Core applications (3.3.0) Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet @@ -283,7 +301,12 @@ The code provided in this tutorial is designed to create and delete spot instanc To clean up the sample function and support resources, delete its AWS CloudFormation stack and the artifacts bucket that you created\. ``` -$ ./cleanup.sh +./cleanup.sh +``` + +You should see the following output: + +``` Delete deployment artifacts and bucket (lambda-artifacts-63d5cbbf18fa5ecc)?y delete: s3://lambda-artifacts-63d5cbbf18fa5ecc/ebd38e401cedd7d676d05d22b76f0209 remove_bucket: lambda-artifacts-63d5cbbf18fa5ecc diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index a256337e..7d1a7434 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -9,12 +9,17 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -46,7 +51,7 @@ Create an ElastiCache cluster in your default VPC\. 1. Run the following AWS CLI command to create a Memcached cluster\. ``` - $ aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de + aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de ``` You can look up the default VPC security group in the VPC console under **Security Groups**\. Your example Lambda function will add and retrieve an item from this cluster\. @@ -106,7 +111,7 @@ Install dependencies with Pip and create a deployment package\. For instructions Create the Lambda function with the `create-function` command\. ``` -$ aws lambda create-function --function-name AccessMemCache --timeout 30 --memory-size 1024 \ +aws lambda create-function --function-name AccessMemCache --timeout 30 --memory-size 1024 \ --zip-file fileb://function.zip --handler app.handler --runtime python3.8 \ --role arn:aws:iam::123456789012:role/lambda-vpc-role \ --vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb @@ -121,7 +126,7 @@ In this step, you invoke the Lambda function manually using the `invoke` command 1. Invoke the Lambda function with the `invoke` command\. ``` - $ aws lambda invoke --function-name AccessMemCache output.txt + aws lambda invoke --function-name AccessMemCache output.txt ``` 1. Verify that the Lambda function executed successfully as follows: diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index af9d05fe..66e2c48a 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -23,8 +23,13 @@ For asynchronous invocation, Lambda queues the message and [retries](invocation- You need to grant permission for the AWS IoT service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iot.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" } diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md index e6692b7c..997a2044 100644 --- a/doc_source/services-iotevents.md +++ b/doc_source/services-iotevents.md @@ -50,8 +50,13 @@ The event that is passed into the Lambda function includes the following fields: You need to grant permission for the AWS IoT Events service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. ``` -$ aws lambda add-permission --function-name my-function \ +aws lambda add-permission --function-name my-function \ --statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +``` + +You should see the following output: + +``` { "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iotevents.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" } diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md index 0049b611..c633196e 100644 --- a/doc_source/services-lex.md +++ b/doc_source/services-lex.md @@ -100,7 +100,7 @@ Note that the additional fields required for `dialogAction` vary based on the va You need to configure a service\-linked role as your function's [execution role](lambda-intro-execution-role.md)\. Amazon Lex defines the service\-linked role with predefined permissions\. When you create an Amazon Lex bot using the console, the service\-linked role is created automatically\. To create a service\-linked role with the AWS CLI, use the `create-service-linked-role` command\. ``` -$ aws iam create-service-linked-role --aws-service-name lex.amazonaws.com +aws iam create-service-linked-role --aws-service-name lex.amazonaws.com ``` This command creates the following role\. diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index e91da77b..04b9c692 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -45,7 +45,7 @@ Use the following example AWS CLI commands to create and view an Amazon MSK trig The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -55,5 +55,5 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -$ aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 ``` \ No newline at end of file diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 45e85697..98f38168 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -7,14 +7,19 @@ In this tutorial, you do the following: For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -### Prerequisites +## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -22,7 +27,7 @@ For long commands, an escape character \(`\`\) is used to split a command over m On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -### Create the execution role +## Create the execution role Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. @@ -39,7 +44,7 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\. -### Create an Amazon RDS database instance +## Create an Amazon RDS database instance In this tutorial, the example Lambda function creates a table \(Employee\), inserts a few records, and then retrieves the records\. The table that the Lambda function creates has the following schema: @@ -56,7 +61,7 @@ You can launch an RDS MySQL instance using one of the following methods: + Use the following AWS CLI command: ``` - $ aws rds create-db-instance --db-name ExampleDB --engine MySQL \ + aws rds create-db-instance --db-name ExampleDB --engine MySQL \ --db-instance-identifier MySQLForLambdaTest --backup-retention-period 3 \ --db-instance-class db.t2.micro --allocated-storage 5 --no-publicly-accessible \ --master-username username --master-user-password password @@ -64,7 +69,7 @@ You can launch an RDS MySQL instance using one of the following methods: Write down the database name, user name, and password\. You also need the host address \(endpoint\) of the DB instance, which you can get from the RDS console\. You might need to wait until the instance status is available and the Endpoint value appears in the console\. -### Create a deployment package +## Create a deployment package The following example Python code runs a SELECT query against the Employee table in the MySQL RDS instance that you created in the VPC\. The code creates a table in the ExampleDB database, adds sample records, and retrieves those records\. @@ -130,30 +135,33 @@ db_password = "password" db_name = "ExampleDB" ``` +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + `pymysql` – The Lambda function code uses this library to access your MySQL instance \(see [PyMySQL](https://pypi.python.org/pypi/PyMySQL)\) \. -Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +**To create a deployment package** ++ Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. -### Create the Lambda function +## Create the Lambda function Create the Lambda function with the `create-function` command\. You can find the subnet IDs and security group ID for your default VPC in the [Amazon VPC console](https://console.aws.amazon.com/vpc)\. ``` -$ aws lambda create-function --function-name CreateTableAddRecordsAndRead --runtime python3.8 \ +aws lambda create-function --function-name CreateTableAddRecordsAndRead --runtime python3.8 \ --zip-file fileb://app.zip --handler app.handler \ --role arn:aws:iam::123456789012:role/lambda-vpc-role \ --vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb ``` -### Test the Lambda function +## Test the Lambda function In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. 1. Invoke the Lambda function with the `invoke` command\. ``` - $ aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt + aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt ``` 1. Verify that the Lambda function executed successfully as follows: @@ -163,7 +171,7 @@ In this step, you invoke the Lambda function manually using the `invoke` command Now that you have created a Lambda function that accesses a database in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. -### Clean up your resources +## Clean up your resources You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md index 7fa38cb0..7e346dbb 100644 --- a/doc_source/services-rds.md +++ b/doc_source/services-rds.md @@ -2,8 +2,6 @@ You can use AWS Lambda to process event notifications from an Amazon Relational Database Service \(Amazon RDS\) database\. Amazon RDS sends notifications to an Amazon Simple Notification Service \(Amazon SNS\) topic, which you can configure to invoke a Lambda function\. Amazon SNS wraps the message from Amazon RDS in its own event document and sends it to your function\. -## Example - **Example Amazon RDS message in an Amazon SNS event** ``` @@ -31,21 +29,13 @@ You can use AWS Lambda to process event notifications from an Amazon Relational } ``` -## Configuring the function - -**Configuring the maximum concurrency of a function** - -If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. - -**Sending notifications from a database** - -For instructions on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notification](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html) in the Amazon RDS User Guide\. - -**Using Amazon SNS as a trigger** - -For details on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. +**Topics** ++ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) ++ [Configuring the function](#configuration) -## What's Next? +## Configuring the function -**Topics** -+ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) \ No newline at end of file +The following section shows additional configurations and topics we recommend as part of this tutorial\. ++ If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. ++ For more information on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notifications](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\. ++ For more information on using Amazon SNS as trigger, see [Using Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md index d76e8c26..ebbaa92f 100644 --- a/doc_source/services-smaa-topic-add.md +++ b/doc_source/services-smaa-topic-add.md @@ -1,4 +1,4 @@ -# Adding a self\-managed Apache Kafka cluster as an event source +# Adding a Self\-managed Apache Kafka cluster as an event source You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -6,11 +6,11 @@ This section describes how to add your Kafka cluster and topic as a function tri ## Prerequisites + A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md)\. -## Adding a self\-managed Apache Kafka cluster using the Lambda console +## Adding a Self\-managed Apache Kafka cluster using the Lambda console -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. **To add an Apache Kafka trigger to your Lambda function \(console\)** @@ -24,16 +24,16 @@ Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka to 1. Configure the remaining options, and then choose **Add**\. -## Adding a self\-managed Apache Kafka cluster using the AWS CLI +## Adding a Self\-managed Apache Kafka cluster using the AWS CLI -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. +Use the following example AWS CLI commands to create and view a Self\-managed Apache Kafka trigger for your Lambda function\. ### Using SASL/SCRAM If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -43,7 +43,7 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -$ aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -53,5 +53,5 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -$ aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 +aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 ``` \ No newline at end of file diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index 78802d24..f17599c6 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -23,7 +23,7 @@ Step Functions can invoke Lambda functions directly from a `Task` state in an [A You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** ``` { diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 80ac78f1..d9294ca1 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -14,7 +14,9 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **AWS X\-Ray**, choose **Active tracing**\. +1. Under **Monitoring tools**, choose **Edit**\. + +1. Choose **Active tracing** on the **AWS X\-Ray** pane\. 1. Choose **Save**\. @@ -78,7 +80,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A The following example AWS CLI command enables active tracing on a function named my\-function\. ``` -$ aws lambda update-function-configuration --function-name my-function \ +aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` @@ -88,7 +90,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -102,7 +104,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md index 7da4dcd6..4f0c5452 100644 --- a/doc_source/smaa-permissions.md +++ b/doc_source/smaa-permissions.md @@ -1,4 +1,4 @@ -# Managing access and permissions for a self\-managed Apache Kafka cluster +# Managing access and permissions for a Self\-managed Apache Kafka cluster Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. @@ -25,7 +25,7 @@ Your Lambda function might need permission to describe your Secrets Manager secr ### VPC permissions -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within your VPC access your Self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -35,9 +35,9 @@ If only users within your VPC access your self\-managed Apache Kafka cluster, yo ## Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your Self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +By default, Lambda isn't permitted to perform the required or optional actions for a Self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. ``` { @@ -67,7 +67,7 @@ By default, IAM users and roles don't have permission to perform [event source A ## Using SASL/SCRAM authentication -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +User name and password authentication for a Self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index a38cdde0..9e48472f 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -110,7 +110,6 @@ The following Amazon States Language definition of the `WhichCoat` state machine } ``` - **Example Python function** The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index aa94c9d3..79dc5f53 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -13,8 +13,8 @@ When you deploy updates to your function directly with the Lambda API or with a The Lambda runtime needs permission to read the files in your deployment package\. You can use the `chmod` command to change the file mode\. The following example commands make all files and folders in the current directory readable by any user\. ``` -my-function$ chmod 644 $(find . -type f) -my-function$ chmod 755 $(find . -type d) +chmod 644 $(find . -type f) +chmod 755 $(find . -type d) ``` **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 68f4219a..4baab296 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -36,7 +36,7 @@ Runtimes for scripting languages include the AWS SDK and are periodically update + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip file archives](java-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index d4a71f52..0c874220 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -2,28 +2,28 @@ When you invoke a Lambda function, Lambda validates the request and checks for scaling capacity before sending the event to your function or, for asynchronous invocation, to the event queue\. Invocation errors can be caused by issues with request parameters, event structure, function settings, user permissions, resource permissions, or limits\. -If you invoke your function directly, you see invocation errors in the response from Lambda\. If you invoke your function asynchronously with an event source mapping or through another service, you might find errors in logs, a dead\-letter queue, or a failed\-event destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. +If you invoke your function directly, you see any invocation errors in the response from Lambda\. If you invoke your function asynchronously with an event source mapping or through another service, you might find errors in logs, a dead\-letter queue, or a failed\-event destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. -For a list of error types that can be returned by the `Invoke` operation, see [Invoke](API_Invoke.md)\. +For a list of error types that the `Invoke` operation can return, see [Invoke](API_Invoke.md)\. **Error:** *User: arn:aws:iam::123456789012:user/developer is not authorized to perform: lambda:InvokeFunction on resource: my\-function* -Your IAM user, or the role that you assume, needs permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the **AWSLambdaRole** managed policy, or a custom policy that allows the `lambda:InvokeFunction` action on the target function, to your IAM user\. +Your AWS Identity and Access Management \(IAM\) user, or the role that you assume, must have permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the AWS managed policy **AWSLambdaRole** to your IAM user, or add a custom policy that allows the `lambda:InvokeFunction` action on the target function\. **Note** -Unlike other API actions in Lambda, the name of the action in IAM \(`lambda:InvokeFunction`\) doesn't match the name of the API action \(`Invoke`\) for invoking a function\. +Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeFunction`\) doesn't match the name of the API operation \(`Invoke`\) for invoking a function\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. **Error:** *ResourceConflictException: The operation cannot be performed at this time\. The function is currently in the following state: Pending* -When you connect a function to a VPC at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. +When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. **Error:** *A function is stuck in the `Pending` state for several minutes\.* -If a function becomes stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it\. +If a function is stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [PublishVersion](API_PublishVersion.md) @@ -32,19 +32,40 @@ Lambda cancels the pending operation and puts the function into the `Failed` sta **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* -To divide the available concurrency in a Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and also that it won't scale beyond its assigned concurrency\. +To divide your AWS account's available concurrency in an AWS Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and that it doesn't scale beyond its assigned concurrency\. **Issue:** *You can invoke your function directly, but it doesn't run when another service or account invokes it\.* -You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user also needs [permission to invoke functions](access-control-identity-based.md)\. +You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user must also have [permission to invoke functions](access-control-identity-based.md)\. **Issue:** *Function is invoked continuously in a loop\.* -This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it is possible to create a function that stores an object in an Amazon S3 bucket that is configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, choose **Throttle** on the [function configuration page](configuration-console.md)\. Then identify the code path or configuration error that caused the recursive invocation\. +This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. + +**Issue:** *You see cold starts after enabling provisioned concurrency\.* + +When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: ++ [Check that provisioned concurrency is enabled](configuration-concurrency.md#configuration-concurrency-provisioned) on the function version or alias\. +**Note** +Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. ++ Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. ++ Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. ++ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. + +**Note** +There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. + +**Issue:** *You see latency variability on the first invocation after enabling provisioned concurrency\.* + +Depending on your function's runtime and memory configuration, it's possible to see some latency variability on the first invocation on an initialized execution environment\. For example, \.NET and other JIT runtimes can lazily load resources on the first invocation, leading to some latency variability \(typically tens of milliseconds\)\. This variability is more apparent on 128\-MiB functions\. You mitigate this by increasing the function's configured memory\. + +**Issue:** *You see cold starts while deploying new versions of your function\.* + +When you update a function alias, Lambda automatically shifts provisioned concurrency to the new version based on the weights configured on the alias\. **Error:** *KMSDisabledException: Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Please check the function's KMS key settings\.* -This error can occur if your KMS key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then reassign the custom key to recreate the grant\. +This error can occur if your AWS Key Management Service \(AWS KMS\) key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then, reassign the custom key to recreate the grant\. **Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* @@ -54,10 +75,10 @@ The mount request to the function's [file system](configuration-filesystem.md) w The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. -**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out* +**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out\.* -The function was able to connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. +The function could connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. -**Error:** *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* +*EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda was unable to terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 808fbc28..593225cf 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -14,6 +14,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Custom runtime on Amazon Linux 2 \(`provided.al2`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) ++ Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) + Python 3\.8 \(`python3.8`\) @@ -64,7 +65,7 @@ For a \.zip file archive, you can create an AWS CloudFormation template to simpl You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. -You add the extension to your function using the same method as you would for any layer\. For more information, see [Configuring a function to use layers](configuration-layers.md#configuration-layers-using)\. +You add the extension to your function using the same method as you would for any layer\. For more information, see [Configure a function to use layers](configuration-layers.md#configuration-layers-using)\. **Add an extension to your function \(console\)** diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md index e03d66b9..f37aa7ac 100644 --- a/doc_source/with-android-create-package.md +++ b/doc_source/with-android-create-package.md @@ -100,4 +100,4 @@ public class HelloPojo { **Dependencies** + `aws-lambda-java-core` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. \ No newline at end of file +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 0d7759f5..b7dae428 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -8,12 +8,17 @@ The mobile application retrieves AWS credentials from an Amazon Cognito identity ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -64,13 +69,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name AndroidBackendLambdaFunction \ + aws lambda create-function --function-name AndroidBackendLambdaFunction \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-android-role ``` @@ -90,7 +95,7 @@ Invoke the function manually using the sample event data\. 1. Run the following `invoke` command: ``` - $ aws lambda invoke --function-name AndroidBackendLambdaFunction \ + aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md index e14f3954..d1293e28 100644 --- a/doc_source/with-cloudtrail-example.md +++ b/doc_source/with-cloudtrail-example.md @@ -10,10 +10,10 @@ Use the following instructions to create a Lambda function that notifies you whe ## Requirements -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. Before you begin, make sure that you have the following tools: -+ [Node\.js 8 with `npm`](https://nodejs.org/en/download/releases/)\. ++ [Node\.js 12\.x with `npm`](https://nodejs.org/en/download/releases/)\. + The Bash shell\. For Linux and macOS, this is included by default\. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -189,19 +189,19 @@ The following Lambda function processes CloudTrail logs, and sends a notificatio 1. In the *lambda\-cloudtrail* folder, run the following script\. It creates a `package-lock.json` file and a `node_modules` folder, which handle all dependencies\. ``` - $ npm install async + npm install async ``` 1. Run the following script to create a deployment package\. ``` - $ zip -r function.zip . + zip -r function.zip . ``` 1. Create a Lambda function named CloudTrailEventProcessing with the `create-function` command by running the following script\. Make the indicated replacements\. ``` - $ aws lambda create-function --function-name CloudTrailEventProcessing \ + aws lambda create-function --function-name CloudTrailEventProcessing \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x --timeout 10 --memory-size 1024 \ --role arn:aws:iam::123456789012:role/lambda-cloudtrail-role ``` @@ -215,7 +215,7 @@ The Lambda function's resource policy needs permissions to allow Amazon S3 to in 1. Run the following `add-permission` command\. Replace the ARN and account ID with your own\. ``` - $ aws lambda add-permission --function-name CloudTrailEventProcessing \ + aws lambda add-permission --function-name CloudTrailEventProcessing \ --statement-id Id-1 --action "lambda:InvokeFunction" --principal s3.amazonaws.com \ --source-arn arn:aws:s3:::my-bucket \ --source-account 123456789012 @@ -228,7 +228,7 @@ The Lambda function's resource policy needs permissions to allow Amazon S3 to in 1. To view the Lambda function's access policy, run the following `get-policy` command, and replace the function name\. ``` - $ aws lambda get-policy --function-name function-name + aws lambda get-policy --function-name function-name ``` ## Step 6: Configuring notifications on an Amazon S3 bucket diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md index 35a341e2..2cf7e228 100644 --- a/doc_source/with-ddb-create-package.md +++ b/doc_source/with-ddb-create-package.md @@ -67,7 +67,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 43e12c54..a188584c 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -4,12 +4,17 @@ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -64,13 +69,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessDynamoDBRecords \ + aws lambda create-function --function-name ProcessDynamoDBRecords \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-dynamodb-role ``` @@ -177,7 +182,7 @@ In this step, you invoke your Lambda function manually using the `invoke` AWS La Run the following `invoke` command\. ``` -$ aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt +aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` The function returns the string `message` in the response body\. @@ -221,7 +226,7 @@ Create an event source mapping in AWS Lambda\. This event source mapping associa Run the following AWS CLI `create-event-source-mapping` command\. After the command runs, note down the UUID\. You'll need this UUID to refer to the event source mapping in any commands, for example, when deleting the event source mapping\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ +aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ --batch-size 100 --starting-position LATEST --event-source DynamoDB-stream-arn ``` @@ -230,7 +235,7 @@ $ aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords You can get the list of event source mappings by running the following command\. ``` -$ aws lambda list-event-source-mappings +aws lambda list-event-source-mappings ``` The list returns all of the event source mappings you created, and for each mapping it shows the `LastProcessingResult`, among other things\. This field is used to provide an informative message if there are any problems\. Values such as `No records processed` \(indicates that AWS Lambda has not started polling or that there are no records in the stream\) and `OK` \(indicates AWS Lambda successfully read records from the stream and invoked your Lambda function\) indicate that there are no issues\. If there are issues, you receive an error message\. @@ -238,7 +243,7 @@ The list returns all of the event source mappings you created, and for each mapp If you have a lot of event source mappings, use the function name parameter to narrow down the results\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords +aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords ``` ## Test the setup diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 45d67f48..0f447c31 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,6 +79,8 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. + **Topics** + [Execution role permissions](#events-dynamodb-permissions) + [Configuring a stream as an event source](#services-dynamodb-eventsourcemapping) @@ -98,6 +100,7 @@ Lambda needs the following permissions to manage resources related to your Dynam + [dynamodb:GetRecords](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html) + [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) + [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) ++ [dynamodb:ListShards](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListShards.html) The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. @@ -127,7 +130,7 @@ Lambda supports the following options for DynamoDB event sources\. **Event source options** + **DynamoDB table** – The DynamoDB table to read records from\. -+ **Batch size** – The number of records to send to the function in each batch, up to 1,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch, up to 10,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. + **Batch window** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. + **Starting position** – Process only new records, or all existing records\. + **Latest** – Process new records that are added to the stream\. @@ -158,8 +161,13 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 +``` + +You should see the following output: + +``` { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, @@ -181,9 +189,14 @@ $ aws lambda create-event-source-mapping --function-name my-function --batch-siz Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. ``` -$ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ +aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ --maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 --destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -205,7 +218,12 @@ $ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. ``` -$ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -231,7 +249,7 @@ $ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449 To process multiple batches concurrently, use the `--parallelization-factor` option\. ``` -$ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ +aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ --parallelization-factor 5 ``` @@ -448,7 +466,7 @@ At the end of your window, Lambda uses final processing for actions on the aggre You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 ``` Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. @@ -487,7 +505,7 @@ def lambda_handler(event, context): ## Reporting batch item failures -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md index e3d1c76a..09ee9978 100644 --- a/doc_source/with-kinesis-create-package.md +++ b/doc_source/with-kinesis-create-package.md @@ -8,13 +8,13 @@ The code on this page does not support [aggregated records](https://docs.aws.ama Sample code is available for the following languages\. **Topics** -+ [Node\.js 8](#with-kinesis-example-deployment-pkg-nodejs) ++ [Node\.js 12\.x](#with-kinesis-example-deployment-pkg-nodejs) + [Java 11](#with-kinesis-example-deployment-pkg-java) + [C\#](#with-kinesis-example-deployment-pkg-dotnet) + [Python 3](#with-kinesis-example-deployment-pkg-python) + [Go](#with-kinesis-example-deployment-pkg-go) -## Node\.js 8 +## Node\.js 12\.x The following example code receives a Kinesis event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. @@ -70,7 +70,7 @@ If the handler returns normally without exceptions, Lambda considers the input b + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 36310cac..06d5f5b8 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -12,12 +12,17 @@ In this tutorial, you create a Lambda function to consume events from a Kinesis ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -71,13 +76,13 @@ exports.handler = function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessKinesisRecords \ + aws lambda create-function --function-name ProcessKinesisRecords \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-kinesis-role ``` @@ -116,7 +121,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a 1. Use the `invoke` command to send the event to the function\. ``` - $ aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt + aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` The response is saved to `out.txt`\. @@ -126,13 +131,18 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a Use the `create-stream ` command to create a stream\. ``` -$ aws kinesis create-stream --stream-name lambda-stream --shard-count 1 +aws kinesis create-stream --stream-name lambda-stream --shard-count 1 ``` Run the following `describe-stream` command to get the stream ARN\. ``` -$ aws kinesis describe-stream --stream-name lambda-stream +aws kinesis describe-stream --stream-name lambda-stream +``` + +You should see the following output: + +``` { "StreamDescription": { "Shards": [ @@ -170,7 +180,7 @@ You use the stream ARN in the next step to associate the stream with your Lambda Run the following AWS CLI `add-event-source` command\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ +aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ --event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream \ --batch-size 100 --starting-position LATEST ``` @@ -178,7 +188,7 @@ $ aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ Note the mapping ID for later use\. You can get a list of event source mappings by running the `list-event-source-mappings` command\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessKinesisRecords \ +aws lambda list-event-source-mappings --function-name ProcessKinesisRecords \ --event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream ``` @@ -189,8 +199,44 @@ In the response, you can verify the status value is `enabled`\. Event source map To test the event source mapping, add event records to your Kinesis stream\. The `--data` value is a string that the CLI encodes to base64 prior to sending it to Kinesis\. You can run the same command more than once to add multiple records to the stream\. ``` -$ aws kinesis put-record --stream-name lambda-stream --partition-key 1 \ +aws kinesis put-record --stream-name lambda-stream --partition-key 1 \ --data "Hello, this is a test." ``` -Lambda uses the execution role to read records from the stream\. Then it invokes your Lambda function, passing in batches of records\. The function decodes data from each record and logs it, sending the output to CloudWatch Logs\. View the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. \ No newline at end of file +Lambda uses the execution role to read records from the stream\. Then it invokes your Lambda function, passing in batches of records\. The function decodes data from each record and logs it, sending the output to CloudWatch Logs\. View the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Kinesis stream** + +1. Sign in to the AWS Management Console and open the Kinesis console at [https://console\.aws\.amazon\.com/kinesis](https://console.aws.amazon.com/kinesis)\. + +1. Select the stream you created\. + +1. Choose **Actions**, **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 7a3f7eac..fa7e336c 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -10,9 +10,6 @@ To minimize latency and maximize read throughput, you can create a data stream c For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. -**Note** -Error handling is not available for HTTP/2 stream consumers\. - Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. **Example Kinesis record event** @@ -62,6 +59,8 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. + **Topics** + [Configuring your data stream and function](#services-kinesis-configure) + [Execution role permissions](#events-kinesis-permissions) @@ -84,8 +83,13 @@ For standard iterators, Lambda polls each shard in your Kinesis stream for recor To minimize latency and maximize read throughput, create a data stream consumer with enhanced fan\-out\. Enhanced fan\-out consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. Stream consumers use HTTP/2 to reduce latency by pushing records to Lambda over a long\-lived connection and by compressing request headers\. You can create a stream consumer with the Kinesis [RegisterStreamConsumer](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html) API\. ``` -$ aws kinesis register-stream-consumer --consumer-name con1 \ +aws kinesis register-stream-consumer --consumer-name con1 \ --stream-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream +``` + +You should see the following output: + +``` { "Consumer": { "ConsumerName": "con1", @@ -172,9 +176,14 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat To create the event source mapping with the AWS CLI, use the `create-event-source-mapping` command\. The following example uses the AWS CLI to map a function named `my-function` to a Kinesis data stream\. The data stream is specified by an Amazon Resource Name \(ARN\), with a batch size of 500, starting from the timestamp in Unix time\. ``` -$ aws lambda create-event-source-mapping --function-name my-function \ +aws lambda create-event-source-mapping --function-name my-function \ --batch-size 500 --starting-position AT_TIMESTAMP --starting-position-timestamp 1541139109 \ --event-source-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream +``` + +You should see the following output: + +``` { "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", "BatchSize": 500, @@ -198,9 +207,14 @@ To use a consumer, specify the consumer's ARN instead of the stream's ARN\. Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. ``` -$ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ +aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ --maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 --destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -222,7 +236,12 @@ $ aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. ``` -$ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b +``` + +You should see this output: + +``` { "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", "BatchSize": 100, @@ -248,7 +267,7 @@ $ aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449 To process multiple batches concurrently, use the `--parallelization-factor` option\. ``` -$ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ +aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ --parallelization-factor 5 ``` @@ -396,7 +415,7 @@ At the end of your window, Lambda uses final processing for actions on the aggre You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. ``` -$ aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 +aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 ``` Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. @@ -435,7 +454,7 @@ def lambda_handler(event, context): ## Reporting batch item failures -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries n a successful record\. +When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 3b1c539e..f9920a57 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -87,8 +87,6 @@ To read records from an Amazon MQ broker, your Lambda function needs the followi + [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -The AWS managed policy `AWSLambdaMQExecutionRole` includes these permissions\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. - **Note** When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. @@ -145,11 +143,16 @@ The Amazon VPC configuration is discoverable through the [Amazon MQ API](https:/ The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. ``` -$ aws lambda create-event-source-mapping \ +aws lambda create-event-source-mapping \ --event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ --function-name MQ-Example-Function \ --source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ ---queues ExampleQueue +--queues ExampleQueue +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 100, @@ -174,9 +177,14 @@ $ aws lambda create-event-source-mapping \ Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` -$ aws lambda update-event-source-mapping \ +aws lambda update-event-source-mapping \ --uuid 91eaeb7e-c976-1234-9451-8709db01f137 \ --batch-size 2 +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 2, @@ -192,8 +200,13 @@ $ aws lambda update-event-source-mapping \ Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. ``` -$ aws lambda get-event-source-mapping \ +aws lambda get-event-source-mapping \ --uuid 91eaeb7e-c976-4939-9451-8709db01f137 +``` + +You should see the following output: + +``` { "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", "BatchSize": 2, diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md index a75a2cf3..01392350 100644 --- a/doc_source/with-s3-example-deployment-pkg.md +++ b/doc_source/with-s3-example-deployment-pkg.md @@ -1,6 +1,6 @@ # Sample Amazon S3 function code -Sample code is available for the following languages\. +The following sample code is available for the [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md)\. **Topics** + [Node\.js 12\.x](#with-s3-example-deployment-pkg-nodejs) @@ -11,125 +11,134 @@ Sample code is available for the following languages\. The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +### Create the function code + +Copy the sample code into a file named `index.js` into a new folder named `lambda-s3`\. + **Example index\.js** ``` // dependencies -const AWS = require('aws-sdk'); -const util = require('util'); -const sharp = require('sharp'); - -// get reference to S3 client -const s3 = new AWS.S3(); - -exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); -}; + const AWS = require('aws-sdk'); + const util = require('util'); + const sharp = require('sharp'); + + // get reference to S3 client + const s3 = new AWS.S3(); + + exports.handler = async (event, context, callback) => { + + // Read options from the event parameter. + console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); + const srcBucket = event.Records[0].s3.bucket.name; + // Object key may have spaces or unicode non-ASCII characters. + const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); + const dstBucket = srcBucket + "-resized"; + const dstKey = "resized-" + srcKey; + + // Infer the image type from the file suffix. + const typeMatch = srcKey.match(/\.([^.]*)$/); + if (!typeMatch) { + console.log("Could not determine the image type."); + return; + } + + // Check that the image type is supported + const imageType = typeMatch[1].toLowerCase(); + if (imageType != "jpg" && imageType != "png") { + console.log(`Unsupported image type: ${imageType}`); + return; + } + + // Download the image from the S3 source bucket. + + try { + const params = { + Bucket: srcBucket, + Key: srcKey + }; + var origimage = await s3.getObject(params).promise(); + + } catch (error) { + console.log(error); + return; + } + + // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. + const width = 200; + + // Use the Sharp module to resize the image and save in a buffer. + try { + var buffer = await sharp(origimage.Body).resize(width).toBuffer(); + + } catch (error) { + console.log(error); + return; + } + + // Upload the thumbnail image to the destination bucket + try { + const destparams = { + Bucket: dstBucket, + Key: dstKey, + Body: buffer, + ContentType: "image" + }; + + const putResult = await s3.putObject(destparams).promise(); + + } catch (error) { + console.log(error); + return; + } + + console.log('Successfully resized ' + srcBucket + '/' + srcKey + + ' and uploaded to ' + dstBucket + '/' + dstKey); + }; ``` ++ Review the preceding code and note the following: + + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. + + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. + + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. -The deployment package is a \.zip file containing your Lambda function code and dependencies\. +### Create the deployment package -**To create a deployment package** +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: -1. Create a folder \(`examplefolder`\), and then create a subfolder \(`node_modules`\)\. +**Dependencies** ++ Sharp for node\.js -1. Install dependencies\. The code examples use the following libraries: - + AWS SDK for JavaScript in Node\.js - + Sharp for node\.js +**To create a deployment package** - The AWS Lambda runtime already has the AWS SDK for JavaScript in Node\.js, so you only need to install the Sharp library\. Open a command prompt, navigate to the `examplefolder`, and install the libraries using the `npm` command, which is part of Node\.js\. For Linux, use the following command\. +1. Install the Sharp library with npm\. For Linux, use the following command\. ``` - $ npm install sharp + lambda-s3$ npm install sharp ``` For macOS, use the following command\. ``` - $ npm install --arch=x64 --platform=linux --target=12.13.0 sharp + lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp ``` -1. Save the sample code to a file named index\.js\. +1. After you complete this step, you should have the following folder structure: -1. Review the preceding code and note the following: - + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. - + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. - + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. + ``` + lambda-s3 + |- index.js + |- /node_modules/sharp + └ /node_modules/... + ``` -1. Save the file as `index.js` in `examplefolder`\. After you complete this step, you will have the following folder structure: +1. Create a deployment package with the function code and dependencies\. ``` - index.js - /node_modules/sharp + lambda-s3$ zip -r function.zip . ``` -1. Zip the index\.js file and the node\_modules folder as `CreateThumbnail.zip`\. +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. ## Java 11 @@ -137,6 +146,10 @@ The following is example Java code that reads incoming Amazon S3 events and crea The `S3Event` type that the handler uses as the input type is one of the predefined classes in the `aws-lambda-java-events`  library that provides methods for you to easily read information from the incoming Amazon S3 event\. The handler returns a string as output\. +### Create the function code + +Copy the sample code into a file named `Handler.java`\. + **Example Handler\.java** ``` @@ -273,19 +286,30 @@ public class Handler implements Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda runs the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. +### Create the deployment package + +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + `aws-lambda-java-core` + `aws-lambda-java-events` + `aws-java-sdk` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +**To create a deployment package** ++ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. + +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. ## Python 3 The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +### Create the function code + +Copy the sample code into a file named `lambda_function.py`\. + **Example lambda\_function\.py** -Copy the sample code into a file named `lambda_function.py`\. ``` import boto3 @@ -315,8 +339,15 @@ def lambda_handler(event, context): s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) ``` +### Create the deployment package + +A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: + **Dependencies** + [Pillow](https://pypi.org/project/Pillow/) **To create a deployment package** -+ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow](https://pypi.org/project/Pillow/) library\. \ No newline at end of file ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. + +**To create and test the function** ++ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index e18abe3c..816a8c24 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -19,12 +19,17 @@ Upon completing this tutorial, you will have the following Amazon S3, Lambda, an ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -120,6 +125,8 @@ The following example code receives an Amazon S3 event input and processes the m **Note** For sample code in other languages, see [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md)\. +### Create the function code + **Example index\.js** ``` @@ -207,6 +214,8 @@ Review the preceding code and note the following: + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. +### Create the deployment package + The deployment package is a \.zip file containing your Lambda function code and dependencies\. **To create a deployment package** @@ -218,13 +227,13 @@ The deployment package is a \.zip file containing your Lambda function code and 1. Install the Sharp library with npm\. For Linux, use the following command\. ``` - lambda-s3$ npm install sharp + npm install sharp ``` For macOS, use the following command\. ``` - lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp + npm install --arch=x64 --platform=linux --target=12.13.0 sharp ``` After you complete this step, you will have the following folder structure: @@ -236,32 +245,36 @@ The deployment package is a \.zip file containing your Lambda function code and └ /node_modules/... ``` -1. Create a deployment package with the function code and dependencies\. +1. Create a deployment package with the function code and dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. ``` - lambda-s3$ zip -r function.zip . + zip -r function.zip . ``` +### Create the Lambda function + **To create the function** + Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name CreateThumbnail \ + aws lambda create-function --function-name CreateThumbnail \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --timeout 10 --memory-size 1024 \ --role arn:aws:iam::123456789012:role/lambda-s3-role ``` +**Note** +If you are using AWS CLI version 2, add the following command parameters: -If you are using AWS CLI version 2, add the following command parameters: + ``` + --cli-binary-format raw-in-base64-out + ``` -``` ---cli-binary-format raw-in-base64-out -``` + The Lambda function in the last step uses a Node\.js function handler of `index.handler`\. This name reflects the function name as `handler`, and the file where the handler code is stored in `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. It also specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. For the role parameter, replace the number sequence with your AWS account ID\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects you upload, you might need to increase the timeout value using the following AWS CLI command\. ``` -$ aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 +aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 ``` ## Test the Lambda function @@ -316,9 +329,15 @@ In this step, you invoke the Lambda function manually using sample Amazon S3 eve 1. Run the following Lambda CLI `invoke` command to invoke the function\. Note that the command requests asynchronous execution\. You can optionally invoke it synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - $ aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ + aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ --payload file://inputFile.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameters: + + ``` + --cli-binary-format raw-in-base64-out + ``` 1. Verify that the thumbnail was created in the target bucket\. @@ -337,7 +356,7 @@ In this step, you add the remaining configuration so that Amazon S3 can publish + The bucket is owned by your account\. If you delete a bucket, it is possible for another account to create a bucket with the same ARN\. ``` - $ aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ + aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ --statement-id s3invoke --action "lambda:InvokeFunction" \ --source-arn arn:aws:s3:::sourcebucket \ --source-account account-id @@ -346,7 +365,7 @@ In this step, you add the remaining configuration so that Amazon S3 can publish 1. Verify the function's access policy by running the AWS CLI `get-policy` command\. ``` - $ aws lambda get-policy --function-name CreateThumbnail + aws lambda get-policy --function-name CreateThumbnail ``` Add notification configuration on the source bucket to request Amazon S3 to publish object\-created events to Lambda\. diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md index 00c7fdb7..8f44c052 100644 --- a/doc_source/with-sns-create-package.md +++ b/doc_source/with-sns-create-package.md @@ -3,12 +3,12 @@ Sample code is available for the following languages\. **Topics** -+ [Node\.js 8](#with-sns-example-deployment-pkg-nodejs) ++ [Node\.js 12\.x](#with-sns-example-deployment-pkg-nodejs) + [Java 11](#with-sns-example-deployment-pkg-java) + [Go](#with-sns-example-deployment-pkg-go) + [Python 3](#with-sns-example-deployment-pkg-python) -## Node\.js 8 +## Node\.js 12\.x The following example processes messages from Amazon SNS, and logs their contents\. @@ -61,7 +61,7 @@ public class LogEvent implements RequestHandler { + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## Go diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 6be99da0..d9bae04a 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -4,12 +4,17 @@ You can use a Lambda function in one AWS account to subscribe to an Amazon SNS t ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -24,7 +29,7 @@ In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by From account A \(01234567891A\), create the source Amazon SNS topic\. ``` -$ aws sns create-topic --name lambda-x-account --profile accountA +aws sns create-topic --name lambda-x-account --profile accountA ``` Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. @@ -74,13 +79,13 @@ exports.handler = function(event, context, callback) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name SNS-X-Account \ + aws lambda create-function --function-name SNS-X-Account \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB @@ -93,23 +98,28 @@ Note the function ARN that is returned by the command\. You will need it when yo From account A \(01234567891A\), grant permission to account B \(01234567891B\) to subscribe to the topic: ``` -$ aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ +aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---action-name Subscribe ListSubscriptionsByTopic Receive --profile accountA +--action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. ``` -$ aws lambda add-permission --function-name SNS-X-Account \ +aws lambda add-permission --function-name SNS-X-Account \ --source-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --statement-id sns-x-account --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB +``` + +You should see the following output: + +``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891A:function:SNS-X-Account\", + \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:SNS-X-Account\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, \"Sid\":\"sns-x-account1\"}" } @@ -125,10 +135,15 @@ If the account with the SNS topic is hosted in an opt\-in region, you need to sp From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A \(01234567891A\), Amazon SNS invokes the `SNS-X-Account` function in account B \(01234567891B\)\. ``` -$ aws sns subscribe --protocol lambda \ +aws sns subscribe --protocol lambda \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account \ --profile accountB +``` + +You should see the following output: + +``` { "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:lambda-x-account:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } @@ -141,7 +156,7 @@ The output contains the ARN of the topic subscription\. From account A \(01234567891A\), test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: ``` -$ aws sns publish --message file://message.txt --subject Test \ +aws sns publish --message file://message.txt --subject Test \ --topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ --profile accountA ``` @@ -149,3 +164,47 @@ $ aws sns publish --message file://message.txt --subject Test \ This will return a message id with a unique identifier, indicating the message has been accepted by the Amazon SNS service\. Amazon SNS will then attempt to deliver it to the topic's subscribers\. Alternatively, you could supply a JSON string directly to the `message` parameter, but using a text file allows for line breaks in the message\. To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Amazon SNS topic** + +1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. + +1. Select the topic you created\. + +1. Choose **Delete**\. + +1. Enter **delete me** in the text box\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Amazon SNS subscription** + +1. Open the [Subscriptions page](https://console.aws.amazon.com/sns/home#subscriptions:) of the Amazon SNS console\. + +1. Select the subscription you created\. + +1. Choose **Delete**, **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index fea17f30..7e1167be 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -1,6 +1,6 @@ -# Using AWS Lambda with Amazon SNS +# Using Lambda with Amazon SNS -You can use a Lambda function to process Amazon Simple Notification Service notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. +You can use a Lambda function to process Amazon Simple Notification Service \(Amazon SNS\) notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. Amazon SNS invokes your function [asynchronously](invocation-async.md) with an event that contains a message and metadata\. @@ -40,11 +40,18 @@ Amazon SNS invokes your function [asynchronously](invocation-async.md) with an e } ``` -For asynchronous invocation, Lambda queues the message and handles retries\. If Amazon SNS is unable to reach Lambda or the message is rejected, Amazon SNS retries at increasing intervals over several hours\. For details, see [Reliability](https://aws.amazon.com/sns/faqs/#Reliability) in the Amazon SNS FAQ\. +For asynchronous invocation, Lambda queues the message and handles retries\. If Amazon SNS can't reach Lambda or the message is rejected, Amazon SNS retries at increasing intervals over several hours\. For details, see [Reliability](http://aws.amazon.com/sns/faqs/#Reliability) in the Amazon SNS FAQs\. -In order to perform cross account Amazon SNS deliveries to Lambda, you need to authorize your Lambda function to be invoked from Amazon SNS\. In turn, Amazon SNS needs to allow the Lambda account to subscribe to the Amazon SNS topic\. For example, if the Amazon SNS topic is in account A and the Lambda function is in account B, both accounts must grant permissions to the other to access their respective resources\. Since not all the options for setting up cross\-account permissions are available from the AWS console, you use the AWS CLI to set up the entire process\. +To perform cross\-account Amazon SNS deliveries to Lambda, you must authorize Amazon SNS to invoke your Lambda function\. In turn, Amazon SNS must allow the AWS account with the Lambda function to subscribe to the Amazon SNS topic\. For example, if the Amazon SNS topic is in account A and the Lambda function is in account B, both accounts must grant permissions to the other to access their respective resources\. Since not all the options for setting up cross\-account permissions are available from the AWS Management Console, you must use the AWS Command Line Interface \(AWS CLI\) for setup\. -For more information, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. +For more information, see [Fanout to Lambda functions](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda-as-subscriber.html) in the *Amazon Simple Notification Service Developer Guide*\. + +**Input types for Amazon SNS events** + +For input type examples for Amazon SNS events in Java, \.NET, and Go, see the following on the AWS GitHub repository: ++ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) ++ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/main/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) ++ [sns\.go](https://github.com/aws/aws-lambda-go/blob/main/events/sns.go) **Topics** + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 1144ad8f..6723b172 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -13,7 +13,7 @@ Sample code is available for the following languages\. The following is example code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. -**Example index\.js \(Node\.js 8\)** +**Example index\.js \(Node\.js 12\)** ``` exports.handler = async function(event, context) { @@ -25,17 +25,6 @@ exports.handler = async function(event, context) { } ``` -**Example index\.js \(Node\.js 6\)** - -``` -event.Records.forEach(function(record) { - var body = record.body; - console.log(body); - }); - callback(null, "message"); -}; -``` - Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. ## Java @@ -70,7 +59,7 @@ public class Handler implements RequestHandler{ + `aws-lambda-java-core` + `aws-lambda-java-events` -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip file archives](java-package.md)\. +Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. ## C\# diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 2a3d1c55..efe9beea 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -4,12 +4,17 @@ In this tutorial, you create a Lambda function to consume messages from an [Amaz ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands are shown in listings preceded by a prompt symbol \($\) and the name of the current directory, when appropriate: +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +this is a command +``` + +You should see the following output: ``` -~/lambda-project$ this is a command this is output ``` @@ -60,13 +65,13 @@ exports.handler = async function(event, context) { 1. Create a deployment package\. ``` - $ zip function.zip index.js + zip function.zip index.js ``` 1. Create a Lambda function with the `create-function` command\. ``` - $ aws lambda create-function --function-name ProcessSQSRecord \ + aws lambda create-function --function-name ProcessSQSRecord \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::123456789012:role/lambda-sqs-role ``` @@ -105,7 +110,7 @@ If the handler returns normally without exceptions, Lambda considers the message 1. Run the following `invoke` command\. ``` - $ aws lambda invoke --function-name ProcessSQSRecord \ + aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` @@ -132,14 +137,14 @@ Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Q To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command runs, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. ``` -$ aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ +aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` You can get the list of event source mappings by running the following command\. ``` -$ aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ +aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` @@ -153,4 +158,40 @@ Now you can test the setup as follows: 1. AWS Lambda polls the queue and when it detects updates, it invokes your Lambda function by passing in the event data it finds in the queue\. -1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. \ No newline at end of file +1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the Amazon SQS queue** + +1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. + +1. Select the queue you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d88bdf10..ea24fdfe 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -1,6 +1,6 @@ # Using AWS Lambda with Amazon SQS -You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/fifo-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. +You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. @@ -132,9 +132,11 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. + **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for synchronous invocation \(6 MB\)\. + + Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. Lambda processes up to 5 batches at a time\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** @@ -142,7 +144,7 @@ Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon To manage the event source configuration later, choose the trigger in the designer\. -Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. +Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the [reserved concurrency](configuration-concurrency.md) value to 1000, which is the maximum number of concurrent executions for an Amazon SQS event source\. ## Event source mapping APIs @@ -156,9 +158,14 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. ``` -$ aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ --maximum-batching-window-in-seconds 60 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue +``` + +You should see the following output: + +``` { "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", "BatchSize": 5, From 9974312a9d5483858f15cce24e099f87c0b8e432 Mon Sep 17 00:00:00 2001 From: Anton Klimenko Date: Thu, 25 Feb 2021 08:56:47 +1100 Subject: [PATCH 065/243] Fix typo in adding RIE to the image example There's inconsistency in the example of how to add RIE to the image. Dockerfile `ADD` and `RUN` commands work with `/usr/bin/aws-lambda-rie`. But `entry.sh` script refers to `/usr/local/bin/aws-lambda-rie` that causes issues. Alternatively, Dockerfile `ADD` and `RUN` commands can be updated to work with `/usr/local/bin/aws-lambda-rie`. --- doc_source/go-image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 4b8e4564..85566819 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -131,7 +131,7 @@ The steps are the same as described for a `provided.al2` base image, with one ad ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie "$@" + exec /usr/bin/aws-lambda-rie "$@" else exec "$@" fi @@ -165,4 +165,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file +For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. From d42b13e80b9fe481f904aa8fb50ceafbaa3c2908 Mon Sep 17 00:00:00 2001 From: Andre F de Miranda Date: Mon, 1 Mar 2021 11:50:44 +1100 Subject: [PATCH 066/243] Fix broken link --- doc_source/golang-handler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 5acc75f7..e193dc0a 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. ### Valid handler signatures @@ -176,4 +176,4 @@ func LambdaHandler() (int, error) { func main() { lambda.Start(LambdaHandler) } -``` \ No newline at end of file +``` From 995561f71c5d014fa5970e4ebe0124fe18bbb6ea Mon Sep 17 00:00:00 2001 From: Tim Mattison Date: Tue, 2 Mar 2021 16:44:49 -0500 Subject: [PATCH 067/243] Fixed reference to iotevents.amazonaws.com that should be iot.amazonaws.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code snippet references iotevents.amazonaws.com but should reference iot.amazonaws.com. This can be verified in the output JSON below the code that shows the service principal as “iot.amazonaws.com”. --- doc_source/services-iot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index 66e2c48a..a1e3dfbf 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -24,7 +24,7 @@ You need to grant permission for the AWS IoT service to invoke your Lambda funct ``` aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +--statement-id iot-events --action "lambda:InvokeFunction" --principal iot.amazonaws.com ``` You should see the following output: @@ -35,4 +35,4 @@ You should see the following output: } ``` -For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. \ No newline at end of file +For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. From 197a6ba22400e9a1af13b49cace7df0811693268 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 4 Mar 2021 15:07:40 +0500 Subject: [PATCH 068/243] fix JSON syntax in example resource-based policy --- doc_source/access-control-resource-based.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 0778a999..0c8b3993 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function” + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" @@ -225,4 +225,4 @@ Use `remove-layer-version-permission` to remove statements from the policy\. ``` aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` \ No newline at end of file +``` From 94b3498206a550763afa3b1a4e60c1cd588e9f07 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Thu, 4 Mar 2021 22:42:11 +0000 Subject: [PATCH 069/243] Periodic update --- doc_source/access-control-identity-based.md | 2 +- doc_source/access-control-resource-based.md | 14 +- doc_source/configuration-aliases.md | 17 +- doc_source/configuration-concurrency.md | 6 +- doc_source/configuration-console.md | 8 +- doc_source/configuration-database.md | 6 +- doc_source/configuration-envvars.md | 12 +- doc_source/configuration-filesystem.md | 2 + doc_source/configuration-layers.md | 121 +++-- doc_source/configuration-tags.md | 2 + doc_source/configuration-versions.md | 10 +- doc_source/configuration-vpc.md | 2 + doc_source/csharp-exceptions.md | 13 +- doc_source/csharp-image.md | 2 +- doc_source/csharp-logging.md | 6 +- doc_source/csharp-tracing.md | 14 +- doc_source/getting-started-create-function.md | 28 +- doc_source/go-image.md | 2 +- doc_source/golang-exceptions.md | 13 +- doc_source/golang-handler.md | 4 +- doc_source/golang-logging.md | 6 +- doc_source/golang-package.md | 6 +- doc_source/golang-tracing.md | 10 +- doc_source/images-test.md | 8 +- doc_source/index.md | 10 +- doc_source/invocation-async.md | 8 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-sync.md | 2 +- doc_source/java-context.md | 20 +- doc_source/java-exceptions.md | 19 +- doc_source/java-handler.md | 40 +- doc_source/java-logging.md | 8 +- doc_source/java-package.md | 34 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 14 +- doc_source/kafka-hosting.md | 4 +- doc_source/kafka-smaa.md | 6 +- doc_source/kafka-using-cluster.md | 2 +- doc_source/lambda-intro-execution-role.md | 6 +- doc_source/lambda-kafka.md | 2 +- doc_source/lambda-monitoring.md | 3 +- doc_source/lambda-releases.md | 1 + doc_source/lambda-services.md | 2 +- doc_source/monitoring-insights.md | 6 +- doc_source/monitoring-metrics.md | 2 +- doc_source/monitoring-servicemap.md | 80 ++++ doc_source/nodejs-exceptions.md | 13 +- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-logging.md | 4 +- doc_source/nodejs-package.md | 14 +- doc_source/nodejs-tracing.md | 16 +- doc_source/powershell-exceptions.md | 13 +- doc_source/powershell-logging.md | 6 +- doc_source/python-exceptions.md | 13 +- doc_source/python-handler.md | 4 +- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 452 ++++++++++++++++++ doc_source/python-package-update.md | 216 +++++++++ doc_source/python-package.md | 238 +-------- doc_source/python-tracing.md | 16 +- doc_source/ruby-exceptions.md | 13 +- doc_source/ruby-logging.md | 4 +- doc_source/ruby-package.md | 12 +- doc_source/ruby-tracing.md | 16 +- doc_source/runtimes-modify.md | 6 +- doc_source/samples-blank.md | 16 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/samples-listmanager.md | 10 +- doc_source/services-apigateway-blueprint.md | 12 +- doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-apigateway.md | 16 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-tutorial.md | 14 +- doc_source/services-cloudwatchevents.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-iot.md | 2 +- doc_source/services-msk-topic-add.md | 2 +- doc_source/services-rds-tutorial.md | 4 +- doc_source/services-smaa-topic-add.md | 14 +- doc_source/services-stepfunctions.md | 2 +- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 10 +- doc_source/troubleshooting-deployment.md | 14 + doc_source/troubleshooting-execution.md | 10 + doc_source/troubleshooting-images.md | 6 + doc_source/troubleshooting-invocation.md | 26 + doc_source/troubleshooting-networking.md | 6 + doc_source/using-extensions.md | 4 +- doc_source/with-ddb-example.md | 2 +- doc_source/with-ddb.md | 4 +- doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 4 +- doc_source/with-mq.md | 4 +- doc_source/with-s3-example.md | 2 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sns.md | 6 +- doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 2 +- 99 files changed, 1270 insertions(+), 607 deletions(-) create mode 100644 doc_source/monitoring-servicemap.md create mode 100644 doc_source/python-package-create.md create mode 100644 doc_source/python-package-update.md diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 5a6a3318..56270b66 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -170,7 +170,7 @@ The permissions in the policy are organized into statements based on the [resour This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. +When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. ## Layer development and use diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 0778a999..19f6734a 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -10,9 +10,9 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc 1. Choose a function\. -1. Choose **Permissions**\. +1. Choose **Configuration** and then choose **Permissions**\. -1. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. +1. Scroll down to **Resource\-based policy** and then choose **View policy document**\. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. **Example Resource\-based policy** ``` @@ -22,7 +22,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Statement": [ { "Sid": "lambda-allow-s3-my-function", - "Effect": "Allow", + "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, @@ -31,12 +31,12 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" - }, + }, "ArnLike": { - "AWS:SourceArn": "arn:aws:s3:::my-bucket" + "AWS:SourceArn": "arn:aws:s3:::my-bucket" } - } - } + } + } ] } ``` diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 0fa7f0a8..7876becd 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -6,10 +6,9 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of a function\. +1. Choose a function\. -1. On the function configuration page, choose **Actions**, **Create alias**\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-actions.png) +1. Choose **Aliases** and then choose **Create alias**\. 1. On the **Create alias** page, do the following: @@ -23,8 +22,6 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is 1. Choose **Save**\. -To view the aliases that are currently defined for a function, on the function configuration page, choose **Qualifiers**, and then choose the **Aliases** tab\. - ## Managing aliases with the Lambda API To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. @@ -84,14 +81,14 @@ You can point an alias to a maximum of two Lambda function versions\. The versio + Both versions must be published\. The alias cannot point to `$LATEST`\. **To configure routing on an alias** +**Note** +Verify that the function has at least two published versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of a function\. - -1. Verify that the function has at least two published versions\. On the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to display the list of versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. +1. Choose a function\. -1. Choose **Actions**, **Create alias**\. +1. Choose **Aliases** and then choose **Create alias**\. 1. On the **Create alias** page, do the following: @@ -130,7 +127,7 @@ aws lambda update-alias --name routing-alias --function-name my-function \ To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. ``` -aws lambda update-alias --name routing-alias --function-name my-function \ +aws lambda update-alias --name routing-alias --function-name my-function \ --function-version 2 --routing-config AdditionalVersionWeights={} ``` diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 03cd0ad3..75406a69 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -36,6 +36,8 @@ To manage reserved concurrency settings for a function, use the Lambda console\. 1. Choose a function\. +1. Choose **Configuration** and then choose **Concurrency**\. + 1. Under **Concurrency**, choose **Edit**\. 1. Choose **Reserve concurrency**\. Enter the amount of concurrency to reserve for the function\. @@ -70,7 +72,9 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd 1. Choose a function\. -1. Under **Provisioned concurrency configurations**, choose **Add**\. +1. Choose **Configuration** and then choose **Concurrency**\. + +1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. 1. Choose an alias or version\. diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md index 9a05cc2c..39af7e6f 100644 --- a/doc_source/configuration-console.md +++ b/doc_source/configuration-console.md @@ -2,18 +2,18 @@ You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code\. -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. Under **Aliases**, choose `Latest`\. The function designer is near the top of the page\. +To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. -![\[The function designer in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) +![\[The function overview in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -The designer shows an overview of your function and its upstream and downstream resources\. +The function overview shows a visualization of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. + **Triggers** – Triggers are services and resources that you have configured to invoke your function\. Choose **Add trigger** to create a Lambda [event source mapping](invocation-eventsourcemapping.md) or to configure a trigger in another service that the Lambda console integrates with\. For details about these services and others, see [Using AWS Lambda with other services](lambda-services.md)\. + **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a \.zip file archive that contains libraries, a custom runtime, or other dependencies\. + **Destinations** – Add a destination to your function to send details about invocation results to another service\. You can send invocation records when your function is invoked [asynchronously](invocation-async.md), or by an [event source mapping](invocation-eventsourcemapping.md) that reads from a stream\. -With the `Latest` function version selected, you can modify the following settings\. +By default you are working with the `Latest` function version\. You can modify the following settings in this version: **Function settings** + **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a [deployment package](gettingstarted-package.md)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index cc56da29..1d84a658 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -8,6 +8,8 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for 1. Choose a function\. +1. Choose **Configuration** and then choose **Database proxies**\. + 1. Choose **Add database proxy**\. 1. Configure the following options\. @@ -46,7 +48,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -82,4 +84,4 @@ Sample applications that demonstrate the use of Lambda with an Amazon RDS databa [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 5720a4a1..9abf6b67 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -13,7 +13,9 @@ You set environment variables on the unpublished version of your function by spe 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. @@ -155,7 +157,9 @@ When you provide the key, only users in your account with access to the key can 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -206,7 +210,9 @@ You can also encrypt environment variable values on the client side before sendi 1. Choose a function\. -1. Under **Environment variables**, choose **Edit**\. +1. Choose **Code** if it is not already selected\. + +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 29308b57..930b1cc5 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -13,6 +13,8 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu 1. Choose a function\. +1. Choose **Configuration** and then choose **File systems**\. + 1. Under **File system**, choose **Add file system**\. 1. Configure the following properties: diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 209a0076..6dd8a5d0 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -5,7 +5,7 @@ You can configure your Lambda function to pull in additional code and content in **Note** Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. -Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB\. +Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB \(and each code file under `512 KB`\)\. **Note** A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. @@ -200,53 +200,76 @@ When you delete a layer version, you can no longer configure functions to use it ## Include library dependencies in a layer -You can move runtime dependencies out of your Lambda function code by placing them in a layer\. Lambda runtimes include paths in the `/opt` directory to ensure that your function code has access to libraries that are included in layers\. - -To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. -+ **Node\.js** – `nodejs/node_modules`, `nodejs/node8/node_modules` \(`NODE_PATH`\) -**Example AWS X\-Ray SDK for Node\.js** - - ``` - xray-sdk.zip - └ nodejs/node_modules/aws-xray-sdk - ``` -+ **Python** – `python`, `python/lib/python3.8/site-packages` \(site directories\) -**Example Pillow** - - ``` - pillow.zip - │ python/PIL - └ python/Pillow-5.3.0.dist-info - ``` -+ **Ruby** – `ruby/gems/2.5.0` \(`GEM_PATH`\), `ruby/lib` \(`RUBYLIB`\) -**Example JSON** - - ``` - json.zip - └ ruby/gems/2.5.0/ - | build_info - | cache - | doc - | extensions - | gems - | └ json-2.1.0 - └ specifications - └ json-2.1.0.gemspec - ``` -+ **Java** – `java/lib` \(classpath\) -**Example Jackson** - - ``` - jackson.zip - └ java/lib/jackson-core-2.2.3.jar - ``` -+ **All** – `bin` \(`PATH`\), `lib` \(`LD_LIBRARY_PATH`\) -**Example JQ** - - ``` - jq.zip - └ bin/jq - ``` +You can move runtime dependencies out of your Lambda function by placing them in a layer\. Each Lambda runtime includes the paths to specific folders in the `/opt` directory\. Define the same folder structure in your layer \.zip archive to ensure that your function code has access to the libraries in that layer\. + +To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. The following table lists the folder paths that each runtime supports\. + + +**Layer paths for each Lambda runtime** +[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) + +The following examples show how you can structure the folders for your layer\. + +------ +#### [ Node\.js ] + +**Example file structure for AWS X\-Ray SDK** + +``` +xray-sdk.zip +└ nodejs/node_modules/aws-xray-sdk +``` + +------ +#### [ Python ] + +**Example file structure for the Pillow library** + +``` +pillow.zip +│ python/PIL +└ python/Pillow-5.3.0.dist-info +``` + +------ +#### [ Ruby ] + +**Example file structure for JSON gem** + +``` +json.zip +└ ruby/gems/2.5.0/ + | build_info + | cache + | doc + | extensions + | gems + | └ json-2.1.0 + └ specifications + └ json-2.1.0.gemspec +``` + +------ +#### [ Java ] + +**Example file structure for Jackson jar file** + +``` +jackson.zip +└ java/lib/jackson-core-2.2.3.jar +``` + +------ +#### [ All ] + +**Example file structure for JQ library** + +``` +jq.zip +└ bin/jq +``` + +------ For more information about path settings in the Lambda execution environment, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. @@ -275,7 +298,7 @@ For more examples, see [Granting layer access to other accounts](access-control- To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 7b97c72a..2232792f 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -8,6 +8,8 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Choose a function\. +1. Choose **Configuration** and then choose **Tags**\. + 1. Under **Tags**, choose **Manage tags**\. 1. Enter a key and value\. To add additional tags, choose **Add new tag**\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 75d05619..caabb639 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -14,20 +14,14 @@ You can change the function code and settings only on the unpublished version of 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose the name of the function that you want to publish\. +1. Choose a function and then choose **Versions**\. -1. On the function configuration page, choose **Actions**, **Publish new version**\. +1. On the versions configuration page, choose **Publish new version**\. 1. \(Optional\) Enter a version description\. 1. Choose **Publish**\. -After you publish the first version of a function, the Lambda console displays a dropdown list of the available versions\. The **Designer** panel displays a version qualifier at the end of the function name\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/version-1-created.png) - -To view the current versions of a function, on the function configuration page, choose **Qualifiers**, and then choose the **Versions** tab to see a list of versions for the function\. If you haven't published a new version of the function, the list only displays the `$LATEST` version\. - ## Managing versions with the Lambda API To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API operation\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index a592160d..30056c02 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -67,6 +67,8 @@ To access private resources, connect your function to private subnets\. If your 1. Choose a function\. +1. Choose **Configuration** and then choose **VPC**\. + 1. Under **VPC**, choose **Edit**\. 1. Choose a VPC, subnets, and security groups\. diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index dbb88487..3e1a65f4 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in C\# -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the C\# runtime using the Lambda console and the AWS CLI\. @@ -155,24 +155,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index eabed738..664397c5 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -15,7 +15,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/main/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index e939a3ce..7e7df14d 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. + To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) @@ -109,7 +109,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 37704f8a..835f8e7c 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -57,7 +59,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -102,7 +104,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -116,7 +118,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 77869296..13a9bc44 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -30,23 +30,21 @@ In this getting started exercise, you create a Node\.js Lambda function using th Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -### Use the designer +### Use the function overview -The **Designer** shows an overview of your function and its upstream and downstream resources\. You can use it to configure triggers, layers, and destinations\. +The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger, destination, and layer configuration\. ![\[A Lambda function with an Amazon S3 trigger and an Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) -Choose **my\-function** in the designer to return to the function's code and configuration\. For scripting languages, Lambda includes sample code that returns a success response\. You can edit your function code with the embedded [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html) editor as long as your source code doesn't exceed the 3 MB limit\. - ### Invoke the Lambda function Invoke your Lambda function using the sample event data provided in the console\. **To invoke a function** -1. In the upper right corner, choose **Test**\. +1. After selecting your function, choose the **Test** tab\. -1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: ``` { @@ -56,18 +54,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` - You can change keys and values in the sample JSON, but don't change the event structure\. If you do change any keys and values, you must update the sample code accordingly\. - -1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. 1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) @@ -281,9 +277,9 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. In the upper right corner, choose **Test**\. +1. After selecting your function, choose the **Test** tab\. -1. In the **Configure test event** dialog box, choose **Create new test event**\. In **Event template**, leave the default **Hello World** option\. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: ``` { @@ -293,16 +289,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** section \(below the **Test** button\) shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. 1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 4b8e4564..98a70933 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -131,7 +131,7 @@ The steps are the same as described for a `provided.al2` base image, with one ad ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie "$@" + exec /usr/bin/aws-lambda-rie "$@" else exec "$@" fi diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 719cfd9c..0be634ea 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Go -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Go runtime using the Lambda console and the AWS CLI\. @@ -73,24 +73,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 5acc75f7..6d9032d1 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -2,7 +2,7 @@ The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. +A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. ``` package main @@ -90,7 +90,7 @@ And the response would look like this: } ``` -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/main/events)\. +To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. ### Valid handler signatures diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index a6175f9a..c94ebb5b 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. + To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-go/function/main.go) – Logging** +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { @@ -94,7 +94,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 007e8ea5..3db7529a 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -14,7 +14,7 @@ This page describes how to create a \.zip file as your deployment package for th ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -40,7 +40,7 @@ Lambda provides the following sample applications for the Go runtime: ## Creating a \.zip file on macOS and Linux -The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/main/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. +The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. 1. Download the **lambda** library from GitHub\. @@ -78,7 +78,7 @@ The following steps demonstrate how to download the [lambda](https://github.com/ ## Creating a \.zip file on Windows -The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. +The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. **Note** If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index ee119846..0b76e3be 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -84,7 +86,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -98,7 +100,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 990b4999..9765af49 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -109,16 +109,16 @@ You install the runtime interface emulator to your local machine\. When you run ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ + && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` 1. Run your Lambda function using the `docker run` command\. ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ + docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ - <(optional) image command> + <(optional) image command> ``` This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. diff --git a/doc_source/index.md b/doc_source/index.md index 9e959188..cd0d9deb 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -32,7 +32,6 @@ Amazon's trademarks and trade dress may not be used in + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) + [Configuring functions in the console](configuration-console.md) - + [Configuring functions in the AWS Lambda console (preview)](configuration-preview.md) + [Configuring functions defined as container images](configuration-images.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Managing concurrency for a Lambda function](configuration-concurrency.md) @@ -144,9 +143,9 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda with Amazon MSK](with-msk.md) + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with Self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a Self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a Self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) + + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) + + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) @@ -162,6 +161,8 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Python](lambda-python.md) + [AWS Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) + + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) + + [Updating a Lambda function in Python 3.8](python-package-update.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) @@ -216,6 +217,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + + [Example workflows using other AWS services](monitoring-servicemap.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for Lambda](security-iam.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 8fbb60cd..b1611c5d 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -60,6 +60,8 @@ Use the Lambda console to configure error handling settings on a function, a ver 1. Choose a function\. +1. Choose **Configuration** and then choose **Asynchronous invocation**\. + 1. Under **Asynchronous invocation**, choose **Edit**\. 1. Configure the following settings\. @@ -84,7 +86,7 @@ To send events to a destination, your function needs additional permissions\. Ad + **Lambda** – [lambda:InvokeFunction](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) + **EventBridge** – [events:PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) -Add destinations to your function in the Lambda console's function designer\. +Add destinations to your function in the Lambda console's function visualization\. **To configure a destination for asynchronous invocation records** @@ -92,7 +94,7 @@ Add destinations to your function in the Lambda console's function designer\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Asynchronous invocation**\. @@ -221,6 +223,8 @@ After creating the target and updating your function's execution role, add the d 1. Choose a function\. +1. Choose **Configuration** and then choose **Asynchronous invocation**\. + 1. Under **Asynchronous invocation**, choose **Edit**\. 1. Set **DLQ resource** to **Amazon SQS** or **Amazon SNS**\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index b66cc774..285b7ef7 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index 849c5b15..08a3ff0d 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -39,7 +39,7 @@ An error occurred (InvalidRequestContentException) when calling the Invoke opera at [Source: (byte[])"value"; line: 1, column: 11] ``` -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index bf682e40..99a60a3e 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,13 +17,13 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -64,17 +64,17 @@ END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms ``` -The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. +The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); -import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); -import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); +import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); +import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) public class TestContext implements Context{ public TestContext() {} diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 270b0470..fb8fb869 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Java -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI\. @@ -68,9 +68,9 @@ For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md# You can create a Lambda function that displays human\-readable error messages to users\. **Note** -To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; @@ -111,7 +111,7 @@ When the function throws `InputLengthException`, the Java runtime serializes it } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. @@ -135,24 +135,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 5bc8a0b4..842f9360 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -4,13 +4,13 @@ The AWS Lambda function handler is the method in your function code that process In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.Handler @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -104,15 +104,15 @@ The output type can be an object or `void`\. The runtime serializes return value ## Handler interfaces -The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/main/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. +The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. **** -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) ++ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,12 +125,12 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) +import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) +import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) +import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) ... // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { @@ -177,11 +177,11 @@ The GitHub repository for this guide includes sample applications that demonstra + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 8babf997..b7ee6126 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -108,7 +108,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -222,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -269,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -295,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 2eb8094b..8467b2e1 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -7,14 +7,10 @@ This page describes how to create your deployment package as a \.zip file or Jar **Topics** + [Prerequisites](#java-package-prereqs) + [Tools and libraries](#java-package-libraries) -+ [Building a deployment package with Gradle](#java-package-gradle) -+ [Building a deployment package with Maven](#java-package-maven) -+ [Uploading a deployment package with the Lambda API](#java-package-cli) -+ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -68,7 +64,27 @@ To create a deployment package, compile your function code and dependencies into **Note** To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. -## Building a deployment package with Gradle +You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. + +**To upload a deployment package with the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Under **Code source**, choose **Upload from**\. + +1. Upload the deployment package\. + +1. Choose **Save**\. + +**Topics** ++ [Building a deployment package with Gradle](#java-package-gradle) ++ [Building a deployment package with Maven](#java-package-maven) ++ [Uploading a deployment package with the Lambda API](#java-package-cli) ++ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) + +### Building a deployment package with Gradle To create a deployment package with your function's code and dependencies, use the `Zip` build type\. @@ -114,7 +130,7 @@ unzip path/to/my/function.zip -d expanded find ./expanded/lib -name '*.jar' | xargs -n1 zipinfo -1 | grep '.*.class' | sort | uniq -c | sort ``` -## Building a deployment package with Maven +### Building a deployment package with Maven To build a deployment package with Maven, use the [Maven Shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/)\. The plugin creates a JAR file that contains the compiled function code and all of its dependencies\. @@ -203,7 +219,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf ``` -## Uploading a deployment package with the Lambda API +### Uploading a deployment package with the Lambda API To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: @@ -268,7 +284,7 @@ You should see the following output: You can use this method to upload function packages up to 250 MB \(decompressed\)\. -## Uploading a deployment package with AWS SAM +### Uploading a deployment package with AWS SAM You can use AWS SAM to automate deployments of your function code, configuration, and dependencies\. AWS SAM is an extension of AWS CloudFormation that provides a simplified syntax for defining serverless applications\. The following example template defines a function with a deployment package in the `build/distributions` directory that Gradle uses: diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 3dc7ed56..4aa16cb4 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -15,7 +15,7 @@ Use the `blank-java` sample app to learn the basics, or as a starting point for The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index dd48f6e2..2d3ec9e1 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -85,7 +87,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -99,7 +101,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -116,7 +118,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md index fe678e3a..096de4b5 100644 --- a/doc_source/kafka-hosting.md +++ b/doc_source/kafka-hosting.md @@ -10,7 +10,7 @@ To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud pro When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. +For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. ## Using Amazon MSK @@ -26,4 +26,4 @@ For more information about using an MSK cluster, see [Using Lambda with Amazon M You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file +For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md index 11235148..df8fc0ed 100644 --- a/doc_source/kafka-smaa.md +++ b/doc_source/kafka-smaa.md @@ -1,9 +1,9 @@ -# Using Lambda with Self\-managed Apache Kafka +# Using Lambda with self\-managed Apache Kafka You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. **Topics** -+ [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a Self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) ++ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 6a02ca8c..62af0c15 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -17,7 +17,7 @@ When you add your Apache Kafka cluster as a trigger for your Lambda function, th + Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -For Amazon MSK and Self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. ## Event source API operations diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2213e8af..761f9e58 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -8,7 +8,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA 1. Choose a function\. -1. Choose **Permissions**\. +1. Choose **Configuration** and then choose **Permissions**\. 1. Under **Resource summary**, view the services and resources that the function can access\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-executionrole.png) @@ -132,7 +132,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md index fbeb3491..0cb6ab64 100644 --- a/doc_source/lambda-kafka.md +++ b/doc_source/lambda-kafka.md @@ -10,4 +10,4 @@ This section describes how to use an AWS or non\-AWS hosted Kafka cluster with L + [Hosting an Apache Kafka cluster](kafka-hosting.md) + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) + [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with Self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file ++ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index c25149b1..a1ebc99f 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -8,4 +8,5 @@ You can use other AWS services to troubleshoot your Lambda functions\. This sect + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) -+ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) \ No newline at end of file ++ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) ++ [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index a9f5e883..9c890a25 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index d8cfce11..960d08e1 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [Self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](kafka-smaa.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 69a62cef..377dc64e 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see�[Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes @@ -42,7 +42,7 @@ You can use Lambda Insights with any of the following [Lambda function runtimes] ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -60,7 +60,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function's [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 97d9062c..a685336f 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -56,7 +56,7 @@ Performance metrics provide performance details about a single invocation\. For **Performance metrics** + `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. -+ `PostRuntimeExecutionDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. ++ `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md new file mode 100644 index 00000000..d377f99b --- /dev/null +++ b/doc_source/monitoring-servicemap.md @@ -0,0 +1,80 @@ +# Example workflows using other AWS services + +AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use for AWS X\-Ray and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. + +**Topics** ++ [Prerequisites](#monitoring-troubleshooting-prereqs) ++ [Pricing](#monitoring-troubleshooting-pricing) ++ [Example AWS X\-Ray workflow to view a service map](#monitoring-servicemap-example) ++ [Example AWS X\-Ray workflow to view trace details](#monitoring-tracing-example) ++ [What's next?](#monitoring-troubleshooting-next-up) + +## Prerequisites + +### Using AWS X\-Ray + +AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray workflows on this page\. If your execution role does not have the required permissions, the Lambda console will attempt to add them to your execution role\. + +**To enable AWS X\-Ray on the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose your function\. + +1. Choose the **Configuration** tab\. + +1. On the **Monitoring tools** pane, choose **Edit**\. + +1. Under **AWS X\-Ray**, turn on **Active tracing**\. + +1. Choose **Save**\. + +## Pricing ++ With AWS X\-Ray you pay only for what you use, based on the number of traces recorded, retrieved, and scanned\. For more information, see [AWS X\-Ray Pricing](http://aws.amazon.com/xray/pricing/)\. + +## Example AWS X\-Ray workflow to view a service map + +If you've enabled AWS X\-Ray, you can view a ServiceLens service map on the CloudWatch console\. A service map displays your service endpoints and resources as nodes and highlights the traffic, latency, and errors for each node and its connections\. + +You can choose a node to see detailed insights about the correlated metrics, logs, and traces associated with that part of the service\. This enables you to investigate problems and their effect on an application\. + +**To view service map and traces using the CloudWatch console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Monitoring**\. + +1. Choose **View traces in X\-Ray**\. + +1. Choose **Service map**\. + +1. Choose from the predefined time ranges, or choose a custom time range\. + +1. To troubleshoot requests, choose a filter\. + +## Example AWS X\-Ray workflow to view trace details + +If you've enabled AWS X\-Ray, you can use the single\-function view on the CloudWatch Lambda Insights dashboard to show the distributed trace data of a function invocation error\. For example, if the application logs message shows an error, you can open the ServiceLens traces view to see the distributed trace data and the other services handling the transaction\. + +**To view trace details of a function** + +1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) in the CloudWatch console\. + +1. Choose the **Application logs** tab\. + +1. Use the **Timestamp** or **Message** to identify the invocation request that you want to troubleshoot\. + +1. To show the **Most recent 1000 invocations**, choose the **Invocations** tab\. +![\[Sorting the most recent 1000 invocations by request ID.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambainsights-invocations-request-id.png) + +1. Choose the **Request ID** column to sort entries in ascending alphabetical order\. + +1. In the **Trace** column, choose **View**\. + + The **Trace details** page opens in the ServiceLens traces view\. +![\[Function trace details in the ServiceLens traces view.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-trace-details.png) + +## What's next? ++ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. \ No newline at end of file diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 4dbaf14d..0955df5f 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Node\.js -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Node\.js runtime using the Lambda console and the AWS CLI\. @@ -68,24 +68,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 24c8bd92..b792b973 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. +When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 5f73c122..6f0b9f5f 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -13,7 +13,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example index\.js file – Logging** @@ -87,7 +87,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index f349ad9d..aaf33bdc 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -2,12 +2,12 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#node-package-prereqs) @@ -16,7 +16,7 @@ This page describes how to create a \.zip file as your deployment package, and t ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) @@ -59,7 +59,7 @@ To update a function by using the Lambda API, use the [UpdateFunctionCode](API_U ## Updating a function with additional dependencies -If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 44827ac0..0132ea20 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -46,7 +48,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** ``` { @@ -68,7 +70,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -119,7 +121,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -133,7 +135,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -150,7 +152,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 9b9c131d..bddd1d85 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in PowerShell -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. @@ -92,24 +92,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 4c265319..e0c81187 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -13,9 +13,9 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. + To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} @@ -97,7 +97,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index a4f8a519..83ee2cd5 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Python -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. @@ -44,24 +44,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index d4e4c1d3..4a022c55 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -10,7 +10,7 @@ def handler_name(event, context): return some_value ``` -## Naming +## Naming The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: + the name of the file in which the Lambda handler function is located @@ -108,7 +108,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 3211a16b..1d3fe7cb 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -14,7 +14,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.py** @@ -76,7 +76,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md new file mode 100644 index 00000000..46e2f92d --- /dev/null +++ b/doc_source/python-package-create.md @@ -0,0 +1,452 @@ +# Tutorial: Creating a Lambda function in Python 3\.8 + +This tutorial guides you through building the code and assets to create a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. + +**Topics** ++ [Prerequisites](#python-package-create-prereqs) ++ [Creating a function without runtime dependencies](#python-package-create-no-dependency) ++ [Creating a function with runtime dependencies](#python-package-create-with-dependency) + +## Prerequisites + +This section describes the tools and resources required to complete the steps in the tutorial\. + +### Install the AWS CLI + +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +### Create an execution role + +Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AWS Identity and Access Management \(IAM\) role that grants your function permission to access AWS services and resources\. Create an execution role in IAM with [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) permission\. + +**To create the execution role** + +1. Open a command prompt and use the [create\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. + +------ +#### [ macOS/Linux ] + + ``` + aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' + ``` + +------ +#### [ Windows ] + + ``` + aws iam create-role --role-name lambda-ex --assume-role-policy-document "{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}" + ``` + +------ + + This command produces the following output\. Save the value returned in `Arn`\. + + ``` + { + "Role": { + "Path": "/", + "RoleName": "lambda-ex", + "RoleId": "AROAWNZPPVHULXRJXQJD5", + "Arn": "arn:aws:iam::your-account-id:role/lambda-ex", + "CreateDate": "2021-01-05T18:00:30Z", + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + } + } + } + ``` + +1. Use the [attach\-role\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. + + ``` + $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + ``` + + This command produces no output\. + +## Creating a function without runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + + For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) + +This section describes how to create a Lambda function without runtime dependencies\. + +### Overview + +In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: ++ Set up the directory structure of a deployment package \(\.zip file\)\. ++ Create a deployment package for a Lambda function without any runtime dependencies\. ++ Use the AWS CLI to upload the deployment package and create the Lambda function\. ++ Invoke the Lambda function to return a mathematical calculation\. + +The sample code contains standard math and logging Python libraries, which are used to return a calculation based on user input\. Standard Python libraries are included with the `python3.8` [runtime](lambda-runtimes.md)\. Although the function's code doesn't depend on any other Python libraries and has no additional application dependencies, Lambda still requires a deployment package to create a function\. + +### Create the deployment package + +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. + +Create the \.zip file that Lambda uses as your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: + + ``` + mkdir my-math-function + ``` + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: + + ``` + my-math-function$ + | lambda_function.py + ``` + +1. Add the `lambda_function.py` file to the root of the \.zip file\. + + ``` + zip my-deployment-package.zip lambda_function.py + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: lambda_function.py (deflated 50%) + ``` + +### Create the Lambda function + +Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. + +Create the Lambda function using the execution role and deployment package that you created in the previous steps\. + +**To create the function** + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Create a function named `my-math-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. + + ``` + aws lambda create-function --function-name my-math-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex + ``` + + This command produces the following output: + + ``` + { + "FunctionName": "my-math-function", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-math-function", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-ex", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 753, + "Description": "", + "Timeout": 3, + "MemorySize": 128, + "LastModified": "2021-01-05T18:39:44.847+0000", + "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", + "Version": "$LATEST", + "TracingConfig": { + "Mode": "PassThrough" + }, + "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", + "State": "Active", + "LastUpdateStatus": "Successful" + } + ``` + + The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +### Invoke the Lambda function + +Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. + +**To invoke the function** ++ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. + +------ +#### [ macOS/Linux ] + + ``` + aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt + ``` + +------ +#### [ Windows ] + + ``` + aws lambda invoke --function-name my-math-function --cli-binary-format raw-in-base64-out --payload "{"action": "square","number": 3}" output.txt + ``` + +------ + + This command produces the following output: + + ``` + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + ``` + + For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. + + You should see the following mathematical calculation in `output.txt`: + + ``` + {"result": 9} + ``` + +### What's next? ++ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. ++ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. ++ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. + +### Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** ++ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. + + ``` + aws lambda delete-function --function-name my-function + ``` + + This command produces no output\. + +**To delete the execution role policy** ++ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. + + ``` + aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole + ``` + +**To delete the execution role** ++ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. + + ``` + aws iam delete-role --role-name lambda-ex + ``` + +## Creating a function with runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) + +This section describes how to create a Lambda function with runtime dependencies\. + +### Overview + +In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://docs\.aws\.amazon\.com/](https://docs.aws.amazon.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. + +You'll learn how to: ++ Set up the directory structure of a deployment package \(\.zip file\)\. ++ Create a deployment package for a Lambda function with runtime dependencies\. ++ Use the AWS CLI to upload the deployment package and create the Lambda function\. ++ Invoke the Lambda function to return the source code\. + +### Create the deployment package + +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. + +Create the \.zip file that Lambda uses as your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: + + ``` + mkdir my-sourcecode-function + ``` + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: + + ``` + import requests + def main(event, context): + response = requests.get("https://docs.aws.amazon.com") + print(response.text) + return response.text + if __name__ == "__main__": + main('', '') + ``` + + Your directory structure should look like this: + + ``` + my-sourcecode-function$ + | lambda_function.py + ``` + +1. Install the requests library to a new `package` directory\. + + ``` + pip install --target ./package requests + ``` + +1. Create a deployment package with the installed library at the root\. + + ``` + cd package + zip -r ../my-deployment-package.zip . + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: chardet/ (stored 0%) + adding: chardet/enums.py (deflated 58%) + ... + ``` + +1. Add the `lambda_function.py` file to the root of the zip file\. + + ``` + cd .. + zip -g my-deployment-package.zip lambda_function.py + ``` + +### Create the Lambda function + +Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. + +Create the Lambda function using the execution role and deployment package that you created in the previous steps\. + +**To create the function** + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Create a function named `my-sourcecode-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. + + ``` + aws lambda create-function --function-name my-sourcecode-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.main --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex + ``` + + This command produces the following output: + + ``` + { + "FunctionName": "my-sourcecode-function", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-sourcecode-function", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-ex", + "Handler": "lambda_function.main", + "CodeSize": 753, + "Description": "", + "Timeout": 3, + "MemorySize": 128, + "LastModified": "2021-01-11T18:39:44.847+0000", + "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", + "Version": "$LATEST", + "TracingConfig": { + "Mode": "PassThrough" + }, + "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", + "State": "Active", + "LastUpdateStatus": "Successful" + } + ``` + + The Lambda function in this step uses a function handler of `lambda_function.main`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +### Invoke the Lambda function + +Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. + +**To invoke the function** ++ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. + +------ +#### [ macOS/Linux ] + + ``` + aws lambda invoke --function-name requests-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + ``` + +------ +#### [ Windows ] + + ``` + aws lambda invoke --function-name requests-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + ``` + +------ + + This command produces the following output: + + ``` + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + ``` + + For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. + + You should see the source code in `output.txt`\. + +### What's next? ++ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. ++ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. ++ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. + +### Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** ++ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. + + ``` + aws lambda delete-function --function-name my-function + ``` + + This command produces no output\. + +**To delete the execution role policy** ++ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. + + ``` + aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole + ``` + +**To delete the execution role** ++ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. + + ``` + aws iam delete-role --role-name lambda-ex + ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md new file mode 100644 index 00000000..3c734766 --- /dev/null +++ b/doc_source/python-package-update.md @@ -0,0 +1,216 @@ +# Updating a Lambda function in Python 3\.8 + +This tutorial guides you through the process of installing a Python library, creating a deployment package, and updating a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. + +The following steps assume that you have created a Lambda function and are updating the \.zip file used as your deployment package\. If you haven't created a function yet, see [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md)\. + +**Topics** ++ [Prerequisites](#python-package-update-prereqs) ++ [Updating a function without runtime dependencies](#python-package-update-codeonly) ++ [Updating a function with runtime dependencies](#python-package-update-dependencies) ++ [Using a virtual environment](#python-package-update-venv) + +## Prerequisites + +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: ++ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) ++ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) + +## Updating a function without runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + +The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. + +**To update a Python function without runtime dependencies** + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function$ zip my-deployment-package.zip lambda_function.py + ``` + +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 815, + "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", + "Version": "$LATEST", + "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +## Updating a function with runtime dependencies + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + +For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. + +**Note** +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. + +**To update a Python function with dependencies** + +1. Install libraries in a `package` directory with `pip`'s `--target` option\. + + ``` + ~/my-function$ pip install --target ./package requests + ``` +**Note** +To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. + +1. Navigate to the `package` directory\. + + ``` + cd package + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$ zip -r ../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. + +1. Navigate back to the `my-function` directory\. + + ``` + cd .. + ``` + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 2269409, + "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", + "Version": "$LATEST", + "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. + +## Using a virtual environment + +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. + + For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. + + The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. + +**Note** +If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. + +**To update a Python function with a virtual environment** + +1. Activate the virtual environment\. For example: + + ``` + ~/my-function$ source myvenv/bin/activate + ``` + +1. Install libraries with pip\. + + ``` + (myvenv) ~/my-function$ pip install requests + ``` + +1. Deactivate the virtual environment\. + + ``` + (myvenv) ~/my-function$ deactivate + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$ cd myvenv/lib/python3.8/site-packages + ~/my-function/myvenv/lib/python3.8/site-packages$ cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. + + ``` + ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 5912988, + "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", + "Version": "$LATEST", + "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", + ... + } + ``` + +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index ceeba98a..b46c5ede 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -2,239 +2,33 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#python-package-prereqs) -+ [Updating a function with no dependencies](#python-package-codeonly) -+ [Updating a function with additional dependencies](#python-package-dependencies) -+ [Using a virtual environment](#python-package-venv) ++ [What is a runtime dependency?](#python-package-dependencies) ++ [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md) ++ [Updating a Lambda function in Python 3\.8](python-package-update.md) ## Prerequisites -The following steps assume that you have created a Lambda function, and are updating the deployment package for your function\. If you haven't created a function yet, see [Building Lambda functions with Python](lambda-python.md)\. - -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) -## Updating a function with no dependencies - -The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. - -**To update a Python function with no dependencies** - -1. Add function code files to the root of your deployment package\. - - ``` - zip my-deployment-package.zip lambda_function.py - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 815, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", - ... - } - ``` - -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. - -## Updating a function with additional dependencies - -If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. - -**Note** -Make sure that the files and directories in the deployment package have their permissions set to be globally readable, so that Lambda can import your Python modules at runtime\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with dependencies** - -1. Install libraries in a `package` directory with `pip`'s `--target` option\. - - ``` - pip install --target ./package requests - ``` -**Note** -To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. - -1. Navigate to the `package` directory\. - - ``` - cd package - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - zip -r ../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. - -1. Navigate back to the `my-function` directory\. - - ``` - cd.. - ``` - -1. Add function code files to the root of your deployment package\. - - ``` - zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 2269409, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", - ... - } - ``` - -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. - -## Using a virtual environment - -If your Lambda function depends on libraries other than the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), install the libraries to a local directory with [pip](https://pypi.org/project/pip/), and include them in your deployment package \(\.zip file\)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are using the [virtualenv](https://docs.python.org/3/library/venv.html) module for a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with a virtual environment** - -1. Create a virtual environment\. - - ``` - virtualenv myvenv - ``` -**Note** -The [virtualenv](https://docs.python.org/3/library/venv.html) module uses Python 2\.7 by default\. You may need to add a local export path to your command line profile, such as `export VIRTUALENV_PYTHON=/usr/bin/python3.8` when using the *virtualenv* module with Python 3 and pip 3\. - -1. Activate the environment\. - - ``` - source myvenv/bin/activate - ``` - -1. Install libraries with pip\. - - ``` - pip install requests - ``` - -1. Deactivate the virtual environment\. - - ``` - deactivate - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. -**Tip** -A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. - -1. Add function code files to the root of your deployment package\. - - ``` - cd ../../../../ - zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. +## What is a runtime dependency? - ``` - aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - ``` +A [deployment package](gettingstarted-package.md) is required to create or update a Lambda function with or without runtime dependencies\. The deployment package acts as the source bundle to run your function's code and dependencies \(if applicable\) on Lambda\. - You should see the following output: +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](#python-package)\. - ``` - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 5912988, - "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", - "Version": "$LATEST", - "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", - ... - } - ``` +The following example describes a Lambda function without runtime dependencies: ++ If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. ++ If your function's code depends only on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with the `python3.8` runtime\. -The Lambda function in the last step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [AWS Lambda function handler in Python](python-handler.md)\. \ No newline at end of file +For a complete list of AWS SDKs, see [Tools to Build on AWS](http://aws.amazon.com/tools/)\. \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 35b517d7..c6b364fe 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -42,7 +44,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -97,7 +99,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -111,7 +113,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -128,7 +130,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index be98e869..e28640b7 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -1,6 +1,6 @@ # AWS Lambda function errors in Ruby -You can invoke your AWS Lambda function with a test payload and view the output on the Lambda console, the AWS Command Line Interface \(AWS CLI\), using Lambda APIs, or the AWS SDK\. When your Lambda function's code raises an error, Lambda generates a JSON representation of the error that is returned to an invocation log and, for synchronous invocations, in the output\. +When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Ruby runtime using the Lambda console and the AWS CLI\. @@ -69,24 +69,23 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Choose a function\. -1. Choose **Configure test events** from the drop\-down menu next to the **Test** button\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-test-config.png) +1. Choose **Test**\. -1. Choose an **Event template** from the dropdown list\. +1. Select **New event** and then choose an **Event template** from the dropdown list\. 1. Enter a name for the test event\. 1. Enter the JSON for the test event\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 1eb563fa..12d7b277 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -13,7 +13,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs -After your function finishes processing an event, Lambda sends metrics about the invocation to CloudWatch\. You can also create a Lambda function that returns logs for the invocation\. To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. + To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. **Example lambda\_function\.rb** @@ -109,7 +109,7 @@ To use a sample application that correlates logs and traces with X\-Ray, see [Er ## Using the AWS Command Line Interface \(AWS CLI\) -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 7144e0d4..cd066b9e 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -2,12 +2,12 @@ Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. -You can use a built\-in ZIP archive utility, or any other ZIP utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool to create a deployment package\. -+ The \.zip file must contain your function's code, and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you do not need to include the libraries in your \.zip file\. These libraries are included with our supported [Lambda runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) environments\. -+ If your \.zip file is larger than 50 MB, we recommend uploading it to an Amazon S3 bucket\. For more information, see [Using other AWS services to build a deployment package](gettingstarted-package.md)\. -+ If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) library, we recommend using the AWS SAM CLI to build a deployment package\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. +To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. -This page describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package-zip)\. +This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#ruby-package-prereqs) @@ -17,7 +17,7 @@ This page describes how to create a \.zip file as your deployment package, and t ## Prerequisites -The AWS Command Line Interface \(AWS CLI\) is an open source tool that enables you to interact with AWS services using commands in your command\-line shell\. To complete the steps in this section, you need the following: +The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: + [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) + [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 55ffaa4e..352aea1b 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -33,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -46,7 +48,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -99,7 +101,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -113,7 +115,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -130,7 +132,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 432d4f33..83024158 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -17,7 +17,7 @@ Using language\-specific environment variables is the preferred way to set start The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. -The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. +The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. ``` import com.amazonaws.services.lambda.runtime.RequestStreamHandler; @@ -198,7 +198,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Add the layer to your function\. - 1. On the [configuration page](configuration-console.md), choose **Layers**\. + 1. Choose your function, and then choose **Code** if it is not already selected\. 1. Choose **Add a layer**\. @@ -223,7 +223,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Choose **Save**\. - 1. Under **Environment variables**, choose **Manage environment variables**\. + 1. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index a2357ac0..b6f91318 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -78,7 +78,7 @@ The application template uses an AWS Serverless Application Model \(AWS SAM\) re The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Serverless resources** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** ``` AWSTemplateFormatVersion: '2010-09-09' @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 19a44d70..ad43ed3b 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,8 +5,8 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index a7247d54..86415c56 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,8 +7,8 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index cb626549..58b86895 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -40,9 +40,13 @@ In this step, you will use the console to test the Lambda function\. In addition **To test the API** -1. With your `lambda-microservice` function still open in the console, in the upper right hand corner of the console, choose **Test**\. +1. With your `lambda-microservice` function still open in the console, choose the **Test** tab\. -1. In **Event name**, enter a name for the test event\. +1. Choose **New event**\. + +1. Choose the **Hello World** template\. + +1. In **Name**, enter a name for the test event\. 1. In the text entry panel, replace the existing text with the following: @@ -55,6 +59,6 @@ In this step, you will use the console to test the Lambda function\. In addition } ``` -1. After entering the text above choose **Create**\. +1. After entering the text above choose **Create event**\. -1. Choose the event that you created and choose **Test**\. \ No newline at end of file +1. Choose the event that you created and choose **Invoke**\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 344eb18f..a77a1bb0 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -534,7 +534,7 @@ curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\ ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 0644383b..d0be5212 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -8,9 +8,9 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Functional overview**, choose **Add trigger**\. -1. Choose **API Gateway**\. +1. Select **API Gateway**\. 1. For **API**, choose **Create an API**\. @@ -18,10 +18,6 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. Choose **Add**\. -With the **API Gateway** trigger selected in the designer, choose the endpoint to invoke the function with API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-apig-endpoint.png) - API Gateway APIs are comprised of stages, resources, methods, and integrations\. The stage and resource determine the path of the endpoint: **API path format** @@ -34,7 +30,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -79,7 +75,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -207,7 +203,7 @@ The following example shows an X\-Ray trace map for a request that resulted in a To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -255,7 +251,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6b2ba087..6ff099f0 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index a592cf3a..80f942db 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -45,15 +45,15 @@ Test the function with a sample event provided by the Lambda console\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **lambda\-canary**\. +1. Choose the **lambda\-canary** function\. -1. Next to the **Test** button at the top of the page, choose **Configure test events** from the drop\-down menu\. +1. Choose **Test**\. 1. Create a new event using the **CloudWatch Events** event template\. -1. Choose **Create**\. +1. Choose **Create event**\. -1. Choose **Test**\. +1. Choose **Invoke**\. The output from the function execution is shown at the top of the page\. @@ -113,9 +113,9 @@ Update the function configuration to cause the function to return an error, whic 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose **lambda\-canary**\. +1. Choose the **lambda\-canary** function\. -1. Under **Environment variables**, choose **Edit**\. +1. Scroll down\. Under **Environment variables**, choose **Edit**\. 1. Set **expected** to **404**\. @@ -125,7 +125,7 @@ Wait a minute, and then check your email for a message from Amazon SNS\. ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 3c131066..cb53ee42 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -56,7 +56,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Choose a function -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Set the trigger type to **CloudWatch Events/EventBridge**\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index e0f41bf8..701a36a0 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -51,11 +51,11 @@ Standard charges apply for each service\. ## Review the code -Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. +Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. The `Function` class includes a `FunctionHandler` method that calls other methods to create spot requests, check their status, and clean up\. It creates an Amazon EC2 client with the AWS SDK for \.NET in a static constructor to allow it to be used throughout the class\. -**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** +**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 7d1a7434..356f6507 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -138,7 +138,7 @@ Now that you have created a Lambda function that accesses an ElastiCache cluster ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index 66e2c48a..366582cc 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -24,7 +24,7 @@ You need to grant permission for the AWS IoT service to invoke your Lambda funct ``` aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com +--statement-id iot-events --action "lambda:InvokeFunction" --principal iot.amazonaws.com ``` You should see the following output: diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 04b9c692..87d49a38 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -30,7 +30,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. Choose the name of your Lambda function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Under **Trigger configuration**, choose the **MSK** trigger type\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 98f38168..ec9474d1 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -92,7 +92,7 @@ logger = logging.getLogger() logger.setLevel(logging.INFO) try: - conn = pymysql.connect(rds_host, user=name, passwd=password, db=db_name, connect_timeout=5) + conn = pymysql.connect(host=rds_host, user=name, passwd=password, db=db_name, connect_timeout=5) except pymysql.MySQLError as e: logger.error("ERROR: Unexpected error: Could not connect to MySQL instance.") logger.error(e) @@ -173,7 +173,7 @@ Now that you have created a Lambda function that accesses a database in your VPC ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md index ebbaa92f..0e525069 100644 --- a/doc_source/services-smaa-topic-add.md +++ b/doc_source/services-smaa-topic-add.md @@ -1,4 +1,4 @@ -# Adding a Self\-managed Apache Kafka cluster as an event source +# Adding a self\-managed Apache Kafka cluster as an event source You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. @@ -6,11 +6,11 @@ This section describes how to add your Kafka cluster and topic as a function tri ## Prerequisites + A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a Self\-managed Apache Kafka cluster](smaa-permissions.md)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. -## Adding a Self\-managed Apache Kafka cluster using the Lambda console +## Adding a self\-managed Apache Kafka cluster using the Lambda console -Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. **To add an Apache Kafka trigger to your Lambda function \(console\)** @@ -18,15 +18,15 @@ Follow these steps to add your Self\-managed Apache Kafka cluster and a Kafka to 1. Choose the name of your Lambda function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. 1. Configure the remaining options, and then choose **Add**\. -## Adding a Self\-managed Apache Kafka cluster using the AWS CLI +## Adding a self\-managed Apache Kafka cluster using the AWS CLI -Use the following example AWS CLI commands to create and view a Self\-managed Apache Kafka trigger for your Lambda function\. +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. ### Using SASL/SCRAM diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md index f17599c6..78802d24 100644 --- a/doc_source/services-stepfunctions.md +++ b/doc_source/services-stepfunctions.md @@ -23,7 +23,7 @@ Step Functions can invoke Lambda functions directly from a `Task` state in an [A You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** ``` { diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index d9294ca1..39fe6edb 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -14,9 +14,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose a function\. -1. Under **Monitoring tools**, choose **Edit**\. +1. Choose **Configuration** and then choose **Monitoring tools**\. -1. Choose **Active tracing** on the **AWS X\-Ray** pane\. +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -90,7 +92,7 @@ Tracing mode is part of the version\-specific configuration that is locked when To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/function-inline.yml) – Tracing configuration** +**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** ``` Resources: @@ -104,7 +106,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md index 4f0c5452..7da4dcd6 100644 --- a/doc_source/smaa-permissions.md +++ b/doc_source/smaa-permissions.md @@ -1,4 +1,4 @@ -# Managing access and permissions for a Self\-managed Apache Kafka cluster +# Managing access and permissions for a self\-managed Apache Kafka cluster Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. @@ -25,7 +25,7 @@ Your Lambda function might need permission to describe your Secrets Manager secr ### VPC permissions -If only users within your VPC access your Self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -35,9 +35,9 @@ If only users within your VPC access your Self\-managed Apache Kafka cluster, yo ## Adding permissions to your execution role -To access other AWS services that your Self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. -By default, Lambda isn't permitted to perform the required or optional actions for a Self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. ``` { @@ -67,7 +67,7 @@ By default, IAM users and roles don't have permission to perform [event source A ## Using SASL/SCRAM authentication -User name and password authentication for a Self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 79dc5f53..a9eba472 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -4,6 +4,8 @@ When you update your function, Lambda deploys the change by launching new instan When you deploy updates to your function directly with the Lambda API or with a client such as the AWS CLI, you can see errors from Lambda directly in the output\. If you use services like AWS CloudFormation, AWS CodeDeploy, or AWS CodePipeline, look for the response from Lambda in the logs or event stream for that service\. +## General: Permission is denied / Cannot load such file + **Error:** *EACCES: permission denied, open '/var/task/index\.js'* **Error:** *cannot load such file \-\- function* @@ -17,6 +19,8 @@ chmod 644 $(find . -type f) chmod 755 $(find . -type d) ``` +## General: Error occurs when calling the UpdateFunctionCode + **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. @@ -24,10 +28,14 @@ When you upload a deployment package or layer archive directly to Lambda, the si **Note** When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +## Amazon S3: Error Code PermanentRedirect\. + **Error:** *Error occurred while GetObject\. S3 Error Code: PermanentRedirect\. S3 Error Message: The bucket is in this region: us\-east\-2\. Please use this region to retry the request* When you upload a function's deployment package from an Amazon S3 bucket, the bucket must be in the same Region as the function\. This issue can occur when you specify an Amazon S3 object in a call to [UpdateFunctionCode](API_UpdateFunctionCode.md), or use the package and deploy commands in the AWS CLI or AWS SAM CLI\. Create a deployment artifact bucket for each Region where you develop applications\. +## General: Cannot find, cannot load, unable to import, class not found, no such file or directory + **Error:** *Cannot find module 'function'* **Error:** *cannot load such file \-\- function* @@ -42,6 +50,8 @@ When you upload a function's deployment package from an Amazon S3 bucket, the bu The name of the file or class in your function's handler configuration doesn't match your code\. See the following entry for more information\. +## General: Undefined method handler + **Error:** *index\.handler is undefined or not exported* **Error:** *Handler 'handler' missing on module 'function'* @@ -63,6 +73,8 @@ For some languages, Lambda provides a library with an interface that expects a h + [Building Lambda functions with C\#](lambda-csharp.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) +## Lambda: InvalidParameterValueException or RequestEntityTooLargeException + **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided exceeded the 4KB limit\. String measured: \{"A1":"uSFeY5cyPiPn7AtnX5BsM\.\.\.* **Error:** *RequestEntityTooLargeException: Request must be smaller than 5120 bytes for the UpdateFunctionConfiguration operation* @@ -87,6 +99,8 @@ The maximum size of the variables object that is stored in the function's config In this example, the object is 39 characters and takes up 39 bytes when it's stored \(without white space\) as the string `{"BUCKET":"my-bucket","KEY":"file.txt"}`\. Standard ASCII characters in environment variable values use one byte each\. Extended ASCII and Unicode characters can use between 2 bytes and 4 bytes per character\. +## Lambda: InvalidParameterValueException + **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 4baab296..be5f6ba8 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -6,10 +6,14 @@ Function execution errors can be caused by issues with your code, function confi When your function code or the Lambda runtime return an error, the status code in the response from Lambda is 200 OK\. The presence of an error in the response is indicated by a header named `X-Amz-Function-Error`\. 400 and 500\-series status codes are reserved for [invocation errors](troubleshooting-invocation.md)\. +## Lambda: Execution takes too long + **Issue:** *Function execution takes too long\.* If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-console.md) to increase both memory and CPU\. +## Lambda: Logs or traces don't appear + **Issue:** *Logs don't appear in CloudWatch Logs\.* **Issue:** *Traces don't appear in AWS X\-Ray\.* @@ -20,6 +24,8 @@ Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [ When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +## Lambda: The function returns before execution finishes + **Issue: \(Node\.js\)** *Function returns before code finishes executing* Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. @@ -28,6 +34,8 @@ To wait for the promise to resolve into a response, use the `await` keyword\. Th Some libraries don't return promises but can be wrapped in code that does\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. +## AWS SDK: Versions and updates + **Issue:** *The AWS SDK included on the runtime is not the latest version* **Issue:** *The AWS SDK included on the runtime updates automatically* @@ -41,6 +49,8 @@ Runtimes for scripting languages include the AWS SDK and are periodically update + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) +## Python: Libraries load incorrectly + **Issue:** \(Python\) *Some libraries don't load correctly from the deployment package* Libraries with extension modules written in C or C\+\+ must be compiled in an environment with the same processor architecture as Lambda \(Amazon Linux\)\. For more information, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index c02eca30..dbfc8d50 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -1,13 +1,19 @@ # Troubleshoot container image issues in Lambda +## Container: Error occurs on runtime InvalidEntrypoint + **Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. +## Lambda: System provisioning additonal capacity + **Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* Retry the function invocation\. If the retry fails, validate that the files required to run the function code can be read by any user\. Lambda defines a default Linux user with least\-privileged permissions\. You need to verify that your application code does not rely on files that are restricted by other Linux users for execution\. +## CloudFormation: ENTRYPOINT is being overridden with a null or empty value + **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 0c874220..0ac5dda8 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -6,6 +6,8 @@ If you invoke your function directly, you see any invocation errors in the respo For a list of error types that the `Invoke` operation can return, see [Invoke](API_Invoke.md)\. +## IAM: lambda:InvokeFunction not authorized + **Error:** *User: arn:aws:iam::123456789012:user/developer is not authorized to perform: lambda:InvokeFunction on resource: my\-function* Your AWS Identity and Access Management \(IAM\) user, or the role that you assume, must have permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the AWS managed policy **AWSLambdaRole** to your IAM user, or add a custom policy that allows the `lambda:InvokeFunction` action on the target function\. @@ -15,12 +17,16 @@ Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeF For more information, see [AWS Lambda permissions](lambda-permissions.md)\. +## Lambda: Operation cannot be performed ResourceConflictException + **Error:** *ResourceConflictException: The operation cannot be performed at this time\. The function is currently in the following state: Pending* When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +## Lambda: Function is stuck in Pending + **Error:** *A function is stuck in the `Pending` state for several minutes\.* If a function is stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it: @@ -30,18 +36,26 @@ If a function is stuck in the `Pending` state for more than six minutes, call on Lambda cancels the pending operation and puts the function into the `Failed` state\. You can then delete the function and recreate it, or attempt another update\. +## Lambda: One function is using all concurrency + **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* To divide your AWS account's available concurrency in an AWS Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and that it doesn't scale beyond its assigned concurrency\. +## General: Cannot invoke function with other accounts or services + **Issue:** *You can invoke your function directly, but it doesn't run when another service or account invokes it\.* You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user must also have [permission to invoke functions](access-control-identity-based.md)\. +## General: Function invocation is looping + **Issue:** *Function is invoked continuously in a loop\.* This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +## Lambda: Cold starts with provisioned concurrency + **Issue:** *You see cold starts after enabling provisioned concurrency\.* When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: @@ -55,10 +69,14 @@ Provisioned concurrency is not configurable on the [$LATEST version](configurati **Note** There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. +## Lambda: Latency variability with provisioned concurrency + **Issue:** *You see latency variability on the first invocation after enabling provisioned concurrency\.* Depending on your function's runtime and memory configuration, it's possible to see some latency variability on the first invocation on an initialized execution environment\. For example, \.NET and other JIT runtimes can lazily load resources on the first invocation, leading to some latency variability \(typically tens of milliseconds\)\. This variability is more apparent on 128\-MiB functions\. You mitigate this by increasing the function's configured memory\. +## Lambda: Cold starts with new versions + **Issue:** *You see cold starts while deploying new versions of your function\.* When you update a function alias, Lambda automatically shifts provisioned concurrency to the new version based on the weights configured on the alias\. @@ -67,18 +85,26 @@ When you update a function alias, Lambda automatically shifts provisioned concur This error can occur if your AWS Key Management Service \(AWS KMS\) key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then, reassign the custom key to recreate the grant\. +## EFS: Function could not mount the EFS file system + **Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* The mount request to the function's [file system](configuration-filesystem.md) was rejected\. Check the function's permissions, and confirm that its file system and access point exist and are ready for use\. +## EFS: Function could not connect to the EFS file system + **Error:** *EFSMountConnectivityException: The function couldn't connect to the Amazon EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\. Check your network configuration and try again\.* The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. +## EFS: Function could not mount the EFS file system due to timeout + **Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out\.* The function could connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. +## Lambda: Lambda detected an IO process that was taking too long + *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md index 6436661f..b5bf14db 100644 --- a/doc_source/troubleshooting-networking.md +++ b/doc_source/troubleshooting-networking.md @@ -4,6 +4,8 @@ By default, Lambda runs your functions in an internal virtual private cloud \(VP Network connectivity errors can result from issues in routing configuration, security group rules, role permissions, network address translation, or the availability of resources such as IP addresses or network interfaces\. They may result in a specific error or, if a request can't reach its destination, a timeout\. +## VPC: Function loses internet access or times out + **Issue:** *Function loses internet access after connecting to a VPC* **Error:** *Error: connect ETIMEDOUT 176\.32\.98\.189:443* @@ -12,10 +14,14 @@ Network connectivity errors can result from issues in routing configuration, sec When you connect a function to a VPC, all outbound requests go through your VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +## VPC: Function needs access to AWS services without using the internet + **Issue:** *Function needs access to AWS services without using the internet* To connect to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample template with VPC endpoints for DynamoDB and Amazon S3, see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. +## VPC: Limit was reached for the function's VPC + **Error:** *ENILimitReachedException: The elastic network interface limit was reached for the function's VPC\.* When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. These network interfaces are limited to 250 per VPC, but this limit can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 593225cf..6e5c559a 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -73,9 +73,9 @@ You add the extension to your function using the same method as you would for an 1. Choose a function\. -1. Under **Designer**, choose **Layers**\. +1. Choose the **Code** tab if it is not already selected\. -1. Under **Layers**, choose **Add a layer**\. +1. Under **Layers**, choose **Edit**\. 1. For **Choose a layer**, choose **Specify an ARN**\. diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index a188584c..f60ffb50 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -258,7 +258,7 @@ Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 0f447c31..27af38ec 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -120,7 +120,7 @@ To configure your function to read from DynamoDB Streams in the Lambda console, 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -269,7 +269,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Stream invocation**\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 06d5f5b8..5b834fd6 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -207,7 +207,7 @@ Lambda uses the execution role to read records from the stream\. Then it invokes ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the execution role** diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index fa7e336c..8ed04e40 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -133,7 +133,7 @@ To configure your function to read from Kinesis in the Lambda console, create a 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -287,7 +287,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. 1. Choose a function\. -1. Under **Designer**, choose **Add destination**\. +1. Under **Function overview**, choose **Add destination**\. 1. For **Source**, choose **Stream invocation**\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index f9920a57..629953a6 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -102,7 +102,7 @@ To configure your function to read from Amazon MQ, create an **MQ** trigger in t 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. @@ -115,7 +115,7 @@ Lambda supports the following options for Amazon MQ event sources: + **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. + **Enable trigger** – Disable the trigger to stop processing records\. -To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the [designer](getting-started-create-function.md#get-started-designer)\. To reconfigure the trigger, use the event source mapping API operations\. +To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the designer\. To reconfigure the trigger, use the event source mapping API operations\. ## Event source mapping API diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 816a8c24..f6e46ff1 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -401,7 +401,7 @@ Now you can test the setup as follows: ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index d9bae04a..5af476de 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -167,7 +167,7 @@ To learn more about Amazon SNS, see [What is Amazon Simple Notification Service] ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Amazon SNS topic** diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index 7e1167be..c9564cb0 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -49,9 +49,9 @@ For more information, see [Fanout to Lambda functions](https://docs.aws.amazon.c **Input types for Amazon SNS events** For input type examples for Amazon SNS events in Java, \.NET, and Go, see the following on the AWS GitHub repository: -+ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/main/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) -+ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/main/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) -+ [sns\.go](https://github.com/aws/aws-lambda-go/blob/main/events/sns.go) ++ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) ++ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) ++ [sns\.go](https://github.com/aws/aws-lambda-go/blob/master/events/sns.go) **Topics** + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index efe9beea..be7557a0 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -162,7 +162,7 @@ Now you can test the setup as follows: ## Clean up your resources -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you are no longer using, you prevent unnecessary charges to your AWS account\. +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the execution role** diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index ea24fdfe..d2f55610 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -121,7 +121,7 @@ To configure your function to read from Amazon SQS in the Lambda console, create 1. Choose a function\. -1. Under **Designer**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. From 98e81c60494c26cdd8cab485d54193b5c1d7d673 Mon Sep 17 00:00:00 2001 From: Ali Vest Date: Thu, 4 Mar 2021 22:43:04 +0000 Subject: [PATCH 070/243] Periodic update --- doc_source/go-image.md | 2 +- doc_source/golang-handler.md | 2 +- doc_source/services-iot.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 85566819..98a70933 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -165,4 +165,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. +For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 807c222f..6d9032d1 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -176,4 +176,4 @@ func LambdaHandler() (int, error) { func main() { lambda.Start(LambdaHandler) } -``` +``` \ No newline at end of file diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md index a1e3dfbf..366582cc 100644 --- a/doc_source/services-iot.md +++ b/doc_source/services-iot.md @@ -35,4 +35,4 @@ You should see the following output: } ``` -For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. +For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. \ No newline at end of file From 3de4c5101e2e04739ec1b10a50fc3e91f90bb264 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Wed, 10 Mar 2021 12:13:38 -0800 Subject: [PATCH 071/243] update Handler.java in java-basic sample to address issues #247 and #248 --- sample-apps/java-basic/src/main/java/example/Handler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index 5d8d9ab2..94834f20 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -16,13 +16,13 @@ public class Handler implements RequestHandler, String>{ public String handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); - String response = new String("200 OK"); + String response = "200 OK"; // log execution details logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); logger.log("CONTEXT: " + gson.toJson(context)); // process event logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.log("EVENT TYPE: " + event.getClass()); return response; } } \ No newline at end of file From 3778e90ec0e3e0ae151ddc63145b20ef188a9121 Mon Sep 17 00:00:00 2001 From: Alex Hedley Date: Thu, 11 Mar 2021 12:17:43 +0000 Subject: [PATCH 072/243] Update python formatting --- doc_source/with-sqs-create-package.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 6723b172..46650be2 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -144,11 +144,12 @@ Follow the instructions to create a AWS Lambda function deployment package\. ``` from __future__ import print_function + def lambda_handler(event, context): for record in event['Records']: - print ("test") - payload=record["body"] - print(str(payload)) + print("test") + payload = record["body"] + print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 0e9f498baaba549788f3c90c1396d37fdcb5c45e Mon Sep 17 00:00:00 2001 From: JamesJJ Date: Sat, 13 Mar 2021 12:30:15 +0800 Subject: [PATCH 073/243] Improve Go code example --- doc_source/services-apigateway-code.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index 594b4580..c8d5fd7a 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -119,11 +119,19 @@ The following example processes messages from API Gateway, and logs information **Example LambdaFunctionOverHttps\.go** ``` +package main + import ( - "strings" + "context" + "fmt" "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" ) +func main() { + runtime.Start(handleRequest) +} + func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) fmt.Printf("Body size = %d.\n", len(request.Body)) @@ -133,7 +141,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) ( fmt.Printf(" %s: %s\n", key, value) } - return events.APIGatewayProxyResponse { Body: request.Body, StatusCode: 200 }, nil + return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil } ``` From 9cddb205087dc9739a3e83c66258715c7f53a783 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 19 Mar 2021 09:50:56 -0700 Subject: [PATCH 074/243] Documentation updates --- doc_source/API_AccountLimit.md | 2 +- doc_source/API_AccountUsage.md | 2 +- doc_source/API_AddLayerVersionPermission.md | 6 +- doc_source/API_AddPermission.md | 2 +- doc_source/API_AliasConfiguration.md | 2 +- doc_source/API_AliasRoutingConfiguration.md | 2 +- doc_source/API_AllowedPublishers.md | 2 +- doc_source/API_CodeSigningConfig.md | 2 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_Concurrency.md | 2 +- doc_source/API_CreateAlias.md | 2 +- doc_source/API_CreateCodeSigningConfig.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 88 +++++++++-- doc_source/API_CreateFunction.md | 101 ++++++++++-- doc_source/API_DeadLetterConfig.md | 2 +- doc_source/API_DeleteAlias.md | 2 +- doc_source/API_DeleteCodeSigningConfig.md | 2 +- doc_source/API_DeleteEventSourceMapping.md | 45 +++++- doc_source/API_DeleteFunction.md | 2 +- .../API_DeleteFunctionCodeSigningConfig.md | 2 +- doc_source/API_DeleteFunctionConcurrency.md | 2 +- .../API_DeleteFunctionEventInvokeConfig.md | 2 +- doc_source/API_DeleteLayerVersion.md | 2 +- .../API_DeleteProvisionedConcurrencyConfig.md | 2 +- doc_source/API_DestinationConfig.md | 2 +- doc_source/API_Environment.md | 2 +- doc_source/API_EnvironmentError.md | 2 +- doc_source/API_EnvironmentResponse.md | 2 +- .../API_EventSourceMappingConfiguration.md | 41 ++++- doc_source/API_FileSystemConfig.md | 2 +- doc_source/API_FunctionCode.md | 9 +- doc_source/API_FunctionCodeLocation.md | 12 +- doc_source/API_FunctionConfiguration.md | 35 ++++- doc_source/API_FunctionEventInvokeConfig.md | 2 +- doc_source/API_GetAccountSettings.md | 2 +- doc_source/API_GetAlias.md | 2 +- doc_source/API_GetCodeSigningConfig.md | 2 +- doc_source/API_GetEventSourceMapping.md | 45 +++++- doc_source/API_GetFunction.md | 24 ++- .../API_GetFunctionCodeSigningConfig.md | 2 +- doc_source/API_GetFunctionConcurrency.md | 2 +- doc_source/API_GetFunctionConfiguration.md | 49 +++++- .../API_GetFunctionEventInvokeConfig.md | 2 +- doc_source/API_GetLayerVersion.md | 8 +- doc_source/API_GetLayerVersionByArn.md | 8 +- doc_source/API_GetLayerVersionPolicy.md | 2 +- doc_source/API_GetPolicy.md | 2 +- .../API_GetProvisionedConcurrencyConfig.md | 2 +- doc_source/API_ImageConfig.md | 4 +- doc_source/API_ImageConfigError.md | 2 +- doc_source/API_ImageConfigResponse.md | 2 +- doc_source/API_Invoke.md | 2 +- doc_source/API_InvokeAsync.md | 2 +- doc_source/API_Layer.md | 14 +- doc_source/API_LayerVersionContentInput.md | 2 +- doc_source/API_LayerVersionContentOutput.md | 12 +- doc_source/API_LayerVersionsListItem.md | 4 +- doc_source/API_LayersListItem.md | 2 +- doc_source/API_ListAliases.md | 2 +- doc_source/API_ListCodeSigningConfigs.md | 2 +- doc_source/API_ListEventSourceMappings.md | 11 +- .../API_ListFunctionEventInvokeConfigs.md | 2 +- doc_source/API_ListFunctions.md | 27 +++- .../API_ListFunctionsByCodeSigningConfig.md | 2 +- doc_source/API_ListLayerVersions.md | 4 +- doc_source/API_ListLayers.md | 4 +- .../API_ListProvisionedConcurrencyConfigs.md | 2 +- doc_source/API_ListTags.md | 2 +- doc_source/API_ListVersionsByFunction.md | 20 ++- doc_source/API_OnFailure.md | 2 +- doc_source/API_OnSuccess.md | 2 +- doc_source/API_Operations.md | 9 ++ ...PI_ProvisionedConcurrencyConfigListItem.md | 2 +- doc_source/API_PublishLayerVersion.md | 10 +- doc_source/API_PublishVersion.md | 49 +++++- .../API_PutFunctionCodeSigningConfig.md | 2 +- doc_source/API_PutFunctionConcurrency.md | 2 +- .../API_PutFunctionEventInvokeConfig.md | 2 +- .../API_PutProvisionedConcurrencyConfig.md | 2 +- .../API_RemoveLayerVersionPermission.md | 2 +- doc_source/API_RemovePermission.md | 2 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 20 ++- doc_source/API_TagResource.md | 2 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_TracingConfigResponse.md | 2 +- doc_source/API_Types.md | 7 + doc_source/API_UntagResource.md | 2 +- doc_source/API_UpdateAlias.md | 2 +- doc_source/API_UpdateCodeSigningConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 73 +++++++-- doc_source/API_UpdateFunctionCode.md | 72 ++++++++- doc_source/API_UpdateFunctionConfiguration.md | 77 +++++++-- .../API_UpdateFunctionEventInvokeConfig.md | 2 +- doc_source/API_VpcConfig.md | 2 +- doc_source/API_VpcConfigResponse.md | 2 +- doc_source/access-control-resource-based.md | 4 +- doc_source/applications-tutorial.md | 1 - doc_source/code-editor.md | 36 ++++- doc_source/configuration-aliases.md | 15 +- doc_source/configuration-database.md | 21 ++- doc_source/configuration-envvars.md | 146 ++++++++++-------- doc_source/configuration-filesystem.md | 17 +- doc_source/configuration-images.md | 24 ++- doc_source/configuration-layers.md | 2 +- doc_source/configuration-memory.md | 16 +- doc_source/configuration-preview.md | 96 ------------ doc_source/configuration-tags.md | 14 +- doc_source/configuration-versions.md | 12 +- doc_source/configuration-vpc-endpoints.md | 5 + doc_source/configuration-vpc.md | 8 +- doc_source/csharp-handler.md | 4 +- doc_source/gettingstarted-limits.md | 2 +- doc_source/golang-envvars.md | 2 +- doc_source/index.md | 19 ++- doc_source/invocation-retries.md | 2 +- doc_source/java-package-eclipse.md | 6 + doc_source/kafka-using-cluster.md | 4 + doc_source/lambda-api-permissions-ref.md | 2 + doc_source/lambda-rolling-deployments.md | 2 + doc_source/lambda-services.md | 1 + doc_source/logging-using-cloudtrail.md | 2 + doc_source/monitoring-servicemap.md | 31 +++- doc_source/runtimes-avx2.md | 2 + doc_source/runtimes-context.md | 2 + doc_source/runtimes-custom.md | 2 +- doc_source/runtimes-extensions-api.md | 6 +- doc_source/security_iam_troubleshoot.md | 4 +- doc_source/services-apigateway-code.md | 2 - doc_source/services-apigateway-tutorial.md | 2 + .../services-cloudwatchevents-tutorial.md | 6 +- doc_source/services-cloudwatchevents.md | 5 +- doc_source/services-connect.md | 41 +++++ doc_source/services-ec2-tutorial.md | 2 + doc_source/stepfunctions-patterns.md | 1 + doc_source/troubleshooting-deployment.md | 2 +- doc_source/with-ddb.md | 2 +- doc_source/with-kinesis.md | 2 +- doc_source/with-sqs-create-package.md | 3 +- 139 files changed, 1152 insertions(+), 446 deletions(-) delete mode 100644 doc_source/configuration-preview.md create mode 100644 doc_source/services-connect.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index 5f40217b..e59478cf 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -35,5 +35,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index 5ca7c5ad..6f70e7c4 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index cb84d5e2..b327715e 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,6 +1,6 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all AWS accounts, or all accounts in an organization\. +Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. @@ -52,7 +52,7 @@ Pattern: `o-[a-z0-9]{10,32}` Required: No ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** -An account ID, or `*` to grant permission to all AWS accounts\. +An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes @@ -127,7 +127,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index 35f57f17..01452a8c 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -149,7 +149,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index c4850463..c2be5893 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -45,5 +45,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 04330b69..641fc0c9 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -17,5 +17,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index 125a3a0e..808b7807 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -16,5 +16,5 @@ Required: Yes For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index 9014e737..c787444c 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -43,5 +43,5 @@ Required: Yes For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 82ca2b40..2d49743f 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -16,5 +16,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index 68753c1d..2fb185a9 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -13,5 +13,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 0bef67af..33ef85bd 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -152,7 +152,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index e7f55a0a..01be275e 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -92,7 +92,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index ad941e89..7c9f4ba5 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -8,6 +8,7 @@ For details about each event source type, see the following topics\. + [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) + [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) + [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -36,11 +37,17 @@ Content-type: application/json "Enabled": boolean, "EventSourceArn": "string", "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -49,7 +56,8 @@ Content-type: application/json ], "StartingPosition": "string", "StartingPositionTimestamp": number, - "Topics": [ "string" ] + "Topics": [ "string" ], + "TumblingWindowInSeconds": number } ``` @@ -65,8 +73,9 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -94,7 +103,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: Yes +Required: No ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. @@ -110,8 +119,15 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` +Required: No + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -140,14 +156,17 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** +The Self\-Managed Apache Kafka cluster to send records\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -162,11 +181,17 @@ Type: Timestamp Required: No ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MSK\) The name of the Kafka topic\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -188,6 +213,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -195,15 +221,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -237,6 +271,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -246,7 +286,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -272,12 +312,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -288,12 +339,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -327,7 +383,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index f87bbbec..12105e88 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -8,6 +8,8 @@ A function has an unpublished version, and can have published versions and alias The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. + If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. @@ -20,11 +22,13 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "S3Bucket": "string", "S3Key": "string", "S3ObjectVersion": "string", "ZipFile": blob }, + "CodeSigningConfigArn": "string", "DeadLetterConfig": { "TargetArn": "string" }, @@ -42,9 +46,15 @@ Content-type: application/json ], "FunctionName": "string", "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, + "PackageType": "string", "Publish": boolean, "Role": "string", "Runtime": "string", @@ -75,6 +85,13 @@ The code for the function\. Type: [FunctionCode](API_FunctionCode.md) object Required: Yes + ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** +To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. +Type: String +Length Constraints: Maximum length of 200\. +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` +Required: No + ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. Type: [DeadLetterConfig](API_DeadLetterConfig.md) object @@ -115,7 +132,12 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` -Required: Yes +Required: No + + ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object +Required: No ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. @@ -131,9 +153,15 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + ** [PackageType](#API_CreateFunction_RequestSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. +Type: String +Valid Values:` Zip | Image` Required: No ** [Publish](#API_CreateFunction_RequestSyntax) ** @@ -150,8 +178,8 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: Yes +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. @@ -205,6 +233,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -213,14 +252,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -286,6 +330,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -307,7 +355,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -319,9 +367,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_CreateFunction_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -335,7 +388,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -349,7 +412,7 @@ Type: String ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -372,8 +435,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +HTTP Status Code: 400 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** @@ -403,7 +478,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index 091cb236..e958b423 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -15,5 +15,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index f114deeb..3ecd3ad8 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -69,7 +69,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index 73ee4ae7..af2018a0 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -57,7 +57,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 44f1d88c..759438f1 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -41,6 +41,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -48,15 +49,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -90,6 +99,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -99,7 +114,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -125,12 +140,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -141,12 +167,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -180,7 +211,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index 96f3b3f4..f2ce995b 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -74,7 +74,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index e1044a4d..3727e079 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -71,7 +71,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 9cd0fd8f..38f30490 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -67,7 +67,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 95012343..5b686b74 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -70,7 +70,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 3ae903a4..7efc4d20 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -53,7 +53,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index f108599a..7781aacb 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -73,7 +73,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index 9230f2cb..6e7375b2 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 9e140772..d7d1c480 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -15,5 +15,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Environment) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 58d1e16f..94ce5d75 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index 625bfee0..7bbc27d4 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -20,5 +20,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 9e78f5c5..f82fb0fe 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -30,6 +30,13 @@ Required: No The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: No + + **FunctionResponseTypes** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No **LastModified** @@ -43,7 +50,7 @@ Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -72,14 +79,28 @@ Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` +Required: No + + **SelfManagedEventSource** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. +Required: No + + **StartingPosition** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` +Required: No + + **StartingPositionTimestamp** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp Required: No **State** @@ -93,11 +114,17 @@ Type: String Required: No **Topics** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` +Required: No + + **TumblingWindowInSeconds** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No **UUID** @@ -110,5 +137,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 2a18b234..4aa62f56 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -23,5 +23,5 @@ Required: Yes For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index 8487a2d7..6ebb6ed3 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -1,9 +1,14 @@ # FunctionCode -The code for the Lambda function\. You can specify either an object in Amazon S3, or upload a deployment package directly\. +The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **S3Bucket** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String @@ -33,5 +38,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 850b4594..59c99331 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,6 +4,11 @@ Details about a function's deployment package\. ## Contents + **ImageUri** +URI of a container image in the Amazon ECR registry\. +Type: String +Required: No + **Location** A presigned URL that you can use to download the deployment package\. Type: String @@ -12,6 +17,11 @@ Required: No **RepositoryType** The service that's hosting the file\. Type: String +Required: No + + **ResolvedImageUri** +The resolved URI for the image\. +Type: String Required: No ## See Also @@ -19,5 +29,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 2fa66b1c..be995ce7 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -54,6 +54,11 @@ The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + **ImageConfigResponse** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No **KMSKeyArn** @@ -81,7 +86,7 @@ Required: No **LastUpdateStatusReasonCode** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Layers** @@ -96,9 +101,15 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **MemorySize** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. +Required: No + + **PackageType** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` Required: No **RevisionId** @@ -115,7 +126,19 @@ Required: No **Runtime** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Required: No + + **SigningJobArn** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No **State** @@ -132,7 +155,7 @@ Required: No **StateReasonCode** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No **Timeout** @@ -163,5 +186,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index e4236102..e2ca486e 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -41,5 +41,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index e87f8194..a2da9476 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -68,7 +68,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index 4b13be19..b6e3e516 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -115,7 +115,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 3910db03..459415c7 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -75,7 +75,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f073a04e..fb1c29a7 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -39,6 +39,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -46,15 +47,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -88,6 +97,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -97,7 +112,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -123,12 +138,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -139,12 +165,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -174,7 +205,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 247f695e..ee3d29e0 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -41,8 +41,10 @@ Content-type: application/json { "Code": { + "ImageUri": "string", "Location": "string", - "RepositoryType": "string" + "RepositoryType": "string", + "ResolvedImageUri": "string" }, "Concurrency": { "ReservedConcurrentExecutions": number @@ -72,6 +74,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -80,14 +93,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -155,7 +173,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 2a4604df..3e3c1b64 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -89,7 +89,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index c0e7e63a..143a3c22 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -75,7 +75,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 4d3a9dc4..8fc54d45 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -66,6 +66,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +85,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -147,6 +163,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -168,7 +188,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -180,9 +200,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -196,7 +221,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -210,7 +245,7 @@ Type: String ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -256,7 +291,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index 171a7824..a1ff02fc 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -117,7 +117,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d0469dc3..61c5fcd7 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -37,7 +37,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -58,7 +60,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. @@ -119,7 +121,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 46aaf325..e4c3cf0d 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -33,7 +33,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -54,7 +56,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. @@ -115,7 +117,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index 5f080c3f..8a6f1f17 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -77,7 +77,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 35421479..7e9d820e 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -84,7 +84,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 0f08ee63..4248db3d 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -113,7 +113,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index 1b4f1fdd..ac7ed0bb 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -1,6 +1,6 @@ # ImageConfig -Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html)\. +Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms)\. ## Contents @@ -27,5 +27,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index b43ac4bc..2e0f10d5 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index 4b19ddeb..a71f8502 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index e982a0f1..294589d9 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -216,7 +216,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Invoke) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index f7246f81..69395006 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -81,7 +81,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index df0d9d16..80c3a729 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -14,6 +14,18 @@ Required: No **CodeSize** The size of the layer archive in bytes\. Type: Long +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ## See Also @@ -21,5 +33,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/Layer) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index df236db4..8f946fc3 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -33,5 +33,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 09f64516..b0ead36e 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -17,6 +17,16 @@ Required: No **Location** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String +Required: No + + **SigningJobArn** +The Amazon Resource Name \(ARN\) of a signing job\. +Type: String +Required: No + + **SigningProfileVersionArn** +The Amazon Resource Name \(ARN\) for a signing profile version\. +Type: String Required: No ## See Also @@ -24,5 +34,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 2e858f4a..f2df4764 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -8,7 +8,7 @@ Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lam The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No **CreatedDate** @@ -45,5 +45,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index 96e5e748..8748e7b8 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -28,5 +28,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 6440d010..355812a0 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -104,7 +104,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 517dbaf5..2317b88d 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -79,7 +79,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 803b3be6..7ff4f8fe 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -64,6 +64,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -71,15 +72,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ], @@ -126,7 +135,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 4b865687..b689c65c 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -103,7 +103,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index ae21f90a..e99ef63e 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -2,7 +2,10 @@ Returns a list of Lambda functions, with the version\-specific configuration of each\. Lambda returns up to 50 functions per call\. -Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. To get more information about a function or version, use [GetFunction](API_GetFunction.md)\. +Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. + +**Note** +The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -26,7 +29,7 @@ For Lambda@Edge functions, the AWS Region of the master function\. For example, Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` ** [MaxItems](#API_ListFunctions_RequestSyntax) ** -The maximum number of functions to return\. +The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body @@ -66,6 +69,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -74,14 +88,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -136,7 +155,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index 39443594..a2cc5696 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -77,7 +77,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 1e38e5f3..eacec069 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. @@ -93,7 +93,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index cf6939f7..4adf853d 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -14,7 +14,7 @@ The request uses the following URI parameters\. ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. @@ -87,7 +87,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 5cb586fe..77a1530d 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -96,7 +96,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index e5e7d1d5..d2dc7f0b 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -69,7 +69,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListTags) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index cfdddb83..a6bb06e9 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -69,6 +69,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -77,14 +88,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -142,7 +158,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 144e32dc..46402c85 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -16,5 +16,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index 97935571..ae14a7ea 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -16,5 +16,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 4dedc902..70a90b0c 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -4,19 +4,24 @@ The following actions are supported: + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) ++ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) ++ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) ++ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) ++ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -28,9 +33,11 @@ The following actions are supported: + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) ++ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) ++ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -38,6 +45,7 @@ The following actions are supported: + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) ++ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -46,6 +54,7 @@ The following actions are supported: + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) ++ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 7325b710..73d4e84e 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -49,5 +49,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index fcbe9f72..21b6f62a 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -41,7 +41,7 @@ The request accepts the following data in JSON format\. A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -75,7 +75,9 @@ Content-type: application/json "Content": { "CodeSha256": "string", "CodeSize": number, - "Location": "string" + "Location": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" }, "CreatedDate": "string", "Description": "string", @@ -96,7 +98,7 @@ The following data is returned in JSON format by the service\. The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. @@ -161,7 +163,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 4e1749f3..d361190c 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -86,6 +86,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -94,14 +105,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -167,6 +183,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -188,7 +208,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -200,9 +220,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_PublishVersion_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -216,7 +241,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -230,7 +265,7 @@ Type: String ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -288,7 +323,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index 18cc1352..8263662a 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -109,7 +109,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index c1ec66a8..367942bc 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -94,7 +94,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 7de52ada..ec123c06 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -156,7 +156,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 09083ef0..5123b441 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -124,7 +124,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 0bad24c5..529e3980 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -74,7 +74,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index 6f877055..f7533bc9 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -81,7 +81,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 5ea2260c..cdf08843 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -19,5 +19,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 8a21b665..06601520 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,21 +1,25 @@ # SourceAccessConfiguration - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` +You can specify the authentication protocol, or the VPC components to secure access to your event source\. ## Contents **Type** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. ++ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. ++ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. Type: String -Valid Values:` BASIC_AUTH` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` Required: No **URI** -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Length Constraints: Minimum length of 1\. Maximum length of 200\. +Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` Required: No ## See Also @@ -23,5 +27,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 7c144f26..81d0c506 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -72,7 +72,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 40bef909..653b1917 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -15,5 +15,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index 97f01023..acfdfabb 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -15,5 +15,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index ebedf4f7..aaa9f473 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -5,6 +5,9 @@ The following data types are supported: + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) ++ [AllowedPublishers](API_AllowedPublishers.md) ++ [CodeSigningConfig](API_CodeSigningConfig.md) ++ [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -17,6 +20,9 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [ImageConfig](API_ImageConfig.md) ++ [ImageConfigError](API_ImageConfigError.md) ++ [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -25,6 +31,7 @@ The following data types are supported: + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index b1e30427..eb23ed5e 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -64,7 +64,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index 609444f5..e1d3748f 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -158,7 +158,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index c7f21012..a12662bc 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -102,7 +102,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index c6a09e35..4e6263f3 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -28,6 +28,7 @@ Content-type: application/json }, "Enabled": boolean, "FunctionName": "string", + "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, "MaximumRecordAgeInSeconds": number, "MaximumRetryAttempts": number, @@ -37,7 +38,8 @@ Content-type: application/json "Type": "string", "URI": "string" } - ] + ], + "TumblingWindowInSeconds": number } ``` @@ -57,8 +59,9 @@ The request accepts the following data in JSON format\. The maximum number of items to retrieve in a single batch\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. -+ **Amazon Simple Queue Service** \- Default 10\. Max 10\. ++ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No @@ -90,10 +93,17 @@ The length constraint applies only to the full ARN\. If you specify only the fun Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: No + + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -117,11 +127,15 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. +Required: No + + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No ## Response Syntax @@ -143,6 +157,7 @@ Content-type: application/json }, "EventSourceArn": "string", "FunctionArn": "string", + "FunctionResponseTypes": [ "string" ], "LastModified": number, "LastProcessingResult": "string", "MaximumBatchingWindowInSeconds": number, @@ -150,15 +165,23 @@ Content-type: application/json "MaximumRetryAttempts": number, "ParallelizationFactor": number, "Queues": [ "string" ], + "SelfManagedEventSource": { + "Endpoints": { + "string" : [ "string" ] + } + }, "SourceAccessConfigurations": [ { "Type": "string", "URI": "string" } ], + "StartingPosition": "string", + "StartingPositionTimestamp": number, "State": "string", "StateTransitionReason": "string", "Topics": [ "string" ], + "TumblingWindowInSeconds": number, "UUID": "string" } ``` @@ -192,6 +215,12 @@ The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) A list of current response type enums applied to the event source mapping\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` ReportBatchItemFailures` + ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. Type: Timestamp @@ -201,7 +230,7 @@ The result of the last AWS Lambda invocation of your Lambda function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -227,12 +256,23 @@ Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` + ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The Self\-Managed Apache Kafka cluster for your event source\. +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The Secrets Manager secret that stores your broker credentials\. To store your secret, use the following format: ` { "username": "your username", "password": "your password" }` -To reference the secret, use the following format: `[ { "Type": "BASIC_AUTH", "URI": "secretARN" } ]` -The value of `Type` is always `BASIC_AUTH`\. To encrypt the secret, you can use customer or service managed keys\. When using a customer managed KMS key, the Lambda execution role requires `kms:Decrypt` permissions\. +An array of the authentication protocol, or the VPC components to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 22 items\. + + ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +Type: String +Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` + + ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** +With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. +Type: Timestamp ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. @@ -243,12 +283,17 @@ Indicates whether the last change to the event source mapping was made by a user Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MSK\) The name of the Kafka topic to consume\. +The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 900\. + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -286,7 +331,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index f0f55d47..8f181f19 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -1,9 +1,12 @@ # UpdateFunctionCode -Updates a Lambda function's code\. +Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\. +**Note** +For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. + ## Request Syntax ``` @@ -12,6 +15,7 @@ Content-type: application/json { "DryRun": boolean, + "ImageUri": "string", "Publish": boolean, "RevisionId": "string", "S3Bucket": "string", @@ -44,6 +48,11 @@ The request accepts the following data in JSON format\. ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean +Required: No + + ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** +URI of a container image in the Amazon ECR registry\. +Type: String Required: No ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** @@ -111,6 +120,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -119,14 +139,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -192,6 +217,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -213,7 +242,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -225,9 +254,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -241,7 +275,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -255,7 +299,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -278,8 +322,20 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + **CodeStorageExceededException** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +HTTP Status Code: 400 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 **InvalidParameterValueException** @@ -313,7 +369,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f4b2ea77..f828bcfe 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -31,6 +31,11 @@ Content-type: application/json } ], "Handler": "string", + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + }, "KMSKeyArn": "string", "Layers": [ "string" ], "MemorySize": number, @@ -95,6 +100,11 @@ The name of the method within your code that Lambda calls to execute your functi Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` +Required: No + + ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Type: [ImageConfig](API_ImageConfig.md) object Required: No ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -111,9 +121,9 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory that your function has access to\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value must be a multiple of 64 MB\. +The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -130,7 +140,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -180,6 +190,17 @@ Content-type: application/json "FunctionArn": "string", "FunctionName": "string", "Handler": "string", + "ImageConfigResponse": { + "Error": { + "ErrorCode": "string", + "Message": "string" + }, + "ImageConfig": { + "Command": [ "string" ], + "EntryPoint": [ "string" ], + "WorkingDirectory": "string" + } + }, "KMSKeyArn": "string", "LastModified": "string", "LastUpdateStatus": "string", @@ -188,14 +209,19 @@ Content-type: application/json "Layers": [ { "Arn": "string", - "CodeSize": number + "CodeSize": number, + "SigningJobArn": "string", + "SigningProfileVersionArn": "string" } ], "MasterArn": "string", "MemorySize": number, + "PackageType": "string", "RevisionId": "string", "Role": "string", "Runtime": "string", + "SigningJobArn": "string", + "SigningProfileVersionArn": "string", "State": "string", "StateReason": "string", "StateReasonCode": "string", @@ -261,6 +287,10 @@ Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` + ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The function's image configuration values\. +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String @@ -282,7 +312,7 @@ Type: String ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. @@ -294,9 +324,14 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The memory that's allocated to the function\. +The amount of memory available to the function at runtime\. Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 3008\. +Valid Range: Minimum value of 128\. Maximum value of 10240\. + + ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. +Type: String +Valid Values:` Zip | Image` ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. @@ -310,7 +345,17 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs10.x | nodejs12.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore2.1 | dotnetcore3.1 | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` + + ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing job\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` + + ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The ARN of the signing profile version\. +Type: String +Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. @@ -324,7 +369,7 @@ Type: String ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup` +Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. @@ -347,6 +392,18 @@ Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors + **CodeSigningConfigNotFoundException** +The specified code signing configuration does not exist\. +HTTP Status Code: 404 + + **CodeVerificationFailedException** +The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. +HTTP Status Code: 400 + + **InvalidCodeSignatureException** +The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. +HTTP Status Code: 400 + **InvalidParameterValueException** One of the parameters in the request is invalid\. HTTP Status Code: 400 @@ -378,7 +435,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 33509a9b..3a5cb783 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -154,7 +154,7 @@ For more information about using this API in one of the language\-specific AWS S + [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) + [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index 8b29a124..d2610bb6 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -21,5 +21,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index 37a49bed..b68675f5 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -26,5 +26,5 @@ Required: No For more information about using this API in one of the language\-specific AWS SDKs, see the following: + [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) + [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Java](https://docs.aws.amazon.com/goto/SdkForJava/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) + [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 1f95f955..4d4d82de 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function”, "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" @@ -225,4 +225,4 @@ Use `remove-layer-version-permission` to remove statements from the policy\. ``` aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` +``` \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 7c4c9ddb..e017d02d 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -63,7 +63,6 @@ Create an application in the Lambda console\. In Lambda, an application is an AW 1. Configure application settings\. + **Application name** – **my\-app**\. - + **Application description** – **my application**\. + **Runtime** – **Node\.js 10\.x**\. + **Source control service** – **CodeCommit**\. + **Repository name** – **my\-app\-repo**\. diff --git a/doc_source/code-editor.md b/doc_source/code-editor.md index 6812db13..2472dcff 100644 --- a/doc_source/code-editor.md +++ b/doc_source/code-editor.md @@ -4,6 +4,8 @@ The Lambda console provides a code editor for languages that do not require comp The code editor includes the *menu bar*, *windows*, and the *editor pane*\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. @@ -26,6 +28,8 @@ You can use the **Environment** window in the code editor to create, open, and m ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) + + **To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. **To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. @@ -33,9 +37,13 @@ You can use the **Environment** window in the code editor to create, open, and m **To create a new file**, do one of the following: + In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. + Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) + + **To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. **To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. @@ -48,6 +56,8 @@ You can use the **Environment** window in the code editor to create, open, and m **To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. @@ -58,17 +68,27 @@ Use the editor pane in the code editor to view and write code\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) + + ### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) + + **To display an open file's contents**, do one of the following: + Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) + + **To close an open file**, do one of the following: + Choose the **X** icon in the file's tab\. + Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. @@ -83,12 +103,20 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) + + **To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) + + **To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. + + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) **To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. @@ -99,6 +127,8 @@ Use the status bar to move quickly to a line in the active file and to change ho ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) + + ## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -107,6 +137,8 @@ To expand the code editor to the edges of the web browser window, choose the **T ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) + + To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 7876becd..9af84539 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -2,6 +2,17 @@ You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. +**Topics** ++ [Creating a function alias \(Console\)](#configuration-aliases-config) ++ [Managing aliases with the Lambda API](#versioning-aliases-api) ++ [Using aliases](#using-aliases) ++ [Resource policies](#versioning-permissions-alias) ++ [Alias routing configuration](#configuring-alias-routing) + +## Creating a function alias \(Console\) + +You can create a function alias using the Lambda console\. + **To create an alias** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -143,4 +154,6 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file ++ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. + + \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index 1d84a658..8e42e650 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -1,6 +1,15 @@ # Configuring database access for a Lambda function -You can use the Lambda console to create an Amazon RDS Proxy database proxy for your function\. A database proxy manages a pool of database connections and relays queries from a function\. This enables a function to reach high [concurrency](gettingstarted-concepts.md#gettingstarted-concepts-concurrency) levels without exhausting database connections\. +You can create an Amazon RDS Proxy database proxy for your function\. A database proxy manages a pool of database connections and relays queries from a function\. This enables a function to reach high [concurrency](gettingstarted-concepts.md#gettingstarted-concepts-concurrency) levels without exhausting database connections\. + +**Topics** ++ [Creating a database proxy \(console\)](#configuration-database-config) ++ [Using the function's permissions for authentication](#configuration-database-auth) ++ [Sample application](#configuration-database-sample) + +## Creating a database proxy \(console\) + +You can use the Lambda console to create an Amazon RDS Proxy database proxy\. **To create a database proxy** @@ -20,9 +29,9 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy for ``` { - "username": "admin", - "password": "e2abcecxmpldc897" - } + "username": "admin", + "password": "e2abcecxmpldc897" + } ``` + **IAM role** – An IAM role with permission to use the secret, and a trust policy that allows Amazon RDS to assume the role\. + **Authentication** – The authentication and authorization method for connecting to the proxy from your function code\. @@ -36,10 +45,6 @@ Proxy creation takes a few minutes\. When the proxy is available, configure your Standard [Amazon RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/) applies\. For more information, see [Managing connections with the Amazon RDS Proxy](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html) in the Amazon Aurora User Guide\. -**Topics** -+ [Using the function's permissions for authentication](#configuration-database-auth) -+ [Sample application](#configuration-database-sample) - ## Using the function's permissions for authentication By default, you can connect to a proxy with the same username and password that it uses to connect to the database\. The only difference in your function code is the endpoint that the database client connects to\. The drawback of this method is that you must expose the password to your function code, either by configuring it in a secure environment variable or by retrieving it from Secrets Manager\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 9abf6b67..cf46ef31 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -5,7 +5,22 @@ You can use environment variables to adjust your function's behavior without upd **Note** To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. -You set environment variables on the unpublished version of your function by specifying a key and value\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. +Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in your function code\. + +**Topics** ++ [Configuring environment variables](#configuration-envvars-config) ++ [Configuring environment variables with the API](#configuration-envvars-api) ++ [Example scenario for environment variables](#configuration-envvars-example) ++ [Retrieve environment variables](#configuration-envvars-retrieve) ++ [Defined runtime environment variables](#configuration-envvars-runtime) ++ [Securing environment variables](#configuration-envvars-encryption) ++ [Sample code and templates](#configuration-envvars-samples) + +## Configuring environment variables + +You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. + +You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. **To set environment variables in the Lambda console** @@ -13,9 +28,9 @@ You set environment variables on the unpublished version of your function by spe 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Choose **Add environment variable**\. @@ -29,7 +44,59 @@ You set environment variables on the unpublished version of your function by spe 1. Choose **Save**\. -Use environment variables to pass environment\-specific settings to your code\. For example, you can have two functions with the same code but different configuration\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. +## Configuring environment variables with the API + +To manage environment variables with the AWS CLI or AWS SDK, use the following API operations\. ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [CreateFunction](API_CreateFunction.md) + +The following example sets two environment variables on a function named `my-function`\. + +``` +aws lambda update-function-configuration --function-name my-function \ + --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" +``` + +When you apply environment variables with the `update-function-configuration` command, the entire contents of the `Variables` structure is replaced\. To retain existing environment variables when you add a new one, include all existing values in your request\. + +To get the current configuration, use the `get-function-configuration` command\. + +``` +aws lambda get-function-configuration --function-name my-function +``` + +You should see the following output: + +``` +{ + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Environment": { + "Variables": { + "BUCKET": "my-bucket", + "KEY": "file.txt" + } + }, + "RevisionId": "0894d3c1-2a3d-4d48-bf7f-abade99f3c15", + ... +} +``` + +To ensure that the values don't change between when you read the configuration and when you update it, you can pass the revision ID from the output of `get-function-configuration` as a parameter to `update-function-configuration`\. + +To configure a function's encryption key, set the `KMSKeyARN` option\. + +``` +aws lambda update-function-configuration --function-name my-function \ + --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 +``` + +## Example scenario for environment variables + +You can use environment variables to customize function behavior in your test environment and production environment\. For example, you can create two functions with the same code but different configurations\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. The following example shows how to define the database host and database name as environment variables\. @@ -37,8 +104,7 @@ The following example shows how to define the database host and database name as If you want your test environment to generate more debug information than the production environment, you could set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. -**Note** -Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in the function code\. +## Retrieve environment variables To retrieve environment variables in your function code, use the standard method for your programming language\. @@ -54,7 +120,7 @@ let region = process.env.AWS_REGION ``` import os -region = os.environ['AWS_REGION'] + region = os.environ['AWS_REGION'] ``` **Note** @@ -103,13 +169,7 @@ $region = $env:AWS_REGION Lambda stores environment variables securely by encrypting them at rest\. You can [configure Lambda to use a different encryption key](#configuration-envvars-encryption), encrypt environment variable values on the client side, or set environment variables in an AWS CloudFormation template with AWS Secrets Manager\. -**Topics** -+ [Runtime environment variables](#configuration-envvars-runtime) -+ [Securing environment variables](#configuration-envvars-encryption) -+ [Configuring environment variables with the Lambda API](#configuration-envvars-api) -+ [Sample code and templates](#configuration-envvars-samples) - -## Runtime environment variables +## Defined runtime environment variables Lambda [runtimes](lambda-runtimes.md) set several environment variables during initialization\. Most of the environment variables provide information about the function or runtime\. The keys for these environment variables are *reserved* and cannot be set in your function configuration\. @@ -157,9 +217,9 @@ When you provide the key, only users in your account with access to the key can 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -210,9 +270,9 @@ You can also encrypt environment variable values on the client side before sendi 1. Choose a function\. -1. Choose **Code** if it is not already selected\. +1. Choose **Configuration**, then choose **Environment variables**\. -1. Scroll down\. Under **Environment variables**, choose **Edit**\. +1. Under **Environment variables**, choose **Edit**\. 1. Expand **Encryption configuration**\. @@ -229,56 +289,6 @@ To view sample code for your function's language, choose **Code** next to an env Another option is to store passwords in AWS Secrets Manager secrets\. You can reference the secret in your AWS CloudFormation templates to set passwords on databases\. You can also set the value of an environment variable on the Lambda function\. For an example, see the next section\. -## Configuring environment variables with the Lambda API - -To manage environment variables with the AWS CLI or AWS SDK, use the following API operations\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example sets two environment variables on a function named `my-function`\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" -``` - -When you apply environment variables with the `update-function-configuration` command, the entire contents of the `Variables` structure is replaced\. To retain existing environment variables when you add a new one, include all existing values in your request\. - -To get the current configuration, use the `get-function-configuration` command\. - -``` -aws lambda get-function-configuration --function-name my-function -``` - -You should see the following output: - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Environment": { - "Variables": { - "BUCKET": "my-bucket", - "KEY": "file.txt" - } - }, - "RevisionId": "0894d3c1-2a3d-4d48-bf7f-abade99f3c15", - ... -} -``` - -To ensure that the values don't change between when you read the configuration and when you update it, you can pass the revision ID from the output of `get-function-configuration` as a parameter to `update-function-configuration`\. - -To configure a function's encryption key, set the `KMSKeyARN` option\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 -``` - ## Sample code and templates Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 930b1cc5..d11a0713 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -2,6 +2,16 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. +**Topics** ++ [Connecting to a file system \(console\)](#configuration-filesystem-config) ++ [Configuring a file system and access point](#configuration-filesystem-setup) ++ [Execution role and user permissions](#configuration-filesystem-permissions) ++ [Configuring file system access with the Lambda API](#configuration-filesystem-api) ++ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) ++ [Sample applications](#configuration-filesystem-samples) + +## Connecting to a file system \(console\) + A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. **Note** @@ -27,13 +37,6 @@ Lambda charges for data transfer between VPCs\. This only applies if your functi For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. -**Topics** -+ [Configuring a file system and access point](#configuration-filesystem-setup) -+ [Execution role and user permissions](#configuration-filesystem-permissions) -+ [Configuring file system access with the Lambda API](#configuration-filesystem-api) -+ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) -+ [Sample applications](#configuration-filesystem-samples) - ## Configuring a file system and access point Create a file system in Amazon EFS with a mount target in every Availability Zone that your function connects to\. For performance and resilience, use at least two Availability Zones\. For example, in a simple configuration you could have a VPC with two private subnets in separate Availability Zones\. The function connects to both subnets and a mount target is available in each\. Ensure that NFS traffic \(port 2049\) is allowed by the security groups used by the function and mount targets\. diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 5c252be0..10bf3d74 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -42,19 +42,17 @@ For example, use the IAM console to create a role with the following policy: ``` { "Version": "2012-10-17", - "Statement": { - [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy" - ], - "Resource": "arn:aws:ecr:::repository//" - } - ] - } + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "ecr:SetRepositoryPolicy", + "ecr:GetRepositoryPolicy" + ], + "Resource": "arn:aws:ecr:::repository//" + } + ] } ``` diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 6dd8a5d0..a91abe0e 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -271,7 +271,7 @@ jq.zip ------ -For more information about path settings in the Lambda execution environment, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. +For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. ## Layer permissions diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md index ee80ac23..b88d5251 100644 --- a/doc_source/configuration-memory.md +++ b/doc_source/configuration-memory.md @@ -4,7 +4,11 @@ Lambda allocates CPU power in proportion to the amount of memory configured\. *M This page describes how to update the memory allotted to your function in the Lambda console\. -## Configuring function memory in the Lambda console +**Topics** ++ [Configuring function memory \(console\)](#configuration-memory-console) ++ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) + +## Configuring function memory \(console\) You can configure the memory of your function in the Lambda console\. @@ -14,13 +18,15 @@ You can configure the memory of your function in the Lambda console\. 1. Choose a function\. -1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. +1. Choose **Configuration** and then choose **General configuration** + +1. Under **General configuration**, choose **Edit**\. 1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. 1. Choose **Save**\. -## Accepting function memory recommendations on the Lambda console +## Accepting function memory recommendations \(console\) If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. @@ -32,7 +38,9 @@ When you've opted in and your [Lambda function meets Compute Optimizer requireme 1. Choose a function\. -1. On the [function configuration page](configuration-console.md), on the **Basic settings** pane, choose **Edit**\. +1. Choose **Configuration** and then choose **General configuration** + +1. Under **General configuration**, choose **Edit**\. 1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. diff --git a/doc_source/configuration-preview.md b/doc_source/configuration-preview.md deleted file mode 100644 index 2bebab89..00000000 --- a/doc_source/configuration-preview.md +++ /dev/null @@ -1,96 +0,0 @@ -# Configuring functions in the AWS Lambda console \(preview\) - - -**Public preview** - -| | -| --- | -| Public preview The updated AWS Lambda console is in preview release and is subject to change\. The preview is available to AWS accounts on a region by region basis\. The changes include a new function\-level configuration page, increased visibility into versions and aliases, and a dedicated section for your code\. To provide feedback, visit the updated console \([https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\) and select **Tell us what you think**\. | - - You can use the Lambda console to configure function settings, add triggers and destinations, and edit and update your code\. The following sections will cover how to perform those workflows in the updated Lambda console\. - -**Topics** -+ [Configure function settings](#configuration-preview-settings) -+ [Add and edit triggers and destinations](#configuration-preview-triggers) -+ [Edit and update code](#configuration-preview-code) - -## Configure function settings - -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. - -Choose **Latest configuration** to view and manage your version's current configuration\. - -![\[The Latest configuration section of the updated console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/latest-config.png) - -Areas of configuration are broken into five sections, which encapsulate the following: - -**General** -Basic settings -Asynchronous invocation -Monitoring tools -VPC -Database proxies -File system -Concurrency - -**Runtime** -Environment variables -Layers - -**Triggers** -A list of existing triggers and options to create, enable, disable, fix, and delete triggers\. - -**Permissions** -Execution role -Resource summary -Resource\-based policy -Auditing and compliance - -**Destinations** -A list of existing destinations and options to create, remove, and edit destinations\. - -## Add and edit triggers and destinations - -Triggers and destinations now exist as subsets of your function's greater configuration settings\. Both resources are still visible in the function visualization, but are no longer accessed through interacting with it\. - -To see your lists of existing triggers or destinations, choose **Latest configuration** when viewing a version of your function and select either **Triggers** or **Destinations** from the left\-hand sections\. - -**To add a new trigger** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. - -1. Choose **Latest configuration** and then **Triggers**\. - -1. Choose **Add trigger** and select the type of trigger from the list of available options\. - -1. The fields associated with that trigger will load in below\. Fill them in and choose **Add**\. - -1. To verify your trigger has been added, choose **Overview** and note the new trigger in the **Function visualization**\. - -To enable, disable, fix, or delete a trigger, choose the item in the list of triggers provided when you visit the **Triggers** section of **Latest configuration**\. To reconfigure the trigger, use the event source mapping API commands\. - -**To add a new destination** - -1. Open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -1. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. - -1. Choose **Latest configuration** and then **Destinations**\. - -1. Choose **Add destination**\. - -1. Fill in the required fields and then choose **Save**\. - -1. To verify your destination has been added, choose **Overview** and note the new destination in the **Function visualization**\. - -To edit or remove the destination, choose the item in the list of destinations provided when you choose the **Destinations** section of **Latest configuration**\. - -## Edit and update code - -Function code now has its own primary section within your function's details\. To access your function code, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. From the list of aliases associated with your function, choose the alias that points to the version you want to configure\. This will take you to the function visualization\. - -Choose **Code** to view and manage your version's current code\. From this view you can edit inline, where possible, or choose **Upload from** to upload from a source\. - -Functionality has not changed for the development environment and test events\. \ No newline at end of file diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 2232792f..1cd6d2af 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -2,6 +2,14 @@ You can tag Lambda functions to organize them by owner, project or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources and adding detail to billing reports\. +**Topics** ++ [Adding tags to a function \(console\)](#configuration-tags-config) ++ [Using tags to filter functions \(console\)](#configuration-tags-filter) ++ [Using Tags with the AWS CLI](#configuration-tags-cli) ++ [Tag Key and Value Requirements](#configuration-tags-restrictions) + +## Adding tags to a function \(console\) + **To add tags to a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -17,6 +25,8 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Choose **Save**\. +## Using tags to filter functions \(console\) + You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. **To filter functions with tags** @@ -35,10 +45,6 @@ The search bar also supports searching for tag keys\. Type `tag` to see just a l With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. -**Topics** -+ [Using Tags with the AWS CLI](#configuration-tags-cli) -+ [Tag Key and Value Requirements](#configuration-tags-restrictions) - ## Using Tags with the AWS CLI When you create a new Lambda function, you can include tags with the `--tags` option\. diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index caabb639..6ba8a250 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -8,9 +8,19 @@ A function version includes the following information: + All of the function settings, including the environment variables\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. +**Topics** ++ [Creating function versions](#configuration-versions-config) ++ [Managing versions with the Lambda API](#versioning-versions-api) ++ [Using versions](#versioning-versions-using) ++ [Granting permissions](#versioning-permissions) + +## Creating function versions + You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the console](configuration-console.md)\. -**To create a new version of a function** +You can create a function version using the Lambda console\. + +**To create a new function version** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 7ac4795d..1ca577fe 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -6,6 +6,11 @@ To establish a private connection between your VPC and Lambda, create an [interf Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. +**Topics** ++ [Considerations for Lambda interface endpoints](#vpc-endpoint-considerations) ++ [Creating an interface endpoint for Lambda](#vpc-endpoint-create) ++ [Creating an interface endpoint policy for Lambda](#vpc-endpoint-policy) + ## Considerations for Lambda interface endpoints Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 30056c02..c05e249b 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -14,8 +14,8 @@ Lambda functions can't connect directly to a VPC with [ dedicated instance tenan **Topics** + [Execution role and user permissions](#vpc-permissions) -+ [Configuring VPC access with the Lambda console](#vpc-configuring) -+ [Configuring VPC access with the Lambda API](#vpc-configuring-api) ++ [Configuring VPC access \(console\)](#vpc-configuring) ++ [Configuring VPC access \(API\)](#vpc-configuring-api) + [Using IAM condition keys for VPC settings](#vpc-conditions) + [Internet and service access for VPC\-connected functions](#vpc-internet) + [VPC tutorials](#vpc-tutorials) @@ -39,7 +39,7 @@ When you configure VPC connectivity, Lambda uses your permissions to verify netw + **ec2:DescribeSubnets** + **ec2:DescribeVpcs** -## Configuring VPC access with the Lambda console +## Configuring VPC access \(console\) If your [IAM permissions](#vpc-conditions) allow you only to create Lambda functions that connect to your VPC, you must configure the VPC when you create the function\. If your IAM permissions allow you to create functions that aren't connected to your VPC, you can add the VPC configuration after you create the function\. @@ -77,7 +77,7 @@ To access private resources, connect your function to private subnets\. If your 1. Choose **Save**\. -## Configuring VPC access with the Lambda API +## Configuring VPC access \(API\) To connect a Lambda function to a VPC, you can use the following API operations: + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 04b6de39..9739305d 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -90,7 +90,7 @@ public class ProductService{ ``` **Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. ## Handler signatures @@ -130,7 +130,7 @@ If the method specified in your handler string is overloaded, you must provide t For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: + Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. **Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/0eff7ab687bbfc1e026feee1de336849e0315bc6/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index f6bca081..2af77154 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -7,7 +7,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | | Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md index d7cbc73f..ad97c3f5 100644 --- a/doc_source/golang-envvars.md +++ b/doc_source/golang-envvars.md @@ -19,4 +19,4 @@ func main() { } ``` -For a list of environment variables that are set by the Lambda runtime, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file +For a list of environment variables that are set by the Lambda runtime, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index cd0d9deb..66fdcf1d 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -1,7 +1,7 @@ # AWS Lambda Developer Guide ----- -*****Copyright © 2020 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** +*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** ----- Amazon's trademarks and trade dress may not be used in @@ -99,6 +99,7 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + [Using AWS Lambda with AWS Config](services-config.md) + + [Using Lambda with Amazon Connect](services-connect.md) + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) @@ -240,19 +241,24 @@ Amazon's trademarks and trade dress may not be used in + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateAlias](API_CreateAlias.md) + + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + [DeleteAlias](API_DeleteAlias.md) + + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) + + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) + [GetAlias](API_GetAlias.md) + + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) + + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) @@ -264,9 +270,11 @@ Amazon's trademarks and trade dress may not be used in + [Invoke](API_Invoke.md) + [InvokeAsync](API_InvokeAsync.md) + [ListAliases](API_ListAliases.md) + + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) + + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -274,6 +282,7 @@ Amazon's trademarks and trade dress may not be used in + [ListVersionsByFunction](API_ListVersionsByFunction.md) + [PublishLayerVersion](API_PublishLayerVersion.md) + [PublishVersion](API_PublishVersion.md) + + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) @@ -282,6 +291,7 @@ Amazon's trademarks and trade dress may not be used in + [TagResource](API_TagResource.md) + [UntagResource](API_UntagResource.md) + [UpdateAlias](API_UpdateAlias.md) + + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) @@ -291,6 +301,9 @@ Amazon's trademarks and trade dress may not be used in + [AccountUsage](API_AccountUsage.md) + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) + + [AllowedPublishers](API_AllowedPublishers.md) + + [CodeSigningConfig](API_CodeSigningConfig.md) + + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) @@ -303,6 +316,9 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) + + [ImageConfig](API_ImageConfig.md) + + [ImageConfigError](API_ImageConfigError.md) + + [ImageConfigResponse](API_ImageConfigResponse.md) + [Layer](API_Layer.md) + [LayersListItem](API_LayersListItem.md) + [LayerVersionContentInput](API_LayerVersionContentInput.md) @@ -311,6 +327,7 @@ Amazon's trademarks and trade dress may not be used in + [OnFailure](API_OnFailure.md) + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + + [SelfManagedEventSource](API_SelfManagedEventSource.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md index 7f165662..649fd7ad 100644 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -9,7 +9,7 @@ Issues with the request, caller, or account can cause invocation errors\. Invoca + **Caller** – The user or service doesn't have permission to invoke the function\. + **Account** – The maximum number of function instances are already running, or requests are being made too quickly\. -Clients such as the AWS CLI and the AWS SDK retry on client timeouts, throttling errors \(429\), and other errors that aren't caused by a bad request \(500 series\)\. For a full list of invocation errors, see [Invoke](API_Invoke.md)\. +Clients such as the AWS CLI and the AWS SDK retry on client timeouts, throttling errors \(429\), and other errors that aren't caused by a bad request\. For a full list of invocation errors, see [Invoke](API_Invoke.md)\. Function errors occur when your function code or the runtime that it uses return an error\. diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 5a74dc55..03935add 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -59,8 +59,12 @@ If you are following other tutorial topics in this guide, the specific tutorials 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. 1. In the **New Java Class** window, type the following values: + + + **Package**: **example** + **Name**: **Hello** + + **Note** If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. @@ -79,6 +83,8 @@ The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. 1. In the **Add Plugin** window, type the following values: + + + **Group Id:** org\.apache\.maven\.plugins + **Artifact Id:** maven\-shade\-plugin + **Version:** 3\.2\.2 diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md index 62af0c15..61272809 100644 --- a/doc_source/kafka-using-cluster.md +++ b/doc_source/kafka-using-cluster.md @@ -1,5 +1,7 @@ # Using an Apache Kafka cluster as an event source for Lambda + + You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. This page describes how to use your Kafka cluster as an event source for your Lambda function\. @@ -10,6 +12,8 @@ This page describes how to use your Kafka cluster as an event source for your La ## How it works + + When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. + If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. + If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 93ea4ae9..942b41f8 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -82,6 +82,8 @@ When making Lambda API calls, users can specify a version or alias by passing a You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. + + ### Best practices for using Deny statements with functions The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index 4375f047..ba58d856 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -16,6 +16,8 @@ In a rolling deployment, AWS SAM performs these tasks: + It detects when you create a new version of your Lambda function\. + It triggers CodeDeploy to start the deployment of the new version\. + + ## Example AWS SAM Lambda template The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 960d08e1..e8c051a1 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -61,6 +61,7 @@ Other services invoke your function directly\. You grant the other service permi **Services that invoke Lambda functions synchronously** + [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) + [Amazon Cognito](services-cognito.md) ++ [Amazon connect](services-connect.md) + [Amazon Lex](services-lex.md) + [Amazon Alexa](services-alexa.md) + [Amazon API Gateway](services-apigateway.md) diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index 18f76a39..2e8afa81 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -15,6 +15,7 @@ For an ongoing record of events in your AWS account, including events for AWS La + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) AWS Lambda supports logging the following actions as events in CloudTrail log files: ++ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) @@ -25,6 +26,7 @@ AWS Lambda supports logging the following actions as events in CloudTrail log fi + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) + [GetPolicy](API_GetPolicy.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctions](API_ListFunctions.md) diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md index d377f99b..efa356d5 100644 --- a/doc_source/monitoring-servicemap.md +++ b/doc_source/monitoring-servicemap.md @@ -1,16 +1,19 @@ # Example workflows using other AWS services -AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use for AWS X\-Ray and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. +AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use with AWS X\-Ray, AWS Trusted Advisor and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. **Topics** + [Prerequisites](#monitoring-troubleshooting-prereqs) + [Pricing](#monitoring-troubleshooting-pricing) + [Example AWS X\-Ray workflow to view a service map](#monitoring-servicemap-example) + [Example AWS X\-Ray workflow to view trace details](#monitoring-tracing-example) ++ [Example AWS Trusted Advisor workflow to view recommendations](#monitoring-ta-example) + [What's next?](#monitoring-troubleshooting-next-up) ## Prerequisites +The following section describes the steps to using AWS X\-Ray and Trusted Advisor to troubleshoot your Lambda functions\. + ### Using AWS X\-Ray AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray workflows on this page\. If your execution role does not have the required permissions, the Lambda console will attempt to add them to your execution role\. @@ -29,8 +32,17 @@ AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray 1. Choose **Save**\. +### Using AWS Trusted Advisor + +AWS Trusted Advisor inspects your AWS environment and makes recommendations on ways you can save money, improve system availability and performance, and help close security gaps\. You can use Trusted Advisor checks to evaluate the Lambda functions and applications in your AWS account\. The checks provide recommended steps to take and resources for more information\. ++ For more information on AWS support plans for Trusted Advisor checks, see [Support plans](https://console.aws.amazon.com/support/plans/home?#/)\. ++ For more information about the checks for Lambda, see [AWS Trusted Advisor best practice checklist](http://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/)\. ++ For more information on how to use the Trusted Advisor console, see [Get started with AWS Trusted Advisor](https://docs.aws.amazon.com/awssupport/latest/user/get-started-with-aws-trusted-advisor.html)\. ++ For instructions on how to allow and deny console access to Trusted Advisor, see [IAM policy examples](https://docs.aws.amazon.com/awssupport/latest/user/security-trusted-advisor.html#iam-policy-examples-trusted-advisor)\. + ## Pricing + With AWS X\-Ray you pay only for what you use, based on the number of traces recorded, retrieved, and scanned\. For more information, see [AWS X\-Ray Pricing](http://aws.amazon.com/xray/pricing/)\. ++ Trusted Advisor cost optimization checks are included with AWS Business and Enterprise support subscriptions\. For more information, see [AWS Trusted Advisor Pricing](http://aws.amazon.com/premiumsupport/pricing/)\. ## Example AWS X\-Ray workflow to view a service map @@ -76,5 +88,20 @@ If you've enabled AWS X\-Ray, you can use the single\-function view on the Cloud The **Trace details** page opens in the ServiceLens traces view\. ![\[Function trace details in the ServiceLens traces view.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-trace-details.png) +## Example AWS Trusted Advisor workflow to view recommendations + +Trusted Advisor checks Lambda functions in all AWS Regions to identify functions with the highest potential cost savings, and deliver actionable recommendations for optimization\. It analyzes your Lambda usage data such as function execution time, billed duration, memory used, memory configured, timeout configuration and errors\. + +For example, the *Lambda Functions with High Error Rate* check recommends that you use AWS X\-Ray or CloudWatch to detect errors with your Lambda functions\. + +**To check for functions with high error rates** + +1. Open the [Trusted Advisor](https://console.aws.amazon.com/trustedadvisor) console\. + +1. Choose the **Cost Optimization** category\. + +1. Scroll down to **AWS Lambda Functions with High Error Rates**\. Expand the section to see the results and the recommended actions\. + ## What's next? -+ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. \ No newline at end of file ++ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. ++ Learn more about how to get a list of Trusted Advisor checks in [Using Trusted Advisor as a web service](https://docs.aws.amazon.com/awssupport/latest/user/trustedadvisor.html)\. \ No newline at end of file diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index 7c0f280c..a3fa3b30 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -40,6 +40,8 @@ For more information about Intel MKL and similar libraries, see [Math Kernel Lib If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. + + Python Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 50268a89..d0b9384c 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -4,6 +4,8 @@ Lambda invokes your function in an execution environment, which provides a secur The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. + + ![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index 49e9db3b..2c973af3 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -46,7 +46,7 @@ Your runtime code is responsible for completing some initialization tasks\. Then + `LAMBDA_TASK_ROOT` – The directory that contains the function code\. + `AWS_LAMBDA_RUNTIME_API` – The host and port of the runtime API\. - See [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime) for a full list of available variables\. + See [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime) for a full list of available variables\. + **Initialize the function** – Load the handler file and run any global or static code that it contains\. Functions should create static resources like SDK clients and database connections once, and reuse them for multiple invocations\. + **Handle errors** – If an error occurs, call the [initialization error](runtimes-api.md#runtimes-api-initerror) API and exit immediately\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index c498b4ab..233db4c2 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -49,6 +49,8 @@ Each phase starts with an event from the Lambda service to the runtime and to al ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) + + **Topics** + [Init phase](#runtimes-extensions-api-reg) + [Invoke phase](#runtimes-lifecycle-invoke) @@ -322,4 +324,6 @@ The extension uses this method to report an error to Lambda before exiting\. Cal + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. \ No newline at end of file ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + + \ No newline at end of file diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index e2e7810d..a4ca44a0 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -61,6 +61,8 @@ Lambda has introduced two new AWS managed policies: + The **AWSLambda\_ReadOnlyAccess** policy grants read\-only access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. + The **AWSLambda\_FullAccess** policy grants full access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. + + ### Using the AWS managed policies We recommend using the newly launched managed policies to grant users, groups, and roles access to Lambda; however, review the permissions granted in the policies to ensure they meet your requirements\. @@ -80,6 +82,6 @@ You can create a role that users in other accounts or people outside of your org To learn more, consult the following: + To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. + To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing ccess to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. ++ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. + To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. + To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index c8d5fd7a..eefdfd5f 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -119,8 +119,6 @@ The following example processes messages from API Gateway, and logs information **Example LambdaFunctionOverHttps\.go** ``` -package main - import ( "context" "fmt" diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index a77a1bb0..85b8b5b7 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -25,6 +25,8 @@ The request payload you send in the `POST` request identifies the DynamoDB opera ``` + The following is a sample request payload for a DynamoDB read item operation: + + ``` { "operation": "read", diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 80f942db..58b5bfdb 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -17,13 +17,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an 1. Choose **Create function**\. -1. Choose **Blueprints**\. +1. Choose **Use a blueprint**\. 1. Enter **canary** in the search bar\. Choose the **lambda\-canary** blueprint, and then choose **Configure**\. 1. Configure the following settings\. + **Name** – **lambda\-canary**\. - + **Role** – **Create a new role from one or more templates**\. + + **Role** – **Create a new role from AWS policy templates**\. + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. + **Rule** – **Create a new rule**\. @@ -105,6 +105,8 @@ Configure an alarm in Amazon CloudWatch that monitors the Lambda function and se + Threshold – **Whenever Errors is >=****1**\. + **Send notification to** – **lambda\-canary\-notifications**\. + + ## Test the alarm Update the function configuration to cause the function to return an error, which triggers the alarm\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index cb53ee42..030e742a 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -37,6 +37,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re ``` { + "version": "0", "account": "123456789012", "region": "us-east-2", "detail": {}, @@ -45,7 +46,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re "time": "2019-03-01T01:23:45Z", "id": "cdc73f9d-aea9-11e3-9d5a-835b769c0d9c", "resources": [ - "arn:aws:events:us-east-1:123456789012:rule/my-schedule" + "arn:aws:events:us-east-2:123456789012:rule/my-schedule" ] } ``` @@ -58,7 +59,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Under **Function overview**, choose **Add trigger**\. -1. Set the trigger type to **CloudWatch Events/EventBridge**\. +1. Set the trigger type to **EventBridge\(CloudWatch Events\)**\. 1. For **Rule**, choose **Create a new rule**\. diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md new file mode 100644 index 00000000..ca2777ef --- /dev/null +++ b/doc_source/services-connect.md @@ -0,0 +1,41 @@ +# Using Lambda with Amazon Connect + +You can use a Lambda function to process requests from Amazon Connect\. + +Amazon Connect invokes your Lambda function synchronously with an event that contains the request body and metadata\. + +**Example Amazon Connect request event** + +``` +{ + "Details": { + "ContactData": { + "Attributes": {}, + "Channel": "VOICE", + "ContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "CustomerEndpoint": { + "Address": "+1234567890", + "Type": "TELEPHONE_NUMBER" + }, + "InitialContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "InitiationMethod": "INBOUND | OUTBOUND | TRANSFER | CALLBACK", + "InstanceARN": "arn:aws:connect:aws-region:1234567890:instance/c8c0e68d-2200-4265-82c0-XXXXXXXXXX", + "PreviousContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", + "Queue": { + "ARN": "arn:aws:connect:eu-west-2:111111111111:instance/cccccccc-bbbb-dddd-eeee-ffffffffffff/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "Name": "PasswordReset" + }, + "SystemEndpoint": { + "Address": "+1234567890", + "Type": "TELEPHONE_NUMBER" + } + }, + "Parameters": { + "sentAttributeKey": "sentAttributeValue" + } + }, + "Name": "ContactFlowEvent" +} +``` + +For information about how to use Amazon Connect with Lambda, see [ Invoke Lambda functions](https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html) in the *Amazon Connect administrator guide*\. \ No newline at end of file diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 701a36a0..a3a578c3 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -8,6 +8,8 @@ This tutorial provides code that performs these tasks and a sample application t For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\. + + ## Prerequisites To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md index 9e48472f..a38cdde0 100644 --- a/doc_source/stepfunctions-patterns.md +++ b/doc_source/stepfunctions-patterns.md @@ -110,6 +110,7 @@ The following Amazon States Language definition of the `WhichCoat` state machine } ``` + **Example Python function** The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a9eba472..a0c24ba6 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -103,4 +103,4 @@ In this example, the object is 39 characters and takes up 39 bytes when it's sto **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* -Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file +Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 27af38ec..ff9e2917 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -563,7 +563,7 @@ public class ProcessDynamodbRecords implements RequestHandler batchItemFailures = new ArrayList<*gt;(); + List batchItemFailures = new ArrayList<*>(); String curRecordSequenceNumber = ""; for (DynamodbEvent.DynamodbEventRecord dynamodbEventRecord : input.getRecords()) { diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 8ed04e40..b1e09fd7 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -512,7 +512,7 @@ public class ProcessKinesisRecords implements RequestHandler batchItemFailures = new ArrayList<*gt;(); + List batchItemFailures = new ArrayList<*>(); String curRecordSequenceNumber = ""; for (KinesisEvent.KinesisEventRecord kinesisEventRecord : input.getRecords()) { diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 46650be2..953a7226 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -144,7 +144,6 @@ Follow the instructions to create a AWS Lambda function deployment package\. ``` from __future__ import print_function - def lambda_handler(event, context): for record in event['Records']: print("test") @@ -152,4 +151,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file From 202e90007ec50076dadd8daed32a6bad6a933581 Mon Sep 17 00:00:00 2001 From: marianoc84 Date: Tue, 23 Mar 2021 09:14:25 +0100 Subject: [PATCH 075/243] Rephrasing to reflect new Lambda UI Renamed the steps needed to upload a .zip file to reflect changes in the Lambda's UI --- doc_source/gettingstarted-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index 388e7af3..b3db0b03 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -36,7 +36,7 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa 1. Select a function\. -1. Choose **Actions**, **Upload a \.zip file** in the **Function code** pane\. +1. Choose **Upload from**, **\.zip file** in the **Code Source** pane\. 1. Choose **Upload** to select your local \.zip file\. @@ -81,4 +81,4 @@ If your deployment package is larger than 50 MB, we recommend uploading your fun You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. -To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. From e6b04bc71de399058e77fb43e32af8c02c973f81 Mon Sep 17 00:00:00 2001 From: juankb1024 Date: Fri, 26 Mar 2021 20:18:00 -0500 Subject: [PATCH 076/243] Update template.yml After March 1, 2021, the AWS managed policies AWSLambdaReadOnlyAccess and AWSLambdaFullAccess will be deprecated and can no longer be attached to new IAM users. Info: https://docs.aws.amazon.com/lambda/latest/dg/security_iam_troubleshoot.html Without this, the 3-deploy.sh script will always fail. --- sample-apps/s3-java/template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/s3-java/template.yml b/sample-apps/s3-java/template.yml index 3ffd1620..a576f664 100644 --- a/sample-apps/s3-java/template.yml +++ b/sample-apps/s3-java/template.yml @@ -17,7 +17,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole - AmazonS3FullAccess @@ -42,4 +42,4 @@ Resources: Description: Dependencies for the Java S3 sample app. ContentUri: build/s3-java-lib.zip CompatibleRuntimes: - - java8 \ No newline at end of file + - java8 From 815331b7c608bc577e7f3475ba3e4e193f8eb245 Mon Sep 17 00:00:00 2001 From: juankb1024 Date: Fri, 26 Mar 2021 20:20:31 -0500 Subject: [PATCH 077/243] Update template-mvn.yml After March 1, 2021, the AWS managed policies AWSLambdaReadOnlyAccess and AWSLambdaFullAccess will be deprecated and can no longer be attached to new IAM users. Info: https://docs.aws.amazon.com/lambda/latest/dg/security_iam_troubleshoot.html Without this, the 3-deploy.sh script will always fail. --- sample-apps/s3-java/template-mvn.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/s3-java/template-mvn.yml b/sample-apps/s3-java/template-mvn.yml index e8e77b37..dff099bc 100644 --- a/sample-apps/s3-java/template-mvn.yml +++ b/sample-apps/s3-java/template-mvn.yml @@ -17,7 +17,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole - AmazonS3FullAccess @@ -32,4 +32,4 @@ Resources: S3Key: Rules: - Name: prefix - Value: inbound/ \ No newline at end of file + Value: inbound/ From 4964623b1c185caa0a53246890d3eda9795a9078 Mon Sep 17 00:00:00 2001 From: bryamcastle Date: Sun, 28 Mar 2021 11:42:33 -0500 Subject: [PATCH 078/243] Update template.yml --- sample-apps/blank-python/template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sample-apps/blank-python/template.yml b/sample-apps/blank-python/template.yml index 7b14daf2..7d8e59d7 100644 --- a/sample-apps/blank-python/template.yml +++ b/sample-apps/blank-python/template.yml @@ -13,7 +13,8 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess +# - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: From 076a5bdedda5df37c595ce5a0d60afff0aafea47 Mon Sep 17 00:00:00 2001 From: Carl Manaster Date: Mon, 29 Mar 2021 11:01:49 -0700 Subject: [PATCH 079/243] Update with-sqs-create-package.md "a AWS Lambda" --> "an AWS Lambda" --- doc_source/with-sqs-create-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index 953a7226..cfb1164d 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -137,7 +137,7 @@ Build the executable with `go build` and create a deployment package\. For instr The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. -Follow the instructions to create a AWS Lambda function deployment package\. +Follow the instructions to create an AWS Lambda function deployment package\. **Example ProcessSQSRecords\.py** @@ -151,4 +151,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 5077aa18c8fdf6479eeca0403f2be54f61f0624f Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 29 Mar 2021 14:20:13 -0700 Subject: [PATCH 080/243] IAM policy AWSLambdaReadOnlyAccess is now AWSLambda_ReadOnlyAccess --- sample-apps/blank-csharp/template.yml | 2 +- sample-apps/blank-go/template.yml | 2 +- sample-apps/blank-java/template-mvn.yml | 2 +- sample-apps/blank-java/template.yml | 2 +- sample-apps/blank-nodejs/template.yml | 2 +- sample-apps/blank-powershell/template.yml | 2 +- sample-apps/blank-python/template.yml | 1 - sample-apps/blank-ruby/template-2.7.yml | 2 +- sample-apps/blank-ruby/template.yml | 2 +- sample-apps/java-basic/template-mvn.yml | 2 +- sample-apps/java-basic/template.yml | 2 +- sample-apps/java-events-v1sdk/template-mvn.yml | 2 +- sample-apps/java-events-v1sdk/template.yml | 2 +- sample-apps/java-events/template-mvn.yml | 2 +- sample-apps/java-events/template.yml | 2 +- sample-apps/nodejs-apig/template.yml | 2 +- 16 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sample-apps/blank-csharp/template.yml b/sample-apps/blank-csharp/template.yml index 190dd823..17836497 100644 --- a/sample-apps/blank-csharp/template.yml +++ b/sample-apps/blank-csharp/template.yml @@ -14,6 +14,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-go/template.yml b/sample-apps/blank-go/template.yml index 007eb42b..841d6623 100644 --- a/sample-apps/blank-go/template.yml +++ b/sample-apps/blank-go/template.yml @@ -13,6 +13,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-java/template-mvn.yml b/sample-apps/blank-java/template-mvn.yml index d6cefd07..a2c3d5d6 100644 --- a/sample-apps/blank-java/template-mvn.yml +++ b/sample-apps/blank-java/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/blank-java/template.yml b/sample-apps/blank-java/template.yml index fce3ade2..748d3b7e 100644 --- a/sample-apps/blank-java/template.yml +++ b/sample-apps/blank-java/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/blank-nodejs/template.yml b/sample-apps/blank-nodejs/template.yml index 26659b40..fbef2c5c 100644 --- a/sample-apps/blank-nodejs/template.yml +++ b/sample-apps/blank-nodejs/template.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: diff --git a/sample-apps/blank-powershell/template.yml b/sample-apps/blank-powershell/template.yml index 9b11775f..cbae139c 100644 --- a/sample-apps/blank-powershell/template.yml +++ b/sample-apps/blank-powershell/template.yml @@ -14,6 +14,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-python/template.yml b/sample-apps/blank-python/template.yml index 7d8e59d7..d2b27aee 100644 --- a/sample-apps/blank-python/template.yml +++ b/sample-apps/blank-python/template.yml @@ -13,7 +13,6 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole -# - AWSLambdaReadOnlyAccess - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active diff --git a/sample-apps/blank-ruby/template-2.7.yml b/sample-apps/blank-ruby/template-2.7.yml index 1a6410f1..39f2fe93 100644 --- a/sample-apps/blank-ruby/template-2.7.yml +++ b/sample-apps/blank-ruby/template-2.7.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Environment: diff --git a/sample-apps/blank-ruby/template.yml b/sample-apps/blank-ruby/template.yml index 00f841ad..9cd53133 100644 --- a/sample-apps/blank-ruby/template.yml +++ b/sample-apps/blank-ruby/template.yml @@ -13,7 +13,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Environment: diff --git a/sample-apps/java-basic/template-mvn.yml b/sample-apps/java-basic/template-mvn.yml index 0eafe8e7..0fdaaf91 100644 --- a/sample-apps/java-basic/template-mvn.yml +++ b/sample-apps/java-basic/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-basic/template.yml b/sample-apps/java-basic/template.yml index 5a760a43..5cec6e28 100644 --- a/sample-apps/java-basic/template.yml +++ b/sample-apps/java-basic/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events-v1sdk/template-mvn.yml b/sample-apps/java-events-v1sdk/template-mvn.yml index ee250ed0..6cabcd01 100644 --- a/sample-apps/java-events-v1sdk/template-mvn.yml +++ b/sample-apps/java-events-v1sdk/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events-v1sdk/template.yml b/sample-apps/java-events-v1sdk/template.yml index 40b167f1..b1f59be5 100644 --- a/sample-apps/java-events-v1sdk/template.yml +++ b/sample-apps/java-events-v1sdk/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events/template-mvn.yml b/sample-apps/java-events/template-mvn.yml index 5fdfbe50..62078b99 100644 --- a/sample-apps/java-events/template-mvn.yml +++ b/sample-apps/java-events/template-mvn.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/java-events/template.yml b/sample-apps/java-events/template.yml index def7925a..4b1ee18a 100644 --- a/sample-apps/java-events/template.yml +++ b/sample-apps/java-events/template.yml @@ -14,7 +14,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/sample-apps/nodejs-apig/template.yml b/sample-apps/nodejs-apig/template.yml index 8b2d575f..998a9c22 100644 --- a/sample-apps/nodejs-apig/template.yml +++ b/sample-apps/nodejs-apig/template.yml @@ -19,7 +19,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Events: From 973b1bbee38f70d4deda18c45ce79ce778f485e6 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Mon, 29 Mar 2021 16:17:56 -0700 Subject: [PATCH 081/243] clarify that context can be set by the caller there isn't anything specific to "mobile application" when context is set --- doc_source/nodejs-context.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md index 8740b68a..c5a9f578 100644 --- a/doc_source/nodejs-context.md +++ b/doc_source/nodejs-context.md @@ -27,7 +27,7 @@ When Lambda runs your function, it passes a context object to the [handler](node + `env.make` + `env.model` + `env.locale` - + `Custom` – Custom values that are set by the mobile application\. + + `Custom` – Custom values that are set by the caller\. + `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. The following example function logs context information and returns the location of the logs\. @@ -40,4 +40,4 @@ exports.handler = async function(event, context) { console.log('Function name: ', context.functionName) return context.logStreamName } -``` \ No newline at end of file +``` From ab3d7a8578bc6af980e2877c34b199bce5bd5e79 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 5 Apr 2021 08:56:07 -0700 Subject: [PATCH 082/243] periodic update --- .DS_Store | Bin 0 -> 8196 bytes doc_source/.DS_Store | Bin 133124 -> 129028 bytes doc_source/API_AddLayerVersionPermission.md | 2 + doc_source/API_AddPermission.md | 3 +- doc_source/API_CodeSigningConfig.md | 2 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 28 +- doc_source/API_CreateFunction.md | 16 +- doc_source/API_DeleteEventSourceMapping.md | 12 +- doc_source/API_Environment.md | 4 +- .../API_EventSourceMappingConfiguration.md | 12 +- doc_source/API_FileSystemConfig.md | 2 +- doc_source/API_FunctionCode.md | 2 +- doc_source/API_FunctionConfiguration.md | 4 +- doc_source/API_GetEventSourceMapping.md | 12 +- doc_source/API_GetFunctionConfiguration.md | 4 +- doc_source/API_ListVersionsByFunction.md | 2 +- doc_source/API_PublishVersion.md | 4 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 14 +- doc_source/API_UpdateFunctionCode.md | 4 +- doc_source/API_UpdateFunctionConfiguration.md | 10 +- doc_source/access-control-identity-based.md | 4 +- doc_source/best-practices.md | 2 + doc_source/configuration-database.md | 4 +- doc_source/configuration-images.md | 6 +- doc_source/configuration-layers.md | 2 +- doc_source/csharp-handler.md | 2 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-tracing.md | 6 +- doc_source/deploying-lambda-apps.md | 2 + doc_source/gettingstarted-package.md | 4 +- doc_source/golang-handler.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/index.md | 6 +- doc_source/java-context.md | 4 +- doc_source/java-exceptions.md | 6 +- doc_source/java-handler.md | 24 +- doc_source/java-logging.md | 6 +- doc_source/java-package.md | 2 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 6 +- doc_source/lambda-functions.md | 4 +- doc_source/lambda-monitoring.md | 2 + doc_source/lambda-nodejs.md | 3 + doc_source/lambda-permissions.md | 2 + doc_source/lambda-python.md | 22 +- doc_source/lambda-releases.md | 40 +- doc_source/lambda-ruby.md | 3 + doc_source/lambda-runtimes.md | 9 + doc_source/lambda-security.md | 2 + doc_source/lambda-services.md | 2 + doc_source/lambda-troubleshooting.md | 2 + doc_source/nodejs-context.md | 4 +- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-tracing.md | 8 +- doc_source/powershell-logging.md | 2 +- doc_source/python-context.md | 5 +- doc_source/python-exceptions.md | 3 + doc_source/python-handler.md | 21 +- doc_source/python-image.md | 3 + doc_source/python-logging.md | 3 + doc_source/python-package-create.md | 12 +- doc_source/python-package-update.md | 16 +- doc_source/python-package.md | 3 + doc_source/python-tracing.md | 11 +- doc_source/ruby-handler.md | 2 +- doc_source/ruby-tracing.md | 8 +- doc_source/runtime-support-policy.md | 46 +- doc_source/runtimes-context.md | 2 +- doc_source/samples-blank.md | 18 +- doc_source/samples-errorprocessor.md | 6 +- doc_source/samples-listmanager.md | 10 +- doc_source/services-apigateway-code.md | 2 +- doc_source/services-apigateway-tutorial.md | 10 +- doc_source/services-apigateway.md | 8 +- doc_source/services-cloudformation.md | 2 +- .../services-cloudwatchevents-expressions.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-xray.md | 2 +- doc_source/welcome.md | 2 + doc_source/with-android-example.md | 6 + doc_source/with-ddb-example.md | 7 + doc_source/with-kinesis-example.md | 6 + doc_source/with-s3-example-deployment-pkg.md | 353 --------- doc_source/with-s3-example.md | 524 +++++-------- doc_source/with-s3-tutorial.md | 712 ++++++++++++++++++ doc_source/with-s3.md | 4 +- doc_source/with-sqs-create-package.md | 4 +- doc_source/with-sqs-example.md | 6 + doc_source/with-sqs.md | 10 + 92 files changed, 1238 insertions(+), 941 deletions(-) create mode 100644 .DS_Store delete mode 100644 doc_source/with-s3-example-deployment-pkg.md create mode 100644 doc_source/with-s3-tutorial.md diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..46177358ce517fc9065e0a719a965ecfd3892489 GIT binary patch literal 8196 zcmeHMS!@+m82-OfU}g&Rl&#AExzflI3bq(1Ws%zrsX#z)OUrt>_s#$lr!)1=+*_d3 z)S%G^193@=+Y9;z(I*TsKDk0PCdS4s(U|z=lkv?Mm;cO}vK0E@3z#q`Ip;s;{QrNJ zZ@xL_{&R^49VM%UsE&v<&QgjhE^d>gUgld;Mcgx;CD@-RAfHN9qypKuSSK9`0to^M z0to^M0to{D2L$-emPwo9-dEbBOb|#AxF->i=R=CKl<8QGDH$CdTtp!N%S!H!64yBn zhFmSajPcY<;!#4{s~P!P?|eyPZukXAA& z69f_jZbd-G?gm*Lw-+dTWBi^U4ufB7!cx$YD;|)oJ-P6BKCburzI&~n%kOpU;jEb7>3d<$@$6#c>{vFN9PD>I%OCFW zOP&=(<7AXV*L6+Lin@`Jme$s$)Y=VgqfM!iw$_%WRO{Nd(NSHiy}xBk&ym5Cr$$bX zKKZKJAL28DsweIDwW&611qCQ-ZUPP6s4{yVF?MFf+%j)+ z_fY8gUa;3L1}w9pI$&UW3ck0eXiI&6!FNl8UXT?vg`8U`xw+78cioJ0$_@rX`$Q;f z`vboic1DI-AxeS$n9X)h+3sTNV8G$wq?v$zVb+4hOP8%`Ubk^;*ZAx?)xt35&F?Qe zfs=RbeYv1udzRxJ>l=2g@c4el)eD`Yj$PFC8eH!6a)b7`SXf(E-(Z@`=DN?sC5-<iX0IFdSkjd=88u3w1zL8 z?R1boVhzz5dY;bGIeMMmri=6*eL$bl6}n1a&{y;W{Y<~o@AN1AMSs&j(69gtQHOdg z#Tq<-X0+iUY(+adumgMWC^G29ArxTYD2`zWCvXxYIE`m;7U%FHUcwu=fQxts@8U8( z#7FoTpWsV;jd8WUiV1G-iq{(p{K%E5s2jh?6^Cy}-G=UM#`e2I-S1~fzShj0H-EvB z#ucmAwr*~}_FN}D$r~vZ@kkLRBG3duqDOfXE5{>Z8;cfCF!?&S71#TifA$GYl1R){ z)(!V9)tEOzi<`@qbMum@h?+*jswSN&ET+XnH@9d^Rxw>^jdkmFrn9JwwHr6Fc88cT zUSC_caEr0k5G3C^JsxWrA8-GiiRbA8y-%Og=gh!w=qLJxexpACRG|j75&ITl36^68 zR$>)aV?A220UNOy-PneQ(ZgKqMIZKJ0Q(~@+RQ}@W==kZGk6-$;yJt!aq?xn ziSu}C5(9fCG4SG43@m4gp6h$ZSU6rPV=)3v*M_lN!Mg1fXD#f62ff1sd+LZR9UwM~4GzY2zuSYY{i(G**y zrZF*LGa)BUY-wxalOlK%=LP7}#=c-}G1?bX%j%}6(R8Uk)EDcyNKCaz)jK(J&)hrb zyWgDo=G@^C%W!sGNC<)I!H&2v_>M-KKxs1cuy-Fn3=82DVt`wh=oX!#IGK3& zZj%wn=Ambs@Qgg|x5(Cu+hiitq`NI%vmP=31bv-ld{Q<{#iYG1qc=>wW0F;=C>`m* zqTHG)lx3+$OdX;_##(~%T5BGB^5s;aJ~rE=sfH#Lfp)zBuUY(c%EWwBzi@GnCO^6C zmf;1Tj1F9tSH98Mua+OSdgX7YbM?XWW=*-azyo=BDIlA(x$^PsV=}%_x-!Kj9oc|> zZ0VeR)Q(4~xeA$42fAf(w&vDZ>Ld`+C~AV6<}`Sys~SaA;6hAZ>CG6ozcq*>s9Fxe3T&WM5~Wme6k!@mB53BXgy`#295H^9 z!SYn(Blv-Qa-PL~RC0!6?@{m1BOeH>8)>*WqjVyRTC!e8y_`LJgnHu8{;EqpW3hBwenwOsxQ@5(qVw%=l6436(XVM{6Kcbo7PM0&hNV9f zy$UG<$ERlEh-wt7n9-ABBA_p7&GN0FWEBiJl=wzC>X@Cx$( z5bx@&JSv;SoSiPuun^{sL!%4Z@St*>KojI_sC&)e++|&;OQ#UD(XI(RK|gx2NV_Lc zPMRN9#olL-RU4jL6UIv{sfSdjjx$yjuIEEd1@(xj%9Ig3e<(m7Ok&{9Fp3rVy^Wf` zz`ZoK9YNZ13B`t&NB#3Cm*c@jDw)R+9h=1Po#BW@U9N6^j`wV8dOI{I#{zypVLunj z60QcF+^?Bh;?qz}b$j7ab>HGst2+NQVoJsVAXY(xSpIm%CDXgTbb1Gdp&JZ@Q8!j|?o9rv|fBVlG^uq+Ddl(fR~^-GvEF=A6Atj=X1) zRk2JtKAI(KM<0;I7w1w@5Le~4(K!a;)eFbkH90x5_WJ8LDe}tjWQf9Lu*%}eCCwVb zbYKaFDB_0m({woPa$9WW&0N&vKv1>Wu^yzXa8bGwK6+^>b7~22D&AT&nUUzeCA&w3 z(;%5MgnViZVI4JOFcogau*%6mrj0rrm_t{5$i1x$ud2vKIp~>1tUW#tYn7t{nf3(@ zVlUUhUe0BM$QDNEuMfXbLk{u>k`n}0-ic0l zfHZ3C3+m1PscDboFaL9DtviMzEf?|Bhd%XA2%zJ-e~rd&m1n*LYG z$<$Pfg{sYnp^D_e2CA+%ilq(@Yk7YsZLi4Tr0wGMzf)=0>QxsHa>ht&#NG74*Z5f_ zHe!<|6MbnjlIJGQ=298iX;IM^u?Ez392Tk~*y-SMlqp9O&S>(S%QqwGF3Nfni`B+s zSO&Usk_)Z21p#?HX_zuT=Rz}fs-y)eHu*?u?~K)WrpqsUij)3r6fvmD74U+Pk6cyM zjxVk9Ts%Knqr3nenKpNFR>b>$TXPT^u+hv&V0Q3Hd+#<+EG0>f_*wzZ*+9N;VF+QE3fOs^thtbF%)@Bvjs|cdI<(6gP$RnYR53& zj4>Net^;OrTt@zVJi3hOHT5wOXAt~;855AfI5Zh=fPwwjaQGT-oW{lg6!g?()X+m^ L*l=Pqx=eoo3{>SD diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index b327715e..e5c0a23a 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -42,12 +42,14 @@ The request accepts the following data in JSON format\. ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String +Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String +Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index 01452a8c..cd2857b7 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -64,7 +64,7 @@ Required: No ** [Principal](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String -Pattern: `.*` +Pattern: `[^\s]+` Required: Yes ** [RevisionId](#API_AddPermission_RequestSyntax) ** @@ -75,6 +75,7 @@ Required: No ** [SourceAccount](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String +Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index c787444c..adcc72ca 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -1,6 +1,6 @@ # CodeSigningConfig -Details about a Code signing configuration\. +Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html)\. ## Contents diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 2d49743f..d35e8561 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -1,6 +1,6 @@ # CodeSigningPolicies -Code signing configuration policies specifies the validation failure action for signature mismatch or expiry\. +Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) specify the validation failure action for signature mismatch or expiry\. ## Contents diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 7c9f4ba5..61a802c8 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,13 +2,13 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. -+ [Using AWS Lambda with Amazon DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) -+ [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html) -+ [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) -+ [Using AWS Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html) -+ [Using AWS Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [Using AWS Lambda with Self\-Managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) +For details about each event source type, see the following topics\. In particular, each of the topics describes the required and optional parameters for the specific event source\. ++ [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -122,7 +122,7 @@ Required: Yes ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -254,11 +254,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -274,7 +274,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -291,17 +291,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(Streams only\) 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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 12105e88..90ff763a 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -2,6 +2,10 @@ Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. + +You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. + When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. @@ -135,7 +139,7 @@ Pattern: `[^\s]+` Required: No ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** - [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. +Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. Type: [ImageConfig](API_ImageConfig.md) object Required: No @@ -153,7 +157,7 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No @@ -187,13 +191,13 @@ Type: String to string map Required: No ** [Timeout](#API_CreateFunction_RequestSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. +The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with AWS X\-Ray\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No @@ -305,11 +309,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_CreateFunction_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 759438f1..85797869 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -82,11 +82,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -102,7 +102,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -119,17 +119,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(Streams only\) 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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index d7d1c480..97ce945c 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -1,11 +1,11 @@ # Environment -A function's environment variable settings\. +A function's environment variable settings\. You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. ## Contents **Variables** -Environment variable key\-value pairs\. +Environment variable key\-value pairs\. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` Required: No diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index f82fb0fe..8c6aca49 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -11,12 +11,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No **BisectBatchOnFunctionError** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean Required: No **DestinationConfig** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -35,7 +35,7 @@ Required: No **FunctionResponseTypes** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -56,19 +56,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No **MaximumRecordAgeInSeconds** -\(Streams\) 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\. +\(Streams only\) 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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** -\(Streams\) 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\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No **ParallelizationFactor** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 4aa62f56..4e3ecc1f 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -1,6 +1,6 @@ # FileSystemConfig -Details about the connection between a Lambda function and an Amazon EFS file system\. +Details about the connection between a Lambda function and an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. ## Contents diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index 6ebb6ed3..ea8dcf57 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -5,7 +5,7 @@ The code for the Lambda function\. You can specify either an object in Amazon S3 ## Contents **ImageUri** -URI of a container image in the Amazon ECR registry\. +URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. Type: String Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index be995ce7..c6105cf6 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -26,12 +26,12 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No **Environment** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object Required: No **FileSystemConfigs** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index fb1c29a7..eb182d3f 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -80,11 +80,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -100,7 +100,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -117,17 +117,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(Streams only\) 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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 8fc54d45..5ed5e329 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -138,11 +138,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index a6bb06e9..87a9b031 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -28,7 +28,7 @@ Required: Yes Specify the pagination token that's returned by a previous request to retrieve the next page of results\. ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** -The maximum number of versions to return\. +The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index d361190c..a70135ce 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -158,11 +158,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_PublishVersion_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 653b1917..517a7d18 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's AWS X\-Ray tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 4e6263f3..c238265e 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -98,7 +98,7 @@ Required: No ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No @@ -198,11 +198,11 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. The default value is false\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -218,7 +218,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams\) A list of current response type enums applied to the event source mapping\. Type: Array of strings -Array Members: Fixed number of 1 item\. +Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -235,17 +235,17 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(Streams only\) 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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) 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\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 8f181f19..d266387b 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -192,11 +192,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index f828bcfe..d01c5d7b 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -121,7 +121,7 @@ Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0- Required: No ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of memory available to the function at runtime\. Increasing the function's memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. +The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No @@ -144,13 +144,13 @@ Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodej Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. +The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with AWS X\-Ray\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No @@ -262,11 +262,11 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's environment variables\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -Connection settings for an Amazon EFS file system\. +Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 56270b66..1e738dce 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -6,8 +6,8 @@ Lambda provides AWS managed policies that grant access to Lambda API actions and **Note** The AWS managed policies **AWSLambdaFullAccess** and **AWSLambdaReadOnlyAccess** will be [deprecated](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) on March 1, 2021\. After this date, you cannot attach these policies to new IAM users\. For more information, see the related [troubleshooting topic](security_iam_troubleshoot.md#security_iam_troubleshoot-admin-deprecation)\. -+ **AWSLambdaFullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. -+ **AWSLambdaReadOnlyAccess** – Grants read\-only access to Lambda resources\. ++ **AWSLambda\_FullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. ++ **AWSLambda\_ReadOnlyAccess** – Grants read\-only access to Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. + **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. AWS managed policies grant permission to API actions without restricting the Lambda functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 9e01a7db..e765485d 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -8,6 +8,8 @@ The following are recommended best practices for using AWS Lambda: + [Metrics and alarms](#alarming-metrics) + [Working with streams](#stream-events) +For more information about best practices for Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. + ## Function code + **Separate the Lambda handler from your core logic\.** This allows you to make a more unit\-testable function\. In Node\.js this may look like: diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index 8e42e650..f1a0a47b 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -53,7 +53,7 @@ You can create a database proxy that uses the function's IAM credentials for aut The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** +**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** ``` const signer = new AWS.RDS.Signer({ @@ -89,4 +89,4 @@ Sample applications that demonstrate the use of Lambda with an Amazon RDS databa [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/README.md)\. \ No newline at end of file +To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 10bf3d74..5a38bfd5 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -189,12 +189,12 @@ In the `AWS::Lambda::Function` resource, set the following properties to create + Code – Enter your container image URI in the `ImageUri` field\. + ImageConfig – \(Optional\) Override the container image configuration properties\. -The `AWS::Lambda::Function::ImageConfig` resource contains the following fields: +The `ImageConfig` property in `AWS::Lambda::Function` contains the following fields: + Command – Specifies parameters that you want to pass in with `EntryPoint`\. + EntryPoint – Specifies the entry point to the application\. + WorkingDirectory – Specifies the working directory\. **Note** -If you declare an `ImageConfig` resource in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. +If you declare an `ImageConfig` property in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. -For information about the `ImageConfig` resource, see [ImageConfig](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-imageconfig.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file +For more information, see [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index a91abe0e..63b7254a 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -316,7 +316,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 9739305d..88ff9be2 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in C\# -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 7e7df14d..2e53e534 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** ``` public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 835f8e7c..c01fbf94 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** +**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** ``` @@ -59,7 +59,7 @@ You can instrument your function code to record metadata and trace downstream ca To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** +**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** ``` static async void initialize() { @@ -118,7 +118,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 5e2b25a1..eba01d7e 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -10,6 +10,8 @@ The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI] When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. +For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. + **Topics** + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index b3db0b03..787224a9 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -36,7 +36,7 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa 1. Select a function\. -1. Choose **Upload from**, **\.zip file** in the **Code Source** pane\. +1. In the **Code Source** pane, choose **Upload from** and then **\.zip file**\. 1. Choose **Upload** to select your local \.zip file\. @@ -81,4 +81,4 @@ If your deployment package is larger than 50 MB, we recommend uploading your fun You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. -To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. +To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index 6d9032d1..c3c80996 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Go -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index c94ebb5b..5f8da42a 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-go/function/main.go) – Logging** +**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go/function/main.go) – Logging** ``` func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 0b76e3be..c479b6f0 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -100,7 +100,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/index.md b/doc_source/index.md index 66fdcf1d..6b01b909 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -121,8 +121,8 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) - + [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) - + [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) + + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) + + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + [Using AWS Lambda with Amazon SES](services-ses.md) @@ -160,7 +160,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Node.js](nodejs-exceptions.md) + [Instrumenting Node.js code in AWS Lambda](nodejs-tracing.md) + [Building Lambda functions with Python](lambda-python.md) - + [AWS Lambda function handler in Python](python-handler.md) + + [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) + [Updating a Lambda function in Python 3.8](python-package-update.md) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 99a60a3e..c249fff6 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -17,7 +17,7 @@ When Lambda runs your function, it passes a context object to the [handler](java The following example shows a function that uses the context object to access the Lambda logger\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; @@ -66,7 +66,7 @@ REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Bille The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/test/java/example/TestContext.java)** +**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** ``` package example; diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index fb8fb869..cf8cadf2 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -68,9 +68,9 @@ For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md# You can create a Lambda function that displays human\-readable error messages to users\. **Note** -To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. +To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** +**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** ``` import java.util.List; @@ -111,7 +111,7 @@ When the function throws `InputLengthException`, the Java runtime serializes it } ``` -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. +In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. The return statement in the previous example can also throw a runtime exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 842f9360..81125f55 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -1,10 +1,10 @@ # AWS Lambda function handler in Java -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java)** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** ``` package example; @@ -42,7 +42,7 @@ You can add [initialization code](gettingstarted-features.md#gettingstarted-feat In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** ``` // Handler value: example.Handler @@ -75,7 +75,7 @@ The GitHub repo for this guide provides easy\-to\-deploy sample applications tha You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/event.json) – Weather data** +**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/event.json) – Weather data** ``` { @@ -112,7 +112,7 @@ The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/m The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** +**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** ``` // Handler value: example.Handler @@ -125,7 +125,7 @@ To use your own serialization, implement the `RequestStreamHandler` interface\. The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** +**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** ``` import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) @@ -177,11 +177,11 @@ The GitHub repository for this guide includes sample applications that demonstra + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. ++ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. ++ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. ++ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. ++ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. ++ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. ++ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index b7ee6126..c8da6366 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -222,7 +222,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -269,7 +269,7 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** ``` import org.slf4j.Logger; @@ -295,7 +295,7 @@ public class Handler implements RequestHandler{ The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Logging dependencies** ``` dependencies { diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 8467b2e1..bbc574e0 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -307,7 +307,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 4aa16cb4..31985ad9 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -15,7 +15,7 @@ Use the `blank-java` sample app to learn the basics, or as a starting point for The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** +**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** ``` // Handler value: example.HandlerStream @@ -38,7 +38,7 @@ public class HandlerStream implements RequestStreamHandler { The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 2d3ec9e1..6da3fdad 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** ``` dependencies { @@ -101,7 +101,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -118,7 +118,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-java/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index b474f5e5..35371776 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -10,4 +10,6 @@ As you add libraries and other dependencies to your function, creating and uploa To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. + +For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index a1ebc99f..caa57e8d 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -4,6 +4,8 @@ AWS Lambda integrates with other AWS services to help you monitor and troublesho You can use other AWS services to troubleshoot your Lambda functions\. This section describes how to use these AWS services to monitor, trace, debug, and troubleshoot your Lambda functions and applications\. +For more information about monitoring Lambda applications, see [Monitoring and observability](https://docs.aws.amazon.com/lambda/latest/operatorguide/monitoring-observability.html) in the *Lambda operator guide*\. + **Topics** + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 66466169..c3e5aa0b 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -13,6 +13,9 @@ Lambda supports the following Node\.js runtimes\. | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +**Note** +For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 7f3c461d..3c4cbbbf 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -15,6 +15,8 @@ You can restrict user permissions by the resource an action affects and, in some For more information about IAM, see [What is IAM?](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*\. +For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. + **Topics** + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource\-based policies for AWS Lambda](access-control-resource-based.md) diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 87978144..aa915f24 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -4,6 +4,9 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + **Python runtimes** @@ -14,23 +17,6 @@ Lambda supports the following Python runtimes\. | Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -You can add permissions to the role later, or swap it out for a different role that's specific to a single function\. - **To create a Python function** 1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. @@ -71,7 +57,7 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](python-logging.md) during invocation\. If your function [returns an error](python-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** -+ [AWS Lambda function handler in Python](python-handler.md) ++ [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 9c890a25..d5b2158b 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -11,7 +11,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | | [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | | [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | -| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | +| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | | [New event source for Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | | [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | @@ -19,21 +19,21 @@ The following table describes the important changes to the *AWS Lambda Developer | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | | [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | -| [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using AWS Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | +| [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | -| [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | AWS Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | +| [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](https://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | | [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | -| [Increased concurrency for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | A new option for [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings enables you to process more than one batch at a time from each shard\. When you increase the number of concurrent batches per shard, your function's concurrency can be up to 10 times the number of shards in your stream\. For details, see [AWS Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | +| [Increased concurrency for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | A new option for [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings enables you to process more than one batch at a time from each shard\. When you increase the number of concurrent batches per shard, your function's concurrency can be up to 10 times the number of shards in your stream\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | When you create or update a function, it enters a pending state while Lambda provisions resources to support it\. If you connect your function to a VPC, Lambda can create a shared elastic network interface right away, instead of creating network interfaces when your function is invoked\. This results in better performance for VPC\-connected functions, but might require an update to your automation\. For details, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Error handling options for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors) | New configuration options are available for asynchronous invocation\. You can configure Lambda to limit retries and set a maximum event age\. For details, see [Configuring error handling for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors)\. | November 25, 2019 | -| [Error handling for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | New configuration options are available for event source mappings that read from streams\. You can configure [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings to limit retries and set a maximum record age\. When errors occur, you can configure the event source mapping to split batches before retrying, and to send invocation records for failed batches to a queue or topic\. For details, see [AWS Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | +| [Error handling for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | New configuration options are available for event source mappings that read from streams\. You can configure [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings to limit retries and set a maximum record age\. When errors occur, you can configure the event source mapping to split batches before retrying, and to send invocation records for failed batches to a queue or topic\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | | [Destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations) | You can now configure Lambda to send records of asynchronous invocations to another service\. Invocation records contain details about the event, context, and function response\. You can send invocation records to an SQS queue, SNS topic, Lambda function, or EventBridge event bus\. For details, see [Configuring destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations)\. | November 25, 2019 | -| [New runtimes for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtimes are available for Node\.js 12, Python 3\.8, and Java 11\. For details, see [AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | -| [FIFO queue support for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss) | You can now create an event source mapping that reads from a first\-in, first\-out \(FIFO\) queue\. Previously, only standard queues were supported\. For details, see [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | +| [New runtimes for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtimes are available for Node\.js 12, Python 3\.8, and Java 11\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | +| [FIFO queue support for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss) | You can now create an event source mapping that reads from a first\-in, first\-out \(FIFO\) queue\. Previously, only standard queues were supported\. For details, see [Using Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | | [Create applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | Application creation in the Lambda console is now generally available\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 31, 2019 | | [Create applications in the Lambda console \(beta\)](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | You can now create a Lambda application with an integrated continuous delivery pipeline in the Lambda console\. The console provides sample applications that you can use as a starting point for your own project\. Choose between AWS CodeCommit and GitHub for source control\. Each time you push changes to your repository, the included pipeline builds and deploys them automatically\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 3, 2019 | | [Performance improvements for VPC\-connected functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | Lambda now uses a new type of elastic network interface that is shared by all functions in a virtual private cloud \(VPC\) subnet\. When you connect a function to a VPC, Lambda creates a network interface for each combination of security group and subnet that you choose\. When the shared network interfaces are available, the function no longer needs to create additional network interfaces as it scales up\. This dramatically improves startup times\. For details, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | September 3, 2019 | @@ -43,16 +43,16 @@ The following table describes the important changes to the *AWS Lambda Developer | [Node\.js 10](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | A new runtime is available for Node\.js 10, nodejs10\.x\. This runtime uses Node\.js 10\.15 and will be updated with the latest point release of Node\.js 10 periodically\. Node\.js 10 is also the first runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 13, 2019 | | [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | | [Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Ruby 2\.5 with a new runtime\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom AWS Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | +| [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | +| [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Application Load Balancer triggers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss) | Elastic Load Balancing now supports Lambda functions as a target for Application Load Balancers\. For details, see [Using Lambda with application load balancers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using AWS Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | +| [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | -| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [AWS Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | +| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | | [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. For details, see [AWS GovCloud \(US\-East\) now open](https://aws.amazon.com/blogs/aws/aws-govcloud-us-east-now-open/?icmpid=docs_lambda_rss) on the AWS blog\. | November 12, 2018 | | [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | -| [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [AWS Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | +| [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | | [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | | [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | @@ -84,19 +84,19 @@ The following table describes the important changes in each release of the *AWS | AWS Lambda support for the \.NET runtime, Lambda@Edge \(Preview\), Dead Letter Queues and automated deployment of serverless applications\. | AWS Lambda added support for C\#\. For more information, see [Building Lambda functions with C\#](lambda-csharp.md)\. Lambda@Edge allows you to run Lambda functions at the AWS Edge locations in response to CloudFront events\. For more information, see [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md)\. | December 3, 2016 | | AWS Lambda adds Amazon Lex as a supported event source\. | Using Lambda and Amazon Lex, you can quickly build chat bots for various services like Slack and Facebook\. For more information, see [Using AWS Lambda with Amazon Lex](services-lex.md)\. | November 30, 2016 | | US West \(N\. California\) Region | AWS Lambda is now available in the US West \(N\. California\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 21, 2016 | -| Introduced the AWS Serverless Application Model for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS Serverless Application Model: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | +| Introduced the AWS SAM for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS SAM: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | | Asia Pacific \(Seoul\) Region | AWS Lambda is now available in the Asia Pacific \(Seoul\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | August 29, 2016 | | Asia Pacific \(Sydney\) Region | Lambda is now available in the Asia Pacific \(Sydney\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 23, 2016 | | Updates to the Lambda console | The Lambda console has been updated to simplify the role\-creation process\. For more information, see [Create a Lambda function with the console](getting-started-create-function.md)\. | June 23, 2016 | | AWS Lambda now supports Node\.js runtime v4\.3 | AWS Lambda added support for Node\.js runtime v4\.3\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 07, 2016 | | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | -| AWS Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambda functions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up AWS Lambda to invoke your code on a regular, scheduled basis using the AWS Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | +| Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | +| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | -| AWS Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, AWS Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | -| The AWS Lambda console now provides blueprints to easily create Lambda functions and test them\. | AWS Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the AWS Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | -| AWS Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | -| AWS Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | -| AWS Lambda now generally available with added support for mobile backends | AWS Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using AWS Lambda that scale automatically without provisioning or managing infrastructure\. AWS Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | +| Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | +| The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | +| Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | +| Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | +| Lambda now generally available with added support for mobile backends | Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using Lambda that scale automatically without provisioning or managing infrastructure\. Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | | Preview release | Preview release of the *AWS Lambda Developer Guide*\. | November 13, 2014 | \ No newline at end of file diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index ce4963c7..62807c1a 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -12,6 +12,9 @@ Lambda supports the following Ruby runtimes\. | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +**Note** +For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 93d6a5b7..d58ef247 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -25,6 +25,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +**Note** +For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. + **Python runtimes** @@ -35,6 +38,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +**Important** +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. + **Ruby runtimes** @@ -43,6 +49,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +**Note** +For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. + **Java runtimes** diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md index 738703b2..9cebf5f4 100644 --- a/doc_source/lambda-security.md +++ b/doc_source/lambda-security.md @@ -8,6 +8,8 @@ Security is a shared responsibility between AWS and you\. The [shared responsibi This documentation helps you understand how to apply the shared responsibility model when using Lambda\. The following topics show you how to configure Lambda to meet your security and compliance objectives\. You also learn how to use other AWS services that help you to monitor and secure your Lambda resources\. +For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. + **Topics** + [Data protection in AWS Lambda](security-dataprotection.md) + [Identity and access management for Lambda](security-iam.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index e8c051a1..5bac8e85 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -58,6 +58,8 @@ For services that generate a queue or data stream, you create an [event source m Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. +For more information about Lambda service architectures, see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. + **Services that invoke Lambda functions synchronously** + [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) + [Amazon Cognito](services-cognito.md) diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md index 61a9711e..927c5b35 100644 --- a/doc_source/lambda-troubleshooting.md +++ b/doc_source/lambda-troubleshooting.md @@ -4,6 +4,8 @@ The following topics provide troubleshooting advice for errors and issues that y For more troubleshooting advice and answers to common support questions, visit the [AWS Knowledge Center](https://aws.amazon.com/premiumsupport/knowledge-center/#AWS_Lambda)\. +For more information about debugging and troubleshooting Lambda applications, see [Debugging](https://docs.aws.amazon.com/lambda/latest/operatorguide/debugging-ops.html) in the *Lambda operator guide*\. + **Topics** + [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) + [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md index c5a9f578..7a1e562f 100644 --- a/doc_source/nodejs-context.md +++ b/doc_source/nodejs-context.md @@ -27,7 +27,7 @@ When Lambda runs your function, it passes a context object to the [handler](node + `env.make` + `env.model` + `env.locale` - + `Custom` – Custom values that are set by the caller\. + + `Custom` – Custom values that are set by the client application\. + `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. The following example function logs context information and returns the location of the logs\. @@ -40,4 +40,4 @@ exports.handler = async function(event, context) { console.log('Function name: ', context.functionName) return context.logStreamName } -``` +``` \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index b792b973..406c5f25 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Node\.js -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. The following example function logs the contents of the event object and returns the location of the logs\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 0132ea20..43c7fc2c 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -48,7 +48,7 @@ AWSXRay.setContextMissingStrategy(() => {}); You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/package.json)** +**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/package.json)** ``` { @@ -70,7 +70,7 @@ You can instrument your handler code to record metadata and trace downstream cal To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -135,7 +135,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -152,7 +152,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index e0c81187..1c5ab1ea 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -15,7 +15,7 @@ This page describes how to produce log output from your Lambda function's code, To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-powershell/function/Handler.ps1) – Logging** +**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** ``` #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} diff --git a/doc_source/python-context.md b/doc_source/python-context.md index b0770e46..332f2077 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,6 +1,9 @@ # AWS Lambda context object in Python -When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [AWS Lambda function handler in Python](python-handler.md)\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + +When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. **Context methods** + `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 83ee2cd5..ef389967 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,5 +1,8 @@ # AWS Lambda function errors in Python +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 4a022c55..9849eb94 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,6 +1,9 @@ -# AWS Lambda function handler in Python +# Lambda function handler in Python -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You can use the following general syntax when creating a function handler in Python: @@ -12,19 +15,19 @@ def handler_name(event, context): ## Naming -The Lambda function *handler* name specified at the time you create a Lambda function is derived from the following: -+ the name of the file in which the Lambda handler function is located -+ the name of the Python handler function +The Lambda function handler name specified at the time that you create a Lambda function is derived from: ++ The name of the file in which the Lambda handler function is located\. ++ The name of the Python handler function\. -A function handler can be any name; however, the default on the Lambda console is `lambda_function.lambda_handler`\. This name reflects the function name as `lambda_handler`, and the file where the handler code is stored in `lambda_function.py`\. +A function handler can be any name; however, the default name in the Lambda console is `lambda_function.lambda_handler`\. This function handler name reflects the function name \(`lambda_handler`\) and the file where the handler code is stored \(`lambda_function.py`\)\. -If you choose a different name for your function handler on the Lambda console, you must update the name on the **Runtime settings** pane\. The following example shows the Lambda function handler on the Lambda console: +To change the function handler name in the Lambda console, on the **Runtime settings** pane, choose **Edit**\. -![\[The following image shows the function handler on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) +![\[A function handler name in the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) ## How it works -When your function handler is invoked by Lambda, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: +When Lambda invokes your function handler, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: + The first argument is the [event object](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-event)\. An event is a JSON\-formatted document that contains data for a Lambda function to process\. The [Lambda runtime](lambda-runtimes.md) converts the event to an object and passes it to your function code\. It is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or the `NoneType` type\. The event object contains information from the invoking service\. When you invoke a function, you determine the structure and contents of the event\. When an AWS service invokes your function, the service defines the event structure\. For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 0f5b3e34..5b7c5dc1 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,5 +1,8 @@ # Deploy Python Lambda functions with container images +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 1d3fe7cb..c8d3710a 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,5 +1,8 @@ # AWS Lambda function logging in Python +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 46e2f92d..04cb9e72 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -186,22 +186,16 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i **To invoke the function** + Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ------- -#### [ macOS/Linux ] - ``` aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt ``` - ------- -#### [ Windows ] +**Note** +If you are using AWS CLI version 2, add the following command parameter: ``` - aws lambda invoke --function-name my-math-function --cli-binary-format raw-in-base64-out --payload "{"action": "square","number": 3}" output.txt + --cli-binary-format raw-in-base64-out ``` ------- - This command produces the following output: ``` diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 3c734766..0ea280f5 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -105,10 +105,10 @@ To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa my-deployment-package.zip$ │ lambda_function.py │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ ... ``` @@ -188,10 +188,10 @@ A library may appear in `site-packages` or `dist-packages` and the first folder my-deployment-package.zip$ │ lambda_function.py │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ ... ``` diff --git a/doc_source/python-package.md b/doc_source/python-package.md index b46c5ede..743f475e 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,5 +1,8 @@ # Deploy Python Lambda functions with \.zip file archives +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index c6b364fe..83b40b55 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,5 +1,8 @@ # Instrumenting Python code in AWS Lambda +**Note** +End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. + Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. @@ -35,7 +38,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/requirements.txt)** +**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 @@ -44,7 +47,7 @@ aws-xray-sdk==2.4.3 To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -113,7 +116,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -130,7 +133,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-python/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index ad7ff752..fe3c6e88 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -1,6 +1,6 @@ # AWS Lambda function handler in Ruby -The AWS Lambda function handler is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. +The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. In the following example, the file `function.rb` defines a handler method named `handler`\. The handler function takes two objects as input and returns a JSON document\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 352aea1b..2f08c9dd 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -35,7 +35,7 @@ When active tracing is enabled, Lambda records a trace for a subset of invocatio You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/Gemfile)** +**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/Gemfile)** ``` # Gemfile @@ -48,7 +48,7 @@ gem 'test-unit', '3.3.5' To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -115,7 +115,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: @@ -132,7 +132,7 @@ If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-ruby/template.yml) – Dependencies layer** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** ``` Resources: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index c03b0a65..fb8835f3 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -1,36 +1,42 @@ # Runtime support policy -[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When a component of a runtime is no longer supported for security updates, Lambda deprecates the runtime\. +[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. -Deprecation occurs in two phases\. During the first phase, you can no longer create functions that use the deprecated runtime\. For at least 30 days, you can continue to update existing functions that use the deprecated runtime\. After this period, both function creation and updates are disabled permanently\. However, the function continues to be available to process invocation events\. +Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. Note that existing functions that use the runtime are no longer eligible for technical support\. -**Note** -Python 2\.7 reached end of life on January 1, 2020\. However, the Python 2\.7 runtime is still supported and is not scheduled to be deprecated at this time\. For details, see [Continued support for Python 2\.7 on AWS Lambda](http://aws.amazon.com/blogs/compute/continued-support-for-python-2-7-on-aws-lambda/) on the AWS Compute Blog\. +In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. However, existing functions that use the runtime remain available to process invocation events\. -The following runtimes have been deprecated: +**Important** +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +The following runtimes have reached or are scheduled for end of support: -**Deprecated runtimes** -| Name | Identifier | Operating system | Deprecation completed date | -| --- | --- | --- | --- | -| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | July 30, 2019 | -| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | May 30, 2019 | -| Node\.js 0\.10 | `nodejs` | Amazon Linux | October 31, 2016 | -| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | March 6, 2020 | -| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | April 30, 2019 | -| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | August 12, 2019 | -| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | March 6, 2020 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 28, 2021 | +**Runtime end of support dates** -In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime\. In some cases, such as security issues that require a backwards\-incompatible update, or software that doesn't support a long\-term support \(LTS\) schedule, advance notice might not be possible\. +| Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | +| --- | --- | --- | --- | --- | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | May 31, 2021 | June 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 31, 2021 | June 30, 2021 | +| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | +| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | +| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | +| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | | March 6, 2020 | +| Node\.js 0\.10 | `nodejs` | Amazon Linux | | October 31, 2016 | +| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | +| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | + +In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. + +In some cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. **Language and framework support policies** + **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) + **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/technetwork/java/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) -+ **Go** – [golang\.org](https://golang.org/s/release) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) ++ **Go** – [golang\.org](https://golang.org/doc/devel/release.html) + **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) -After a runtime is deprecated, Lambda might retire it completely at any time by disabling invocation\. Deprecated runtimes aren't eligible for security updates or technical support\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled to be retired at this time\. \ No newline at end of file +After ending support for a runtime, Lambda might retire it completely at any time by disabling invocation\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled for retirement at this time\. \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index d0b9384c..cc75571a 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -47,7 +47,7 @@ The function's timeout setting limits the duration of the entire `Invoke` phase\ The invoke phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. -If there is a failure during `Invoke`, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. +If the Lambda function crashes or times out during the `Invoke` phase, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. ![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index b6f91318..38688e57 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -39,7 +39,7 @@ Standard charges apply for each service\. For more information, see [AWS Pricing The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Handler code** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** ``` // Handler @@ -66,7 +66,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI @@ -96,7 +96,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: @@ -152,7 +152,7 @@ In this example, the `Code` property specifies an object in an Amazon S3 bucket\ To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** +**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** ``` #!/bin/bash @@ -164,7 +164,7 @@ aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --ca The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. +The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. ## Instrumentation with the AWS X\-Ray @@ -176,7 +176,7 @@ The first service node \(`AWS::Lambda`\) represents the Lambda service, which va To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/function/index.js) – Instrumentation** +**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** ``` const AWSXRay = require('aws-xray-sdk-core') @@ -200,7 +200,7 @@ You can include the X\-Ray SDK and other libraries in your function's deployment You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Dependency layer** +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** ``` Resources: @@ -215,7 +215,7 @@ Resources: # Function's execution role Policies: - AWSLambdaBasicExecutionRole - - AWSLambdaReadOnlyAccess + - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess Tracing: Active Layers: @@ -232,7 +232,7 @@ Resources: The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** +**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** ``` #!/bin/bash diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index ad43ed3b..67e825cc 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -5,8 +5,8 @@ The Error Processor sample application demonstrates the use of AWS Lambda to han ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/processor/index.js) ++ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/random-error/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/processor/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. @@ -84,7 +84,7 @@ The application is implemented in two Node\.js modules and deployed with an AWS + Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. + Amazon S3 bucket – A storage location for output from the processor function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) on GitHub\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 86415c56..7225177f 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -7,8 +7,8 @@ The list manager sample application demonstrates the use of AWS Lambda to proces Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/dbadmin/index.js) ++ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/processor/index.js) ++ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/dbadmin/index.js) You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. @@ -66,7 +66,7 @@ A *ranking* contains a list of entries where the value is the order in which the A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/events/kinesis.json) – Record** +**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/events/kinesis.json) – Record** ``` { @@ -112,9 +112,9 @@ The application is implemented in Node\.js modules and deployed with an AWS Clou + Execution role – An IAM role that grants the functions permission to access other AWS services\. + Lambda event source mapping – Reads records from the data stream and invokes the function\. -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml) on GitHub\. +View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml) on GitHub\. -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. +A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. **Infrastructure resources** + VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md index eefdfd5f..ec13c87c 100644 --- a/doc_source/services-apigateway-code.md +++ b/doc_source/services-apigateway-code.md @@ -58,7 +58,7 @@ exports.handler = function(event, context, callback) { callback(null, "pong"); break; default: - callback('Unknown operation: ${operation}'); + callback(`Unknown operation: ${operation}`); } }; ``` diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 85b8b5b7..667e3e63 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -179,7 +179,7 @@ exports.handler = function(event, context, callback) { callback(null, "pong"); break; default: - callback('Unknown operation: ${operation}'); + callback(`Unknown operation: ${operation}`); } }; ``` @@ -224,7 +224,13 @@ Invoke the function manually using the sample event data\. We recommend that you ``` aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload fileb://input.txt outputfile.txt + --payload file://input.txt outputfile.txt + ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out ``` ## Create an API using Amazon API Gateway diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index d0be5212..1b99debe 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -30,7 +30,7 @@ A Lambda integration maps a path and HTTP method combination to a Lambda functio Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** +**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { @@ -75,7 +75,7 @@ API Gateway waits for a response from your function and relays the result to the The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** ``` var response = { @@ -203,7 +203,7 @@ The following example shows an X\-Ray trace map for a request that resulted in a To customize the error response, you must catch errors in your code and format a response in the required format\. -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/function/index.js) – Error formatting** +**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** ``` var formatError = function(error){ @@ -251,7 +251,7 @@ WebSocket APIs also use the API Gateway version 2 API and support a similar feat HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** +**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** ``` { diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md index 6ff099f0..5a68656f 100644 --- a/doc_source/services-cloudformation.md +++ b/doc_source/services-cloudformation.md @@ -56,7 +56,7 @@ AWS CloudFormation provides a library called `cfn-response` that handles sending The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/template.yml) – Custom resource function** +**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) – Custom resource function** ``` Transform: 'AWS::Serverless-2016-10-31' diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index 2f1a84ca..eb06bd91 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -39,4 +39,4 @@ Note the following: + If you are using the Lambda console, do not include the `cron` prefix in your expression\. + One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. -For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) in the *CloudWatch Events User Guide*\. \ No newline at end of file +For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index a3a578c3..194c346a 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -57,7 +57,7 @@ Locate the sample project in the guide repository under [sample\-apps/ec2\-spot] The `Function` class includes a `FunctionHandler` method that calls other methods to create spot requests, check their status, and clean up\. It creates an Amazon EC2 client with the AWS SDK for \.NET in a static constructor to allow it to be used throughout the class\. -**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** +**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** ``` using Amazon.EC2; @@ -86,7 +86,7 @@ using Amazon.EC2; The `RequestSpotInstance` method creates a spot instance request\. -**Example [Function\.cs – RequestSpotInstance](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/ec2-spot/src/ec2spot/Function.cs#L59)** +**Example [Function\.cs – RequestSpotInstance](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L59)** ``` using Amazon; diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 39fe6edb..35da3661 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -106,7 +106,7 @@ Resources: For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Tracing configuration** +**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** ``` Resources: diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 4d93f4fa..54e8030d 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -6,6 +6,8 @@ You can use Lambda to run your code in response to events, such as changes to da You can also build serverless applications composed of functions that are triggered by events, and automatically deploy them using AWS CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +For more information about designing, operating, and troubleshooting Lambda\-based applications, see [Introduction](https://docs.aws.amazon.com/lambda/latest/operatorguide/intro.html) in the *Lambda operator guide*\. + **Topics** + [When should I use AWS Lambda?](#when-to-use-cloud-functions) + [Are you a first\-time user of AWS Lambda?](#welcome-first-time-user) diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index b7dae428..2c2cb972 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -98,6 +98,12 @@ Invoke the function manually using the sample event data\. aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index f60ffb50..7c711bb4 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,6 +185,13 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + +``` +--cli-binary-format raw-in-base64-out +``` + The function returns the string `message` in the response body\. Verify the output in the `outputfile.txt` file\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 5b834fd6..6e39e0bb 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -123,6 +123,12 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a ``` aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` The response is saved to `out.txt`\. diff --git a/doc_source/with-s3-example-deployment-pkg.md b/doc_source/with-s3-example-deployment-pkg.md deleted file mode 100644 index 01392350..00000000 --- a/doc_source/with-s3-example-deployment-pkg.md +++ /dev/null @@ -1,353 +0,0 @@ -# Sample Amazon S3 function code - -The following sample code is available for the [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md)\. - -**Topics** -+ [Node\.js 12\.x](#with-s3-example-deployment-pkg-nodejs) -+ [Java 11](#with-s3-example-deployment-pkg-java) -+ [Python 3](#with-s3-example-deployment-pkg-python) - -## Node\.js 12\.x - -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. - -### Create the function code - -Copy the sample code into a file named `index.js` into a new folder named `lambda-s3`\. - -**Example index\.js** - -``` -// dependencies - const AWS = require('aws-sdk'); - const util = require('util'); - const sharp = require('sharp'); - - // get reference to S3 client - const s3 = new AWS.S3(); - - exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); - }; -``` -+ Review the preceding code and note the following: - + The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg, the code creates a thumbnail and saves it to the target bucket\. - + The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. - + For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ Sharp for node\.js - -**To create a deployment package** - -1. Install the Sharp library with npm\. For Linux, use the following command\. - - ``` - lambda-s3$ npm install sharp - ``` - - For macOS, use the following command\. - - ``` - lambda-s3$ npm install --arch=x64 --platform=linux --target=12.13.0 sharp - ``` - -1. After you complete this step, you should have the following folder structure: - - ``` - lambda-s3 - |- index.js - |- /node_modules/sharp - └ /node_modules/... - ``` - -1. Create a deployment package with the function code and dependencies\. - - ``` - lambda-s3$ zip -r function.zip . - ``` - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. - -## Java 11 - -The following is example Java code that reads incoming Amazon S3 events and creates a thumbnail\. Note that it implements the `RequestHandler` interface provided in the `aws-lambda-java-core` library\. Therefore, at the time you create a Lambda function you specify the class as the handler \(that is, `example.handler`\)\. For more information about using interfaces to provide a handler, see [Handler interfaces](java-handler.md#java-handler-interfaces)\. - -The `S3Event` type that the handler uses as the input type is one of the predefined classes in the `aws-lambda-java-events`  library that provides methods for you to easily read information from the incoming Amazon S3 event\. The handler returns a string as output\. - -### Create the function code - -Copy the sample code into a file named `Handler.java`\. - -**Example Handler\.java** - -``` -package example; - -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.imageio.ImageIO; - -import com.amazonaws.AmazonServiceException; -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; -import com.amazonaws.services.s3.model.GetObjectRequest; -import com.amazonaws.services.s3.model.ObjectMetadata; -import com.amazonaws.services.s3.model.S3Object; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; - -public class Handler implements - RequestHandler { - private static final float MAX_WIDTH = 100; - private static final float MAX_HEIGHT = 100; - private final String JPG_TYPE = (String) "jpg"; - private final String JPG_MIME = (String) "image/jpeg"; - private final String PNG_TYPE = (String) "png"; - private final String PNG_MIME = (String) "image/png"; - - public String handleRequest(S3Event s3event, Context context) { - try { - S3EventNotificationRecord record = s3event.getRecords().get(0); - - String srcBucket = record.getS3().getBucket().getName(); - - // Object key may have spaces or unicode non-ASCII characters. - String srcKey = record.getS3().getObject().getUrlDecodedKey(); - - String dstBucket = srcBucket + "-resized"; - String dstKey = "resized-" + srcKey; - - // Sanity check: validate that source and destination are different - // buckets. - if (srcBucket.equals(dstBucket)) { - System.out - .println("Destination bucket must not match source bucket."); - return ""; - } - - // Infer the image type. - Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); - if (!matcher.matches()) { - System.out.println("Unable to infer image type for key " - + srcKey); - return ""; - } - String imageType = matcher.group(1); - if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { - System.out.println("Skipping non-image " + srcKey); - return ""; - } - - // Download the image from S3 into a stream - AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); - S3Object s3Object = s3Client.getObject(new GetObjectRequest( - srcBucket, srcKey)); - InputStream objectData = s3Object.getObjectContent(); - - // Read the source image - BufferedImage srcImage = ImageIO.read(objectData); - int srcHeight = srcImage.getHeight(); - int srcWidth = srcImage.getWidth(); - // Infer the scaling factor to avoid stretching the image - // unnaturally - float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT - / srcHeight); - int width = (int) (scalingFactor * srcWidth); - int height = (int) (scalingFactor * srcHeight); - - BufferedImage resizedImage = new BufferedImage(width, height, - BufferedImage.TYPE_INT_RGB); - Graphics2D g = resizedImage.createGraphics(); - // Fill with white before applying semi-transparent (alpha) images - g.setPaint(Color.white); - g.fillRect(0, 0, width, height); - // Simple bilinear resize - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - g.drawImage(srcImage, 0, 0, width, height, null); - g.dispose(); - - // Re-encode image to target format - ByteArrayOutputStream os = new ByteArrayOutputStream(); - ImageIO.write(resizedImage, imageType, os); - InputStream is = new ByteArrayInputStream(os.toByteArray()); - // Set Content-Length and Content-Type - ObjectMetadata meta = new ObjectMetadata(); - meta.setContentLength(os.size()); - if (JPG_TYPE.equals(imageType)) { - meta.setContentType(JPG_MIME); - } - if (PNG_TYPE.equals(imageType)) { - meta.setContentType(PNG_MIME); - } - - // Uploading to S3 destination bucket - System.out.println("Writing to: " + dstBucket + "/" + dstKey); - try { - s3Client.putObject(dstBucket, dstKey, is, meta); - } - catch(AmazonServiceException e) - { - System.err.println(e.getErrorMessage()); - System.exit(1); - } - System.out.println("Successfully resized " + srcBucket + "/" - + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); - return "Ok"; - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} -``` - -Amazon S3 invokes your Lambda function using the `Event` invocation type, where AWS Lambda runs the code asynchronously\. What you return does not matter\. However, in this case we are implementing an interface that requires us to specify a return type, so in this example the handler uses `String` as the return type\. - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` -+ `aws-java-sdk` - -**To create a deployment package** -+ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. - -## Python 3 - -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. - -### Create the function code - -Copy the sample code into a file named `lambda_function.py`\. - -**Example lambda\_function\.py** - -``` -import boto3 -import os -import sys -import uuid -from urllib.parse import unquote_plus -from PIL import Image -import PIL.Image - -s3_client = boto3.client('s3') - -def resize_image(image_path, resized_path): - with Image.open(image_path) as image: - image.thumbnail(tuple(x / 2 for x in image.size)) - image.save(resized_path) - -def lambda_handler(event, context): - for record in event['Records']: - bucket = record['s3']['bucket']['name'] - key = unquote_plus(record['s3']['object']['key']) - tmpkey = key.replace('/', '') - download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) - upload_path = '/tmp/resized-{}'.format(tmpkey) - s3_client.download_file(bucket, key, download_path) - resize_image(download_path, upload_path) - s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) -``` - -### Create the deployment package - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ [Pillow](https://pypi.org/project/Pillow/) - -**To create a deployment package** -+ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. - -**To create and test the function** -+ After you have created a deployment package with your function code and your Lambda function, return to the S3 tutorial to [Create the Lambda function](with-s3-example.md)\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index f6e46ff1..89663759 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -1,403 +1,251 @@ -# Tutorial: Using AWS Lambda with Amazon S3 +# Tutorial: Using an Amazon S3 trigger to invoke a Lambda function -Suppose you want to create a thumbnail for each image file that is uploaded to a bucket\. You can create a Lambda function \(`CreateThumbnail`\) that Amazon S3 can invoke when objects are created\. Then, the Lambda function can read the image object from the source bucket and create a thumbnail image to save in the target bucket\. +In this tutorial, you use the console to create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. The trigger invokes your function every time that you add an object to your Amazon S3 bucket\. -Upon completing this tutorial, you will have the following Amazon S3, Lambda, and IAM resources in your account: +We recommend that you complete this console\-based tutorial before you try the [tutorial to create thumbnail images](with-s3-tutorial.md)\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/s3-admin-iser-walkthrough-10.png) +## Prerequisites -**Lambda resources** -+ A Lambda function\. -+ An access policy associated with your Lambda function that grants Amazon S3 permission to invoke the Lambda function\. +To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) -**IAM resources** -+ An execution role that grants permissions that your Lambda function needs through the permissions policy associated with this role\. - -**Amazon S3 resources** -+ A source bucket with a notification configuration that invokes the Lambda function\. -+ A target bucket where the function saves resized images\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. -## Prerequisites +## Create a bucket and upload a sample object -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +Create an Amazon S3 bucket and upload a test file to your new bucket\. Your Lambda function retrieves information about this file when you test the function from the console\. -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: +**To create an Amazon S3 bucket using the console** -``` -this is a command -``` +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. -You should see the following output: +1. Choose **Create bucket**\. -``` -this is output -``` +1. Under **General configuration**, do the following: -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + 1. For **Bucket name**, enter a unique name\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + 1. For **AWS Region**, choose a Region\. Note that you must create your Lambda function in the same Region\. -Install npm to manage the function's dependencies\. +1. Choose **Create bucket**\. -The tutorial uses AWS CLI commands to create and invoke the Lambda function\. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +After creating the bucket, Amazon S3 opens the **Buckets** page, which displays a list of all buckets in your account in the current Region\. -## Create buckets and upload a sample object +**To upload a test object using the Amazon S3 console** -Follow the steps to create buckets and upload an object\. +1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the bucket that you created\. -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. +1. On the **Objects** tab, choose **Upload**\. -1. Create two buckets\. The target bucket name must be *source* followed by **\-resized**, where *source* is the name of the bucket you want to use for the source\. For example, `mybucket` and `mybucket-resized`\. +1. Drag a test file from your local machine to the **Upload **page\. -1. In the source bucket, upload a \.jpg object, `HappyFace.jpg`\. +1. Choose **Upload**\. - When you invoke the Lambda function manually before you connect to Amazon S3, you pass sample event data to the function that specifies the source bucket and `HappyFace.jpg` as the newly created object so you need to create this sample object first\. +## Create the Lambda function -## Create the IAM Policy +Use a [function blueprint](gettingstarted-features.md#gettingstarted-features-blueprints) to create the Lambda function\. A blueprint provides a sample function that demonstrates how to use Lambda with other AWS services\. Also, a blueprint includes sample code and function configuration presets for a certain runtime\. For this tutorial, you can choose the blueprint for the Node\.js or Python runtime\. -Create an IAM policy that defines the permissions for the Lambda function\. The required permissions include: -+ Get the object from the source S3 bucket\. -+ Put the resized object into the target S3 bucket\. -+ Permissions related to the CloudWatch Logs\. +**To create a Lambda function from a blueprint in the console** -**To create an IAM Policy** +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM Console\. +1. Choose **Create function**\. -1. Choose **Create policy** +1. On the **Create function** page, choose **Use a blueprint**\. -1. Under the **JSON** tab, copy the following policy\. Make sure the source and target bucket names match the bucket names that you created previously\. +1. Under **Blueprints**, enter **s3** in the search box\. - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "logs:PutLogEvents", - "logs:CreateLogGroup", - "logs:CreateLogStream" - ], - "Resource": "arn:aws:logs:*:*:*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::mybucket/*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject" - ], - "Resource": "arn:aws:s3:::mybucket-resized/*" - } - ] - } - ``` +1. In the search results, do one of the following: + + For a Node\.js function, choose **s3\-get\-object**\. + + For a Python function, choose **s3\-get\-object\-python**\. -1. Choose **Review policy**, specify the policy name as `AWSLambdaS3Policy`, and create the policy\. +1. Choose **Configure**\. -## Create the execution role +1. Under **Basic information**, do the following: -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. + 1. For **Function name**, enter **my\-s3\-function**\. -**To create an execution role** + 1. For **Execution role**, choose **Create a new role from AWS policy templates**\. -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. + 1. For **Role name**, enter **my\-s3\-function\-role**\. -1. Choose **Create role**\. +1. Under **S3 trigger**, choose the S3 bucket that you created previously\. -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaS3Policy**\. - + **Role name** – **lambda\-s3\-role**\. + When you configure an S3 trigger using the Lambda console, the console modifies your function's [resource\-based policy](access-control-resource-based.md) to allow Amazon S3 to invoke the function\. -The **AWSLambdaS3Policy** policy has the permissions that the function needs to manage objects in Amazon S3 and write logs to CloudWatch Logs\. +1. Choose **Create function**\. -## Create the function +## Review the function code -The following example code receives an Amazon S3 event input and processes the message that it contains\. It resizes an image in the source bucket and saves the output to the target bucket\. +The Lambda function retrieves the source S3 bucket name and the key name of the uploaded object from the event parameter that it receives\. The function uses the Amazon S3 `getObject` API to retrieve the content type of the object\. -**Note** -For sample code in other languages, see [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md)\. +While viewing your function in the [Lambda console](https://console.aws.amazon.com/lambda), you can review the function code on the **Code** tab, under **Code source**\. The code looks like the following: -### Create the function code +------ +#### [ Node\.js ] **Example index\.js** ``` -// dependencies -const AWS = require('aws-sdk'); -const util = require('util'); -const sharp = require('sharp'); - -// get reference to S3 client -const s3 = new AWS.S3(); - -exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } +console.log('Loading function'); + +const aws = require('aws-sdk'); - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } +const s3 = new aws.S3({ apiVersion: '2006-03-01' }); - // Download the image from the S3 source bucket. +exports.handler = async (event, context) => { + //console.log('Received event:', JSON.stringify(event, null, 2)); + // Get the object from the event and show its content type + const bucket = event.Records[0].s3.bucket.name; + const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' ')); + const params = { + Bucket: bucket, + Key: key, + }; try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the Sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); + const { ContentType } = await s3.getObject(params).promise(); + console.log('CONTENT TYPE:', ContentType); + return ContentType; + } catch (err) { + console.log(err); + const message = `Error getting object ${key} from bucket ${bucket}. Make sure they exist and your bucket is in the same region as this function.`; + console.log(message); + throw new Error(message); + } }; ``` -Review the preceding code and note the following: -+ The function knows the source bucket name and the key name of the object from the event data it receives as parameters\. If the object is a \.jpg or a \.png, the code creates a thumbnail and saves it to the target bucket\. -+ The code assumes that the destination bucket exists and its name is a concatenation of the source bucket name followed by the string `-resized`\. For example, if the source bucket identified in the event data is `examplebucket`, the code assumes you have an `examplebucket-resized` destination bucket\. -+ For the thumbnail it creates, the code derives its key name as the concatenation of the string `resized-` followed by the source object key name\. For example, if the source object key is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. - -### Create the deployment package - -The deployment package is a \.zip file containing your Lambda function code and dependencies\. - -**To create a deployment package** - -1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. - -1. Save the function code as `index.js` in a folder named `lambda-s3`\. - -1. Install the Sharp library with npm\. For Linux, use the following command\. - - ``` - npm install sharp - ``` - - For macOS, use the following command\. - - ``` - npm install --arch=x64 --platform=linux --target=12.13.0 sharp - ``` - - After you complete this step, you will have the following folder structure: - - ``` - lambda-s3 - |- index.js - |- /node_modules/sharp - └ /node_modules/... - ``` - -1. Create a deployment package with the function code and dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. - - ``` - zip -r function.zip . - ``` - -### Create the Lambda function - -**To create the function** -+ Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name CreateThumbnail \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-s3-role - ``` -**Note** -If you are using AWS CLI version 2, add the following command parameters: - - ``` - --cli-binary-format raw-in-base64-out - ``` - - The Lambda function in the last step uses a Node\.js function handler of `index.handler`\. This name reflects the function name as `handler`, and the file where the handler code is stored in `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. It also specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. +------ +#### [ Python ] -For the role parameter, replace the number sequence with your AWS account ID\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects you upload, you might need to increase the timeout value using the following AWS CLI command\. +**Example lambda\-function\.py** ``` -aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 -``` - -## Test the Lambda function - -In this step, you invoke the Lambda function manually using sample Amazon S3 event data\. +import json +import urllib.parse +import boto3 -**To test the Lambda function** +print('Loading function') -1. Save the following Amazon S3 sample event data in a file and save it as `inputFile.txt`\. You need to update the JSON by providing your *sourcebucket* name and a \.jpg object key\. +s3 = boto3.client('s3') - ``` - { - "Records":[ - { - "eventVersion":"2.0", - "eventSource":"aws:s3", - "awsRegion":"us-west-2", - "eventTime":"1970-01-01T00:00:00.000Z", - "eventName":"ObjectCreated:Put", - "userIdentity":{ - "principalId":"AIDAJDPLRKLG7UEXAMPLE" - }, - "requestParameters":{ - "sourceIPAddress":"127.0.0.1" - }, - "responseElements":{ - "x-amz-request-id":"C3D13FE58DE4C810", - "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" - }, - "s3":{ - "s3SchemaVersion":"1.0", - "configurationId":"testConfigRule", - "bucket":{ - "name":"sourcebucket", - "ownerIdentity":{ - "principalId":"A3NL1KOZZKExample" - }, - "arn":"arn:aws:s3:::sourcebucket" - }, - "object":{ - "key":"HappyFace.jpg", - "size":1024, - "eTag":"d41d8cd98f00b204e9800998ecf8427e", - "versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko" - } - } - } - ] - } - ``` -1. Run the following Lambda CLI `invoke` command to invoke the function\. Note that the command requests asynchronous execution\. You can optionally invoke it synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. +def lambda_handler(event, context): + #print("Received event: " + json.dumps(event, indent=2)) - ``` - aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt - ``` -**Note** -If you are using AWS CLI version 2, add the following command parameters: - - ``` - --cli-binary-format raw-in-base64-out - ``` - -1. Verify that the thumbnail was created in the target bucket\. - -## Configure Amazon S3 to publish events - -In this step, you add the remaining configuration so that Amazon S3 can publish object\-created events to AWS Lambda and invoke your Lambda function\. You do the following in this step: -+ Add permissions to the Lambda function access policy to allow Amazon S3 to invoke the function\. -+ Add notification configuration to your source bucket\. In the notification configuration, you provide the following: - + Event type for which you want Amazon S3 to publish events\. For this tutorial, you specify the `s3:ObjectCreated:*` event type so that Amazon S3 publishes events when objects are created\. - + Lambda function to invoke\. - -**To add permissions to the function policy** - -1. Run the following Lambda CLI `add-permission` command to grant Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Note that permission is granted to Amazon S3 to invoke the function only if the following conditions are met: - + An object\-created event is detected on a specific bucket\. - + The bucket is owned by your account\. If you delete a bucket, it is possible for another account to create a bucket with the same ARN\. - - ``` - aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ - --statement-id s3invoke --action "lambda:InvokeFunction" \ - --source-arn arn:aws:s3:::sourcebucket \ - --source-account account-id - ``` + # Get the object from the event and show its content type + bucket = event['Records'][0]['s3']['bucket']['name'] + key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8') + try: + response = s3.get_object(Bucket=bucket, Key=key) + print("CONTENT TYPE: " + response['ContentType']) + return response['ContentType'] + except Exception as e: + print(e) + print('Error getting object {} from bucket {}. Make sure they exist and your bucket is in the same region as this function.'.format(key, bucket)) + raise e +``` -1. Verify the function's access policy by running the AWS CLI `get-policy` command\. +------ + +## Test in the console + +Invoke the Lambda function manually using sample Amazon S3 event data\. + +**To test the Lambda function using the console** + +1. On the **Code** tab, under **Code source**, choose the arrow next to **Test**, and then choose **Configure test events** from the dropdown list\. + +1. In the **Configure test event** window, do the following: + + 1. Choose **Create new test event**\. + + 1. For **Event template**, choose **Amazon S3 Put** \(**s3\-put**\)\. + + 1. For **Event name**, enter a name for the test event\. For example, **mys3testevent**\. + + 1. In the test event JSON, replace the S3 bucket name \(`example-bucket`\) and object key \(`test/key`\) with your bucket name and test file name\. Your test event should look similar to the following: + + ``` + { + { + "Records": [ + { + "eventVersion": "2.0", + "eventSource": "aws:s3", + "awsRegion": "us-west-2", + "eventTime": "1970-01-01T00:00:00.000Z", + "eventName": "ObjectCreated:Put", + "userIdentity": { + "principalId": "EXAMPLE" + }, + "requestParameters": { + "sourceIPAddress": "127.0.0.1" + }, + "responseElements": { + "x-amz-request-id": "EXAMPLE123456789", + "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" + }, + "s3": { + "s3SchemaVersion": "1.0", + "configurationId": "testConfigRule", + "bucket": { + "name": "my-s3-bucket", + "ownerIdentity": { + "principalId": "EXAMPLE" + }, + "arn": "arn:aws:s3:::example-bucket" + }, + "object": { + "key": "HappyFace.jpg", + "size": 1024, + "eTag": "0123456789abcdef0123456789abcdef", + "sequencer": "0A1B2C3D4E5F678901" + } + } + } + ] + } + ``` + + 1. Choose **Create**\. + +1. To invoke the function with your test event, under **Code source**, choose **Test**\. + + The **Execution results** tab displays the response, function logs, and request ID, similar to the following: ``` - aws lambda get-policy --function-name CreateThumbnail + Response + "image/jpeg" + + Function Logs + START RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Version: $LATEST + 2021-02-18T21:40:59.280Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO INPUT BUCKET AND KEY: { Bucket: 'my-s3-bucket', Key: 'HappyFace.jpg' } + 2021-02-18T21:41:00.215Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO CONTENT TYPE: image/jpeg + END RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 + REPORT RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Duration: 976.25 ms Billed Duration: 977 ms Memory Size: 128 MB Max Memory Used: 90 MB Init Duration: 430.47 ms + + Request ID + 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 ``` -Add notification configuration on the source bucket to request Amazon S3 to publish object\-created events to Lambda\. - -**Important** -This procedure configures the bucket to invoke your function every time an object is created in it\. Ensure that you configure this option only on the source bucket and do not create objects in the source bucket from the function that is triggered\. Otherwise, your function could cause itself to be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. - -**To configure notifications** - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Choose the source bucket\. +## Test with the S3 trigger -1. Choose **Properties**\. +Invoke your function when you upload a file to the Amazon S3 source bucket\. -1. Under **Events**, configure a notification with the following settings\. - + **Name** – **lambda\-trigger**\. - + **Events** – **All object create events**\. - + **Send to** – **Lambda function**\. - + **Lambda** – **CreateThumbnail**\. +**To test the Lambda function using the S3 trigger** -For more information on event configuration, see [Enabling event notifications](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. +1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the source bucket that you created earlier\. -## Test the setup +1. On the **Upload** page, upload a few \.jpg or \.png image files to the bucket\. -Now you can test the setup as follows: +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Upload \.jpg or \.png objects to the source bucket using the Amazon S3 console\. +1. Choose the name of your function \(**my\-s3\-function**\)\. -1. Verify that the thumbnail was created in the target bucket using the `CreateThumbnail` function\. +1. Choose the **Monitor** tab, then verify that the function ran once for each file that you uploaded\. -1. View logs in the CloudWatch console\. +1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. ## Clean up your resources @@ -413,13 +261,13 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. -**To delete the policy that you created** +**To delete the IAM policy** -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the AWS Identity and Access Management \(IAM\) console\. -1. Select the policy that you created\. +1. Select the policy that Lambda created for you\. The policy name begins with **AWSLambdaS3ExecutionRole\-**\. -1. From **Policy actions**, choose **Delete**\. +1. Choose **Policy actions**, **Delete**\. 1. Choose **Delete**\. @@ -433,14 +281,18 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Yes, delete**\. -**To delete the S3 buckets** +**To delete the S3 bucket** 1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) -1. Select the source bucket you created\. +1. Select the bucket you created\. 1. Choose **Delete**\. -1. Enter the name of the source bucket in the text box\. +1. Enter the name of the bucket in the text box\. + +1. Choose **Confirm**\. + +## Next steps -1. Choose **Confirm**\. \ No newline at end of file +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md new file mode 100644 index 00000000..c1ca9ecc --- /dev/null +++ b/doc_source/with-s3-tutorial.md @@ -0,0 +1,712 @@ +# Tutorial: Using an Amazon S3 trigger to create thumbnail images + +In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. + +**Note** +This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. + + In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: + +**Lambda resources** ++ A Lambda function\. You can choose Node\.js, Python, or Java for the function code\. ++ A \.zip file archive deployment package for the function\. ++ An access policy that grants Amazon S3 permission to invoke the function\. + +**AWS Identity and Access Management \(IAM\) resources** ++ An execution role with an associated permissions policy to grant permissions that your function needs\. + +**Amazon S3 resources** ++ A source S3 bucket with a notification configuration that invokes the function\. ++ A target S3 bucket where the function saves the resized images\. + +**Topics** ++ [Prerequisites](#with-s3-tutorial-prepare) ++ [Step 1\. Create S3 buckets and upload a sample object](#with-s3-tutorial-prepare-create-buckets) ++ [Step 2\. Create the IAM policy](#with-s3-tutorial-create-policy) ++ [Step 3\. Create the execution role](#with-s3-tutorial-create-execution-role) ++ [Step 4\. Create the function code](#with-s3-tutorial-create-function-code) ++ [Step 5\. Create the deployment package](#with-s3-tutorial-create-function-package) ++ [Step 6\. Create the Lambda function](#with-s3-tutorial-create-function-createfunction) ++ [Step 7\. Test the Lambda function](#s3-tutorial-events-adminuser-create-test-function-upload-zip-test-manual-invoke) ++ [Step 8\. Configure Amazon S3 to publish events](#with-s3-tutorial-configure-event-source) ++ [Step 9\. Test using the S3 trigger](#with-s3-tutorial-configure-event-source-test-end-to-end) ++ [Step 10\. Clean up your resources](#s3-tutorial-cleanup) + +## Prerequisites ++ AWS account + + To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) ++ Command line + + To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + + ``` + this is a command + ``` + + You should see the following output: + + ``` + this is output + ``` + + For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + + On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. ++ AWS CLI + + In this tutorial, you use AWS CLI commands to create and invoke the Lambda function\. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. ++ Language tools + + Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](gettingstarted-tools.md#lambda-app-author)\. + +## Step 1\. Create S3 buckets and upload a sample object + +Follow these steps to create S3 buckets and upload an object\. + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. [Create two S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)\. The target bucket must be named ***source*\-resized**, where *source* is the name of the source bucket\. For example, a source bucket named `mybucket` and a target bucket named `mybucket-resized`\. + +1. In the source bucket, [upload](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) a \.jpg object, for example, `HappyFace.jpg`\. + + You must create this sample object before you test your Lambda function\. When you test the function manually using the Lambda invoke command, you pass sample event data to the function that specifies the source bucket name and `HappyFace.jpg` as the newly created object\. + +## Step 2\. Create the IAM policy + +Create an IAM policy that defines the permissions for the Lambda function\. The function must have permissions to: ++ Get the object from the source S3 bucket\. ++ Put the resized object into the target S3 bucket\. ++ Write logs to Amazon CloudWatch Logs\. + +**To create an IAM policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. + +1. Choose **Create policy**\. + +1. Choose the **JSON** tab, and then paste the following policy\. Be sure to replace *mybucket* with the name of the source bucket that you created previously\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "logs:PutLogEvents", + "logs:CreateLogGroup", + "logs:CreateLogStream" + ], + "Resource": "arn:aws:logs:*:*:*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:GetObject" + ], + "Resource": "arn:aws:s3:::mybucket/*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject" + ], + "Resource": "arn:aws:s3:::mybucket-resized/*" + } + ] + } + ``` + +1. Choose **Next: Tags**\. + +1. Choose **Next: Review**\. + +1. Under **Review policy**, for **Name**, enter **AWSLambdaS3Policy**\. + +1. Choose **Create policy**\. + +## Step 3\. Create the execution role + +Create the [execution role](lambda-intro-execution-role.md) that gives your Lambda function permission to access AWS resources\. + +**To create an execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. + +1. Choose **Create role**\. + +1. Create a role with the following properties: + + **Trusted entity** – **Lambda** + + **Permissions policy** – **AWSLambdaS3Policy** + + **Role name** – **lambda\-s3\-role** + +## Step 4\. Create the function code + +In the following code examples, the Amazon S3 event contains the source S3 bucket name and the object key name\. If the object is a \.jpg or a \.png image file, it reads the image from the source bucket, generates a thumbnail image, and then saves the thumbnail to the target S3 bucket\. + +Note the following: ++ The code assumes that the target bucket exists and that its name is a concatenation of the source bucket name and `-resized`\. ++ For each thumbnail file created, the Lambda function code derives the object key name as a concatenation of `resized-` and the source object key name\. For example, if the source object key name is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. + +------ +#### [ Node\.js ] + +Copy the following code example into a file named `index.js`\. + +**Example index\.js** + +``` +// dependencies +const AWS = require('aws-sdk'); +const util = require('util'); +const sharp = require('sharp'); + +// get reference to S3 client +const s3 = new AWS.S3(); + +exports.handler = async (event, context, callback) => { + + // Read options from the event parameter. + console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); + const srcBucket = event.Records[0].s3.bucket.name; + // Object key may have spaces or unicode non-ASCII characters. + const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); + const dstBucket = srcBucket + "-resized"; + const dstKey = "resized-" + srcKey; + + // Infer the image type from the file suffix. + const typeMatch = srcKey.match(/\.([^.]*)$/); + if (!typeMatch) { + console.log("Could not determine the image type."); + return; + } + + // Check that the image type is supported + const imageType = typeMatch[1].toLowerCase(); + if (imageType != "jpg" && imageType != "png") { + console.log(`Unsupported image type: ${imageType}`); + return; + } + + // Download the image from the S3 source bucket. + + try { + const params = { + Bucket: srcBucket, + Key: srcKey + }; + var origimage = await s3.getObject(params).promise(); + + } catch (error) { + console.log(error); + return; + } + + // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. + const width = 200; + + // Use the sharp module to resize the image and save in a buffer. + try { + var buffer = await sharp(origimage.Body).resize(width).toBuffer(); + + } catch (error) { + console.log(error); + return; + } + + // Upload the thumbnail image to the destination bucket + try { + const destparams = { + Bucket: dstBucket, + Key: dstKey, + Body: buffer, + ContentType: "image" + }; + + const putResult = await s3.putObject(destparams).promise(); + + } catch (error) { + console.log(error); + return; + } + + console.log('Successfully resized ' + srcBucket + '/' + srcKey + + ' and uploaded to ' + dstBucket + '/' + dstKey); +}; +``` + +------ +#### [ Python ] + +Copy the following code example into a file named `lambda_function.py`\. + +**Example lambda\_function\.py** + +``` +import boto3 +import os +import sys +import uuid +from urllib.parse import unquote_plus +from PIL import Image +import PIL.Image + +s3_client = boto3.client('s3') + +def resize_image(image_path, resized_path): + with Image.open(image_path) as image: + image.thumbnail(tuple(x / 2 for x in image.size)) + image.save(resized_path) + +def lambda_handler(event, context): + for record in event['Records']: + bucket = record['s3']['bucket']['name'] + key = unquote_plus(record['s3']['object']['key']) + tmpkey = key.replace('/', '') + download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) + upload_path = '/tmp/resized-{}'.format(tmpkey) + s3_client.download_file(bucket, key, download_path) + resize_image(download_path, upload_path) + s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) +``` + +------ +#### [ Java ] + +The Java code implements the `RequestHandler` interface provided in the `aws-lambda-java-core` library\. When you create a Lambda function, you specify the class as the handler \(in this code example, `example.handler`\)\. For more information about using interfaces to provide a handler, see [Handler interfaces](java-handler.md#java-handler-interfaces)\. + +The handler uses `S3Event` as the input type, which provides convenient methods for your function code to read information from the incoming Amazon S3 event\. Amazon S3 invokes your Lambda function asynchronously\. Because you are implementing an interface that requires you to specify a return type, the handler uses `String` as the return type\. + +Copy the following code example into a file named `Handler.java`\. + +**Example Handler\.java** + +``` +package example; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.imageio.ImageIO; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.S3Event; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; +import com.amazonaws.services.s3.model.GetObjectRequest; +import com.amazonaws.services.s3.model.ObjectMetadata; +import com.amazonaws.services.s3.model.S3Object; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; + +public class Handler implements + RequestHandler { + private static final float MAX_WIDTH = 100; + private static final float MAX_HEIGHT = 100; + private final String JPG_TYPE = (String) "jpg"; + private final String JPG_MIME = (String) "image/jpeg"; + private final String PNG_TYPE = (String) "png"; + private final String PNG_MIME = (String) "image/png"; + + public String handleRequest(S3Event s3event, Context context) { + try { + S3EventNotificationRecord record = s3event.getRecords().get(0); + + String srcBucket = record.getS3().getBucket().getName(); + + // Object key may have spaces or unicode non-ASCII characters. + String srcKey = record.getS3().getObject().getUrlDecodedKey(); + + String dstBucket = srcBucket + "-resized"; + String dstKey = "resized-" + srcKey; + + // Sanity check: validate that source and destination are different + // buckets. + if (srcBucket.equals(dstBucket)) { + System.out + .println("Destination bucket must not match source bucket."); + return ""; + } + + // Infer the image type. + Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); + if (!matcher.matches()) { + System.out.println("Unable to infer image type for key " + + srcKey); + return ""; + } + String imageType = matcher.group(1); + if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { + System.out.println("Skipping non-image " + srcKey); + return ""; + } + + // Download the image from S3 into a stream + AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); + S3Object s3Object = s3Client.getObject(new GetObjectRequest( + srcBucket, srcKey)); + InputStream objectData = s3Object.getObjectContent(); + + // Read the source image + BufferedImage srcImage = ImageIO.read(objectData); + int srcHeight = srcImage.getHeight(); + int srcWidth = srcImage.getWidth(); + // Infer the scaling factor to avoid stretching the image + // unnaturally + float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT + / srcHeight); + int width = (int) (scalingFactor * srcWidth); + int height = (int) (scalingFactor * srcHeight); + + BufferedImage resizedImage = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + Graphics2D g = resizedImage.createGraphics(); + // Fill with white before applying semi-transparent (alpha) images + g.setPaint(Color.white); + g.fillRect(0, 0, width, height); + // Simple bilinear resize + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BILINEAR); + g.drawImage(srcImage, 0, 0, width, height, null); + g.dispose(); + + // Re-encode image to target format + ByteArrayOutputStream os = new ByteArrayOutputStream(); + ImageIO.write(resizedImage, imageType, os); + InputStream is = new ByteArrayInputStream(os.toByteArray()); + // Set Content-Length and Content-Type + ObjectMetadata meta = new ObjectMetadata(); + meta.setContentLength(os.size()); + if (JPG_TYPE.equals(imageType)) { + meta.setContentType(JPG_MIME); + } + if (PNG_TYPE.equals(imageType)) { + meta.setContentType(PNG_MIME); + } + + // Uploading to S3 destination bucket + System.out.println("Writing to: " + dstBucket + "/" + dstKey); + try { + s3Client.putObject(dstBucket, dstKey, is, meta); + } + catch(AmazonServiceException e) + { + System.err.println(e.getErrorMessage()); + System.exit(1); + } + System.out.println("Successfully resized " + srcBucket + "/" + + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); + return "Ok"; + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} +``` + +------ + +## Step 5\. Create the deployment package + +The deployment package is a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip) containing your Lambda function code and its dependencies\. + +------ +#### [ Node\.js ] + +The sample function must include the sharp module in the deployment package\. + +**To create a deployment package** + +1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. + +1. Save the function code as `index.js` in a directory named `lambda-s3`\. + +1. Install the sharp library with npm\. For Linux, use the following command: + + ``` + npm install sharp + ``` + + After this step, you have the following directory structure: + + ``` + lambda-s3 + |- index.js + |- /node_modules/sharp + └ /node_modules/... + ``` + +1. Create a deployment package with the function code and its dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. + + ``` + zip -r function.zip . + ``` + +------ +#### [ Python ] + +**Dependencies** ++ [Pillow](https://pypi.org/project/Pillow/) + +**To create a deployment package** ++ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. + +------ +#### [ Java ] + +**Dependencies** ++ `aws-lambda-java-core` ++ `aws-lambda-java-events` ++ `aws-java-sdk` + +**To create a deployment package** ++ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. + +------ + +## Step 6\. Create the Lambda function + +**To create the function** ++ Create a Lambda function with the create\-function command\. + +------ +#### [ Node\.js ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ +#### [ Python ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler lambda_function.lambda_handler --runtime python3.8 \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ +#### [ Java ] + + ``` + aws lambda create-function --function-name CreateThumbnail \ + --zip-file fileb://function.zip --handler example.handler --runtime java11 \ + --timeout 10 --memory-size 1024 \ + --role arn:aws:iam::123456789012:role/lambda-s3-role + ``` + +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + + The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +------ + +For the role parameter, replace *123456789012* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html)\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects that you upload, you might need to increase the timeout value using the following AWS CLI command: + +``` +aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 +``` + +## Step 7\. Test the Lambda function + +Invoke the Lambda function manually using sample Amazon S3 event data\. + +**To test the Lambda function** + +1. Save the following Amazon S3 sample event data in a file named `inputFile.txt`\. Be sure to replace *sourcebucket* and *HappyFace\.jpg* with your source S3 bucket name and a \.jpg object key, respectively\. + + ``` + { + "Records":[ + { + "eventVersion":"2.0", + "eventSource":"aws:s3", + "awsRegion":"us-west-2", + "eventTime":"1970-01-01T00:00:00.000Z", + "eventName":"ObjectCreated:Put", + "userIdentity":{ + "principalId":"AIDAJDPLRKLG7UEXAMPLE" + }, + "requestParameters":{ + "sourceIPAddress":"127.0.0.1" + }, + "responseElements":{ + "x-amz-request-id":"C3D13FE58DE4C810", + "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" + }, + "s3":{ + "s3SchemaVersion":"1.0", + "configurationId":"testConfigRule", + "bucket":{ + "name":"sourcebucket", + "ownerIdentity":{ + "principalId":"A3NL1KOZZKExample" + }, + "arn":"arn:aws:s3:::sourcebucket" + }, + "object":{ + "key":"HappyFace.jpg", + "size":1024, + "eTag":"d41d8cd98f00b204e9800998ecf8427e", + "versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko" + } + } + } + ] + } + ``` + +1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. + + ``` + aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ + --payload file://inputFile.txt outputfile.txt + ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` + +1. Verify that the thumbnail is created in the target S3 bucket\. + +## Step 8\. Configure Amazon S3 to publish events + +Complete the configuration so that Amazon S3 can publish object\-created events to Lambda and invoke your Lambda function\. In this step, you do the following: ++ Add permissions to the function access policy to allow Amazon S3 to invoke the function\. ++ Add a notification configuration to your source S3 bucket\. In the notification configuration, you provide the following: + + The event type for which you want Amazon S3 to publish events\. For this tutorial, specify the `s3:ObjectCreated:*` event type so that Amazon S3 publishes events when objects are created\. + + The function to invoke\. + +**To add permissions to the function policy** + +1. Run the following add\-permission command to grant Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Note that Amazon S3 is granted permission to invoke the function only if the following conditions are met: + + An object\-created event is detected on a specific S3 bucket\. + + The S3 bucket is owned by your AWS account\. If you delete a bucket, it is possible for another AWS account to create a bucket with the same Amazon Resource Name \(ARN\)\. + + ``` + aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ + --statement-id s3invoke --action "lambda:InvokeFunction" \ + --source-arn arn:aws:s3:::sourcebucket \ + --source-account account-id + ``` + +1. Verify the function's access policy by running the get\-policy command\. + + ``` + aws lambda get-policy --function-name CreateThumbnail + ``` + +To have Amazon S3 publish object\-created events to Lambda, add a notification configuration on the source S3 bucket\. + +**Important** +This procedure configures the S3 bucket to invoke your function every time that an object is created in the bucket\. Be sure to configure this option only on the source bucket\. Do not have your function create objects in the source bucket, or your function could cause itself to be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. + +**To configure notifications** + +1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Choose the name of the source S3 bucket\. + +1. Choose the **Properties** tab\. + +1. Under **Event notifications**, choose **Create event notification** to configure a notification with the following settings: + + **Event name** – **lambda\-trigger** + + **Event types** – **All object create events** + + **Destination** – **Lambda function** + + **Lambda function** – **CreateThumbnail** + +For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. + +## Step 9\. Test using the S3 trigger + +Test the setup as follows: + +1. Upload \.jpg or \.png objects to the source S3 bucket using the [Amazon S3 console](https://console.aws.amazon.com/s3)\. + +1. Verify for each image object that a thumbnail is created in the target S3 bucket using the `CreateThumbnail` Lambda function\. + +1. View logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Step 10\. Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the policy that you created** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. Select the policy that you created \(**AWSLambdaS3Policy**\)\. + +1. Choose **Policy actions**, **Delete**\. + +1. Choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the S3 bucket** + +1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) + +1. Select the bucket you created\. + +1. Choose **Delete**\. + +1. Enter the name of the bucket in the text box\. + +1. Choose **Confirm**\. \ No newline at end of file diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index 544463a5..29b23cba 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -55,6 +55,6 @@ To invoke your function, Amazon S3 needs permission from the function's [resourc If your function uses the AWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. **Topics** -+ [Tutorial: Using AWS Lambda with Amazon S3](with-s3-example.md) -+ [Sample Amazon S3 function code](with-s3-example-deployment-pkg.md) ++ [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) ++ [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) \ No newline at end of file diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index cfb1164d..acdd5447 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -137,8 +137,6 @@ Build the executable with `go build` and create a deployment package\. For instr The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. -Follow the instructions to create an AWS Lambda function deployment package\. - **Example ProcessSQSRecords\.py** ``` @@ -151,4 +149,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index be7557a0..d555bd08 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -113,6 +113,12 @@ If the handler returns normally without exceptions, Lambda considers the message aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` 1. Verify the output in the `outputfile.txt` file\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d2f55610..96f42fa1 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -79,6 +79,16 @@ For FIFO queues, records contain additional attributes that are related to dedup When Lambda reads a batch, the messages stay in the queue but become hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. If your function is [throttled](invocation-scaling.md), returns an error, or doesn't respond, the message becomes visible again\. All messages in a failed batch return to the queue, so your function code must be able to process the same message multiple times without side effects\. +**Topics** ++ [Scaling and processing](#events-sqs-scaling) ++ [Configuring a queue to use with Lambda](#events-sqs-queueconfig) ++ [Execution role permissions](#events-sqs-permissions) ++ [Configuring a queue as an event source](#events-sqs-eventsource) ++ [Event source mapping APIs](#services-dynamodb-api) ++ [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) ++ [Sample Amazon SQS function code](with-sqs-create-package.md) ++ [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + ## Scaling and processing For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to 5 batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that can be processed simultaneously by an event source mapping is 1000\. From 2ab2173eb7d0d86ef25fc585c17f75a5d6e5c849 Mon Sep 17 00:00:00 2001 From: Darren Garvey Date: Wed, 7 Apr 2021 11:13:17 +0100 Subject: [PATCH 083/243] Update with-s3-example.md Fix example `Records` payload by removing extraneous `{`. --- doc_source/with-s3-example.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 89663759..0d38b65a 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -168,7 +168,6 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. ``` { - { "Records": [ { "eventVersion": "2.0", @@ -295,4 +294,4 @@ You can now delete the resources that you created for this tutorial, unless you ## Next steps -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. From 9467b96ae1770df238c0bc36a9a83f840ed498c1 Mon Sep 17 00:00:00 2001 From: "Stan Silas(Vivek Mangipudi)" Date: Wed, 7 Apr 2021 21:55:39 -0500 Subject: [PATCH 084/243] fix arn the arn is wrong. It should be the account number and now the keyword aws --- doc_source/access-control-identity-based.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 1e738dce..bfe47929 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -157,7 +157,7 @@ The permissions in the policy are organized into statements based on the [resour "iam:GetPolicy", "iam:GetPolicyVersion" ], - "Resource": "arn:aws:iam::aws:policy/*" + "Resource": "arn:aws:iam::accountNumber:policy/*" ``` + `ViewLogs` – Use CloudWatch Logs to view logs for functions that are prefixed with `intern-`\. @@ -243,4 +243,4 @@ For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/Use You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. -For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file +For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. From 9fb2bb8143d4f0f3891012ec3699ca4b75cca4a9 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 14:32:17 -0700 Subject: [PATCH 085/243] updating getting started docs to include deploy --- doc_source/getting-started-create-function.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 13a9bc44..396df7cc 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. (Note that AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions.) 1. Choose **Create function**\. @@ -42,9 +42,11 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. After selecting your function, choose the **Test** tab\. +1. In the console, open the file with the lambda function. For this Node\.js app, it's called index\.js. -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: +1. Click on the orange **Test** button to create a new test event. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + +1. Enter an **Event name** and note the following sample event template: ``` { @@ -54,18 +56,17 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Create**, and then choose **Test** again to run the function\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + + The **Execution results** tab shows the execution status as **succeeded**\. Here you will also see **Function Logs**\. -1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. +1. To make changes to your lambda function, edit the `index.js` file, and choose **Deploy**\. This will store those changes in S3. Then, choose **Test** again to run the function. + -1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. From e93b276e8ebe6e28926076c0949fba3d805b3be9 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 15:52:31 -0700 Subject: [PATCH 086/243] update role creation for api-gateway tutorial --- doc_source/services-apigateway-tutorial.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 667e3e63..c15120cc 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -88,9 +88,12 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Choose **Create role**\. 1. Create a role with the following properties\. - + **Trusted entity** – Lambda\. - + **Role name** – **lambda\-apigateway\-role**\. - + **Permissions** – Custom policy with permission to DynamoDB and CloudWatch Logs\. + + **Trusted entity** – AWS Service\. + + **Use Case** – **Lambda**\. + +1. Choose Next: Permissions + + Choose **Create policy**\. This will open a new tab\. + + Choose the **JSON** tab and paste this custom policy with permission to DynamoDB and CloudWatch Logs\. ``` { From 4fa612461e55d5f21b47c8241579a331fa217f16 Mon Sep 17 00:00:00 2001 From: talianassi921 Date: Fri, 9 Apr 2021 16:01:15 -0700 Subject: [PATCH 087/243] adding missing steps --- doc_source/services-apigateway-tutorial.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index c15120cc..96a96ad4 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -126,6 +126,15 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func } ``` +1. Choose **Next: Tags**\. + + Tags are key-value pairs that you can add to AWS resources to help identify, organize, or search for resources. Note that this is optional. + +1. Choose **Next: Review**\. + + Enter a **Name** for your policy\. + + Verify that you see write access for CloudWatch Logs and both read and write access for DynamoDB\. + +1. Choose **Create Policy**\. + The custom policy has the permissions that the function needs to write data to DynamoDB and upload logs\. Note the Amazon Resource Name \(ARN\) of the role for later use\. ## Create the function From 771f9a952600abc817eeb45cabccb48879b05641 Mon Sep 17 00:00:00 2001 From: Rohan Deshpande Date: Sun, 11 Apr 2021 01:07:33 -0700 Subject: [PATCH 088/243] Fix typo --- doc_source/nodejs-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index aaf33bdc..aefc9a08 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -73,7 +73,7 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins 1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. -1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function>`\. +1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function`\. 1. Install libraries in the node\_modules directory using the `npm install` command\. @@ -126,4 +126,4 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. From 27558c569ee196f9567b087e8b30a7f2e4d2153b Mon Sep 17 00:00:00 2001 From: Bulat Usmanov Date: Tue, 20 Apr 2021 12:58:40 +0300 Subject: [PATCH 089/243] Remove excess cd command --- doc_source/python-package-update.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 0ea280f5..79d06776 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -167,8 +167,7 @@ If you are creating a deployment package used in a layer, see [Include library d ``` ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . + ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r ../../../../my-deployment-package.zip . ``` The last command saves the deployment package to the root of the `my-function` directory\. @@ -213,4 +212,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder } ``` -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. From ba29cdd1ee7e98a7f0f091ece2c818e19d66249d Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 22 Apr 2021 10:45:32 -0700 Subject: [PATCH 090/243] Documentation updates --- doc_source/access-control-identity-based.md | 20 +-- doc_source/configuration-images.md | 5 +- doc_source/configuration-layers.md | 167 +++++++++++------- doc_source/csharp-image.md | 6 + doc_source/deploying-lambda-apps.md | 4 +- doc_source/getting-started-create-function.md | 33 ++-- doc_source/getting-started.md | 1 - doc_source/gettingstarted-concepts.md | 88 ++++----- doc_source/gettingstarted-features.md | 4 +- doc_source/go-image.md | 10 +- doc_source/index.md | 2 +- doc_source/java-image.md | 7 + doc_source/lambda-intro-execution-role.md | 14 ++ ...ngstarted-tools.md => lambda-settingup.md} | 47 ++--- doc_source/monitoring-insights.md | 13 +- doc_source/nodejs-image.md | 6 + doc_source/nodejs-package.md | 2 +- doc_source/python-package-create.md | 6 + doc_source/python-package-update.md | 6 +- doc_source/ruby-image.md | 6 + doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-logs-api.md | 2 +- doc_source/services-apigateway-tutorial.md | 105 ++++++----- .../services-cloudwatchevents-expressions.md | 4 +- doc_source/services-cloudwatchlogs.md | 2 +- doc_source/with-s3-example.md | 4 +- doc_source/with-s3-tutorial.md | 4 +- 27 files changed, 326 insertions(+), 246 deletions(-) rename doc_source/{gettingstarted-tools.md => lambda-settingup.md} (57%) diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index bfe47929..829053aa 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -78,15 +78,6 @@ The following shows an example of a permissions policy with limited scope\. It a ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" }, - { - "Sid": "ViewExecutionRolePolicies", - "Effect": "Allow", - "Action": [ - "iam:GetPolicy", - "iam:GetPolicyVersion" - ], - "Resource": "arn:aws:iam::aws:policy/*" - }, { "Sid": "ViewLogs", "Effect": "Allow", @@ -150,15 +141,6 @@ The permissions in the policy are organized into statements based on the [resour ], "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" ``` -+ `ViewExecutionRolePolicies` – View the AWS managed policies that are attached to the execution role\. This lets you view the function's permissions in the console, but doesn't include permission to view policies that were created by other users in the account\. - - ``` - "Action": [ - "iam:GetPolicy", - "iam:GetPolicyVersion" - ], - "Resource": "arn:aws:iam::accountNumber:policy/*" - ``` + `ViewLogs` – Use CloudWatch Logs to view logs for functions that are prefixed with `intern-`\. ``` @@ -243,4 +225,4 @@ For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/Use You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. -For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. +For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 5a38bfd5..afcfaddc 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -35,7 +35,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Update the user permissions -Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. +Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For example, use the IAM console to create a role with the following policy: @@ -48,7 +48,8 @@ For example, use the IAM console to create a role with the following policy: "Effect": "Allow", "Action": [ "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy" + "ecr:GetRepositoryPolicy", + "ecr:InitiateLayerUpload" ], "Resource": "arn:aws:ecr:::repository//" } diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 63b7254a..ac89a471 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,80 +1,30 @@ # Lambda layers -You can configure your Lambda function to pull in additional code and content in the form of layers\. A *layer* is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. +You use layers with functions that use \.zip file archives for deployment\. For a function defined as a container image, you package your preferred runtime and all code dependencies when you [create the container image](runtimes-custom.md)\. For more information, see [ Working with Lambda layers and extensions in container images]( https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. -**Note** -Functions defined as container images do not support layers\. When you build a container image, you can package your preferred runtimes and dependencies as a part of the image\. +You can use Lambda layers to share code in your functions\. A *layer* contains code libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. Layers help to reduce your \.zip archive deployment package size, because layers are not included in the deployment package\. -Layers let you keep your deployment package small, which makes development easier\. You can avoid errors that can occur when you install and package dependencies with your function code\. For Node\.js, Python, and Ruby functions, you can [develop your function code in the Lambda console](code-editor.md) as long as you keep your deployment package under 3 MB \(and each code file under `512 KB`\)\. - -**Note** A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. -You can create layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. - -Layers are extracted to the `/opt` directory in the function execution environment\. Each runtime looks for libraries in a different location under `/opt`, depending on the language\. [Structure your layer](#configuration-layers-path) so that function code can access libraries without additional configuration\. +You can create your own layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Configure a function to use layers](#configuration-layers-using) + [Create layers](#configuration-layers-create) + [Manage layers](#configuration-layers-manage) + [Include library dependencies in a layer](#configuration-layers-path) + [Layer permissions](#configuration-layers-permissions) ++ [Configure a function to use layers](#configuration-layers-using) ++ [Add an updated layer version to your function](#configuration-layers-script) + [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) + [Sample applications](#configuration-layers-samples) -## Configure a function to use layers - -You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, update your function's configuration\. - -To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 -``` - -You should see the following output: - -``` -{ - "FunctionName": "test-layers", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", - "CodeSize": 169 - }, - { - "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", - "CodeSize": 169 - } - ], - "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", - ... -} -``` - -You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. - -``` -aws lambda update-function-configuration --function-name my-function --layers [] -``` - -While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. - -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. - ## Create layers -You can create new layers in the Lambda console or using the Lambda API\. +When you create a new layer, Lambda creates the layer as version 1\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. -**To create a layer in the console** +**To create a layer \(console\)** 1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. @@ -94,13 +44,14 @@ You can create new layers in the Lambda console or using the Lambda API\. 1. Choose **Create**\. -**To create a layer using the API** +**To create a layer \(API\)** To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. ``` -aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ ---content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip --compatible-runtimes python3.6 python3.7 +aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ +--license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ + --compatible-runtimes python3.6 python3.7 python3.8 ``` You should see the following output: @@ -126,7 +77,7 @@ You should see the following output: } ``` -Each time that you call `publish-layer-version`, you create a new version\. Functions that use the layer refer directly to a layer version\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +Each time that you call `publish-layer-version`, you create a new version of the layer\. ## Manage layers @@ -200,15 +151,15 @@ When you delete a layer version, you can no longer configure functions to use it ## Include library dependencies in a layer -You can move runtime dependencies out of your Lambda function by placing them in a layer\. Each Lambda runtime includes the paths to specific folders in the `/opt` directory\. Define the same folder structure in your layer \.zip archive to ensure that your function code has access to the libraries in that layer\. +Each Lambda runtime adds specific `/opt` directory folders to the PATH variable\. If the layer uses the same folder structure, your function code can access the layer content without the need to specify the path\. -To include libraries in a layer, place them in one of the folders that your runtime supports, or modify that path variable for your language\. The following table lists the folder paths that each runtime supports\. +The following table lists the folder paths that each runtime supports\. **Layer paths for each Lambda runtime** [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) -The following examples show how you can structure the folders for your layer\. +The following examples show how you can structure the folders in your layer \.zip archive\. ------ #### [ Node\.js ] @@ -275,7 +226,9 @@ For more information about path settings in the Lambda execution environment, se ## Layer permissions -Layer usage permissions are managed on the resource\. To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md) or from the function's [resource\-based policy](access-control-resource-based.md)\. To use a layer in another account, you need permission on your user policy, and the owner of the other account must grant your account permission with a resource\-based policy\. +To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md)\. + +To use a layer in another account, the owner of the other account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. @@ -294,6 +247,88 @@ Permissions apply only to a single version of a layer\. Repeat the process each For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. +## Configure a function to use layers + +You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, you can update your function's configuration\. + +To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ +arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see the following output: + +``` +{ + "FunctionName": "test-layers", + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", + "Layers": [ + { + "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", + "CodeSize": 169 + }, + { + "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", + "CodeSize": 169 + } + ], + "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", + ... +} +``` + +You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. + +``` +aws lambda update-function-configuration --function-name my-function --layers [] +``` + +While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. + +The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Add an updated layer version to your function + + Use the `update-function-configuration` command to add an updated layer version to your function\. + +The `layers` parameter for this command is a list of all of the layer versions to add to the function\. If the function already has layers, the new list overwrites the previous list\. If you want to update only one of the layer versions, the `layers` parameter needs to include the ARNs of the existing layer versions\. + +The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. + +**Add an updated layer version to your function** + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + + \(Optional\) You can also get the latest version of a layer based on the layer name\. + + ``` + aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`\. + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + ## AWS CloudFormation and AWS SAM To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. @@ -331,7 +366,7 @@ Resources: - nodejs12.x ``` -When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. If you deploy changes to your code without modifying your dependencies, AWS SAM skips the layer update, saving upload time\. +When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. ## Sample applications diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 664397c5..66353c8d 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -23,6 +23,12 @@ Docker Hub repository: amazon/aws\-lambda\-dotnet Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet +## Using a \.NET base image + +For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. + ## \.NET runtime interface clients Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index eba01d7e..19cd514e 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -4,9 +4,9 @@ An AWS Lambda application is a combination of Lambda functions, event sources, a The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/) provides a collection of Lambda applications that you can deploy in your account with a few clicks\. The repository includes both ready\-to\-use applications and samples that you can use as a starting point for your own projects\. You can also submit your own projects for inclusion\. -[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](gettingstarted-tools.md#gettingstarted-tools-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. +[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](lambda-settingup.md#lambda-settingup-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. -The [AWS CLI](gettingstarted-tools.md#gettingstarted-tools-awscli) and [SAM CLI](gettingstarted-tools.md#gettingstarted-tools-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. +The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 396df7cc..6373c1ff 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. (Note that AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions.) + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell,C\#\) Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -32,9 +32,9 @@ Lambda creates a Node\.js function and an [execution role](lambda-intro-executio ### Use the function overview -The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger, destination, and layer configuration\. +The **Function overview** shows a visualization of your function, including any triggers, destinations, and layer that you have configured for the function\. -![\[A Lambda function with an Amazon S3 trigger and an Amazon EventBridge destination.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) +![\[A Lambda function with no triggers, destinations or layers.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) ### Invoke the Lambda function @@ -42,11 +42,9 @@ Invoke your Lambda function using the sample event data provided in the console\ **To invoke a function** -1. In the console, open the file with the lambda function. For this Node\.js app, it's called index\.js. - -1. Click on the orange **Test** button to create a new test event. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. After selecting your function, choose the **Test** tab\. -1. Enter an **Event name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: ``` { @@ -56,15 +54,16 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create**, and then choose **Test** again to run the function\. +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. 1. Upon successful completion, view the results in the console\. - + The **Execution results** tab shows the execution status as **succeeded**\. Here you will also see **Function Logs**\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. To make changes to your lambda function, edit the `index.js` file, and choose **Deploy**\. This will store those changes in S3. Then, choose **Test** again to run the function. - +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) @@ -232,7 +231,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ### Update the user permissions -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* For example, use the IAM console to create a role with the following policy: @@ -243,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], "Resource": "arn:aws:ecr:::repository//" } ] @@ -280,7 +279,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. After selecting your function, choose the **Test** tab\. -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter an **Name** and note the following sample event template: +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: ``` { @@ -290,7 +289,7 @@ Invoke your Lambda function using the sample event data provided in the console\ } ``` -1. Choose **Create event**, and then choose **Invoke**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. @@ -299,9 +298,9 @@ Invoke your Lambda function using the sample event data provided in the console\ + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. -1. Run the function \(choose **Invoke**\) a few more times to gather some metrics that you can view in the next step\. +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. -1. Near the top of the page, choose the **Monitoring** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index 5348ee05..7e77bf67 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -19,5 +19,4 @@ You deploy your function code to Lambda using a deployment package\. Lambda supp + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda deployment packages](gettingstarted-package.md) -+ [Tools for working with Lambda](gettingstarted-tools.md) + [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index b9e05f9f..c5ac3406 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -4,15 +4,15 @@ With Lambda, you run functions to process events\. To send events to your functi **Topics** + [Function](#gettingstarted-concepts-function) -+ [Qualifier](#gettingstarted-concepts-qualifier) ++ [Trigger](#gettingstarted-concepts-trigger) ++ [Event](#gettingstarted-concepts-event) + [Execution environment](#gettingstarted-concepts-ee) + [Deployment package](#gettingstarted-concepts-dp) -+ [Layer](#gettingstarted-concepts-layer) + [Runtime](#gettingstarted-concepts-runtime) ++ [Layer](#gettingstarted-concepts-layer) + [Extension](#gettingstarted-concepts-extensions) -+ [Event](#gettingstarted-concepts-event) + [Concurrency](#gettingstarted-concepts-concurrency) -+ [Trigger](#gettingstarted-concepts-trigger) ++ [Qualifier](#gettingstarted-concepts-qualifier) ## Function @@ -20,45 +20,9 @@ A *function* is a resource that you can invoke to run your code in Lambda\. A fu For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. -## Qualifier - -When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. - -For more information, see [Lambda function versions](configuration-versions.md)\. - -## Execution environment - -An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. - -For more information, see [AWS Lambda execution environment](runtimes-context.md)\. - -## Deployment package - -You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. - -For more information, see [Lambda deployment packages](gettingstarted-package.md)\. - -## Layer - -A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. - -For more information, see [Lambda layers](configuration-layers.md)\. - -## Runtime - -The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. - -For more information, see [Lambda runtimes](lambda-runtimes.md)\. - -## Extension - -Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. - -An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. +## Trigger -For more information, see [Using Lambda extensions](using-extensions.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event @@ -93,12 +57,48 @@ When an AWS service invokes your function, the service defines the shape of the For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. +## Execution environment + +An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. + +For more information, see [AWS Lambda execution environment](runtimes-context.md)\. + +## Deployment package + +You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: ++ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. + +For more information, see [Lambda deployment packages](gettingstarted-package.md)\. + +## Runtime + +The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. + +For more information, see [Lambda runtimes](lambda-runtimes.md)\. + +## Layer + +A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information, see [Lambda layers](configuration-layers.md)\. + +## Extension + +Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. + +An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. + +For more information, see [Using Lambda extensions](using-extensions.md)\. + ## Concurrency *Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. -## Trigger +## Qualifier + +When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +For more information, see [Lambda function versions](configuration-versions.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 2c676ff4..a40b35da 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -95,13 +95,13 @@ For more information, see [Configuring destinations for asynchronous invocation] When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. -Blueprints are provided for use under the [Creative Commons Zero](https://spdx.org/licenses/CC0-1.0.html) license\. They are available only in the Lambda console\. +Blueprints are provided for use under the [Amazon Software License](https://aws.amazon.com/asl/)\. They are available only in the Lambda console\. ## Testing and deployment tools Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use a rich tools ecosystem for authoring, building, and deploying your Lambda functions using AWS and popular community tools like the Docker command line interface \(CLI\)\. -For more information, see [Tools for working with Lambda](gettingstarted-tools.md)\. +To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. ## Application templates diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 98a70933..b1b2d290 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -11,6 +11,7 @@ You can deploy your Lambda function code as a [container image](images-create.md **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) ++ [Using the Go:1\.x base image](#go-image-v1) + [Deploying Go with the `provided.al2` base image](#go-image-al2) + [Deploying Go with an alternative base image](#go-image-other) @@ -31,6 +32,12 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/go AWS does not provide a separate runtime interface client for Go\. The `aws-lambda-go/lambda` package includes an implementation of the runtime interface\. +## Using the Go:1\.x base image + +For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [AWS Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. + ## Deploying Go with the `provided.al2` base image To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. @@ -99,9 +106,10 @@ You can build a container image for Go from an alternative base image\. The foll FROM alpine as build # install build tools RUN apk add go git +RUN go env -w GOPROXY=direct # cache dependencies ADD go.mod go.sum ./ -RUN go mod download GOPROXY=direct +RUN go mod download # build ADD . . RUN go build -o /main diff --git a/doc_source/index.md b/doc_source/index.md index 6b01b909..42811c25 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -15,6 +15,7 @@ Amazon's trademarks and trade dress may not be used in ----- ## Contents + [What is AWS Lambda?](welcome.md) ++ [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) + [Creating functions using the AWS Lambda console editor](code-editor.md) @@ -22,7 +23,6 @@ Amazon's trademarks and trade dress may not be used in + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda deployment packages](gettingstarted-package.md) - + [Tools for working with Lambda](gettingstarted-tools.md) + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 8ae09915..8e1c2457 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -10,6 +10,7 @@ You can deploy your Lambda function code as a [container image](images-create.md **Topics** + [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) + [Java runtime interface clients](#java-image-clients) ## AWS base images for Java @@ -27,6 +28,12 @@ Docker Hub repository: amazon/aws\-lambda\-java Amazon ECR repository: gallery\.ecr\.aws/lambda/java +## Using a Java base image + +For instructions on how to use a Java base image, choose the **usage** tab on [AWS Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. + ## Java runtime interface clients Install the runtime interface client for Java using the Apache Maven package manager\. Add the following to your `pom.xml` file: diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 761f9e58..c738417e 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -19,6 +19,12 @@ You can add or remove permissions from a function's execution role at any time, When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +**Topics** ++ [Creating an execution role in the IAM console](#permissions-executionrole-console) ++ [Grant least privilege access to your Lambda execution role](#permissions-executionrole-least-privilege) ++ [Managing roles with the IAM API](#permissions-executionrole-api) ++ [AWS managed policies for Lambda features](#permissions-executionrole-features) + ## Creating an execution role in the IAM console By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started-create-function.md)\. You can also create an execution role in the IAM console\. @@ -45,6 +51,14 @@ By default, Lambda creates an execution role with minimal permissions when you [ For detailed instructions, see [Creating a role for an AWS service \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the *IAM User Guide*\. +## Grant least privilege access to your Lambda execution role + +When you first create an IAM role for your Lambda function during the development phase, you might sometimes grant permissions beyond what is required\. Before publishing your function in the production environment, best practice is to adjust the policy to include only the required permissions\. For more information, see [granting least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege)\. + +Use IAM Access Analyzer to help identify the required permissions for the IAM execution role policy\. IAM Access Analyzer reviews your AWS CloudTrail logs over the date range that you specify and generates a policy template with only the permissions that the function used during that time\. You can use the template to create a managed policy with fine\-grained permissions, and then attach it to the IAM role\. That way, you grant only the permissions that the role needs to interact with AWS resources for your specific use case\. + +To learn more, see [Generate policies based on access activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html) in the *IAM User Guide*\. + ## Managing roles with the IAM API To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. diff --git a/doc_source/gettingstarted-tools.md b/doc_source/lambda-settingup.md similarity index 57% rename from doc_source/gettingstarted-tools.md rename to doc_source/lambda-settingup.md index dcae16df..09907139 100644 --- a/doc_source/gettingstarted-tools.md +++ b/doc_source/lambda-settingup.md @@ -1,17 +1,24 @@ -# Tools for working with Lambda +# Setting up with Lambda -In addition to the Lambda console, you can use the following tools to manage and invoke Lambda resources\. +To use AWS Lambda, you need an AWS account\. If you plan to configure and use Lambda functions from the command line, set up the AWS CLI\. You can set up other development and build tools as required for the environment and language that you are planning to use\. **Topics** -+ [AWS CLI](#gettingstarted-tools-awscli) -+ [AWS SAM](#gettingstarted-tools-awssam) -+ [AWS SAM CLI](#gettingstarted-tools-samcli) -+ [Tools for container images](#gettingstarted-tools-docker) -+ [Code authoring tools](#lambda-app-author) ++ [AWS Account](#lambda-settingup-account) ++ [AWS CLI](#lambda-settingup-awscli) ++ [AWS SAM](#lambda-settingup-awssam) ++ [AWS SAM CLI](#lambda-settingup-samcli) ++ [Tools for container images](#lambda-settingup-docker) ++ [Code authoring tools](#lambda-settingup-author) -## AWS CLI +## AWS Account -To manage and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. +To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + +As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. + +## AWS CLI + +If you plan to configure and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. To set up the AWS CLI, see the following topics in the *AWS Command Line Interface User Guide*\. + [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) @@ -23,25 +30,25 @@ To verify that the AWS CLI is configured correctly, run the `list-functions` com aws lambda list-functions ``` -## AWS SAM +## AWS SAM The AWS Serverless Application Model \(AWS SAM\) is an extension for the AWS CloudFormation template language that lets you define serverless applications at a higher level\. AWS SAM abstracts away common tasks such as function role creation, making it easier to write templates\. AWS SAM is supported directly by AWS CloudFormation, and includes additional functionality through the AWS CLI and AWS SAM CLI\. For more information about AWS SAM templates, see the [AWS SAM specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) in the *AWS Serverless Application Model Developer Guide*\. -## AWS SAM CLI +## AWS SAM CLI The AWS SAM CLI is a separate command line tool that you can use to manage and test AWS SAM applications\. In addition to commands for uploading artifacts and launching AWS CloudFormation stacks that are also available in the AWS CLI, the AWS SAM CLI provides commands for validating templates and running applications locally in a Docker container\. You can use the AWS SAM CLI to build functions deployed as \.zip file archives or container images\. To set up the AWS SAM CLI, see [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) in the *AWS Serverless Application Model Developer Guide*\. -## Tools for container images +## Tools for container images To create and test functions deployed as container images, you can use native container tools such as the Docker CLI\. To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. -## Code authoring tools +## Code authoring tools You can author your Lambda function code in the languages that Lambda supports\. For a list of supported languages, see [Lambda runtimes](lambda-runtimes.md)\. There are tools for authoring code, such as the Lambda console, Eclipse integrated development environment \(IDE\), and Visual Studio IDE\. But the available tools and options depend on: + The language that you use to write your Lambda function code\. @@ -54,10 +61,10 @@ The following table lists the languages that Lambda supports, and the tools and | Language | Tools and options for authoring code | | --- | --- | -| Node\.js | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Java | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| C\# | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Python | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Ruby | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| Go | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | -| PowerShell | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-tools.html) | \ No newline at end of file +| Node\.js | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Java | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| C\# | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Python | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Ruby | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| Go | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | +| PowerShell | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 377dc64e..d8dead06 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -27,18 +27,7 @@ For each Lambda function enabled for Lambda Insights, you only pay for what you ## Supported runtimes -You can use Lambda Insights with any of the following [Lambda function runtimes](lambda-runtimes.md): -+ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) -+ Custom runtime \(`provided`\) -+ Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Java 11 \(Corretto\) \(`java11`\) -+ Java 8 \(Corretto\) \(`java8.al2`\) -+ Node\.js 12\.x \(`nodejs12.x`\) -+ Node\.js 10\.x \(`nodejs10.x`\) -+ Python 3\.8 \(`python3.8`\) -+ Python 3\.7 \(`python3.7`\) -+ Ruby 2\.7 \(`ruby2.7`\) -+ Ruby 2\.5 \(`ruby2.5`\) +You can use Lambda Insights with any of the runtimes that support [Lambda extensions](runtimes-extensions-api.md)\. ## Enabling Lambda Insights in the Lambda console diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 98044798..49d69fcc 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -23,6 +23,12 @@ Docker Hub repository: amazon/aws\-lambda\-nodejs Amazon ECR repository: gallery\.ecr\.aws/lambda/nodejs +## Using a Node\.js base image + +For instructions on how to use a Node\.js base image, choose the **usage** tab on [AWS Lambda base images for Node\.js](https://gallery.ecr.aws/lambda/nodejs) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Node\.js](https://hub.docker.com/r/amazon/aws-lambda-nodejs) in the *Docker Hub repository*\. + ## Node\.js runtime interface clients Install the runtime interface client for Node\.js using the npm package manager: diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index aefc9a08..2bbfd1d6 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -126,4 +126,4 @@ As an alternative, you can create the deployment package using an Amazon EC2 ins } ``` -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. +In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 04cb9e72..786bcf9f 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -399,6 +399,12 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i ``` ------ +**Note** +If you are using AWS CLI version 2, add the following command parameter: + + ``` + --cli-binary-format raw-in-base64-out + ``` This command produces the following output: diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index 79d06776..f6ba930e 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -166,8 +166,8 @@ If you are creating a deployment package used in a layer, see [Include library d 1. Create a deployment package with the installed libraries at the root\. ``` - ~/my-function$ cd myvenv/lib/python3.8/site-packages - ~/my-function/myvenv/lib/python3.8/site-packages$ zip -r ../../../../my-deployment-package.zip . + ~/my-function$cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . ``` The last command saves the deployment package to the root of the `my-function` directory\. @@ -212,4 +212,4 @@ A library may appear in `site-packages` or `dist-packages` and the first folder } ``` -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. +The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index d5eb5be9..29d147cb 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -22,6 +22,12 @@ Docker Hub repository: amazon/aws\-lambda\-ruby Amazon ECR repository: gallery\.ecr\.aws/lambda/ruby +## Using a Ruby base image + +For instructions on how to use a Ruby base image, choose the **usage** tab on [AWS Lambda base images for Ruby](https://gallery.ecr.aws/lambda/ruby) in the *Amazon ECR repository*\. + +The instructions are also available on [AWS Lambda base images for Ruby](https://hub.docker.com/r/amazon/aws-lambda-ruby) in the *Docker Hub repository*\. + ## Ruby runtime interface clients Install the runtime interface client for Ruby using the RubyGems\.org package manager: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index fb8835f3..d191b0b7 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -17,8 +17,8 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | May 31, 2021 | June 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | May 31, 2021 | June 30, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index 4b41d6af..c9712d97 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -52,7 +52,7 @@ We also recommend setting up the local HTTP listener or the TCP port before subs ## Buffering configuration Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Lambda uses the default value for any field that you do not specify: -+ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 100\. Maximum: 30000\. ++ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 25\. Maximum: 30000\. + **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262144\. Minimum: 262144\. Maximum: 1048576\. + **maxItems** – The maximum number of events to buffer in memory\. Default: 10000\. Minimum: 1000\. Maximum: 10000\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 96a96ad4..a1febf9f 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -79,7 +79,56 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Create the execution role -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +Create the [execution role](lambda-intro-execution-role.md)\. This role uses a custom policy to give your function permission to access the required AWS resources\. You first create the policy and then create the execution role\. + +**To create a custom policy** + +1. Open the [policy page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. + +1. Choose **Create Policy**\. + +1. Choose the **JSON** tab\. Paste the following custom policy into the input box\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "Stmt1428341300017", + "Action": [ + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:PutItem", + "dynamodb:Query", + "dynamodb:Scan", + "dynamodb:UpdateItem" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Sid": "", + "Resource": "*", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow" + } + ] + } + ``` + +1. Choose **Next: Tags**\. + +1. Choose **Next: Review**\. + +1. For the policy name, enter **lambda\-apigateway\-policy**\. + +1. Enter **Create policy**\. + +This policy includes permissions for the function to access DynamoDB and CloudWatch Logs\. **To create an execution role** @@ -87,55 +136,21 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func 1. Choose **Create role**\. -1. Create a role with the following properties\. - + **Trusted entity** – AWS Service\. - + **Use Case** – **Lambda**\. - -1. Choose Next: Permissions - + Choose **Create policy**\. This will open a new tab\. - + Choose the **JSON** tab and paste this custom policy with permission to DynamoDB and CloudWatch Logs\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "Stmt1428341300017", - "Action": [ - "dynamodb:DeleteItem", - "dynamodb:GetItem", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Sid": "", - "Resource": "*", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow" - } - ] - } - ``` +1. For the trusted entity, choose **AWS Service**, and for the use case choose **Lambda**\. -1. Choose **Next: Tags**\. - + Tags are key-value pairs that you can add to AWS resources to help identify, organize, or search for resources. Note that this is optional. +1. Choose **Next: Permissions**\. + +1. In the policy search box, enter **lambda\-apigateway\-policy**\. + +1. In the results, select `lambda-apigateway-policy` and choose **Next: Tags**\. 1. Choose **Next: Review**\. - + Enter a **Name** for your policy\. - + Verify that you see write access for CloudWatch Logs and both read and write access for DynamoDB\. -1. Choose **Create Policy**\. +1. For the role name, enter **lambda\-apigateway\-role**\. + +1. Enter **Create role**\. -The custom policy has the permissions that the function needs to write data to DynamoDB and upload logs\. Note the Amazon Resource Name \(ARN\) of the role for later use\. + Note the Amazon Resource Name \(ARN\) of the execution role for later use\. ## Create the function diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index eb06bd91..ad0c3815 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -14,7 +14,7 @@ Where *Value* is a positive integer and *Unit* can be minute\(s\), hour\(s\), or | Frequency | Expression | | --- | --- | | Every 5 minutes | `rate(5 minutes)` | -| Every hour | `rate(1 hour)` | +| Every hour | `rate(1 hours)` | | Every seven days | `rate(7 days)` | Cron expressions have the following format\. @@ -39,4 +39,4 @@ Note the following: + If you are using the Lambda console, do not include the `cron` prefix in your expression\. + One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. -For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file +For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md index 59ffb2fa..cf435ee5 100644 --- a/doc_source/services-cloudwatchlogs.md +++ b/doc_source/services-cloudwatchlogs.md @@ -2,7 +2,7 @@ You can use a Lambda function to monitor and analyze logs from an Amazon CloudWatch Logs log stream\. Create [subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html) for one or more log streams to invoke a function when logs are created or match an optional pattern\. Use the function to send a notification or persist the log to a database or storage\. -CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.zip file archive\. +CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.gzip file archive\. **Example CloudWatch Logs message event** diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 0d38b65a..0c547d52 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -6,7 +6,7 @@ We recommend that you complete this console\-based tutorial before you try the [ ## Prerequisites -To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) +To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. @@ -294,4 +294,4 @@ You can now delete the resources that you created for this tutorial, unless you ## Next steps -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index c1ca9ecc..3e4468bc 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -35,7 +35,7 @@ This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We ## Prerequisites + AWS account - To use Lambda, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) + Command line To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: @@ -58,7 +58,7 @@ This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We In this tutorial, you use AWS CLI commands to create and invoke the Lambda function\. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. + Language tools - Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](gettingstarted-tools.md#lambda-app-author)\. + Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](lambda-settingup.md#lambda-settingup-author)\. ## Step 1\. Create S3 buckets and upload a sample object From fdd1f74609c54f456f5ec6ce288893a1c5078675 Mon Sep 17 00:00:00 2001 From: yorickdowne <71337066+yorickdowne@users.noreply.github.com> Date: Fri, 23 Apr 2021 11:47:30 -0400 Subject: [PATCH 091/243] Update deprecated `Buffer()` ... to use `Buffer.from()` instead --- sample-apps/error-processor/processor/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/error-processor/processor/index.js b/sample-apps/error-processor/processor/index.js index 8894ab27..d6b5e412 100644 --- a/sample-apps/error-processor/processor/index.js +++ b/sample-apps/error-processor/processor/index.js @@ -83,7 +83,7 @@ var getTrace = function(context){ exports.handler = function(event, context) { console.log("Event: " + JSON.stringify(event, null, 2)) - var payload = new Buffer(event.awslogs.data, 'base64') + var payload = new Buffer.from(event.awslogs.data, 'base64') zlib.gunzip(payload, function(e, decodedEvent) { if (e) { context.fail(e) @@ -104,4 +104,4 @@ exports.handler = function(event, context) { //context.succeed() } }) -} \ No newline at end of file +} From 4def38a50837a8255b24453f9b9485adb4440e5b Mon Sep 17 00:00:00 2001 From: Andy Garfield Date: Tue, 27 Apr 2021 17:53:23 -0400 Subject: [PATCH 092/243] use ascii quotes and typo fix --- doc_source/images-test.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 9765af49..2e1ae3f0 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -78,7 +78,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-rie else exec /usr/bin/npx aws-lambda-ric fi @@ -90,7 +90,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie - ENTRYPOINT [ “/entry_script.sh” ] + ENTRYPOINT [ "/entry_script.sh" ] ``` 1. Build your image locally using the `docker build` command\. @@ -129,4 +129,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 250be931160222eab0a7623809e64a8846e78169 Mon Sep 17 00:00:00 2001 From: Andy Garfield Date: Wed, 28 Apr 2021 07:53:42 -0400 Subject: [PATCH 093/243] Update images-test.md It is `ric`, oops. --- doc_source/images-test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 2e1ae3f0..d44b3c83 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -78,7 +78,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-rie + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric else exec /usr/bin/npx aws-lambda-ric fi From 0585ea78268050e03c85863c6e10508913586cb0 Mon Sep 17 00:00:00 2001 From: Murat Goksel Date: Thu, 29 Apr 2021 15:23:45 -0400 Subject: [PATCH 094/243] Correct function-name argument in invocation call On lines 391 and 398, the function-name argument was passed as `requests-function`, but the name of the created function is `my-sourcecode-function`. This might be confusing to new comers so I changed those arguments to `my-sourcecode-function` to be in line with the rest of the document. --- doc_source/python-package-create.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 786bcf9f..b2faa753 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -388,14 +388,14 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i #### [ macOS/Linux ] ``` - aws lambda invoke --function-name requests-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke --function-name my-sourcecode-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------ #### [ Windows ] ``` - aws lambda invoke --function-name requests-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke --function-name my-sourcecode-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------ @@ -449,4 +449,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file + ``` From a930cb32b75fbda45d903b22864bdd605a96bb95 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 30 Apr 2021 12:46:08 -0700 Subject: [PATCH 095/243] Documentation updates --- .DS_Store | Bin 8196 -> 0 bytes doc_source/.DS_Store | Bin 129028 -> 0 bytes doc_source/access-control-resource-based.md | 6 +- doc_source/applications-tutorial.md | 4 +- doc_source/best-practices.md | 2 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-database.md | 2 +- doc_source/configuration-layers.md | 335 +++++------------- doc_source/csharp-image.md | 2 +- doc_source/csharp-package-toolkit.md | 2 +- doc_source/csharp-tracing.md | 4 +- doc_source/getting-started-create-function.md | 4 +- doc_source/gettingstarted-awscli.md | 4 +- doc_source/gettingstarted-concepts.md | 12 +- doc_source/gettingstarted-package.md | 6 +- doc_source/go-image.md | 4 +- doc_source/golang-package.md | 19 +- doc_source/golang-tracing.md | 4 +- doc_source/images-test.md | 19 +- doc_source/index.md | 3 +- doc_source/invocation-layers.md | 195 ++++++++++ doc_source/java-image.md | 4 +- doc_source/java-package-eclipse.md | 2 +- doc_source/java-package.md | 4 +- doc_source/java-tracing.md | 6 +- doc_source/lambda-functions.md | 4 +- doc_source/lambda-nodejs.md | 4 +- doc_source/lambda-python.md | 2 +- doc_source/lambda-rolling-deployments.md | 2 +- doc_source/lambda-ruby.md | 4 +- doc_source/lambda-runtimes.md | 4 +- .../monitoring-functions-access-metrics.md | 2 +- doc_source/nodejs-package.md | 13 +- doc_source/nodejs-tracing.md | 6 +- doc_source/python-package-create.md | 6 +- doc_source/python-package-update.md | 4 +- doc_source/python-package.md | 13 +- doc_source/python-tracing.md | 12 +- doc_source/ruby-package.md | 13 +- doc_source/ruby-tracing.md | 12 +- doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-walkthrough.md | 4 +- doc_source/samples-blank.md | 14 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/services-apigateway-tutorial.md | 4 +- .../services-cloudwatchevents-expressions.md | 2 +- doc_source/services-ec2-tutorial.md | 4 +- doc_source/services-ec2.md | 4 +- doc_source/services-elasticache-tutorial.md | 4 +- doc_source/services-rds-tutorial.md | 4 +- doc_source/services-s3-batch.md | 2 +- doc_source/services-xray.md | 4 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 8 +- doc_source/troubleshooting-invocation.md | 2 +- doc_source/using-extensions.md | 2 +- doc_source/welcome.md | 98 +++-- doc_source/with-android-example.md | 4 +- doc_source/with-ddb-example.md | 4 +- doc_source/with-ddb.md | 6 +- doc_source/with-kinesis-example.md | 4 +- doc_source/with-kinesis.md | 8 +- doc_source/with-mq.md | 1 + doc_source/with-s3-tutorial.md | 4 +- doc_source/with-s3.md | 2 +- doc_source/with-sns-example.md | 4 +- doc_source/with-sqs-example.md | 4 +- doc_source/with-sqs.md | 4 +- 70 files changed, 548 insertions(+), 411 deletions(-) delete mode 100644 .DS_Store delete mode 100644 doc_source/.DS_Store create mode 100644 doc_source/invocation-layers.md diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 46177358ce517fc9065e0a719a965ecfd3892489..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMS!@+m82-OfU}g&Rl&#AExzflI3bq(1Ws%zrsX#z)OUrt>_s#$lr!)1=+*_d3 z)S%G^193@=+Y9;z(I*TsKDk0PCdS4s(U|z=lkv?Mm;cO}vK0E@3z#q`Ip;s;{QrNJ zZ@xL_{&R^49VM%UsE&v<&QgjhE^d>gUgld;Mcgx;CD@-RAfHN9qypKuSSK9`0to^M z0to^M0to{D2L$-emPwo9-dEbBOb|#AxF->i=R=CKl<8QGDH$CdTtp!N%S!H!64yBn zhFmSajPcY<;!#4{s~P!P?|eyPZukXAA& z69f_jZbd-G?gm*Lw-+dTWBi^U4ufB7!cx$YD;|)oJ-P6BKCburzI&~n%kOpU;jEb7>3d<$@$6#c>{vFN9PD>I%OCFW zOP&=(<7AXV*L6+Lin@`Jme$s$)Y=VgqfM!iw$_%WRO{Nd(NSHiy}xBk&ym5Cr$$bX zKKZKJAL28DsweIDwW&611qCQ-ZUPP6s4{yVF?MFf+%j)+ z_fY8gUa;3L1}w9pI$&UW3ck0eXiI&6!FNl8UXT?vg`8U`xw+78cioJ0$_@rX`$Q;f z`vboic1DI-AxeS$n9X)h+3sTNV8G$wq?v$zVb+4hOP8%`Ubk^;*ZAx?)xt35&F?Qe zfs=RbeYv1udzRxJ>l=2g@c4el)eD`Yj$PFC8eH!6a)b7`SXf(E-(Z@`=DN?sC5-<iX0IFdSkjd=88u3w1zL8 z?R1boVhzz5dY;bGIeMMmri=6*eL$bl6}n1a&{y;W{Y<~o@AN1AMSs&j(69gtQHOdg z#Tq<-X0+iUY(+adumgMWC^G29ArxTYD2`zWCvXxYIE`m;7U%FHUcwu=fQxts@8U8( z#7FoTpWsV;jd8WUiV1G-iq{(p{K%E5s2jh?6^Cy}-G=UM#`e2I-S1~fzShj0H-EvB z#ucmAwr*~}_FN}D$r~vZ@kkLRBG3duqDOfXE5{>Z8;cfCF!?&S71#TifA$GYl1R){ z)(!V9)tEOzi<`@qbMum@h?+*jswSN&ET+XnH@9d^Rxw>^jdkmFrn9JwwHr6Fc88cT zUSC_caEr0k5G3C^JsxWrA8-GiiRbA8y-%Og=gh!w=qLJxexpACRG|j75&ITl36^68 zR$>)aV?A220UNOy-PneQ(ZgKqMIZKJ0Q(~@+RQ}@W==kZGk6-$;yJt!aq?xn ziSu}C5(9fCG4SG43@m4gp6h$ZSUT5o*9iLTL(&}B+C}#j6Io^q2kYr^*%oHcIERQ;n{=Y5I?tzEqtF%{JxD>__eOE6_@83ExQBP%D>m@T1H5v8cfF1G-R%7PYVip^+s6p^ zP4QK62kCrPd|!NCe2ULFK1Ko~fsw#Sz$O9KeR!NY?eF8yk-$h`BrqpH`>=wG_nWi( zOMiE!13%FGcYlAKcRuhM`T_2~GP~cL-Cz2|jg~4&ZIlI5~ zcOSi&_~^xC_Rf=84`t%s9r0FN@M3b)-^ZULfsw!>0rq`Y(5KwQzwP1(|Jc)Ik9Law z?$cry&v(%4+;*?*;MEs+Wdkve@Y>eA-+OP?@7+aDbGOu2{S}^Xps&1xS5LAxdjtL9 zJH>bSJnO}M{Qgm~hWl6O_1-~$`F8D7?BNq07Ekbro)*vX&8nZ-KVv_iK7bnt^$0(Q z;UxZn-pnID5B(KK_=d;$u2gr_P0!ykoMLtBObfa#AxEwicj1S*<;oouVtKoVQnH6@ zYN}Ml(+~|JW3-U|7UklB^Z1G1&Vv1F;z>O=lqy@TthAupbx}R@3;nSS*A8|u}3LN$|uf>kN3S$d0&pEv!}`)6n}p)e;*6&!dMo9m6!ll|m;DZ<<-pCgVO?fPt^SlmubwGEu}i9AUpk-J;`}QMb}WsED3K5g)R*Vf zZ@XH99vweFj@}%rRxF*0&`*pB1wsu^1$G_%ZKxuBCQJ4xmW9xc3J=DiHYqb6Ywq%> zS6@b=Nw0LERj5hIT8%Y#b&RqD7+IAz7gnwukkF+@a(1dgDd_TU`;4=Z)O z)HHRS;;o{5?m^SV=M0|1HhR8oV%e841Siq3cUsZ;D_HWo=pjEtKkNzGJXTwpab+i- zndmuay3jU^yOhgh)9A0IHftUk(J3P~)c8-;lCPo1_7o+GqauD>kz*ygowQosPKKPQ zc><|J?J#1)vd4BHM_t0`u~jW|xQJ58aiK%#ZQgM;*N!W1`38ORfhN-TV5>KcT7i5zqC{p2Q07{zGBP{Bu7&Qy zN7Ttq1NsD?SH0wfT6XkN4Z}(F>dhRw1)s@pQFBdE%DAdcR@bb%*JNI=t(i}GWJH^c z*ihr_+{%d>7DukTDG23`kRTdr98Z)jvn|(J<7_hPb8hqLhys}@K$%e6cx6I8(cBxe z)Xwe0N7Ttq1NsCnlh>zSuUpb0mW6PS3J=CVui5)LO9N}^WJlp-u*XeErj$?p0io|Y)sRU<{F z2qoXHS;%pILpl>tC5a{2*IVUH?7x7|`W8kt!d|Qv>|H(`(IYbjC{u5dHz^a=587JO z*N2a&lbr_iIajkJ*^DVJ)epT3;x@qsMp_z$ZgQg2@LvQyk#y;Lt4ZkpL6?;mEbB*e!@cynGq zmHR)IN?1Dq;oA}l6w9S9%$vW3`5Q0L7Tz>94=a|1kc|ot#%Ja^HMDUp<%&KM%1#6NgnIs-TLs0rK{6Yq zyrY!`k6|ne;T{zpjKk=bFzz1lwKWT?A0g4BM=DS$?7|=_g;9{^xhl4F>dQ!!>Xi;= zbX8YBFM37fefswQKPdHXxJGnZ)aP!5JW}qdm;GWPhsdWIFjeH+u*a_C+xlk=pTL3@ zPvIeoM8^T||LDvUM+HaRx^29rUfuB2M7x1ghQj9;6b@}yTV*MZgeVaa8g#=tVzF0& zZnY0?i**hcA)g!ERG?Crukbazw_hU9a|JKwf7)7sAHzY2cZOZyx(=e@gfvTe zyvj=FpmSBif@^3!eT}gO?j;*`A+Tku<46eGh|t(oP#=G+X1kO6 zq7QHM)P(g{L(&qp2I3DTLyNFk$#FfFKS48xkSNxJb3}RT_L*CN78 z%pvxI93vEOHg|k>6x*i8-JMlbZOM1m{5DhxRR;(Yn?qMg2XSg@D zx~-oo8f;ZxTB6ZFDMHCGdR+c&))h;qBFZGjM6bQg6C$aeRR5pz|HBNp@(d8adlF|y z#hg$ppR;#b_&j08k@w*Y`24L z=;k4OqvL>gu=C#{w{E#nl<{=9b{4`piX9k-`J3f*M?Y%WkJ^`!XwoYkXcgApl(h<8 zrE<%5JlFO6BA1fr)sr_A3%iPzKTCZ+iIg@=ZT>tmqD)3?sPX=M47f{;aewNeSczhT zq=z;@&iFt3|H0?lrhTxbO=|$8jLP>KG+lho;FtUkZJtf_WC9Cw|6@3a2AyHSHO#AB z(y!l=DV#?<-92Kj0?$6bE>dxnol4c>dr&AFP5@WiO(5%4J z&8pxDQ#;UU*VO3I<(8b;#6?s{j@zNbF+4Ndu6*!r%S+S7vWZKK4r*NJaK6}ZjHj?b z2Qxo0Pf+0KsV(wxB!qQDXwZGjS#|E4JTGuYR&ZFBf4a#5v333#&G?} zA#~#J*7j^|D=+?UO?=|@X<%IO%4wdk7T-&c{(pNp_urZ0?>re$%BpkxoUFNQ~L3z%H!Q3zQ9O7OI`2MkP*xg_xZR z@T7ar0X{U=T5MN9qY|gULQE)dsnrVk88@~pP#O^-pAZYw+uKx}^G>U?gS^jE?=98H zd1OR|jMz})z1A}D%#8}tm$r}I5a&^HPV3Z|E`1q^LcP*~Ru?0*vQ%DDc!&nkagg8h z#{b`jQs<%6QSsRI@ebx=jocObN0c7XNIp|U=$ZQEG?^Ah4Gxf^MQceVV|fVa=s1do zRFhVaeMVa&3ibS{lMu!cp+Wa-O})_PlhR?qJJn4=sCI-@^6M^Y>qq$KSD{#t34U@{Sj@~TwT2{fF-Zu7+Y|)RWAi=KpU~h*l*HyBG+?)@Eh2-$4 z@Xn%F)Acqab6695?efbt-Z5N+eR5praJA$8WQLFTRN1ocxokv_toRX{aMvc< zeZQ;ms0rudu=T-Ov58HrCTjc$dqw}jp6kcj(xc1fXk0{#QA=lZo?f<_F z1uoX|ciULKynA#UMPYqJ)}q2X31M6>KT2qYu0DQfk*-dniLMe_p{utlEz;FVG|^Q; zD|D67kb~)lMY=kPCb~*!&^=db>-jw-f(Kpvm=@T^a1gScVZrsS8dpCOWNSpfi-GWL z4F{H|z>@RS*yga5C$;Y_%ohFzPD_r{GxTA~JHv1km@C3KLTQO!JPlzQ83UwO8c1)u z9q#>n@~6%h&H1c*P=Mp`_U1hd!AaEVofdSv*q~eRci8gErSK3PqT_(~r3T(?W3WB4 zgS#!_X+(s1Labs7tzn5*?;Ym%|C>Gm$D_H^Rn@l1`zORgZn@BqTP)UIu`GmiRCq8x zTl^k+ajm}W7iZB&*-b&Xc7$}fHV|#|idpDIT`1+QHWorRDts;1DjqH){r_@a)F}wp zj*uYwW=W~g`mxkMXeS^fTSC?HrQ#bjm@jn-LbIGNm5?C1T*{YKe<0WF`nhkM(HwRe zvS3%!sR;4Jn6*4zRlt&UDCbn2f)MTqStH6B348Db_gl}XF#Tsz#p3J|q#JFCg%jD4ozGa!h-92HOoMcIoo2KPfA}ITUN(-#n+*%L94szTBzCjG7>#{r30-l zDq7XY)h*eW6ds~MbR6)m*Q(-Cx5T)MfpBdNr{rDkxw#LkB7Hf|Pq)Oio)6o22;=BD z;9ajL_Q9KTm41)@kR{GB9E5LYSa7{mv%z{#(-Pq{BEmW$7IN-vA2{$25AOe0FA>~1 z^Eq-kcQ$>D`!4>87V^%~agcsJM;u_r+7v0%c1gMxT0k)zgl}h9aJ^6~MfA(i_iXW; zn^+dYH!3_B*S%W4xF2w%R?5RzhbXY@@=1@%ftNRz|{%jB~}25WW$il^pEPi{$Ph>?zq= zF<#G+O)P|PRQLwQhnRb4@oY$qnZ}}x@j`eoUS6;goX>f%u=klQo19KXxF^Ph0#|AZ zc%LrY7JiNg`!G*k-Du78l1E0A$cPO!-U0RUF43!K<#AkEc4gpSkI^Fcvmkh0mYv=u zPt9u@v3C@}M(h7y0@rJ3*)94J{Vvg-=yRk##TdrpnF6*fP9Hv!-pnI`Kw{4}41)qBg4-keB zA&etJgYMZ{ZVq#A?6mA-C-|UgpiF0tkoOah|oy$vP-u-qlxD< zmA%xK+EiCS;~e~r)lqVKC7+=_`L!W`JWm>-cdtI)>ir#ll`z*{a_6?N8cXtCQarrR zJGfTddzHr#$(^?O5$j*=q$mOuzWm*HQ~wQ8@Mx|MWK5ZvHd+$f-bj_Z#VHypTMqvT-+$WDZauU@b`+( zitmfhi%;>&Z9M-De_b!`HQc{KxI4uyJih@wkCDzUl)V8<$a6NH;CIdn-^VNE zb140@dT(^Gt)=wn(ejn=TyJYBp~1KwN^ift`aO)H`u}Ia^fa#5ab1P-YsFpUkl#RO z)`RQF0gs@!pI@rzhKAiKpjqlGok$L`0*U}BAgX-+~>i+C321|DF zU%+j7&h1O&9CBMn8Qn=K9@3&Ss9TD|lzVWAt4x;u_;8HHNlYj&Fe4FXzF|c zhGlOV?oHxz7+1?5;vd)3Y{FiY^PSMXJF_8{EGld3l{vw6v2%nFtj{g6c?)dLgALck zvR8C~UX~}teDx!8mmL~o|DQW)-EbCp?EkYZI0X%1QtzuPJ^Hc#pXps0s{fCyi*ZV> zBM;s@&39$Trp2?6K35bwFn*)P*b>vG?=B40zk}I-RhV)033~{~uGK*g)iYdvy?x#L z-0f|B^}U2A%TKgBF^!=A)r$V~GO)G9UZHQtbG;MSyF9^9YkOMevJu^~;zN`2$j_1U z{M5^yCCe61L%2uA0O`{Ux!)4m=5H?~8$vADjX#Wbqtq_1miu@%LOm-!G+C+SX8*p` z5#zDW_I=56TRe}GXw{qfg1y&1k0q;Awcc$sM1#l}3-+FATOwPv=H+iMBpX7Y{pUxh z?a&&s|Ic~3%V;}`E!IX~v1`Fo)?_zyBEmi) zRtt5zt3{gl=|sAyE3sOr+w~kaQP+udQCDJt`gz#$u*b9Ic1#=zp&St!bXn(?=~}Np zQ+NpJ=r~Gl)@ua|^<+JN>Li45L}<`GTg%N>_xPxm=|u`cwSyP>>0G;3KC#bvM$o_1 z_W$$iVyo}1)TEWU8l9n)GNaTJMpi!8OMy;8)Qt$O(6zb}X0fHAlW3x=gmxB5_K&yR zaybio;djw*q99Z|LW1apQd-tqE3qtuZdCYMuGQ;h3oVp#UeqZF*N%`N`erHDF4o5u zXtom&k}aWX`BHCLSRh%>Z8`;^*%7ivRBugKBdSx-h$q- z9HAhTJ3^koehD4D`cnV9BP70KO8=kZ|1mo@37O8YNN-8uY;~1X3JqZ#$q%G`-=JEq zxptOoakz_-?vfwq_4# z`B-Bi%%j4C@kJ%y`<{!<)a4v55~(%p60HI zyI4cS-OT)sZ#;9wQq7r8MYt!%gaYT#HVM1L(UNdCO74UC#1!)w4nnyzEVy1-;K~`j z%+K7VfOpv)gs)i2-Fak$eMW4k!TnpSxtx2au~p99^!9Oay`n80QkjSXN%3avxr-}z zE#V#&-0_yZ&!#6&{^0t5=5dXf>{(ac|HYc^NGBsXH-jtGxT>h( zcP^sGj+UG~&#>p9B|UQ4h$30>p^4uYxoT6md$%nQOE(4K+!3-NmvbH0L*(!WuBN1~ zmbskP$JQ=WS}u)YBlNT4LlbS+d9vsJd~Cn?-S}*2k;+6gNQwvczgV#P--9?U4DVa6 zpTu&(9Z;%cXZ8ITYClAJHj04d|ntTtUCyhACf1Hw9tc5fVhtyBr_vk@x!h(?A}Wq8dj+ z$VP-s9%?YO|zJe@dcM&y*4sJ4SDtR)Vd~T~lQ$g|kj6M=>QODCT>P^?G;F`dKPb zsZ2zTq`tT9O zveW3S@j|JSnSYkFX|J)G*@!M#@zL%c`ZPwTnQOcF-yr+^!L!P>R+99r{mhB#X}I$J zlH%cgE~^&a_u$#SBX3V;Jsx@~kK8HY^jbbf?zVQSay}hVBQph818~H$ zdWKaV^EgZrtlET(Qz7bFl)rI_fw@HY_%L* z3JIcqJyJafv)(&EyW<#s*RZO{7UeuLLOvrl)ZnV#@_cXBkUwI?`hl^v{xKYcbZ1y_ zrFXU|Pp_h-w`t0I5>G=IN5+`hlV;M~X>aP3ID}=fXHU|}hyt`HiLs%^yNIK&L-6OL zt-6`A2PgqgVPW=Qd$@0ur4~y+LZVKORG`wePL;T~6#eF$*FulXzA26R@DYWw({SbP z2Fl4JoS51*8}QW`|G(0iC)@Uu%7`6ht!TBLA^+1SZ?PnF+nF{(QWkoo5~UL7YD}?G zkuzhxC-adhd)3XijZnNwjj2GTCDax49`D0$`PIN|J(Tw*v{cK-(-8WRF+lnaesYy;`eQ5-#Ox{?9FXt=k30XM1x-GK&#~z zt=KLNds>j|v@1m59WyZJ8han|O4UihtyV|Lq-BOgx zMik154^1v~Xky8d#j+6QQQ>R(ehW4H#%QNXUWDhc+}vH39=LcmqCq*|N5`*tGF%RK zJv9Ft1e-s&|KC!ngvdMSc1k`|WDKNzdLeB~<*oVK3(1BMAXje7Rp$teZ2{d*~w*R`saq*d2fXK#nQIUeACgrD^HS}GSq@)8XPOA~sQ+wJXoT2d{YifEG< z6AGMdEK!z-cT*6;9U(!K{uyb9>=l17WpA3kyU^4eDJll{#HLmO9(5&pXAv;xp{3`+4yxM)_}JFTU@PZ`X_a_ zA94K&*Pn6y1=nA3{SDVoxF)BH$xWnF;5vtE1=kO_4sgB1^+#NP!u4ldf5G)vTz^Bn z@i7t@3H*ZyOkTgee)|i&`J~|kyoT3TaQ%Rb4~BcmU+}>1{4?*b^NuH{@a%v2yY`s) z;0W)6&vPyN^zb<6rmDi^+<63Nz&IsPF1Kq<8pW k5HGR6YGjl;or=_9i7}x-M}O7`@oox2xFaNp*7~^r2QD#qrvLx| diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 4d4d82de..ffd963b8 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -152,20 +152,20 @@ To grant other accounts permission for multiple functions, or for actions that d ## Granting layer access to other accounts -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. +To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. ``` aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ --action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text ``` -You should see the following output: +You should see output similar to the following: ``` e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` -Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. +Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. To grant permission to all accounts in an organization, use the `organization-id` option\. The following example grants all accounts in an organization permission to use version 3 of a layer\. diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index e017d02d..5e13d816 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -34,13 +34,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index e765485d..f531f311 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -38,7 +38,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. ## Function configuration -+ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [AWS CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: ++ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: ``` REPORT RequestId: 3604209a-e9a3-11e6-939a-754dd98c7be3 Duration: 12.34 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 75406a69..1e3b8cc9 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -6,7 +6,7 @@ There are two types of concurrency available: + Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. + Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. -This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see AWS Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. +This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index f1a0a47b..c10ef15a 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -39,7 +39,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy\. 1. Choose **Add**\. **Pricing** -Amazon RDS charges a hourly price for proxies that that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. +Amazon RDS charges a hourly price for proxies that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. Proxy creation takes a few minutes\. When the proxy is available, configure your function to connect to the proxy endpoint instead of the database endpoint\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index ac89a471..f58c1396 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,159 +1,46 @@ -# Lambda layers +# Creating and sharing Lambda layers -You use layers with functions that use \.zip file archives for deployment\. For a function defined as a container image, you package your preferred runtime and all code dependencies when you [create the container image](runtimes-custom.md)\. For more information, see [ Working with Lambda layers and extensions in container images]( https://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. +A Lambda layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can use Lambda layers to share code in your functions\. A *layer* contains code libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. Layers help to reduce your \.zip archive deployment package size, because layers are not included in the deployment package\. +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](lambda-images.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. -A function can use up to five layers at a time\. The total unzipped size of the function and all layers can't exceed the unzipped deployment package size limit of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. - -You can create your own layers, or use layers that AWS or an AWS customer has published\. Layers support [resource\-based policies](#configuration-layers-permissions) for granting layer usage permissions to specific AWS accounts, [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html), or all accounts\. - -You can also use the AWS Serverless Application Model \(AWS SAM\) to manage layers and your function's layer configuration\. For instructions, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. +You can create layers using the Lambda console, the Lambda API, AWS CloudFormation, or the AWS Serverless Application Model \(AWS SAM\)\. For more information about creating layers with AWS SAM, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. **Topics** -+ [Create layers](#configuration-layers-create) -+ [Manage layers](#configuration-layers-manage) -+ [Include library dependencies in a layer](#configuration-layers-path) -+ [Layer permissions](#configuration-layers-permissions) -+ [Configure a function to use layers](#configuration-layers-using) -+ [Add an updated layer version to your function](#configuration-layers-script) -+ [AWS CloudFormation and AWS SAM](#configuration-layers-cloudformation) -+ [Sample applications](#configuration-layers-samples) ++ [Creating layer content](#configuration-layers-upload) ++ [Compiling the \.zip file archive for your layer](#configuration-layers-compile) ++ [Including library dependencies in a layer](#configuration-layers-path) ++ [Creating a layer](#configuration-layers-create) ++ [Deleting a layer version](#configuration-layers-delete) ++ [Configuring layer permissions](#configuration-layers-permissions) ++ [Using AWS CloudFormation with layers](#invocation-layers-cloudformation) -## Create layers +## Creating layer content -When you create a new layer, Lambda creates the layer as version 1\. You can [configure permissions](#configuration-layers-permissions) on an existing layer version, but to make any other changes, you must create a new version\. +When you create a layer, you must bundle all its content into a \.zip file archive\. You upload the \.zip file archive to your layer from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. Lambda extracts the layer contents into the `/opt` directory when setting up the execution environment for the function\. -**To create a layer \(console\)** - -1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. +### Using the AWS CLI -1. Choose **Create layer**\. +You can create and upload a \.zip file for your layer using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) -1. For **Name**, enter a name for your layer\. +## Compiling the \.zip file archive for your layer -1. \(Optional\) For **Description**, enter a description for your layer\. +You build your layer code into a \.zip file archive using the same procedure as you would for a function\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. -1. To upload your layer code, do one of the following: - + To upload a \.zip file from your computer, choose **Upload a \.zip file**, choose your \.zip file, and then choose **Open**\. - + To upload a file from Amazon Simple Storage Service \(Amazon S3\), choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. +One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. -1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. +## Including library dependencies in a layer -1. \(Optional\) For **License**, enter any necessary license information\. +For each [Lambda runtime](lambda-runtimes.md), the PATH variable includes specific folders in the `/opt` directory\. If you define the same folder structure in your layer \.zip file archive, your function code can access the layer content without the need to specify the path\. -1. Choose **Create**\. - -**To create a layer \(API\)** - -To create a layer, use the `publish-layer-version` command with a name, description, \.zip file archive, and a list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional, but it makes the layer easier to discover\. - -``` -aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ ---license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ - --compatible-runtimes python3.6 python3.7 python3.8 -``` - -You should see the following 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 layer", - "CreatedDate": "2018-11-14T23:03:52.894+0000", - "Version": 1, - "LicenseInfo": "MIT", - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8" - ] -} -``` - -Each time that you call `publish-layer-version`, you create a new version of the layer\. - -## Manage layers - - To find layers that are compatible with your Lambda function's runtime, use the `list-layers` command\. - -``` -aws lambda list-layers --compatible-runtime python3.8 -``` - -You should see the following 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", - "python3.8", - ] - } - } - ] -} -``` - -To list all layers, you can omit the runtime option\. The details in the response reflect the latest version of the layer\. See all the versions of a layer with `list-layer-versions`\. To see more information about a version, use `get-layer-version`\. - -``` -aws lambda get-layer-version --layer-name my-layer --version-number 2 -``` - -You should see the following output: - -``` -{ - "Content": { - "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-91e9ea6e-492d-4100-97d5-a4388d442f3f?versionId=GmvPV.309OEpkfN...", - "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:2", - "Description": "My layer", - "CreatedDate": "2018-11-15T00:37:46.592+0000", - "Version": 2, - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8" - ] -} -``` - -The link in the response lets you download the layer archive\. The link is valid for 10 minutes\. - -To delete a layer version, use the `delete-layer-version` command\. - -``` -aws lambda delete-layer-version --layer-name my-layer --version-number 1 -``` - -When you delete a layer version, you can no longer configure functions to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. - -## Include library dependencies in a layer - -Each Lambda runtime adds specific `/opt` directory folders to the PATH variable\. If the layer uses the same folder structure, your function code can access the layer content without the need to specify the path\. - -The following table lists the folder paths that each runtime supports\. +The following table lists the folder paths that each runtime supports\. **Layer paths for each Lambda runtime** @@ -164,7 +51,7 @@ The following examples show how you can structure the folders in your layer \.zi ------ #### [ Node\.js ] -**Example file structure for AWS X\-Ray SDK** +**Example file structure for the AWS X\-Ray SDK for Node\.js** ``` xray-sdk.zip @@ -185,7 +72,7 @@ pillow.zip ------ #### [ Ruby ] -**Example file structure for JSON gem** +**Example file structure for the JSON gem** ``` json.zip @@ -203,7 +90,7 @@ json.zip ------ #### [ Java ] -**Example file structure for Jackson jar file** +**Example file structure for the Jackson JAR file** ``` jackson.zip @@ -213,7 +100,7 @@ jackson.zip ------ #### [ All ] -**Example file structure for JQ library** +**Example file structure for the jq library** ``` jq.zip @@ -224,129 +111,115 @@ jq.zip For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. -## Layer permissions +## Creating a layer -To configure a Lambda function with a layer, you need permission to call `GetLayerVersion` on the layer version\. For functions in your account, you can get this permission from your [user policy](access-control-identity-based.md)\. +You can create new layers using the Lambda console or the Lambda API\. -To use a layer in another account, the owner of the other account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. +Layers can have one or more version\. When you create a layer, Lambda sets the layer version to version 1\. You can configure permissions on an existing layer version, but to update the code or make other configuration changes, you must create a new version of the layer\. -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy with the `add-layer-version-permission` command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. +**To create a layer \(console\)** -``` -aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text -``` +1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. -You should see the following output: +1. Choose **Create layer**\. -``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} -``` +1. Under **Layer configuration**, for **Name**, enter a name for your layer\. -Permissions apply only to a single version of a layer\. Repeat the process each time that you create a new layer version\. +1. \(Optional\) For **Description**, enter a description for your layer\. -For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. +1. To upload your layer code, do one of the following: + + To upload a \.zip file from your computer, choose **Upload a \.zip file**\. Then, choose **Upload** to select your local \.zip file\. + + To upload a file from Amazon S3, choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. -## Configure a function to use layers +1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. -You can specify up to five layers in your Lambda function's configuration, during or after function creation\. You choose a specific version of a layer to use\. If you want to use a different version later, you can update your function's configuration\. +1. \(Optional\) For **License**, enter any necessary license information\. -To add layers to your function, use the `update-function-configuration` command\. The following example adds two layers: one from the same account as the function, and one from a different account\. +1. Choose **Create**\. -``` -aws lambda update-function-configuration --function-name my-function \ ---layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 -``` +**To create a layer \(API\)** -You should see the following output: +To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, and list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional\. ``` -{ - "FunctionName": "test-layers", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", - "CodeSize": 169 - }, - { - "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", - "CodeSize": 169 - } - ], - "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", - ... -} +aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ +--license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ + --compatible-runtimes python3.6 python3.7 python3.8 ``` -You must specify the version of each layer to use by providing the full Amazon Resource Name \(ARN\) of the layer version\. When you add layers to a function that already has layers, the new list overwrites the previous list\. Include all layers every time that you update the layer configuration\. To remove all layers, specify an empty list\. +You should see output similar to the following: ``` -aws lambda update-function-configuration --function-name my-function --layers [] +{ + "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 layer", + "CreatedDate": "2018-11-14T23:03:52.894+0000", + "Version": 1, + "LicenseInfo": "MIT", + "CompatibleRuntimes": [ + "python3.6", + "python3.7", + "python3.8" + ] +} ``` -While your function is running, it can access the content of the layer in the `/opt` directory\. Layers are applied in the order that's specified, merging any folders with the same name\. If the same file appears in multiple layers, the version in the last applied layer is used\. - -The creator of a layer can delete the version of the layer that you're using\. When this happens, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. - -## Add an updated layer version to your function - - Use the `update-function-configuration` command to add an updated layer version to your function\. +**Note** +Each time that you call `publish-layer-version`, you create a new version of the layer\. -The `layers` parameter for this command is a list of all of the layer versions to add to the function\. If the function already has layers, the new list overwrites the previous list\. If you want to update only one of the layer versions, the `layers` parameter needs to include the ARNs of the existing layer versions\. +## Deleting a layer version -The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. +To delete a layer version, use the delete\-layer\-version command\. -**Add an updated layer version to your function** +``` +aws lambda delete-layer-version --layer-name my-layer --version-number 1 +``` -1. \(Optional\) If the new layer version is not published yet, publish the new version\. +When you delete a layer version, you can no longer configure a Lambda function to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. - ``` - aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ - --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 - ``` +## Configuring layer permissions -1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. +By default, a layer that you create is private to your AWS account\. However, you can optionally share the layer with other accounts or make it public\. - ``` - aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml - ``` +To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. - \(Optional\) You can also get the latest version of a layer based on the layer name\. +``` +aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ +--action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +``` - ``` - aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' - ``` +You should see output similar to the following: -1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`\. +``` +e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} +``` - ``` - aws lambda update-function-configuration --function-name my-function \ - --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ - arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 - ``` +Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. -## AWS CloudFormation and AWS SAM +For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. -To automate the creation and mapping of layers in your application, use AWS SAM in your AWS CloudFormation templates\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. +## Using AWS CloudFormation with layers -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** +You can use AWS CloudFormation to create a layer and associate the layer with your Lambda function\. The following example template creates a layer named **blank\-nodejs\-lib** and attaches the layer to the Lambda function using the **Layers** property\. ``` AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. +Description: A Lambda application that calls the Lambda API. Resources: function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs12.x CodeUri: function/. - Description: Call the AWS Lambda API + Description: Call the Lambda API Timeout: 10 # Function's execution role Policies: @@ -357,23 +230,11 @@ Resources: Layers: - !Ref libs libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) + Type: AWS::Serverless::LayerVersion Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. ContentUri: lib/. CompatibleRuntimes: - nodejs12.x -``` - -When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. - -## Sample applications - -The GitHub repository for this guide provides [sample applications](lambda-samples.md) that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) - -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. \ No newline at end of file +``` \ No newline at end of file diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 66353c8d..6e28a97f 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -27,7 +27,7 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. ## \.NET runtime interface clients diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index e43ddef3..8b9a182c 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -6,7 +6,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. From the **File** menu, choose **New**, and then choose **Project**\. - 1. In the **New Project** window, choose **AWS Lambda Project \(\.NET Core\)**, and then choose **OK**\. + 1. In the **New Project** window, choose **Lambda Project \(\.NET Core\)**, and then choose **OK**\. 1. In the **Select Blueprint** window, you can select from a list of sample applications that provide you with sample code to get started with creating a \.NET\-based Lambda application\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index c01fbf94..ea1e1aaa 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 6373c1ff..1cf23be7 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -124,13 +124,13 @@ In this getting started exercise, you use the Docker CLI to create a container i To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index 7d821b6d..e71c6056 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -11,13 +11,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index c5ac3406..79ba9114 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -79,9 +79,17 @@ For more information, see [Lambda runtimes](lambda-runtimes.md)\. ## Layer -A Lambda layer is a \.zip file archive that contains libraries, a [custom runtime](runtimes-custom.md), or other dependencies\. You can use a layer to distribute a dependency to multiple functions\. You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. +A Lambda *layer* is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. -For more information, see [Lambda layers](configuration-layers.md)\. +Layers provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. Layers also promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. + +You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](https://docs.amazonaws.cn/en_us/lambda/latest/dg/gettingstarted-limits.html)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. + +By default, the layers that you create are private to your AWS account\. You can choose to share a layer with other accounts or to make the layer public\. If your functions consume a layer that a different account published, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function or update functions using a deleted layer version\. + +Functions deployed as a container image do not use layers\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. + +For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. ## Extension diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index 787224a9..f48a2107 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -1,6 +1,6 @@ # Lambda deployment packages -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. **Topics** + [Container images](#gettingstarted-package-images) @@ -63,7 +63,7 @@ If you deploy your function code using a \.zip file archive, you can use Lambda You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. -For more information about layers, see [Lambda layers](configuration-layers.md)\. +For more information about layers, see [Creating and sharing Lambda layers](configuration-layers.md)\. ## Using other AWS services to build a deployment package @@ -79,6 +79,6 @@ For more information, see [sam build](https://docs.aws.amazon.com/serverless-app If your deployment package is larger than 50 MB, we recommend uploading your function code and dependencies to an Amazon S3 bucket\. -You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS Command Line Interface \(AWS CLI\)\. +You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS CLI\. To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/go-image.md b/doc_source/go-image.md index b1b2d290..8160dbe6 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -34,9 +34,9 @@ AWS does not provide a separate runtime interface client for Go\. The `aws-lambd ## Using the Go:1\.x base image -For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [AWS Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. +For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. ## Deploying Go with the `provided.al2` base image diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 3db7529a..ee9506f4 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -1,8 +1,8 @@ # Deploy Go Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. To upload your \.zip file on the Lambda console, see [Deployment packages](gettingstarted-package.md)\. +This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. **Topics** + [Prerequisites](#golang-package-prereqs) @@ -10,7 +10,6 @@ This page describes how to create a \.zip file as your deployment package for th + [Sample applications](#golang-package-sample) + [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) + [Creating a \.zip file on Windows](#golang-package-windows) -+ [Creating the Lambda function using the AWS CLI](#golang-package-create) ## Prerequisites @@ -70,6 +69,8 @@ The following steps demonstrate how to download the [lambda](https://github.com/ This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. +1. Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. + 1. Create a deployment package by packaging the executable in a \.zip file\. ``` @@ -115,14 +116,4 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ~\Go\Bin\build-lambda-zip.exe -output main.zip main ``` ------- - -## Creating the Lambda function using the AWS CLI - -Lambda needs to know the [Lambda runtime](lambda-runtimes.md) environment to use for your function's code \(in `runtime`\), a name for your Lambda function \(in `function-name`\), the Lambda handler in your function code \(in `handler`\), and the [execution role](lambda-intro-execution-role.md) it can use to invoke your function \(in `role`\)\. - -Use the [create\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-function.html) command to create the Lambda function\. - -``` -aws lambda create-function --function-name my-function --runtime go1.x --zip-file fileb://function.zip --handler main --role arn:aws:iam::your-account-id:role/execution_role -``` \ No newline at end of file +------ \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index c479b6f0..7822bf4c 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index d44b3c83..deba8173 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -73,7 +73,11 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local **To build the emulator into your image** -1. Create a script and save it in your project directory\. The following example shows a typical script for a Node\.js function\. The presence of the `AWS_LAMBDA_RUNTIME_API` environment variable indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. +1. Create a script and save it in your project directory\. Set execution permissions for the script file\. + + The script checks for the presence of the `AWS_LAMBDA_RUNTIME_API` environment variable, which indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. + + The following example shows a typical script for a Node\.js function\. ``` #!/bin/sh @@ -84,6 +88,17 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local fi ``` + The following example shows a typical script for a Python function\. + + ``` + #!/bin/sh + if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then + exec /usr/local/bin/aws-lambda-rie usr/local/bin/python -m awslambdaric $@ + else + exec usr/local/bin/python -m awslambdaric $@ + fi + ``` + 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. 1. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: @@ -129,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index 42811c25..c45b7949 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -37,7 +37,8 @@ Amazon's trademarks and trade dress may not be used in + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [Lambda layers](configuration-layers.md) + + [Creating and sharing Lambda layers](configuration-layers.md) + + [Using layers with your Lambda function](invocation-layers.md) + [Configuring Lambda function memory](configuration-memory.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md new file mode 100644 index 00000000..98619e6c --- /dev/null +++ b/doc_source/invocation-layers.md @@ -0,0 +1,195 @@ +# Using layers with your Lambda function + +A Lambda layer is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a custom runtime, data, or configuration files\. Use layers to reduce deployment package size and to promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. + +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](lambda-images.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. + +**Topics** ++ [Configuring a function to use layers](#invocation-layers-using) ++ [Accessing the contents of a layer](#invocation-layers-accessing) ++ [Finding layer information](#configuration-layers-finding) ++ [Updating a layer version that your function uses](#invocation-layers-script) ++ [Adding layer permissions](#invocation-layers-permissions) ++ [Using AWS SAM to add a layer to a function](#invocation-layers-cloudformation) ++ [Sample applications](#invocation-layers-samples) + +## Configuring a function to use layers + +A Lambda function can use up to five layers at a time\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. + +If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. + +To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ +arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +``` + +You should see output similar to the following: + +``` +{ + "FunctionName": "test-layers", + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", + "Layers": [ + { + "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", + "CodeSize": 169 + }, + { + "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", + "CodeSize": 169 + } + ], + "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", + ... +} +``` + +To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. Or, to remove all layers, specify an empty list\. + +``` +aws lambda update-function-configuration --function-name my-function --layers [] +``` + +The creator of a layer can delete a version of the layer\. If you're using that layer version in a function, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. + +## Accessing the contents of a layer + +When you include a layer in a Lambda function, Lambda extracts the layer's contents into the `/opt` directory in the function execution environment\. Lambda extracts layers in the order that you specified them, merging any folders with the same name\. If the same file appears in multiple layers, the function uses the version in the last extracted layer\. + +Each [Lambda runtime](lambda-runtimes.md) adds specific `/opt` directory folders to the PATH variable\. Your function code can access the layer content without the need to specify the path\. For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. + +## Finding layer information + +To find layers in your AWS account that are compatible with your Lambda function's runtime, use the list\-layers command\. + +``` +aws lambda list-layers --compatible-runtime python3.8 +``` + +You should see output similar to the following: + +``` +{ + "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", + "python3.8", + ] + } + } + ] +} +``` + +To list all layers in your account, you can omit the `--compatible-runtime` option\. The details in the response reflect the latest version of the layer\. + +You can also get the latest version of a layer using the list\-layer\-versions command\. + +``` +aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn +``` + +## Updating a layer version that your function uses + +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. + +To add an updated layer version to your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to list all of the layer versions that you want to add\. If the function already has layers, the new list overwrites the previous list\. + +To update only one of the layer versions, you must include the ARNs of the existing layer versions with the `--layers` option\. + +The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. + +**Add an updated layer version to your function** + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + +## Adding layer permissions + +To use a Lambda function with a layer, you need permission to call the [GetLayerVersion](API_GetLayerVersion.md) API operation on the layer version\. For functions in your AWS account, you can add this permission from your [user policy](access-control-identity-based.md)\. + +To use a layer in another account, the owner of that account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. + +For examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. + +## Using AWS SAM to add a layer to a function + +To automate the creation and mapping of layers in your application, use the AWS Serverless Application Model \(AWS SAM\)\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. + +**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** + +``` +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) + Properties: + Handler: index.handler + Runtime: nodejs12.x + CodeUri: function/. + Description: Call the AWS Lambda API + Timeout: 10 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambda_ReadOnlyAccess + - AWSXrayWriteOnlyAccess + Tracing: Active + Layers: + - !Ref libs + libs: + Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) + Properties: + LayerName: blank-nodejs-lib + Description: Dependencies for the blank sample app. + ContentUri: lib/. + CompatibleRuntimes: + - nodejs12.x +``` + +When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. + +## Sample applications + +The GitHub repository for this guide provides blank sample applications that demonstrate the use of layers for dependency management\. ++ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) ++ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) ++ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) ++ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) + +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 8e1c2457..7b94916b 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -30,9 +30,9 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/java ## Using a Java base image -For instructions on how to use a Java base image, choose the **usage** tab on [AWS Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. +For instructions on how to use a Java base image, choose the **usage** tab on [Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. +The instructions are also available on [Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. ## Java runtime interface clients diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md index 03935add..c0c3a2a5 100644 --- a/doc_source/java-package-eclipse.md +++ b/doc_source/java-package-eclipse.md @@ -3,7 +3,7 @@ This section shows how to package your Java code into a deployment package using Eclipse IDE and Maven plugin for Eclipse\. **Note** -The AWS SDK Eclipse Toolkit provides an Eclipse plugin for you to both create a deployment package and also upload it to create a Lambda function\. If you can use Eclipse IDE as your development environment, this plugin enables you to author Java code, create and upload a deployment package, and create your Lambda function\. For more information, see the [AWS Toolkit for Eclipse Getting Started Guide](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/)\. For an example of using the toolkit for authoring Lambda functions, see [Using AWS Lambda with the AWS toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda.html)\. +The AWS SDK Eclipse Toolkit provides an Eclipse plugin for you to both create a deployment package and also upload it to create a Lambda function\. If you can use Eclipse IDE as your development environment, this plugin enables you to author Java code, create and upload a deployment package, and create your Lambda function\. For more information, see the [AWS Toolkit for Eclipse Getting Started Guide](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/)\. For an example of using the toolkit for authoring Lambda functions, see [Using Lambda with the AWS toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda.html)\. **Topics** + [Prerequisites](#java-package-eclipse-prereqs) diff --git a/doc_source/java-package.md b/doc_source/java-package.md index bbc574e0..5b41ed3a 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -1,6 +1,6 @@ # Deploy Java Lambda functions with \.zip or JAR file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. This page describes how to create your deployment package as a \.zip file or Jar file, and then use the deployment package to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. @@ -62,7 +62,7 @@ dependencies { To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. **Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Lambda layers](configuration-layers.md)\. +To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 6da3fdad..269149d7 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -114,7 +114,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 35371776..b474f5e5 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -10,6 +10,4 @@ As you add libraries and other dependencies to your function, creating and uploa To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. - -For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. \ No newline at end of file +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index c3e5aa0b..2df01c9f 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -7,7 +7,7 @@ Lambda supports the following Node\.js runtimes\. **Node\.js runtimes** -| Name | Identifier | AWS SDK for JavaScript | Operating system | +| Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | | Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | @@ -58,7 +58,7 @@ You can add permissions to the role later, or swap it out for a different role t The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index aa915f24..158cf7c8 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -42,7 +42,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md index ba58d856..1a30e336 100644 --- a/doc_source/lambda-rolling-deployments.md +++ b/doc_source/lambda-rolling-deployments.md @@ -4,7 +4,7 @@ Use rolling deployments to control the risks associated with introducing new ver You configure a rolling deployment by using AWS CodeDeploy and AWS SAM\. CodeDeploy is a service that automates application deployments to Amazon computing platforms such as Amazon EC2 and AWS Lambda\. For more information, see [What is CodeDeploy?](https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html)\. By using CodeDeploy to deploy your Lambda function, you can easily monitor the status of the deployment and initiate a rollback if you detect any issues\. -AWS SAM is an open\-source framework for building serverless applications\. You create an AWS SAM template \(in YAML format\) to specify the configuration of the components required for the rolling deployment\. AWS SAM uses the template to create and configure the components\. For more information, see [What is the AWS Serverless Application Model?](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\. +AWS SAM is an open\-source framework for building serverless applications\. You create an AWS SAM template \(in YAML format\) to specify the configuration of the components required for the rolling deployment\. AWS SAM uses the template to create and configure the components\. For more information, see [What is the AWS SAM?](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\. In a rolling deployment, AWS SAM performs these tasks: + It configures your Lambda function and creates an alias\. diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 62807c1a..6e6a6a6a 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -7,7 +7,7 @@ Lambda supports the following Ruby runtimes\. **Ruby runtimes** -| Name | Identifier | AWS SDK for Ruby | Operating system | +| Name | Identifier | SDK for Ruby | Operating system | | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | @@ -57,7 +57,7 @@ You can add permissions to the role later, or swap it out for a different role t The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with AWS Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d58ef247..d6936b4a 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,7 +19,7 @@ A runtime can support a single version of a language, multiple versions of a lan **Node\.js runtimes** -| Name | Identifier | AWS SDK for JavaScript | Operating system | +| Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | | Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | | Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | @@ -44,7 +44,7 @@ Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) **Ruby runtimes** -| Name | Identifier | AWS SDK for Ruby | Operating system | +| Name | Identifier | SDK for Ruby | Operating system | | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | | Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index 5d586b61..ec584aa9 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -73,7 +73,7 @@ The following section describes how to view and add reports from CloudWatch Logs 1. \(Optional\) Choose **Save**\. -![\[The AWS CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) +![\[The CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) ## What's next? + Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index 2bbfd1d6..64882488 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -1,11 +1,14 @@ # Deploy Node\.js Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 43c7fc2c..6f2c191a 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -148,7 +148,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index b2faa753..dc71a008 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -95,7 +95,7 @@ The sample code contains standard math and logging Python libraries, which are u ### Create the deployment package -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. Create the \.zip file that Lambda uses as your deployment package\. @@ -265,7 +265,7 @@ You'll learn how to: ### Create the deployment package -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. Create the \.zip file that Lambda uses as your deployment package\. @@ -449,4 +449,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` + ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index f6ba930e..e6ea38a0 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -61,7 +61,7 @@ For more information, see [What is a runtime dependency?](python-package.md#pyth The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with dependencies** @@ -141,7 +141,7 @@ A dependency can be any package, module or other assembly dependency that is not The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. **Note** -If you are creating a deployment package used in a layer, see [Include library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. +If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. **To update a Python function with a virtual environment** diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 743f475e..f507f007 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -3,12 +3,15 @@ **Note** End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 83b40b55..373542ae 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -5,7 +5,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -21,7 +21,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -45,9 +45,9 @@ jsonpickle==1.3 aws-xray-sdk==2.4.3 ``` -To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. +To instrumentAWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing anAWS SDK client** ``` import boto3 @@ -84,7 +84,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -129,7 +129,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index cd066b9e..eebb0309 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -1,11 +1,14 @@ # Deploy Ruby Lambda functions with \.zip file archives -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip files\. +Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. -To create a deployment package, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file must contain your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ The \.zip file must be less than 50 MB\. If it's larger than 50 MB, we recommend uploading it to an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ The \.zip file can't contain libraries written in C or C\+\+\. If your \.zip file contains C\-extension libraries, such as the Pillow \(PIL\) or numpy libraries, we recommend using the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) to build a deployment package\. +To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: ++ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. ++ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. ++ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. + + For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index 2f08c9dd..bf39980b 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -46,9 +46,9 @@ gem 'aws-sdk-lambda', '1.39.0' gem 'test-unit', '3.3.5' ``` -To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. +To instrumentAWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing anAWS SDK client** ``` # lambda_function.rb @@ -83,7 +83,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -128,7 +128,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index d191b0b7..ccba88a3 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -37,6 +37,4 @@ In some cases, advance notice of support ending might not be possible\. For exam + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) - -After ending support for a runtime, Lambda might retire it completely at any time by disabling invocation\. Before retiring a runtime, Lambda sends additional notifications to affected customers\. No runtimes are scheduled for retirement at this time\. \ No newline at end of file ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index bb0ab2f1..c49f6e76 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -9,13 +9,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 38688e57..014a51c7 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -1,6 +1,6 @@ # Blank function sample application for AWS Lambda -The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. +The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and theAWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) @@ -37,7 +37,7 @@ The sample application consists of function code, an AWS CloudFormation template Standard charges apply for each service\. For more information, see [AWS Pricing](https://aws.amazon.com/pricing)\. -The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. +The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with theAWS SDK and passes the response back to the Lambda runtime\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** @@ -64,7 +64,7 @@ var serialize = function(object) { } ``` -The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. +The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code orAWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. @@ -174,7 +174,7 @@ The sample function is configured for tracing with [AWS X\-Ray](https://console. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. -To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. +To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with theAWS SDK to AWS services\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** @@ -186,15 +186,15 @@ const AWS = AWSXRay.captureAWS(require('aws-sdk')) const lambda = new AWS.Lambda() ``` -Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. +Instrumenting theAWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) -The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. +The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for theAWS SDK call to the `GetAccountSettings` API operation\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) -You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. +You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes theAWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 67e825cc..a9eeb6f5 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -72,7 +72,7 @@ The two Node\.js functions are configured for active tracing in the template, an ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) -The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. +The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It usesAWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. ## AWS CloudFormation template and additional resources diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 7225177f..29c48463 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -98,7 +98,7 @@ The application uses [AWS X\-Ray](services-xray.md) to trace function invocation ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) -The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. +The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with anAWS SDK or MySQL client\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 4cc83fe3..49760245 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -18,7 +18,7 @@ We strongly recommend that you never put sensitive identifying information, such ## Encryption in transit -Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console, AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. +Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. When you [connect your function to a file system](configuration-filesystem.md), Lambda uses [Encryption in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) for all connections\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index a1febf9f..3e190953 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -64,13 +64,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index ad0c3815..74c7e746 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -14,7 +14,7 @@ Where *Value* is a positive integer and *Unit* can be minute\(s\), hour\(s\), or | Frequency | Expression | | --- | --- | | Every 5 minutes | `rate(5 minutes)` | -| Every hour | `rate(1 hours)` | +| Every hour | `rate(1 hour)` | | Every seven days | `rate(7 days)` | Cron expressions have the following format\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 194c346a..8416d961 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -15,13 +15,13 @@ For more information about spot instances usage and best practices, see [Spot In To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index bdce5f13..28a100e6 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -27,7 +27,7 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. -You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. +You can also use theAWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions @@ -59,4 +59,4 @@ aws lambda add-permission --action lambda:InvokeFunction --statement-id ec2-even --principal events.amazonaws.com --function-name my-function --source-arn 'arn:aws:events:us-east-2:12456789012:rule/*' ``` -If your function uses the AWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file +If your function uses theAWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 356f6507..048ecc12 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -14,13 +14,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index ec9474d1..2af5cd7b 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -14,13 +14,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 848b668a..08bb31ec 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -57,7 +57,7 @@ In the [resource\-based policy](access-control-resource-based.md) that you creat In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. -If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. +If your function uses theAWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 35da3661..b80cdabb 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -18,7 +18,7 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, enable **Active tracing**\. 1. Choose **Save**\. @@ -74,7 +74,7 @@ For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/l ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a0c24ba6..8c6c8337 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -26,7 +26,7 @@ chmod 755 $(find . -type d) When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. **Note** -When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +When you upload a file directly with the AWS CLI,AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. ## Amazon S3: Error Code PermanentRedirect\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index be5f6ba8..d2138fe1 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -28,7 +28,7 @@ When you add permissions to your function, make an update to its code or configu **Issue: \(Node\.js\)** *Function returns before code finishes executing* -Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. +Many libraries, including theAWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. To wait for the promise to resolve into a response, use the `await` keyword\. This blocks your handler code from executing until the promise is resolved into an object that contains the response\. If you don't need to use the data from the response in your code, you can return the promise directly to the runtime\. @@ -36,11 +36,11 @@ Some libraries don't return promises but can be wrapped in code that does\. For ## AWS SDK: Versions and updates -**Issue:** *The AWS SDK included on the runtime is not the latest version* +**Issue:** *TheAWS SDK included on the runtime is not the latest version* -**Issue:** *The AWS SDK included on the runtime updates automatically* +**Issue:** *TheAWS SDK included on the runtime updates automatically* -Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: +Runtimes for scripting languages include theAWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of theAWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 0ac5dda8..27afc2dc 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -36,7 +36,7 @@ If a function is stuck in the `Pending` state for more than six minutes, call on Lambda cancels the pending operation and puts the function into the `Failed` state\. You can then delete the function and recreate it, or attempt another update\. -## Lambda: One function is using all concurrency +## Lambda: One function is using all concurrency **Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 6e5c559a..23e90de8 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -65,7 +65,7 @@ For a \.zip file archive, you can create an AWS CloudFormation template to simpl You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. -You add the extension to your function using the same method as you would for any layer\. For more information, see [Configure a function to use layers](configuration-layers.md#configuration-layers-using)\. +You add the extension to your function using the same method as you would for any layer\. For more information, see [Using layers with your Lambda function](invocation-layers.md)\. **Add an extension to your function \(console\)** diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 54e8030d..86848848 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -1,39 +1,97 @@ # What is AWS Lambda? -AWS Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. With Lambda, you can run code for virtually any type of application or backend service, all with zero administration\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. +Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. With Lambda, you can run code for virtually any type of application or backend service\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. -You can use Lambda to run your code in response to events, such as changes to data in an Amazon Simple Storage Service \(Amazon S3\) bucket or an Amazon DynamoDB table; to run your code in response to HTTP requests using Amazon API Gateway; or to invoke your code using API calls made using AWS SDKs\. With these capabilities, you can use Lambda to build data processing triggers for AWS services such as Amazon S3 and DynamoDB, process streaming data stored in Amazon Kinesis, or create your own backend that operates at AWS scale, performance, and security\. +**Note** +In the AWS Lambda Developer Guide, we assume that you have experience with coding, compiling, and deploying programs using one of the supported languages\. -You can also build serverless applications composed of functions that are triggered by events, and automatically deploy them using AWS CodePipeline and AWS CodeBuild\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. +You organize your code into [Lambda functions](gettingstarted-concepts.md#gettingstarted-concepts-function)\. Lambda runs your function only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. -For more information about designing, operating, and troubleshooting Lambda\-based applications, see [Introduction](https://docs.aws.amazon.com/lambda/latest/operatorguide/intro.html) in the *Lambda operator guide*\. +You can invoke your Lambda functions using the Lambda API, or Lambda can run your functions in response to events from other AWS services\. For example, you can use Lambda to: ++ Build data\-processing triggers for AWS services such as Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. ++ Process streaming data stored in Amazon Kinesis\. ++ Create your own backend that operates at AWS scale, performance, and security\. -**Topics** -+ [When should I use AWS Lambda?](#when-to-use-cloud-functions) -+ [Are you a first\-time user of AWS Lambda?](#welcome-first-time-user) +Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. -## When should I use AWS Lambda? +## When should I use Lambda? -AWS Lambda is an ideal compute service for many application scenarios, provided that you can run your application code using the Lambda standard runtime environment and within the resources that Lambda provides\. +Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. -When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources\. This is in exchange for flexibility, which means you cannot log in to compute instances, or customize the operating system on provided runtimes\. These constraints enable Lambda to perform operational and administrative activities on your behalf, including provisioning capacity, monitoring fleet health, applying security patches, deploying your code, and monitoring and logging your Lambda functions\. +When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. -If you need to manage your own compute resources, AWS also offers other compute services to meet your needs\. For example: -+ Amazon Elastic Compute Cloud \(Amazon EC2\) offers flexibility and a wide range of EC2 instance types to choose from\. It gives you the option to customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. +If you need to manage your own compute resources, AWS has other compute services to meet your needs\. For example: ++ Amazon Elastic Compute Cloud \(Amazon EC2\) offers a wide range of EC2 instance types to choose from\. It lets you customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. + AWS Elastic Beanstalk enables you to deploy and scale applications onto Amazon EC2\. You retain ownership and full control over the underlying EC2 instances\. -Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. +## Lambda features + +The following key features help you develop Lambda applications that are scalable, secure, and easily extensible: + +**Concurrency controls** +[Concurrency limits and provisioned concurrency](invocation-scaling.md) give you fine\-grained control over the scaling and responsiveness of your production applications\. + +**Functions defined as container images** +Use your preferred [container image](lambda-images.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. + +**Code signing ** +[Code signing](configuration-codesigning.md) for Lambda provides trust and integrity controls that let you verify that only unaltered code that approved developers have published is deployed in your Lambda functions\. + +**Lambda extensions** +You can use [Lambda extensions](runtimes-extensions-api.md) to augment your Lambda functions\. For example, use extensions to more easily integrate Lambda with your favorite tools for monitoring, observability, security, and governance\. + +**Function blueprints** +A function blueprint provides sample code that shows how to use Lambda with other AWS services or third\-party applications\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. + +**Database access** +A [database proxy](configuration-database.md) manages a pool of database connections and relays queries from a function\. This enables a function to reach high concurrency levels without exhausting database connections\. + +**File systems access** +You can configure a function to mount an [Amazon Elastic File System \(Amazon EFS\) file system](configuration-filesystem.md) to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. + +## Getting started with Lambda + +To work effectively with Lambda, you need coding experience and expertise in the following domains: ++ Linux OS and commands, as well as concepts such as processes, threads, and file permissions\. ++ Cloud concepts and IP networking concepts \(for public and private networks\)\. ++ Distributed computing concepts such as HTML as an IPC, queues, messaging, notifications, and concurrency\. ++ Familiarity with security services and concepts: AWS Identity and Access Management \(IAM\) and access control principles, and AWS Key Management Service \(AWS KMS\) and public key infrastructure\. ++ Familiarity with key services that interact with Lambda: Amazon API Gateway, Amazon S3, Amazon Simple Queue Service \(Amazon SQS\), and DynamoDB\. ++ Configuring EC2 instances with Linux\. + +If you are a first\-time user of Lambda, we recommend that you start with the following topics to help you learn the basics: + +1. **Read the [Lambda product overview](http://aws.amazon.com/lambda/) and explore the [Lambda getting started](http://aws.amazon.com/lambda/getting-started/) page\.** + +1. **To create and test a Lambda function using the Lambda console, try the [console\-based getting started exercise](getting-started.md)\.** This exercise teaches you about the Lambda programming model and other concepts\. + +1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](getting-started-create-function.md#gettingstarted-images)\.** + + AWS also provides the following resources for learning about serverless applications and Lambda: ++ The [AWS Compute Blog](http://aws.amazon.com/blogs/compute/ ) includes useful articles about Lambda\. ++ [AWS Serverless](https://serverlessland.com/) provides blogs, videos, and training related to AWS serverless development\. ++ The [AWS Online Tech Talks](https://www.youtube.com/channel/UCT-nPlVzJI-ccQXlxjSvJmw) YouTube channel includes videos about Lambda\-related topics\. For an overview of serverless applications and Lambda, see the [Introduction to AWS Lambda & Serverless Applications](https://www.youtube.com/watch?v=EBSdyoO3goc) video\. + +## Related services -## Are you a first\-time user of AWS Lambda? +[Lambda integrates with other AWS services](lambda-services.md) to invoke functions based on events that you specify\. For example: ++ Use [API Gateway](services-apigateway.md) to provide a secure and scalable gateway for web APIs that route HTTP requests to Lambda functions\. ++ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), have Lambda read data from the services, create an event, and invoke your function to process the event\. ++ Define [Amazon S3](with-s3.md) events that invoke a Lambda function to process Amazon S3 objects, for example, when an object is created or deleted\. ++ Use a Lambda function to process [Amazon SQS](with-sqs.md) messages or [Amazon Simple Notification Service \(Amazon SNS\)](with-sns.md) notifications\. ++ Use [AWS Step Functions](lambda-stepfunctions.md) to connect Lambda functions together into serverless workflows called state machines\. -If you are a first\-time user of AWS Lambda, we recommend that you review the following in order: +## Accessing Lambda -1. **Read the product overview and watch the introductory video on the [AWS Lambda webpage](http://aws.amazon.com/lambda/)\.** +You can create, invoke, and manage your Lambda functions using any of the following interfaces: ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. ++ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. ++ **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. ++ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. ++ **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. -1. **Try the console\-based getting started exercise\.** This exercise guides you through creating and testing a Lambda function using the AWS Management Console\. You also learn about the programming model and other Lambda concepts\. For instructions, see [Getting started with Lambda](getting-started.md)\. -1. **Try the getting started exercise for container images\.** This exercise guides you through creating and testing a Lambda function defined as a container image\. For instructions, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. -1. **Read about deploying applications with Lambda\.** The [AWS Lambda applications](deploying-lambda-apps.md) section of this guide introduces various Lambda components that you work with to create an end\-to\-end experience\. +## Pricing for Lambda -Beyond the getting started exercises, you can also explore the various use cases, each of which includes a tutorial that walks you through an example scenario\. Depending on your application needs \(for example, whether you want event\-driven Lambda function invocation or on\-demand invocation\), you can follow tutorials that meet your specific needs\. For more information on the various use cases, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file +There is no additional charge for creating Lambda functions\. There are charges for running a function and for data transfer between Lambda and other AWS services\. Some optional Lambda features \(such as [provisioned concurrency](configuration-concurrency.md)\) also incur charges\. For more information, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 2c2cb972..b0312a74 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -13,13 +13,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 7c711bb4..d4413760 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -9,13 +9,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index ff9e2917..0287e764 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,7 +79,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -515,9 +515,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl ``` { - "BatchItemFailures": [ + "batchItemFailures": [ { - "ItemIdentifier": "" + "itemIdentifier": "" } ] } diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 6e39e0bb..36f9a21e 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -17,13 +17,13 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: ``` -this is a command +aws --version ``` You should see the following output: ``` -this is output +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 ``` For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index b1e09fd7..783c19fc 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -59,7 +59,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -464,9 +464,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl ``` { - "BatchItemFailures": [ + "batchItemFailures": [ { - "ItemIdentifier": "" + "itemIdentifier": "" } ] } @@ -541,7 +541,7 @@ public class ProcessKinesisRecords implements RequestHandler Date: Mon, 3 May 2021 20:09:14 +0300 Subject: [PATCH 096/243] #276 - Add error handling for function callLambda call in init. --- sample-apps/blank-go/function/main.go | 83 ++++++++++++++------------- 1 file changed, 43 insertions(+), 40 deletions(-) diff --git a/sample-apps/blank-go/function/main.go b/sample-apps/blank-go/function/main.go index fb45d288..bc1a5c3d 100644 --- a/sample-apps/blank-go/function/main.go +++ b/sample-apps/blank-go/function/main.go @@ -1,57 +1,60 @@ package main import ( - "os" - "log" - "context" - "encoding/json" - runtime "github.com/aws/aws-lambda-go/lambda" - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambdacontext" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/lambda" + "context" + "encoding/json" + "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" + "github.com/aws/aws-lambda-go/lambdacontext" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/lambda" + "log" + "os" ) var client = lambda.New(session.New()) func init() { - callLambda() + _, err := callLambda() + if err != nil { + log.Printf("ERROR calling GetAccountSettings API: %s", err) + } } func callLambda() (string, error) { - input := &lambda.GetAccountSettingsInput{} - req, resp := client.GetAccountSettingsRequest(input) - err := req.Send() - output, _ := json.Marshal(resp.AccountUsage) - return string(output), err + input := &lambda.GetAccountSettingsInput{} + req, resp := client.GetAccountSettingsRequest(input) + err := req.Send() + output, _ := json.Marshal(resp.AccountUsage) + return string(output), err } func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { - // event - eventJson, _ := json.MarshalIndent(event, "", " ") - log.Printf("EVENT: %s", eventJson) - // environment variables - log.Printf("REGION: %s", os.Getenv("AWS_REGION")) - log.Println("ALL ENV VARS:") - for _, element := range os.Environ() { - log.Println(element) - } - // request context - lc, _ := lambdacontext.FromContext(ctx) - log.Printf("REQUEST ID: %s", lc.AwsRequestID) - // global variable - log.Printf("FUNCTION NAME: %s", lambdacontext.FunctionName) - // context method - deadline, _ := ctx.Deadline() - log.Printf("DEADLINE: %s", deadline) - // AWS SDK call - usage, err := callLambda() - if err != nil { - return "ERROR", err - } - return usage, nil + // event + eventJson, _ := json.MarshalIndent(event, "", " ") + log.Printf("EVENT: %s", eventJson) + // environment variables + log.Printf("REGION: %s", os.Getenv("AWS_REGION")) + log.Println("ALL ENV VARS:") + for _, element := range os.Environ() { + log.Println(element) + } + // request context + lc, _ := lambdacontext.FromContext(ctx) + log.Printf("REQUEST ID: %s", lc.AwsRequestID) + // global variable + log.Printf("FUNCTION NAME: %s", lambdacontext.FunctionName) + // context method + deadline, _ := ctx.Deadline() + log.Printf("DEADLINE: %s", deadline) + // AWS SDK call + usage, err := callLambda() + if err != nil { + return "ERROR", err + } + return usage, nil } func main() { - runtime.Start(handleRequest) -} \ No newline at end of file + runtime.Start(handleRequest) +} From 016de409939cb0d99327895b40a5090dd6c350cd Mon Sep 17 00:00:00 2001 From: gytisrepecka Date: Mon, 3 May 2021 20:23:27 +0300 Subject: [PATCH 097/243] #276 - Remove callLambda within init function as it does not return anything. Function callLambda is still called from handleRequest which is expected to return string and error - no need to query GetAccountSettings API twice. --- sample-apps/blank-go/function/main.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sample-apps/blank-go/function/main.go b/sample-apps/blank-go/function/main.go index bc1a5c3d..04d89f09 100644 --- a/sample-apps/blank-go/function/main.go +++ b/sample-apps/blank-go/function/main.go @@ -14,13 +14,6 @@ import ( var client = lambda.New(session.New()) -func init() { - _, err := callLambda() - if err != nil { - log.Printf("ERROR calling GetAccountSettings API: %s", err) - } -} - func callLambda() (string, error) { input := &lambda.GetAccountSettingsInput{} req, resp := client.GetAccountSettingsRequest(input) From 097f8fc10c803be2aabd6b0ba08e1f9882fc6e4c Mon Sep 17 00:00:00 2001 From: gytisrepecka Date: Mon, 3 May 2021 20:26:21 +0300 Subject: [PATCH 098/243] #276 - Fix element name to FunctionCount in error message to avoid misleading notice. --- sample-apps/blank-go/function/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-go/function/main_test.go b/sample-apps/blank-go/function/main_test.go index bf192bd6..277a3cf6 100644 --- a/sample-apps/blank-go/function/main_test.go +++ b/sample-apps/blank-go/function/main_test.go @@ -33,7 +33,7 @@ func TestMain(t *testing.T) { } t.Log(result) if !strings.Contains(result, "FunctionCount") { - t.Errorf("Output does not contain FunctionCode.") + t.Errorf("Output does not contain FunctionCount.") } } func ReadJSONFromFile(t *testing.T, inputFile string) []byte { From d9c31dccca17a0dbfa5d6f7e515a1d3099a9a92f Mon Sep 17 00:00:00 2001 From: nickcox Date: Tue, 4 May 2021 18:43:11 +1000 Subject: [PATCH 099/243] Update Nodejs example to forward CMD arguments The nodejs example doesn't seem to work as given. Shouldn't it forward the handler argument from CMD as with the Python example? --- doc_source/images-test.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index deba8173..74d6a73a 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric + exec /usr/bin/npx aws-lambda-ric $@ fi ``` @@ -144,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 377fd133dc67d97aeffc022f8eaed06acb7edbf1 Mon Sep 17 00:00:00 2001 From: Daniel Garces Date: Fri, 7 May 2021 15:46:00 -0400 Subject: [PATCH 100/243] Update README.md to reference correct filename of cleanup script README.md currently references ./8-cleanup.sh in order to run the cleanup script. This file currently exists in the repo as 7-cleanup.sh --- sample-apps/rds-mysql/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index c1d82810..c29f1a7f 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -138,4 +138,4 @@ For more information, see [Configuring database access](https://docs.aws.amazon. To delete the application, run the cleanup script. - rds-mysql$ ./8-cleanup.sh + rds-mysql$ ./7-cleanup.sh From 3cf6c95fe44ee304ce96826b9cab656b32433598 Mon Sep 17 00:00:00 2001 From: Mirek Svoboda <7804468+GoodMirek@users.noreply.github.com> Date: Mon, 24 May 2021 21:42:16 +0200 Subject: [PATCH 101/243] Add VPC endpoints as alternative to NAT gateway Error messages in Lambda console indicate that it is possible to use AWS VPC Endpoints for LAmbda and STS services, instead of NAT gateway. It indeed works, but this alternative was not documented so far. --- doc_source/services-msk-topic-add.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 87d49a38..94d769a9 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -12,6 +12,7 @@ This section describes how to add your Kafka cluster and topic as a function tri To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: + Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. ++ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services. Your Amazon VPC security groups must be configured with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. @@ -56,4 +57,4 @@ The following example uses the [https://awscli.amazonaws.com/v2/documentation/ap ``` aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file +``` From 3cc2149acd68f8497998312af2307b9c834858b7 Mon Sep 17 00:00:00 2001 From: Mirek Svoboda Date: Tue, 25 May 2021 08:04:58 +0200 Subject: [PATCH 102/243] Add VPC endpoint for Secrets Manager if authentication is required --- doc_source/services-msk-topic-add.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md index 94d769a9..62f8eb85 100644 --- a/doc_source/services-msk-topic-add.md +++ b/doc_source/services-msk-topic-add.md @@ -12,7 +12,7 @@ This section describes how to add your Kafka cluster and topic as a function tri To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: + Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services. ++ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services\. If authentication is required, then deploy also VPC Endpoint for Secrets Manager\. Your Amazon VPC security groups must be configured with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. From 746224008a1677657ae0b6e8e69308d20be1b3ab Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 3 Jun 2021 09:27:41 -0700 Subject: [PATCH 103/243] periodic update of documentation fixes --- doc_source/best-practices.md | 2 +- doc_source/configuration-aliases.md | 6 +- doc_source/configuration-concurrency.md | 6 +- doc_source/configuration-database.md | 1 + doc_source/configuration-vpc.md | 4 +- doc_source/csharp-tracing.md | 2 +- doc_source/deploying-lambda-apps.md | 2 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-limits.md | 6 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 35 ++- doc_source/images-test.md | 10 +- doc_source/index.md | 15 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-images.md | 4 +- doc_source/invocation-scaling.md | 2 +- doc_source/java-tracing.md | 4 +- doc_source/kafka-hosting.md | 29 -- doc_source/kafka-smaa.md | 9 - doc_source/kafka-using-cluster.md | 56 ---- doc_source/lambda-csharp.md | 10 +- doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-kafka.md | 13 - doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-releases.md | 14 +- doc_source/lambda-runtimes.md | 19 +- doc_source/lambda-services.md | 2 +- doc_source/monitoring-insights.md | 2 +- doc_source/msk-permissions.md | 42 --- doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-package.md | 2 +- doc_source/nodejs-tracing.md | 4 +- doc_source/powershell-handler.md | 2 +- doc_source/python-package-create.md | 24 +- doc_source/python-package.md | 2 +- doc_source/python-tracing.md | 10 +- doc_source/ruby-package.md | 2 +- doc_source/ruby-tracing.md | 10 +- doc_source/runtime-support-policy.md | 13 +- doc_source/runtimes-api.md | 130 +++++++-- doc_source/runtimes-context.md | 2 +- doc_source/runtimes-extensions-api.md | 117 +++++--- doc_source/runtimes-logs-api.md | 294 ++++++++++++-------- doc_source/samples-blank.md | 14 +- doc_source/samples-errorprocessor.md | 2 +- doc_source/samples-listmanager.md | 2 +- doc_source/services-cognito.md | 2 +- doc_source/services-ec2-tutorial.md | 2 +- doc_source/services-ec2.md | 4 +- doc_source/services-iotevents.md | 3 +- doc_source/services-msk-topic-add.md | 59 ---- doc_source/services-s3-batch.md | 2 +- doc_source/services-smaa-topic-add.md | 57 ---- doc_source/services-xray.md | 10 +- doc_source/smaa-permissions.md | 81 ------ doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 8 +- doc_source/using-extensions.md | 10 +- doc_source/welcome.md | 16 +- doc_source/with-kafka.md | 237 ++++++++++++++++ doc_source/with-mq.md | 6 +- doc_source/with-msk.md | 114 +++++++- doc_source/with-s3.md | 2 +- doc_source/with-sqs.md | 4 +- 66 files changed, 900 insertions(+), 670 deletions(-) delete mode 100644 doc_source/kafka-hosting.md delete mode 100644 doc_source/kafka-smaa.md delete mode 100644 doc_source/kafka-using-cluster.md delete mode 100644 doc_source/lambda-kafka.md delete mode 100644 doc_source/msk-permissions.md delete mode 100644 doc_source/services-msk-topic-add.md delete mode 100644 doc_source/services-smaa-topic-add.md delete mode 100644 doc_source/smaa-permissions.md create mode 100644 doc_source/with-kafka.md diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index f531f311..8ee37b62 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -48,7 +48,7 @@ For more information about best practices for Lambda applications, see [Applicat **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. - To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [Creating faster AWS Lambda functions with AVX2](https://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/ompute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. + **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 9af84539..769e0491 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -35,19 +35,19 @@ You can create a function alias using the Lambda console\. ## Managing aliases with the Lambda API -To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-alias.html) command\. +To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html) command\. ``` aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " ``` -To change an alias to point a new version of the function, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-alias.html) command\. +To change an alias to point a new version of the function, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html) command\. ``` aws lambda update-alias --function-name my-function --name alias-name --function-version version-number ``` -To delete an alias, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-alias.html) command\. +To delete an alias, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html) command\. ``` aws lambda delete-alias --function-name my-function --name alias-name diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 1e3b8cc9..f1cfbbbb 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -2,9 +2,9 @@ Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. -There are two types of concurrency available: -+ Reserved concurrency – Reserved concurrency creates a pool of requests that can only be used by its function, and also prevents its function from using unreserved concurrency\. -+ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond to your function's invocations\. +There are two types of concurrency controls available: ++ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md index c10ef15a..b7a76747 100644 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -75,6 +75,7 @@ exports.handler = async (event) => { var query = event.query var result connection.connect() +} ``` For more information, see [IAM database authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the Amazon RDS User Guide\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index c05e249b..13f14522 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,11 +2,11 @@ You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources while the function is running\. -When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each subnet in your function's VPC configuration\. This process can take about a minute\. +When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each subnet in your function's VPC configuration\. This process can take several minutes\. While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. -Multiple functions connected to the same subnets share network interfaces\. Connecting additional functions to a subnet that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. +Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to a subnet that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index ea1e1aaa..bae18fb8 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 19cd514e..9e76814a 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -8,7 +8,7 @@ The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverle The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. -When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [What are connections?](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. +When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [ What are connections?](https://docs.aws.amazon.com/connect/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 79ba9114..91685abf 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -83,7 +83,7 @@ A Lambda *layer* is a \.zip file archive that can contain additional code or oth Layers provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. Layers also promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](https://docs.amazonaws.cn/en_us/lambda/latest/dg/gettingstarted-limits.html)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. +You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](gettingstarted-limits.md)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. By default, the layers that you create are private to your AWS account\. You can choose to share a layer with other accounts or to make the layer public\. If your functions consume a layer that a different account published, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function or update functions using a deleted layer version\. diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index a40b35da..709727ba 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -95,7 +95,7 @@ For more information, see [Configuring destinations for asynchronous invocation] When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. -Blueprints are provided for use under the [Amazon Software License](https://aws.amazon.com/asl/)\. They are available only in the Lambda console\. +Blueprints are provided for use under the [Amazon Software License](http://aws.amazon.com/asl/)\. They are available only in the Lambda console\. ## Testing and deployment tools diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 2af77154..b2821df3 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -6,8 +6,8 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Resource | Default quota | Can be increased up to | | --- | --- | --- | | Concurrent executions | 1,000 | Hundreds of thousands | -| Function and layer storage \(\.zip file archives\) | 75 GB | Terabytes | -| Function storage \(container images\) | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. @@ -24,7 +24,7 @@ The following quotas apply to function configuration, deployments, and execution | Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\), 512 KB maximum for an individual file | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | | [Container image](lambda-images.md) code package size | 10 GB | | Test events \(console editor\) | 10 | | `/tmp` directory storage | 512 MB | diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 7822bf4c..94755a2a 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 9b67b93f..10f34f47 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -8,6 +8,8 @@ You can also use an alternative base image from another container registry\. Lam For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. +After you create a container image in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + **Topics** + [Image types](#images-types) + [Container tools](#images-tools) @@ -83,7 +85,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. On your local machine, create a project directory for your new function\. -1. Create an app directory in the project directory, and then add your function handler code to the app directory\. +1. Create a directory named **app** in in the project directory, and then add your function handler code to the app directory\. 1. Use a text editor to create a new Dockerfile\. @@ -91,13 +93,14 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do + LAMBDA\_TASK\_ROOT=/var/task + LAMBDA\_RUNTIME\_DIR=/var/runtime - The following shows an example Dockerfile for Node\.js version 12\. : + The following shows an example Dockerfile for Node\.js version 14\. : ``` - FROM public.ecr.aws/lambda/nodejs:12 + FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - COPY app.js package.json /var/task/ + # Assumes your function is named "app.js", and there is a package.json file in the app directory. + COPY app.js package.json /var/task/ # Install NPM dependencies for function RUN npm install @@ -112,6 +115,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker build -t hello-world . ``` +1. Start the Docker image with the `docker run` command\. For this example, enter `hello-world` as the image name\. + + ``` + docker run -p 9000:8080 hello-world + ``` + 1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. From a new terminal window, post an event to the following endpoint using a `curl` command: ``` @@ -126,6 +135,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + 1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` @@ -133,6 +148,8 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + ## Create an image from an alternative base image **Prerequisites** @@ -146,7 +163,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do 1. On your local machine, create a project directory for your new function\. -1. Create an app directory in the project directory, and then add your function handler code to the app directory\. +1. Create a directory named **app** in the project directory, and then add your function handler code to the app directory\. 1. Use a text editor to create a new Dockerfile with the following configuration: + Set the `FROM` property to the URI of the base image\. @@ -213,6 +230,12 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com ``` +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + 1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. ``` @@ -220,6 +243,8 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + ## Create an image using the AWS SAM toolkit You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create and deploy a function defined as a container image\. For a new project, you can use the AWS SAM CLI `init` command to set up the scaffolding for your project in your preferred runtime\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index deba8173..5f278440 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric + exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric + exec /usr/bin/npx aws-lambda-ric $@ fi ``` @@ -93,9 +93,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie usr/local/bin/python -m awslambdaric $@ + exec /usr/local/bin/aws-lambda-rie /usr/local/bin/python -m awslambdaric $@ else - exec usr/local/bin/python -m awslambdaric $@ + exec /usr/local/bin/python -m awslambdaric $@ fi ``` @@ -132,7 +132,7 @@ You install the runtime interface emulator to your local machine\. When you run ``` docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ - --entrypoint /aws-lambda/aws-lambda-rie myfunction:latest \ + --entrypoint /aws-lambda/aws-lambda-rie hello-world:latest \ <(optional) image command> ``` diff --git a/doc_source/index.md b/doc_source/index.md index c45b7949..7a2b41ed 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -1,7 +1,7 @@ # AWS Lambda Developer Guide ----- -*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** +*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** ----- Amazon's trademarks and trade dress may not be used in @@ -70,8 +70,8 @@ Amazon's trademarks and trade dress may not be used in + [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) + [Lambda Extensions API](runtimes-extensions-api.md) + + [Lambda Logs API](runtimes-logs-api.md) + [Modifying the runtime environment](runtimes-modify.md) - + [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) @@ -112,6 +112,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Amazon EFS with Lambda](services-efs.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + + [Using Lambda with an Apache Kafka cluster](with-kafka.md) + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) @@ -119,6 +120,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + [Using AWS Lambda with Amazon Lex](services-lex.md) + [Using Lambda with Amazon MQ](with-mq.md) + + [Using Lambda with Amazon MSK](with-msk.md) + [Using AWS Lambda with Amazon RDS](services-rds.md) + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + [Using AWS Lambda with Amazon S3](with-s3.md) @@ -139,15 +141,6 @@ Amazon's trademarks and trade dress may not be used in + [State machine application patterns](stepfunctions-patterns.md) + [Managing state machines in the Lambda console](stepfunctions-lc.md) + [Orchestration examples with Step Functions](services-stepfunctions.md) -+ [Using Lambda with an Apache Kafka cluster](lambda-kafka.md) - + [Hosting an Apache Kafka cluster](kafka-hosting.md) - + [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) - + [Using Lambda with Amazon MSK](with-msk.md) - + [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) - + [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) - + [Using Lambda with self-managed Apache Kafka](kafka-smaa.md) - + [Managing access and permissions for a self-managed Apache Kafka cluster](smaa-permissions.md) - + [Adding a self-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 285b7ef7..15a739c4 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index 5059ae08..b0027372 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -19,7 +19,9 @@ You can use the Lambda API to get information about a function's state\. For mor ## Invoking the function -When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda calls the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. +When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda initializes any [extensions](using-extensions.md#invocation-extensions-images) and then runs the function’s initialization code \(the code outside the main handler\)\. Note that function initialization duration is included in billed execution time\. + +Lambda then runs the function by calling the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. ## Image security diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index ef5329f2..38f3c55d 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,7 +2,7 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. - Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. + Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. **Burst concurrency quotas** + **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 269149d7..410d2902 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -114,7 +114,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. diff --git a/doc_source/kafka-hosting.md b/doc_source/kafka-hosting.md deleted file mode 100644 index 096de4b5..00000000 --- a/doc_source/kafka-hosting.md +++ /dev/null @@ -1,29 +0,0 @@ -# Hosting an Apache Kafka cluster - -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. - -This page describes the AWS and non\-AWS hosting options available for using your Kafka cluster as an for your Lambda function\. - -## Using a non\-AWS provider - -To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. - -When you create a Kafka cluster using a non\-AWS provider, you receive the connection information for your cluster\. This information includes the Kafka cluster hostname, topic name, Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) user name and password, and bootstrap server host\-port pairs\. - -For more information about using a non\-AWS hosted Apache Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. - -## Using Amazon MSK - -To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. - -When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. - -To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. - -For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. - -## Using other AWS hosting options - -You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. - -For more information about using an AWS hosted Apache Kafka cluster on another AWS service, such as Amazon Elastic Compute Cloud \(Amazon EC2\), see [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md)\. \ No newline at end of file diff --git a/doc_source/kafka-smaa.md b/doc_source/kafka-smaa.md deleted file mode 100644 index df8fc0ed..00000000 --- a/doc_source/kafka-smaa.md +++ /dev/null @@ -1,9 +0,0 @@ -# Using Lambda with self\-managed Apache Kafka - -You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. - -This section describes how to use a function with a self\-managed Kafka cluster to process records in an Kafka topic\. - -**Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md) -+ [Adding a self\-managed Apache Kafka cluster as an event source](services-smaa-topic-add.md) \ No newline at end of file diff --git a/doc_source/kafka-using-cluster.md b/doc_source/kafka-using-cluster.md deleted file mode 100644 index 61272809..00000000 --- a/doc_source/kafka-using-cluster.md +++ /dev/null @@ -1,56 +0,0 @@ -# Using an Apache Kafka cluster as an event source for Lambda - - - -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. - -This page describes how to use your Kafka cluster as an event source for your Lambda function\. - -## Prerequisites -+ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster -+ A [Lambda execution role](lambda-intro-execution-role.md) - -## How it works - - - -When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. -+ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. -+ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. -+ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -+ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -+ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. - -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. - -## Event source API operations - -When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. - -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -## Event source mapping errors - -When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. - -To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: - -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. - -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda couldn't authenticate the event source\. - -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda doesn't have the required permissions to access the event source\. - -**`FUNCTION_CONFIG_NOT_VALID`** -The Lambda function configuration is not valid\. - -**Note** -If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. \ No newline at end of file diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 407b533d..82c2db32 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -27,9 +27,13 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | **Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -[ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. +For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. + +To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. + +**Sample Lambda applications in C\#** ++ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. ++ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** + [AWS Lambda function handler in C\#](csharp-handler.md) diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index c738417e..525bb027 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -146,7 +146,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-kafka.md b/doc_source/lambda-kafka.md deleted file mode 100644 index 0cb6ab64..00000000 --- a/doc_source/lambda-kafka.md +++ /dev/null @@ -1,13 +0,0 @@ -# Using Lambda with an Apache Kafka cluster - -[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. - -Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. - -This section describes how to use an AWS or non\-AWS hosted Kafka cluster with Lambda\. - -**Topics** -+ [Hosting an Apache Kafka cluster](kafka-hosting.md) -+ [Using an Apache Kafka cluster as an event source for Lambda](kafka-using-cluster.md) -+ [Using Lambda with Amazon MSK](with-msk.md) -+ [Using Lambda with self\-managed Apache Kafka](kafka-smaa.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 2df01c9f..6cb32e93 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 158cf7c8..7c5c94ce 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | **To create a Python function** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index d5b2158b..fbe5224f 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -17,12 +17,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | -| [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | +| [CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [Support for \.NET Core 3\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | -| [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](https://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | +| [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | | [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | @@ -49,12 +49,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | -| [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. For details, see [AWS GovCloud \(US\-East\) now open](https://aws.amazon.com/blogs/aws/aws-govcloud-us-east-now-open/?icmpid=docs_lambda_rss) on the AWS blog\. | November 12, 2018 | -| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [ GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | +| [Moved SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | -| [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | -| [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | +| [Support for PowerShell Core language in ](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | +| [Support for \.NET Core 2\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | | [Support for Amazon SQS as event source](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Amazon Simple Queue Service \(Amazon SQS\) as an event source\. For more information, see [Invoking Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss)\. | June 28, 2018 | | [China \(Ningxia\) Region](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the China \(Ningxia\) Region\. For more information about Lambda Regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html?icmpid=docs_lambda_rss) in the *AWS General Reference*\. | June 28, 2018 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d6936b4a..d94696dc 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.804\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.804\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.16\.31 botocore\-1\.19\.31 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.16\.31 botocore\-1\.19\.32 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -76,6 +76,9 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +**Note** +For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. + To use other languages in Lambda, you can implement a [custom runtime](runtimes-custom.md)\. The Lambda execution environment provides a [runtime interface](runtimes-api.md) for getting invocation events and sending responses\. You can deploy a custom runtime alongside your function code, or in a [layer](configuration-layers.md)\. @@ -92,8 +95,8 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Runtime support for Lambda container images](runtimes-images.md) + [AWS Lambda runtime API](runtimes-api.md) + [Lambda Extensions API](runtimes-extensions-api.md) ++ [Lambda Logs API](runtimes-logs-api.md) + [Modifying the runtime environment](runtimes-modify.md) -+ [AWS Lambda Logs API](runtimes-logs-api.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 5bac8e85..601fb137 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](kafka-smaa.md) ++ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index d8dead06..95336612 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -49,7 +49,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/msk-permissions.md b/doc_source/msk-permissions.md deleted file mode 100644 index 403f7af9..00000000 --- a/doc_source/msk-permissions.md +++ /dev/null @@ -1,42 +0,0 @@ -# Managing access and permissions for an Amazon MSK cluster - -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. - -This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. - -## Required Lambda function permissions - -To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -## Adding a policy to your execution role - -Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. - -**To add an AWS managed policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. - -1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. - -1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. - -1. Select your execution role from the list, and then choose **Attach policy**\. - -## Granting users access with an IAM policy - -By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -## Using SASL/SCRAM authentication - -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 406c5f25..2ff4c530 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -33,7 +33,7 @@ If your code performs an asynchronous task, return a promise to make sure that i ``` const https = require('https') -let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" +let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" exports.handler = async function(event) { const promise = new Promise(function(resolve, reject) { diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index 64882488..d04db7f6 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -8,7 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 6f2c191a..e3ab82dc 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -148,7 +148,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index 2e5e7c32..a9827dd4 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://aws.amazon.com/documentation/powershell/?id=docs_gateway)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://docs.aws.amazon.com/documentation/powershell/?id=docs_gateway)\. ## Returning data diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index dc71a008..417d545e 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -23,7 +23,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW **To create the execution role** -1. Open a command prompt and use the [create\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. +1. Open a command prompt and use the [create\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. ------ #### [ macOS/Linux ] @@ -67,7 +67,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW } ``` -1. Use the [attach\-role\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. +1. Use the [attach\-role\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. ``` $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole @@ -184,7 +184,7 @@ Create the Lambda function using the execution role and deployment package that Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. **To invoke the function** -+ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ++ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ``` aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt @@ -223,7 +223,7 @@ If you are using AWS CLI version 2, add the following command parameter: You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** -+ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. ++ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` aws lambda delete-function --function-name my-function @@ -232,14 +232,14 @@ You can now delete the resources that you created for this tutorial, unless you This command produces no output\. **To delete the execution role policy** -+ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. ++ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. ``` aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole ``` **To delete the execution role** -+ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. ++ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. ``` aws iam delete-role --role-name lambda-ex @@ -255,7 +255,7 @@ This section describes how to create a Lambda function with runtime dependencies ### Overview -In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://docs\.aws\.amazon\.com/](https://docs.aws.amazon.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. +In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. You'll learn how to: + Set up the directory structure of a deployment package \(\.zip file\)\. @@ -288,7 +288,7 @@ Create the \.zip file that Lambda uses as your deployment package\. ``` import requests def main(event, context): - response = requests.get("https://docs.aws.amazon.com") + response = requests.get("https://www.test.com/") print(response.text) return response.text if __name__ == "__main__": @@ -382,7 +382,7 @@ Create the Lambda function using the execution role and deployment package that Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. **To invoke the function** -+ Use the [invoke](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/invoke.html) command\. ++ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ------ #### [ macOS/Linux ] @@ -429,7 +429,7 @@ If you are using AWS CLI version 2, add the following command parameter: You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. **To delete the Lambda function** -+ Use the [delete\-function](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/delete-function.html) command\. ++ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` aws lambda delete-function --function-name my-function @@ -438,14 +438,14 @@ You can now delete the resources that you created for this tutorial, unless you This command produces no output\. **To delete the execution role policy** -+ Use the [delete\-policy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-policy.html) command\. ++ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. ``` aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole ``` **To delete the execution role** -+ Use the [delete\-role](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-role.html) command\. ++ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. ``` aws iam delete-role --role-name lambda-ex diff --git a/doc_source/python-package.md b/doc_source/python-package.md index f507f007..daaff8a8 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -11,7 +11,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 373542ae..b3129243 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -5,7 +5,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -45,9 +45,9 @@ jsonpickle==1.3 aws-xray-sdk==2.4.3 ``` -To instrumentAWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. +To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing anAWS SDK client** +**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** ``` import boto3 @@ -84,7 +84,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -129,7 +129,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index eebb0309..4ed7911d 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -8,7 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. ++ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index bf39980b..ee881ffb 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -2,7 +2,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses theAWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. [images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) @@ -46,9 +46,9 @@ gem 'aws-sdk-lambda', '1.39.0' gem 'test-unit', '3.3.5' ``` -To instrumentAWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. +To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing anAWS SDK client** +**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** ``` # lambda_function.rb @@ -83,7 +83,7 @@ You can also instrument HTTP clients, record SQL queries, and create custom subs ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -128,7 +128,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrumentAWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index ccba88a3..200ce1ac 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -2,9 +2,11 @@ [Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. -Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. Note that existing functions that use the runtime are no longer eligible for technical support\. +Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. This includes updating the runtime version, and rolling back to the previous runtime version\. Note that functions that use a deprecated runtime are no longer eligible for technical support\. -In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. However, existing functions that use the runtime remain available to process invocation events\. +In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. To update a function, you need to migrate it to a supported runtime version\. After you migrate the function to a supported runtime version, you cannot rollback the function to the previous runtime\. + +Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -16,6 +18,7 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Aug 23, 2021 | Sept 23, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | | Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | @@ -27,14 +30,12 @@ The following runtimes have reached or are scheduled for end of support: | \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | | \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | -In most cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. - -In some cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. +In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. **Language and framework support policies** + **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) + **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [aws\.amazon\.com/corretto](https://aws.amazon.com/corretto/faqs/) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) + **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md index da982192..8e13f1bf 100644 --- a/doc_source/runtimes-api.md +++ b/doc_source/runtimes-api.md @@ -2,9 +2,9 @@ AWS Lambda provides an HTTP API for [custom runtimes](runtimes-custom.md) to receive invocation events from Lambda and send response data back within the Lambda [execution environment](lambda-runtimes.md)\. -The OpenAPI specification for the runtime API version **2018\-06\-01** is available here: [runtime\-api\.zip](samples/runtime-api.zip) +The OpenAPI specification for the runtime API version **2018\-06\-01** is available in [runtime\-api\.zip](samples/runtime-api.zip) -Runtimes get an endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and use the following resource paths to interact with the API\. +To create an API request URL, runtimes get the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and add the desired resource path\. **Example Request** @@ -15,8 +15,8 @@ curl "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next" **Topics** + [Next invocation](#runtimes-api-next) + [Invocation response](#runtimes-api-response) -+ [Invocation error](#runtimes-api-invokeerror) + [Initialization error](#runtimes-api-initerror) ++ [Invocation error](#runtimes-api-invokeerror) ## Next invocation @@ -24,7 +24,7 @@ curl "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next" **Method** – **GET** -Retrieves an invocation event\. The response body contains the payload from the invocation, which is a JSON document that contains event data from the function trigger\. The response headers contain additional data about the invocation\. +The runtime sends this message to Lambda to request an invocation event\. The response body contains the payload from the invocation, which is a JSON document that contains event data from the function trigger\. The response headers contain additional data about the invocation\. **Response headers** + `Lambda-Runtime-Aws-Request-Id` – The request ID, which identifies the request that triggered the function invocation\. @@ -42,7 +42,7 @@ Retrieves an invocation event\. The response body contains the payload from the + `Lambda-Runtime-Client-Context` – For invocations from the AWS Mobile SDK, data about the client application and device\. + `Lambda-Runtime-Cognito-Identity` – For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider\. -Call `/runtime/invocation/next` to get the invocation event, and pass it to the function handler for processing\. Do not set a timeout on the `GET` call\. Between when Lambda bootstraps the runtime and when the runtime has an event to return, the runtime process may be frozen for several seconds\. +Do not set a timeout on the `GET` request as the response may be delayed\. Between when Lambda bootstraps the runtime and when the runtime has an event to return, the runtime process may be frozen for several seconds\. The request ID tracks the invocation within Lambda\. Use it to specify the invocation when you send the response\. @@ -54,7 +54,7 @@ The tracing header contains the trace ID, parent ID, and sampling decision\. If **Method** – **POST** -Sends an invocation response to Lambda\. After the runtime invokes the function handler, it posts the response from the function to the invocation response path\. For synchronous invocations, Lambda then sends the response back to the client\. +After the function has run to completion, the runtime sends an invocation response to Lambda\. For synchronous invocations, Lambda sends the response to the client\. **Example success request** @@ -63,42 +63,128 @@ REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "SUCCESS" ``` -## Invocation error +## Initialization error -**Path** – `/runtime/invocation/AwsRequestId/error` +If the function returns an error or the runtime encounters an error during initialization, the runtime uses this method to report the error to Lambda\. + +**Path** – `/runtime/init/error` **Method** – **POST** -If the function returns an error, the runtime formats the error into a JSON document, and posts it to the invocation error path\. +**Headers** + +`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. -**Example request body** +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason + +**Body parameters** + +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: ``` { - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException" + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings } ``` -**Example error request** +Note that Lambda accepts any value for `errorType`\. -``` -REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 -ERROR="{\"errorMessage\" : \"Error parsing event data.\", \"errorType\" : \"InvalidEventDataException\"}" -curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" -``` +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. -## Initialization error +**Example Function error** -**Path** – `/runtime/init/error` +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` -**Method** – **POST** +**Response body parameters** ++ `StatusResponse` – String\. Status information, sent with 202 response codes\. ++ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. -If the runtime encounters an error during initialization, it posts an error message to the initialization error path\. +**Response codes** ++ 202 – Accepted ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. **Example initialization error request** ``` ERROR="{\"errorMessage\" : \"Failed to load function.\", \"errorType\" : \"InvalidFunctionException\"}" curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/init/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" +``` + +## Invocation error + +If the function returns an error or the runtime encounters an error, the runtime uses this method to report the error to Lambda\. + +**Path** – `/runtime/invocation/AwsRequestId/error` + +**Method** – **POST** + +**Headers** + +`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason + +**Body parameters** + +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` + +**Response body parameters** ++ `StatusResponse` – String\. Status information, sent with 202 response codes\. ++ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. + +**Response codes** ++ 202 – Accepted ++ 400 – Bad Request ++ 403 – Forbidden ++ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. + +**Example error request** + +``` +REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 +ERROR="{\"errorMessage\" : \"Error parsing event data.\", \"errorType\" : \"InvalidEventDataException\"}" +curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" ``` \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index cc75571a..09fccb9a 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -19,7 +19,7 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ![\[The Init phase is followed by one or more function invocations. When there are no invocation requests, Lambda initiates the SHutdown phase.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Successful-Invokes.png) diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 233db4c2..b2c45236 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -1,12 +1,10 @@ # Lambda Extensions API -You use the Extensions API to create Lambda extensions\. Extensions provide a method for monitoring, security, and other tools to integrate with the Lambda [execution environment](runtimes-context.md)\. For more information, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. +Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, AWS Partners, and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. -The Extensions API builds on the existing [Runtime API](runtimes-api.md), which provides an HTTP API for custom runtimes to receive invocation events from Lambda\. As an extension author, you can use the Extensions API to register for function and execution environment lifecycle events\. In response to these events, you can start new processes or run logic\. +As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](runtimes-context.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. -Lambda supports internal and external extensions\. *Internal extensions* allow you to configure the runtime environment and modify the startup of the runtime process\. Internal extensions use language\-specific [environment variables and wrapper scripts](runtimes-modify.md), and start and shut down within the runtime process\. Internal extensions run as separate threads within the runtime process, which starts and stops them\. - -An *external extension* runs as an independent process in the execution environment and continues to run after the function invoke is fully processed\. An external extension must register for the `Shutdown` event, which triggers the extension to shut down\. Because external extensions run as processes, you can write them in a different language than the function\. +An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) @@ -22,18 +20,15 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) -We recommend that you implement external extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. - -You share your extension as a [Lambda layer](configuration-layers.md) to make it available within your organization or to the entire community of Lambda developers\. Function developers can find, manage, and install extensions through layers\. +Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. -You can install and manage extensions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. +You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](using-extensions.md#invocation-extensions-images) to your container image\. **Note** For example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. **Topics** + [Lambda execution environment lifecycle](#runtimes-extensions-api-lifecycle) -+ [Adding extensions to container images](#extensions-images) + [Extensions API reference](#runtimes-extensions-registration-api) ## Lambda execution environment lifecycle @@ -43,9 +38,9 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. -Each phase starts with an event from the Lambda service to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. +Each phase starts with an event from Lambda to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) @@ -78,7 +73,9 @@ Extensions can complete their initialization at any point in the `Init` phase\. When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension that is registered for the `Invoke` event\. -During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or send logs, metrics, and traces to a location of your choice\. +During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or to send logs, metrics, and traces to a location of your choice\. + +After receiving the function response from the runtime, Lambda returns the response to the client, even if extensions are still running\. The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. @@ -103,17 +100,20 @@ Here is an example payload: } ``` -**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. +**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. +**Note** +Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. + To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. ### Shutdown phase -When Lambda is about to terminate the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. +When Lambda is about to shut down the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. **Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: + 300 ms – A function with no registered extensions @@ -122,7 +122,7 @@ When Lambda is about to terminate the runtime, it sends a `Shutdown` event to th For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2,000 ms limit for external extensions to shut down\. -If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda terminates the process using a `SIGKILL` signal\. +If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda ends the process using a `SIGKILL` signal\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Shutdown-Phase.png) @@ -145,7 +145,7 @@ If the runtime or an extension does not respond to the `Shutdown` event within t Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and `/tmp` disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. -**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional network egress rules, you must apply these rules to the function configuration\. +**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional outbound network traffic rules, you must apply these rules to the function configuration\. **Note** Because the function code directory is read\-only, extensions cannot modify the function code\. @@ -172,21 +172,12 @@ If there is a failure \(such as a function timeout or runtime error\) during `In ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) -**Note** -Lambda does not automatically shut down extensions that repeatedly fail\. However, Lambda reports these errors through Amazon CloudWatch metrics and logs so that function developers and extension authors can understand and diagnose such failures\. - **Extension logs**: Lambda sends the log output of extensions to CloudWatch Logs\. Lambda also generates an additional log event for each extension during `Init`\. The log event records the name and registration preference \(event, config\) on success, or the failure reason on failure\. ### Troubleshooting extensions + If a `Register` request fails, make sure that the `Lambda-Extension-Name` header in the `Register` API call contains the full file name of the extension\. + If the `Register` request fails for an internal extension, make sure that the request does not register for the `Shutdown` event\. -## Adding extensions to container images - -You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT [container image setting](images-create.md#images-parms) specifies the main process for the container\. Configure the ENTRYPOINT and CMD settings in the Dockerfile, or as an override in the function configuration\. - -You can run multiple processes within a container\. Lambda provides a built\-in server that manages the lifecycle of the main process and any additional processes\. The server uses the Extensions API to communicate with each external extension\. - ## Extensions API reference The OpenAPI specification for the extensions API version **2020\-01\-01** is available here: [extensions\-api\.zip](samples/extensions-api.zip) @@ -194,7 +185,7 @@ The OpenAPI specification for the extensions API version **2020\-01\-01** is ava You can retrieve the value of the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send a `Register` request, use the prefix `2020-01-01/` before each API path\. For example: ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register +http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register ``` **Topics** @@ -274,7 +265,7 @@ Do not set a timeout on the GET call, as the extension can be suspended for a pe ### Init error -The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. +The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. **Path** – `/extension/init/error` @@ -284,11 +275,41 @@ The extension uses this method to report an initialization error to Lambda\. Cal `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason **Body parameters** -`ErrorRequest` – JSON object with the error type, error message, and stack trace\. +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` **Response body** + `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. @@ -301,7 +322,7 @@ The extension uses this method to report an initialization error to Lambda\. Cal ### Exit error -The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit\. +The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. **Path** – `/extension/exit/error` @@ -311,11 +332,41 @@ The extension uses this method to report an error to Lambda before exiting\. Cal `Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. -`Lambda-Extension-Function-Error-Type` – Error enum\. Required: yes\. Type: String error enum \(for example, Fatal\.ConnectFailed\)\. +`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. + +This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: ++ Runtime\.NoSuchHandler ++ Extension\.APIKeyNotFound ++ Extension\.ConfigInvalid ++ Extension\.UnknownReason **Body parameters** -`ErrorRequest` – JSON object with the error type, error message, and stack trace\. +`ErrorRequest` – Information about the error\. Required: no\. + +This field is a JSON object with the following structure: + +``` +{ + errorMessage: string (text description of the error), + errorType: string, + stackTrace: array of strings +} +``` + +Note that Lambda accepts any value for `errorType`\. + +The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. + +**Example Function error** + +``` +{ + "errorMessage" : "Error parsing event data.", + "errorType" : "InvalidEventDataException", + "stackTrace": [ ] +} +``` **Response body** + `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index c9712d97..82e9c6db 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -1,4 +1,4 @@ -# AWS Lambda Logs API +# Lambda Logs API Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. @@ -8,57 +8,60 @@ Lambda automatically captures runtime logs and streams them to Amazon CloudWatch The Logs API allows extensions to subscribe to three different logs streams: + Function logs that the Lambda function generates and writes to `stdout` or `stderr`\. -+ Lambda platform logs, such as the START, END, and REPORT logs\. + Extension logs that extension code generates\. ++ Lambda platform logs, which record events and errors related to invocations and extensions\. **Note** Lambda sends all logs to CloudWatch, even when an extension subscribes to one or more of the log streams\. **Topics** + [Subscribing to receive logs](#runtimes-logs-api-subscribing) ++ [Memory usage](#runtimes-logs-api-memory) + [Destination protocols](#runtimes-logs-api-dest) + [Buffering configuration](#runtimes-logs-api-buffering) + [Example subscription](#runtimes-logs-api-subs-example) -+ [Example log messages](#runtimes-logs-api-examples) + [Sample code for Logs API](#runtimes-logs-api-samples) + [Logs API reference](#runtimes-logs-api-ref) ++ [Log messages](#runtimes-logs-api-msg) ## Subscribing to receive logs A Lambda extension can subscribe to receive logs by sending a subscription request to the Logs API\. -To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase is complete, Lambda does not process subscription requests\. +To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase completes, Lambda does not process subscription requests\. **Note** Logs API subscription is idempotent\. Duplicate subscribe requests do not result in duplicate subscriptions\. +## Memory usage + Memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store the logs\. To help optimize memory usage, you can adjust the [buffering configuration](#runtimes-logs-api-buffering)\. Buffer memory usage counts towards overall memory consumption in the execution environment\. ## Destination protocols You can choose one of the following protocols to receive the logs: -1. **HTTP** \(recommended\) – Logs are delivered to a local HTTP endpoint \(`http://sandbox:${PORT}/${PATH}`\) as an array of records in JSON format\. The $PATH parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. +1. **HTTP** \(recommended\) – Lambda delivers logs to a local HTTP endpoint \(`http://sandbox.localdomain:${PORT}/${PATH}`\) as an array of records in JSON format\. The `$PATH` parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. -1. **TCP** – Logs are delivered to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. +1. **TCP** – Lambda delivers logs to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. -We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge that logs are delivered to the application layer\. Therefore, you may lose logs if your extension crashes\. HTTP does not share this limitation\. Also, in a TCP connection, you can unintentionally partition the NDJSON record incorrectly and corrupt the format\. If you choose to use TCP, wait until a newline arrives before flushing a record\. +We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge when it delivers logs to the application layer\. Therefore, you might lose logs if your extension crashes\. HTTP does not share this limitation\. We also recommend setting up the local HTTP listener or the TCP port before subscribing to receive logs\. During setup, note the following: + Lambda sends logs only to destinations that are inside the execution environment\. -+ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in error\. If the log subscriber crashes, it will continue to receive logs after Lambda restarts the execution environment\. ++ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in an error\. If the log subscriber crashes, it continues to receive logs after Lambda restarts the execution environment\. + Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. ## Buffering configuration -Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Lambda uses the default value for any field that you do not specify: -+ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1000\. Minimum: 25\. Maximum: 30000\. -+ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262144\. Minimum: 262144\. Maximum: 1048576\. -+ **maxItems** – The maximum number of events to buffer in memory\. Default: 10000\. Minimum: 1000\. Maximum: 10000\. +Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Note that Lambda uses the default value for any field that you do not specify\. ++ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1,000\. Minimum: 25\. Maximum: 30,000\. ++ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262,144\. Minimum: 262,144\. Maximum: 1,048,576\. ++ **maxItems** – The maximum number of events to buffer in memory\. Default: 10,000\. Minimum: 1,000\. Maximum: 10,000\. During buffering configuration, note the following points: + Lambda flushes the logs if any of the input streams are closed, for example, if the runtime crashes\. -+ Each subscriber can specify a different buffering configuration during the subscription request\. ++ Each subscriber can specify a different buffering configuration in their subscription request\. + Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2*maxBytes+metadata`, where `maxBytes` is configured in the subscribe request\. For example, Lambda adds the following metadata bytes to each record: ``` @@ -68,7 +71,7 @@ During buffering configuration, note the following points: "record": "Hello World" } ``` -+ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda injects a `platform.logsDropped` record\. ++ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda sends a `platform.logsDropped` log\. ## Example subscription @@ -76,18 +79,19 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{"types": [ - "platform", - "function" - ], +{ "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" + ], "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 - } + "maxItems": 1000, + "maxBytes": 10240, + "timeoutMs": 100 + } "destination": { "protocol": "HTTP", - "URI": "http://sandbox:8080/lambda_logs" + "URI": "http://sandbox.localdomain:8080/lambda_logs" } } ``` @@ -99,32 +103,122 @@ HTTP/1.1 200 OK "OK" ``` -## Example log messages +## Sample code for Logs API + +For sample code showing how to send logs to a custom destination, see [Using AWS Lambda extensions to send logs to custom destinations](http://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations/) on the AWS Compute Blog\. + +For Python and Go code examples showing how to develop a basic Lambda extension and subscribe to the Logs API, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. + +## Logs API reference -The following example shows platform start, end, and report logs\. +You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: ``` - { +http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ +``` + +The OpenAPI specification for the Logs API version **2020\-08\-15** is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) + +### Subscribe + +To subscribe to one or more of the log streams available in the Lambda execution environment, extensions send a Subscribe API request\. + +**Path** – `/logs` + +**Method** – **PUT** + +**Body parameters** + +`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. + +`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. + +`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. + +`schemaVersion` – Required: no\. Default value: "2020\-08\-15"\. Set to "2021\-03\-18" for the extension to receive [`platform.runtimeDone`](#runtimes-logs-api-ref-done) messages\. + +****Response parameters**** + +The OpenAPI specifications for the subscription responses version **2020\-08\-15** are available for the HTTP and TCP protocols: ++ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) ++ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) + +****Response codes**** ++ 200 – Request completed successfully ++ 202 – Request accepted\. Response to a subscription request during local testing\. ++ 4XX – Bad Request ++ 500 – Service error + +If the request succeeds, the subscriber receives an HTTP 200 success response\. + +``` +HTTP/1.1 200 OK +"OK" +``` + +If the request fails, the subscriber receives an error response\. For example: + +``` +HTTP/1.1 400 OK +{ + "errorType": "Logs.ValidationError", + "errorMessage": URI port is not provided; types should not be empty" +} +``` + +## Log messages + +The Logs API allows extensions to subscribe to three different logs streams: ++ Function – Logs that the Lambda function generates and writes to `stdout` or `stderr`\. ++ Extension – Logs that extension code generates\. ++ Platform – Logs that the runtime platform generates, which record events and errors related to invocations and extensions\. + +**Topics** ++ [Function logs](#runtimes-logs-api-msg-function) ++ [Extension logs](#runtimes-logs-api-msg-extension) ++ [Platform logs](#runtimes-logs-api-msg-platform) + +### Function logs + +The Lambda function and internal extensions generate function logs and write them to `stdout` or `stderr`\. + +The following example shows the format of a function log message\. \{ "time": "2020\-08\-20T12:31:32\.123Z", "type": "function", "record": "ERROR encountered\. Stack trace:\\n\\my\-function \(line 10\)\\n" \} + +### Extension logs + +Extensions can generate extension logs\. The log format is the same as for a function log\. + +### Platform logs + +Lambda generates log messages for platform events such as `platform.start`, `platform.end`, and `platform.fault`\. + +Optionally, you can subscribe to the **2021\-03\-18** version of the Logs API schema, which includes the `platform.runtimeDone` log message\. + +#### Example platform log messages + +The following example shows the platform start and platform end logs\. These logs indicate the invocation start time and invocation end time for the invocation that the requestId specifies\. + +``` +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.start", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56" - } + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} } { "time": "2020-08-20T12:31:32.123Z", "type": "platform.end", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56" - } + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} } -{ +``` + +The platform report log includes metrics about the invocation that the requestId specifies\. The `initDurationMs` field is included in the log only if the invocation included a cold start\. If AWS X\-Ray tracing is active, the log includes X\-Ray metadata\. The following example shows a platform report log for an invocation that included a cold start\. + +``` +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.report", - "record": { - "requestId": "6f7f0961f83442118a7af6fe80b88d56", - "metrics": { - "durationMs": 101.51, + "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56", + "metrics": {"durationMs": 101.51, "billedDurationMs": 300, "memorySizeMB": 512, "maxMemoryUsedMB": 33, @@ -134,146 +228,102 @@ The following example shows platform start, end, and report logs\. } ``` -The platform log captures runtime or execution environment errors\. The following example shows a platform fault log message\. +The platform fault log captures runtime or execution environment errors\. The following example shows a platform fault log message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.fault", "record": "RequestId: d783b35e-a91d-4251-af17-035953428a2c Process exited before completing request" } ``` -The following example shows an Extensions API registration log message\. +Lambda generates a platform extension log when an extension registers with the extensions API\. The following example shows a platform extension message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.extension", - "record": { - "name": "Foo.bar", + "record": {"name": "Foo.bar", "state": "Ready", "events": ["INVOKE", "SHUTDOWN"] } } ``` -The following example shows a Logs API subscription log message\. +Lambda generates a platform logs subscription log when an extension subscribes to the logs API\. The following example shows a logs subscription message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.logsSubscription", - "record": { - "name": "Foo.bar", + "record": {"name": "Foo.bar", "state": "Subscribed", "types": ["function", "platform"], } } ``` -The following example shows a `platform.logsDropped` log message\. +Lambda generates a platform logs dropped log when an extension is not able to process the number of logs that it is receiving\. The following example shows a `platform.logsDropped` log message\. ``` -{ +{ "time": "2020-08-20T12:31:32.123Z", "type": "platform.logsDropped", - "record": { - "reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", + "record": {"reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", "droppedRecords": 123, "droppedBytes" 12345 } } ``` -The following example shows a function log message\. +#### Platform `runtimeDone` messages -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "function", - "record": "ERROR something happened. Stack trace:\n\tfoo (line 10)\n" -} -``` +If you set the schema version to "2021\-03\-18" in the subscribe request, Lambda sends a `platform.runtimeDone` message after the function invocation completes either successfully or with an error\. The extension can use this message to stop all the telemetry collection for this function invocation\. -## Sample code for Logs API +The OpenAPI specification for the Log event type in schema version **2021\-03\-18** is available here: [schema\-2021\-03\-18\.zip](samples/schema-2021-03-18.zip) -The [ compute blog post entry](https://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations) for Logs API includes sample code showing how to send logs to a custom destination\. +Lambda generates the `platform.runtimeDone` log message when the runtime sends a `Next` or `Error` runtime API request\. The `platform.runtimeDone` log informs consumers of the Logs API that the function invocation completes\. Extensions can use this information to decide when to send all the telemetry collected during that invocation\. -Lambda provides [Python and Go code examples](https://github.com/aws-samples/aws-lambda-extensions) showing how to develop a basic extension and subscribe to the Logs API\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. +##### Examples -## Logs API reference +Lambda sends the `platform.runtimeDone` message after the runtime sends the NEXT request when the function invocation completes\. The following examples show messages for each of the status values: success, failure, and timeout\. -You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: +**Example success message** ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ -``` - -### Subscribe - -To subscribe to one or more of the log streams that are available in the Lambda execution environment, extensions send a Subscribe API request\. - -The OpenAPI specification for the Logs API subscription request, version **2020\-08\-15**, is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) - -**Path** – `/logs` - -**Method** – **PUT** - -**Body parameters** - -`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. - -`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. - -`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. - -**Response parameters** - -The OpenAPI specifications for the subscription responses, version **2020\-08\-15**, are available for HTTP and TCP: -+ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) -+ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) - -**Response codes** -+ 200 – Request completed successfully -+ 202 – Request accepted\. Response to a subscription request during local testing\. -+ 4XX – Bad Request -+ 500 – Service error - -**Example subscription request** - -``` - PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 - { - "types": [ - "platform", - "function" - ], - "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 - } - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox:8080/lambda_logs" - } +{ + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "success" + } } ``` -If the request succeeds, the subscriber receives an HTTP 200 success response\. +**Example failure message** ``` -HTTP/1.1 200 OK -"OK" +{ + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "failure" + } +} ``` -If the request fails, the subscriber receives an error response\. +**Example timeout message** ``` -HTTP/1.1 400 OK { - "errorType": "Logs.ValidationError", - "errorMessage": URI port is not provided; types should not be empty" + "time": "2021-02-04T20:00:05.123Z", + "type": "platform.runtimeDone", + "record": { + "requestId":"6f7f0961f83442118a7af6fe80b88", + "status": "timeout" + } } ``` \ No newline at end of file diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 014a51c7..38688e57 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -1,6 +1,6 @@ # Blank function sample application for AWS Lambda -The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and theAWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. +The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) @@ -37,7 +37,7 @@ The sample application consists of function code, an AWS CloudFormation template Standard charges apply for each service\. For more information, see [AWS Pricing](https://aws.amazon.com/pricing)\. -The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with theAWS SDK and passes the response back to the Lambda runtime\. +The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** @@ -64,7 +64,7 @@ var serialize = function(object) { } ``` -The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code orAWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. +The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. @@ -174,7 +174,7 @@ The sample function is configured for tracing with [AWS X\-Ray](https://console. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. -To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with theAWS SDK to AWS services\. +To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. **Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** @@ -186,15 +186,15 @@ const AWS = AWSXRay.captureAWS(require('aws-sdk')) const lambda = new AWS.Lambda() ``` -Instrumenting theAWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. +Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) -The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for theAWS SDK call to the `GetAccountSettings` API operation\. +The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) -You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes theAWS SDK in the execution environment\. +You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index a9eeb6f5..67e825cc 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -72,7 +72,7 @@ The two Node\.js functions are configured for active tracing in the template, an ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) -The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It usesAWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. +The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. ## AWS CloudFormation template and additional resources diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 29c48463..7225177f 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -98,7 +98,7 @@ The application uses [AWS X\-Ray](services-xray.md) to trace function invocation ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) -The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with anAWS SDK or MySQL client\. +The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md index 36138928..3625525c 100644 --- a/doc_source/services-cognito.md +++ b/doc_source/services-cognito.md @@ -1,6 +1,6 @@ # Using AWS Lambda with Amazon Cognito -The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito\. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized\. To learn more and walk through an example, see [Introducing Amazon Cognito Events: Sync Triggers](https://aws.amazon.com/blogs/mobile/introducing-amazon-cognito-events-sync-triggers/) in the Mobile Development blog\. +The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito\. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized\. To learn more and walk through an example, see [Introducing Amazon Cognito Events: Sync Triggers](http://aws.amazon.com/blogs/mobile/introducing-amazon-cognito-events-sync-triggers/) in the Mobile Development blog\. **Example Amazon Cognito message event** diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 8416d961..5b41419f 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -73,7 +73,7 @@ using Amazon.EC2; public async Task FunctionHandler(Dictionary input, ILambdaContext context) { - // More AMI IDs: [aws\.amazon\.com/amazon\-linux\-2/release\-notes/](https://aws.amazon.com/amazon-linux-2/release-notes/) + // More AMI IDs: [amazon\-linux\-2/release\-notes/](http://aws.amazon.com/amazon-linux-2/release-notes/) // us-east-2 HVM EBS-Backed 64-bit Amazon Linux 2 string ami = "ami-09d9edae5eb90d556"; string sg = "default"; diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index 28a100e6..bdce5f13 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -27,7 +27,7 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. -You can also use theAWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. +You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions @@ -59,4 +59,4 @@ aws lambda add-permission --action lambda:InvokeFunction --statement-id ec2-even --principal events.amazonaws.com --function-name my-function --source-arn 'arn:aws:events:us-east-2:12456789012:rule/*' ``` -If your function uses theAWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file +If your function uses the AWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md index 997a2044..95c70582 100644 --- a/doc_source/services-iotevents.md +++ b/doc_source/services-iotevents.md @@ -9,7 +9,6 @@ When the event occurs, AWS IoT Events invokes your Lambda function asynchronousl **Example AWS IoT Events message event** ``` - { "event: ":{ "eventName": "myChargedEvent", @@ -17,7 +16,7 @@ When the event occurs, AWS IoT Events invokes your Lambda function asynchronousl "payload":{ "detector":{ "detectorModelName": "AWS_IoTEvents_Hello_World1567793458261", - "detectorModelVersion": "4", + "detectorModelVersion": "4", "keyValue": "100009" }, "eventTriggerDetails":{ diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md deleted file mode 100644 index 87d49a38..00000000 --- a/doc_source/services-msk-topic-add.md +++ /dev/null @@ -1,59 +0,0 @@ -# Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md)\. - -## VPC configuration - -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: -+ Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -**Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. - -## Adding an Amazon MSK cluster using the Lambda console - -Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an MSK trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **MSK** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding an Amazon MSK cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. - -### Creating a trigger using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index 08bb31ec..848b668a 100644 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -57,7 +57,7 @@ In the [resource\-based policy](access-control-resource-based.md) that you creat In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. -If your function uses theAWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. +If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. diff --git a/doc_source/services-smaa-topic-add.md b/doc_source/services-smaa-topic-add.md deleted file mode 100644 index 0e525069..00000000 --- a/doc_source/services-smaa-topic-add.md +++ /dev/null @@ -1,57 +0,0 @@ -# Adding a self\-managed Apache Kafka cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](kafka-hosting.md)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](smaa-permissions.md)\. - -## Adding a self\-managed Apache Kafka cluster using the Lambda console - -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an Apache Kafka trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding a self\-managed Apache Kafka cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. - -### Using SASL/SCRAM - -If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Using a VPC - -If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 -``` \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index b80cdabb..402690ca 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -29,7 +29,13 @@ Your function needs permission to upload trace data to X\-Ray\. When you enable X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. +In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](runtimes-context.md)\. + +The `Initialization` subsegment represents the init phase of the Lambda execution environment lifecycle\. During this phase, Lambda creates or unfreezes an execution environment with the resources you have configured, downloads the function code and all layers, initializes extensions, initializes the runtime, and runs the function's initialization code\. + +The `Invocation` subsegment represents the invoke phase where Lambda invokes the function handler\. This begins with runtime and extension registration and it ends when the runtime is ready to send the response\. + +The `Overhead` subsegment represents the phase that occurs between the time when the runtime sends the response and the signal for the next invoke\. During this time, the runtime finishes all tasks related to an invoke and prepares to freeze the sandbox\. The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. @@ -74,7 +80,7 @@ For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/l ## Enabling active tracing with the Lambda API -To manage tracing configuration with the AWS CLI orAWS SDK, use the following API operations: +To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) diff --git a/doc_source/smaa-permissions.md b/doc_source/smaa-permissions.md deleted file mode 100644 index 7da4dcd6..00000000 --- a/doc_source/smaa-permissions.md +++ /dev/null @@ -1,81 +0,0 @@ -# Managing access and permissions for a self\-managed Apache Kafka cluster - -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. - -This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. - -## Required Lambda function permissions - -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -## Optional Lambda function permissions - -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. - -### Secrets Manager and AWS KMS permissions - -If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. - -Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) - -### VPC permissions - -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) - -## Adding permissions to your execution role - -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. - -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. - -``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } -``` - -For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. - -## Adding users to an IAM policy - -By default, IAM users and roles don't have permission to perform [event source API operations](kafka-using-cluster.md#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. - -## Using SASL/SCRAM authentication - -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. - -To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: - -``` -{ - "username": "ab1c23de", - "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" -} -``` - -For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index 8c6c8337..a0c24ba6 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -26,7 +26,7 @@ chmod 755 $(find . -type d) When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. **Note** -When you upload a file directly with the AWS CLI,AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. +When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. ## Amazon S3: Error Code PermanentRedirect\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index d2138fe1..be5f6ba8 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -28,7 +28,7 @@ When you add permissions to your function, make an update to its code or configu **Issue: \(Node\.js\)** *Function returns before code finishes executing* -Many libraries, including theAWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. +Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. To wait for the promise to resolve into a response, use the `await` keyword\. This blocks your handler code from executing until the promise is resolved into an object that contains the response\. If you don't need to use the data from the response in your code, you can return the promise directly to the runtime\. @@ -36,11 +36,11 @@ Some libraries don't return promises but can be wrapped in code that does\. For ## AWS SDK: Versions and updates -**Issue:** *TheAWS SDK included on the runtime is not the latest version* +**Issue:** *The AWS SDK included on the runtime is not the latest version* -**Issue:** *TheAWS SDK included on the runtime updates automatically* +**Issue:** *The AWS SDK included on the runtime updates automatically* -Runtimes for scripting languages include theAWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of theAWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: +Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 23e90de8..c1889ca0 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -29,7 +29,7 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc + [Impact on performance and resources](#using-extensions-reg) + [Permissions](#using-extensions-permissions) + [Configuring extensions \(\.zip file archive\)](#using-extensions-config) -+ [Using extensions in container images](#invocation-images-extensions) ++ [Using extensions in container images](#invocation-extensions-images) + [Next steps](#using-extensions-next) ## Execution environment @@ -41,7 +41,7 @@ The lifecycle of the execution environment includes the following phases: The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda terminates the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. ++ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and starts all extensions in parallel\. @@ -83,7 +83,7 @@ You add the extension to your function using the same method as you would for an 1. Choose **Add**\. -## Using extensions in container images +## Using extensions in container images You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. @@ -111,6 +111,6 @@ CMD python ./index.py ## Next steps To learn more about extensions, we recommend the following resources: -+ For a basic working example, see [Building Extensions for AWS Lambda](https://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. -+ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. ++ For a basic working example, see [Building Extensions for AWS Lambda](http://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. ++ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. + To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 86848848..663bec4f 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -14,6 +14,14 @@ You can invoke your Lambda functions using the Lambda API, or Lambda can run you Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. +**Topics** ++ [When should I use Lambda?](#when-to-use-cloud-functions) ++ [Lambda features](#features) ++ [Getting started with Lambda](#welcome-first-time-user) ++ [Related services](#related-services) ++ [Accessing Lambda](#accessing) ++ [Pricing for Lambda](#pricing) + ## When should I use Lambda? Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. @@ -28,8 +36,8 @@ If you need to manage your own compute resources, AWS has other compute services The following key features help you develop Lambda applications that are scalable, secure, and easily extensible: -**Concurrency controls** -[Concurrency limits and provisioned concurrency](invocation-scaling.md) give you fine\-grained control over the scaling and responsiveness of your production applications\. +**Concurrency and scaling controls** +[Concurrency and scaling controls](invocation-scaling.md) such as concurrency limits and provisioned concurrency give you fine\-grained control over the scaling and responsiveness of your production applications\. **Functions defined as container images** Use your preferred [container image](lambda-images.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. @@ -76,7 +84,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo [Lambda integrates with other AWS services](lambda-services.md) to invoke functions based on events that you specify\. For example: + Use [API Gateway](services-apigateway.md) to provide a secure and scalable gateway for web APIs that route HTTP requests to Lambda functions\. -+ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), have Lambda read data from the services, create an event, and invoke your function to process the event\. ++ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), Lambda polls the queue or data stream from the service and invokes your function to process the received data\. + Define [Amazon S3](with-s3.md) events that invoke a Lambda function to process Amazon S3 objects, for example, when an object is created or deleted\. + Use a Lambda function to process [Amazon SQS](with-sqs.md) messages or [Amazon Simple Notification Service \(Amazon SNS\)](with-sns.md) notifications\. + Use [AWS Step Functions](lambda-stepfunctions.md) to connect Lambda functions together into serverless workflows called state machines\. @@ -87,7 +95,7 @@ You can create, invoke, and manage your Lambda functions using any of the follow + **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. -+ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. ++ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. + **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md new file mode 100644 index 00000000..7921d071 --- /dev/null +++ b/doc_source/with-kafka.md @@ -0,0 +1,237 @@ +# Using Lambda with an Apache Kafka cluster + +[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. + +Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. + +AWS provides a managed Kafka service, or you can use a non\-AWS Kafka cluster with Lambda\. + +**Topics** ++ [Hosting an Apache Kafka cluster](#kafka-hosting) ++ [Using an Apache Kafka cluster as an event source for Lambda](#kafka-using-cluster) ++ [Using Lambda with self\-managed Apache Kafka](#kafka-smaa) + +## Hosting an Apache Kafka cluster + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +### Using Amazon MSK + +To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. + +For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. + +### Using a self\-managed Kafka provider + +To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. + +You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. + +For more information about using a self\-managed Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](#kafka-smaa)\. + +## Using an Apache Kafka cluster as an event source for Lambda + + + +You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. + +### Prerequisites ++ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster ++ A [Lambda execution role](lambda-intro-execution-role.md) + +### How it works + + + +When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. ++ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. ++ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. ++ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. ++ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. ++ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. ++ + +For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. + +### Event source API operations + +When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. + +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + +### Event source mapping errors + +When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. + +To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: + +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. + +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda couldn't authenticate the event source\. + +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda doesn't have the required permissions to access the event source\. + +**`FUNCTION_CONFIG_NOT_VALID`** +The Lambda function configuration is not valid\. + +**Note** +If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. + +## Using Lambda with self\-managed Apache Kafka + +You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. + +**Topics** ++ [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions) ++ [Adding a self\-managed Apache Kafka cluster as an event source](#services-smaa-topic-add) + +### Managing access and permissions for a self\-managed Apache Kafka cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. + +#### Required Lambda function permissions + +To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +#### Optional Lambda function permissions + +Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. + +##### Secrets Manager and AWS KMS permissions + +If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. + +Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) + +##### VPC permissions + +If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + +#### Adding permissions to your execution role + +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. + +By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. + +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" + } + ] + } +``` + +For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. + +#### Adding users to an IAM policy + +By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. + +#### Using SASL/SCRAM authentication + +**Important** +Plaintext brokers are not supported if you are is using SASL/SCRAM based authentication\. You must use TLS encryption for your brokers\. + +User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + +To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: + +``` +{ + "username": "ab1c23de", + "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" +} +``` + +For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. + +### Adding a self\-managed Apache Kafka cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +#### Prerequisites ++ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](#kafka-hosting)\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions)\. + +#### Adding a self\-managed Apache Kafka cluster using the Lambda console + +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an Apache Kafka trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +#### Adding a self\-managed Apache Kafka cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. + +##### Using SASL/SCRAM + +If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +##### Using a VPC + +If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. + +``` +aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +##### Viewing the status + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 +``` \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index fc3f5e22..5b8a125a 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -127,7 +127,7 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) command\. +To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. @@ -175,7 +175,7 @@ You should see the following output: } ``` -Using the `[update\-event\-source\-mapping](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. +Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` aws lambda update-event-source-mapping \ @@ -198,7 +198,7 @@ You should see the following output: } ``` -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) command\. +Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. ``` aws lambda get-event-source-mapping \ diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index b22063bb..72717471 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -2,6 +2,116 @@ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK provides the control\-plane operations, such as those for creating, updating, and deleting clusters\. It supports multiple open\-source versions of Kafka\. +When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. + +To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. + **Topics** -+ [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md) -+ [Adding an Amazon MSK cluster as an event source](services-msk-topic-add.md) \ No newline at end of file ++ [Managing access and permissions for an Amazon MSK cluster](#msk-permissions) ++ [Adding an Amazon MSK cluster as an event source](#services-msk-topic-add) + +## Managing access and permissions for an Amazon MSK cluster + +Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. + +This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. + +### Required Lambda function permissions + +To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +### Adding a policy to your execution role + +Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. + +**To add an AWS managed policy** + +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. + +1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. + +1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. + +1. Select your execution role from the list, and then choose **Attach policy**\. + +### Granting users access with an IAM policy + +By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +### Using SASL/SCRAM authentication + +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +## Adding an Amazon MSK cluster as an event source + +You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. + +This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. + +### Prerequisites ++ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](#msk-permissions)\. + +### VPC configuration + +To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, do one of the following: ++ We recommend that you deploy Amazon VPC Endpoints \(PrivateLink\) for Lambda and AWS STS services\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. + + If authentication is required, also deploy an Amazon VPC Endpoint for the Secrets Manager\. ++ Alternatively, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +Your Amazon VPC security groups must be configured with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. + +**Note** +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. + +### Adding an Amazon MSK cluster using the Lambda console + +Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. + +**To add an MSK trigger to your Lambda function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of your Lambda function\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. Under **Trigger configuration**, choose the **MSK** trigger type\. + +1. Configure the remaining options, and then choose **Add**\. + +### Adding an Amazon MSK cluster using the AWS CLI + +Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. + +#### Creating a trigger using the AWS CLI + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. + +``` +aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +``` + +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. + +#### Viewing the status using the AWS CLI + +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. + +``` +aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +``` \ No newline at end of file diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md index 35103d89..29b23cba 100644 --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -52,7 +52,7 @@ Amazon S3 invokes your function [asynchronously](invocation-async.md) with an ev To invoke your function, Amazon S3 needs permission from the function's [resource\-based policy](access-control-resource-based.md)\. When you configure an Amazon S3 trigger in the Lambda console, the console modifies the resource\-based policy to allow Amazon S3 to invoke the function if the bucket name and account ID match\. If you configure the notification in Amazon S3, you use the Lambda API to update the policy\. You can also use the Lambda API to grant permission to another account, or restrict permission to a designated alias\. -If your function uses theAWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. +If your function uses the AWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. **Topics** + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 08eb3d96..8bf175d7 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) is reached or full batch size is reached\. +By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. @@ -141,7 +141,7 @@ Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. From ff84f50662dcf11c14578969d00d7ace82dc9a29 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 3 Jun 2021 10:45:52 -0700 Subject: [PATCH 104/243] Updates --- doc_source/images-test.md | 2 +- doc_source/services-msk-topic-add.md | 60 ---------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 doc_source/services-msk-topic-add.md diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 68b379c7..5f278440 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -144,4 +144,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/services-msk-topic-add.md b/doc_source/services-msk-topic-add.md deleted file mode 100644 index 62f8eb85..00000000 --- a/doc_source/services-msk-topic-add.md +++ /dev/null @@ -1,60 +0,0 @@ -# Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. - -## Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](msk-permissions.md)\. - -## VPC configuration - -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, we recommend: -+ Configuring one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Alternatively, instead of NAT gateway, deploy VPC Endpoints (PrivateLink) for Lambda and STS services\. If authentication is required, then deploy also VPC Endpoint for Secrets Manager\. - -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -**Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. - -## Adding an Amazon MSK cluster using the Lambda console - -Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an MSK trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, choose the **MSK** trigger type\. - -1. Configure the remaining options, and then choose **Add**\. - -## Adding an Amazon MSK cluster using the AWS CLI - -Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. - -### Creating a trigger using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function -``` - -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. - -### Viewing the status using the AWS CLI - -The following example uses the [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` From 595790bcd0c6925b67d1ae99bd4d292e8d8a0c5c Mon Sep 17 00:00:00 2001 From: Elias Lousseief Date: Fri, 4 Jun 2021 09:09:40 +0200 Subject: [PATCH 105/243] Update images-test.md Clarified that script needs to be copied into the image as well. Also changed the path to `npx` which seems to be wrong in the script. --- doc_source/images-test.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 5f278440..6da8454f 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -82,9 +82,9 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local ``` #!/bin/sh if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/bin/npx aws-lambda-ric $@ + exec /usr/local/bin/aws-lambda-rie /usr/local/bin/npx aws-lambda-ric $@ else - exec /usr/bin/npx aws-lambda-ric $@ + exec /usr/local/bin/npx aws-lambda-ric $@ fi ``` @@ -101,9 +101,10 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script and install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` + COPY ./entry_script.sh /entry_script.sh ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` @@ -144,4 +145,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. \ No newline at end of file + This command invokes the function running in the container image and returns a response\. From 0b302c5bf8d99ec01f7c04a54b0e3396dff4723c Mon Sep 17 00:00:00 2001 From: Elias Lousseief Date: Fri, 4 Jun 2021 09:13:02 +0200 Subject: [PATCH 106/243] Update images-test.md --- doc_source/images-test.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 6da8454f..8504098f 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Copy the script and install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` COPY ./entry_script.sh /entry_script.sh From 730c4f65d5bdad4c0bbb48e28b9ae36b6256a915 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Thu, 10 Jun 2021 10:04:06 -0400 Subject: [PATCH 107/243] Fix typos in getting-started-create-function.md --- doc_source/getting-started-create-function.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 1cf23be7..faa6c2c9 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell,C\#\) Go, Java, Node\.js, Python, and Ruby\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\) Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload"], "Resource": "arn:aws:ecr:::repository//" } ] @@ -341,4 +341,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. From f4c82b57c5f5c942912ac1635b488f51fded2c29 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 14 Jun 2021 09:11:09 -0700 Subject: [PATCH 108/243] Updates. Add file for Secrets manager in Services chapter --- doc_source/API_AccountLimit.md | 2 +- doc_source/API_AddLayerVersionPermission.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 22 +++++++++---------- doc_source/API_CreateFunction.md | 4 ++-- doc_source/API_DeleteEventSourceMapping.md | 8 +++---- doc_source/API_DeleteLayerVersion.md | 2 +- .../API_EventSourceMappingConfiguration.md | 8 +++---- doc_source/API_GetEventSourceMapping.md | 8 +++---- doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_GetLayerVersionPolicy.md | 2 +- doc_source/API_Invoke.md | 10 ++++----- doc_source/API_Layer.md | 2 +- doc_source/API_LayerVersionContentInput.md | 2 +- doc_source/API_LayerVersionContentOutput.md | 2 +- doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_LayersListItem.md | 2 +- doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- doc_source/API_PublishLayerVersion.md | 2 +- doc_source/API_PublishVersion.md | 2 +- .../API_RemoveLayerVersionPermission.md | 2 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 22 +++++++++---------- doc_source/API_UpdateFunctionConfiguration.md | 2 +- doc_source/best-practices.md | 2 +- doc_source/csharp-image.md | 8 +++++++ doc_source/getting-started-create-function.md | 6 ++--- doc_source/gettingstarted-limits.md | 2 +- doc_source/go-image.md | 14 ++++++++++-- doc_source/images-create.md | 10 ++++----- doc_source/images-test.md | 4 ++-- doc_source/index.md | 1 + doc_source/java-image.md | 20 ++++++++++++----- doc_source/lambda-releases.md | 12 +++++----- doc_source/lambda-services.md | 1 + doc_source/nodejs-image.md | 8 +++++++ doc_source/powershell-handler.md | 2 +- doc_source/python-image.md | 12 ++++++++-- doc_source/ruby-image.md | 8 +++++++ doc_source/with-secrets-manager.md | 15 +++++++++++++ 41 files changed, 156 insertions(+), 87 deletions(-) create mode 100644 doc_source/with-secrets-manager.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index e59478cf..d365af86 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -10,7 +10,7 @@ Type: Long Required: No **CodeSizeZipped** -The maximum size of a deployment package when it's uploaded directly to AWS Lambda\. Use Amazon S3 for larger files\. +The maximum size of a deployment package when it's uploaded directly to Lambda\. Use Amazon S3 for larger files\. Type: Long Required: No diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index e5c0a23a..ed1614f6 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,6 +1,6 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. +Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 61a802c8..c1f14b5d 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -81,12 +81,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -120,7 +120,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: Yes ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -133,19 +133,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No @@ -189,7 +189,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -272,7 +272,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -291,12 +291,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) 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\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(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\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -346,7 +346,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 90ff763a..675dda2a 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -1,6 +1,6 @@ # CreateFunction -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. +Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and X\-Ray for request tracing\. You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. @@ -197,7 +197,7 @@ Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 85797869..96159677 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -100,7 +100,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -119,12 +119,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) 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\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(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\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -174,7 +174,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 7efc4d20..44a8a967 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -1,6 +1,6 @@ # DeleteLayerVersion -Deletes a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. +Deletes a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. ## Request Syntax diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 8c6aca49..0719b9c9 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -33,7 +33,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No **FunctionResponseTypes** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -56,13 +56,13 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No **MaximumRecordAgeInSeconds** -\(Streams only\) 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\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No **MaximumRetryAttempts** -\(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\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No @@ -122,7 +122,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No **TumblingWindowInSeconds** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index eb182d3f..f1e2f959 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -98,7 +98,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -117,12 +117,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) 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\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(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\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -172,7 +172,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 61c5fcd7..260e345b 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -1,6 +1,6 @@ # GetLayerVersion -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index e4c3cf0d..90ea2d4d 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -1,6 +1,6 @@ # GetLayerVersionByArn -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index 8a6f1f17..c81c02ab 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 294589d9..8ee0f24c 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -110,11 +110,11 @@ Need additional permissions to configure VPC settings\. HTTP Status Code: 502 **EC2ThrottledException** -AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function\. + AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function\. HTTP Status Code: 502 **EC2UnexpectedException** -AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. + AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 **EFSIOException** @@ -134,7 +134,7 @@ The function was able to make a network connection to the configured file system HTTP Status Code: 408 **ENILimitReachedException** -AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. + AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. HTTP Status Code: 502 **InvalidParameterValueException** @@ -158,7 +158,7 @@ The Subnet ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 **InvalidZipFileException** -AWS Lambda could not unzip the deployment package\. + AWS Lambda could not unzip the deployment package\. HTTP Status Code: 502 **KMSAccessDeniedException** @@ -198,7 +198,7 @@ The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 **SubnetIPAddressLimitReachedException** -AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses\. + AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses\. HTTP Status Code: 502 **TooManyRequestsException** diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 80c3a729..7f3231c3 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -1,6 +1,6 @@ # Layer -An [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index 8f946fc3..0e082bcc 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -1,6 +1,6 @@ # LayerVersionContentInput -A ZIP archive that contains the contents of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. +A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. ## Contents diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index b0ead36e..9ad0560e 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -1,6 +1,6 @@ # LayerVersionContentOutput -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index f2df4764..9171a195 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -1,6 +1,6 @@ # LayerVersionsListItem -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index 8748e7b8..d87156c7 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -1,6 +1,6 @@ # LayersListItem -Details about an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index eacec069..db472ea6 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,6 +1,6 @@ # ListLayerVersions -Lists the versions of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. +Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. ## Request Syntax diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 4adf853d..3f0ec3fe 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,6 +1,6 @@ # ListLayers -Lists [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. +Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. ## Request Syntax diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 21b6f62a..35fb23e5 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -1,6 +1,6 @@ # PublishLayerVersion -Creates an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. +Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index a70135ce..ef95166a 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,7 +2,7 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. -AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 529e3980..769a97a1 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 517a7d18..48a8dba7 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index c238265e..00dad8a2 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -67,12 +67,12 @@ Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) If the function returns an error, split the batch in two and retry\. +\(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. +\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. Type: [DestinationConfig](API_DestinationConfig.md) object Required: No @@ -96,7 +96,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} Required: No ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -109,19 +109,19 @@ Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. +\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The number of batches to process from each shard concurrently\. +\(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No @@ -133,7 +133,7 @@ Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -216,7 +216,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) A list of current response type enums applied to the event source mapping\. +\(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` @@ -235,12 +235,12 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) 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\. +\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(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\. +\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. @@ -290,7 +290,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index d01c5d7b..24c67918 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -150,7 +150,7 @@ Valid Range: Minimum value of 1\. Required: No ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. +Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. Type: [TracingConfig](API_TracingConfig.md) object Required: No diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 8ee37b62..0a9fe11f 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -48,7 +48,7 @@ For more information about best practices for Lambda applications, see [Applicat **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. - To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/ompute/creating-faster-aws-lambda-functions-with-avx2/)\. + To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. + **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. + **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 6e28a97f..6132f93a 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for \.NET AWS provides the following base images for \.NET: diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index faa6c2c9..83c80e0b 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -24,7 +24,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th 1. For **Function name**, enter **my\-function**\. - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\) Go, Java, Node\.js, Python, and Ruby\. + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\), Go, Java, Node\.js, Python, and Ruby\. 1. Choose **Create function**\. @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload"], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], "Resource": "arn:aws:ecr:::repository//" } ] @@ -341,4 +341,4 @@ If you are done working with your function, delete it\. You can also delete the 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index b2821df3..4fd1e465 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -5,7 +5,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Resource | Default quota | Can be increased up to | | --- | --- | --- | -| Concurrent executions | 1,000 | Hundreds of thousands | +| Concurrent executions | 1,000 | Tens of thousands | | Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 8160dbe6..c55879cf 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) @@ -98,6 +106,8 @@ Note that the first three steps are identical whether you deploy your function a docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` +Now that your container image resides in the Amazon ECR container registry, you can [create](configuration-images.md) the Lambda function and deploy the image\. + ## Deploying Go with an alternative base image You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. @@ -119,7 +129,7 @@ COPY --from=build /main /main ENTRYPOINT [ "/main" ] ``` -The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. +The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. **To add RIE to the image** @@ -173,4 +183,4 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. \ No newline at end of file +Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 10f34f47..3d64771e 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -15,8 +15,8 @@ After you create a container image in the Amazon ECR container registry, you can + [Container tools](#images-tools) + [Lambda requirements for container images](#images-reqs) + [Container image settings](#images-parms) -+ [Create an image from an AWS base image for Lambda](#images-create-1) -+ [Create an image from an alternative base image](#images-create-2) ++ [Create an image from an AWS base image for Lambda](#images-create-from-base) ++ [Create an image from an alternative base image](#images-create-from-alt) + [Create an image using the AWS SAM toolkit](#images-create-sam) ## Image types @@ -41,7 +41,7 @@ To deploy a container image to Lambda, note the following requirements: 1. The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. -1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. If you are using an image that requires a writable directory outside of `/tmp`, configure it to write to a directory under the `/tmp` directory\. +1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. 1. The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. @@ -65,7 +65,7 @@ You can specify the container image settings in the Dockerfile when you build yo **Warning** When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sure that you enter the absolute path\. Also, do not use symlinks as the entry point to the container\. -## Create an image from an AWS base image for Lambda +## Create an image from an AWS base image for Lambda To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. @@ -150,7 +150,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. -## Create an image from an alternative base image +## Create an image from an alternative base image **Prerequisites** + The AWS CLI diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 8504098f..4ce6881d 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -101,7 +101,7 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local 1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. -1. Copy the script, install the emulator package and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: ``` COPY ./entry_script.sh /entry_script.sh @@ -145,4 +145,4 @@ You install the runtime interface emulator to your local machine\. When you run curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' ``` - This command invokes the function running in the container image and returns a response\. + This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index 7a2b41ed..ef9fea9a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -128,6 +128,7 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + [Using AWS Lambda with Amazon SES](services-ses.md) + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 7b94916b..e6dc8fe7 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -8,10 +8,13 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. -**Topics** -+ [AWS base images for Java](#java-image-base) -+ [Using a Java base image](#java-image-instructions) -+ [Java runtime interface clients](#java-image-clients) +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. ## AWS base images for Java @@ -48,4 +51,11 @@ Install the runtime interface client for Java using the Apache Maven package man For package details, see [Lambda RIC](https://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. -You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. \ No newline at end of file +You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. + +After your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. + +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) ++ [Java runtime interface clients](#java-image-clients) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index fbe5224f..9a25d4b8 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -17,8 +17,8 @@ The following table describes the important changes to the *AWS Lambda Developer | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | -| [Support for \.NET Core 3\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | +| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | @@ -49,12 +49,12 @@ The following table describes the important changes to the *AWS Lambda Developer | [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | -| [ GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | -| [Moved SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | +| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | -| [Support for PowerShell Core language in ](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | -| [Support for \.NET Core 2\.1\.0 runtime in ](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | +| [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | +| [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | | [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | | [Support for Amazon SQS as event source](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Amazon Simple Queue Service \(Amazon SQS\) as an event source\. For more information, see [Invoking Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss)\. | June 28, 2018 | | [China \(Ningxia\) Region](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the China \(Ningxia\) Region\. For more information about Lambda Regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html?icmpid=docs_lambda_rss) in the *AWS General Reference*\. | June 28, 2018 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index 601fb137..f7d76415 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -70,6 +70,7 @@ For more information about Lambda service architectures, see [Event driven archi + [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) + [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Amazon Simple Storage Service Batch](services-s3-batch.md) ++ [Secrets Manager](with-secrets-manager.md) For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 49d69fcc..60c1a5ee 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Node\.js AWS provides the following base images for Node\.js: diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md index a9827dd4..8b640b5a 100644 --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](https://docs.aws.amazon.com/documentation/powershell/?id=docs_gateway)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. ## Returning data diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 5b7c5dc1..6c21dc9b 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -11,6 +11,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Python AWS provides the following base images for Python: @@ -64,8 +72,8 @@ When you build a container image for Python using an AWS base image, you only ne CMD ["app.handler"] ``` -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-1.title)\. +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. -## Create a Python image from an alternative base image +## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 29d147cb..3cb98410 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -8,6 +8,14 @@ You can deploy your Lambda function code as a [container image](images-create.md If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. +The workflow for a function defined as a container image includes these steps: + +1. Build your container image using the resources listed in this topic\. + +1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. + +1. [Create](configuration-images.md) the Lambda function and deploy the image\. + ## AWS base images for Ruby AWS provides the following base images for Ruby: diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md new file mode 100644 index 00000000..0dd06a0a --- /dev/null +++ b/doc_source/with-secrets-manager.md @@ -0,0 +1,15 @@ +# Using AWS Lambda with Secrets Manager + +Secrets Manager uses a Lambda function to [ rotate the secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) for a secured service or database\. You can customize the Lambda function to implement the service\-specific details of rotating a secret\. + +Secrets Manager invokes the Lambda rotation function as a synchronous invocation\. The event parameter contains the following fields: + +``` +{ + "Step" : "request.type", + "SecretId" : "string", + "ClientRequestToken" : "string" +} +``` + +For more information about using Lambda with Secrets Manager, see [Understanding Your Lambda rotation function](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-lambda-function-customizing.html)\. \ No newline at end of file From 3b408fe4da597a1f12b8bd4915d3ac68c71032a5 Mon Sep 17 00:00:00 2001 From: Jiahao Date: Tue, 15 Jun 2021 16:54:41 -0700 Subject: [PATCH 109/243] Remove Unused Variable `logger` is unused since `Util.logEnvironment()` is doing the logging. Remove the unused Logger here. --- .../java-events/src/main/java/example/HandlerApiGateway.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java index d417e28f..a13d63e0 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java @@ -18,7 +18,6 @@ public class HandlerApiGateway implements RequestHandler Date: Tue, 15 Jun 2021 19:22:00 -0700 Subject: [PATCH 110/243] Remove unused import --- .../java-events/src/main/java/example/HandlerApiGateway.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java index a13d63e0..76df1e1e 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; From 2e781c600131f0fe5e2498d58a95c7ac2a540f69 Mon Sep 17 00:00:00 2001 From: Rafael CP Date: Sat, 26 Jun 2021 19:04:02 -0300 Subject: [PATCH 111/243] fix: use payload file protocol accordingly Aws Cli version --- sample-apps/blank-csharp/3-invoke.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/blank-csharp/3-invoke.sh b/sample-apps/blank-csharp/3-invoke.sh index 85db0bb9..85ab68d9 100755 --- a/sample-apps/blank-csharp/3-invoke.sh +++ b/sample-apps/blank-csharp/3-invoke.sh @@ -1,9 +1,9 @@ #!/bin/bash set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-csharp --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) - +if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi; while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD_PROTOCOL://event.json out.json cat out.json echo "" sleep 2 From a33a6f2c1a1158e4bc24f5d5a5b1cb906e45fc2e Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 28 Jun 2021 15:45:16 -0700 Subject: [PATCH 112/243] doc updates --- doc_source/API_ListEventSourceMappings.md | 2 +- doc_source/configuration-images.md | 36 ++++++------- doc_source/csharp-exceptions.md | 17 ++----- doc_source/csharp-handler.md | 2 +- doc_source/csharp-logging.md | 3 +- doc_source/csharp-package-cli.md | 6 ++- doc_source/gettingstarted-awscli.md | 2 +- doc_source/golang-exceptions.md | 17 ++----- doc_source/golang-handler.md | 2 +- doc_source/golang-logging.md | 3 +- doc_source/invocation-async.md | 8 ++- doc_source/java-exceptions.md | 17 ++----- doc_source/java-logging.md | 3 +- doc_source/lambda-releases.md | 1 + .../monitoring-functions-access-metrics.md | 2 +- doc_source/nodejs-exceptions.md | 17 ++----- doc_source/nodejs-logging.md | 3 +- doc_source/powershell-exceptions.md | 17 ++----- doc_source/powershell-logging.md | 3 +- doc_source/python-exceptions.md | 17 ++----- doc_source/python-image.md | 34 +++++++++++++ doc_source/python-logging.md | 3 +- doc_source/python-package-create.md | 50 ++++++++++--------- doc_source/ruby-exceptions.md | 17 ++----- doc_source/ruby-logging.md | 3 +- doc_source/runtimes-extensions-api.md | 3 +- doc_source/services-apigateway-tutorial.md | 6 +-- doc_source/services-xray.md | 6 +++ doc_source/using-extensions.md | 2 +- doc_source/with-android-example.md | 6 +-- doc_source/with-ddb-example.md | 7 +-- doc_source/with-kinesis-example.md | 6 +-- doc_source/with-s3-example.md | 5 +- doc_source/with-s3-tutorial.md | 33 +++--------- doc_source/with-sns-create-package.md | 2 +- doc_source/with-sns-example.md | 28 +++++------ doc_source/with-sqs-example.md | 6 +-- 37 files changed, 185 insertions(+), 210 deletions(-) diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 7ff4f8fe..fc36e832 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -36,7 +36,7 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} A pagination token returned by a previous call\. ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** -The maximum number of event source mappings to return\. +The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. ## Request Body diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index afcfaddc..d68f2173 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -13,7 +13,7 @@ In Amazon ECR, if you reassign the image tag to another image, Lambda does not u **Topics** + [Function version $LATEST](#configuration-images-latest) + [Container image deployment](#configuration-images-optimization) -+ [Update the user permissions](#configuration-images-permissions) ++ [Amazon ECR permissions](#configuration-images-permissions) + [Override the container settings](#configuration-images-settings) + [Creating a function \(console\)](#configuration-images-create) + [Updating the function code \(console\)](#configuration-images-update) @@ -33,30 +33,30 @@ For more information about managing versions, see [Lambda function versions](con When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. -## Update the user permissions +## Amazon ECR permissions -Make sure that the permissions for the AWS Identity and Access Management \(IAM\) user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. - -For example, use the IAM console to create a role with the following policy: +For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minumum policy: ``` { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "ecr:SetRepositoryPolicy", - "ecr:GetRepositoryPolicy", - "ecr:InitiateLayerUpload" - ], - "Resource": "arn:aws:ecr:::repository//" - } - ] + "Sid": "LambdaECRImageRetrievalPolicy", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ] } ``` +For more information about Amazon ECR repository permissions, see [Repository policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) in the *Amazon Elastic Container Registry User Guide*\. + +If the Amazon ECR repository does not include these permissions, Lambda adds `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` to the container image repository permissions\. Lambda can add these permissions only if the Principal calling Lambda has `ecr:getRepositoryPolicy` and `ecr:setRepositoryPolicy` permissions\. + +To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. + ## Override the container settings You can use the Lambda console or the Lambda API to override the following container image settings: diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3e1a65f4..ff338602 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -179,21 +179,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 88ff9be2..10818ea5 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -97,7 +97,7 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the name of the folder that contains your \.csproj file once the build is complete\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the folder name is `HelloWorldApp`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the \.csproj file is `HelloWorldApp.csproj`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 2e53e534..eb775c10 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -151,10 +151,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index 85cf3997..381751e5 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -167,14 +167,16 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + ``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" ``` If everything is successful, you see the following: ``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" Payload: "JUST CHECKING IF EVERYTHING IS OK" diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index e71c6056..b145cf67 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -185,7 +185,7 @@ This example requires that `my-function` returns a log stream ID\. ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 0be634ea..a2c01bb6 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -97,21 +97,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index c3c80996..bf6475de 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -113,7 +113,7 @@ The following lists valid handler signatures\. `TIn` and `TOut` represent types + ``` - func (TIn), error + func (TIn) error ``` + diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 5f8da42a..88cdb341 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,10 +136,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index b1611c5d..e3a39d64 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -9,9 +9,15 @@ The following diagram shows clients invoking a Lambda function asynchronously\. For asynchronous invocation, Lambda places the event in a queue and returns a success response without additional information\. A separate process reads events from the queue and sends them to your function\. To invoke a function asynchronously, set the invocation type parameter to `Event`\. ``` -aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json +aws lambda invoke \ + --function-name my-function \ + --invocation-type Event \ + --cli-binary-format raw-in-base64-out \ + --payload '{ "key": "value" }' response.json ``` +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + You should see the following output: ``` diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index cf8cadf2..b597748e 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -159,21 +159,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index c8da6366..6e6600ef 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,10 +150,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 9a25d4b8..dc4829a1 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | | [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | | [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md index ec584aa9..015532fb 100644 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -25,7 +25,7 @@ You can use the Lambda console's monitoring dashboard to monitor your Lambda fun The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** -+ **Invocations** – The number of times that the function was invoked in each 5\-minute period\. ++ **Invocations** – The number of times that the function was invoked\. + **Duration** – The average, minimum, and maximum execution times\. + **Error count and success rate \(%\)** – The number of errors and the percentage of executions that completed without error\. + **Throttles** – The number of times that execution failed due to concurrency limits\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 0955df5f..bcb6fab3 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -92,21 +92,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 6f0b9f5f..18f012c4 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,10 +129,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index bddd1d85..04a07bb0 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -116,21 +116,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 1c5ab1ea..4df8aab8 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,10 +139,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index ef389967..23085fbb 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -71,21 +71,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 6c21dc9b..b7f6ee42 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -19,6 +19,12 @@ The workflow for a function defined as a container image includes these steps: 1. [Create](configuration-images.md) the Lambda function and deploy the image\. +**Topics** ++ [AWS base images for Python](#python-image-base) ++ [Python runtime interface clients](#python-image-clients) ++ [Deploying Python with an AWS base image](#python-image-create) ++ [Create a Python image from an alternative base image](#python-image-create-alt) + ## AWS base images for Python AWS provides the following base images for Python: @@ -74,6 +80,34 @@ When you build a container image for Python using an AWS base image, you only ne 1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. +### Adding dependencies when you create a Python image + +If your Lambda function depends on external Python libraries, modify the previous procedure as follows: + +1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. + +1. Modify your Dockerfile to add the required libraries to the container image\. The following example copies the requirements file and installs the required libraries into the `app` directory\. Do not install the dependencies globally or in user space\. + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + # Create function directory + WORKDIR /app + + # Install the function's dependencies + # Copy file requirements.txt from your project folder and install + # the requirements in the app directory. + + COPY requirements.txt . + RUN pip3 install -r requirements.txt + + # Copy handler function (from the local app directory) + COPY app.py . + + # Overwrite the command by providing a different command directly in the template. + CMD ["/app/app.handler"] + ``` + ## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index c8d3710a..46c2c9e6 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,10 +121,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 417d545e..61ca477b 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -83,6 +83,14 @@ A dependency can be any package, module or other assembly dependency that is not This section describes how to create a Lambda function without runtime dependencies\. +**Topics** ++ [Overview](#python-package-create-about-no-dependency) ++ [Create the deployment package](#python-package-create-package-no-dependency) ++ [Create the Lambda function](#python-package-create-createfunction-no-dependency) ++ [Invoke the Lambda function](#python-package-create-invokefunction-no-dependency) ++ [What's next?](#python-package-create-next-no-dependency) ++ [Clean up your resources](#python-package-create-cleanup-no-dependency) + ### Overview In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: @@ -187,14 +195,13 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i + Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ``` - aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt + aws lambda invoke \ + --function-name my-math-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"action": "square","number": 3}' output.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) This command produces the following output: @@ -253,6 +260,14 @@ For more information, see [What is a runtime dependency?](python-package.md#pyth This section describes how to create a Lambda function with runtime dependencies\. +**Topics** ++ [Overview](#python-package-create-about) ++ [Create the deployment package](#python-package-create-package-with-dependency) ++ [Create the Lambda function](#python-package-create-createfunction-with-dependency) ++ [Invoke the Lambda function](#python-package-create-invokefunction-with-dependency) ++ [What's next?](#python-package-create-next-with-dependency) ++ [Clean up your resources](#python-package-create-cleanup-with-dependency) + ### Overview In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. @@ -384,27 +399,14 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i **To invoke the function** + Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. ------- -#### [ macOS/Linux ] - ``` - aws lambda invoke --function-name my-sourcecode-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt + aws lambda invoke \ + --function-name my-sourcecode-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- -#### [ Windows ] - - ``` - aws lambda invoke --function-name my-sourcecode-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt - ``` - ------- -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) This command produces the following output: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index e28640b7..6a9b9ff9 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -93,21 +93,14 @@ When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the respons The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. ------- -#### [ mac OS/Linux OS ] - -``` -aws lambda invoke --function-name my-function --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - ------- -#### [ Windows OS ] - ``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt +aws lambda invoke \ + --function-name my-function \ + --cli-binary-format raw-in-base64-out \ + --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` ------- +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 12d7b277..02f53e70 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,10 +151,11 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ``` #!/bin/bash -aws lambda invoke --function-name my-function --payload '{"key": "value"}' out +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index b2c45236..96f68152 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -10,6 +10,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) ++ Go 1\.x \(`go1.x`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) + Node\.js 14\.x \(`nodejs14.x`\) @@ -107,7 +108,7 @@ Here is an example payload: **Note** Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. -To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExecutionDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 3e190953..32b02804 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -253,12 +253,8 @@ Invoke the function manually using the sample event data\. We recommend that you aws lambda invoke --function-name LambdaFunctionOverHttps \ --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ## Create an API using Amazon API Gateway diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 402690ca..c509f9e0 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -37,6 +37,12 @@ The `Invocation` subsegment represents the invoke phase where Lambda invokes the The `Overhead` subsegment represents the phase that occurs between the time when the runtime sends the response and the signal for the next invoke\. During this time, the runtime finishes all tasks related to an invoke and prepares to freeze the sandbox\. + + +**Note** +If your Lambda function uses [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), your X\-Ray trace might display a function initialization with a very long duration\. +Provisioned concurrency initializes function instances in advance, to reduce lag at the time of invocation\. Over time, provisioned concurrency refreshes these instances by creating new instances to replace the old ones\. For workloads with steady traffic, the new instances are initialized well in advance of their first invocation\. The time gap gets recorded in the X\-Ray trace as the initialization duration\. + The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index c1889ca0..5d6b1af5 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -53,7 +53,7 @@ Extensions can impact the performance of your function because they share functi Each extension must complete its initialization before Lambda invokes the function\. Therefore, an extension that consumes significant initialization time can increase the latency of the function invocation\. -To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExecutionDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. +To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExtensionsDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. ## Permissions diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index b0312a74..8389bf61 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -98,12 +98,8 @@ Invoke the function manually using the sample event data\. aws lambda invoke --function-name AndroidBackendLambdaFunction \ --payload file://file-path/input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index d4413760..f26f7fb4 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,12 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - -``` ---cli-binary-format raw-in-base64-out -``` +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The function returns the string `message` in the response body\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 36f9a21e..1efb74d3 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -123,12 +123,8 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a ``` aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The response is saved to `out.txt`\. diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 0c547d52..9f6c28d6 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -242,7 +242,10 @@ Invoke your function when you upload a file to the Amazon S3 source bucket\. 1. Choose the name of your function \(**my\-s3\-function**\)\. -1. Choose the **Monitor** tab, then verify that the function ran once for each file that you uploaded\. +1. To verify that the function ran once for each file that you uploaded, choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. The count in the **Invocations** graph should match the number of files that you uploaded to the Amazon S3 bucket\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. 1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 189fedf9..11e3265d 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -488,12 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -507,12 +502,7 @@ If you are using AWS CLI version 2, add the following command parameter: --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -526,12 +516,7 @@ If you are using AWS CLI version 2, add the following command parameter: --role arn:aws:iam::123456789012:role/lambda-s3-role ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -595,15 +580,13 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - aws lambda invoke --function-name CreateThumbnail --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt + aws lambda invoke + --function-name CreateThumbnail \ + --invocation-type Event \ + --payload file://inputFile.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md index 8f44c052..25919e17 100644 --- a/doc_source/with-sns-create-package.md +++ b/doc_source/with-sns-create-package.md @@ -32,7 +32,7 @@ Zip up the sample code to create a deployment package\. For instructions, see [D The following example processes messages from Amazon SNS, and logs their contents\. -**Example LambdaWithSNS\.java** +**Example LogEvent\.java** ``` package example; diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index c048cb30..03e2fffe 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -29,7 +29,7 @@ In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by From account A \(01234567891A\), create the source Amazon SNS topic\. ``` -aws sns create-topic --name lambda-x-account --profile accountA +aws sns create-topic --name sns-topic-for-lambda --profile accountA ``` Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. @@ -85,7 +85,7 @@ exports.handler = function(event, context, callback) { 1. Create a Lambda function with the `create-function` command\. ``` - aws lambda create-function --function-name SNS-X-Account \ + aws lambda create-function --function-name Function-With-SNS \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB @@ -99,16 +99,16 @@ From account A \(01234567891A\), grant permission to account B \(01234567891B\) ``` aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ --action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. ``` -aws lambda add-permission --function-name SNS-X-Account \ ---source-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---statement-id sns-x-account --action "lambda:InvokeFunction" \ +aws lambda add-permission --function-name Function-With-SNS \ +--source-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--statement-id function-with-sns --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB ``` @@ -117,11 +117,11 @@ You should see the following output: ``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:sns:us-east-2:12345678901A:lambda-x-account\"}}, + \"arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:SNS-X-Account\", + \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:Function-With-SNS\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, - \"Sid\":\"sns-x-account1\"}" + \"Sid\":\"function-with-sns1\"}" } ``` @@ -132,12 +132,12 @@ If the account with the SNS topic is hosted in an opt\-in region, you need to sp ## Create a subscription -From account B, subscribe the Lambda function to the topic\. When a message is sent to the `lambda-x-account` topic in account A \(01234567891A\), Amazon SNS invokes the `SNS-X-Account` function in account B \(01234567891B\)\. +From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. ``` aws sns subscribe --protocol lambda \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ ---notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:SNS-X-Account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:Function-With-SNS \ --profile accountB ``` @@ -145,7 +145,7 @@ You should see the following output: ``` { - "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:lambda-x-account:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" + "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } ``` @@ -157,7 +157,7 @@ From account A \(01234567891A\), test the subscription\. Type `Hello World` into ``` aws sns publish --message file://message.txt --subject Test \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:lambda-x-account \ +--topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ --profile accountA ``` diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index b226fdea..87cd8e43 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -113,12 +113,8 @@ If the handler returns normally without exceptions, Lambda considers the message aws lambda invoke --function-name ProcessSQSRecord \ --payload file://input.txt outputfile.txt ``` -**Note** -If you are using AWS CLI version 2, add the following command parameter: - ``` - --cli-binary-format raw-in-base64-out - ``` + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) 1. Verify the output in the `outputfile.txt` file\. From e0af1ee737a7c1ed14682d374d2ddd8e0a6cfd4a Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 8 Jul 2021 13:51:14 -0700 Subject: [PATCH 113/243] MQ event source now supports RabbitMQ. Other updates --- doc_source/API_CreateEventSourceMapping.md | 22 +- doc_source/API_DeleteEventSourceMapping.md | 20 +- .../API_EventSourceMappingConfiguration.md | 22 +- doc_source/API_GetEventSourceMapping.md | 20 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 18 +- doc_source/API_UpdateEventSourceMapping.md | 22 +- doc_source/configuration-aliases.md | 4 +- doc_source/index.md | 2 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-releases.md | 2 + doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 8 +- doc_source/python-package-create.md | 4 +- doc_source/python-package-update.md | 6 +- doc_source/python-package.md | 2 +- doc_source/runtimes-extensions-api.md | 5 +- doc_source/runtimes-images.md | 7 +- doc_source/troubleshooting-execution.md | 3 + doc_source/troubleshooting-invocation.md | 6 + doc_source/using-extensions.md | 4 +- doc_source/with-kafka.md | 354 +++++++++++------- doc_source/with-mq.md | 187 +++++---- doc_source/with-msk.md | 152 ++++++-- 25 files changed, 549 insertions(+), 329 deletions(-) diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c1f14b5d..c10c1f12 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -164,7 +164,7 @@ Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of authentication protocols or VPC components required to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -278,15 +278,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -301,28 +301,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -335,7 +335,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -346,7 +346,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 96159677..9a7ed927 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -106,15 +106,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -129,28 +129,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -163,7 +163,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -174,7 +174,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 0719b9c9..b035d9d8 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,6 +1,6 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and an AWS Lambda function\. See [CreateEventSourceMapping](API_CreateEventSourceMapping.md) for details\. +A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. ## Contents @@ -40,17 +40,17 @@ Valid Values:` ReportBatchItemFailures` Required: No **LastModified** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp Required: No **LastProcessingResult** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String Required: No **MaximumBatchingWindowInSeconds** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -68,13 +68,13 @@ Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No **ParallelizationFactor** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No **Queues** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. @@ -82,18 +82,18 @@ Pattern: `[\s\S]*` Required: No **SelfManagedEventSource** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No **SourceAccessConfigurations** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No **StartingPosition** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No @@ -109,7 +109,7 @@ Type: String Required: No **StateTransitionReason** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String Required: No @@ -122,7 +122,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No **TumblingWindowInSeconds** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f1e2f959..b23d8210 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -104,15 +104,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -127,28 +127,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -161,7 +161,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -172,7 +172,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index cdf08843..0c6fbb53 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -1,6 +1,6 @@ # SelfManagedEventSource -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. ## Contents diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 06601520..4cb6fbc6 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -1,18 +1,20 @@ # SourceAccessConfiguration -You can specify the authentication protocol, or the VPC components to secure access to your event source\. +To secure and define access to your event source, you can specify the authentication protocol, VPC components, or virtual host\. ## Contents **Type** -The type of authentication protocol or the VPC components for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. -+ `BASIC_AUTH` \- \(MQ\) The Secrets Manager secret that stores your broker credentials\. -+ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your Self\-Managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your Self\-Managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your Self\-Managed Apache Kafka brokers\. +The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. ++ `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. ++ `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. ++ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your self\-managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. ++ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No **URI** diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 00dad8a2..b834fc9f 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -127,7 +127,7 @@ Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of authentication protocols or VPC components required to secure your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -222,15 +222,15 @@ Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated, or its state changed, in Unix time seconds\. +The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The result of the last AWS Lambda invocation of your Lambda function\. +The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. +\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -245,28 +245,28 @@ Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. The default value is 1\. +\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. + \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The Self\-Managed Apache Kafka cluster for your event source\. +The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, or the VPC components to secure your event source\. +An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` @@ -279,7 +279,7 @@ The state of the event source mapping\. It can be one of the following: `Creatin Type: String ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** -Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service\. +Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -290,7 +290,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 769e0491..1ceeea73 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -86,6 +86,8 @@ For more information about using resource names in policies, see [Resources and Use routing configuration on an alias to send a portion of traffic to a second function version\. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version\. +Note that Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. + You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: + Both versions must have the same [execution role](lambda-intro-execution-role.md)\. + Both versions must have the same [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) configuration, or no dead\-letter queue configuration\. @@ -117,7 +119,7 @@ Verify that the function has at least two published versions\. To create additio 1. Choose **Save**\. -### Configuring alias routing +### Configuring alias routing using CLI Use the `create-alias` and `update-alias` AWS CLI commands to configure the traffic weights between two function versions\. When you create or update the alias, you specify the traffic weight in the `routing-config` parameter\. diff --git a/doc_source/index.md b/doc_source/index.md index ef9fea9a..b4ce81fa 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -112,7 +112,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Amazon EFS with Lambda](services-efs.md) + [Using AWS Lambda with AWS IoT](services-iot.md) + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) - + [Using Lambda with an Apache Kafka cluster](with-kafka.md) + + [Using Lambda with self-managed Apache Kafka](with-kafka.md) + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 15a739c4..8ebd736e 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -7,7 +7,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 525bb027..bce78b63 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -146,7 +146,7 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index dc4829a1..d8ea2dd7 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,8 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | +| [SASL/PLAIN authentication for self\-managed Kafka on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss) | SASL/PLAIN is now a supported authentication mechanism for self\-managed Kafka event sources on Lambda Customers already using SASL/PLAIN on their self\-managed Kafka cluster can now easily use Lambda to build consumer applications without having to modify the way they authenticate\. For details, see [Using Lambda with self\-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss)\. | June 29, 2021 | | [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | | [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index f7d76415..c51eea66 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -53,7 +53,7 @@ For services that generate a queue or data stream, you create an [event source m + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) + [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md#kafka-smaa) ++ [self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service](with-sqs.md) Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index b17ff9c9..8c6012d6 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -6,6 +6,9 @@ You can insert logging statements into your code to help you validate that your You can view logs for Lambda functions using the Lambda console, the CloudWatch console, the AWS Command Line Interface \(AWS CLI\), or the CloudWatch API\. This page describes how to view logs using the Lambda console\. +**Note** +It may take 5 to 10 minutes for logs to show up after a function invocation\. + **Topics** + [Prerequisites](#monitoring-cloudwatchlogs-prereqs) + [Pricing](#monitoring-cloudwatchlogs-pricing) @@ -31,16 +34,13 @@ The following section describes how to view logs for your function on the Lambda 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose **Monitor**\. ![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/) A graphical representation of the metrics for the Lambda function are shown\. 1. Choose **View logs in CloudWatch**\. -**Note** -Logs may not be immediately available after invocation\. We recommend waiting 5 to 10 minutes before checking your execution role\. - ## Using the AWS CLI To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. For language\-specific instructions, see the following topics: diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 61ca477b..80ee105a 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -77,7 +77,7 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AW ## Creating a function without runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) @@ -254,7 +254,7 @@ You can now delete the resources that you created for this tutorial, unless you ## Creating a function with runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md index e6ea38a0..b94099d2 100644 --- a/doc_source/python-package-update.md +++ b/doc_source/python-package-update.md @@ -18,7 +18,7 @@ The AWS CLI is an open\-source tool that enables you to interact with AWS servic ## Updating a function without runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. @@ -54,7 +54,7 @@ The Lambda function in this step uses a function handler of `lambda_function.lam ## Updating a function with runtime dependencies -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. @@ -134,7 +134,7 @@ The Lambda function in this step uses a function handler of `lambda_function.lam ## Using a virtual environment -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. diff --git a/doc_source/python-package.md b/doc_source/python-package.md index daaff8a8..cf4e4866 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -31,7 +31,7 @@ The AWS CLI is an open\-source tool that enables you to interact with AWS servic A [deployment package](gettingstarted-package.md) is required to create or update a Lambda function with or without runtime dependencies\. The deployment package acts as the source bundle to run your function's code and dependencies \(if applicable\) on Lambda\. -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. For more information, see [What is a runtime dependency?](#python-package)\. +A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. The following example describes a Lambda function without runtime dependencies: + If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 96f68152..8792ad16 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -6,11 +6,10 @@ As an extension author, you can use the Lambda Extensions API to integrate deepl An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. -The following [Lambda runtimes](lambda-runtimes.md) support external extensions: +The following [Lambda runtimes](lambda-runtimes.md) support extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Go 1\.x \(`go1.x`\) + Java 11 \(Corretto\) \(`java11`\) + Java 8 \(Corretto\) \(`java8.al2`\) + Node\.js 14\.x \(`nodejs14.x`\) @@ -21,6 +20,8 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) +Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. + Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](using-extensions.md#invocation-extensions-images) to your container image\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index 2a097aed..9f42c839 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -4,6 +4,7 @@ AWS provides a set of open\-source base images that you can use\. You can also u **Topics** + [AWS base images for Lambda](#runtimes-images-lp) ++ [Base images for custom runtimes](#runtimes-images-custom) + [Runtime interface clients](#runtimes-api-client) + [Runtime interface emulator](#runtimes-test-emulator) @@ -21,7 +22,7 @@ Lambda provides base images for the following runtimes: + [Go](go-image.md) + [Ruby](ruby-image.md) -### Base images for custom runtimes +## Base images for custom runtimes AWS provides base images that contain the required Lambda components and the Amazon Linux or Amazon Linux2 operating system\. You can add your preferred runtime, dependencies and code to these images\. @@ -39,7 +40,7 @@ ECR Public: public\.ecr\.aws/lambda/provided The runtime interface client in your container image manages the interaction between Lambda and your function code\. The [Runtime API](runtimes-api.md), along with the [ Extensions API](runtimes-extensions-api.md), defines a simple HTTP interface for runtimes to receive invocation events from Lambda and respond with success or failure indications\. -Each of the AWS base images for Lambda include a runtime interface client\. If you choose an alternative base image, you need to add the appropriate runtime interface client\. +Each of the AWS base images for Lambda include a runtime interface client\. If you choose one of the base images for custom runtimes or an alternative base image, you need to add the appropriate runtime interface client\. For your convenience, Lambda provides an open source runtime interface client for each of the supported Lambda runtimes: + [Node\.js](nodejs-image.md#nodejs-image-clients) @@ -51,4 +52,4 @@ For your convenience, Lambda provides an open source runtime interface client fo ## Runtime interface emulator -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index be5f6ba8..07078be7 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -24,6 +24,9 @@ Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [ When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +**Note** +It may take 5 to 10 minutes for logs to show up after a function invocation\. + ## Lambda: The function returns before execution finishes **Issue: \(Node\.js\)** *Function returns before code finishes executing* diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 27afc2dc..04a7bfc4 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -54,6 +54,12 @@ You grant [other services](lambda-services.md) and accounts permission to invoke This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +## Lambda: Alias routing with provisioned concurrency + +**Issue:** *Provisioned concurrency spillover invocations during alias routing\.* + +Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. + ## Lambda: Cold starts with provisioned concurrency **Issue:** *You see cold starts after enabling provisioned concurrency\.* diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 5d6b1af5..6b72a4eb 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -8,7 +8,7 @@ An internal extension runs as part of the runtime process\. Your function access You can add extensions to a function using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. -The following [Lambda runtimes](lambda-runtimes.md) support external extensions: +The following [Lambda runtimes](lambda-runtimes.md) support extensions: + \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) + Custom runtime \(`provided`\) + Custom runtime on Amazon Linux 2 \(`provided.al2`\) @@ -22,6 +22,8 @@ The following [Lambda runtimes](lambda-runtimes.md) support external extensions: + Ruby 2\.7 \(`ruby2.7`\) + Ruby 2\.5 \(`ruby2.5`\) +Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. + You are charged for the execution time that the extension consumes \(in 1 ms increments\)\. For more pricing information for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information for partner extensions, see those partners' websites\. There is no cost to install your own extensions\. **Topics** diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index 7921d071..c56a6ffc 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -1,237 +1,301 @@ -# Using Lambda with an Apache Kafka cluster +# Using Lambda with self\-managed Apache Kafka -[Apache Kafka](https://kafka.apache.org/) is a distributed data store optimized for ingesting and processing streaming data in real time\. +Lambda supports [Apache Kafka](https://kafka.apache.org/) as an [event source](invocation-eventsourcemapping.md)\. Apache Kafka is a an open\-source event streaming platform that supports workloads such as data pipelines and streaming analytics\. -Kafka is primarily used to build streaming data pipelines and applications that adapt to the data streams\. It combines messaging, storage, and stream processing to allow storage and analysis of both historical and real\-time data\. +You can use the AWS managed Kafka service Amazon Managed Streaming for Apache Kafka \(Amazon MSK\), or a self\-managed Kafka cluster\. For details about using Lambda with Amazon MSK, see [Using Lambda with Amazon MSK](with-msk.md)\. -AWS provides a managed Kafka service, or you can use a non\-AWS Kafka cluster with Lambda\. +This topic describes how to use Lambda with a self\-managed Kafka cluster\. In AWS terminology, a self\-managed cluster includes non\-AWS hosted Kafka clusters\. For example, you can host your Kafka cluster with a cloud provider such as [CloudKarafka](https://www.cloudkarafka.com/)\. You can also use other AWS hosting options for your cluster\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. + +Apache Kafka as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) + +For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. + + + +Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. + +``` +{ "eventSource": "aws:kafka", + "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records": { + "mytopic-0": [ + { + "topic": "mytopic" + "partition": "0", + "offset": 15, + "timestamp": 1545084650987, + "timestampType": "CREATE_TIME", + "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + } + ] + } +} +``` **Topics** -+ [Hosting an Apache Kafka cluster](#kafka-hosting) -+ [Using an Apache Kafka cluster as an event source for Lambda](#kafka-using-cluster) -+ [Using Lambda with self\-managed Apache Kafka](#kafka-smaa) ++ [Managing access and permissions](#smaa-permissions) ++ [Kafka authentication](#smaa-authentication) ++ [Network configuration](#services-msk-vpc-config) ++ [Adding a Kafka cluster as an event source](#services-smaa-topic-add) ++ [Using a Kafka cluster as an event source](#kafka-using-cluster) ++ [Auto scaling of the Kafka event source](#services-kafka-scaling) ++ [Event source API operations](#kafka-hosting-api-operations) ++ [Event source mapping errors](#services-event-errors) ++ [Event source configuration parameters](#services-msk-parms) -## Hosting an Apache Kafka cluster +## Managing access and permissions -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. +For Lambda to poll your Apache Kafka topic and update other cluster resources, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have the following permissions\. -### Using Amazon MSK +### Required Lambda function permissions -To host your Apache Kafka cluster and topics, you can use [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)\. +To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) -For more information about using an MSK cluster, see [Using Lambda with Amazon MSK](with-msk.md)\. +### Optional Lambda function permissions -### Using a self\-managed Kafka provider +Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed customer master key \(CMK\)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. -To host your Apache Kafka cluster and topics, you can use any non\-AWS cloud provider, such as [CloudKarafka](https://www.cloudkarafka.com/)\. +#### Secrets Manager and AWS KMS permissions -You can also use other AWS hosting options for your Apache Kafka cluster and topics\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. +If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) ++ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) -For more information about using a self\-managed Kafka cluster, see [Using Lambda with self\-managed Apache Kafka](#kafka-smaa)\. +#### VPC permissions -## Using an Apache Kafka cluster as an event source for Lambda +If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) +### Adding permissions to your execution role +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. -You can host an Apache Kafka cluster on AWS, or on any other cloud provider of your choice\. Lambda supports Kafka as an [event source](invocation-eventsourcemapping.md) regardless of where it is hosted, as long as Lambda can access the cluster\. +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. -### Prerequisites -+ A [Lambda function](getting-started-create-function.md) with function code in a [supported runtime](lambda-runtimes.md) to invoke your cluster -+ A [Lambda execution role](lambda-intro-execution-role.md) +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" + } + ] + } +``` -### How it works +For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +### Adding users to an IAM policy +By default, IAM users and roles do not have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. -When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. When you add your Kafka cluster and topic as an event source, Lambda creates a consumer group with an event source `UUID`\. -+ If you use an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-EventSourceArn), Lambda reads event data using the Amazon MSK cluster and the Kafka topic that you specify\. -+ If you use a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as your event source in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SelfManagedEventSource), Lambda reads event data using the Kafka host, topic, and connection details that you specify\. -+ Lambda reads event data from the Kafka topics that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -+ Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -+ Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication for your Kafka brokers\. Lambda uses the SASL/SCRAM user name and password that you specify in your AWS Secrets Manager secret in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-SourceAccessConfigurations)\. -+ +## Kafka authentication -For Amazon MSK and self\-managed Apache Kafka, the maximum amount of time that Lambda allows a function to run before stopping it is 14 minutes\. +Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of the following authentication methods that Lambda supports: ++ VPC -### Event source API operations + If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. ++ SASL/SCRAM -When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS Command Line Interface \(AWS CLI\), Lambda uses APIs to process your request\. + With Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication, the cluster encrypts the credentials using SSL encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. ++ SASL/PLAIN -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. -### Event source mapping errors +For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. -When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. +## Network configuration -To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: +If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources\. -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. +Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda couldn't authenticate the event source\. +Alternatively, ensure that the VPC associated with your Kafka cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda doesn't have the required permissions to access the event source\. +You must configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. ++ Outbound rules – Allow all traffic on all ports for all destinations\. -**`FUNCTION_CONFIG_NOT_VALID`** -The Lambda function configuration is not valid\. +For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. -**Note** -If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. +## Adding a Kafka cluster as an event source -## Using Lambda with self\-managed Apache Kafka +To create an [event source mapping](invocation-eventsourcemapping.md), add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. -You can onboard a non\-AWS hosted Apache Kafka cluster—or an AWS hosted Apache Kafka cluster on another AWS service—as an [event source](invocation-eventsourcemapping.md) for a Lambda function\. This enables you to trigger your functions in response to records sent to your Kafka cluster\. +This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. -**Topics** -+ [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions) -+ [Adding a self\-managed Apache Kafka cluster as an event source](#services-smaa-topic-add) +### Prerequisites ++ A self\-managed Apache Kafka cluster\. Lambda supports Apache Kafka version 0\.10\.0\.0 and later\. ++ A Lambda execution role with permission to access the AWS resources that your self\-managed Kafka cluster uses\. -### Managing access and permissions for a self\-managed Apache Kafka cluster +### Adding a self\-managed Kafka cluster \(console\) -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. +Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. -This page describes how to grant permission to Lambda and other users of your self\-managed Kafka cluster\. +**To add an Apache Kafka trigger to your Lambda function \(console\)** -#### Required Lambda function permissions +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +1. Choose the name of your Lambda function\. -#### Optional Lambda function permissions +1. Under **Function overview**, choose **Add trigger**\. -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed CMK](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. +1. Under **Trigger configuration**, do the following: -##### Secrets Manager and AWS KMS permissions + 1. Choose the **Apache Kafka** trigger type\. -If your Kafka users access your Apache Kafka brokers over the internet, you must specify a Secrets Manager secret\. For more information, see [Using SASL/SCRAM authentication](#smaa-permissions-add-secret)\. + 1. For **Bootstrap servers**, enter the host and port pair address of a Kafka broker in your cluster, and then choose **Add**\. Repeat for each Kafka broker in the cluster\. -Your Lambda function might need permission to describe your Secrets Manager secret or decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) + 1. For **Topic name**, enter the name of the Kafka topic used to store records in the cluster\. -##### VPC permissions + 1. \(Optional\) For **Batch size**, enter the maximum number of records to receive in a single batch\. -If only users within your VPC access your self\-managed Apache Kafka cluster, your Lambda function needs permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources, including your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. + +1. Under **Authentication method**, choose the access or authentication protocol of the Kafka brokers in your cluster\. If only users within your VPC access your Kafka brokers, you must configure VPC access\. If users access your Kafka brokers over the internet, you must configure SASL authentication\. + + To configure VPC access, choose the **VPC** for your Kafka cluster, then choose **VPC subnets** and **VPC security groups**\. + + To configure SASL authentication, under **Secret key**, choose **Add**, then do the following: -#### Adding permissions to your execution role + 1. Choose the key type\. If your Kafka broker uses SASL plaintext, choose **BASIC\_AUTH**\. Otherwise, choose one of the **SASL\_SCRAM** options\. -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permission policies that you define in your function's [execution role](lambda-intro-execution-role.md)\. + 1. Choose the name of the Secrets Manager secret key that contains the credentials for your Kafka cluster\. -By default, Lambda isn't permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. +1. To create the trigger, choose **Add**\. + +### Adding a self\-managed Kafka cluster \(AWS CLI\) + +Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. + +#### Using SASL/SCRAM + +If Kafka users access your Kafka brokers over the internet, you must specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } +aws lambda create-event-source-mapping --topics AWSKafkaTopic + --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName + --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function + --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For information about creating a JSON policy document on the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. -#### Adding users to an IAM policy +#### Using a VPC -By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. +If only Kafka users within your VPC access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. -#### Using SASL/SCRAM authentication +``` +aws lambda create-event-source-mapping + --topics AWSKafkaTopic + --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"}, + {"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"}, + {"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' + --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function + --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", + "abc2.xyz.com:9092"]}}' +``` -**Important** -Plaintext brokers are not supported if you are is using SASL/SCRAM based authentication\. You must use TLS encryption for your brokers\. +For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. -User name and password authentication for a self\-managed Apache Kafka cluster uses Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\)\. SCRAM uses secured hashing algorithms and doesn't transmit plaintext passwords between the client and server\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. +#### Viewing the status using the AWS CLI -To set up user name and password authentication for your self\-managed Kafka cluster, create a secret in AWS Secrets Manager\. Your non\-AWS cloud provider must provide your user name and password in SASL/SCRAM format\. For example: +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -{ - "username": "ab1c23de", - "password": "qxbbaLRG7JXYN4NpNMVccP4gY9WZyDbp" -} +aws lambda get-event-source-mapping + --uuid dh38738e-992b-343a-1077-3478934hjkfd7 ``` -For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. +## Using a Kafka cluster as an event source -### Adding a self\-managed Apache Kafka cluster as an event source +When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. +Lambda reads event data from the Kafka topics that you specify in [ `Topics`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [ `StartingPosition`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. +If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. -#### Prerequisites -+ A non\-AWS hosted Apache Kafka cluster, or an AWS hosted Apache Kafka cluster on another AWS service\. For more information, see [Hosting an Apache Kafka cluster](#kafka-hosting)\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. For more information, see [Managing access and permissions for a self\-managed Apache Kafka cluster](#smaa-permissions)\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. -#### Adding a self\-managed Apache Kafka cluster using the Lambda console +If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. +The maximum amount of time that Lambda lets a function run before stopping it is 14 minutes\. -**To add an Apache Kafka trigger to your Lambda function \(console\)** +## Auto scaling of the Kafka event source -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +When you initially create an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -1. Choose the name of your Lambda function\. +Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. -1. Under **Function overview**, choose **Add trigger**\. +If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. -1. Under **Trigger configuration**, choose the **Apache Kafka** trigger type\. +To monitor the throughput of your Kafka topic, you can view the Apache Kafka consumer metrics, such as `consumer_lag` and `consumer_offset`\. To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. -1. Configure the remaining options, and then choose **Add**\. +## Event source API operations -#### Adding a self\-managed Apache Kafka cluster using the AWS CLI +When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. +To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -##### Using SASL/SCRAM +## Event source mapping errors -If Kafka users access your Kafka brokers over the internet, you must specify your AWS Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` +To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +**`ESM_CONFIG_NOT_VALID`** +The event source mapping configuration is not valid\. -##### Using a VPC +**`EVENT_SOURCE_AUTHN_ERROR`** +Lambda could not authenticate the event source\. -If only Kafka users within your virtual private cloud \(VPC\) access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +**`EVENT_SOURCE_AUTHZ_ERROR`** +Lambda does not have the required permissions to access the event source\. -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"},{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"},{"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` +**`FUNCTION_CONFIG_NOT_VALID`** +The function configuration is not valid\. -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +**Note** +If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -##### Viewing the status +## Event source configuration parameters -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. -``` -aws lambda get-event-source-mapping --uuid dh38738e-992b-343a-1077-3478934hjkfd7 -``` \ No newline at end of file + +**Event source parameters that apply to self\-managed Apache Kafka** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10,000 | +| DestinationConfig | N | none | | +| Enabled | N | Enabled | | +| KafkaBrokerList | Y | | Can set only on Create | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | Maximum: 300 | +| MaximumRecordAgeInSeconds | N | 604,800 \(7 days\) | Maximum: no limit | +| MaximumRetryAttempts | N | 10,000 | Maximum: no limit | +| ParallelizationFactor | N | 1 | | +| SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | +| Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 5b8a125a..2748d5ca 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -1,21 +1,23 @@ # Using Lambda with Amazon MQ -Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. Lambda only supports Apache ActiveMQ\. A *message broker* allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. +Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. A *message broker* enables software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. -Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ brokers and by providing different network topologies and other infrastructure needs\. +Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ or RabbitMQ brokers and by providing different network topologies and other infrastructure needs\. -You can use a Lambda function to process records from your Amazon MQ message broker\. Your function is triggered through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. +You can use a Lambda function to process records from your Amazon MQ message broker\. Lambda invokes your function through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. The Amazon MQ event source mapping has the following configuration restrictions: -+ Cross account – Cross account processing is not supported\. You cannot use Lambda to process records from an Amazon MQ message broker that is in a different account\. -+ Authentication – Only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. User credentials associated with the broker are the only method of connection\. For more information about authentication, see [Messaging Authentication and Authorization for ActiveMQ](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. ++ Cross account – Lambda does not support cross\-account processing\. You cannot use Lambda to process records from an Amazon MQ message broker that is in a different AWSaccount\. ++ Authentication – For ActiveMQ, only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. For RabbitMQ, only the [PLAIN](https://www.rabbitmq.com/access-control.html#mechanisms) authentication mechanism is supported\. Users must use AWS Secrets Manager to manage their credentials\. For more information about ActiveMQ authentication, see [Integrating ActiveMQ brokers with LDAP](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. + Connection quota – Brokers have a maximum number of allowed connections per wire\-level protocol\. This quota is based on the broker instance type\. For more information, see the [Brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html#broker-limits) section of **Quotas in Amazon MQ** in the *Amazon MQ Developer Guide*\. -+ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to interact with the records\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. -+ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website\. -+ Network topology – Only one single\-instance or standby broker is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Amazon MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) in the *Amazon MQ Developer Guide*\. -+ Protocols – Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. ++ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to receive messages\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. ++ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website, and [Virtual Hosts](https://www.rabbitmq.com/vhosts.html) on the RabbitMQ website\. ++ Network topology – For ActiveMQ, only one single\-instance or standby broker is supported per event source mapping\. For RabbitMQ, only one single\-instance broker or cluster deployment is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Active MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) and [Rabbit MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-broker-architecture.html)in the *Amazon MQ Developer Guide*\. ++ Protocols – Supported protocols depend on the type of Amazon MQ integration\. + + For ActiveMQ integrations, Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported for consuming messages\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. + + For RabbitMQ integrations, Lambda consumes messages using the AMQP 0\-9\-1 protocol\. No other protocols are supported for consuming messages\. For more information about RabbitMQ's implementation of the AMQP 0\-9\-1 protocol, see [AMQP 0\-9\-1 Complete Reference Guide](https://www.rabbitmq.com/amqp-0-9-1-reference.html) on the RabbitMQ website\. -Lambda automatically supports the latest versions of ActiveMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ Release Notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. +Lambda automatically supports the latest versions of ActiveMQ and RabbitMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ release notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. **Note** By default, Amazon MQ has a weekly maintenance window for brokers\. During that window of time, brokers are unavailable\. For brokers without standby, Lambda cannot process any messages during that window\. @@ -36,45 +38,101 @@ Lambda will pull messages until it has processed a maximum of 6 MB, until timeou **Note** The maximum function invocation time is 14 minutes\. -Lambda processes all incoming batches concurrently and automatically scales the concurrency to meet demands\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. -**Example Amazon MQ record event** +**Example Amazon MQ record events** ``` { - "eventSource": "aws:amq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages": { [ - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/text-message", - "data": "QUJDOkFBQUE=", - "connectionId": "myJMSCoID", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": { + [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] + } +} +``` + +``` +{ + "eventSource": "aws:rmq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "rmqMessagesByQueue": { + "test::/": [ + { + "basicProperties": { + "contentType": "text/plain", + "contentEncoding": null, + "headers": { + "header1": { + "bytes": [ + 118, + 97, + 108, + 117, + 101, + 49 + ] }, - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data": "3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId": "myJMSCoID1", - "persistent": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - } - ] - } + "header2": { + "bytes": [ + 118, + 97, + 108, + 117, + 101, + 50 + ] + }, + "numberInHeader": 10 + } + "deliveryMode": 1, + "priority": 34, + "correlationId": null, + "replyTo": null, + "expiration": "60000", + "messageId": null, + "timestamp": "Jan 1, 1970, 12:33:41 AM", + "type": null, + "userId": "AIDACKCEVSQ6C2EXAMPLE", + "appId": null, + "clusterId": null, + "bodySize": 80 + }, + "redelivered": false, + "data": "eyJ0aW1lb3V0IjowLCJkYXRhIjoiQ1pybWYwR3c4T3Y0YnFMUXhENEUifQ==" + } + ] + } } ``` +In the RabbitMQ example, `test` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `test::/`\. ## Execution role permissions @@ -87,6 +145,9 @@ To read records from an Amazon MQ broker, your Lambda function needs the followi + [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) + [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) **Note** When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. @@ -113,7 +174,7 @@ Lambda supports the following options for Amazon MQ event sources: + **MQ broker** – Select an Amazon MQ broker\. + **Batch size** – Set the maximum number of messages to retrieve in a single batch\. + **Queue name** – Enter the Amazon MQ queue to consume\. -+ **Source access configuration** – Select the AWS Secrets Manager secret that stores your broker credentials\. ++ **Source access configuration** – Enter virtual host information and the Secrets Manager secret that stores your broker credentials\. + **Enable trigger** – Disable the trigger to stop processing records\. To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the designer\. To reconfigure the trigger, use the event source mapping API operations\. @@ -129,26 +190,26 @@ To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/lat To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. -By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker is given a public IP address\. +By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker receives a public IP address\. -For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon VPC access requirements, you can do one of the following: +For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. To meet the Amazon Virtual Private Cloud \(Amazon VPC\) access requirements, you can do one of the following: + Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS STS and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. ++ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS Security Token Service \(AWS STS\) and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. -The Amazon Virtual Private Cloud \(Amazon VPC\) security group rules that you configure should have the following settings at minimum: +The Amazon VPC security group rules that you configure should have the following settings at minimum: + Inbound rules – For a broker without public accessibility, allow all traffic on all ports for the security group that's specified as your source\. For a broker with public accessibility, allow all traffic on all ports for all destinations\. + Outbound rules – Allow all traffic on all ports for all destinations\. The Amazon VPC configuration is discoverable through the [Amazon MQ API](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/resources.html) and does not need to be configured in the `create-event-source-mapping` setup\. -The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ broker named `ExampleMQBroker`\. The command also provides a Secrets Manager secret named `ExampleMQBrokerUserPassword` that stores the broker credentials\. +The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ RabbitMQ\-based broker named `ExampleMQBroker`\. The command also provides the virtual host name and a Secrets Manager secret ARN that stores the broker credentials\. ``` aws lambda create-event-source-mapping \ ---event-source-arn arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca \ ---function-name MQ-Example-Function \ ---source-access-configuration Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt \ ---queues ExampleQueue +--event-source-arn arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-24cacbb4-b295-49b7-8543-7ce7ce9dfb98 \ +--function-name arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function \ +--queues ExampleQueue \ +--source-access-configuration Type=VIRTUAL_HOST,URI="/" Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt \ ``` You should see the following output: @@ -157,8 +218,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 100, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601927898.741, "LastProcessingResult": "No records processed", "State": "Creating", @@ -169,13 +230,13 @@ You should see the following output: "SourceAccessConfigurations": [ { "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-east-1:12345678901:secret:ExampleMQBrokerUserPassword-xPBMTt" + "URI": "arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt" } ] } ``` -Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how batches are processed and to specify when to discard records that can't be processed\. The following example command updates an event source mapping to have a batch size of 2\. +Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how Lambda processes batches and to specify when to discard records that cannot be processed\. The following example command updates an event source mapping to have a batch size of 2\. ``` aws lambda update-event-source-mapping \ @@ -189,8 +250,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601928393.531, "LastProcessingResult": "No records processed", "State": "Updating", @@ -198,7 +259,7 @@ You should see the following output: } ``` -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. +Lambda updates these settings asynchronously\. The output will not reflect changes until this process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. ``` aws lambda get-event-source-mapping \ @@ -211,8 +272,8 @@ You should see the following output: { "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:12345678901:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:12345678901:function:MQ-Example-Function", + "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", + "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", "LastModified": 1601928393.531, "LastProcessingResult": "No records processed", "State": "Enabled", @@ -222,7 +283,7 @@ You should see the following output: ## Event source mapping errors -When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided they don't encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: +When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided that they do not encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: **`ESM_CONFIG_NOT_VALID`** The event source mapping configuration is not valid\. @@ -236,4 +297,4 @@ Lambda does not have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** The function's configuration is not valid\. -Records also go unprocessed if they are dropped due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website\. \ No newline at end of file +Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 72717471..512f60f8 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -1,24 +1,49 @@ # Using Lambda with Amazon MSK -[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that enables you to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK provides the control\-plane operations, such as those for creating, updating, and deleting clusters\. It supports multiple open\-source versions of Kafka\. +[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Additionally, Amazon MSK supports multiple open\-source versions of Kafka\. -When you create an Amazon MSK cluster, you receive the required hosting and connection information of the cluster\. This information includes the Kafka cluster hostname, topic name, SASL/SCRAM user name and password, and bootstrap server host\-port pairs\. +Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -To support your Kafka cluster on Amazon MSK, you might need to create Amazon Virtual Private Cloud \(Amazon VPC\) networking components\. For more information, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. -**Topics** -+ [Managing access and permissions for an Amazon MSK cluster](#msk-permissions) -+ [Adding an Amazon MSK cluster as an event source](#services-msk-topic-add) +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -## Managing access and permissions for an Amazon MSK cluster +Lambda allows a function to run for up to 14 minutes before stopping it\. -Lambda polls your Apache Kafka topic partitions for new records and invokes your Lambda function [synchronously](invocation-sync.md)\. To update other AWS resources that your cluster uses, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have permission to perform these actions\. +Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. -This page describes how to grant permission to Lambda and other users of your Amazon MSK cluster\. +``` +{ "eventSource": "aws:kafka", + "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records": { + "mytopic-0": [ + { + "topic": "mytopic" + "partition": "0", + "offset": 15, + "timestamp": 1545084650987, + "timestampType": "CREATE_TIME", + "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + } + ] + } +} +``` + +**Topics** ++ [Managing access and permissions](#msk-permissions) ++ [Network configuration](#services-msk-vpc-config) ++ [Adding Amazon MSK as an event source](#services-msk-topic-add) ++ [Auto scaling of the Amazon MSK event source](#services-msk-ops-scaling) ++ [Amazon MSK configuration parameters](#services-msk-parms) + +## Managing access and permissions + +For Lambda to poll your Kafka topic and update other cluster resources, your Lambda function—as well as your IAM users and roles—must have the following permissions\. ### Required Lambda function permissions -To read records from your Amazon MSK cluster on your behalf, your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: +Your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission to read records from your Amazon MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: + [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) + [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) @@ -43,46 +68,48 @@ Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to 1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. -1. Select your execution role from the list, and then choose **Attach policy**\. +1. On the **Attach policy** page, select your execution role from the list, and then choose **Attach policy**\. ### Granting users access with an IAM policy -By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon Managed Streaming for Apache Kafka Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +By default, IAM users and roles do not have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ### Using SASL/SCRAM authentication -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Using Username and Password Authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -## Adding an Amazon MSK cluster as an event source - -You can use a Lambda function to process records from your Apache Kafka cluster when the cluster is configured as an [event](gettingstarted-concepts.md#gettingstarted-concepts-event) source\. To create an [event source mapping](invocation-eventsourcemapping.md), you can add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -This section describes how to add your Kafka cluster and topic as a function trigger using the Lambda console or AWS CLI\. +Note that Amazon MSK does not support SASL/PLAIN authentication\. -### Prerequisites -+ An Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. For more information, see [Managing access and permissions for an Amazon MSK cluster](#msk-permissions)\. - -### VPC configuration +## Network configuration -To get Apache Kafka records from Amazon MSK brokers, Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your MSK cluster\. To meet Amazon VPC access requirements, do one of the following: -+ We recommend that you deploy Amazon VPC Endpoints \(PrivateLink\) for Lambda and AWS STS services\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. +Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. - If authentication is required, also deploy an Amazon VPC Endpoint for the Secrets Manager\. -+ Alternatively, you can configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -Your Amazon VPC security groups must be configured with the following rules \(at minimum\): +You must configure your Amazon VPC security groups with the following rules \(at minimum\): + Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. + Outbound rules – Allow all traffic on all ports for all destinations\. **Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and doesn't need to be configured in your `create-event-source-mapping` setup\. +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. + +For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. + +## Adding Amazon MSK as an event source + +To create an [event source mapping](invocation-eventsourcemapping.md), add Amazon MSK as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. -### Adding an Amazon MSK cluster using the Lambda console +This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. + +### Prerequisites ++ An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ++ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your Amazon MSK cluster uses\. + +### Adding an Amazon MSK trigger \(console\) Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. -**To add an MSK trigger to your Lambda function \(console\)** +**To add an Amazon MSK trigger to your Lambda function \(console\)** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. @@ -90,20 +117,38 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. Under **Function overview**, choose **Add trigger**\. -1. Under **Trigger configuration**, choose the **MSK** trigger type\. +1. Under **Trigger configuration**, do the following: + + 1. Choose the **MSK** trigger type\. -1. Configure the remaining options, and then choose **Add**\. + 1. For **MSK cluster**, select your cluster\. -### Adding an Amazon MSK cluster using the AWS CLI + 1. For **Batch size**, enter the maximum number of messages to receive in a single batch\. + + 1. For **Topic name**, enter the name of a Kafka topic\. + + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. + + 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. + + 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. + +1. To create the trigger, choose **Add**\. + +### Adding an Amazon MSK trigger \(AWS CLI\) Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. #### Creating a trigger using the AWS CLI -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `latest`\. +The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `LATEST`\. ``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 --topics AWSKafkaTopic --starting-position LATEST --function-name my-kafka-function +aws lambda create-event-source-mapping \ + --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 \ + --topics AWSKafkaTopic \ + --starting-position LATEST \ + --function-name my-kafka-function ``` For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. @@ -113,5 +158,36 @@ For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. ``` -aws lambda get-event-source-mapping --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` \ No newline at end of file +aws lambda get-event-source-mapping \ + --uuid 6d9bce8e-836b-442c-8070-74e77903c815 +``` + +## Auto scaling of the Amazon MSK event source + +When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. + +Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. + +If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. + +To monitor the throughput of your Kafka topic, you can view the [Amazon MSK consumer\-lag metrics](https://docs.aws.amazon.com/msk/latest/developerguide/consumer-lag.html)\. To help you find the metrics for this Lambda function, the value of the consumer group field in the logs is set to the event source UUID\. + +To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. + +## Amazon MSK configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MSK\. + + +**Event source parameters that apply to Amazon MSK** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10,000 | +| DestinationConfig | N | none | | +| Enabled | N | Enabled | | +| EventSourceArn | Y | | Can set only on Create | +| FunctionName | Y | | | +| SourceAccessConfigurations | N | No credentials | VPC information or SASL/SCRAM authentication credentials for your event source | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | +| Topics | Y | | Kafka topic name Can set only on Create | \ No newline at end of file From abc4ca715d2e76cda599bb2177f6d3b011d9f1fa Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Fri, 23 Jul 2021 11:09:34 -0700 Subject: [PATCH 114/243] fixes. Also, updates to Python SDK versions. Updates for .NET 2.1 phase 1 and 2 deprecation start dates. --- doc_source/.DS_Store | Bin 0 -> 6148 bytes .../API_DeleteFunctionEventInvokeConfig.md | 4 +++ .../API_PutFunctionEventInvokeConfig.md | 4 +++ .../API_UpdateFunctionEventInvokeConfig.md | 4 +++ doc_source/access-control-identity-based.md | 16 +++++++--- doc_source/access-control-resource-based.md | 2 +- doc_source/configuration-filesystem.md | 4 +-- doc_source/configuration-images.md | 2 +- doc_source/configuration-layers.md | 29 ++++++++++-------- doc_source/csharp-exceptions.md | 2 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-package-cli.md | 2 +- doc_source/getting-started-create-function.md | 4 +-- doc_source/gettingstarted-concepts.md | 9 +++++- doc_source/golang-exceptions.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/invocation-async.md | 8 ++--- doc_source/java-exceptions.md | 2 +- doc_source/java-logging.md | 2 +- doc_source/lambda-powershell.md | 2 -- doc_source/lambda-python.md | 8 ++--- doc_source/lambda-runtimes.md | 8 ++--- doc_source/lambda-samples.md | 2 -- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-logging.md | 2 +- doc_source/powershell-devenv.md | 18 ++++------- doc_source/powershell-exceptions.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/powershell-package.md | 23 -------------- doc_source/python-exceptions.md | 2 +- doc_source/python-logging.md | 2 +- doc_source/python-package-create.md | 4 +-- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-logging.md | 2 +- doc_source/runtime-support-policy.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/services-apigateway-tutorial.md | 2 +- doc_source/welcome.md | 2 +- doc_source/with-android-example.md | 2 +- doc_source/with-ddb-example.md | 2 +- doc_source/with-kafka.md | 11 ++----- doc_source/with-kinesis-example.md | 2 +- doc_source/with-mq.md | 5 ++- doc_source/with-s3-tutorial.md | 8 ++--- doc_source/with-sqs-example.md | 2 +- 45 files changed, 106 insertions(+), 115 deletions(-) create mode 100644 doc_source/.DS_Store diff --git a/doc_source/.DS_Store b/doc_source/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b69849dd92ef70b78b64791809fd6819225e77c8 GIT binary patch literal 6148 zcmeHK!AiqG5Pe%KM7{JPcwDdEiU+T;L_rWQMLbs06e}d8SjB7p!_VjP*;z_U z^biD5nSt52natZ|-$Et>z>S`YAus@t&;@%t96m95FW$0VjBFEKSmPWuN)(vkp_Ofc z->87x-9D~(W6$tdzdw%~+~W~*#xIC7R9F_vX_?n`DM#r*EANKmXm6yIE7F<(2u(HplnGX+cmQ{e9^z?v?zu43YY?>z)Au6 zK6tud8nICfpAHV81t9hr4#v6k62kEj(};~C-_V>=iAr^`#c)bz+{e5$Vxy>ZxY&HS zxU-8LiVM4QeIL@{Qbik00aIX8fh~O;Nc}(iy8quK*^?Pu=rTBmzjBzg$Vj8hgWQ1lv0zn2FOo1O&-~+==ODX^W literal 0 HcmV?d00001 diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 5b686b74..58e0a053 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -51,6 +51,10 @@ If the action is successful, the service sends back an HTTP 204 response with an One of the parameters in the request is invalid\. HTTP Status Code: 400 + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index ec123c06..2818b8f5 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -137,6 +137,10 @@ Valid Range: Minimum value of 0\. Maximum value of 2\. One of the parameters in the request is invalid\. HTTP Status Code: 400 + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 3a5cb783..0d90c5ef 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -135,6 +135,10 @@ Valid Range: Minimum value of 0\. Maximum value of 2\. One of the parameters in the request is invalid\. HTTP Status Code: 400 + **ResourceConflictException** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + **ResourceNotFoundException** The resource specified in the request does not exist\. HTTP Status Code: 404 diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 829053aa..378cfbb9 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -33,10 +33,14 @@ The following shows an example of a permissions policy with limited scope\. It a "Effect": "Allow", "Action": [ "lambda:GetAccountSettings", - "lambda:ListFunctions", - "lambda:ListTags", "lambda:GetEventSourceMapping", + "lambda:GetFunction", + "lambda:GetFunctionConfiguration", + "lambda:GetFunctionCodeSigningConfig", + "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", + "lambda:ListFunctions", + "lambda:ListTags" "iam:ListRoles" ], "Resource": "*" @@ -96,10 +100,14 @@ The permissions in the policy are organized into statements based on the [resour ``` "Action": [ "lambda:GetAccountSettings", - "lambda:ListFunctions", - "lambda:ListTags", "lambda:GetEventSourceMapping", + "lambda:GetFunction", + "lambda:GetFunctionConfiguration", + "lambda:GetFunctionCodeSigningConfig", + "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", + "lambda:ListFunctions", + "lambda:ListTags" "iam:ListRoles" ], "Resource": "*" diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index ffd963b8..400ace4b 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function”, + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index d11a0713..bd90009b 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -170,9 +170,7 @@ Resources: CodeUri: function/. Description: Use a file system. FileSystemConfigs: - - - Arn: !Sub - - "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" + - Arn: "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" LocalMountPath: "/mnt/efs0" DependsOn: "MountTarget1" ``` diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index d68f2173..27751f4a 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -35,7 +35,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Amazon ECR permissions -For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minumum policy: +For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: ``` { diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index f58c1396..76a659bf 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -10,6 +10,7 @@ You can create layers using the Lambda console, the Lambda API, AWS CloudFormati + [Creating layer content](#configuration-layers-upload) + [Compiling the \.zip file archive for your layer](#configuration-layers-compile) + [Including library dependencies in a layer](#configuration-layers-path) ++ [Language\-specific instructions](#configuration-layers-zip-cli) + [Creating a layer](#configuration-layers-create) + [Deleting a layer version](#configuration-layers-delete) + [Configuring layer permissions](#configuration-layers-permissions) @@ -19,20 +20,9 @@ You can create layers using the Lambda console, the Lambda API, AWS CloudFormati When you create a layer, you must bundle all its content into a \.zip file archive\. You upload the \.zip file archive to your layer from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. Lambda extracts the layer contents into the `/opt` directory when setting up the execution environment for the function\. -### Using the AWS CLI - -You can create and upload a \.zip file for your layer using the Lambda console or the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ## Compiling the \.zip file archive for your layer -You build your layer code into a \.zip file archive using the same procedure as you would for a function\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. +You build your layer code into a \.zip file archive using the same procedure as you would for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. @@ -111,6 +101,17 @@ jq.zip For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. +## Language\-specific instructions + + For language\-specific instructions on how to create a \.zip file archive, see the following topics\. ++ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) ++ [Deploy Python Lambda functions with \.zip file archives](python-package.md) ++ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) ++ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) ++ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) ++ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) ++ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + ## Creating a layer You can create new layers using the Lambda console or the Lambda API\. @@ -234,7 +235,9 @@ Resources: Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. - ContentUri: lib/. + Content: + S3Bucket: my-bucket-region-123456789012 + S3Key: layer.zip CompatibleRuntimes: - nodejs12.x ``` \ No newline at end of file diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index ff338602..043d1252 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -186,7 +186,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index eb775c10..2d009821 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md index 381751e5..4e984227 100644 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -167,7 +167,7 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 83c80e0b..3747cb2e 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -231,7 +231,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ### Update the user permissions -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy`, `SetRepositoryPolicy`, and `InitiateLayerUpload`\. For information about access policies, see [ Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the *IAM User Guide* +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) For example, use the IAM console to create a role with the following policy: @@ -242,7 +242,7 @@ For example, use the IAM console to create a role with the following policy: { "Sid": "VisualEditor0", "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy", "ecr:InitiateLayerUpload], + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], "Resource": "arn:aws:ecr:::repository//" } ] diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 91685abf..6b394aa1 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -13,6 +13,7 @@ With Lambda, you run functions to process events\. To send events to your functi + [Extension](#gettingstarted-concepts-extensions) + [Concurrency](#gettingstarted-concepts-concurrency) + [Qualifier](#gettingstarted-concepts-qualifier) ++ [Destination](#gettingstarted-concepts-destinations) ## Function @@ -109,4 +110,10 @@ Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region l When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. -For more information, see [Lambda function versions](configuration-versions.md)\. \ No newline at end of file +For more information, see [Lambda function versions](configuration-versions.md)\. + +## Destination + +A *destination* is an AWS resource where Lambda can send events from an asynchronous invocation\. You can configure a destination for events that fail processing\. Some services also support a destination for events that are successfully processed\. + +For more information, see [Configuring destinations for asynchronous invocation](invocation-async.md#invocation-async-destinations)\. \ No newline at end of file diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index a2c01bb6..79406118 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -104,7 +104,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 88cdb341..89a50954 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,7 +136,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index e3a39d64..8d4abdf1 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -16,9 +16,7 @@ aws lambda invoke \ --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) - -You should see the following output: +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` { @@ -32,7 +30,7 @@ Lambda manages the function's asynchronous event queue and attempts to retry on ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-retries.png) -If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. However, it might be longer if the queue is backed up\. Lambda also reduces the rate at which it reads events from the queue\. +If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. If the queue contains many entries, Lambda increases the retry interval and reduces the rate at which it reads events from the queue\. The following example shows an event that was successfully added to the queue, but is still pending one hour later due to throttling\. @@ -40,7 +38,7 @@ The following example shows an event that was successfully added to the queue, b Even if your function doesn't return an error, it's possible for it to receive the same event from Lambda multiple times because the queue itself is eventually consistent\. If the function can't keep up with incoming events, events might also be deleted from the queue without being sent to the function\. Ensure that your function code gracefully handles duplicate events, and that you have enough concurrency available to handle all invocations\. -When the queue is backed up, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. +When the queue is very long, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. You can also configure Lambda to send an invocation record to another service\. Lambda supports the following [destinations](#invocation-async-destinations) for asynchronous invocation\. + **Amazon SQS** – A standard SQS queue\. diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index b597748e..2ee6c9c0 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -166,7 +166,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 6e6600ef..b88eb616 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,7 +150,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index 21bc2a35..0645f6d8 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -11,8 +11,6 @@ The following sections explain how common programming patterns and core concepts | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 7c5c94ce..6b083454 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **To create a Python function** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index d94696dc..73b9c8fb 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.42 botocore\-1\.20\.42 | Amazon Linux | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index e7a4582c..ccd61487 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -55,8 +55,6 @@ Lambda provides the following sample applications for the Go runtime: #### [ PowerShell ] Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. ------ diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index bcb6fab3..0d486fd1 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -99,7 +99,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 18f012c4..7ba49d9b 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,7 +129,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md index 54b84ff7..0e4feffc 100644 --- a/doc_source/powershell-devenv.md +++ b/doc_source/powershell-devenv.md @@ -1,15 +1,9 @@ # Setting Up a PowerShell Development Environment -To set up your development environment for writing PowerShell scripts, do the following: +Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for Powershell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. -1. **Install the correct version of PowerShell** – Lambda's support for PowerShell is based on the cross\-platform PowerShell Core 6\.0 release\. This means that you can develop your PowerShell Lambda functions on Windows, Linux, or Mac\. If you don’t have this version of PowerShell installed, you can find instructions in [Installing PowerShell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell#powershell-core)\. - -1. **Install the \.NET Core 3\.1 SDK** – Because PowerShell Core is built on top of \.NET Core, the Lambda support for PowerShell uses the same \.NET Core 3\.1 Lambda runtime for both \.NET Core and PowerShell Lambda functions\. The \.NET Core 3\.1 SDK is used by the new Lambda PowerShell publishing cmdlets to create the Lambda deployment package\. The \.NET Core 3\.1 SDK is available at [\.NET downloads](https://www.microsoft.com/net/download) on the Microsoft website\. Be sure to install the SDK and not the runtime installation\. - -1. **Install the AWSLambdaPSCore module** – You can install this either from the [ PowerShell Gallery](https://www.powershellgallery.com/packages/AWSLambdaPSCore), or you can install it by using the following PowerShell Core shell command: - - ``` - Install-Module AWSLambdaPSCore -Scope CurrentUser - ``` - -1. **\(Optional\) Install AWS Tools for PowerShell** – You can install either the modularized [AWS\.Tools](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-welcome.html#pwsh_structure_pstools) or single\-module [AWSPowerShell\.NetCore](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-welcome.html#pwsh_structure_pscore) version in PowerShell Core 6\.0 to use the Lambda API within your PowerShell environment\\\. For instructions, see [Installing the AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html) \ No newline at end of file +The AWSLambdaPSCore module includes the following cmdlets to help author and publish PowerShell Lambda functions: ++ **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. ++ **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. ++ **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. ++ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 04a07bb0..a5709fb0 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -123,7 +123,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 4df8aab8..451ade07 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,7 +139,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md index 09fdac4c..ba401214 100644 --- a/doc_source/powershell-package.md +++ b/doc_source/powershell-package.md @@ -2,29 +2,6 @@ A deployment package for the PowerShell runtime contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. -## Tools and libraries - -Lambda provides the following sample applications for the PowerShell runtime: - -**Tools and libraries for PowerShell** -+ [AWS Lambda and AWS Tools for PowerShell](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-lambda.html): the steps to install PowerShell, the \.NET Core 2\.1 SDK, and the `AWSLambdaPSCore` module\. -+ [aws\-lambda\-dotnet](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell): Lambda tools for Powershell on GitHub\. - -The AWSLambdaPSCore module has the following new cmdlets to help author and publish PowerShell Lambda functions: - -**AWSLambdaPSCore cmdlets** -+ **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. -+ **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. -+ **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. -+ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. - -## Sample applications - -Lambda provides the following sample applications for the PowerShell runtime: - -**Sample Lambda applications in PowerShell** -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. - ## Creating the Lambda function To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 23085fbb..1c7113cd 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -78,7 +78,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 46c2c9e6..79fb10c2 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,7 +121,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index 80ee105a..c23c3a21 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -201,7 +201,7 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i --payload '{"action": "square","number": 3}' output.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. This command produces the following output: @@ -406,7 +406,7 @@ Invoke the Lambda function [synchronously](invocation-sync.md) using the event i --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. This command produces the following output: diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 6a9b9ff9..0e87f7b6 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -100,7 +100,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 02f53e70..3ee0dbba 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 200ce1ac..87a4c1ad 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -18,7 +18,7 @@ The following runtimes have reached or are scheduled for end of support: | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Aug 23, 2021 | Sept 23, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | | Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 49760245..2c25ed53 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -10,7 +10,7 @@ For data protection purposes, we recommend that you protect AWS account credenti + Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. + If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. -We strongly recommend that you never put sensitive identifying information, such as your customers' account numbers, into free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into Lambda or other services might get picked up for inclusion in diagnostic logs\. When you provide a URL to an external server, don't include credentials information in the URL to validate your request to that server\. +We strongly recommend that you never put confidential or sensitive information, such as your customers' email addresses, into tags or free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into tags or free\-form fields used for names may be used for billing or diagnostic logs\. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server\. **Topics** + [Encryption in transit](#security-privacy-intransit) diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 32b02804..41828285 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -254,7 +254,7 @@ Invoke the function manually using the sample event data\. We recommend that you --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an API using Amazon API Gateway diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 663bec4f..20e1a540 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -62,7 +62,7 @@ You can configure a function to mount an [Amazon Elastic File System \(Amazon EF To work effectively with Lambda, you need coding experience and expertise in the following domains: + Linux OS and commands, as well as concepts such as processes, threads, and file permissions\. + Cloud concepts and IP networking concepts \(for public and private networks\)\. -+ Distributed computing concepts such as HTML as an IPC, queues, messaging, notifications, and concurrency\. ++ Distributed computing concepts such as HTTP as an IPC, queues, messaging, notifications, and concurrency\. + Familiarity with security services and concepts: AWS Identity and Access Management \(IAM\) and access control principles, and AWS Key Management Service \(AWS KMS\) and public key infrastructure\. + Familiarity with key services that interact with Lambda: Amazon API Gateway, Amazon S3, Amazon Simple Queue Service \(Amazon SQS\), and DynamoDB\. + Configuring EC2 instances with Linux\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 8389bf61..31bb5ad9 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -99,7 +99,7 @@ Invoke the function manually using the sample event data\. --payload file://file-path/input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index f26f7fb4..24b2ad24 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,7 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The function returns the string `message` in the response body\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index c56a6ffc..ef7a8d36 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -41,7 +41,7 @@ Lambda sends the batch of messages in the event parameter when it invokes your L + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) -+ [Event source configuration parameters](#services-msk-parms) ++ [Event source configuration parameters](#services-kafka-parms) ## Managing access and permissions @@ -278,7 +278,7 @@ The function configuration is not valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -## Event source configuration parameters +## Event source configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. @@ -288,14 +288,9 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | | BatchSize | N | 100 | Maximum: 10,000 | -| DestinationConfig | N | none | | | Enabled | N | Enabled | | -| KafkaBrokerList | Y | | Can set only on Create | | FunctionName | Y | | | -| MaximumBatchingWindowInSeconds | N | 0 | Maximum: 300 | -| MaximumRecordAgeInSeconds | N | 604,800 \(7 days\) | Maximum: no limit | -| MaximumRetryAttempts | N | 10,000 | Maximum: no limit | -| ParallelizationFactor | N | 1 | | +| SelfManagedEventSource | Y | | List of Kafka Brokers\. Can set only on Create | | SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | | StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | | Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 1efb74d3..23fbf996 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -124,7 +124,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The response is saved to `out.txt`\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 2748d5ca..d047239c 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -297,4 +297,7 @@ Lambda does not have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** The function's configuration is not valid\. -Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a redelivery policy and dead\-letter queue \(DLQ\) handling with Amazon MQ\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. \ No newline at end of file +Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a dead\-letter queue \(DLQ\)\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. + +**Note** +Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 11e3265d..5921f6c6 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -488,7 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -502,7 +502,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -516,7 +516,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -586,7 +586,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. --payload file://inputFile.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 87cd8e43..037e18ea 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -114,7 +114,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam) + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the `outputfile.txt` file\. From a170fde11fc53c7ee0ba4b2e608b48158216515f Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 26 Jul 2021 12:14:38 -0700 Subject: [PATCH 115/243] Move java-events-v1sdk samples to java-events. Add note that v1sdk examples are deprecated. --- sample-apps/java-events-v1sdk/README.md | 2 + sample-apps/java-events/3-invoke.sh | 9 +++ sample-apps/java-events/README.md | 6 ++ sample-apps/java-events/build.gradle | 8 +-- .../java-events/events/dynamodb-record.json | 64 +++++++++++++++++++ .../java-events/events/kinesis-record.json | 36 +++++++++++ .../java-events/events/s3-notification.json | 39 +++++++++++ sample-apps/java-events/pom.xml | 13 ++-- 8 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 sample-apps/java-events/events/dynamodb-record.json create mode 100644 sample-apps/java-events/events/kinesis-record.json create mode 100644 sample-apps/java-events/events/s3-notification.json diff --git a/sample-apps/java-events-v1sdk/README.md b/sample-apps/java-events-v1sdk/README.md index 31e42f6d..d2299710 100644 --- a/sample-apps/java-events-v1sdk/README.md +++ b/sample-apps/java-events-v1sdk/README.md @@ -2,6 +2,8 @@ This sample application shows the use of the `aws-lambda-java-events` library with event types that require AWS SDK as a dependency. A separate handler class is defined for each input type. For other event types (which don't require the AWS SDK), see the `java-events` sample. +**Note: The `java-events-v1sdk` examples are deprecated.** As of version 3.0.0 of the `aws-lambda-java-events` package, [users are no longer required to pull in SDK dependencies in order to use that library](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events). Please see the [`java-events` package](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) for updated examples. + ![Architecture](/sample-apps/java-events-v1sdk/images/sample-java-events-v1sdk.png) The project includes function code and supporting resources: diff --git a/sample-apps/java-events/3-invoke.sh b/sample-apps/java-events/3-invoke.sh index ebac190b..0504ea1e 100755 --- a/sample-apps/java-events/3-invoke.sh +++ b/sample-apps/java-events/3-invoke.sh @@ -25,12 +25,21 @@ then cog) PAYLOAD='file://events/cognito-sync.json' ;; + kin) + PAYLOAD='file://events/kinesis-record.json' + ;; fh) PAYLOAD='file://events/firehose-record.json' ;; lex) PAYLOAD='file://events/lex-flowers.json' ;; + ddb) + PAYLOAD='file://events/dynamodb-record.json' + ;; + s3) + PAYLOAD='file://events/s3-notification.json' + ;; *) echo -n "Unknown event type" ;; diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index 48533a0e..a8a0b7d8 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -90,8 +90,11 @@ By default, the function uses a handler class named `Handler` that takes an API - `HandlerCognito.java` - Takes `CognitoEvent` as input. - `HandlerCWEvents.java` - Takes `ScheduledEventEvent` as input. - `HandlerCWLogs.java` - Takes `CloudWatchLogsEvent` as input. +- `HandlerDynamoDB.java` - Takes `DynamodbEvent` as input. - `HandlerFirehose.java` - Takes `KinesisFirehoseEvent` as input. +- `HandlerKinesis.java` - Takes `KinesisEvent` as input. - `HandlerLex.java` - Takes `LexEvent` as input. +- `HandlerS3.java` - Takes `S3Event` as input. - `HandlerSNS.java` - Takes `SNSEvent` as input. To use a different handler, change the value of the Handler setting in the application template (`template.yml` or `template-mvn.yaml`). For example, to use the Amazon Lex handler: @@ -118,8 +121,11 @@ The following event type keys are supported: - `cfg` - Config rule (`events/config-rule.json`) - `cc` - CodeCommit push (`events/codecommit-push.json`) - `cog` - Cognito Sync (`events/cognito-sync.json`) +- `kin` - Kinesis record (`events/kinesis-record.json`) - `fh` - Kinesis Firehose record (`events/firehose-record.json`) - `lex` - Lex dialog (`events/lex-flowers.json`) +- `ddb` - DynamoDB record (`events/dynamodb-record.json`) +- `s3` - S3Event record (`events/s3-notification.json`) # Cleanup To delete the application, run `4-cleanup.sh`. diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index a22a9885..0f68f99a 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -8,11 +8,11 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' + implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + implementation 'org.apache.logging.log4j:log4j-api:2.13.0' + implementation 'org.apache.logging.log4j:log4j-core:2.13.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/events/dynamodb-record.json b/sample-apps/java-events/events/dynamodb-record.json new file mode 100644 index 00000000..74a055e8 --- /dev/null +++ b/sample-apps/java-events/events/dynamodb-record.json @@ -0,0 +1,64 @@ +{ + "Records": [ + { + "eventID": "1", + "eventVersion": "1.0", + "dynamodb": { + "Keys": { + "Id": { + "N": "101" + } + }, + "NewImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "StreamViewType": "NEW_AND_OLD_IMAGES", + "SequenceNumber": "111", + "SizeBytes": 26 + }, + "awsRegion": "us-west-2", + "eventName": "INSERT", + "eventSourceARN": "eventsourcearn", + "eventSource": "aws:dynamodb" + }, + { + "eventID": "2", + "eventVersion": "1.0", + "dynamodb": { + "OldImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "SequenceNumber": "222", + "Keys": { + "Id": { + "N": "101" + } + }, + "SizeBytes": 59, + "NewImage": { + "Message": { + "S": "This item has changed" + }, + "Id": { + "N": "101" + } + }, + "StreamViewType": "NEW_AND_OLD_IMAGES" + }, + "awsRegion": "us-west-2", + "eventName": "MODIFY", + "eventSourceARN": "sourcearn", + "eventSource": "aws:dynamodb" + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/events/kinesis-record.json b/sample-apps/java-events/events/kinesis-record.json new file mode 100644 index 00000000..8bc3e069 --- /dev/null +++ b/sample-apps/java-events/events/kinesis-record.json @@ -0,0 +1,36 @@ +{ + "Records": [ + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", + "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "approximateArrivalTimestamp": 1545084650.987 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", + "awsRegion": "us-east-2", + "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" + }, + { + "kinesis": { + "kinesisSchemaVersion": "1.0", + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692540925702759324208523137515618", + "data": "VGhpcyBpcyBvbmx5IGEgdGVzdC4=", + "approximateArrivalTimestamp": 1545084711.166 + }, + "eventSource": "aws:kinesis", + "eventVersion": "1.0", + "eventID": "shardId-000000000006:49590338271490256608559692540925702759324208523137515618", + "eventName": "aws:kinesis:record", + "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", + "awsRegion": "us-east-2", + "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/events/s3-notification.json b/sample-apps/java-events/events/s3-notification.json new file mode 100644 index 00000000..94c28f5c --- /dev/null +++ b/sample-apps/java-events/events/s3-notification.json @@ -0,0 +1,39 @@ +{ + "Records": [ + { + "awsRegion": "us-east-2", + "eventName": "ObjectCreated:Put", + "eventSource": "aws:s3", + "eventTime": "2020-03-08T00:30:12.456Z", + "eventVersion": "2.1", + "requestParameters": { + "sourceIPAddress": "174.255.255.156" + }, + "responseElements": { + "xAmzId2": "nBbLJPAHhdvxmplPvtCgTrWCqf/KtonyV93l9rcoMLeIWJxpS9x9P8u01+Tj0OdbAoGs+VGvEvWl/Sg1NW5uEsVO25Laq7L", + "xAmzRequestId": "AF2D7AB6002E898D" + }, + "s3": { + "configurationId": "682bbb7a-xmpl-48ca-94b1-7f77c4d6dbf0", + "bucket": { + "name": "BUCKET_NAME", + "ownerIdentity": { + "principalId": "A3XMPLFAF2AI3E" + }, + "arn": "arn:aws:s3:::BUCKET_NAME" + }, + "object": { + "key": "inbound/sample-java-s3.png", + "size": 21476, + "eTag": "d132690b6c65b6d1629721dcfb49b883", + "versionId": "", + "sequencer": "005E64A65DF093B26D" + }, + "s3SchemaVersion": "1.0" + }, + "userIdentity": { + "principalId": "AWS:AIDAINPONIXMPLT3IKHL2" + } + } + ] +} \ No newline at end of file diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index ec6141b0..0d13721a 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -20,7 +20,7 @@ com.amazonaws aws-lambda-java-events - 2.2.9 + 3.9.0 com.google.code.gson @@ -31,32 +31,29 @@ org.apache.logging.log4j log4j-api 2.13.0 - test org.apache.logging.log4j log4j-core 2.13.2 - test org.apache.logging.log4j log4j-slf4j18-impl 2.13.0 - test - + org.junit.jupiter junit-jupiter-api 5.6.0 test - - + + org.junit.jupiter junit-jupiter-engine 5.6.0 test - + From ea892da10971b4ed7846d2524a7b8bd31987b29c Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 26 Jul 2021 12:44:41 -0700 Subject: [PATCH 116/243] Add handlers & logging config to java-events samples --- .../main/java/example/HandlerDynamoDB.java | 33 +++++++++++++++++ .../src/main/java/example/HandlerKinesis.java | 30 ++++++++++++++++ .../src/main/java/example/HandlerS3.java | 35 +++++++++++++++++++ .../java-events/src/main/resources/log4j2.xml | 16 +++++++++ 4 files changed, 114 insertions(+) create mode 100644 sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java create mode 100644 sample-apps/java-events/src/main/java/example/HandlerKinesis.java create mode 100644 sample-apps/java-events/src/main/java/example/HandlerS3.java create mode 100644 sample-apps/java-events/src/main/resources/log4j2.xml diff --git a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java new file mode 100644 index 00000000..7bdb3bba --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java @@ -0,0 +1,33 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandlerDynamoDB +public class HandlerDynamoDB implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(DynamodbEvent event, Context context) + { + String response = new String("200 OK"); + for (DynamodbStreamRecord record : event.getRecords()){ + logger.info(record.getEventID()); + logger.info(record.getEventName()); + logger.info(record.getDynamodb().toString()); + } + logger.info("Successfully processed " + event.getRecords().size() + " records."); + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java new file mode 100644 index 00000000..d337920b --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java @@ -0,0 +1,30 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandleKinesis +public class HandlerKinesis implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerKinesis.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(KinesisEvent event, Context context) + { + String response = new String("200 OK"); + for(KinesisEventRecord record : event.getRecords()) { + logger.info(gson.toJson(record.getKinesis().getData())); + } + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerS3.java b/sample-apps/java-events/src/main/java/example/HandlerS3.java new file mode 100644 index 00000000..a6f470be --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerS3.java @@ -0,0 +1,35 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.events.S3Event; + +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.Handler +public class HandlerS3 implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(S3Event event, Context context) + { + String response = new String("200 OK"); + S3EventNotificationRecord record = event.getRecords().get(0); + String srcBucket = record.getS3().getBucket().getName(); + // Object key may have spaces or unicode non-ASCII characters. + String srcKey = record.getS3().getObject().getUrlDecodedKey(); + logger.info("RECORD: " + record); + logger.info("SOURCE BUCKET: " + srcBucket); + logger.info("SOURCE KEY: " + srcKey); + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/resources/log4j2.xml b/sample-apps/java-events/src/main/resources/log4j2.xml new file mode 100644 index 00000000..b9a6c317 --- /dev/null +++ b/sample-apps/java-events/src/main/resources/log4j2.xml @@ -0,0 +1,16 @@ + + + + + %d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n + + + + + + + + + + + \ No newline at end of file From dc96abc288940ddd62f19891ed545fbb36eb8a08 Mon Sep 17 00:00:00 2001 From: Stefan Schablowski Date: Wed, 28 Jul 2021 21:12:54 +0200 Subject: [PATCH 117/243] fix function name in code sample --- doc_source/python-package-create.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index c23c3a21..a2f536ae 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -434,7 +434,7 @@ You can now delete the resources that you created for this tutorial, unless you + Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` - aws lambda delete-function --function-name my-function + aws lambda delete-function --function-name my-sourcecode-function ``` This command produces no output\. @@ -451,4 +451,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file + ``` From cbc91b4e710c5026473a4fca6415cfe361b019c8 Mon Sep 17 00:00:00 2001 From: csereno <35574850+csereno@users.noreply.github.com> Date: Thu, 29 Jul 2021 23:38:55 -0500 Subject: [PATCH 118/243] Removed a redundant half sentence in the cold start section Removed the statements in brackets in the following paragraph from the provision concurrency section. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency. [[For example, a function configured with 100 provisioned concurrency.]] For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur. --- doc_source/troubleshooting-invocation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 04a7bfc4..f526d9bd 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -70,7 +70,7 @@ When the number of concurrent executions on a function is less than or equal to Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. + Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. + Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. -+ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. ++ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. **Note** There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. @@ -113,4 +113,4 @@ The function could connect to the function's [file system](configuration-filesys *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. From 779926c5791c94cdf8b2767b0ea1483b9486f099 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Sat, 31 Jul 2021 07:52:56 -0700 Subject: [PATCH 119/243] updates. Two new function configuration files --- doc_source/access-control-identity-based.md | 5 + doc_source/configuration-console.md | 58 ------ doc_source/configuration-envvars.md | 2 +- doc_source/configuration-function-common.md | 161 +++++++++++++++ doc_source/configuration-function-zip.md | 106 ++++++++++ doc_source/configuration-images.md | 4 +- doc_source/configuration-memory.md | 47 ----- doc_source/configuration-versions.md | 2 +- doc_source/csharp-handler.md | 2 +- doc_source/foundation-console.md | 187 ++++++++++++++++++ ...ode-editor.md => functions-code-editor.md} | 22 +-- doc_source/getting-started-create-function.md | 2 +- doc_source/getting-started.md | 4 +- doc_source/gettingstarted-limits.md | 4 +- doc_source/index.md | 17 +- doc_source/java-context.md | 4 +- doc_source/java-exceptions.md | 4 +- doc_source/java-handler.md | 4 +- doc_source/java-logging.md | 4 +- doc_source/java-package.md | 4 +- doc_source/java-samples.md | 4 +- doc_source/java-tracing.md | 4 +- doc_source/lambda-functions.md | 8 +- doc_source/lambda-java.md | 2 +- doc_source/lambda-managing.md | 13 ++ doc_source/lambda-monitoring.md | 1 + doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 6 +- doc_source/lambda-releases.md | 2 +- doc_source/lambda-ruby.md | 6 +- doc_source/lambda-runtimes.md | 2 +- doc_source/lambda-samples.md | 4 +- doc_source/monitoring-code-profiler.md | 50 +++++ doc_source/monitoring-metrics.md | 2 +- doc_source/nodejs-handler.md | 2 +- doc_source/ruby-package.md | 5 +- doc_source/runtimes-extensions-api.md | 2 +- doc_source/runtimes-modify.md | 2 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/troubleshooting-invocation.md | 4 +- doc_source/welcome.md | 2 +- doc_source/with-sqs.md | 2 +- 42 files changed, 597 insertions(+), 177 deletions(-) delete mode 100644 doc_source/configuration-console.md create mode 100644 doc_source/configuration-function-common.md create mode 100644 doc_source/configuration-function-zip.md delete mode 100644 doc_source/configuration-memory.md create mode 100644 doc_source/foundation-console.md rename doc_source/{code-editor.md => functions-code-editor.md} (91%) create mode 100644 doc_source/lambda-managing.md create mode 100644 doc_source/monitoring-code-profiler.md diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index 378cfbb9..daf049a0 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -20,6 +20,11 @@ AWS managed policies grant permission to API actions without restricting the Lam ## Function development +Use identity\-based policies to allow users to perform operations on Lambda functions\. + +**Note** +For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](configuration-images.md#configuration-images-permissions) + The following shows an example of a permissions policy with limited scope\. It allows a user to create and manage Lambda functions named with a designated prefix \(`intern-`\), and configured with a designated execution role\. **Example Function development policy** diff --git a/doc_source/configuration-console.md b/doc_source/configuration-console.md deleted file mode 100644 index 39af7e6f..00000000 --- a/doc_source/configuration-console.md +++ /dev/null @@ -1,58 +0,0 @@ -# Configuring functions in the console - -You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code\. - -To manage a function, open the Lambda console [Functions page](https://console.aws.amazon.com/lambda/home#/functions) and choose a function\. - -![\[The function overview in the AWS Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) - -The function overview shows a visualization of your function and its upstream and downstream resources\. - -You can use it to configure triggers, layers, and destinations\. -+ **Triggers** – Triggers are services and resources that you have configured to invoke your function\. Choose **Add trigger** to create a Lambda [event source mapping](invocation-eventsourcemapping.md) or to configure a trigger in another service that the Lambda console integrates with\. For details about these services and others, see [Using AWS Lambda with other services](lambda-services.md)\. -+ **Layers** – Choose the **Layers** node to add [layers](configuration-layers.md) to your application\. A layer is a \.zip file archive that contains libraries, a custom runtime, or other dependencies\. -+ **Destinations** – Add a destination to your function to send details about invocation results to another service\. You can send invocation records when your function is invoked [asynchronously](invocation-async.md), or by an [event source mapping](invocation-eventsourcemapping.md) that reads from a stream\. - -By default you are working with the `Latest` function version\. You can modify the following settings in this version: - -**Function settings** -+ **Code** – The code and dependencies of your function\. For scripting languages, you can edit your function code in the embedded [editor](code-editor.md)\. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a [deployment package](gettingstarted-package.md)\. If your deployment package is larger than 50 MB, choose **Upload a file from Amazon S3**\. -+ **Runtime** – The [Lambda runtime](lambda-runtimes.md) that runs your function\. -+ **Handler** – The method that the runtime runs when your function is invoked, such as `index.handler`\. The first value is the name of the file or module\. The second value is the name of the method\. -+ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. -+ **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. - - Tags apply to the entire function, including all versions and aliases\. -+ **Execution role** – The [AWS Identity and Access Management \(IAM\) role](lambda-intro-execution-role.md) that Lambda assumes when it runs your function\. -+ **Description** – A description of the function\. -+ **Memory**– The amount of memory available to the function at runtime\. To [set the memory for your function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html), enter a value between 128 MB and 10,240 MB in 1\-MB increments\. -+ **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. -+ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. -+ **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. -+ **Active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. -+ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. - - Reserved concurrency applies to the entire function, including all versions and aliases\. -+ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. - - You can configure error handling settings on a function, version, or alias\. - -Except as noted in the preceding list, you can only change function settings on the unpublished version of a function\. When you publish a version, code and most settings are locked to ensure a consistent experience for users of that version\. Use [aliases](configuration-aliases.md) to propagate configuration changes in a controlled manner\. - -To configure functions with the Lambda API, use the following actions: -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\. -+ [TagResource](API_TagResource.md) – Tag a function\. -+ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\. -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\. -+ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. -+ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. -+ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. - -For example, to update a function's memory setting with the AWS CLI, use the `update-function-configuration` command\. - -``` -aws lambda update-function-configuration --function-name my-function --memory-size 256 -``` - -For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index cf46ef31..b263c785 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -18,7 +18,7 @@ Environment variables are not evaluated prior to the function invocation\. Any v ## Configuring environment variables -You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-console.md)\. +You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\. You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md new file mode 100644 index 00000000..72202d40 --- /dev/null +++ b/doc_source/configuration-function-common.md @@ -0,0 +1,161 @@ +# Configuring Lambda function options + +After you create a function, you can configure additional capabilities for the function, such as triggers, network acccess, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. + +You can also create and edit test events to test your function using the console\. + +For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. + +**Topics** ++ [Function versions](#configuration-function-latest) ++ [Using the function overview](#configuration-functions-designer) ++ [Configuring functions \(console\)](#configuration-common-summary) ++ [Configuring functions \(API\)](#configuration-function-api) ++ [Configuring function memory \(console\)](#configuration-memory-console) ++ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) ++ [Configuring triggers \(console\)](#configuration-common-triggers) ++ [Testing functions \(console\)](#configuration-common-test) + +## Function versions + +A function has an unpublished version, and can have published versions and aliases\. By default, the console displays configuration information for the unpublished version of the function\. You change the unpublished version when you update your function's code and configuration\. + +A published version is a snapshot of your function code and configuration that can't be changed \(except for a few configuration items relevant to a function version, such as provisioned concurrency\)\. + +## Using the function overview + +The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger and destination configuration\. You can use it to jump to layer configuration for functions defined as \.zip file archives\. + +![\[The Lambda function overview, with no configured triggers or destinations.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) + +## Configuring functions \(console\) + +For most function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: ++ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. ++ **Triggers** – Configure [triggers](#configuration-common-triggers)\. ++ **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. ++ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. ++ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. ++ **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. + + Tags apply to the entire function, including all versions and aliases\. ++ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. ++ **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. ++ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. + + Reserved concurrency applies to the entire function, including all versions and aliases\. ++ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. + + You can configure on a function, version, or alias\. ++ **Code signing** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. ++ **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. ++ **File systems** – Connect your function to a [file system](configuration-filesystem.md)\. + +The console provides separate tabs to configure aliases and versions: ++ **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\. ++ **Versions** – Lambda assigns a new version number each time you publish your function\. For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. + +You can configure the following items for a published function version: ++ Triggers ++ Destinations ++ Provisioned concurrency ++ Asynchronous invocation ++ Database proxies + +## Configuring functions \(API\) + +To configure functions with the Lambda API, use the following actions: ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\. ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\. ++ [TagResource](API_TagResource.md) – Tag a function\. ++ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\. ++ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\. ++ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. ++ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. ++ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. + +## Configuring function memory \(console\) + +Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. + +You can configure the memory of your function in the Lambda console\. + +**To update the memory of a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. + +1. Choose **Save**\. + +## Accepting function memory recommendations \(console\) + +If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. + +When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. + +**To accept a function memory recommendation** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. + +1. Choose **Save**\. + +## Configuring triggers \(console\) + +You can configure other AWS services to trigger your function each time a specified event occurs\. + +For details about how services trigger Lambda functions, see [Using AWS Lambda with other services](lambda-services.md)\. + +**To add a trigger to your function\.** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. From the drop\-down list of triggers, choose a trigger\. The console displays additional configuration fields required for this trigger\. + +1. Choose **Add**\. + +## Testing functions \(console\) + +You can create test events for your function from the **Test** tab\. + +**To create a test event** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to test, and choose **Test**\. + +1. Under **Test event**, select **New event**\. + +1. Select a **Template**\. + +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. + +1. Choose **Save changes**\. + +Saved test events are also available from the **Code** tab, under the **Test** menu\. After you create one or more test events, you can invoke your function using one of your tests as an event\. + +**To test the function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to test, and choose **Test**\. + +1. Under **Test event**, select **Saved events** and select the event you want to use\. + +1. Choose **Test**\. + +1. Expand the **Execution result** panel to display details about the test\. \ No newline at end of file diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md new file mode 100644 index 00000000..32fa7a5e --- /dev/null +++ b/doc_source/configuration-function-zip.md @@ -0,0 +1,106 @@ +# Creating Lambda functions defined as \.zip file archives + +When you create a Lambda function, you package your function code into a [deployment package](gettingstarted-package.md)\. Lambda supports two types of deployment packages: [container images](configuration-images.md) and \.zip file archives\. + +You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. + +**Note** +You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. + +**Topics** ++ [Creating a function \(console\)](#configuration-function-create) ++ [Using the console code editor](#configuration-functions-console-update) ++ [Updating function code \(console\)](#configuration-function-update) ++ [Configuring runtime settings \(console\)](#configuration-function-runtime) ++ [Using the Lambda API](#configuration-function-api) ++ [AWS CloudFormation](#configuration-function-cloudformation) + +## Creating a function \(console\) + +When you create a function defined with a \.zip file archive, you choose a code template, the language version, and the execution role for the function\. You add your function code after Lambda creates the function\. + +**To create the function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose **Author from scratch** or **Use a blueprint** to create your function\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter the function name\. + + 1. For **Runtime**, choose the language version to use for your function\. + +1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. You can create a new **Execution role** or use an existing role\. + +1. \(Optional\) Expand **Advanced settings**\. You can choose a **Code signing configuration** for the function\. You can also configure an \(Amazon VPC\) for the function to access\. + +1. Choose **Create function**\. + +Lambda creates the new function\. You can now use the console to add the function code and configure other function parameters and features\. + +## Using the console code editor + +The console creates a Lambda function with a single source file\. For scripting languages, you can edit this file and add more files using the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. + +**Note** +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. + +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. + +## Updating function code \(console\) + +For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. To add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. You can upload the zip archive from your local machine\. If the \.zip archive is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. + +**To upload function code as a \.zip archive** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Code source**, choose **Upload from**\. + +1. Choose **\.zip file** and then choose **Upload**\. + + 1. In the file chooser, select the new image version and choose **Open**, then choose **Save**\. + +1. \(Alternative to step 4\) Choose **Amazon S3 location**\. + + 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. + +## Configuring runtime settings \(console\) + +When you create a function that uses a \.zip file deployment package, you must specify the runtime to use and the name of the function handler\. + +**To update the runtime settings** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Runtime settings**, choose **Edit**\. + + 1. For **Runtime**, select the runtime version\. + + 1. For **Handler**, specify file name and handler for your function\. + +1. Choose **Save**\. + +## Using the Lambda API + +To create and configure a function that uses a \.zip file archive, use the following API operations: ++ [CreateFunction](API_CreateFunction.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + +## AWS CloudFormation + +You can use AWS CloudFormation to create a Lambda function that uses a \.zip file archive\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. + +In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a \.zip file archive: ++ AWS::Lambda::Function + + PackageType – Set to `Zip`\. + + Code – Enter the Amazon S3 bucket name and \.zip file name in the `S3Bucket` and `S3Key`fields\. For Node\.js or Python, you can provide inline source code of your Lambda function\. + + Runtime – Set the runtime value\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index 27751f4a..f6839867 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -1,4 +1,6 @@ -# Configuring functions defined as container images +# Creating Lambda functions defined as container images + +When you create a Lambda function, you use a [deployment package](gettingstarted-package.md) to deploy your function code\. Lambda supports two types of deployment packages: [\.zip file archives](configuration-function-zip.md) and container images\. You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. diff --git a/doc_source/configuration-memory.md b/doc_source/configuration-memory.md deleted file mode 100644 index b88d5251..00000000 --- a/doc_source/configuration-memory.md +++ /dev/null @@ -1,47 +0,0 @@ -# Configuring Lambda function memory - -Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. - -This page describes how to update the memory allotted to your function in the Lambda console\. - -**Topics** -+ [Configuring function memory \(console\)](#configuration-memory-console) -+ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) - -## Configuring function memory \(console\) - -You can configure the memory of your function in the Lambda console\. - -**To update the memory of a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **General configuration** - -1. Under **General configuration**, choose **Edit**\. - -1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. - -1. Choose **Save**\. - -## Accepting function memory recommendations \(console\) - -If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. - -When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. - -**To accept a function memory recommendation** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **General configuration** - -1. Under **General configuration**, choose **Edit**\. - -1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. - -1. Choose **Save**\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index 6ba8a250..d0890f5a 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -16,7 +16,7 @@ A function version includes the following information: ## Creating function versions -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring functions in the console](configuration-console.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. You can create a function version using the Lambda console\. diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 10818ea5..7ec210e0 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -168,7 +168,7 @@ Note that there are some restrictions on the handler signature\. ## Using async in C\# functions with AWS Lambda -If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to [time out](configuration-console.md)\. +If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md new file mode 100644 index 00000000..b930fbfc --- /dev/null +++ b/doc_source/foundation-console.md @@ -0,0 +1,187 @@ +# Using the Lambda console + +You can use the Lambda console to configure applications, functions, code signing configurations, and layers\. + +**Topics** ++ [Applications](#foundation-applications) ++ [Functions](#foundation-functions) ++ [Code signing](#foundation-code-signing) ++ [Layers](#foundation-layers) ++ [Edit code using the console editor](#code-editor) + +## Applications + +The [Applications](deploying-lambda-apps.md) page shows you a list of applications that have been deployed using AWS CloudFormation, or other tools including the AWS Serverless Application Model\. Filter to find applications based on keywords\. + +## Functions + +The functions page shows you a list of functions defined for your account in this region\. The initial console flow to create a function depends on whether the function uses a [container image](configuration-images.md) or [\.zip file archive](configuration-function-zip.md) for the deployment package\. Many of the optional [configuration tasks](configuration-function-common.md) are common to both types of function\. + +The console provides a [code editor](#code-editor) for your convenience\. + +## Code signing + +You can attach a [code signing](configuration-codesigning.md) configuration to a function\. With code signing, you can ensure that the code has been signed by an approved source and has not been altered since signing, and that the code signature has not expired or been revoked\. + +## Layers + +Create [layers](configuration-layers.md) to separate your \.zip archive function code from its dependencies\. A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. + +## Edit code using the console editor + +You can use the code editor in the AWS Lambda console to write, test, and view the execution results of your Lambda function code\. The code editor supports languages that do not require compiling, such as Node\.js and Python\. The code editor suppports only \.zip archive deployment packages, and the size of the deployment package must be less than 3 MB\. + +The code editor includes the *menu bar*, *windows*, and the *editor pane*\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) + +For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. + +**Topics** ++ [Working with files and folders](#code-editor-files) ++ [Working with code](#code-editor-code) ++ [Working in fullscreen mode](#code-editor-fullscreen) ++ [Working with preferences](#code-editor-prefs) + +### Working with files and folders + +You can use the **Environment** window in the code editor to create, open, and manage files for your function\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env.png) + +**To show or hide the Environment window**, choose the **Environment** button\. If the **Environment** button is not visible, choose **Window, Environment** on the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-button.png) + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) + + + +**To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. + +**To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. + +**To create a new file**, do one of the following: ++ In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. ++ Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. ++ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) + + + +**To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. + +**To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. + +**To rename a file or folder**, right\-click the file or folder in the **Environment** window\. Type the replacement name, and then press Enter \. + +**To delete files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Delete**\. Then confirm the deletion by choosing **Yes** \(for a single selection\) or **Yes to All**\. + +**To cut, copy, paste, or duplicate files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Cut**, **Copy**, **Paste**, or **Duplicate**, respectively\. + +**To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) + +**To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. + +### Working with code + +Use the editor pane in the code editor to view and write code\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) + + + +#### Working with tab buttons + +Use the *tab buttons bar* to select, view, and create files\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) + + + +**To display an open file's contents**, do one of the following: ++ Choose the file's tab\. ++ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) + + + +**To close an open file**, do one of the following: ++ Choose the **X** icon in the file's tab\. ++ Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. + +**To close multiple open files**, choose the drop\-down menu in the tab buttons bar, and then choose **Close All Tabs in All Panes** or **Close All But Current Tab** as needed\. + +**To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. + +#### Working with the status bar + +Use the status bar to move quickly to a line in the active file and to change how code is displayed\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) + + + +**To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) + + + +**To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. + + + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) + +**To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-spaces-tabs.png) + +**To change for all files whether to show or hide invisible characters or the gutter, auto\-pair brackets or quotes, wrap lines, or the font size**, choose the gear icon, and then choose the new settings\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) + + + +### Working in fullscreen mode + +You can expand the code editor to get more room to work with your code\. + +To expand the code editor to the edges of the web browser window, choose the **Toggle fullscreen** button in the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) + + + +To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. + +In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. + +### Working with preferences + +You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. + +To change code editor settings, choose the **Preferences** gear icon in the menu bar\. + +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-preferences.png) + +For a list of what the settings do, see the following references in the *AWS Cloud9 User Guide*\. ++ [Project setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-project.html#settings-project-change) ++ [User setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-user.html#settings-user-change) + +Note that some of the settings listed in those references are not available in the code editor\. \ No newline at end of file diff --git a/doc_source/code-editor.md b/doc_source/functions-code-editor.md similarity index 91% rename from doc_source/code-editor.md rename to doc_source/functions-code-editor.md index 2472dcff..8c68efd3 100644 --- a/doc_source/code-editor.md +++ b/doc_source/functions-code-editor.md @@ -1,4 +1,4 @@ -# Creating functions using the AWS Lambda console editor +# Creating functions using the AWS Lambda console editor The Lambda console provides a code editor for languages that do not require compiling, such as Node\.js or Python\. The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. @@ -11,12 +11,12 @@ The code editor includes the *menu bar*, *windows*, and the *editor pane*\. For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. **Topics** -+ [Working with files and folders](#code-editor-files) -+ [Working with code](#code-editor-code) -+ [Working in fullscreen mode](#code-editor-fullscreen) -+ [Working with preferences](#code-editor-prefs) ++ [Working with files and folders](#functions-code-editor-files) ++ [Working with code](#functions-code-editor-code) ++ [Working in fullscreen mode](#functions-code-editor-fullscreen) ++ [Working with preferences](#functions-code-editor-prefs) -## Working with files and folders +## Working with files and folders You can use the **Environment** window in the code editor to create, open, and manage files for your function\. @@ -62,7 +62,7 @@ You can use the **Environment** window in the code editor to create, open, and m **To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. -## Working with code +## Working with code Use the editor pane in the code editor to view and write code\. @@ -70,7 +70,7 @@ Use the editor pane in the code editor to view and write code\. -### Working with tab buttons +### Working with tab buttons Use the *tab buttons bar* to select, view, and create files\. @@ -97,7 +97,7 @@ Use the *tab buttons bar* to select, view, and create files\. **To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -### Working with the status bar +### Working with the status bar Use the status bar to move quickly to a line in the active file and to change how code is displayed\. @@ -129,7 +129,7 @@ Use the status bar to move quickly to a line in the active file and to change ho -## Working in fullscreen mode +## Working in fullscreen mode You can expand the code editor to get more room to work with your code\. @@ -143,7 +143,7 @@ To shrink the code editor to its original size, choose the **Toggle fullscreen** In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. -## Working with preferences +## Working with preferences You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 3747cb2e..59006aec 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -2,7 +2,7 @@ In the following getting started exercises, you create Lambda functions using the console\. -In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. +In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. In the next exercise, you create a function defined as a container image\. First, create a container image for your function code, and then use the Lambda console to create a function from the container image\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index 7e77bf67..ab68ad07 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -6,7 +6,7 @@ To get started with Lambda, use the Lambda console to create a function\. In a f To use Lambda and other AWS services, you need an AWS account\. If you don't have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. -You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](code-editor.md) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. +You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: + A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. @@ -14,7 +14,7 @@ You deploy your function code to Lambda using a deployment package\. Lambda supp **Topics** + [Create a Lambda function with the console](getting-started-create-function.md) -+ [Creating functions using the AWS Lambda console editor](code-editor.md) ++ [Creating functions using the AWS Lambda console editor](functions-code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 4fd1e465..a30ebad6 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -17,8 +17,8 @@ The following quotas apply to function configuration, deployments, and execution | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-console.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-console.md) | 900 seconds \(15 minutes\) | +| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | +| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/index.md b/doc_source/index.md index b4ce81fa..c193c4d8 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -18,7 +18,7 @@ Amazon's trademarks and trade dress may not be used in + [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) - + [Creating functions using the AWS Lambda console editor](code-editor.md) + + [Creating functions using the AWS Lambda console editor](functions-code-editor.md) + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) @@ -31,21 +31,23 @@ Amazon's trademarks and trade dress may not be used in + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Managing AWS Lambda functions](lambda-functions.md) - + [Configuring functions in the console](configuration-console.md) - + [Configuring functions defined as container images](configuration-images.md) + + [Using the Lambda console](foundation-console.md) + + [Creating Lambda functions defined as .zip file archives](configuration-function-zip.md) + + [Creating and sharing Lambda layers](configuration-layers.md) + + [Creating Lambda functions defined as container images](configuration-images.md) + + [Configuring Lambda function options](configuration-function-common.md) + [Using AWS Lambda environment variables](configuration-envvars.md) - + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) - + [Creating and sharing Lambda layers](configuration-layers.md) - + [Using layers with your Lambda function](invocation-layers.md) - + [Configuring Lambda function memory](configuration-memory.md) ++ [Managing AWS Lambda functions](lambda-managing.md) + + [Managing concurrency for a Lambda function](configuration-concurrency.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Configuring code signing for AWS Lambda](configuration-codesigning.md) + [Tagging Lambda Functions](configuration-tags.md) + + [Using layers with your Lambda function](invocation-layers.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) @@ -213,6 +215,7 @@ Amazon's trademarks and trade dress may not be used in + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) + [Security in AWS Lambda](lambda-security.md) + [Data protection in AWS Lambda](security-dataprotection.md) diff --git a/doc_source/java-context.md b/doc_source/java-context.md index c249fff6..54e09cc3 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -101,8 +101,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 2ee6c9c0..16cb08af 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -211,8 +211,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 81125f55..0b66d6a4 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -172,8 +172,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index b88eb616..28e895dc 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -328,8 +328,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 5b41ed3a..5a441306 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -331,6 +331,6 @@ For a complete working example, see the following sample applications: **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](#java-package) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 31985ad9..cf1a95f8 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -5,8 +5,8 @@ The GitHub repository for this guide provides sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 410d2902..ccc18e0e 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -151,8 +151,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index b474f5e5..60e6c31b 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,13 +1,9 @@ # Managing AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-console.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. +You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-function-common.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. [Versions and aliases](configuration-versions.md) are secondary resources that you can create to manage function deployment and invocation\. Publish [versions](configuration-versions.md) of your function to store its code and configuration as a separate resource that cannot be changed, and create an [alias](configuration-aliases.md) that points to a specific version\. Then you can configure your clients to invoke a function alias, and update the alias when you want to point the client to a new version, instead of updating the client\. -As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. - -To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. - -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file +As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index b843a7f6..db10e560 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -48,7 +48,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md new file mode 100644 index 00000000..2f751d0e --- /dev/null +++ b/doc_source/lambda-managing.md @@ -0,0 +1,13 @@ +# Managing AWS Lambda functions + +Concurrency is the number of instances of your function that are active\. Scaling is how quickly Lambda increases the the number of instances\. + +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. + + + +As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. + +To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. + +To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md index caa57e8d..e2f9ba06 100644 --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -11,4 +11,5 @@ For more information about monitoring Lambda applications, see [Monitoring and o + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) + [Working with AWS Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) ++ [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 6cb32e93..0dfaa908 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -51,18 +51,18 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](nodejs-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 6b083454..469cdeda 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -35,18 +35,18 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](python-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](python-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index d8ea2dd7..c2068ea7 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -72,7 +72,7 @@ The following table describes the important changes in each release of the *AWS | Runtime support for Node\.js runtime 8\.10 | AWS Lambda now supports Node\.js runtime version 8\.10\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 2, 2018 | | Function and alias revision IDs | AWS Lambda now supports revision IDs on your function versions and aliases\. You can use these IDs to track and apply conditional updates when you are updating your function version or alias resources\. | January 25, 2018 | | Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | -| Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Creating functions using the AWS Lambda console editor](code-editor.md)\. | November 30,2017 | +| Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | | Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. | November 30,2017 | | Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions ](lambda-rolling-deployments.md)\. | November 28, 2017 | | Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index 6e6a6a6a..b9d679da 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -50,18 +50,18 @@ You can add permissions to the role later, or swap it out for a different role t 1. For **Event name**, enter **test**\. -1. Choose **Create**\. +1. Choose **Save changes**\. 1. To invoke the function, choose **Test**\. -The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](code-editor.md)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. +The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -Each time you save your function code, the Lambda console creates a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](ruby-package.md) and updating your code at the command line\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](ruby-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 73b9c8fb..c526ef94 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -2,7 +2,7 @@ Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. -When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-console.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. +When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-function-zip.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. **Amazon Linux** + Image – [amzn\-ami\-hvm\-2018\.03\.0\.20181129\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2) diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index ccd61487..8ced5952 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -32,8 +32,8 @@ The GitHub repository for this guide includes sample applications that demonstra **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that don't require the AWS SDK as a dependency, such as Amazon API Gateway\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses the [aws\-lambda\-java\-events](java-package.md) library with event types that require the AWS SDK as a dependency \(Amazon Simple Storage Service \(Amazon S3\), Amazon DynamoDB, and Amazon Kinesis\)\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md new file mode 100644 index 00000000..fe2f6951 --- /dev/null +++ b/doc_source/monitoring-code-profiler.md @@ -0,0 +1,50 @@ +# Using CodeGuru Profiler with your Lambda function + +You can use Amazon CodeGuru Profiler to gain insights into runtime performance of your Lambda functions\. This page describes how to activate CodeGuru Profiler from the Lambda console\. + +**Topics** ++ [Supported runtimes](#monitoring-code-profiler-runtimes) ++ [Activating CodeGuru Profiler from the Lambda console](#monitoring-code-profiler-activate-console) ++ [What happens when you activate CodeGuru Profiler from the Lambda console?](#monitoring-code-profiler-what-happens-activate) ++ [What's next?](#monitoring-code-profiler-next-up) + +## Supported runtimes + +You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python 3\.8, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. ++ For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. ++ For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. + +## Activating CodeGuru Profiler from the Lambda console + +This section describes how to activate CodeGuru Profiler from the Lambda console\. + +**To activate CodeGuru Profiler from the Lambda console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose your function\. + +1. Choose the **Configuration** tab\. + +1. On the **Monitoring and operations tools** pane, choose **Edit**\. + +1. Under **Amazon CodeGuru Profiler**, turn on **Code profiling**\. + +1. Choose **Save**\. + +After activation, CodeGuru automatically creates a profiler group with the name `aws-lambda-`\. You can change the name from the CodeGuru console\. + +## What happens when you activate CodeGuru Profiler from the Lambda console? + +When you activate CodeGuru Profiler from the console, Lambda automatically does the following on your behalf: ++ Lambda adds a CodeGuru Profiler layer to your function\. For more details, see [ Use AWS Lambda layers](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) in the *Amazon CodeGuru Profiler User Guide*\. ++ Lambda also adds environment variables to your function\. The exact value varies based on the runtime\. +**Environment variables** +[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/monitoring-code-profiler.html) ++ Lambda adds the `AmazonCodeGuruProfilerAgentAccess` policy to your function's execution role\. + +**Note** +When you deactivate CodeGuru Profiler from the console, Lambda automatically removes the CodeGuru Profiler layer and environment variables from your function\. However, Lambda does not remove the `AmazonCodeGuruProfilerAgentAccess` policy from your execution role\. + +## What's next? ++ Learn more about the data collected by your profiler group in [Working with visualizations](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/working-with-visualizations.html) in the *Amazon CodeGuru Profiler User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index a685336f..5ed52df0 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,6 +1,6 @@ # Working with AWS Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. +When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 2ff4c530..76841bdf 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -13,7 +13,7 @@ exports.handler = async function(event, context) { } ``` -When you [configure a function](configuration-console.md), the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. +When you configure a function, the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 4ed7911d..baa12817 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -77,7 +77,8 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t 1. Install libraries in the vendor directory using the `bundle` command\. ``` - bundle install --path vendor/bundle + bundle config set --local path 'vendor/bundle' \ + bundle install ``` You should see the following output: @@ -90,7 +91,7 @@ If your function depends on libraries other than the AWS SDK for Ruby, install t ... ``` - The `--path` installs the gems in the project directory instead of the system location, and sets this as the default path for future installations\. To later install gems globally, use the `--system` option\. + This installs the gems in the project directory instead of the system location, and sets `vendor/bundle` as the default path for future installations\. To later install gems globally, use `bundle config set --local system 'true'`\. 1. Create a \.zip file archive\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 8792ad16..e98d8c92 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -102,7 +102,7 @@ Here is an example payload: } ``` -**Duration limit**: The function's [timeout setting](configuration-console.md) limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. +**Duration limit**: The function's timeout setting limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. **Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 83024158..024979c1 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -208,7 +208,7 @@ In the following example, you create a wrapper script to start the Python interp 1. Add the code and the environment variable to your function\. - 1. In the function [code editor](code-editor.md), paste the following function code: + 1. In the function [code editor](foundation-console.md#code-editor), paste the following function code: ``` import json diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 07078be7..02d46203 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -10,7 +10,7 @@ When your function code or the Lambda runtime return an error, the status code i **Issue:** *Function execution takes too long\.* -If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-console.md) to increase both memory and CPU\. +If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-function-common.md) to increase both memory and CPU\. ## Lambda: Logs or traces don't appear diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index f526d9bd..e0776c69 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -52,7 +52,7 @@ You grant [other services](lambda-services.md) and accounts permission to invoke **Issue:** *Function is invoked continuously in a loop\.* -This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-console.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. +This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-function-common.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. ## Lambda: Alias routing with provisioned concurrency @@ -113,4 +113,4 @@ The function could connect to the function's [file system](configuration-filesys *EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* -A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. +A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 20e1a540..a436a30a 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -92,7 +92,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo ## Accessing Lambda You can create, invoke, and manage your Lambda functions using any of the following interfaces: -+ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Configuring functions in the console](configuration-console.md)\. ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Using the Lambda console](foundation-console.md)\. + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. + **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 8bf175d7..d1eba474 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -101,7 +101,7 @@ Your function can scale in concurrency to the number of active message groups\. [Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-console.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-function-common.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. From 498f007bbb8d6552d4c9f7a9ca52d42e3f34ca10 Mon Sep 17 00:00:00 2001 From: blange Date: Mon, 2 Aug 2021 00:07:37 -0700 Subject: [PATCH 120/243] Update lambda-runtimes.md This sentence is problematic "This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the execution environment to avoid creating them every time your function runs." The "This" is referring to an "attempt" to re-use an environment, which is different than an environment actually being reused. The "attempt" doesn't in itself save time. The phrase "and it allows you to save resources such as database connections " is implying that the user can take certain actions because of the attempt that is made by Lambda to re-use an environment when in reality the users actions are the same regardless of whether the execution environment is reused or not. The sentence should be more clear than Lambda is doing the work. The phrase "creating them every time your function runs." is awkward because when an execution environment is reused the resources do not have to be recreated for that particular invocation of the function, but it should not be said that the savings applies to "every time your functions runs" Thank you for taking the time to review my proposed changes. --- doc_source/lambda-runtimes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index c526ef94..68f22226 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -12,7 +12,7 @@ When you use a \.zip file archive for the deployment package, you choose a runti + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. This saves time preparing the execution environment, and it allows you to save resources such as database connections and temporary files in the [execution environment](runtimes-context.md) to avoid creating them every time your function runs\. +When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. When an [execution environment](runtimes-context.md) is reused, time is saved because your resources, such as database connections and temporary files, do not have to be recreated before your function runs\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -99,4 +99,4 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) From 7ddec7c919541a525427ada2a288330cd684bd02 Mon Sep 17 00:00:00 2001 From: Praveen Sripati Date: Sat, 7 Aug 2021 11:11:43 +0530 Subject: [PATCH 121/243] Broken link for the `Interface endpoint properties and limitations` Updated with the proper link for the `Interface endpoint properties and limitations` --- doc_source/configuration-vpc-endpoints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 1ca577fe..143492e9 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -13,7 +13,7 @@ Each interface endpoint is represented by one or more [elastic network interface ## Considerations for Lambda interface endpoints -Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. +Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. You can call any of the Lambda API operations from your VPC\. For example, you can invoke the Lambda function by calling the `Invoke` API from within your VPC\. For the full list of Lambda APIs, see [Actions](https://docs.aws.amazon.com/lambda/latest/dg/API_Operations.html) in the Lambda API reference\. @@ -99,4 +99,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` \ No newline at end of file +``` From 9d6f318ab006f7e2cdc37d559a8a1981e9d48321 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 9 Aug 2021 13:15:55 -0700 Subject: [PATCH 122/243] created new Lambda foundations chapter. Some additional updates --- doc_source/API_AccountLimit.md | 8 +- doc_source/API_AccountUsage.md | 8 +- doc_source/API_AddLayerVersionPermission.md | 18 +- doc_source/API_AddPermission.md | 18 +- doc_source/API_AliasConfiguration.md | 8 +- doc_source/API_AliasRoutingConfiguration.md | 8 +- doc_source/API_AllowedPublishers.md | 8 +- doc_source/API_CodeSigningConfig.md | 8 +- doc_source/API_CodeSigningPolicies.md | 8 +- doc_source/API_Concurrency.md | 8 +- doc_source/API_CreateAlias.md | 18 +- doc_source/API_CreateCodeSigningConfig.md | 18 +- doc_source/API_CreateEventSourceMapping.md | 18 +- doc_source/API_CreateFunction.md | 18 +- doc_source/API_DeadLetterConfig.md | 8 +- doc_source/API_DeleteAlias.md | 18 +- doc_source/API_DeleteCodeSigningConfig.md | 18 +- doc_source/API_DeleteEventSourceMapping.md | 18 +- doc_source/API_DeleteFunction.md | 18 +- .../API_DeleteFunctionCodeSigningConfig.md | 18 +- doc_source/API_DeleteFunctionConcurrency.md | 18 +- .../API_DeleteFunctionEventInvokeConfig.md | 18 +- doc_source/API_DeleteLayerVersion.md | 18 +- .../API_DeleteProvisionedConcurrencyConfig.md | 18 +- doc_source/API_DestinationConfig.md | 8 +- doc_source/API_Environment.md | 8 +- doc_source/API_EnvironmentError.md | 8 +- doc_source/API_EnvironmentResponse.md | 8 +- .../API_EventSourceMappingConfiguration.md | 8 +- doc_source/API_FileSystemConfig.md | 8 +- doc_source/API_FunctionCode.md | 8 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 8 +- doc_source/API_FunctionEventInvokeConfig.md | 8 +- doc_source/API_GetAccountSettings.md | 18 +- doc_source/API_GetAlias.md | 18 +- doc_source/API_GetCodeSigningConfig.md | 18 +- doc_source/API_GetEventSourceMapping.md | 18 +- doc_source/API_GetFunction.md | 18 +- .../API_GetFunctionCodeSigningConfig.md | 18 +- doc_source/API_GetFunctionConcurrency.md | 18 +- doc_source/API_GetFunctionConfiguration.md | 18 +- .../API_GetFunctionEventInvokeConfig.md | 18 +- doc_source/API_GetLayerVersion.md | 18 +- doc_source/API_GetLayerVersionByArn.md | 18 +- doc_source/API_GetLayerVersionPolicy.md | 18 +- doc_source/API_GetPolicy.md | 18 +- .../API_GetProvisionedConcurrencyConfig.md | 18 +- doc_source/API_ImageConfig.md | 8 +- doc_source/API_ImageConfigError.md | 8 +- doc_source/API_ImageConfigResponse.md | 8 +- doc_source/API_Invoke.md | 18 +- doc_source/API_InvokeAsync.md | 18 +- doc_source/API_Layer.md | 8 +- doc_source/API_LayerVersionContentInput.md | 8 +- doc_source/API_LayerVersionContentOutput.md | 8 +- doc_source/API_LayerVersionsListItem.md | 8 +- doc_source/API_LayersListItem.md | 8 +- doc_source/API_ListAliases.md | 18 +- doc_source/API_ListCodeSigningConfigs.md | 18 +- doc_source/API_ListEventSourceMappings.md | 18 +- .../API_ListFunctionEventInvokeConfigs.md | 18 +- doc_source/API_ListFunctions.md | 18 +- .../API_ListFunctionsByCodeSigningConfig.md | 18 +- doc_source/API_ListLayerVersions.md | 18 +- doc_source/API_ListLayers.md | 18 +- .../API_ListProvisionedConcurrencyConfigs.md | 18 +- doc_source/API_ListTags.md | 18 +- doc_source/API_ListVersionsByFunction.md | 18 +- doc_source/API_OnFailure.md | 8 +- doc_source/API_OnSuccess.md | 8 +- ...PI_ProvisionedConcurrencyConfigListItem.md | 8 +- doc_source/API_PublishLayerVersion.md | 18 +- doc_source/API_PublishVersion.md | 18 +- .../API_PutFunctionCodeSigningConfig.md | 18 +- doc_source/API_PutFunctionConcurrency.md | 18 +- .../API_PutFunctionEventInvokeConfig.md | 18 +- .../API_PutProvisionedConcurrencyConfig.md | 18 +- .../API_RemoveLayerVersionPermission.md | 18 +- doc_source/API_RemovePermission.md | 18 +- doc_source/API_SelfManagedEventSource.md | 8 +- doc_source/API_SourceAccessConfiguration.md | 8 +- doc_source/API_TagResource.md | 18 +- doc_source/API_TracingConfig.md | 8 +- doc_source/API_TracingConfigResponse.md | 8 +- doc_source/API_UntagResource.md | 18 +- doc_source/API_UpdateAlias.md | 18 +- doc_source/API_UpdateCodeSigningConfig.md | 18 +- doc_source/API_UpdateEventSourceMapping.md | 18 +- doc_source/API_UpdateFunctionCode.md | 18 +- doc_source/API_UpdateFunctionConfiguration.md | 18 +- .../API_UpdateFunctionEventInvokeConfig.md | 18 +- doc_source/API_VpcConfig.md | 8 +- doc_source/API_VpcConfigResponse.md | 8 +- doc_source/applications-tutorial.md | 8 +- doc_source/applications-usecases.md | 6 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-envvars.md | 4 +- doc_source/configuration-vpc-endpoints.md | 10 +- doc_source/csharp-tracing.md | 2 +- doc_source/foundation-console.md | 2 +- doc_source/foundation-progmodel.md | 27 ++ doc_source/functions-code-editor.md | 158 ----------- doc_source/getting-started-create-function.md | 264 +----------------- doc_source/getting-started.md | 11 +- doc_source/gettingstarted-awscli.md | 52 ++-- doc_source/gettingstarted-concepts.md | 6 +- doc_source/gettingstarted-features.md | 31 +- doc_source/gettingstarted-images.md | 227 +++++++++++++++ doc_source/gettingstarted-limits.md | 4 +- doc_source/golang-package.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 50 +++- doc_source/index.md | 12 +- doc_source/invocation-async.md | 23 +- doc_source/invocation-scaling.md | 4 +- doc_source/java-handler.md | 4 +- doc_source/java-tracing.md | 2 +- doc_source/lambda-foundation.md | 13 + doc_source/lambda-functions.md | 6 +- doc_source/lambda-golang.md | 2 +- doc_source/lambda-intro-execution-role.md | 50 ++-- doc_source/lambda-invocation.md | 3 +- doc_source/lambda-managing.md | 8 +- doc_source/lambda-runtimes.md | 4 +- doc_source/nodejs-tracing.md | 2 +- doc_source/python-image.md | 41 +-- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 8 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-image.md | 43 ++- doc_source/ruby-tracing.md | 2 +- doc_source/security-configuration.md | 2 +- doc_source/security-dataprotection.md | 2 +- doc_source/security-resilience.md | 2 +- doc_source/welcome.md | 6 +- doc_source/with-kinesis.md | 4 +- doc_source/with-msk.md | 1 - doc_source/with-s3-tutorial.md | 24 +- 139 files changed, 1188 insertions(+), 1286 deletions(-) create mode 100644 doc_source/foundation-progmodel.md delete mode 100644 doc_source/functions-code-editor.md create mode 100644 doc_source/gettingstarted-images.md create mode 100644 doc_source/lambda-foundation.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index d365af86..be2309f9 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -33,7 +33,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index 6f70e7c4..aab1e7ab 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index ed1614f6..2a0fa673 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -125,12 +125,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index cd2857b7..a0852996 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -146,12 +146,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index c2be5893..53569649 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -43,7 +43,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 641fc0c9..3bbc94a7 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -15,7 +15,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index 808b7807..d4de5f7f 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -14,7 +14,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index adcc72ca..9f2849ef 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -41,7 +41,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index d35e8561..589a046c 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index 2fb185a9..c1339bf1 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -11,7 +11,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index 33ef85bd..a8976da5 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -148,12 +148,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index 01be275e..1e35f971 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -88,12 +88,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c10c1f12..697e4ca8 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -379,12 +379,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 675dda2a..e64d96e1 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -478,12 +478,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index e958b423..8f8df1e7 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index 3ecd3ad8..95780d00 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index af2018a0..fe427fa2 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -53,12 +53,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index 9a7ed927..c3e55997 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -207,12 +207,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index f2ce995b..be3e5628 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index 3727e079..f6953190 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -67,12 +67,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 38f30490..44efacac 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -63,12 +63,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index 58e0a053..c326c4a8 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 44a8a967..9e60611c 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -49,12 +49,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index 7781aacb..43d7413c 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -69,12 +69,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index 6e7375b2..cbd7d1ce 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 97ce945c..2e4a1fa9 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 94ce5d75..64090a24 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index 7bbc27d4..d1aac97f 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -18,7 +18,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index b035d9d8..1eb5193e 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -135,7 +135,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index 4e3ecc1f..bbd04dfc 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -21,7 +21,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index ea8dcf57..df9dc97b 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -36,7 +36,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 59c99331..05f28abb 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -27,7 +27,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index c6105cf6..72a0cd26 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -184,7 +184,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index e2ca486e..af74b844 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -39,7 +39,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index a2da9476..ecdcac45 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -64,12 +64,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index b6e3e516..ab1becc5 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -111,12 +111,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 459415c7..1bd1717a 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -71,12 +71,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index b23d8210..111f34e4 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -201,12 +201,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index ee3d29e0..236dc6bc 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -169,12 +169,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 3e3c1b64..29a92bef 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -85,12 +85,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index 143a3c22..9a367326 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -71,12 +71,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index 5ed5e329..b44033b1 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -287,12 +287,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index a1ff02fc..56a8d428 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index 260e345b..d8de27de 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -117,12 +117,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index 90ea2d4d..c9f75752 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index c81c02ab..caec1a40 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -73,12 +73,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 7e9d820e..93a818c7 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -80,12 +80,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 4248db3d..02bd2717 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -109,12 +109,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index ac7ed0bb..21848202 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -25,7 +25,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index 2e0f10d5..ea1b2c36 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index a71f8502..59a14f95 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 8ee0f24c..8876a4ea 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -212,12 +212,12 @@ HTTP Status Code: 415 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index 69395006..f47bf60e 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -77,12 +77,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index 7f3231c3..ee4be690 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -31,7 +31,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index 0e082bcc..b85670b3 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -31,7 +31,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 9ad0560e..8cb77ffd 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -32,7 +32,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 9171a195..729496ba 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -43,7 +43,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index d87156c7..a6e1947c 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -26,7 +26,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 355812a0..1e286834 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -100,12 +100,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 2317b88d..9dc64827 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -75,12 +75,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index fc36e832..d48d8aed 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -131,12 +131,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index b689c65c..60f2ced3 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -99,12 +99,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index e99ef63e..252c72fb 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -151,12 +151,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index a2cc5696..0440a9ac 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -73,12 +73,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index db472ea6..b003b710 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -89,12 +89,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 3f0ec3fe..64d1eb41 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -83,12 +83,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 77a1530d..93df5308 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -92,12 +92,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index d2dc7f0b..39ccd31a 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index 87a9b031..aff8498d 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 46402c85..7c74fab6 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index ae14a7ea..f2b35f42 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 73d4e84e..4c1a03bb 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -47,7 +47,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 35fb23e5..162ffdf6 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -159,12 +159,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index ef95166a..40de9968 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -319,12 +319,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index 8263662a..e6364276 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -105,12 +105,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index 367942bc..f1448835 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -90,12 +90,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 2818b8f5..774ee816 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -156,12 +156,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index 5123b441..cb76f8d3 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index 769a97a1..d0cb44c6 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index f7533bc9..c85f9254 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -77,12 +77,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 0c6fbb53..27ce6673 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 4cb6fbc6..996c0e54 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -27,7 +27,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 81d0c506..82a06bef 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -68,12 +68,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 48a8dba7..4ff92965 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index acfdfabb..cb3c0e8c 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index eb23ed5e..e2d5bacb 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -60,12 +60,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index e1d3748f..0a163ec3 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index a12662bc..f6e7e8b9 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -98,12 +98,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index b834fc9f..8e9025f0 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -327,12 +327,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index d266387b..c6e04232 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -365,12 +365,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 24c67918..77e5ac07 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -431,12 +431,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 0d90c5ef..38046cdb 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file ++ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index d2610bb6..c44d94f0 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -19,7 +19,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index b68675f5..66609593 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -24,7 +24,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file ++ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 5e13d816..197c620b 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -63,7 +63,7 @@ Create an application in the Lambda console\. In Lambda, an application is an AW 1. Configure application settings\. + **Application name** – **my\-app**\. - + **Runtime** – **Node\.js 10\.x**\. + + **Runtime** – **Node\.js 14\.x**\. + **Source control service** – **CodeCommit**\. + **Repository name** – **my\-app\-repo**\. + **Permissions** – **Create roles and permissions boundary**\. @@ -148,7 +148,7 @@ To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTa Properties: CodeUri: ./ Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler - Runtime: nodejs10.x + Runtime: nodejs14.x MemorySize: 128 Timeout: 60 Description: A Lambda function that returns a static string. @@ -237,7 +237,7 @@ Next, update the function code to use the table\. The following code uses the Dy Properties: CodeUri: ./ Handler: src/handlers/index.handler - Runtime: nodejs10.x + Runtime: nodejs14.x ``` 1. Commit and push the change\. @@ -261,7 +261,7 @@ After the code change is deployed, invoke the function a few times to update the ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-ddbtable.png) -Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [AWS Lambda function scaling](invocation-scaling.md)\. +Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [Lambda function scaling](invocation-scaling.md)\. ## Next steps diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md index 771016c8..5066ea83 100644 --- a/doc_source/applications-usecases.md +++ b/doc_source/applications-usecases.md @@ -1,10 +1,10 @@ # Common Lambda application types and use cases -When building applications on AWS Lambda the core components are Lambda functions and triggers\. A trigger is the AWS service or application that invokes a function, and a Lambda function is the code and runtime that process events\. To illustrate, consider the following scenarios: +Lambda functions and triggers are the core components of building applications on AWS Lambda\. A Lambda function is the code and runtime that process events, while a trigger is the AWS service or application that invokes the function\. To illustrate, consider the following scenarios: + **File processing** – Suppose you have a photo sharing application\. People use your application to upload photos, and the application stores these user photos in an Amazon S3 bucket\. Then, your application creates a thumbnail version of each user's photos and displays them on the user's profile page\. In this scenario, you may choose to create a Lambda function that creates a thumbnail automatically\. Amazon S3 is one of the supported AWS event sources that can publish *object\-created events* and invoke your Lambda function\. Your Lambda function code can read the photo object from the S3 bucket, create a thumbnail version, and then save it in another S3 bucket\. + **Data and analytics** – Suppose you are building an analytics application and storing raw data in a DynamoDB table\. When you write, update, or delete items in a table, DynamoDB streams can publish item update events to a stream associated with the table\. In this case, the event data provides the item key, event name \(such as insert, update, and delete\), and other relevant details\. You can write a Lambda function to generate custom metrics by aggregating raw data\. + **Websites** – Suppose you are creating a website and you want to host the backend logic on Lambda\. You can invoke your Lambda function over HTTP using Amazon API Gateway as the HTTP endpoint\. Now, your web client can invoke the API, and then API Gateway can route the request to Lambda\. -+ **Mobile applications** – Suppose you have a custom mobile application that produces events\. You can create a Lambda function to process events published by your custom application\. For example, in this scenario you can configure a Lambda function to process the clicks within your custom mobile application\. ++ **Mobile applications** – Suppose you have a custom mobile application that produces events\. You can create a Lambda function to process events published by your custom application\. For example, you can configure a Lambda function to process the clicks within your custom mobile application\. AWS Lambda supports many AWS services as event sources\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. When you configure these event sources to trigger a Lambda function, the Lambda function is invoked automatically when events occur\. You define *event source mapping*, which is how you identify what events to track and which Lambda function to invoke\. @@ -46,4 +46,4 @@ The diagram illustrates the following sequence: 1. The Lambda function is invoked with the incoming event\. -When working with stream\-based event sources, you create event source mappings in AWS Lambda\. Lambda reads items from the stream invokes the function synchronously\. You don't need to grant Lambda permission to invoke the function, but it does need permission to read from the stream\. \ No newline at end of file +When working with stream\-based event sources, you create event source mappings in AWS Lambda\. Lambda reads items from the stream and invokes the function synchronously\. You don't need to grant Lambda permission to invoke the function, but it does need permission to read from the stream\. \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index f1cfbbbb..72bc63ea 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -111,7 +111,7 @@ To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIAL If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. -For provisioned concurrency instances, your function's [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index b263c785..fd5e3380 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -1,6 +1,6 @@ # Using AWS Lambda environment variables -You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. +You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that is stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. **Note** To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. @@ -20,7 +20,7 @@ Environment variables are not evaluated prior to the function invocation\. Any v You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\. -You create an environment variable on your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. +You create an environment variable for your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. **To set environment variables in the Lambda console** diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 143492e9..907835cc 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -2,7 +2,7 @@ If you use Amazon Virtual Private Cloud \(Amazon VPC\) to host your AWS resources, you can establish a connection between your VPC and Lambda\. You can use this connection to invoke your Lambda function without crossing the public internet\. -To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. +To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. @@ -35,7 +35,7 @@ Traffic between peered VPCs stays on the AWS network and does not traverse the p ## Creating an interface endpoint for Lambda -You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. +You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. **To create an interface endpoint for Lambda \(console\)** @@ -57,7 +57,7 @@ You can create an interface endpoint for Lambda using either the Amazon VPC cons To use the private DNS option, you must set the `enableDnsHostnames` and `enableDnsSupportattributes` of your VPC\. For more information, see [Viewing and updating DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-updating) in the *Amazon VPC User Guide*\. If you enable private DNS for the interface endpoint, you can make API requests to Lambda using its default DNS name for the Region, for example, `lambda.us-east-1.amazonaws.com`\. For more service endpoints, see [Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html) in the *AWS General Reference*\. -For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. +For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. For information about creating and configuring an endpoint using AWS CloudFormation, see the [AWS::EC2::VPCEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html) resource in the *AWS CloudFormation User Guide*\. @@ -76,7 +76,7 @@ To control who can use your interface endpoint and which Lambda functions the us + The actions that the principal can perform\. + The resources on which the principal can perform actions\. -For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. +For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. **Example: Interface endpoint policy for Lambda actions** The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. @@ -99,4 +99,4 @@ The following is an example of an endpoint policy for Lambda\. When attached to } ] } -``` +``` \ No newline at end of file diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index bae18fb8..380253fe 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -74,7 +74,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md index b930fbfc..1cb4d6d6 100644 --- a/doc_source/foundation-console.md +++ b/doc_source/foundation-console.md @@ -1,4 +1,4 @@ -# Using the Lambda console +# Lambda console You can use the Lambda console to configure applications, functions, code signing configurations, and layers\. diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md new file mode 100644 index 00000000..8dbf5585 --- /dev/null +++ b/doc_source/foundation-progmodel.md @@ -0,0 +1,27 @@ +# Lambda programming model + +Lambda provides a programming model that is common to all of the runtimes\. The programming model defines the interface between your code and the Lambda system\. You tell Lambda the entry point to your function by defining a *handler* in the function configuration\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. + +When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. + +When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) + +Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. + +The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. + +**Note** +Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. + +For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. ++ [Building Lambda functions with Node\.js](lambda-nodejs.md) ++ [Building Lambda functions with Python](lambda-python.md) ++ [Building Lambda functions with Ruby](lambda-ruby.md) ++ [Building Lambda functions with Java](lambda-java.md) ++ [Building Lambda functions with Go](lambda-golang.md) ++ [Building Lambda functions with C\#](lambda-csharp.md) ++ [Building Lambda functions with PowerShell](lambda-powershell.md) + +Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. \ No newline at end of file diff --git a/doc_source/functions-code-editor.md b/doc_source/functions-code-editor.md deleted file mode 100644 index 8c68efd3..00000000 --- a/doc_source/functions-code-editor.md +++ /dev/null @@ -1,158 +0,0 @@ -# Creating functions using the AWS Lambda console editor - -The Lambda console provides a code editor for languages that do not require compiling, such as Node\.js or Python\. The code editor in the AWS Lambda console enables you to write, test, and view the execution results of your Lambda function code\. - -The code editor includes the *menu bar*, *windows*, and the *editor pane*\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) - -For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. - -**Topics** -+ [Working with files and folders](#functions-code-editor-files) -+ [Working with code](#functions-code-editor-code) -+ [Working in fullscreen mode](#functions-code-editor-fullscreen) -+ [Working with preferences](#functions-code-editor-prefs) - -## Working with files and folders - -You can use the **Environment** window in the code editor to create, open, and manage files for your function\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env.png) - -**To show or hide the Environment window**, choose the **Environment** button\. If the **Environment** button is not visible, choose **Window, Environment** on the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-button.png) - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) - - - -**To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. - -**To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. - -**To create a new file**, do one of the following: -+ In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. -+ Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) - - - -**To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. - -**To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. - -**To rename a file or folder**, right\-click the file or folder in the **Environment** window\. Type the replacement name, and then press Enter \. - -**To delete files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Delete**\. Then confirm the deletion by choosing **Yes** \(for a single selection\) or **Yes to All**\. - -**To cut, copy, paste, or duplicate files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Cut**, **Copy**, **Paste**, or **Duplicate**, respectively\. - -**To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) - -**To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. - -## Working with code - -Use the editor pane in the code editor to view and write code\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) - - - -### Working with tab buttons - -Use the *tab buttons bar* to select, view, and create files\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) - - - -**To display an open file's contents**, do one of the following: -+ Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) - - - -**To close an open file**, do one of the following: -+ Choose the **X** icon in the file's tab\. -+ Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. - -**To close multiple open files**, choose the drop\-down menu in the tab buttons bar, and then choose **Close All Tabs in All Panes** or **Close All But Current Tab** as needed\. - -**To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - -### Working with the status bar - -Use the status bar to move quickly to a line in the active file and to change how code is displayed\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) - - - -**To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) - - - -**To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) - -**To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-spaces-tabs.png) - -**To change for all files whether to show or hide invisible characters or the gutter, auto\-pair brackets or quotes, wrap lines, or the font size**, choose the gear icon, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) - - - -## Working in fullscreen mode - -You can expand the code editor to get more room to work with your code\. - -To expand the code editor to the edges of the web browser window, choose the **Toggle fullscreen** button in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) - - - -To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. - -In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. - -## Working with preferences - -You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. - -To change code editor settings, choose the **Preferences** gear icon in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-preferences.png) - -For a list of what the settings do, see the following references in the *AWS Cloud9 User Guide*\. -+ [Project setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-project.html#settings-project-change) -+ [User setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-user.html#settings-user-change) - -Note that some of the settings listed in those references are not available in the code editor\. \ No newline at end of file diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md index 59006aec..90bea1d8 100644 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,18 +1,15 @@ # Create a Lambda function with the console -In the following getting started exercises, you create Lambda functions using the console\. - -In the first exercise, you create a function and use the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. - -In the next exercise, you create a function defined as a container image\. First, create a container image for your function code, and then use the Lambda console to create a function from the container image\. +In this getting started exercise, you create a Lambda function using the console\.The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. **Topics** -+ [Create a Lambda function with default function code](#gettingstarted-zip-function) -+ [Create a function defined as a container image](#gettingstarted-images) ++ [Create the function](#gettingstarted-zip-function) ++ [Invoke the Lambda function](#get-started-invoke-manually) ++ [Clean up](#gettingstarted-cleanup) -## Create a Lambda function with default function code +## Create the function -In this getting started exercise, you create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. Next, you manually invoke the Lambda function using sample event data\. Lambda runs the function and returns results\. You then verify the results, including the logs that your Lambda function created and various Amazon CloudWatch metrics\. +You create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. **To create a Lambda function with the console** @@ -30,13 +27,7 @@ In this getting started exercise, you create a Node\.js Lambda function using th Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -### Use the function overview - -The **Function overview** shows a visualization of your function, including any triggers, destinations, and layer that you have configured for the function\. - -![\[A Lambda function with no triggers, destinations or layers.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) - -### Invoke the Lambda function +## Invoke the Lambda function Invoke your Lambda function using the sample event data provided in the console\. @@ -70,7 +61,7 @@ Invoke your Lambda function using the sample event data provided in the console\ For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. -### Clean up +## Clean up If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. @@ -104,241 +95,4 @@ If you are done working with the example function, delete it\. You can also dele 1. In the **Delete role** dialog box, choose **Yes, delete**\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. - -## Create a function defined as a container image - -In this getting started exercise, you use the Docker CLI to create a container image and then use the Lambda console to create a function from the container image\. - -**Topics** -+ [Prerequisites](#gettingstarted-images-prereq) -+ [Create the container image](#gettingstarted-images-package) -+ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) -+ [Update the user permissions](#gettingstarted-images-permissions) -+ [Create a Lambda function defined as a container image](#gettingstarted-images-function) -+ [Invoke the Lambda function](#get-started-invoke-function) -+ [Clean up](#gettingstarted-image-cleanup) - -### Prerequisites - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. - -This exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. - -### Create the container image - -AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. - -In the following commands, replace `123456789012` with your AWS account ID\. - -**To create an image using the AWS Node\.js 12 base image** - -1. On your local machine, create a project directory for your new function\. - -1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: - - ``` - exports.handler = async (event) => { - // TODO implement - const response = { - statusCode: 200, - body: JSON.stringify('Hello from Lambda!'), - }; - return response; - }; - ``` - -1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: - - ``` - FROM public.ecr.aws/lambda/nodejs:12 - - # Copy function code and package.json - COPY app.js package.json /var/task/ - - # Install NPM dependencies for function - RUN npm install - - # Set the CMD to your handler - CMD [ "app.handler" ] - ``` - -1. Create the `package.json` file\. From your project directory, run the `npm init` command\. Accept all of the default values: - - ``` - npm init - ``` - -1. Build your Docker image\. From your project directory, run the following command: - - ``` - docker build -t hello-world . - ``` - -1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. - - 1. Run your Docker image\. From your project directory, run the `docker run` command: - - ``` - docker run -p 9000:8080 hello-world:latest - ``` - - 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - -### Upload the image to the Amazon ECR repository - -1. Authenticate the Docker CLI to your Amazon ECR registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Create a repository in Amazon ECR using the `create-repository` command\. - - ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` - -1. Tag your image to match your repository name using the `docker tag` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -1. Deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -### Update the user permissions - -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) - -For example, use the IAM console to create a role with the following policy: - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], - "Resource": "arn:aws:ecr:::repository//" - } - ] -} -``` - -### Create a Lambda function defined as a container image - -Use the Lambda console to create a function defined as a container image\. - -**To create the function with the console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose **Create function**\. - -1. Choose the **Container image** option\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter **my\-function**\. - - 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. - -1. Choose **Create function**\. - -Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. - -### Invoke the Lambda function - -Invoke your Lambda function using the sample event data provided in the console\. - -**To invoke a function** - -1. After selecting your function, choose the **Test** tab\. - -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: - - ``` - { - "key1": "value1", - "key2": "value2", - "key3": "value3" - } - ``` - -1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. - - Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. - -1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. - -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. - -1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. - -### Clean up - -If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* - -If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. - -**To delete a Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Actions**, **Delete**\. - -1. In the **Delete function** dialog box, choose **Delete**\. - -**To delete the log group** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. - -1. Select the function's log group \(`/aws/lambda/my-function`\)\. - -1. Choose **Actions**, **Delete log group\(s\)**\. - -1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. - -1. Select the function's role \(`my-function-role-31exxmpl`\)\. - -1. Choose **Delete role**\. - -1. In the **Delete role** dialog box, choose **Yes, delete**\. - -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md index ab68ad07..61859eb6 100644 --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -9,14 +9,9 @@ As a best practice, create an AWS Identity and Access Management \(IAM\) user wi You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](getting-started-create-function.md#gettingstarted-images)\. ++ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Create a Lambda function with the console](getting-started-create-function.md)\. ++ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](gettingstarted-images.md)\. **Topics** + [Create a Lambda function with the console](getting-started-create-function.md) -+ [Creating functions using the AWS Lambda console editor](functions-code-editor.md) -+ [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) -+ [Lambda concepts](gettingstarted-concepts.md) -+ [Lambda features](gettingstarted-features.md) -+ [Lambda deployment packages](gettingstarted-package.md) -+ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file ++ [Create a function defined as a container image](gettingstarted-images.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index b145cf67..4e003bb0 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -1,4 +1,4 @@ -# Using AWS Lambda with the AWS Command Line Interface +# Using Lambda with the AWS CLI You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. @@ -30,6 +30,31 @@ This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service AP Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. To create an execution role with the AWS CLI, use the `create-role` command\. +In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. + +``` +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +``` + +You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. + +**Example trust\-policy\.json** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + ``` aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json ``` @@ -60,31 +85,6 @@ You should see the following output: } ``` -The `trust-policy.json` file is a JSON file in the current directory that defines the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6b394aa1..6c82bbe9 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,6 +1,6 @@ # Lambda concepts -With Lambda, you run functions to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. +Lambda runs instances of your function to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. **Topics** + [Function](#gettingstarted-concepts-function) @@ -19,11 +19,11 @@ With Lambda, you run functions to process events\. To send events to your functi A *function* is a resource that you can invoke to run your code in Lambda\. A function has code to process the [events](#gettingstarted-concepts-event) that you pass into the function or that other AWS services send to the function\. -For more information, see [Managing AWS Lambda functions](lambda-functions.md)\. +For more information, see [Configuring AWS Lambda functions](lambda-functions.md)\. ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. This includes AWS services that you can configure to invoke a function, applications that you develop, and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 709727ba..520eda6f 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -3,7 +3,6 @@ Lambda provides a management console and API for managing and invoking functions\. It provides runtimes that support a standard set of features so that you can easily switch between languages and frameworks, depending on your needs\. In addition to functions, you can also create versions, aliases, layers, and custom runtimes\. **Topics** -+ [Programming model](#gettingstarted-features-programmingmodel) + [Scaling](#gettingstarted-features-scaling) + [Concurrency controls](#gettingstarted-features-concurrency) + [Asynchronous invocation](#gettingstarted-features-async) @@ -13,41 +12,13 @@ Lambda provides a management console and API for managing and invoking functions + [Testing and deployment tools](#gettingstarted-features-tools) + [Application templates](#gettingstarted-features-templates) -## Programming model - -Authoring specifics vary between runtimes, but all runtimes share a common programming model that defines the interface between your code and the runtime code\. You tell the runtime which method to run by defining a *handler* in the function configuration, and the runtime runs that method\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. - -When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. - -When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) - -Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. - -The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. - -**Note** -Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. - -For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. -+ [Building Lambda functions with Node\.js](lambda-nodejs.md) -+ [Building Lambda functions with Python](lambda-python.md) -+ [Building Lambda functions with Ruby](lambda-ruby.md) -+ [Building Lambda functions with Java](lambda-java.md) -+ [Building Lambda functions with Go](lambda-golang.md) -+ [Building Lambda functions with C\#](lambda-csharp.md) -+ [Building Lambda functions with PowerShell](lambda-powershell.md) - -Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. - ## Scaling Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You only pay for the time that your function is initializing or processing events\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) -For more information, see [AWS Lambda function scaling](invocation-scaling.md)\. +For more information, see [Lambda function scaling](invocation-scaling.md)\. ## Concurrency controls diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md new file mode 100644 index 00000000..7061a86d --- /dev/null +++ b/doc_source/gettingstarted-images.md @@ -0,0 +1,227 @@ +# Create a function defined as a container image + +In this getting started exercise, you create a function defined as a container image\. First, you use the Docker CLI to create a container image for your function code, and then use the Lambda console to create a function from the container image\. + +**Topics** ++ [Prerequisites](#gettingstarted-images-prereq) ++ [Create the container image](#gettingstarted-images-package) ++ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) ++ [Update the user permissions](#gettingstarted-images-permissions) ++ [Create a Lambda function defined as a container image](#gettingstarted-images-function) ++ [Invoke the Lambda function](#get-started-invoke-function) ++ [Clean up](#gettingstarted-image-cleanup) + +## Prerequisites + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +aws --version +``` + +You should see the following output: + +``` +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 +``` + +For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + +On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + +This exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. + +## Create the container image + +AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. + +In the following commands, replace `123456789012` with your AWS account ID\. + +**To create an image using the AWS Node\.js 12 base image** + +1. On your local machine, create a project directory for your new function\. + +1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: + + ``` + exports.handler = async (event) => { + // TODO implement + const response = { + statusCode: 200, + body: JSON.stringify('Hello from Lambda!'), + }; + return response; + }; + ``` + +1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: + + ``` + FROM public.ecr.aws/lambda/nodejs:14 + + # Copy function code + COPY app.js ${LAMBDA_TASK_ROOT} + + # Set the CMD to your handler + CMD [ "app.handler" ] + ``` + +1. Build your Docker image\. From your project directory, run the following command: + + ``` + docker build -t hello-world . + ``` + +1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. + + 1. Run your Docker image\. From your project directory, run the `docker run` command: + + ``` + docker run -p 9000:8080 hello-world:latest + ``` + + 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: + + ``` + curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' + ``` + +## Upload the image to the Amazon ECR repository + +1. Authenticate the Docker CLI to your Amazon ECR registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + +1. Tag your image to match your repository name using the `docker tag` command\. + + ``` + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +1. Deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +## Update the user permissions + +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) + +For example, use the IAM console to create a role with the following policy: + +``` +{ +"Version": "2012-10-17", +"Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Resource": "arn:aws:ecr:::repository//" + } +] +} +``` + +## Create a Lambda function defined as a container image + +Use the Lambda console to create a function defined as a container image\. + +**To create the function with the console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose **Create function**\. + +1. Choose the **Container image** option\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter **my\-function**\. + + 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. + +1. Choose **Create function**\. + +Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. + +## Invoke the Lambda function + +Invoke your Lambda function using the sample event data provided in the console\. + +**To invoke a function** + +1. After selecting your function, choose the **Test** tab\. + +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: + + ``` + { + "key1": "value1", + "key2": "value2", + "key3": "value3" + } + ``` + +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + + Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. + +1. Upon successful completion, view the results in the console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. + +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + +## Clean up + +If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* + +If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. + +**To delete a Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Actions**, **Delete**\. + +1. In the **Delete function** dialog box, choose **Delete**\. + +**To delete the log group** + +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. + +1. Select the function's log group \(`/aws/lambda/my-function`\)\. + +1. Choose **Actions**, **Delete log group\(s\)**\. + +1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. + +1. Select the function's role \(`my-function-role-31exxmpl`\)\. + +1. Choose **Delete role**\. + +1. In the **Delete role** dialog box, choose **Yes, delete**\. + +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index a30ebad6..9977f037 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -10,7 +10,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | -For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [AWS Lambda function scaling](invocation-scaling.md)\. +For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [Lambda function scaling](invocation-scaling.md)\. The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. @@ -19,7 +19,7 @@ The following quotas apply to function configuration, deployments, and execution | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | | Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | -| Function [environment variables](configuration-envvars.md) | 4 KB | +| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index ee9506f4..c9ae5298 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -24,7 +24,7 @@ Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** + [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. + [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. + [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. + [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 94755a2a..86ac0456 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -56,7 +56,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 3d64771e..33ceee1d 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -93,14 +93,19 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do + LAMBDA\_TASK\_ROOT=/var/task + LAMBDA\_RUNTIME\_DIR=/var/runtime - The following shows an example Dockerfile for Node\.js version 14\. : + Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. + + The following shows an example Dockerfile for Node\.js, Python, and Ruby: + +------ +#### [ Node\.js 14 ] ``` FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 # Assumes your function is named "app.js", and there is a package.json file in the app directory. - COPY app.js package.json /var/task/ + COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function RUN npm install @@ -109,6 +114,47 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do CMD [ "app.handler" ] ``` +------ +#### [ Python 3\.8 ] + + ``` + FROM public.ecr.aws/lambda/python:3.8 + + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} + + # Install the function's dependencies using file requirements.txt + # from your project folder. + + COPY requirements.txt . + RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.handler" ] + ``` + +------ +#### [ Ruby 2\.7 ] + + ``` + FROM public.ecr.aws/lambda/ruby:2.7 + + # Copy function code + COPY app.rb ${LAMBDA_TASK_ROOT} + + # Copy dependency management file + COPY Gemfile ${LAMBDA_TASK_ROOT} + + # Install dependencies under LAMBDA_TASK_ROOT + ENV GEM_HOME=${LAMBDA_TASK_ROOT} + RUN bundle install + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.LambdaFunction::Handler.process" ] + ``` + +------ + 1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. ``` diff --git a/doc_source/index.md b/doc_source/index.md index c193c4d8..f841dc4a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -18,11 +18,15 @@ Amazon's trademarks and trade dress may not be used in + [Setting up with Lambda](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) + [Create a Lambda function with the console](getting-started-create-function.md) - + [Creating functions using the AWS Lambda console editor](functions-code-editor.md) - + [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md) + + [Create a function defined as a container image](gettingstarted-images.md) ++ [AWS Lambda foundations](lambda-foundation.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + + [Lambda programming model](foundation-progmodel.md) + + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + + [Lambda console](foundation-console.md) + + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) @@ -30,8 +34,7 @@ Amazon's trademarks and trade dress may not be used in + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) -+ [Managing AWS Lambda functions](lambda-functions.md) - + [Using the Lambda console](foundation-console.md) ++ [Configuring AWS Lambda functions](lambda-functions.md) + [Creating Lambda functions defined as .zip file archives](configuration-function-zip.md) + [Creating and sharing Lambda layers](configuration-layers.md) + [Creating Lambda functions defined as container images](configuration-images.md) @@ -53,7 +56,6 @@ Amazon's trademarks and trade dress may not be used in + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + [Monitoring the state of a function with the Lambda API](functions-states.md) - + [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 8d4abdf1..b3f26109 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -2,6 +2,15 @@ Several AWS services, such as Amazon Simple Storage Service \(Amazon S3\) and Amazon Simple Notification Service \(Amazon SNS\), invoke functions asynchronously to process events\. When you invoke a function asynchronously, you don't wait for a response from the function code\. You hand off the event to Lambda and Lambda handles the rest\. You can configure how Lambda handles errors, and can send invocation records to a downstream resource to chain together components of your application\. +**Topics** ++ [How Lambda handles asynchronous invocations](#async-overview) ++ [Configuring error handling for asynchronous invocation](#invocation-async-errors) ++ [Configuring destinations for asynchronous invocation](#invocation-async-destinations) ++ [Asynchronous invocation configuration API](#invocation-async-api) ++ [AWS Lambda function dead\-letter queues](#dlq) + +## How Lambda handles asynchronous invocations + The following diagram shows clients invoking a Lambda function asynchronously\. Lambda queues the events before sending them to the function\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-async.png) @@ -48,12 +57,6 @@ You can also configure Lambda to send an invocation record to another service\. The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an SQS queue or SNS topic as a [dead\-letter queue](#dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. -**Topics** -+ [Configuring error handling for asynchronous invocation](#invocation-async-errors) -+ [Configuring destinations for asynchronous invocation](#invocation-async-destinations) -+ [Asynchronous invocation configuration API](#invocation-async-api) -+ [AWS Lambda function dead\-letter queues](#dlq) - ## Configuring error handling for asynchronous invocation Use the Lambda console to configure error handling settings on a function, a version, or an alias\. @@ -205,11 +208,13 @@ You should see the following output: As an alternative to an [on\-failure destination](#invocation-async-destinations), you can configure your function with a dead\-letter queue to save discarded events for further processing\. A dead\-letter queue acts the same as an on\-failure destination in that it is used when an event fails all processing attempts or expires without being processed\. However, a dead\-letter queue is part of a function's version\-specific configuration, so it is locked in when you publish a version\. On\-failure destinations also support additional targets and include details about the function's response in the invocation record\. -If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. You can retrieve events manually, or you can [configure Lambda to read from the queue](with-sqs.md) and invoke a function\. +To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. + +You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -+ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. You can configure a topic to send events to an email address, a Lambda function, or an HTTP endpoint\. ++ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. Create a topic in the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index 38f3c55d..009e8b5f 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -1,4 +1,4 @@ -# AWS Lambda function scaling +# Lambda function scaling The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. @@ -24,7 +24,7 @@ The function continues to scale until the account's concurrency limit for the fu The regional concurrency limit starts at 1,000\. You can increase the limit by submitting a request in the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency creates a pool that can only be used by its function, and also prevents its function from using unreserved concurrency\. -When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. +When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 0b66d6a4..c599c164 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -38,7 +38,7 @@ The [Lambda runtime](lambda-runtimes.md) receives an event as a JSON\-formatted + `package.Class::method` – Full format\. For example: `example.Handler::handleRequest`\. + `package.Class` – Abbreviated format for functions that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. -You can add [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. +You can add [initialization code](foundation-progmodel.md) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. @@ -57,7 +57,7 @@ public class Handler implements RequestHandler{ String response = new String(); // call Lambda API logger.info("Getting account settings"); - CompletableFuture accountSettings = + CompletableFuture accountSettings = lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); // log execution details logger.info("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index ccc18e0e..294ab1c8 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -55,7 +55,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md new file mode 100644 index 00000000..6a5146eb --- /dev/null +++ b/doc_source/lambda-foundation.md @@ -0,0 +1,13 @@ +# AWS Lambda foundations + +The Lambda function is the foundational principle of Lambda\. You can configure your functions using the Lambda console, Lambda API, AWS CloudFormation or AWS SAM\. You create code for the function and upload the code using a deployment package\. Lambda invokes the function when an event occurs\. Lambda runs multiple instances of your function in parallel, governed by concurrency and scaling limits\. + +**Topics** ++ [Lambda concepts](gettingstarted-concepts.md) ++ [Lambda features](gettingstarted-features.md) ++ [Lambda programming model](foundation-progmodel.md) ++ [Lambda function scaling](invocation-scaling.md) ++ [Lambda deployment packages](gettingstarted-package.md) ++ [Lambda console](foundation-console.md) ++ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) ++ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 60e6c31b..2c1d4d68 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,8 @@ -# Managing AWS Lambda functions +# Configuring AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. [Basic function settings](configuration-function-common.md) include the description and the execution role that you specify when you create a function in the Lambda console\. You can configure more settings after you create a function, or use the API to modify configuration settings such as the handler name, memory allocation, and security groups during creation\. +You can use the AWS Lambda API or console to create functions and configure function settings\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. + +After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 319081ad..7d80d110 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -14,7 +14,7 @@ Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** + [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. + [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing execution context information from the [context object](golang-context.md)\. ++ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. + [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. + [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index bce78b63..2e6e17c1 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -63,6 +63,31 @@ To learn more, see [Generate policies based on access activity](https://docs.aws To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. +In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. + +``` +aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' +``` + +You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. + +**Example trust\-policy\.json** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] +} +``` + ``` aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json ``` @@ -93,31 +118,6 @@ You should see the following output: } ``` -The `trust-policy.json` file is a JSON file in the current directory that defines the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -You can also specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index a446b1a4..d92a1452 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -10,14 +10,13 @@ To process items from a stream or queue, you can create an [event source mapping Other AWS services and resources invoke your function directly\. For example, you can configure CloudWatch Events to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. **Topics** + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + [Monitoring the state of a function with the Lambda API](functions-states.md) -+ [AWS Lambda function scaling](invocation-scaling.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md index 2f751d0e..41d90511 100644 --- a/doc_source/lambda-managing.md +++ b/doc_source/lambda-managing.md @@ -1,12 +1,8 @@ # Managing AWS Lambda functions -Concurrency is the number of instances of your function that are active\. Scaling is how quickly Lambda increases the the number of instances\. +[Configuring AWS Lambda functions](lambda-functions.md) describes the how to configure the core capabilities and options for a function\. Lambda also provides advanced features such as concurrency control, network access, database interworking, file systems, and code signing\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [AWS Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. - - - -As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. +[Concurrency](configuration-concurrency.md) is the number of instances of your function that are active\. Lambda provides two types of concurrency controls: reserved concurrency and provisioned concurrency\. To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 68f22226..80a32d32 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -12,7 +12,7 @@ When you use a \.zip file archive for the deployment package, you choose a runti + Image – Custom + Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 -When your function is invoked, Lambda attempts to re\-use the execution environment from a previous invocation if one is available\. When an [execution environment](runtimes-context.md) is reused, time is saved because your resources, such as database connections and temporary files, do not have to be recreated before your function runs\. +Lambda invokes your function in an [execution environment](runtimes-context.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. @@ -99,4 +99,4 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index e3ab82dc..a83541ff 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -90,7 +90,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b7f6ee42..b9008b74 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -69,45 +69,28 @@ When you build a container image for Python using an AWS base image, you only ne return 'Hello from AWS Lambda using Python' + sys.version + '!' ``` -1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. +1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. Leave the file empty if there are no dependencies\. - ``` - FROM public.ecr.aws/lambda/python:3.8 - - COPY app.py ./ - CMD ["app.handler"] - ``` - -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base.title)\. - -### Adding dependencies when you create a Python image - -If your Lambda function depends on external Python libraries, modify the previous procedure as follows: - -1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. - -1. Modify your Dockerfile to add the required libraries to the container image\. The following example copies the requirements file and installs the required libraries into the `app` directory\. Do not install the dependencies globally or in user space\. +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. ``` FROM public.ecr.aws/lambda/python:3.8 - - # Create function directory - WORKDIR /app - # Install the function's dependencies - # Copy file requirements.txt from your project folder and install - # the requirements in the app directory. + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} - COPY requirements.txt . - RUN pip3 install -r requirements.txt + # Install the function's dependencies using file requirements.txt + # from your project folder. - # Copy handler function (from the local app directory) - COPY app.py . + COPY requirements.txt . + RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" - # Overwrite the command by providing a different command directly in the template. - CMD ["/app/app.handler"] + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.handler" ] ``` +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. + ## Create a Python image from an alternative base image For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 79fb10c2..22221d64 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -40,7 +40,7 @@ environ({'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/my-function', 'AWS_LAMBDA_LOG ## EVENT {'key': 'value'} END RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 -REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms +REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms XRAY TraceId: 1-5e34a614-10bdxmplf1fb44f07bc535a1 SegmentId: 07f5xmpl2d1f6f85 Sampled: true ``` @@ -218,6 +218,6 @@ START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST [INFO] 2020-01-31T22:12:58.535Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 {'key': 'value'} END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 -REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms +REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true ``` \ No newline at end of file diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md index a2f536ae..732f0120 100644 --- a/doc_source/python-package-create.md +++ b/doc_source/python-package-create.md @@ -302,11 +302,11 @@ Create the \.zip file that Lambda uses as your deployment package\. ``` import requests - def main(event, context): + def main(event, context): response = requests.get("https://www.test.com/") print(response.text) return response.text - if __name__ == "__main__": + if __name__ == "__main__": main('', '') ``` @@ -434,7 +434,7 @@ You can now delete the resources that you created for this tutorial, unless you + Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. ``` - aws lambda delete-function --function-name my-sourcecode-function + aws lambda delete-function --function-name my-function ``` This command produces no output\. @@ -451,4 +451,4 @@ You can now delete the resources that you created for this tutorial, unless you ``` aws iam delete-role --role-name lambda-ex - ``` + ``` \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index b3129243..57dcf1ac 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -71,7 +71,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 3cb98410..45a3011b 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -46,4 +46,45 @@ gem install aws_lambda_ric For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) on [RubyGems\.org](https://rubygems.org/pages/about)\. -You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. + +## Deploying Ruby with an AWS base image + +When you build a container image for Ruby using an AWS base image, you only need to copy the ruby app to the container and install any dependencies\. + +**To build and deploy a Ruby function with the `ruby:2.7` base image\.** + +1. On your local machine, create a project directory for your new function\. + +1. In your project directory, add a file named `app.rb` containing your function code\. The following example shows a simple Ruby handler\. + + ``` + module LambdaFunction + class Handler + def self.process(event:,context:) + "Hello from Ruby 2.7 container image!" + end + end + end + ``` + +1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. + + ``` + FROM public.ecr.aws/lambda/ruby:2.7 + + # Copy function code + COPY app.rb ${LAMBDA_TASK_ROOT} + + # Copy dependency management file + COPY Gemfile ${LAMBDA_TASK_ROOT} + + # Install dependencies under LAMBDA_TASK_ROOT + ENV GEM_HOME=${LAMBDA_TASK_ROOT} + RUN bundle install + + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) + CMD [ "app.LambdaFunction::Handler.process" ] + ``` + +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. \ No newline at end of file diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index ee881ffb..df3ebaa3 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -70,7 +70,7 @@ The following example shows a trace with 2 segments\. Both are named **my\-funct ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](gettingstarted-features.md#gettingstarted-features-programmingmodel)\. This subsegment only appears for the first event processed by each instance of your function\. ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. + **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. + **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md index 68aee0f3..c995e7a0 100644 --- a/doc_source/security-configuration.md +++ b/doc_source/security-configuration.md @@ -2,6 +2,6 @@ AWS Lambda provides [runtimes](lambda-runtimes.md) that run your function code in an Amazon Linux–based execution environment\. Lambda is responsible for keeping software in the runtime and execution environment up to date, releasing new runtimes for new languages and frameworks, and deprecating runtimes when the underlying software is no longer supported\. -If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](getting-started-create-function.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. +If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](gettingstarted-images.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime support policy](runtime-support-policy.md)\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 2c25ed53..9c6e2690 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -34,6 +34,6 @@ Additionally, you can use the following features to customize how environment va For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -Lambda always encrypts files that you upload to Lambda, including [deployment packages](getting-started-create-function.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. +Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 2f4dff9d..0aa543bb 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -6,7 +6,7 @@ For more information about AWS Regions and Availability Zones, see [AWS global i In addition to the AWS global infrastructure, Lambda offers several features to help support your data resiliency and backup needs\. + **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. -+ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [AWS Lambda function scaling](invocation-scaling.md)\. ++ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. + **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. + **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md index a436a30a..a6b1bedb 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -73,7 +73,7 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo 1. **To create and test a Lambda function using the Lambda console, try the [console\-based getting started exercise](getting-started.md)\.** This exercise teaches you about the Lambda programming model and other concepts\. -1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](getting-started-create-function.md#gettingstarted-images)\.** +1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](gettingstarted-images.md)\.** AWS also provides the following resources for learning about serverless applications and Lambda: + The [AWS Compute Blog](http://aws.amazon.com/blogs/compute/ ) includes useful articles about Lambda\. @@ -92,8 +92,8 @@ If you are a first\-time user of Lambda, we recommend that you start with the fo ## Accessing Lambda You can create, invoke, and manage your Lambda functions using any of the following interfaces: -+ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Using the Lambda console](foundation-console.md)\. -+ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using AWS Lambda with the AWS Command Line Interface](gettingstarted-awscli.md)\. ++ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Lambda console](foundation-console.md)\. ++ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using Lambda with the AWS CLI](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. + **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. + **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 783c19fc..1bfce67b 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -10,7 +10,7 @@ To minimize latency and maximize read throughput, you can create a data stream c For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. -Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. +Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. Each batch contains records from a single shard/data stream\. **Example Kinesis record event** @@ -123,7 +123,7 @@ To send records of failed batches to a queue or topic, your function needs addit ## Configuring a stream as an event source -Create an event source mapping to tell Lambda to send records from your data stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple data streams with a single function\. +Create an event source mapping to tell Lambda to send records from your data stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple data streams with a single function\. When processing items from multiple data streams, each batch will only contain records from a single shard/stream\. To configure your function to read from Kinesis in the Lambda console, create a **Kinesis** trigger\. diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 512f60f8..3ae31b37 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -184,7 +184,6 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | | BatchSize | N | 100 | Maximum: 10,000 | -| DestinationConfig | N | none | | | Enabled | N | Enabled | | | EventSourceArn | Y | | Can set only on Create | | FunctionName | Y | | | diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 5921f6c6..5464af60 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -182,14 +182,14 @@ exports.handler = async (event, context, callback) => { return; } - // Check that the image type is supported + // Check that the image type is supported const imageType = typeMatch[1].toLowerCase(); if (imageType != "jpg" && imageType != "png") { console.log(`Unsupported image type: ${imageType}`); return; } - // Download the image from the S3 source bucket. + // Download the image from the S3 source bucket. try { const params = { @@ -201,19 +201,19 @@ exports.handler = async (event, context, callback) => { } catch (error) { console.log(error); return; - } + } // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. const width = 200; // Use the sharp module to resize the image and save in a buffer. - try { + try { var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - + } catch (error) { console.log(error); return; - } + } // Upload the thumbnail image to the destination bucket try { @@ -224,15 +224,15 @@ exports.handler = async (event, context, callback) => { ContentType: "image" }; - const putResult = await s3.putObject(destparams).promise(); - + const putResult = await s3.putObject(destparams).promise(); + } catch (error) { console.log(error); return; - } - + } + console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); + ' and uploaded to ' + dstBucket + '/' + dstKey); }; ``` @@ -580,7 +580,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - aws lambda invoke + aws lambda invoke --function-name CreateThumbnail \ --invocation-type Event \ --payload file://inputFile.txt outputfile.txt From 78a1a2ec216effb3f5c5181b2c2ef313bdc23c6c Mon Sep 17 00:00:00 2001 From: Felipe Alvarez <275621+felipe1982@users.noreply.github.com> Date: Thu, 12 Aug 2021 11:30:05 +1000 Subject: [PATCH 123/243] removed suggestion that CMK means customer managed key CKM is not customer managed key. --- doc_source/security-dataprotection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 9c6e2690..0da22207 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -29,11 +29,11 @@ For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.a You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\) or customer managed keys\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. ++ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\)\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. + **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file +Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. From 0f31cd417a9f9e64fec91cd36470bd75084e8e84 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 17 Aug 2021 17:44:16 -0600 Subject: [PATCH 124/243] Remove period in Docker comment for consistency No other commented sentence includes one --- doc_source/images-create.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 33ceee1d..c9466515 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -104,7 +104,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - # Assumes your function is named "app.js", and there is a package.json file in the app directory. + # Assumes your function is named "app.js", and there is a package.json file in the app directory COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function @@ -297,4 +297,4 @@ You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create a In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. -For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file +For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. From 72e689d6f9a4939a7c0425ca061c090accc42ab6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Fri, 20 Aug 2021 13:40:13 -0700 Subject: [PATCH 125/243] Add note in java-events pointing to java-events-v1sdk examples if necessary --- sample-apps/java-events/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index a8a0b7d8..d99fa3b1 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -2,6 +2,8 @@ This sample application shows the use of the `aws-lambda-java-events` library with various event types. To keep the deployment size minimal, it includes only types that can be used without adding the AWS SDK as a dependency. A separate handler class is defined for each input type. +**Note: To use these examples, you must be using version 3.0.0 or newer of the `aws-lambda-java-events` dependency.** If you are on an older version, see the [`java-events-v1sdk` package](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) for deprecated examples. If possible, update your `aws-lambda-java-events` dependency to version 3.0.0 or newer. + ![Architecture](/sample-apps/java-events/images/sample-java-events.png) The project includes function code and supporting resources: From 2d2df77e214d59b20385d96a9f7bbfa8c776e63a Mon Sep 17 00:00:00 2001 From: Saintmalik Date: Sun, 22 Aug 2021 08:05:56 +0000 Subject: [PATCH 126/243] fix typos in doc --- doc_source/API_Invoke.md | 4 ++-- doc_source/troubleshooting-images.md | 4 ++-- doc_source/with-sns-example.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 8876a4ea..22c31332 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -118,7 +118,7 @@ HTTP Status Code: 502 HTTP Status Code: 502 **EFSIOException** -An error occured when reading from or writing to a connected file system\. +An error occurred when reading from or writing to a connected file system\. HTTP Status Code: 410 **EFSMountConnectivityException** @@ -220,4 +220,4 @@ For more information about using this API in one of the language\-specific AWS S + [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) + [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) + [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index dbfc8d50..d0f78cc5 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -6,7 +6,7 @@ Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. -## Lambda: System provisioning additonal capacity +## Lambda: System provisioning additional capacity **Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* @@ -16,4 +16,4 @@ Retry the function invocation\. If the retry fails, validate that the files requ **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* -Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file +Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 03e2fffe..0d23320b 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -130,7 +130,7 @@ Do not use the `--source-account` parameter to add a source account to the Lambd **Note** If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. -## Create a subscription +## Create a subscription From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. @@ -207,4 +207,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the subscription you created\. -1. Choose **Delete**, **Delete**\. \ No newline at end of file +1. Choose **Delete**, **Delete**\. From acde21cb1eeba558955f5b71090bae97684c5de7 Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Fri, 27 Aug 2021 10:14:21 -0700 Subject: [PATCH 127/243] Remove instructions for Node.js 10.x base image --- doc_source/nodejs-image.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 60c1a5ee..1638ca99 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -25,7 +25,6 @@ AWS provides the following base images for Node\.js: | --- | --- | --- | --- | | 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | -| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | Docker Hub repository: amazon/aws\-lambda\-nodejs @@ -47,4 +46,4 @@ npm install aws-lambda-ric For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. -You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. From b8d8cb99ad742034f01f3c17d6e0e48c883dd26c Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Thu, 2 Sep 2021 15:27:05 -0700 Subject: [PATCH 128/243] Node.js 10.x EOS phase 2 start is now Sept 17th --- doc_source/runtime-support-policy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 87a4c1ad..b44d706a 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -21,7 +21,7 @@ The following runtimes have reached or are scheduled for end of support: | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | | Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | | Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Aug 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Sept 17, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | @@ -38,4 +38,4 @@ In almost all cases, the end\-of\-life date of a language version or operating s + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) From b8305f75aa5ea26d5cdd6645b185cfc1996aea52 Mon Sep 17 00:00:00 2001 From: NiumXp <43611165+NiumXp@users.noreply.github.com> Date: Fri, 10 Sep 2021 01:55:18 -0300 Subject: [PATCH 129/243] fix typo in configuration-function-commom.md --- doc_source/configuration-function-common.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index 72202d40..079c5ac0 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -1,6 +1,6 @@ # Configuring Lambda function options -After you create a function, you can configure additional capabilities for the function, such as triggers, network acccess, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. +After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. You can also create and edit test events to test your function using the console\. @@ -158,4 +158,4 @@ Saved test events are also available from the **Code** tab, under the **Test** m 1. Choose **Test**\. -1. Expand the **Execution result** panel to display details about the test\. \ No newline at end of file +1. Expand the **Execution result** panel to display details about the test\. From db8b7396901dc07a3377e888359862e072f8a64f Mon Sep 17 00:00:00 2001 From: maxday Date: Thu, 16 Sep 2021 20:43:27 -0400 Subject: [PATCH 130/243] fix incorrect value for maxBytes + add missing comma + format --- doc_source/runtimes-logs-api.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index 82e9c6db..e25263ad 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -79,20 +79,21 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{ "schemaVersion": "2020-08-15", - "types": [ - "platform", - "function" +{ + "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" ], - "buffering": { - "maxItems": 1000, - "maxBytes": 10240, - "timeoutMs": 100 + "buffering": { + "maxItems": 1000, + "maxBytes": 262144, + "timeoutMs": 100 + }, + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080/lambda_logs" } - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080/lambda_logs" - } } ``` From 99d79a302a66334721b0abc757265c7f955e4cad Mon Sep 17 00:00:00 2001 From: Michael Roloff Date: Sat, 18 Sep 2021 18:59:57 +0200 Subject: [PATCH 131/243] d --- sample-apps/blank-python/.idea/.gitignore | 8 ++++++++ sample-apps/blank-python/.idea/aws.xml | 17 +++++++++++++++++ sample-apps/blank-python/.idea/blank-python.iml | 8 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++++ sample-apps/blank-python/.idea/misc.xml | 4 ++++ sample-apps/blank-python/.idea/modules.xml | 8 ++++++++ sample-apps/blank-python/.idea/vcs.xml | 6 ++++++ sample-apps/blank-python/1-create-bucket.sh | 8 ++++---- 8 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 sample-apps/blank-python/.idea/.gitignore create mode 100644 sample-apps/blank-python/.idea/aws.xml create mode 100644 sample-apps/blank-python/.idea/blank-python.iml create mode 100644 sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 sample-apps/blank-python/.idea/misc.xml create mode 100644 sample-apps/blank-python/.idea/modules.xml create mode 100644 sample-apps/blank-python/.idea/vcs.xml diff --git a/sample-apps/blank-python/.idea/.gitignore b/sample-apps/blank-python/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/sample-apps/blank-python/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/sample-apps/blank-python/.idea/aws.xml b/sample-apps/blank-python/.idea/aws.xml new file mode 100644 index 00000000..2c4ea32b --- /dev/null +++ b/sample-apps/blank-python/.idea/aws.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/blank-python.iml b/sample-apps/blank-python/.idea/blank-python.iml new file mode 100644 index 00000000..9b31378a --- /dev/null +++ b/sample-apps/blank-python/.idea/blank-python.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml b/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/sample-apps/blank-python/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/misc.xml b/sample-apps/blank-python/.idea/misc.xml new file mode 100644 index 00000000..d1e22ecb --- /dev/null +++ b/sample-apps/blank-python/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/modules.xml b/sample-apps/blank-python/.idea/modules.xml new file mode 100644 index 00000000..92f039cd --- /dev/null +++ b/sample-apps/blank-python/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/.idea/vcs.xml b/sample-apps/blank-python/.idea/vcs.xml new file mode 100644 index 00000000..b2bdec2d --- /dev/null +++ b/sample-apps/blank-python/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-python/1-create-bucket.sh b/sample-apps/blank-python/1-create-bucket.sh index 64a5f749..160f00ed 100755 --- a/sample-apps/blank-python/1-create-bucket.sh +++ b/sample-apps/blank-python/1-create-bucket.sh @@ -1,5 +1,5 @@ #!/bin/bash -BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -BUCKET_NAME=lambda-artifacts-$BUCKET_ID -echo $BUCKET_NAME > bucket-name.txt -aws s3 mb s3://$BUCKET_NAME +# BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +# BUCKET_NAME=lambda-artifacts-$BUCKET_ID +# echo $BUCKET_NAME > bucket-name.txt +# aws s3 mb s3://$BUCKET_NAME From c70b3a8173d16f46d9f1b6e3e92c1c960282a052 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Mon, 20 Sep 2021 17:21:25 +0000 Subject: [PATCH 132/243] Documentation updates --- doc_source/API_AccountLimit.md | 12 +- doc_source/API_AccountUsage.md | 4 +- doc_source/API_AddLayerVersionPermission.md | 34 +- doc_source/API_AddPermission.md | 37 +- doc_source/API_AliasConfiguration.md | 14 +- doc_source/API_AliasRoutingConfiguration.md | 2 +- doc_source/API_AllowedPublishers.md | 2 +- doc_source/API_CodeSigningConfig.md | 16 +- doc_source/API_CodeSigningPolicies.md | 2 +- doc_source/API_Concurrency.md | 4 +- doc_source/API_CreateAlias.md | 36 +- doc_source/API_CreateCodeSigningConfig.md | 18 +- doc_source/API_CreateEventSourceMapping.md | 123 ++--- doc_source/API_CreateFunction.md | 164 +++---- doc_source/API_DeadLetterConfig.md | 2 +- doc_source/API_DeleteAlias.md | 12 +- doc_source/API_DeleteCodeSigningConfig.md | 10 +- doc_source/API_DeleteEventSourceMapping.md | 72 +-- doc_source/API_DeleteFunction.md | 16 +- .../API_DeleteFunctionCodeSigningConfig.md | 14 +- doc_source/API_DeleteFunctionConcurrency.md | 12 +- .../API_DeleteFunctionEventInvokeConfig.md | 16 +- doc_source/API_DeleteLayerVersion.md | 8 +- .../API_DeleteProvisionedConcurrencyConfig.md | 14 +- doc_source/API_DestinationConfig.md | 8 +- doc_source/API_Environment.md | 2 +- doc_source/API_EnvironmentError.md | 4 +- doc_source/API_EnvironmentResponse.md | 6 +- .../API_EventSourceMappingConfiguration.md | 60 +-- doc_source/API_FileSystemConfig.md | 4 +- doc_source/API_FunctionCode.md | 10 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 78 +-- doc_source/API_FunctionEventInvokeConfig.md | 12 +- doc_source/API_GetAccountSettings.md | 12 +- doc_source/API_GetAlias.md | 26 +- doc_source/API_GetCodeSigningConfig.md | 12 +- doc_source/API_GetEventSourceMapping.md | 70 +-- doc_source/API_GetFunction.md | 26 +- .../API_GetFunctionCodeSigningConfig.md | 14 +- doc_source/API_GetFunctionConcurrency.md | 14 +- doc_source/API_GetFunctionConfiguration.md | 94 ++-- .../API_GetFunctionEventInvokeConfig.md | 26 +- doc_source/API_GetLayerVersion.md | 32 +- doc_source/API_GetLayerVersionByArn.md | 30 +- doc_source/API_GetLayerVersionPolicy.md | 18 +- doc_source/API_GetPolicy.md | 16 +- .../API_GetProvisionedConcurrencyConfig.md | 26 +- doc_source/API_ImageConfig.md | 6 +- doc_source/API_ImageConfigError.md | 4 +- doc_source/API_ImageConfigResponse.md | 8 +- doc_source/API_Invoke.md | 78 +-- doc_source/API_InvokeAsync.md | 18 +- doc_source/API_Layer.md | 8 +- doc_source/API_LayerVersionContentInput.md | 8 +- doc_source/API_LayerVersionContentOutput.md | 10 +- doc_source/API_LayerVersionsListItem.md | 14 +- doc_source/API_LayersListItem.md | 8 +- doc_source/API_ListAliases.md | 22 +- doc_source/API_ListCodeSigningConfigs.md | 14 +- doc_source/API_ListEventSourceMappings.md | 22 +- .../API_ListFunctionEventInvokeConfigs.md | 22 +- doc_source/API_ListFunctions.md | 22 +- .../API_ListFunctionsByCodeSigningConfig.md | 16 +- doc_source/API_ListLayerVersions.md | 24 +- doc_source/API_ListLayers.md | 20 +- .../API_ListProvisionedConcurrencyConfigs.md | 20 +- doc_source/API_ListTags.md | 16 +- doc_source/API_ListVersionsByFunction.md | 20 +- doc_source/API_OnFailure.md | 2 +- doc_source/API_OnSuccess.md | 2 +- doc_source/API_Operations.md | 116 ++--- ...PI_ProvisionedConcurrencyConfigListItem.md | 14 +- doc_source/API_PublishLayerVersion.md | 48 +- doc_source/API_PublishVersion.md | 106 ++-- .../API_PutFunctionCodeSigningConfig.md | 20 +- doc_source/API_PutFunctionConcurrency.md | 22 +- .../API_PutFunctionEventInvokeConfig.md | 38 +- .../API_PutProvisionedConcurrencyConfig.md | 28 +- .../API_RemoveLayerVersionPermission.md | 20 +- doc_source/API_RemovePermission.md | 20 +- doc_source/API_SelfManagedEventSource.md | 2 +- doc_source/API_SourceAccessConfiguration.md | 4 +- doc_source/API_TagResource.md | 14 +- doc_source/API_TracingConfig.md | 2 +- doc_source/API_TracingConfigResponse.md | 2 +- doc_source/API_Types.md | 72 +-- doc_source/API_UntagResource.md | 14 +- doc_source/API_UpdateAlias.md | 40 +- doc_source/API_UpdateCodeSigningConfig.md | 22 +- doc_source/API_UpdateEventSourceMapping.md | 109 +++-- doc_source/API_UpdateFunctionCode.md | 118 ++--- doc_source/API_UpdateFunctionConfiguration.md | 150 +++--- .../API_UpdateFunctionEventInvokeConfig.md | 36 +- doc_source/API_VpcConfig.md | 4 +- doc_source/API_VpcConfigResponse.md | 6 +- doc_source/access-control-identity-based.md | 4 +- doc_source/access-control-resource-based.md | 2 +- doc_source/applications-usecases.md | 12 +- doc_source/configuration-aliases.md | 2 +- doc_source/configuration-concurrency.md | 182 +------ doc_source/configuration-envvars.md | 4 +- doc_source/configuration-filesystem.md | 2 +- doc_source/configuration-function-common.md | 19 +- doc_source/configuration-images.md | 2 +- doc_source/configuration-vpc-endpoints.md | 6 +- doc_source/configuration-vpc.md | 4 +- doc_source/csharp-exceptions.md | 2 +- doc_source/csharp-image.md | 14 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-package-toolkit.md | 5 +- doc_source/csharp-tracing.md | 2 +- doc_source/foundation-progmodel.md | 2 - doc_source/functions-states.md | 42 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 2 +- doc_source/gettingstarted-images.md | 2 +- doc_source/gettingstarted-limits.md | 59 ++- doc_source/go-image.md | 17 +- doc_source/golang-exceptions.md | 2 +- doc_source/golang-logging.md | 2 +- doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 4 +- doc_source/index.md | 12 +- doc_source/invocation-async.md | 19 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-images.md | 6 +- doc_source/java-context.md | 1 - doc_source/java-exceptions.md | 3 +- doc_source/java-handler.md | 1 - doc_source/java-image.md | 15 +- doc_source/java-logging.md | 3 +- doc_source/java-package.md | 2 +- doc_source/java-samples.md | 6 +- doc_source/java-tracing.md | 3 +- doc_source/lambda-api-permissions-ref.md | 2 +- doc_source/lambda-intro-execution-role.md | 4 +- doc_source/lambda-invocation.md | 2 +- doc_source/lambda-java.md | 10 +- doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 11 +- doc_source/lambda-releases.md | 8 +- doc_source/lambda-runtimes.md | 9 +- doc_source/lambda-samples.md | 1 - doc_source/lambda-services.md | 2 +- doc_source/monitoring-cloudwatchlogs.md | 10 +- doc_source/monitoring-metrics.md | 4 +- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-handler.md | 2 + doc_source/nodejs-image.md | 14 +- doc_source/nodejs-logging.md | 2 +- doc_source/nodejs-package.md | 2 - doc_source/nodejs-tracing.md | 2 +- doc_source/powershell-exceptions.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/provisioned-concurrency.md | 177 +++++++ doc_source/python-context.md | 2 +- doc_source/python-exceptions.md | 4 +- doc_source/python-handler.md | 9 +- doc_source/python-image.md | 18 +- doc_source/python-logging.md | 4 +- doc_source/python-package-create.md | 454 ------------------ doc_source/python-package-update.md | 215 --------- doc_source/python-package.md | 201 +++++++- doc_source/python-tracing.md | 4 +- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-image.md | 17 +- doc_source/ruby-logging.md | 2 +- doc_source/ruby-package.md | 2 - doc_source/ruby-tracing.md | 2 +- doc_source/runtime-support-policy.md | 4 +- doc_source/runtimes-context.md | 2 +- doc_source/runtimes-custom.md | 2 - doc_source/runtimes-extensions-api.md | 3 +- doc_source/runtimes-images.md | 2 +- doc_source/runtimes-modify.md | 1 + doc_source/samples-blank.md | 12 +- doc_source/samples-errorprocessor.md | 10 +- doc_source/samples-listmanager.md | 8 +- doc_source/security-dataprotection.md | 4 +- doc_source/security-iam.md | 2 +- doc_source/security-infrastructure.md | 2 +- doc_source/security-resilience.md | 4 +- doc_source/services-alexa.md | 3 +- doc_source/services-apigateway-blueprint.md | 29 +- .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-cloudwatchevents.md | 3 + doc_source/services-ec2-tutorial.md | 6 - doc_source/services-s3-object-lambda.md | 5 + doc_source/services-xray.md | 8 +- doc_source/troubleshooting-images.md | 2 +- doc_source/troubleshooting-invocation.md | 6 +- doc_source/using-extensions.md | 3 +- doc_source/with-android-example.md | 2 - doc_source/with-ddb.md | 16 +- doc_source/with-kafka.md | 58 ++- doc_source/with-kinesis-example.md | 4 +- doc_source/with-kinesis.md | 16 +- doc_source/with-mq.md | 10 +- doc_source/with-msk.md | 50 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sqs-example.md | 60 +-- doc_source/with-sqs.md | 10 +- 203 files changed, 2158 insertions(+), 2539 deletions(-) create mode 100644 doc_source/provisioned-concurrency.md delete mode 100644 doc_source/python-package-create.md delete mode 100644 doc_source/python-package-update.md create mode 100644 doc_source/services-s3-object-lambda.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md index be2309f9..8f1ca0c8 100644 --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -4,28 +4,28 @@ Limits that are related to concurrency and storage\. All file and storage sizes ## Contents - **CodeSizeUnzipped** + ** CodeSizeUnzipped ** The maximum size of a function's deployment package and layers when they're extracted\. Type: Long Required: No - **CodeSizeZipped** + ** CodeSizeZipped ** The maximum size of a deployment package when it's uploaded directly to Lambda\. Use Amazon S3 for larger files\. Type: Long Required: No - **ConcurrentExecutions** + ** ConcurrentExecutions ** The maximum number of simultaneous function executions\. Type: Integer Required: No - **TotalCodeSize** + ** TotalCodeSize ** The amount of storage space that you can use for all deployment packages and layer archives\. Type: Long Required: No - **UnreservedConcurrentExecutions** -The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. + ** UnreservedConcurrentExecutions ** +The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. Type: Integer Valid Range: Minimum value of 0\. Required: No diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md index aab1e7ab..d316b7b8 100644 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -4,12 +4,12 @@ The number of functions and amount of storage in use\. ## Contents - **FunctionCount** + ** FunctionCount ** The number of Lambda functions\. Type: Long Required: No - **TotalCodeSize** + ** TotalCodeSize ** The amount of storage space, in bytes, that's being used by deployment packages and layer archives\. Type: Long Required: No diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md index 2a0fa673..f06b3e02 100644 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -2,7 +2,7 @@ Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. -To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. +To revoke permission, call [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. ## Request Syntax @@ -22,16 +22,16 @@ Content-type: application/json The request uses the following URI parameters\. - ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ LayerName ](#API_AddLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ RevisionId ](#API_AddLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ VersionNumber ](#API_AddLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -39,27 +39,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ Action ](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes - ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ OrganizationId ](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No - ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ Principal ](#API_AddLayerVersionPermission_RequestSyntax) ** An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes - ** [StatementId](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [ StatementId ](#API_AddLayerVersionPermission_RequestSyntax) ** An identifier that distinguishes the policy from others on the same layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -84,41 +84,41 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [RevisionId](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [ RevisionId ](#API_AddLayerVersionPermission_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String - ** [Statement](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [ Statement ](#API_AddLayerVersionPermission_ResponseSyntax) ** The permission statement\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PolicyLengthExceededException** + ** PolicyLengthExceededException ** The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md index a0852996..4889c9d4 100644 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -1,6 +1,6 @@ # AddPermission -Grants an AWS service or another account 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\. +Grants an AWS service or another account 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 to version $LATEST\. To grant permission to another account, specify the account ID as the `Principal`\. For AWS services, the principal is a domain\-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com`\. For AWS services, you can also specify the ARN of the associated resource as the `SourceArn`\. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function\. @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_AddPermission_RequestSyntax) ** + ** [ FunctionName ](#API_AddPermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -39,7 +39,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_AddPermission_RequestSyntax) ** + ** [ Qualifier ](#API_AddPermission_RequestSyntax) ** Specify a version or alias to add permissions to a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -48,44 +48,45 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [Action](#API_AddPermission_RequestSyntax) ** + ** [ Action ](#API_AddPermission_RequestSyntax) ** The action that the principal can use on the function\. For example, `lambda:InvokeFunction` or `lambda:GetFunction`\. Type: String Pattern: `(lambda:[*]|lambda:[a-zA-Z]+|[*])` Required: Yes - ** [EventSourceToken](#API_AddPermission_RequestSyntax) ** + ** [ EventSourceToken ](#API_AddPermission_RequestSyntax) ** For Alexa Smart Home functions, a token that must be supplied by the invoker\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Pattern: `[a-zA-Z0-9._\-]+` Required: No - ** [Principal](#API_AddPermission_RequestSyntax) ** + ** [ Principal ](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String Pattern: `[^\s]+` Required: Yes - ** [RevisionId](#API_AddPermission_RequestSyntax) ** + ** [ RevisionId ](#API_AddPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. Type: String Required: No - ** [SourceAccount](#API_AddPermission_RequestSyntax) ** + ** [ SourceAccount ](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No - ** [SourceArn](#API_AddPermission_RequestSyntax) ** + ** [ SourceArn ](#API_AddPermission_RequestSyntax) ** For AWS services, the ARN of the AWS resource that invokes the function\. For example, an Amazon S3 bucket or Amazon SNS topic\. +Note that Lambda configures the comparison using the `StringLike` operator\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [StatementId](#API_AddPermission_RequestSyntax) ** + ** [ StatementId ](#API_AddPermission_RequestSyntax) ** A statement identifier that differentiates the statement from others in the same policy\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -109,37 +110,37 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [Statement](#API_AddPermission_ResponseSyntax) ** + ** [ Statement ](#API_AddPermission_ResponseSyntax) ** The permission statement that's added to the function policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PolicyLengthExceededException** + ** PolicyLengthExceededException ** The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md index 53569649..13d6487b 100644 --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -4,40 +4,40 @@ Provides configuration information about a Lambda function [alias](https://docs. ## Contents - **AliasArn** + ** AliasArn ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **Description** + ** Description ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **FunctionVersion** + ** FunctionVersion ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - **Name** + ** Name ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: No - **RevisionId** + ** RevisionId ** A unique identifier that changes when you update the alias\. Type: String Required: No - **RoutingConfig** + ** RoutingConfig ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## See Also diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md index 3bbc94a7..8eab8c2a 100644 --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -4,7 +4,7 @@ The [traffic\-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traf ## Contents - **AdditionalVersionWeights** + ** AdditionalVersionWeights ** The second version, and the percentage of traffic that's routed to it\. Type: String to double map Key Length Constraints: Minimum length of 1\. Maximum length of 1024\. diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md index d4de5f7f..1060d3b2 100644 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -4,7 +4,7 @@ List of signing profiles that can sign a code package\. ## Contents - **SigningProfileVersionArns** + ** SigningProfileVersionArns ** The Amazon Resource Name \(ARN\) for each of the signing profiles\. A signing profile defines a trusted user who can sign a code package\. Type: Array of strings Array Members: Minimum number of 1 item\. Maximum number of 20 items\. diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md index 9f2849ef..10c2381f 100644 --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -4,36 +4,36 @@ Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/ ## Contents - **AllowedPublishers** + ** AllowedPublishers ** List of allowed publishers\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: Yes - **CodeSigningConfigArn** + ** CodeSigningConfigArn ** The Amazon Resource Name \(ARN\) of the Code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - **CodeSigningConfigId** + ** CodeSigningConfigId ** Unique identifer for the Code signing configuration\. Type: String Pattern: `csc-[a-zA-Z0-9-_\.]{17}` Required: Yes - **CodeSigningPolicies** + ** CodeSigningPolicies ** The code signing policy controls the validation failure action for signature mismatch or expiry\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: Yes - **Description** + ** Description ** Code signing configuration description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **LastModified** + ** LastModified ** The date and time that the Code signing configuration was last modified, in ISO\-8601 format \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String Required: Yes diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md index 589a046c..fdeb3b45 100644 --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -4,7 +4,7 @@ Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/ ## Contents - **UntrustedArtifactOnDeployment** + ** UntrustedArtifactOnDeployment ** Code signing configuration policy for deployment validation failure\. If you set the policy to `Enforce`, Lambda blocks the deployment request if signature validation checks fail\. If you set the policy to `Warn`, Lambda allows the deployment and creates a CloudWatch log\. Default value: `Warn` Type: String diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md index c1339bf1..b9c53c9d 100644 --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -2,8 +2,8 @@ ## Contents - **ReservedConcurrentExecutions** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. + ** ReservedConcurrentExecutions ** +The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. Required: No diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md index a8976da5..710f21c9 100644 --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -26,7 +26,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_CreateAlias_RequestSyntax) ** + ** [ FunctionName ](#API_CreateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -42,29 +42,29 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Description](#API_CreateAlias_RequestSyntax) ** + ** [ Description ](#API_CreateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [FunctionVersion](#API_CreateAlias_RequestSyntax) ** + ** [ FunctionVersion ](#API_CreateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: Yes - ** [Name](#API_CreateAlias_RequestSyntax) ** + ** [ Name ](#API_CreateAlias_RequestSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: Yes - ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** + ** [ RoutingConfig ](#API_CreateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -93,55 +93,55 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_CreateAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_CreateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Description](#API_CreateAlias_ResponseSyntax) ** + ** [ Description ](#API_CreateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_CreateAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_CreateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_CreateAlias_ResponseSyntax) ** + ** [ Name ](#API_CreateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_CreateAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_CreateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_CreateAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_CreateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index 1e35f971..eaa6639a 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -27,17 +27,17 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ AllowedPublishers ](#API_CreateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: Yes - ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningPolicies ](#API_CreateCodeSigningConfig_RequestSyntax) ** The code signing policies define the actions to take if the validation checks fail\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: No - ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [ Description ](#API_CreateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -71,17 +71,17 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_CreateCodeSigningConfig_ResponseSyntax) ** The code signing configuration\. -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 697e4ca8..c16ceb8e 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,10 +2,10 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. In particular, each of the topics describes the required and optional parameters for the specific event source\. +For details about each event source type, see the following topics\. + [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) + [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Configuring an Amazon SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) + [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) + [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) + [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) @@ -69,8 +69,8 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_CreateEventSourceMapping_RequestSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. @@ -80,22 +80,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ DestinationConfig ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** -If true, the event source mapping is active\. Set to false to pause polling and invocation\. + ** [ Enabled ](#API_CreateEventSourceMapping_RequestSyntax) ** +When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. +Default: True Type: Boolean Required: No - ** [EventSourceArn](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ EventSourceArn ](#API_CreateEventSourceMapping_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -105,7 +106,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ FunctionName ](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -119,38 +120,40 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. + ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ Queues ](#API_CreateEventSourceMapping_RequestSyntax) ** \(MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -158,29 +161,29 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_RequestSyntax) ** The Self\-Managed Apache Kafka cluster to send records\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object Required: No - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ StartingPosition ](#API_CreateEventSourceMapping_RequestSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_RequestSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ Topics ](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -188,7 +191,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -248,131 +251,135 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_CreateEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_CreateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_CreateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_CreateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_CreateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index e64d96e1..45fcf6b0 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -6,17 +6,17 @@ You set the package type to `Image` if the deployment package is a [container im You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. -When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. -The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. +The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([ TagResource ](API_TagResource.md)\) and per\-function concurrency limits \([ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [ UpdateFunctionCode ](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. -If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. +If another account or an AWS service invokes your function, use [ AddPermission ](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. -To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. +To invoke your function directly, use [ Invoke ](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. ## Request Syntax @@ -84,41 +84,41 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [Code](#API_CreateFunction_RequestSyntax) ** + ** [ Code ](#API_CreateFunction_RequestSyntax) ** The code for the function\. -Type: [FunctionCode](API_FunctionCode.md) object +Type: [ FunctionCode ](API_FunctionCode.md) object Required: Yes - ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_CreateFunction_RequestSyntax) ** To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: No - ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** + ** [ DeadLetterConfig ](#API_CreateFunction_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - ** [Description](#API_CreateFunction_RequestSyntax) ** + ** [ Description ](#API_CreateFunction_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [Environment](#API_CreateFunction_RequestSyntax) ** + ** [ Environment ](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object +Type: [ Environment ](API_Environment.md) object Required: No - ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** + ** [ FileSystemConfigs ](#API_CreateFunction_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [FunctionName](#API_CreateFunction_RequestSyntax) ** + ** [ FunctionName ](#API_CreateFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -131,79 +131,79 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Handler](#API_CreateFunction_RequestSyntax) ** + ** [ Handler ](#API_CreateFunction_RequestSyntax) ** The name of the method within your code that Lambda calls to execute your function\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** + ** [ ImageConfig ](#API_CreateFunction_RequestSyntax) ** Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No - ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** + ** [ KMSKeyArn ](#API_CreateFunction_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No - ** [Layers](#API_CreateFunction_RequestSyntax) ** + ** [ Layers ](#API_CreateFunction_RequestSyntax) ** A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [MemorySize](#API_CreateFunction_RequestSyntax) ** + ** [ MemorySize ](#API_CreateFunction_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [PackageType](#API_CreateFunction_RequestSyntax) ** + ** [ PackageType ](#API_CreateFunction_RequestSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. Type: String Valid Values:` Zip | Image` Required: No - ** [Publish](#API_CreateFunction_RequestSyntax) ** + ** [ Publish ](#API_CreateFunction_RequestSyntax) ** Set to true to publish the first version of the function during creation\. Type: Boolean Required: No - ** [Role](#API_CreateFunction_RequestSyntax) ** + ** [ Role ](#API_CreateFunction_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: Yes - ** [Runtime](#API_CreateFunction_RequestSyntax) ** + ** [ Runtime ](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Tags](#API_CreateFunction_RequestSyntax) ** + ** [ Tags ](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. Type: String to string map Required: No - ** [Timeout](#API_CreateFunction_RequestSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. + ** [ Timeout ](#API_CreateFunction_RequestSyntax) ** +The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** + ** [ TracingConfig ](#API_CreateFunction_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object +Type: [ TracingConfig ](API_TracingConfig.md) object Required: No - ** [VpcConfig](#API_CreateFunction_RequestSyntax) ** + ** [ VpcConfig ](#API_CreateFunction_RequestSyntax) ** For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [VpcConfig](API_VpcConfig.md) object +Type: [ VpcConfig ](API_VpcConfig.md) object Required: No ## Response Syntax @@ -291,187 +291,187 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_CreateFunction_ResponseSyntax) ** + ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_CreateFunction_ResponseSyntax) ** + ** [ CodeSize ](#API_CreateFunction_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_CreateFunction_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_CreateFunction_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_CreateFunction_ResponseSyntax) ** + ** [ Description ](#API_CreateFunction_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_CreateFunction_ResponseSyntax) ** + ** [ Environment ](#API_CreateFunction_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_CreateFunction_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** + ** [ FunctionArn ](#API_CreateFunction_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionName](#API_CreateFunction_ResponseSyntax) ** + ** [ FunctionName ](#API_CreateFunction_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Handler](#API_CreateFunction_ResponseSyntax) ** + ** [ Handler ](#API_CreateFunction_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_CreateFunction_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [LastModified](#API_CreateFunction_ResponseSyntax) ** + ** [ LastModified ](#API_CreateFunction_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [LastUpdateStatus](#API_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_CreateFunction_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [LastUpdateStatusReason](#API_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_CreateFunction_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_CreateFunction_ResponseSyntax) ** + ** [ Layers ](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_CreateFunction_ResponseSyntax) ** + ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** + ** [ MemorySize ](#API_CreateFunction_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_CreateFunction_ResponseSyntax) ** + ** [ PackageType ](#API_CreateFunction_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** + ** [ RevisionId ](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_CreateFunction_ResponseSyntax) ** + ** [ Role ](#API_CreateFunction_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_CreateFunction_ResponseSyntax) ** + ** [ Runtime ](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** + ** [ SigningJobArn ](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_CreateFunction_ResponseSyntax) ** + ** [ State ](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [StateReason](#API_CreateFunction_ResponseSyntax) ** + ** [ StateReason ](#API_CreateFunction_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** + ** [ StateReasonCode ](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_CreateFunction_ResponseSyntax) ** + ** [ Timeout ](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [TracingConfig](#API_CreateFunction_ResponseSyntax) ** + ** [ TracingConfig ](#API_CreateFunction_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_CreateFunction_ResponseSyntax) ** + ** [ Version ](#API_CreateFunction_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_CreateFunction_ResponseSyntax) ** + ** [ VpcConfig ](#API_CreateFunction_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeStorageExceededException** + ** CodeStorageExceededException ** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md index 8f8df1e7..472781c8 100644 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -4,7 +4,7 @@ The [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation ## Contents - **TargetArn** + ** TargetArn ** The Amazon Resource Name \(ARN\) of an Amazon SQS queue or Amazon SNS topic\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md index 95780d00..a2009314 100644 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Name](#API_DeleteAlias_RequestSyntax) ** + ** [ Name ](#API_DeleteAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,19 +46,19 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md index fe427fa2..4736a717 100644 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_DeleteCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -34,19 +34,19 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index c3e55997..614c5471 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -1,6 +1,6 @@ # DeleteEventSourceMapping -Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. +Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. When you delete an event source mapping, it enters a `Deleting` state and might not be completely deleted for several seconds\. @@ -14,7 +14,7 @@ DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_DeleteEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -76,131 +76,135 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_DeleteEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_DeleteEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_DeleteEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_DeleteEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceInUseException** + ** ResourceInUseException ** The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md index be3e5628..2b753d6f 100644 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -2,7 +2,7 @@ Deletes a Lambda function\. To delete a specific function version, use the `Qualifier` parameter\. Otherwise, all versions and aliases are deleted\. -To delete Lambda event source mappings that invoke a function, use [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. +To delete Lambda event source mappings that invoke a function, use [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunction_RequestSyntax) ** The name of the Lambda function or version\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteFunction_RequestSyntax) ** Specify a version to delete\. You can't delete a version that's referenced by an alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md index f6953190..140631dd 100644 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -40,27 +40,27 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md index 44efacac..a5d54266 100644 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -12,7 +12,7 @@ DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -40,23 +40,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md index c326c4a8..8ae03cdb 100644 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Deletes the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifie The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md index 9e60611c..7b64f0e2 100644 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -12,13 +12,13 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_DeleteLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** + ** [ VersionNumber ](#API_DeleteLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -38,11 +38,11 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md index 43d7413c..3bbd703f 100644 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qual The request uses the following URI parameters\. - ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -46,23 +46,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md index cbd7d1ce..a0fb8fc5 100644 --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -4,14 +4,14 @@ A configuration object that specifies the destination of an event after Lambda p ## Contents - **OnFailure** + ** OnFailure ** The destination configuration for failed invocations\. -Type: [OnFailure](API_OnFailure.md) object +Type: [ OnFailure ](API_OnFailure.md) object Required: No - **OnSuccess** + ** OnSuccess ** The destination configuration for successful invocations\. -Type: [OnSuccess](API_OnSuccess.md) object +Type: [ OnSuccess ](API_OnSuccess.md) object Required: No ## See Also diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md index 2e4a1fa9..0c18270f 100644 --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -4,7 +4,7 @@ A function's environment variable settings\. You can use environment variables t ## Contents - **Variables** + ** Variables ** Environment variable key\-value pairs\. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md index 64090a24..1532e16f 100644 --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -4,12 +4,12 @@ Error messages for environment variables that couldn't be applied\. ## Contents - **ErrorCode** + ** ErrorCode ** The error code\. Type: String Required: No - **Message** + ** Message ** The error message\. Type: String Required: No diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index d1aac97f..f1dadee3 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -4,12 +4,12 @@ The results of an operation to update or read environment variables\. If the ope ## Contents - **Error** + ** Error ** Error messages for environment variables that couldn't be applied\. -Type: [EnvironmentError](API_EnvironmentError.md) object +Type: [ EnvironmentError ](API_EnvironmentError.md) object Required: No - **Variables** + ** Variables ** Environment variable key\-value pairs\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 1eb5193e..6303741e 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,79 +1,83 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. +A mapping between an AWS resource and a Lambda function\. For details, see [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\. ## Contents - **BatchSize** -The maximum number of items to retrieve in a single batch\. + ** BatchSize ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - **BisectBatchOnFunctionError** + ** BisectBatchOnFunctionError ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean Required: No - **DestinationConfig** + ** DestinationConfig ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - **EventSourceArn** + ** EventSourceArn ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **FunctionArn** + ** FunctionArn ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **FunctionResponseTypes** + ** FunctionResponseTypes ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - **LastModified** + ** LastModified ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp Required: No - **LastProcessingResult** + ** LastProcessingResult ** The result of the last Lambda invocation of your function\. Type: String Required: No - **MaximumBatchingWindowInSeconds** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** MaximumBatchingWindowInSeconds ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - **MaximumRecordAgeInSeconds** + ** MaximumRecordAgeInSeconds ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - **MaximumRetryAttempts** + ** MaximumRetryAttempts ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - **ParallelizationFactor** + ** ParallelizationFactor ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - **Queues** + ** Queues ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -81,39 +85,39 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - **SelfManagedEventSource** + ** SelfManagedEventSource ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object Required: No - **SourceAccessConfigurations** + ** SourceAccessConfigurations ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - **StartingPosition** + ** StartingPosition ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - **StartingPositionTimestamp** + ** StartingPositionTimestamp ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - **State** + ** State ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String Required: No - **StateTransitionReason** + ** StateTransitionReason ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String Required: No - **Topics** + ** Topics ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -121,13 +125,13 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - **TumblingWindowInSeconds** + ** TumblingWindowInSeconds ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No - **UUID** + ** UUID ** The identifier of the event source mapping\. Type: String Required: No diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md index bbd04dfc..9c5257df 100644 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -4,14 +4,14 @@ Details about the connection between a Lambda function and an [Amazon EFS file s ## Contents - **Arn** + ** Arn ** The Amazon Resource Name \(ARN\) of the Amazon EFS access point that provides access to the file system\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:access-point/fsap-[a-f0-9]{17}` Required: Yes - **LocalMountPath** + ** LocalMountPath ** The path where the function can access the file system, starting with `/mnt/`\. Type: String Length Constraints: Maximum length of 160\. diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md index df9dc97b..0a3dfa0f 100644 --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -4,31 +4,31 @@ The code for the Lambda function\. You can specify either an object in Amazon S3 ## Contents - **ImageUri** + ** ImageUri ** URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. Type: String Required: No - **S3Bucket** + ** S3Bucket ** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? + ** S3Key ** The Amazon S3 key of the deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **S3ObjectVersion** + ** S3ObjectVersion ** For versioned objects, the version of the deployment package object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **ZipFile** + ** ZipFile ** The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Type: Base64\-encoded binary data object Required: No diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md index 05f28abb..d21a8936 100644 --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -4,22 +4,22 @@ Details about a function's deployment package\. ## Contents - **ImageUri** + ** ImageUri ** URI of a container image in the Amazon ECR registry\. Type: String Required: No - **Location** + ** Location ** A presigned URL that you can use to download the deployment package\. Type: String Required: No - **RepositoryType** + ** RepositoryType ** The service that's hosting the file\. Type: String Required: No - **ResolvedImageUri** + ** ResolvedImageUri ** The resolved URI for the image\. Type: String Required: No diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 72a0cd26..3f9d6178 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -4,181 +4,181 @@ Details about a function's configuration\. ## Contents - **CodeSha256** + ** CodeSha256 ** The SHA256 hash of the function's deployment package\. Type: String Required: No - **CodeSize** + ** CodeSize ** The size of the function's deployment package, in bytes\. Type: Long Required: No - **DeadLetterConfig** + ** DeadLetterConfig ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - **Description** + ** Description ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **Environment** + ** Environment ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object Required: No - **FileSystemConfigs** + ** FileSystemConfigs ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - **FunctionArn** + ** FunctionArn ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **FunctionName** + ** FunctionName ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **Handler** + ** Handler ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - **ImageConfigResponse** + ** ImageConfigResponse ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object Required: No - **KMSKeyArn** + ** KMSKeyArn ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No - **LastModified** + ** LastModified ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String Required: No - **LastUpdateStatus** + ** LastUpdateStatus ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` Required: No - **LastUpdateStatusReason** + ** LastUpdateStatusReason ** The reason for the last update that was performed on the function\. Type: String Required: No - **LastUpdateStatusReasonCode** + ** LastUpdateStatusReasonCode ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No - **Layers** + ** Layers ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects Required: No - **MasterArn** + ** MasterArn ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **MemorySize** + ** MemorySize ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - **PackageType** + ** PackageType ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` Required: No - **RevisionId** + ** RevisionId ** The latest updated revision of the function or alias\. Type: String Required: No - **Role** + ** Role ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: No - **Runtime** + ** Runtime ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - **SigningJobArn** + ** SigningJobArn ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **State** + ** State ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` Required: No - **StateReason** + ** StateReason ** The reason for the function's current state\. Type: String Required: No - **StateReasonCode** + ** StateReasonCode ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` Required: No - **Timeout** + ** Timeout ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. Required: No - **TracingConfig** + ** TracingConfig ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object Required: No - **Version** + ** Version ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - **VpcConfig** + ** VpcConfig ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object Required: No ## See Also diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md index af74b844..1ea75549 100644 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ ## Contents - **DestinationConfig** + ** DestinationConfig ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -10,27 +10,27 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - **FunctionArn** + ** FunctionArn ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **LastModified** + ** LastModified ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp Required: No - **MaximumEventAgeInSeconds** + ** MaximumEventAgeInSeconds ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - **MaximumRetryAttempts** + ** MaximumRetryAttempts ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md index ecdcac45..f18742f2 100644 --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -43,21 +43,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AccountLimit](#API_GetAccountSettings_ResponseSyntax) ** + ** [ AccountLimit ](#API_GetAccountSettings_ResponseSyntax) ** Limits that are related to concurrency and code storage\. -Type: [AccountLimit](API_AccountLimit.md) object +Type: [ AccountLimit ](API_AccountLimit.md) object - ** [AccountUsage](#API_GetAccountSettings_ResponseSyntax) ** + ** [ AccountUsage ](#API_GetAccountSettings_ResponseSyntax) ** The number of functions and amount of storage in use\. -Type: [AccountUsage](API_AccountUsage.md) object +Type: [ AccountUsage ](API_AccountUsage.md) object ## Errors - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md index ab1becc5..9c1f7756 100644 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetAlias_RequestSyntax) ** + ** [ FunctionName ](#API_GetAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Name](#API_GetAlias_RequestSyntax) ** + ** [ Name ](#API_GetAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -60,51 +60,51 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_GetAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_GetAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Description](#API_GetAlias_ResponseSyntax) ** + ** [ Description ](#API_GetAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_GetAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_GetAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_GetAlias_ResponseSyntax) ** + ** [ Name ](#API_GetAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_GetAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_GetAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_GetAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_GetAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md index 1bd1717a..7c2d839d 100644 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_GetCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -50,21 +50,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_GetCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index 111f34e4..cb995038 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -1,6 +1,6 @@ # GetEventSourceMapping -Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. +Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_GetEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -74,127 +74,131 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_GetEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_GetEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_GetEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_GetEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_GetEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_GetEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_GetEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_GetEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_GetEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 236dc6bc..1335cd85 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunction_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunction_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_GetFunction_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunction_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -132,37 +132,37 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Code](#API_GetFunction_ResponseSyntax) ** + ** [ Code ](#API_GetFunction_ResponseSyntax) ** The deployment package of the function or version\. -Type: [FunctionCodeLocation](API_FunctionCodeLocation.md) object +Type: [ FunctionCodeLocation ](API_FunctionCodeLocation.md) object - ** [Concurrency](#API_GetFunction_ResponseSyntax) ** + ** [ Concurrency ](#API_GetFunction_ResponseSyntax) ** The function's [reserved concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. -Type: [Concurrency](API_Concurrency.md) object +Type: [ Concurrency ](API_Concurrency.md) object - ** [Configuration](#API_GetFunction_ResponseSyntax) ** + ** [ Configuration ](#API_GetFunction_ResponseSyntax) ** The configuration of the function or version\. -Type: [FunctionConfiguration](API_FunctionConfiguration.md) object +Type: [ FunctionConfiguration ](API_FunctionConfiguration.md) object - ** [Tags](#API_GetFunction_ResponseSyntax) ** + ** [ Tags ](#API_GetFunction_ResponseSyntax) ** The function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. Type: String to string map ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md index 29a92bef..ebfabc08 100644 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,13 +46,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfigArn ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -66,19 +66,19 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md index 9a367326..017f6474 100644 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -1,6 +1,6 @@ # GetFunctionConcurrency -Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. +Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,26 +45,26 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ReservedConcurrentExecutions](#API_GetFunctionConcurrency_ResponseSyntax) ** + ** [ ReservedConcurrentExecutions ](#API_GetFunctionConcurrency_ResponseSyntax) ** The number of simultaneous executions that are reserved for the function\. Type: Integer Valid Range: Minimum value of 0\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index b44033b1..b3307f36 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -1,8 +1,8 @@ # GetFunctionConfiguration -Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. -To get all of a function's details, including function\-level settings, use [GetFunction](API_GetFunction.md)\. +To get all of a function's details, including function\-level settings, use [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1. The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionConfiguration_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunctionConfiguration_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -120,167 +120,167 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSize ](#API_GetFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Description ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Environment ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_GetFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionName](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionName ](#API_GetFunctionConfiguration_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Handler](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Handler ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [LastModified](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastModified ](#API_GetFunctionConfiguration_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [LastUpdateStatus](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_GetFunctionConfiguration_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [LastUpdateStatusReason](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Layers ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ MemorySize ](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ PackageType ](#API_GetFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ RevisionId ](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Role ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Runtime ](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ SigningJobArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ State ](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [StateReason](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ StateReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ StateReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Timeout ](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [TracingConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ TracingConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ Version ](#API_GetFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ VpcConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md index 56a8d428..4f593364 100644 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Retrieves the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H The request uses the following URI parameters\. - ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -63,7 +63,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -71,42 +71,42 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [LastModified](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index d8de27de..b32f1a07 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_GetLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** + ** [ VersionNumber ](#API_GetLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -56,61 +56,61 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Content ](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_GetLayerVersion_ResponseSyntax) ** + ** [ CreatedDate ](#API_GetLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Description ](#API_GetLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LayerArn ](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [LayerVersionArn](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [LicenseInfo](#API_GetLayerVersion_ResponseSyntax) ** + ** [ LicenseInfo ](#API_GetLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_GetLayerVersion_ResponseSyntax) ** + ** [ Version ](#API_GetLayerVersion_ResponseSyntax) ** The version number\. Type: Long ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index c9f75752..fcbd7e96 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -12,7 +12,7 @@ GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 The request uses the following URI parameters\. - ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** + ** [ Arn ](#API_GetLayerVersionByArn_RequestSyntax) ** The ARN of the layer version\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` @@ -52,61 +52,61 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Content ](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ CreatedDate ](#API_GetLayerVersionByArn_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Description ](#API_GetLayerVersionByArn_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LayerArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [LayerVersionArn](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [LicenseInfo](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ LicenseInfo ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [ Version ](#API_GetLayerVersionByArn_ResponseSyntax) ** The version number\. Type: Long ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md index caec1a40..4fe6a68b 100644 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 The request uses the following URI parameters\. - ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [ LayerName ](#API_GetLayerVersionPolicy_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [ VersionNumber ](#API_GetLayerVersionPolicy_RequestSyntax) ** The version number\. Required: Yes @@ -44,29 +44,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [ Policy ](#API_GetLayerVersionPolicy_ResponseSyntax) ** The policy document\. Type: String - ** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [ RevisionId ](#API_GetLayerVersionPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md index 93a818c7..c8bac1f3 100644 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [FunctionName](#API_GetPolicy_RequestSyntax) ** + ** [ FunctionName ](#API_GetPolicy_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_GetPolicy_RequestSyntax) ** + ** [ Qualifier ](#API_GetPolicy_RequestSyntax) ** Specify a version or alias to get the policy for that resource\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,29 +51,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Policy](#API_GetPolicy_ResponseSyntax) ** + ** [ Policy ](#API_GetPolicy_ResponseSyntax) ** The resource\-based policy\. Type: String - ** [RevisionId](#API_GetPolicy_ResponseSyntax) ** + ** [ RevisionId ](#API_GetPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index 02bd2717..16674dc4 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi The request uses the following URI parameters\. - ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -56,53 +56,53 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AllocatedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AvailableProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ LastModified ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String - ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ RequestedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ Status ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ StatusReason ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ProvisionedConcurrencyConfigNotFoundException** + ** ProvisionedConcurrencyConfigNotFoundException ** The specified configuration does not exist\. HTTP Status Code: 404 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md index 21848202..151d0ad7 100644 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -4,19 +4,19 @@ Configuration values that override the container image Dockerfile settings\. See ## Contents - **Command** + ** Command ** Specifies parameters that you want to pass in with ENTRYPOINT\. Type: Array of strings Array Members: Maximum number of 1500 items\. Required: No - **EntryPoint** + ** EntryPoint ** Specifies the entry point to their application, which is typically the location of the runtime executable\. Type: Array of strings Array Members: Maximum number of 1500 items\. Required: No - **WorkingDirectory** + ** WorkingDirectory ** Specifies the working directory\. Type: String Length Constraints: Maximum length of 1000\. diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md index ea1b2c36..f64556b5 100644 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -4,12 +4,12 @@ Error response to GetFunctionConfiguration\. ## Contents - **ErrorCode** + ** ErrorCode ** Error code\. Type: String Required: No - **Message** + ** Message ** Error message\. Type: String Required: No diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md index 59a14f95..3337f9ed 100644 --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -4,14 +4,14 @@ Response to GetFunctionConfiguration request\. ## Contents - **Error** + ** Error ** Error response to GetFunctionConfiguration\. -Type: [ImageConfigError](API_ImageConfigError.md) object +Type: [ ImageConfigError ](API_ImageConfigError.md) object Required: No - **ImageConfig** + ** ImageConfig ** Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No ## See Also diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 22c31332..2f449d7b 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -29,10 +29,10 @@ Payload The request uses the following URI parameters\. - ** [ClientContext](#API_Invoke_RequestSyntax) ** + ** [ ClientContext ](#API_Invoke_RequestSyntax) ** Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. - ** [FunctionName](#API_Invoke_RequestSyntax) ** + ** [ FunctionName ](#API_Invoke_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -44,18 +44,18 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [InvocationType](#API_Invoke_RequestSyntax) ** + ** [ InvocationType ](#API_Invoke_RequestSyntax) ** Choose from the following options\. + `RequestResponse` \(default\) \- Invoke the function synchronously\. Keep the connection open until the function returns a response or times out\. The API response includes the function response and additional data\. + `Event` \- Invoke the function asynchronously\. Send events that fail multiple times to the function's dead\-letter queue \(if it's configured\)\. The API response only includes a status code\. + `DryRun` \- Validate parameter values and verify that the user or role has permission to invoke the function\. Valid Values:` Event | RequestResponse | DryRun` - ** [LogType](#API_Invoke_RequestSyntax) ** -Set to `Tail` to include the execution log in the response\. + ** [ LogType ](#API_Invoke_RequestSyntax) ** +Set to `Tail` to include the execution log in the response\. Applies to synchronously invoked functions only\. Valid Values:` None | Tail` - ** [Qualifier](#API_Invoke_RequestSyntax) ** + ** [ Qualifier ](#API_Invoke_RequestSyntax) ** Specify a version or alias to invoke a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -64,7 +64,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. - ** [Payload](#API_Invoke_RequestSyntax) ** + ** [ Payload ](#API_Invoke_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. ## Response Syntax @@ -82,130 +82,130 @@ Payload If the action is successful, the service sends back the following HTTP response\. - ** [StatusCode](#API_Invoke_ResponseSyntax) ** + ** [ StatusCode ](#API_Invoke_ResponseSyntax) ** The HTTP status code is in the 200 range for a successful request\. For the `RequestResponse` invocation type, this status code is 200\. For the `Event` invocation type, this status code is 202\. For the `DryRun` invocation type, the status code is 204\. The response returns the following HTTP headers\. - ** [ExecutedVersion](#API_Invoke_ResponseSyntax) ** + ** [ ExecutedVersion ](#API_Invoke_ResponseSyntax) ** The version of the function that executed\. When you invoke a function with an alias, this indicates which version the alias resolved to\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [FunctionError](#API_Invoke_ResponseSyntax) ** + ** [ FunctionError ](#API_Invoke_ResponseSyntax) ** If present, indicates that an error occurred during function execution\. Details about the error are included in the response payload\. - ** [LogResult](#API_Invoke_ResponseSyntax) ** + ** [ LogResult ](#API_Invoke_ResponseSyntax) ** The last 4 KB of the execution log, which is base64 encoded\. The response returns the following as the HTTP body\. - ** [Payload](#API_Invoke_ResponseSyntax) ** + ** [ Payload ](#API_Invoke_ResponseSyntax) ** The response from the function, or an error object\. ## Errors - **EC2AccessDeniedException** + ** EC2AccessDeniedException ** Need additional permissions to configure VPC settings\. HTTP Status Code: 502 - **EC2ThrottledException** + ** EC2ThrottledException ** AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function\. HTTP Status Code: 502 - **EC2UnexpectedException** + ** EC2UnexpectedException ** AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. HTTP Status Code: 502 - **EFSIOException** + ** EFSIOException ** An error occurred when reading from or writing to a connected file system\. HTTP Status Code: 410 - **EFSMountConnectivityException** + ** EFSMountConnectivityException ** The function couldn't make a network connection to the configured file system\. HTTP Status Code: 408 - **EFSMountFailureException** + ** EFSMountFailureException ** The function couldn't mount the configured file system due to a permission or configuration issue\. HTTP Status Code: 403 - **EFSMountTimeoutException** + ** EFSMountTimeoutException ** The function was able to make a network connection to the configured file system, but the mount operation timed out\. HTTP Status Code: 408 - **ENILimitReachedException** + ** ENILimitReachedException ** AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. HTTP Status Code: 502 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **InvalidRequestContentException** + ** InvalidRequestContentException ** The request body could not be parsed as JSON\. HTTP Status Code: 400 - **InvalidRuntimeException** + ** InvalidRuntimeException ** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 - **InvalidSecurityGroupIDException** + ** InvalidSecurityGroupIDException ** The Security Group ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 - **InvalidSubnetIDException** + ** InvalidSubnetIDException ** The Subnet ID provided in the Lambda function VPC configuration is invalid\. HTTP Status Code: 502 - **InvalidZipFileException** + ** InvalidZipFileException ** AWS Lambda could not unzip the deployment package\. HTTP Status Code: 502 - **KMSAccessDeniedException** + ** KMSAccessDeniedException ** Lambda was unable to decrypt the environment variables because KMS access was denied\. Check the Lambda function's KMS permissions\. HTTP Status Code: 502 - **KMSDisabledException** + ** KMSDisabledException ** Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Check the Lambda function's KMS key settings\. HTTP Status Code: 502 - **KMSInvalidStateException** + ** KMSInvalidStateException ** Lambda was unable to decrypt the environment variables because the KMS key used is in an invalid state for Decrypt\. Check the function's KMS key settings\. HTTP Status Code: 502 - **KMSNotFoundException** + ** KMSNotFoundException ** Lambda was unable to decrypt the environment variables because the KMS key was not found\. Check the function's KMS key settings\. HTTP Status Code: 502 - **RequestTooLargeException** + ** RequestTooLargeException ** The request payload exceeded the `Invoke` request body JSON input limit\. For more information, see [Limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)\. HTTP Status Code: 413 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ResourceNotReadyException** + ** ResourceNotReadyException ** The function is inactive and its VPC connection is no longer available\. Wait for the VPC connection to reestablish and try again\. HTTP Status Code: 502 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **SubnetIPAddressLimitReachedException** + ** SubnetIPAddressLimitReachedException ** AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses\. HTTP Status Code: 502 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 - **UnsupportedMediaTypeException** + ** UnsupportedMediaTypeException ** The content type of the `Invoke` request body is not JSON\. HTTP Status Code: 415 @@ -220,4 +220,4 @@ For more information about using this API in one of the language\-specific AWS S + [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) + [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) + [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) ++ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md index f47bf60e..0ed67594 100644 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -3,7 +3,7 @@ *This action has been deprecated\.* **Important** -For asynchronous function invocation, use [Invoke](API_Invoke.md)\. +For asynchronous function invocation, use [ Invoke ](API_Invoke.md)\. Invokes a function asynchronously\. @@ -19,7 +19,7 @@ InvokeArgs The request uses the following URI parameters\. - ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** + ** [ FunctionName ](#API_InvokeAsync_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -35,7 +35,7 @@ Required: Yes The request accepts the following binary data\. - ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** + ** [ InvokeArgs ](#API_InvokeAsync_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. Required: Yes @@ -49,28 +49,28 @@ HTTP/1.1 Status If the action is successful, the service sends back the following HTTP response\. - ** [Status](#API_InvokeAsync_ResponseSyntax) ** + ** [ Status ](#API_InvokeAsync_ResponseSyntax) ** The status code\. ## Errors - **InvalidRequestContentException** + ** InvalidRequestContentException ** The request body could not be parsed as JSON\. HTTP Status Code: 400 - **InvalidRuntimeException** + ** InvalidRuntimeException ** The runtime or runtime version specified is not supported\. HTTP Status Code: 502 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md index ee4be690..8c2f129a 100644 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -4,25 +4,25 @@ An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuratio ## Contents - **Arn** + ** Arn ** The Amazon Resource Name \(ARN\) of the function layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - **CodeSize** + ** CodeSize ** The size of the layer archive in bytes\. Type: Long Required: No - **SigningJobArn** + ** SigningJobArn ** The Amazon Resource Name \(ARN\) of a signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The Amazon Resource Name \(ARN\) for a signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md index b85670b3..461e603b 100644 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -4,26 +4,26 @@ A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs. ## Contents - **S3Bucket** + ** S3Bucket ** The Amazon S3 bucket of the layer archive\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? + ** S3Key ** The Amazon S3 key of the layer archive\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **S3ObjectVersion** + ** S3ObjectVersion ** For versioned objects, the version of the layer archive object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - **ZipFile** + ** ZipFile ** The base64\-encoded contents of the layer archive\. AWS SDK and AWS CLI clients handle the encoding for you\. Type: Base64\-encoded binary data object Required: No diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md index 8cb77ffd..a56a36b3 100644 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -4,27 +4,27 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents - **CodeSha256** + ** CodeSha256 ** The SHA\-256 hash of the layer archive\. Type: String Required: No - **CodeSize** + ** CodeSize ** The size of the layer archive in bytes\. Type: Long Required: No - **Location** + ** Location ** A link to the layer archive in Amazon S3 that is valid for 10 minutes\. Type: String Required: No - **SigningJobArn** + ** SigningJobArn ** The Amazon Resource Name \(ARN\) of a signing job\. Type: String Required: No - **SigningProfileVersionArn** + ** SigningProfileVersionArn ** The Amazon Resource Name \(ARN\) for a signing profile version\. Type: String Required: No diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 729496ba..38f30a79 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -4,38 +4,38 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents - **CompatibleRuntimes** + ** CompatibleRuntimes ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - **CreatedDate** + ** CreatedDate ** The date that the version was created, in ISO 8601 format\. For example, `2018-11-27T15:10:45.123+0000`\. Type: String Required: No - **Description** + ** Description ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - **LayerVersionArn** + ** LayerVersionArn ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - **LicenseInfo** + ** LicenseInfo ** The layer's open\-source license\. Type: String Length Constraints: Maximum length of 512\. Required: No - **Version** + ** Version ** The version number\. Type: Long Required: No diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md index a6e1947c..4064a303 100644 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -4,19 +4,19 @@ Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/d ## Contents - **LatestMatchingVersion** + ** LatestMatchingVersion ** The newest version of the layer\. -Type: [LayerVersionsListItem](API_LayerVersionsListItem.md) object +Type: [ LayerVersionsListItem ](API_LayerVersionsListItem.md) object Required: No - **LayerArn** + ** LayerArn ** The Amazon Resource Name \(ARN\) of the function layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` Required: No - **LayerName** + ** LayerName ** The name of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md index 1e286834..96a8f132 100644 --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&M The request uses the following URI parameters\. - ** [FunctionName](#API_ListAliases_RequestSyntax) ** + ** [ FunctionName ](#API_ListAliases_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,15 +24,15 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** + ** [ FunctionVersion ](#API_ListAliases_RequestSyntax) ** Specify a function version to only list aliases that invoke that version\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Marker](#API_ListAliases_RequestSyntax) ** + ** [ Marker ](#API_ListAliases_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListAliases_RequestSyntax) ** + ** [ MaxItems ](#API_ListAliases_RequestSyntax) ** Limit the number of aliases returned\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -71,29 +71,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Aliases](#API_ListAliases_ResponseSyntax) ** + ** [ Aliases ](#API_ListAliases_ResponseSyntax) ** A list of aliases\. -Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects +Type: Array of [ AliasConfiguration ](API_AliasConfiguration.md) objects - ** [NextMarker](#API_ListAliases_ResponseSyntax) ** + ** [ NextMarker ](#API_ListAliases_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md index 9dc64827..e5fcdff9 100644 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -12,10 +12,10 @@ GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 The request uses the following URI parameters\. - ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListCodeSigningConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListCodeSigningConfigs_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -54,21 +54,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [ CodeSigningConfigs ](#API_ListCodeSigningConfigs_ResponseSyntax) ** The code signing configurations -Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects +Type: Array of [ CodeSigningConfig ](API_CodeSigningConfig.md) objects - ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListCodeSigningConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index d48d8aed..05fffac7 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionNam The request uses the following URI parameters\. - ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ EventSourceArn ](#API_ListEventSourceMappings_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -20,7 +20,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ FunctionName ](#API_ListEventSourceMappings_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -32,10 +32,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Marker](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ Marker ](#API_ListEventSourceMappings_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** + ** [ MaxItems ](#API_ListEventSourceMappings_RequestSyntax) ** The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -102,29 +102,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [ EventSourceMappings ](#API_ListEventSourceMappings_ResponseSyntax) ** A list of event source mappings\. -Type: Array of [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) objects +Type: Array of [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) objects - ** [NextMarker](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [ NextMarker ](#API_ListEventSourceMappings_ResponseSyntax) ** A pagination token that's returned when the response doesn't contain all event source mappings\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md index 60f2ced3..86f29bc5 100644 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -2,7 +2,7 @@ Retrieves a list of configurations for asynchronous invocation for a function\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&Ma The request uses the following URI parameters\. - ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ FunctionName ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -26,10 +26,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The maximum number of configurations to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -70,29 +70,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [FunctionEventInvokeConfigs](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [ FunctionEventInvokeConfigs ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** A list of configurations\. -Type: Array of [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) objects +Type: Array of [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) objects - ** [NextMarker](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index 252c72fb..ebce0f00 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -5,7 +5,7 @@ Returns a list of Lambda functions, with the version\-specific configuration of Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. **Note** -The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. +The `ListFunctions` action returns a subset of the [ FunctionConfiguration ](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -17,18 +17,18 @@ GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterR The request uses the following URI parameters\. - ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** + ** [ FunctionVersion ](#API_ListFunctions_RequestSyntax) ** Set to `ALL` to include entries for all published versions of each function\. Valid Values:` ALL` - ** [Marker](#API_ListFunctions_RequestSyntax) ** + ** [ Marker ](#API_ListFunctions_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MasterRegion](#API_ListFunctions_RequestSyntax) ** + ** [ MasterRegion ](#API_ListFunctions_RequestSyntax) ** For Lambda@Edge functions, the AWS Region of the master function\. For example, `us-east-1` filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East \(N\. Virginia\)\. If specified, you must set `FunctionVersion` to `ALL`\. Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` - ** [MaxItems](#API_ListFunctions_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctions_RequestSyntax) ** The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -126,25 +126,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Functions](#API_ListFunctions_ResponseSyntax) ** + ** [ Functions ](#API_ListFunctions_ResponseSyntax) ** A list of Lambda functions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects +Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects - ** [NextMarker](#API_ListFunctions_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctions_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md index 0440a9ac..04be90ec 100644 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -12,16 +12,16 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marke The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ Marker ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [ MaxItems ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -47,26 +47,26 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionArns ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The function ARNs\. Type: Array of strings Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [ NextMarker ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index b003b710..29e89342 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -12,20 +12,20 @@ GET /2018-10-31/layers/LayerName/versions?CompatibleRuntime=CompatibleRuntime&Ma The request uses the following URI parameters\. - ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** + ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** + ** [ LayerName ](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [Marker](#API_ListLayerVersions_RequestSyntax) ** + ** [ Marker ](#API_ListLayerVersions_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListLayerVersions_RequestSyntax) ** + ** [ MaxItems ](#API_ListLayerVersions_RequestSyntax) ** The maximum number of versions to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -60,29 +60,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [LayerVersions](#API_ListLayerVersions_ResponseSyntax) ** + ** [ LayerVersions ](#API_ListLayerVersions_ResponseSyntax) ** A list of versions\. -Type: Array of [LayerVersionsListItem](API_LayerVersionsListItem.md) objects +Type: Array of [ LayerVersionsListItem ](API_LayerVersionsListItem.md) objects - ** [NextMarker](#API_ListLayerVersions_ResponseSyntax) ** + ** [ NextMarker ](#API_ListLayerVersions_ResponseSyntax) ** A pagination token returned when the response doesn't contain all versions\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 64d1eb41..6aa4022b 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -12,14 +12,14 @@ GET /2018-10-31/layers?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItem The request uses the following URI parameters\. - ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** + ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Marker](#API_ListLayers_RequestSyntax) ** + ** [ Marker ](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. - ** [MaxItems](#API_ListLayers_RequestSyntax) ** + ** [ MaxItems ](#API_ListLayers_RequestSyntax) ** The maximum number of layers to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -58,25 +58,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Layers](#API_ListLayers_ResponseSyntax) ** + ** [ Layers ](#API_ListLayers_ResponseSyntax) ** A list of function layers\. -Type: Array of [LayersListItem](API_LayersListItem.md) objects +Type: Array of [ LayersListItem ](API_LayersListItem.md) objects - ** [NextMarker](#API_ListLayers_ResponseSyntax) ** + ** [ NextMarker ](#API_ListLayers_ResponseSyntax) ** A pagination token returned when the response doesn't contain all layers\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md index 93df5308..bd1e9916 100644 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=M The request uses the following URI parameters\. - ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ FunctionName ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ Marker ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [ MaxItems ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify a number to limit the number of configurations returned\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,29 +63,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [NextMarker](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ NextMarker ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ProvisionedConcurrencyConfigs](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ ProvisionedConcurrencyConfigs ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** A list of provisioned concurrency configurations\. -Type: Array of [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) objects +Type: Array of [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) objects ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md index 39ccd31a..394361bc 100644 --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -1,6 +1,6 @@ # ListTags -Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [GetFunction](API_GetFunction.md)\. +Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [ GetFunction ](API_GetFunction.md)\. ## Request Syntax @@ -12,8 +12,8 @@ GET /2017-03-31/tags/ARN HTTP/1.1 The request uses the following URI parameters\. - ** [ARN](#API_ListTags_RequestSyntax) ** -The function's Amazon Resource Name \(ARN\)\. + ** [ ARN ](#API_ListTags_RequestSyntax) ** +The function's Amazon Resource Name \(ARN\)\. Note: Lambda does not support adding tags to aliases or versions\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes @@ -40,25 +40,25 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [Tags](#API_ListTags_ResponseSyntax) ** + ** [ Tags ](#API_ListTags_ResponseSyntax) ** The function's tags\. Type: String to string map ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index aff8498d..a82e1aed 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems The request uses the following URI parameters\. - ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ FunctionName ](#API_ListVersionsByFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ Marker ](#API_ListVersionsByFunction_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** + ** [ MaxItems ](#API_ListVersionsByFunction_RequestSyntax) ** The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -125,29 +125,29 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [NextMarker](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [ NextMarker ](#API_ListVersionsByFunction_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [Versions](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [ Versions ](#API_ListVersionsByFunction_ResponseSyntax) ** A list of Lambda function versions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects +Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md index 7c74fab6..e85b7838 100644 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -4,7 +4,7 @@ A destination for events that failed processing\. ## Contents - **Destination** + ** Destination ** The Amazon Resource Name \(ARN\) of the destination resource\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 350\. diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md index f2b35f42..5447b3fa 100644 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -4,7 +4,7 @@ A destination for events that were processed successfully\. ## Contents - **Destination** + ** Destination ** The Amazon Resource Name \(ARN\) of the destination resource\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 350\. diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md index 70a90b0c..8c67257d 100644 --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -1,61 +1,61 @@ # Actions The following actions are supported: -+ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) -+ [AddPermission](API_AddPermission.md) -+ [CreateAlias](API_CreateAlias.md) -+ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [CreateFunction](API_CreateFunction.md) -+ [DeleteAlias](API_DeleteAlias.md) -+ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -+ [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) -+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) -+ [DeleteLayerVersion](API_DeleteLayerVersion.md) -+ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) -+ [GetAccountSettings](API_GetAccountSettings.md) -+ [GetAlias](API_GetAlias.md) -+ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [GetFunction](API_GetFunction.md) -+ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) -+ [GetFunctionConcurrency](API_GetFunctionConcurrency.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) -+ [GetLayerVersion](API_GetLayerVersion.md) -+ [GetLayerVersionByArn](API_GetLayerVersionByArn.md) -+ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) -+ [GetPolicy](API_GetPolicy.md) -+ [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) -+ [Invoke](API_Invoke.md) -+ [InvokeAsync](API_InvokeAsync.md) -+ [ListAliases](API_ListAliases.md) -+ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) -+ [ListFunctions](API_ListFunctions.md) -+ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) -+ [ListLayers](API_ListLayers.md) -+ [ListLayerVersions](API_ListLayerVersions.md) -+ [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) -+ [ListTags](API_ListTags.md) -+ [ListVersionsByFunction](API_ListVersionsByFunction.md) -+ [PublishLayerVersion](API_PublishLayerVersion.md) -+ [PublishVersion](API_PublishVersion.md) -+ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) -+ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) -+ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) -+ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) -+ [RemovePermission](API_RemovePermission.md) -+ [TagResource](API_TagResource.md) -+ [UntagResource](API_UntagResource.md) -+ [UpdateAlias](API_UpdateAlias.md) -+ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file ++ [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md) ++ [ AddPermission ](API_AddPermission.md) ++ [ CreateAlias ](API_CreateAlias.md) ++ [ CreateCodeSigningConfig ](API_CreateCodeSigningConfig.md) ++ [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md) ++ [ CreateFunction ](API_CreateFunction.md) ++ [ DeleteAlias ](API_DeleteAlias.md) ++ [ DeleteCodeSigningConfig ](API_DeleteCodeSigningConfig.md) ++ [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md) ++ [ DeleteFunction ](API_DeleteFunction.md) ++ [ DeleteFunctionCodeSigningConfig ](API_DeleteFunctionCodeSigningConfig.md) ++ [ DeleteFunctionConcurrency ](API_DeleteFunctionConcurrency.md) ++ [ DeleteFunctionEventInvokeConfig ](API_DeleteFunctionEventInvokeConfig.md) ++ [ DeleteLayerVersion ](API_DeleteLayerVersion.md) ++ [ DeleteProvisionedConcurrencyConfig ](API_DeleteProvisionedConcurrencyConfig.md) ++ [ GetAccountSettings ](API_GetAccountSettings.md) ++ [ GetAlias ](API_GetAlias.md) ++ [ GetCodeSigningConfig ](API_GetCodeSigningConfig.md) ++ [ GetEventSourceMapping ](API_GetEventSourceMapping.md) ++ [ GetFunction ](API_GetFunction.md) ++ [ GetFunctionCodeSigningConfig ](API_GetFunctionCodeSigningConfig.md) ++ [ GetFunctionConcurrency ](API_GetFunctionConcurrency.md) ++ [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) ++ [ GetFunctionEventInvokeConfig ](API_GetFunctionEventInvokeConfig.md) ++ [ GetLayerVersion ](API_GetLayerVersion.md) ++ [ GetLayerVersionByArn ](API_GetLayerVersionByArn.md) ++ [ GetLayerVersionPolicy ](API_GetLayerVersionPolicy.md) ++ [ GetPolicy ](API_GetPolicy.md) ++ [ GetProvisionedConcurrencyConfig ](API_GetProvisionedConcurrencyConfig.md) ++ [ Invoke ](API_Invoke.md) ++ [ InvokeAsync ](API_InvokeAsync.md) ++ [ ListAliases ](API_ListAliases.md) ++ [ ListCodeSigningConfigs ](API_ListCodeSigningConfigs.md) ++ [ ListEventSourceMappings ](API_ListEventSourceMappings.md) ++ [ ListFunctionEventInvokeConfigs ](API_ListFunctionEventInvokeConfigs.md) ++ [ ListFunctions ](API_ListFunctions.md) ++ [ ListFunctionsByCodeSigningConfig ](API_ListFunctionsByCodeSigningConfig.md) ++ [ ListLayers ](API_ListLayers.md) ++ [ ListLayerVersions ](API_ListLayerVersions.md) ++ [ ListProvisionedConcurrencyConfigs ](API_ListProvisionedConcurrencyConfigs.md) ++ [ ListTags ](API_ListTags.md) ++ [ ListVersionsByFunction ](API_ListVersionsByFunction.md) ++ [ PublishLayerVersion ](API_PublishLayerVersion.md) ++ [ PublishVersion ](API_PublishVersion.md) ++ [ PutFunctionCodeSigningConfig ](API_PutFunctionCodeSigningConfig.md) ++ [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md) ++ [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md) ++ [ PutProvisionedConcurrencyConfig ](API_PutProvisionedConcurrencyConfig.md) ++ [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) ++ [ RemovePermission ](API_RemovePermission.md) ++ [ TagResource ](API_TagResource.md) ++ [ UntagResource ](API_UntagResource.md) ++ [ UpdateAlias ](API_UpdateAlias.md) ++ [ UpdateCodeSigningConfig ](API_UpdateCodeSigningConfig.md) ++ [ UpdateEventSourceMapping ](API_UpdateEventSourceMapping.md) ++ [ UpdateFunctionCode ](API_UpdateFunctionCode.md) ++ [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) ++ [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 4c1a03bb..4f1830eb 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -4,42 +4,42 @@ Details about the provisioned concurrency configuration for a function alias or ## Contents - **AllocatedProvisionedConcurrentExecutions** + ** AllocatedProvisionedConcurrentExecutions ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. Required: No - **AvailableProvisionedConcurrentExecutions** + ** AvailableProvisionedConcurrentExecutions ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. Required: No - **FunctionArn** + ** FunctionArn ** The Amazon Resource Name \(ARN\) of the alias or version\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - **LastModified** + ** LastModified ** The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String Required: No - **RequestedProvisionedConcurrentExecutions** + ** RequestedProvisionedConcurrentExecutions ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. Required: No - **Status** + ** Status ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` Required: No - **StatusReason** + ** StatusReason ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String Required: No diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index 162ffdf6..cbbeb2c9 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -2,7 +2,7 @@ Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. -Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +Add layers to your function with [ CreateFunction ](API_CreateFunction.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. ## Request Syntax @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** + ** [ LayerName ](#API_PublishLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` @@ -37,25 +37,25 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Content](#API_PublishLayerVersion_RequestSyntax) ** + ** [ Content ](#API_PublishLayerVersion_RequestSyntax) ** The function layer archive\. -Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object +Type: [ LayerVersionContentInput ](API_LayerVersionContentInput.md) object Required: Yes - ** [Description](#API_PublishLayerVersion_RequestSyntax) ** + ** [ Description ](#API_PublishLayerVersion_RequestSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** + ** [ LicenseInfo ](#API_PublishLayerVersion_RequestSyntax) ** The layer's software license\. It can be any of the following: + An [SPDX license identifier](https://spdx.org/licenses/)\. For example, `MIT`\. + The URL of a license hosted on the internet\. For example, `https://opensource.org/licenses/MIT`\. @@ -94,65 +94,65 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Content ](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object +Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object - ** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ CreatedDate ](#API_PublishLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [Description](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Description ](#API_PublishLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LayerArn ](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [LayerVersionArn](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LayerVersionArn ](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [LicenseInfo](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ LicenseInfo ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [Version](#API_PublishLayerVersion_ResponseSyntax) ** + ** [ Version ](#API_PublishLayerVersion_ResponseSyntax) ** The version number\. Type: Long ## Errors - **CodeStorageExceededException** + ** CodeStorageExceededException ** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 40de9968..dc6a4d58 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,9 +2,9 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. - AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [ UpdateFunctionCode ](API_UpdateFunctionCode.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. -Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. +Clients can invoke versions directly or with an alias\. To create an alias, use [ CreateAlias ](API_CreateAlias.md)\. ## Request Syntax @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PublishVersion_RequestSyntax) ** + ** [ FunctionName ](#API_PublishVersion_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -39,18 +39,18 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CodeSha256](#API_PublishVersion_RequestSyntax) ** -Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [UpdateFunctionCode](API_UpdateFunctionCode.md)\. + ** [ CodeSha256 ](#API_PublishVersion_RequestSyntax) ** +Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [ UpdateFunctionCode ](API_UpdateFunctionCode.md)\. Type: String Required: No - ** [Description](#API_PublishVersion_RequestSyntax) ** + ** [ Description ](#API_PublishVersion_RequestSyntax) ** A description for the version to override the description in the function configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [RevisionId](#API_PublishVersion_RequestSyntax) ** + ** [ RevisionId ](#API_PublishVersion_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid publishing a version if the function configuration has changed since you last updated it\. Type: String Required: No @@ -140,179 +140,179 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_PublishVersion_ResponseSyntax) ** + ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_PublishVersion_ResponseSyntax) ** + ** [ CodeSize ](#API_PublishVersion_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_PublishVersion_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_PublishVersion_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_PublishVersion_ResponseSyntax) ** + ** [ Description ](#API_PublishVersion_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_PublishVersion_ResponseSyntax) ** + ** [ Environment ](#API_PublishVersion_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_PublishVersion_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** + ** [ FunctionArn ](#API_PublishVersion_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionName](#API_PublishVersion_ResponseSyntax) ** + ** [ FunctionName ](#API_PublishVersion_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Handler](#API_PublishVersion_ResponseSyntax) ** + ** [ Handler ](#API_PublishVersion_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_PublishVersion_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [LastModified](#API_PublishVersion_ResponseSyntax) ** + ** [ LastModified ](#API_PublishVersion_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [LastUpdateStatus](#API_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_PublishVersion_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [LastUpdateStatusReason](#API_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_PublishVersion_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_PublishVersion_ResponseSyntax) ** + ** [ Layers ](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_PublishVersion_ResponseSyntax) ** + ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** + ** [ MemorySize ](#API_PublishVersion_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_PublishVersion_ResponseSyntax) ** + ** [ PackageType ](#API_PublishVersion_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** + ** [ RevisionId ](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_PublishVersion_ResponseSyntax) ** + ** [ Role ](#API_PublishVersion_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_PublishVersion_ResponseSyntax) ** + ** [ Runtime ](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** + ** [ SigningJobArn ](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_PublishVersion_ResponseSyntax) ** + ** [ State ](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [StateReason](#API_PublishVersion_ResponseSyntax) ** + ** [ StateReason ](#API_PublishVersion_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** + ** [ StateReasonCode ](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_PublishVersion_ResponseSyntax) ** + ** [ Timeout ](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [TracingConfig](#API_PublishVersion_ResponseSyntax) ** + ** [ TracingConfig ](#API_PublishVersion_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_PublishVersion_ResponseSyntax) ** + ** [ Version ](#API_PublishVersion_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_PublishVersion_ResponseSyntax) ** + ** [ VpcConfig ](#API_PublishVersion_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeStorageExceededException** + ** CodeStorageExceededException ** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md index e6364276..f8d5b31e 100644 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -33,7 +33,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. @@ -58,13 +58,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -78,27 +78,27 @@ Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12} ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md index f1448835..20dac787 100644 --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -2,9 +2,9 @@ Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level\. -Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [GetFunction](API_GetFunction.md) to see the current setting for a function\. +Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [ GetFunction ](API_GetFunction.md) to see the current setting for a function\. -Use [GetAccountSettings](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. +Use [ GetAccountSettings ](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. ## Request Syntax @@ -21,7 +21,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -37,7 +37,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_RequestSyntax) ** The number of simultaneous executions to reserve for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -60,30 +60,30 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_ResponseSyntax) ** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. + ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_ResponseSyntax) ** +The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md index 774ee816..306e9aaf 100644 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -1,8 +1,8 @@ # PutFunctionEventInvokeConfig -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. +Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md)\. -By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. +By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. To send an invocation record to a queue, topic, function, or event bus, specify a [destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)\. You can configure separate destinations for successful invocations \(on\-success\) and events that fail all processing attempts \(on\-failure\)\. You can configure destinations in addition to or instead of a dead\-letter queue\. @@ -30,7 +30,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -42,7 +42,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,7 +51,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -59,16 +59,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -102,7 +102,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -110,46 +110,46 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [LastModified](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index cb76f8d3..7dca3a23 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ FunctionName ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -29,7 +29,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ Qualifier ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -39,7 +39,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ ProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The amount of provisioned concurrency to allocate for the version or alias\. Type: Integer Valid Range: Minimum value of 1\. @@ -67,53 +67,53 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AllocatedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [AvailableProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ AvailableProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [LastModified](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ LastModified ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String - ** [RequestedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ RequestedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [Status](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ Status ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [StatusReason](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [ StatusReason ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md index d0cb44c6..c9d5478d 100644 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,22 +12,22 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?Re The request uses the following URI parameters\. - ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ LayerName ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ RevisionId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ StatementId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The identifier that was specified when the statement was added\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_]+)` Required: Yes - ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [ VersionNumber ](#API_RemoveLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -47,23 +47,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md index c85f9254..bc601ef3 100644 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -1,6 +1,6 @@ # RemovePermission -Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [GetPolicy](API_GetPolicy.md)\. +Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [ GetPolicy ](API_GetPolicy.md)\. ## Request Syntax @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier The request uses the following URI parameters\. - ** [FunctionName](#API_RemovePermission_RequestSyntax) ** + ** [ FunctionName ](#API_RemovePermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,15 +24,15 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_RemovePermission_RequestSyntax) ** + ** [ Qualifier ](#API_RemovePermission_RequestSyntax) ** Specify a version or alias to remove permissions from a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` - ** [RevisionId](#API_RemovePermission_RequestSyntax) ** + ** [ RevisionId ](#API_RemovePermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [StatementId](#API_RemovePermission_RequestSyntax) ** + ** [ StatementId ](#API_RemovePermission_RequestSyntax) ** Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_.]+)` @@ -54,23 +54,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md index 27ce6673..26ec3da5 100644 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -4,7 +4,7 @@ The self\-managed Apache Kafka cluster for your event source\. ## Contents - **Endpoints** + ** Endpoints ** The list of bootstrap servers for your Kafka brokers in the following format: `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`\. Type: String to array of strings map Map Entries: Maximum number of 2 items\. diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 996c0e54..5b108d1c 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -4,7 +4,7 @@ To secure and define access to your event source, you can specify the authentica ## Contents - **Type** + ** Type ** The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. + `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. + `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. @@ -17,7 +17,7 @@ Type: String Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No - **URI** + ** URI ** The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 200\. diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md index 82a06bef..45444747 100644 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -19,7 +19,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ARN](#API_TagResource_RequestSyntax) ** + ** [ ARN ](#API_TagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes @@ -28,7 +28,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Tags](#API_TagResource_RequestSyntax) ** + ** [ Tags ](#API_TagResource_RequestSyntax) ** A list of tags to apply to the function\. Type: String to string map Required: Yes @@ -45,23 +45,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md index 4ff92965..a4348db1 100644 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -4,7 +4,7 @@ The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/servi ## Contents - **Mode** + ** Mode ** The tracing mode\. Type: String Valid Values:` Active | PassThrough` diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md index cb3c0e8c..9d666f16 100644 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -4,7 +4,7 @@ The function's AWS X\-Ray tracing configuration\. ## Contents - **Mode** + ** Mode ** The tracing mode\. Type: String Valid Values:` Active | PassThrough` diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index aaa9f473..f6188166 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -1,39 +1,39 @@ # Data Types The following data types are supported: -+ [AccountLimit](API_AccountLimit.md) -+ [AccountUsage](API_AccountUsage.md) -+ [AliasConfiguration](API_AliasConfiguration.md) -+ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) -+ [AllowedPublishers](API_AllowedPublishers.md) -+ [CodeSigningConfig](API_CodeSigningConfig.md) -+ [CodeSigningPolicies](API_CodeSigningPolicies.md) -+ [Concurrency](API_Concurrency.md) -+ [DeadLetterConfig](API_DeadLetterConfig.md) -+ [DestinationConfig](API_DestinationConfig.md) -+ [Environment](API_Environment.md) -+ [EnvironmentError](API_EnvironmentError.md) -+ [EnvironmentResponse](API_EnvironmentResponse.md) -+ [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) -+ [FileSystemConfig](API_FileSystemConfig.md) -+ [FunctionCode](API_FunctionCode.md) -+ [FunctionCodeLocation](API_FunctionCodeLocation.md) -+ [FunctionConfiguration](API_FunctionConfiguration.md) -+ [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) -+ [ImageConfig](API_ImageConfig.md) -+ [ImageConfigError](API_ImageConfigError.md) -+ [ImageConfigResponse](API_ImageConfigResponse.md) -+ [Layer](API_Layer.md) -+ [LayersListItem](API_LayersListItem.md) -+ [LayerVersionContentInput](API_LayerVersionContentInput.md) -+ [LayerVersionContentOutput](API_LayerVersionContentOutput.md) -+ [LayerVersionsListItem](API_LayerVersionsListItem.md) -+ [OnFailure](API_OnFailure.md) -+ [OnSuccess](API_OnSuccess.md) -+ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) -+ [SelfManagedEventSource](API_SelfManagedEventSource.md) -+ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) -+ [TracingConfig](API_TracingConfig.md) -+ [TracingConfigResponse](API_TracingConfigResponse.md) -+ [VpcConfig](API_VpcConfig.md) -+ [VpcConfigResponse](API_VpcConfigResponse.md) \ No newline at end of file ++ [ AccountLimit ](API_AccountLimit.md) ++ [ AccountUsage ](API_AccountUsage.md) ++ [ AliasConfiguration ](API_AliasConfiguration.md) ++ [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) ++ [ AllowedPublishers ](API_AllowedPublishers.md) ++ [ CodeSigningConfig ](API_CodeSigningConfig.md) ++ [ CodeSigningPolicies ](API_CodeSigningPolicies.md) ++ [ Concurrency ](API_Concurrency.md) ++ [ DeadLetterConfig ](API_DeadLetterConfig.md) ++ [ DestinationConfig ](API_DestinationConfig.md) ++ [ Environment ](API_Environment.md) ++ [ EnvironmentError ](API_EnvironmentError.md) ++ [ EnvironmentResponse ](API_EnvironmentResponse.md) ++ [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) ++ [ FileSystemConfig ](API_FileSystemConfig.md) ++ [ FunctionCode ](API_FunctionCode.md) ++ [ FunctionCodeLocation ](API_FunctionCodeLocation.md) ++ [ FunctionConfiguration ](API_FunctionConfiguration.md) ++ [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) ++ [ ImageConfig ](API_ImageConfig.md) ++ [ ImageConfigError ](API_ImageConfigError.md) ++ [ ImageConfigResponse ](API_ImageConfigResponse.md) ++ [ Layer ](API_Layer.md) ++ [ LayersListItem ](API_LayersListItem.md) ++ [ LayerVersionContentInput ](API_LayerVersionContentInput.md) ++ [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) ++ [ LayerVersionsListItem ](API_LayerVersionsListItem.md) ++ [ OnFailure ](API_OnFailure.md) ++ [ OnSuccess ](API_OnSuccess.md) ++ [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) ++ [ SelfManagedEventSource ](API_SelfManagedEventSource.md) ++ [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) ++ [ TracingConfig ](API_TracingConfig.md) ++ [ TracingConfigResponse ](API_TracingConfigResponse.md) ++ [ VpcConfig ](API_VpcConfig.md) ++ [ VpcConfigResponse ](API_VpcConfigResponse.md) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md index e2d5bacb..88cfb1be 100644 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -12,12 +12,12 @@ DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 The request uses the following URI parameters\. - ** [ARN](#API_UntagResource_RequestSyntax) ** + ** [ ARN ](#API_UntagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [TagKeys](#API_UntagResource_RequestSyntax) ** + ** [ TagKeys ](#API_UntagResource_RequestSyntax) ** A list of tag keys to remove from the function\. Required: Yes @@ -37,23 +37,23 @@ If the action is successful, the service sends back an HTTP 204 response with an ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md index 0a163ec3..98f85781 100644 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -24,7 +24,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -36,7 +36,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Name](#API_UpdateAlias_RequestSyntax) ** + ** [ Name ](#API_UpdateAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,27 +46,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [Description](#API_UpdateAlias_RequestSyntax) ** + ** [ Description ](#API_UpdateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [FunctionVersion](#API_UpdateAlias_RequestSyntax) ** + ** [ FunctionVersion ](#API_UpdateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - ** [RevisionId](#API_UpdateAlias_RequestSyntax) ** + ** [ RevisionId ](#API_UpdateAlias_RequestSyntax) ** Only update the alias if the revision ID matches the ID that's specified\. Use this option to avoid modifying an alias that has changed since you last read it\. Type: String Required: No - ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** + ** [ RoutingConfig ](#API_UpdateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -95,59 +95,59 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [AliasArn](#API_UpdateAlias_ResponseSyntax) ** + ** [ AliasArn ](#API_UpdateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Description](#API_UpdateAlias_ResponseSyntax) ** + ** [ Description ](#API_UpdateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [FunctionVersion](#API_UpdateAlias_ResponseSyntax) ** + ** [ FunctionVersion ](#API_UpdateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [Name](#API_UpdateAlias_ResponseSyntax) ** + ** [ Name ](#API_UpdateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [RevisionId](#API_UpdateAlias_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [RoutingConfig](#API_UpdateAlias_ResponseSyntax) ** + ** [ RoutingConfig ](#API_UpdateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object +Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md index f6e7e8b9..181a153a 100644 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningConfigArn ](#API_UpdateCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -33,17 +33,17 @@ Required: Yes The request accepts the following data in JSON format\. - ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ AllowedPublishers ](#API_UpdateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object +Type: [ AllowedPublishers ](API_AllowedPublishers.md) object Required: No - ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ CodeSigningPolicies ](#API_UpdateCodeSigningConfig_RequestSyntax) ** The code signing policy\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object +Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object Required: No - ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [ Description ](#API_UpdateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -77,21 +77,21 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** + ** [ CodeSigningConfig ](#API_UpdateCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object +Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 8e9025f0..8d4f4782 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -47,7 +47,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ UUID ](#API_UpdateEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -55,8 +55,8 @@ Required: Yes The request accepts the following data in JSON format\. - ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_UpdateEventSourceMapping_RequestSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. @@ -66,22 +66,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ DestinationConfig ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** -If true, the event source mapping is active\. Set to false to pause polling and invocation\. + ** [ Enabled ](#API_UpdateEventSourceMapping_RequestSyntax) ** +When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. +Default: True Type: Boolean Required: No - ** [FunctionName](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -95,44 +96,46 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. + ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -192,135 +195,139 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The maximum number of items to retrieve in a single batch\. + ** [ BatchSize ](#API_UpdateEventSourceMapping_ResponseSyntax) ** +The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. +Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ DestinationConfig ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ EventSourceArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ LastProcessingResult ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time to gather records before invoking the function, in seconds\. The default value is zero\. + ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. +Default: 0 +Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ Queues ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ SelfManagedEventSource ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects +Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPosition ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StartingPositionTimestamp ](#API_UpdateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ State ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ StateTransitionReason ](#API_UpdateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ Topics ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ UUID ](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceInUseException** + ** ResourceInUseException ** The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. HTTP Status Code: 400 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index c6e04232..dd684e92 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -29,7 +29,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionCode_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,46 +45,46 @@ Required: Yes The request accepts the following data in JSON format\. - ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean Required: No - ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ ImageUri ](#API_UpdateFunctionCode_RequestSyntax) ** URI of a container image in the Amazon ECR registry\. Type: String Required: No - ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** -Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [PublishVersion](API_PublishVersion.md) separately\. + ** [ Publish ](#API_UpdateFunctionCode_RequestSyntax) ** +Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [ PublishVersion ](API_PublishVersion.md) separately\. Type: Boolean Required: No - ** [RevisionId](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionCode_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No - ** [S3Bucket](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ S3Bucket ](#API_UpdateFunctionCode_RequestSyntax) ** An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? + ** [ S3Key ](#API_UpdateFunctionCode_RequestSyntax) ** The Amazon S3 key of the deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - ** [S3ObjectVersion](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ S3ObjectVersion ](#API_UpdateFunctionCode_RequestSyntax) ** For versioned objects, the version of the deployment package object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - ** [ZipFile](#API_UpdateFunctionCode_RequestSyntax) ** + ** [ ZipFile ](#API_UpdateFunctionCode_RequestSyntax) ** The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Type: Base64\-encoded binary data object Required: No @@ -174,191 +174,191 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ CodeSize ](#API_UpdateFunctionCode_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Description ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Environment ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionCode_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionName](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionCode_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Handler](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Handler ](#API_UpdateFunctionCode_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [LastModified](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateFunctionCode_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [LastUpdateStatus](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_UpdateFunctionCode_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [LastUpdateStatusReason](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Layers ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ MemorySize ](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ PackageType ](#API_UpdateFunctionCode_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Role ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Runtime ](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ SigningJobArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ State ](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [StateReason](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ StateReason ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ StateReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Timeout ](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [TracingConfig](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ TracingConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ Version ](#API_UpdateFunctionCode_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ VpcConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeStorageExceededException** + ** CodeStorageExceededException ** You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) HTTP Status Code: 400 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 77e5ac07..a2cb4777 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -2,11 +2,11 @@ Modify the version\-specific settings of a Lambda function\. -When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. These settings can vary between versions of a function and are locked when you publish a version\. You can't modify the configuration of a published version, only the unpublished version\. -To configure function concurrency, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [AddPermission](API_AddPermission.md)\. +To configure function concurrency, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [ AddPermission ](API_AddPermission.md)\. ## Request Syntax @@ -57,7 +57,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -73,90 +73,90 @@ Required: Yes The request accepts the following data in JSON format\. - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object Required: No - ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Description ](#API_UpdateFunctionConfiguration_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Environment ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object +Type: [ Environment ](API_Environment.md) object Required: No - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Handler ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the method within your code that Lambda calls to execute your function\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** - [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object + ** [ ImageConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Docker file\. +Type: [ ImageConfig ](API_ImageConfig.md) object Required: No - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No - ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Layers ](#API_UpdateFunctionConfiguration_RequestSyntax) ** A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ MemorySize ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No - ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Role ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: No - ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ Runtime ](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of time that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. + ** [ Timeout ](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ TracingConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object +Type: [ TracingConfig ](API_TracingConfig.md) object Required: No - ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ VpcConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [VpcConfig](API_VpcConfig.md) object +Type: [ VpcConfig ](API_VpcConfig.md) object Required: No ## Response Syntax @@ -244,187 +244,187 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ CodeSize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object +Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object - ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Description ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Environment ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects +Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [FunctionName](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [Handler](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Handler ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ ImageConfigResponse ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object +Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatus ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Layers ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects +Type: Array of [ Layer ](API_Layer.md) objects - ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the master function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ MemorySize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ PackageType ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ RevisionId ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Role ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Runtime ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ SigningJobArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ SigningProfileVersionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ State ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ StateReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ StateReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Timeout ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ TracingConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object +Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object - ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ Version ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ VpcConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object +Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object ## Errors - **CodeSigningConfigNotFoundException** + ** CodeSigningConfigNotFoundException ** The specified code signing configuration does not exist\. HTTP Status Code: 404 - **CodeVerificationFailedException** + ** CodeVerificationFailedException ** The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. HTTP Status Code: 400 - **InvalidCodeSignatureException** + ** InvalidCodeSignatureException ** The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. HTTP Status Code: 400 - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **PreconditionFailedException** + ** PreconditionFailedException ** The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. HTTP Status Code: 412 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md index 38046cdb..35d1ba27 100644 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Updates the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ FunctionName ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -40,7 +40,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ Qualifier ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -49,7 +49,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -57,16 +57,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object Required: No - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -100,7 +100,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -108,46 +108,46 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object +Type: [ DestinationConfig ](API_DestinationConfig.md) object - ** [FunctionArn](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ FunctionArn ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [LastModified](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ LastModified ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. ## Errors - **InvalidParameterValueException** + ** InvalidParameterValueException ** One of the parameters in the request is invalid\. HTTP Status Code: 400 - **ResourceConflictException** + ** ResourceConflictException ** The resource already exists, or another operation is in progress\. HTTP Status Code: 409 - **ResourceNotFoundException** + ** ResourceNotFoundException ** The resource specified in the request does not exist\. HTTP Status Code: 404 - **ServiceException** + ** ServiceException ** The AWS Lambda service encountered an internal error\. HTTP Status Code: 500 - **TooManyRequestsException** + ** TooManyRequestsException ** The request throughput limit was exceeded\. HTTP Status Code: 429 diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md index c44d94f0..5cf2d276 100644 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -4,13 +4,13 @@ The VPC security groups and subnets that are attached to a Lambda function\. For ## Contents - **SecurityGroupIds** + ** SecurityGroupIds ** A list of VPC security groups IDs\. Type: Array of strings Array Members: Maximum number of 5 items\. Required: No - **SubnetIds** + ** SubnetIds ** A list of VPC subnet IDs\. Type: Array of strings Array Members: Maximum number of 16 items\. diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md index 66609593..af0b36fd 100644 --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -4,19 +4,19 @@ The VPC security groups and subnets that are attached to a Lambda function\. ## Contents - **SecurityGroupIds** + ** SecurityGroupIds ** A list of VPC security groups IDs\. Type: Array of strings Array Members: Maximum number of 5 items\. Required: No - **SubnetIds** + ** SubnetIds ** A list of VPC subnet IDs\. Type: Array of strings Array Members: Maximum number of 16 items\. Required: No - **VpcId** + ** VpcId ** The ID of the VPC\. Type: String Required: No diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md index daf049a0..fec9dded 100644 --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -45,7 +45,7 @@ The following shows an example of a permissions policy with limited scope\. It a "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", "lambda:ListFunctions", - "lambda:ListTags" + "lambda:ListTags", "iam:ListRoles" ], "Resource": "*" @@ -112,7 +112,7 @@ The permissions in the policy are organized into statements based on the [resour "lambda:GetFunctionConcurrency", "lambda:ListEventSourceMappings", "lambda:ListFunctions", - "lambda:ListTags" + "lambda:ListTags", "iam:ListRoles" ], "Resource": "*" diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 400ace4b..f1bb64c7 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function:*", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md index 5066ea83..dcc91b89 100644 --- a/doc_source/applications-usecases.md +++ b/doc_source/applications-usecases.md @@ -12,11 +12,9 @@ The following are introductory examples of event sources and how the end\-to\-en ## Example 1: Amazon S3 pushes events and invokes a Lambda function -Amazon S3 can publish events of different types, such as PUT, POST, COPY, and DELETE object events on a bucket\. Using the bucket notification feature, you can configure an event source mapping that directs Amazon S3 to invoke a Lambda function when a specific type of event occurs, as shown in the following illustration\. +Amazon S3 can publish events of different types, such as PUT, POST, COPY, and DELETE object events on a bucket\. Using the bucket notification feature, you can configure an event source mapping that directs Amazon S3 to invoke a Lambda function when a specific type of event occurs\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/push-s3-example-10.png) - -The diagram illustrates the following sequence: +The following is a typical sequence: 1. The user creates an object in a bucket\. @@ -34,11 +32,7 @@ For poll\-based event sources, AWS Lambda polls the source and then invokes the + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -The following diagram shows how a custom application writes records to a Kinesis stream\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/kinesis-pull-10.png) - -The diagram illustrates the following sequence: +The following steps describe how a custom application writes records to a Kinesis stream: 1. The custom application writes records to a Kinesis stream\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index 1ceeea73..1b3f53ba 100644 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -90,7 +90,7 @@ Note that Lambda uses a simple probabilistic model to distribute the traffic bet You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: + Both versions must have the same [execution role](lambda-intro-execution-role.md)\. -+ Both versions must have the same [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) configuration, or no dead\-letter queue configuration\. ++ Both versions must have the same [dead\-letter queue](invocation-async.md#invocation-dlq) configuration, or no dead\-letter queue configuration\. + Both versions must be published\. The alias cannot point to `$LATEST`\. **To configure routing on an alias** diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md index 72bc63ea..eece79db 100644 --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -1,29 +1,17 @@ -# Managing concurrency for a Lambda function - -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. Concurrency is subject to a Regional [quota](gettingstarted-limits.md) that is shared by all functions in a Region\. +# Managing Lambda reserved concurrency There are two types of concurrency controls available: + Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. + Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. -This topic details how to manage and configure reserved and provisioned concurrency\. To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. - -To ensure that a function can always reach a certain level of concurrency, configure the function with [reserved concurrency](#configuration-concurrency-reserved)\. When a function has reserved concurrency, no other function can use that concurrency\. Reserved concurrency also limits the maximum concurrency for the function, and applies to the function as a whole, including versions and aliases\. - -When Lambda allocates an instance of your function, the [runtime](lambda-runtimes.md) loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function [scales up](invocation-scaling.md), this causes the portion of requests that are served by new instances to have higher latency than the rest\. +This topic details how to manage and configure reserved concurrency\. If you want to decrease latency for your functions, use [provisioned concurrency](provisioned-concurrency.md)\. -To enable your function to scale without fluctuations in latency, use [provisioned concurrency](#configuration-concurrency-provisioned)\. By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with very low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. +Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. The total concurrency for all of the functions in your account is subject to a per\-region quota\. -Lambda also integrates with [Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/)\. You can configure Application Auto Scaling to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. To increase provisioned concurrency automatically as needed, use [the Application Auto Scaling API](#configuration-concurrency-api) to register a target and create a scaling policy\. - -Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \(`$LATEST`\), which prevents it from executing\. - -**Note** -You can't allocate more provisioned concurrency than reserved concurrency for a function\. +To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. **Topics** + [Configuring reserved concurrency](#configuration-concurrency-reserved) -+ [Configuring provisioned concurrency](#configuration-concurrency-provisioned) + [Configuring concurrency with the Lambda API](#configuration-concurrency-api) ## Configuring reserved concurrency @@ -62,84 +50,13 @@ Reserving concurrency has the following effects\. Setting per\-function concurrency can impact the concurrency pool that is available to other functions\. To avoid issues, limit the number of users who can use the `PutFunctionConcurrency` and `DeleteFunctionConcurrency` API operations\. -## Configuring provisioned concurrency - -To manage provisioned concurrency settings for a version or alias, use the Lambda console\. - -**To provision concurrency for an alias** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Concurrency**\. - -1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. - -1. Choose an alias or version\. - -1. Enter the amount of provisioned concurrency to allocate\. - -1. Choose **Save**\. - -You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. - -In the following example, the `my-function-DEV` and `my-function-PROD` functions are configured with both reserved and provisioned concurrency\. For `my-function-DEV`, the full pool of reserved concurrency is also provisioned concurrency\. In this case, all invocations either run on provisioned concurrency or are throttled\. For `my-function-PROD`, a portion of the reserved concurrency pool is standard concurrency\. When all provisioned concurrency is in use, the function scales on standard concurrency to serve any additional requests\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.concurrency.png) Function concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.reserved.png) Reserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.unreserved.png) Unreserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.throttling.png) Throttling - -Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. - -To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. - -If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. - -For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. - -Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. - -When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. - -Lambda emits the following metrics for provisioned concurrency: - -**Provisioned concurrency metrics** -+ `ProvisionedConcurrentExecutions` -+ `ProvisionedConcurrencyInvocations` -+ `ProvisionedConcurrencySpilloverInvocations` -+ `ProvisionedConcurrencyUtilization` - -For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. - ## Configuring concurrency with the Lambda API -To manage concurrency settings and autoscaling with the AWS CLI or AWS SDK, use the following API operations\. +To manage concurrency settings the AWS CLI or AWS SDK, use the following API operations\. + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) + [GetFunctionConcurrency](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConcurrency.html) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) -+ [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) -+ [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) -+ [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) + [GetAccountSettings](API_GetAccountSettings.md) -+ \(Application Auto Scaling\) [RegisterScalableTarget](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html) -+ \(Application Auto Scaling\) [PutScalingPolicy](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScalingPolicy.html) To configure reserved concurrency with the AWS CLI, use the `put-function-concurrency` command\. The following command reserves a concurrency of 100 for a function named `my-function`: @@ -153,93 +70,4 @@ You should see the following output: { "ReservedConcurrentExecutions": 100 } -``` - -To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: - -``` -aws lambda put-provisioned-concurrency-config --function-name my-function \ ---qualifier BLUE --provisioned-concurrent-executions 100 -``` - -You should see the following output: - -``` -{ - "Requested ProvisionedConcurrentExecutions": 100, - "Allocated ProvisionedConcurrentExecutions": 0, - "Status": "IN_PROGRESS", - "LastModified": "2019-11-21T19:32:12+0000" -} -``` - -To configure Application Auto Scaling to manage provisioned concurrency, use the Application Auto Scaling to configure [target tracking scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. First, register a function's alias as a scaling target\. The following example registers the `BLUE` alias of a function named `my-function`: - -``` -aws application-autoscaling register-scalable-target --service-namespace lambda \ - --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ - --scalable-dimension lambda:function:ProvisionedConcurrency -``` - -Next, apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent: - -``` -aws application-autoscaling put-scaling-policy --service-namespace lambda \ ---scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ ---policy-name my-policy --policy-type TargetTrackingScaling \ ---target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' -``` - -You should see the following output: - -``` -{ - "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", - "Alarms": [ - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7" - }, - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66" - } - ] -} -``` - -Application Auto Scaling creates two alarms in CloudWatch\. The first alarm triggers when the utilization of provisioned concurrency consistently exceeds 70 percent\. When this happens, Application Auto Scaling allocates more provisioned concurrency to reduce utilization\. The second alarm triggers when utilization is consistently less than 63 percent \(90 percent of the 70 percent target\)\. When this happens, Application Auto Scaling reduces the alias's provisioned concurrency\. - -In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -To view your account's concurrency quotas in a Region, use `get-account-settings`\. - -``` -aws lambda get-account-settings -``` - -You should see the following output: - -``` -{ - "AccountLimit": { - "TotalCodeSize": 80530636800, - "CodeSizeUnzipped": 262144000, - "CodeSizeZipped": 52428800, - "ConcurrentExecutions": 1000, - "UnreservedConcurrentExecutions": 900 - }, - "AccountUsage": { - "TotalCodeSize": 174913095, - "FunctionCount": 52 - } -} ``` \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index fd5e3380..6a130191 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -182,7 +182,7 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. + `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. - `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. + `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. + `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. + `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. @@ -201,7 +201,7 @@ The following additional environment variables aren't reserved and can be extend + `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. -+ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index bd90009b..9c510546 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -87,7 +87,7 @@ To connect a function to a file system, use the `update-function-configuration` ``` ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd aws lambda update-function-configuration --function-name my-function \ - --fs-config FileSystemArn=$ARN,LocalMountPath=/mnt/efs0 + --file-system-configs Arn=$ARN,LocalMountPath=/mnt/efs0 ``` You can get the ARN of a file system's access point with the `describe-access-points` command\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index 079c5ac0..a62fe9f9 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -30,26 +30,25 @@ The **Function overview** shows a visualization of your function and its upstrea ## Configuring functions \(console\) -For most function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: +For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: + **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. -+ **Triggers** – Configure [triggers](#configuration-common-triggers)\. + **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. -+ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. + **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. Tags apply to the entire function, including all versions and aliases\. + **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. + **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. -+ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. - - Reserved concurrency applies to the entire function, including all versions and aliases\. -+ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#dlq) to retain discarded events\. ++ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. - You can configure on a function, version, or alias\. -+ **Code signing** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. +You can configure the following options on a function, a function version, or an alias\. ++ **Triggers** – Configure [triggers](#configuration-common-triggers)\. ++ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. ++ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#invocation-dlq) to retain discarded events\. ++ **Code signing** – To use [Code signing](configuration-codesigning.md) with your function, configure the function to include a code\-signing configuration\. + **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. + **File systems** – Connect your function to a [file system](configuration-filesystem.md)\. ++ **State machines** – Use a state machine to orchestrate and apply error handling to your function\. The console provides separate tabs to configure aliases and versions: + **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\. @@ -159,3 +158,5 @@ Saved test events are also available from the **Code** tab, under the **Test** m 1. Choose **Test**\. 1. Expand the **Execution result** panel to display details about the test\. + +You can also invoke your function without saving your test event by choosing **Test** before saving\. This creates an unsaved test event that Lambda will preserve for the duration of the session\. You can access your unsaved test events from either the **Test** or **Code** tab\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index f6839867..e980dd4e 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -5,7 +5,7 @@ When you create a Lambda function, you use a [deployment package](gettingstarted You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. **Note** -You cannot convert an existing \.zip file archive function to use a container image\. You must create a new function\. +You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 907835cc..6f84d7d5 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -81,6 +81,9 @@ For more information, see [Controlling access to services with VPC endpoints](ht **Example: Interface endpoint policy for Lambda actions** The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. +**Note** +You need to include both the qualified and the unqualified function ARN in the resource\. + ``` { "Statement":[ @@ -94,7 +97,8 @@ The following is an example of an endpoint policy for Lambda\. When attached to "lambda:InvokeFunction" ], "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-function” + "arn:aws:lambda:us-east-2:123456789012:function:my-function”, + "arn:aws:lambda:us-east-2:123456789012:function:my-function:*” ] } ] diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 13f14522..829b2388 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -4,9 +4,9 @@ You can configure a Lambda function to connect to private subnets in a virtual p When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each subnet in your function's VPC configuration\. This process can take several minutes\. -While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Lambda function states](functions-states.md)\. -Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to a subnet that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. +Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 043d1252..3d4ec84d 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -143,7 +143,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 6132f93a..d8893f72 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for \.NET](#csharp-image-base) ++ [Using a \.NET base image](#csharp-image-instructions) ++ [\.NET runtime interface clients](#csharp-image-clients) ++ [Deploy the container image](#csharp-image-deploy) ## AWS base images for \.NET @@ -39,4 +45,8 @@ The instructions are also available on [Lambda base images for \.NET](https://hu ## \.NET runtime interface clients -Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. \ No newline at end of file +Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. + +## Deploy the container image + +For a new function, you deploy the container image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index 2d009821..02a49dc3 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -103,7 +103,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md index 8b9a182c..316b45f8 100644 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -29,8 +29,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A } ``` -1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambda-function.png) +1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. 1. Once you have written the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. @@ -42,7 +41,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A + **Memory** – The amount of memory available to the function at runtime\. Choose an amount [between 128 MB and 10,240 MB](gettingstarted-limits.md) in 1\-MB increments\. + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. - + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#dlq) to receive failed invocations\. + + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#invocation-dlq) to receive failed invocations\. + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. 1. Choose **Next**, and then choose **Upload** to deploy your application\. diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index 380253fe..21a62e9f 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md index 8dbf5585..4d8c87cc 100644 --- a/doc_source/foundation-progmodel.md +++ b/doc_source/foundation-progmodel.md @@ -6,8 +6,6 @@ When the handler finishes processing the first event, the runtime sends it anoth When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-initialization-trace.png) - Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 6ff428af..4a90a65a 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -1,12 +1,16 @@ -# Monitoring the state of a function with the Lambda API +# Lambda function states -When you create or update a function, Lambda provisions the compute and networking resources that enable it to run\. In most cases, this process is very fast, and your function is ready to be invoked or modified right away\. +When you create or update a function, AWS Lambda provisions the compute and networking resources that enable it to run\. In most cases your function is ready to be invoked or modified after a few seconds\. However, there are situations where this action can take longer, for example, configuring your function to connect to a virtual private cloud \(VPC\)\. This may lead to situations where invocation of your function fails due to resources not being available\. To indicate when your function is ready to invoke, Lambda includes a state field in the function configuration for all functions\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. -If you configure your function to connect to a virtual private cloud \(VPC\), the process can take longer\. When you first connect a function to a VPC, Lambda provisions network interfaces, which takes about a minute\. To communicate the current state of your function, Lambda includes additional fields in the [function configuration](API_FunctionConfiguration.md) document that is returned by several Lambda API actions\. +Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: ++ `Pending` – After Lambda creates the function, it sets the state to pending\. While in pending state, Lambda attempts to create or configure resources for the function, such as VPC or EFS resources\. Lambda does not invoke a function during pending state\. Any invocations or other API actions that operate on the function will fail\. ++ `Active` – Your function transitions to active state after Lambda completes resource configuration and provisioning\. Functions can only be successfully invoked while active\. ++ `Failed` – Indicates that resource configuration or provisioning encountered an error\. ++ `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -When you create a function, the function is initially in the `Pending` state\. When the function is ready to be invoked, the state changes from `Pending` to `Active`\. While the state is `Pending`, invocations and other API actions that operate on the function return an error\. If you build automation around creating and updating functions, wait for the function to become active before performing additional actions that operate on the function\. +Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter with the [AWS SDK for Java API Reference](https://docs.aws.amazon.com/sdk-for-java/latest/reference/AWSLambdaWaiters.html)\. -You can use the Lambda API to get information about a function's state\. State information is included in the [FunctionConfiguration](API_FunctionConfiguration.md) document returned by several API actions\. To view the function's state with the AWS CLI, use the `get-function-configuration` command\. +To view the function's state with the AWS CLI, use `get-function-configuration`\. ``` aws lambda get-function-configuration --function-name my-function @@ -30,15 +34,23 @@ You should see the following output: } ``` -The `StateReason` and `StateReasonCode` contain additional information about the state when it is not `Active`\. The following operations fail while function creation is pending: +Functions have two other attributes, `StateReason` and `StateReasonCode`\. These provide information and context about the function’s state when it is not active for troubleshooting issues\. + +The following operations fail while function creation is pending: + [Invoke](API_Invoke.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [PublishVersion](API_PublishVersion.md) -When you update a function's configuration, the update can trigger an asynchronous operation to provision resources\. While this is in progress, you can invoke the function, but other operations on the function fail\. Invocations that occur while the update is in progress run against the previous configuration\. The function's state is `Active`, but its `LastUpdateStatus` is `InProgress`\. +## Function states while updating + +Lambda provides additional context for functions undergoing updates with the `LastUpdateStatus` attribute, which can have the following statuses: ++ `InProgress` – An update is happening on an existing function\. While a function update is in progress, invocations go to the function’s previous code and configuration\. ++ `Successful` – The update has completed\. Once Lambda finishes the update, this stays set until a further update\. ++ `Failed` – The function update has failed\. Lambda aborts the update and the function’s previous code and configuration remain available\. -**Example Function configuration – Connecting to a VPC** +**Example** +The following is the result of `get-function-configuration` on a function undergoing an update\. ``` { @@ -62,17 +74,9 @@ When you update a function's configuration, the update can trigger an asynchrono } ``` +[FunctionConfiguration](API_FunctionConfiguration.md) has two other attributes, `LastUpdateStatusReason` and `LastUpdateStatusReasonCode`, to help troubleshoot issues with updating\. + The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) - -Other operations, including invocation, work while updates are in progress\. - -For example, when you connect your function to a virtual private cloud \(VPC\), Lambda provisions an elastic network interface for each subnet\. This process can leave your function in a pending state for a minute or so\. Lambda also reclaims network interfaces that are not in use, placing your function in an `Inactive` state\. When the function is inactive, an invocation causes it to enter the `Pending` state while network access is restored\. The invocation that triggers restoration, and further invocations while the operation is pending, fail with `ResourceNotReadyException`\. - -If Lambda encounters an error when restoring a function's network interface, the function goes back to the `Inactive` state\. The next invocation can trigger another attempt\. For some configuration errors, Lambda waits at least 5 minutes before attempting to create another network interface\. These errors have the following `LastUpdateStatusReasonCode` values: -+ `InsufficientRolePermission` – Role doesn't exist or is missing permissions\. -+ `SubnetOutOfIPAddresses` – All IP addresses in a subnet are in use\. - -For more information on how states work with VPC connectivity, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. \ No newline at end of file ++ [PublishVersion](API_PublishVersion.md) \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 6c82bbe9..73a69950 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -104,7 +104,7 @@ For more information, see [Using Lambda extensions](using-extensions.md)\. *Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. -Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. ## Qualifier diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 520eda6f..47b34567 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -30,7 +30,7 @@ To enable functions to scale without fluctuations in latency, use *provisioned c ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) -For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. ## Asynchronous invocation diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index 7061a86d..fbf47dbd 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -37,7 +37,7 @@ AWS provides a set of base images in the Amazon Elastic Container Registry \(Ama In the following commands, replace `123456789012` with your AWS account ID\. -**To create an image using the AWS Node\.js 12 base image** +**To create an image using the AWS Node\.js 14 base image** 1. On your local machine, create a project directory for your new function\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 9977f037..68d60802 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -1,46 +1,57 @@ # Lambda quotas +## Compute and storage + Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. | Resource | Default quota | Can be increased up to | | --- | --- | --- | -| Concurrent executions | 1,000 | Tens of thousands | -| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | -| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | -| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | +| Concurrent executions | 1,000 | Tens of thousands | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | +| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [Lambda function scaling](invocation-scaling.md)\. -The following quotas apply to function configuration, deployments, and execution\. They cannot be changed\. +## Function configuration, deployment, and execution + +The following quotas apply to function configuration, deployment, and execution\. They cannot be changed\. + +**Note** +The Lambda documentation, log messages, and console use the abbreviation MB \(rather than MiB\) to refer to 1024 KB\. | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | -| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | -| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | -| Function [layers](configuration-layers.md) | five layers | -| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | -| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped, including layers\) 3 MB \(console editor\) | -| [Container image](lambda-images.md) code package size | 10 GB | -| Test events \(console editor\) | 10 | -| `/tmp` directory storage | 512 MB | -| File descriptors | 1,024 | -| Execution processes/threads | 1,024 | +| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | +| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | +| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | +| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | +| Function [layers](configuration-layers.md) | five layers | +| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | +| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | +| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped\) This quota applies to all the files you upload, including layers and custom runtimes\. 3 MB \(console editor\) | +| [Container image](lambda-images.md) code package size | 10 GB | +| Test events \(console editor\) | 10 | +| `/tmp` directory storage | 512 MB | +| File descriptors | 1,024 | +| Execution processes/threads | 1,024 | + +## Lambda API requests The following quotas are associated with Lambda API requests\. | Resource | Quota | | --- | --- | -| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | -| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | -| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | -| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | -| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | -| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | +| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | +| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | +| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | +| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | +| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | +| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | + +## Other services Quotas for other services, such as AWS Identity and Access Management \(IAM\), Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud \(Amazon VPC\), can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) in the *Amazon Web Services General Reference*, and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/go-image.md b/doc_source/go-image.md index c55879cf..39b72669 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -14,14 +14,15 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Go](#go-image-base) + [Go runtime interface clients](#go-image-clients) + [Using the Go:1\.x base image](#go-image-v1) -+ [Deploying Go with the `provided.al2` base image](#go-image-al2) -+ [Deploying Go with an alternative base image](#go-image-other) ++ [Create a Go image from the `provided.al2` base image](#go-image-al2) ++ [Create a Go image from an alternative base image](#go-image-other) ++ [Deploy the container image](#go-image-deploy) ## AWS base images for Go @@ -46,7 +47,7 @@ For instructions on how to use the base image for Go:1\.x, choose the **usage** The instructions are also available on [Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. -## Deploying Go with the `provided.al2` base image +## Create a Go image from the `provided.al2` base image To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. @@ -108,7 +109,7 @@ Note that the first three steps are identical whether you deploy your function a Now that your container image resides in the Amazon ECR container registry, you can [create](configuration-images.md) the Lambda function and deploy the image\. -## Deploying Go with an alternative base image +## Create a Go image from an alternative base image You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. @@ -183,4 +184,8 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. \ No newline at end of file +Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. + +## Deploy the container image + +For a new function, you deploy the Go image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 79406118..5f18cfbc 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -61,7 +61,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index 89a50954..a6dac31c 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -88,7 +88,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index 86ac0456..c7564059 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index c9466515..d2337734 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -104,7 +104,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do FROM public.ecr.aws/lambda/nodejs:14 # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 - # Assumes your function is named "app.js", and there is a package.json file in the app directory + # Assumes your function is named "app.js", and there is a package.json file in the app directory COPY app.js package.json ${LAMBDA_TASK_ROOT} # Install NPM dependencies for function @@ -297,4 +297,4 @@ You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create a In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. -For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. +For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md index f841dc4a..69d4573c 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -43,7 +43,8 @@ Amazon's trademarks and trade dress may not be used in + [Lambda function versions](configuration-versions.md) + [Lambda function aliases](configuration-aliases.md) + [Managing AWS Lambda functions](lambda-managing.md) - + [Managing concurrency for a Lambda function](configuration-concurrency.md) + + [Managing Lambda reserved concurrency](configuration-concurrency.md) + + [Managing Lambda provisioned concurrency](provisioned-concurrency.md) + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) + [Configuring database access for a Lambda function](configuration-database.md) @@ -55,7 +56,7 @@ Amazon's trademarks and trade dress may not be used in + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) - + [Monitoring the state of a function with the Lambda API](functions-states.md) + + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) @@ -132,13 +133,14 @@ Amazon's trademarks and trade dress may not be used in + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + [Using AWS Lambda with Amazon SES](services-ses.md) + [Using Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) + [Using AWS Lambda with Amazon SQS](with-sqs.md) - + [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) + + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) @@ -161,8 +163,6 @@ Amazon's trademarks and trade dress may not be used in + [Building Lambda functions with Python](lambda-python.md) + [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) - + [Tutorial: Creating a Lambda function in Python 3.8](python-package-create.md) - + [Updating a Lambda function in Python 3.8](python-package-update.md) + [Deploy Python Lambda functions with container images](python-image.md) + [AWS Lambda context object in Python](python-context.md) + [AWS Lambda function logging in Python](python-logging.md) @@ -177,7 +177,6 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Ruby](ruby-exceptions.md) + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) + [Building Lambda functions with Java](lambda-java.md) - + [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) + [Deploy Java Lambda functions with .zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) @@ -186,6 +185,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function errors in Java](java-exceptions.md) + [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + + [Java sample applications for AWS Lambda](java-samples.md) + [Building Lambda functions with Go](lambda-golang.md) + [AWS Lambda function handler in Go](golang-handler.md) + [AWS Lambda context object in Go](golang-context.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index b3f26109..792b6e0a 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -7,7 +7,7 @@ Several AWS services, such as Amazon Simple Storage Service \(Amazon S3\) and Am + [Configuring error handling for asynchronous invocation](#invocation-async-errors) + [Configuring destinations for asynchronous invocation](#invocation-async-destinations) + [Asynchronous invocation configuration API](#invocation-async-api) -+ [AWS Lambda function dead\-letter queues](#dlq) ++ [Dead\-letter queues](#invocation-dlq) ## How Lambda handles asynchronous invocations @@ -37,14 +37,8 @@ The output file \(`response.json`\) doesn't contain any information, but is stil Lambda manages the function's asynchronous event queue and attempts to retry on errors\. If the function returns an error, Lambda attempts to run it two more times, with a one\-minute wait between the first two attempts, and two minutes between the second and third attempts\. Function errors include errors returned by the function's code and errors returned by the function's runtime, such as timeouts\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-retries.png) - If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. If the queue contains many entries, Lambda increases the retry interval and reduces the rate at which it reads events from the queue\. -The following example shows an event that was successfully added to the queue, but is still pending one hour later due to throttling\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-types-throttle.png) - Even if your function doesn't return an error, it's possible for it to receive the same event from Lambda multiple times because the queue itself is eventually consistent\. If the function can't keep up with incoming events, events might also be deleted from the queue without being sent to the function\. Ensure that your function code gracefully handles duplicate events, and that you have enough concurrency available to handle all invocations\. When the queue is very long, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. @@ -55,7 +49,10 @@ You can also configure Lambda to send an invocation record to another service\. + **AWS Lambda** – A Lambda function\. + **Amazon EventBridge** – An EventBridge event bus\. -The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an SQS queue or SNS topic as a [dead\-letter queue](#dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. +The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an Amazon SQS queue or Amazon SNS topic as a [dead\-letter queue](#invocation-dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. + +**Note** +To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda immediately sends all events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. ## Configuring error handling for asynchronous invocation @@ -90,7 +87,7 @@ The following example shows a function that is processing asynchronous invocatio To send events to a destination, your function needs additional permissions\. Add a policy with the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) -+ **Lambda** – [lambda:InvokeFunction](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) ++ **Lambda** – [InvokeFunction](API_Invoke.md) + **EventBridge** – [events:PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) Add destinations to your function in the Lambda console's function visualization\. @@ -204,14 +201,14 @@ You should see the following output: } ``` -## AWS Lambda function dead\-letter queues +## Dead\-letter queues As an alternative to an [on\-failure destination](#invocation-async-destinations), you can configure your function with a dead\-letter queue to save discarded events for further processing\. A dead\-letter queue acts the same as an on\-failure destination in that it is used when an event fails all processing attempts or expires without being processed\. However, a dead\-letter queue is part of a function's version\-specific configuration, so it is locked in when you publish a version\. On\-failure destinations also support additional targets and include details about the function's response in the invocation record\. To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md) and invoke a function\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 8ebd736e..9065b832 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -13,7 +13,7 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index b0027372..1ae816c4 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -9,13 +9,13 @@ For a Lambda function defined as a container image, function behavior during inv ## Function lifecycle -Lambda optimizes a new or updated container image in preparation for the function to receive invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. +After you upload a new or updated container image, Lambda optimizes the image before the function can process invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. If a function is not invoked for multiple weeks, Lambda reclaims its optimized version, and the function transitions to the `Inactive` state\. To reactivate the function, you must invoke it\. Lambda rejects the first invocation and the function enters the `Pending` state until Lambda re\-optimizes the image\. The function then returns to the `Active` state\. -Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. +Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR or permissions are revoked, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. -You can use the Lambda API to get information about a function's state\. For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +You can use the Lambda API to get information about a function's state\. For more information, see [Lambda function states](functions-states.md)\. ## Invoking the function diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 54e09cc3..653ab0d4 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -102,7 +102,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 16cb08af..1948d663 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -61,7 +61,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Creating a function that returns exceptions @@ -212,7 +212,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index c599c164..6f41740c 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -173,7 +173,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: diff --git a/doc_source/java-image.md b/doc_source/java-image.md index e6dc8fe7..a8a43259 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Java](#java-image-base) ++ [Using a Java base image](#java-image-instructions) ++ [Java runtime interface clients](#java-image-clients) ++ [Deploy the container image](#java-image-deploy) ## AWS base images for Java @@ -55,7 +61,6 @@ You can also view the Java client source code in the [AWS Lambda Java Support Li After your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. -**Topics** -+ [AWS base images for Java](#java-image-base) -+ [Using a Java base image](#java-image-instructions) -+ [Java runtime interface clients](#java-image-clients) \ No newline at end of file +## Deploy the container image + +For a new function, you deploy the Java image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 28e895dc..6302d70b 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -102,7 +102,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -329,7 +329,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 5a441306..4bf6634f 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -20,6 +20,7 @@ Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. + [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. + [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. ++ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. These libraries are available through [Maven Central Repository](https://search.maven.org/search?q=g:com.amazonaws)\. Add them to your build definition as follows: @@ -332,5 +333,4 @@ For a complete working example, see the following sample applications: + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index cf1a95f8..74378b5b 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -6,7 +6,6 @@ The GitHub repository for this guide provides sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. @@ -36,14 +35,13 @@ public class HandlerStream implements RequestStreamHandler { ... ``` -The `java-events` and `java-events-v1sdk` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. For event types like `DynamodbEvent` that require types from the AWS SDK for Java, `java-events-v1sdk` includes the SDK in its build configuration\. +The `java-events` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. -**Example [java\-events\-v1sdk/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** +**Example [java\-events/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** ``` import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; -import com.amazonaws.services.dynamodbv2.model.Record; ... // Handler value: example.HandlerDynamoDB public class HandlerDynamoDB implements RequestHandler{ diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 294ab1c8..db2726ad 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. @@ -152,7 +152,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 942b41f8..ee55ebda 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -78,7 +78,7 @@ For more information on resources and conditions for Lambda and other AWS servic You reference a Lambda function in a policy statement using an Amazon Resource Names \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function, a function [version](configuration-versions.md), or an [alias](configuration-aliases.md)\. -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter, or by setting a value in the [https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunction.html#API_GetFunction_RequestSyntax) parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index 2e6e17c1..81eac920 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -10,8 +10,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA 1. Choose **Configuration** and then choose **Permissions**\. -1. Under **Resource summary**, view the services and resources that the function can access\. The following example shows the CloudWatch Logs permissions that Lambda adds to an execution role when you create it in the Lambda console\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/permissions-executionrole.png) +1. Under **Resource summary**, view the services and resources that the function can access\. 1. Choose a service from the dropdown list to see permissions related to that service\. @@ -136,6 +135,7 @@ The following AWS managed policies provide permissions that are required to use + **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. + **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. + **CloudWatchLambdaInsightsExecutionRolePolicy** – Permission to write runtime metrics to CloudWatch Lambda Insights\. ++ **AmazonS3ObjectLambdaExecutionRolePolicy** – Permission to interact with Amazon S3 Object Lambda\. For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index d92a1452..f74d5090 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -16,7 +16,7 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) -+ [Monitoring the state of a function with the Lambda API](functions-states.md) ++ [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index db10e560..c5f091d0 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -13,6 +13,12 @@ Lambda supports the following Java runtimes\. | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | | Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +Lambda provides the following libraries for Java functions: ++ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. ++ [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. ++ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. ++ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. + Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. **To create an execution role** @@ -66,7 +72,6 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](java-logging.md) during invocation\. If your function [returns an error](java-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** -+ [Java sample applications for AWS Lambda](java-samples.md) + [AWS Lambda function handler in Java](java-handler.md) + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + [Deploy Java Lambda functions with container images](java-image.md) @@ -74,4 +79,5 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) + [Instrumenting Java code in AWS Lambda](java-tracing.md) -+ [Creating a deployment package using Eclipse](java-package-eclipse.md) \ No newline at end of file ++ [Creating a deployment package using Eclipse](java-package-eclipse.md) ++ [Java sample applications for AWS Lambda](java-samples.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 0dfaa908..5d0a13db 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 469cdeda..04feb72f 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -5,13 +5,14 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | @@ -25,7 +26,7 @@ End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more in 1. Configure the following settings: + **Name** – **my\-function**\. - + **Runtime** – **Python 3\.8**\. + + **Runtime** – **Python 3\.9**\. + **Role** – **Choose an existing role**\. + **Existing role** – **lambda\-role**\. @@ -44,16 +45,10 @@ The console creates a Lambda function with a single source file named `lambda_fu **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. -The `lambda_function` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](python-handler.md) that Lambda calls when the function is invoked\. The Python function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](python-package.md) to upload your code to the Lambda function\. - **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](python-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. - Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](python-logging.md) during invocation\. If your function [returns an error](python-exceptions.md), Lambda formats the error and returns it to the invoker\. **Topics** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index c2068ea7..02d80f28 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,8 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | +| [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | | [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | | [SASL/PLAIN authentication for self\-managed Kafka on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss) | SASL/PLAIN is now a supported authentication mechanism for self\-managed Kafka event sources on Lambda Customers already using SASL/PLAIN on their self\-managed Kafka cluster can now easily use Lambda to build consumer applications without having to modify the way they authenticate\. For details, see [Using Lambda with self\-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss)\. | June 29, 2021 | | [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | @@ -26,7 +28,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | -| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/API_FunctionConfiguration.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | +| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | @@ -44,7 +46,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [CloudWatch Logs Insights integration](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss) | The monitoring page in the Lambda console now includes reports from Amazon CloudWatch Logs Insights\. For details, see [Monitoring functions in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss)\. | June 18, 2019 | | [Amazon Linux 2018\.03](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss) | The Lambda execution environment is being updated to use Amazon Linux 2018\.03\. For details, see [Execution environment](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss)\. | May 21, 2019 | | [Node\.js 10](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | A new runtime is available for Node\.js 10, nodejs10\.x\. This runtime uses Node\.js 10\.15 and will be updated with the latest point release of Node\.js 10 periodically\. Node\.js 10 is also the first runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 13, 2019 | -| [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/API_GetLayerVersionByArn.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | +| [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | | [Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Ruby 2\.5 with a new runtime\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | | [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | @@ -73,7 +75,7 @@ The following table describes the important changes in each release of the *AWS | Function and alias revision IDs | AWS Lambda now supports revision IDs on your function versions and aliases\. You can use these IDs to track and apply conditional updates when you are updating your function version or alias resources\. | January 25, 2018 | | Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | | Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | -| Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. | November 30,2017 | +| Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. | November 30,2017 | | Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions ](lambda-rolling-deployments.md)\. | November 28, 2017 | | Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | | China \(Beijing\) Region | AWS Lambda is now available in the China \(Beijing\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 9, 2017 | diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 80a32d32..405bbf3f 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.880\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.880\.0 | Amazon Linux 2 | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,13 +33,14 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | | Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | **Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. **Ruby runtimes** diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 8ced5952..0909c007 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -33,7 +33,6 @@ The GitHub repository for this guide includes sample applications that demonstra + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. + [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. + [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. -+ [java\-events\-v1sdk](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events-v1sdk) – A Java function that uses an older version \(2\.2\.9\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples require the AWS SDK as a dependency\. **These examples are deprecated\. We recommend following the `java-events` examples and using version 3\.0\.0 or above of the `aws-lambda-java-events` library\.** + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ------ diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index c51eea66..b30be145 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -72,7 +72,7 @@ For more information about Lambda service architectures, see [Event driven archi + [Amazon Simple Storage Service Batch](services-s3-batch.md) + [Secrets Manager](with-secrets-manager.md) -For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. +For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. You can disable retries for a function by setting the function's reserved concurrency value to zero\. **Services that invoke Lambda functions asynchronously** + [Amazon Simple Storage Service](with-s3.md) diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index 8c6012d6..7134c54a 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -1,6 +1,6 @@ # Accessing Amazon CloudWatch logs for AWS Lambda -AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. +AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, after you set up permissions, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. @@ -18,7 +18,13 @@ It may take 5 to 10 minutes for logs to show up after a function invocation\. ## Prerequisites -Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using an AWS managed policy provided by Lambda\. For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. +Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using the `AWSLambdaBasicExecutionRole` AWS managed policy provided by Lambda\. To add this policy to your role, run the following command: + +``` +aws iam attach-role-policy --role-name your-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +``` + +For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. ## Pricing diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index 5ed52df0..d0d94b1a 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -42,11 +42,11 @@ Invocation metrics are binary indicators of the outcome of an invocation\. For e You should view the following metrics with the `Sum` statistic\. **Invocation metrics** -+ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an [invocation error](API_Invoke.md#API_Invoke_Errors)\. This equals the number of requests billed\. ++ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an invocation error\. This equals the number of requests billed\. + `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. + `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. + `DestinationDeliveryFailures` – For asynchronous invocation, the number of times Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with [TooManyRequestsException](API_Invoke.md#API_Invoke_Errors)\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. ++ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with `TooManyRequestsException`\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. + `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 0d486fd1..28a57dee 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -56,7 +56,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md index 76841bdf..541044fd 100644 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -23,6 +23,8 @@ The third argument, `callback`, is a function that you can call in [non\-async h For async handlers, you return a response, error, or promise to the runtime instead of using `callback`\. +If your function has additional dependencies, [use npm to include them in your deployment package](nodejs-package.md#nodejs-package-dependencies)\. + ## Async handlers For async handlers, you can use `return` and `throw` to send a response or error, respectively\. Functions must use the `async` keyword to use these methods to return a response or error\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 60c1a5ee..79680e2b 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -14,7 +14,13 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Node\.js](#nodejs-image-base) ++ [Using a Node\.js base image](#nodejs-image-instructions) ++ [Node\.js runtime interface clients](#nodejs-image-clients) ++ [Deploy the container image](#nodejs-image-deploy) ## AWS base images for Node\.js @@ -47,4 +53,8 @@ npm install aws-lambda-ric For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. -You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. \ No newline at end of file +You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. + +## Deploy the container image + +For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 7ba49d9b..d3e16881 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -81,7 +81,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index d04db7f6..a030d52a 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -10,8 +10,6 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. - **Topics** + [Prerequisites](#node-package-prereqs) + [Updating a function with no dependencies](#nodejs-package-codeonly) diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index a83541ff..5ee8eef0 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index a5709fb0..02469114 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -80,7 +80,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 451ade07..9043989d 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -91,7 +91,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md new file mode 100644 index 00000000..3521229a --- /dev/null +++ b/doc_source/provisioned-concurrency.md @@ -0,0 +1,177 @@ +# Managing Lambda provisioned concurrency + +There are two types of concurrency controls available: ++ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. ++ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. + +This topic details how to manage and configure provisioned concurrency\. If you want to configure reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. + +When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function scales up, this causes the portion of requests that are served by new instances to have higher latency than the rest\. + +By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. + +Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. + +Lambda also integrates with Application Auto Scaling, allowing you to manage provisioned concurrency on a schedule or based on utilization\. + +**Topics** ++ [Configuring provisioned concurrency](#configuring-provisioned-concurrency) ++ [Optimizing latency with provisioned concurrency](#optimizing-latency) ++ [Managing provisioned concurrency with Application Auto Scaling](#managing-provisioned-concurency) + +## Configuring provisioned concurrency + +To manage provisioned concurrency settings for a version or alias, use the Lambda console\. + +**To allocate provisioned concurrency for an alias or version** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose a function\. + +1. Choose **Configuration** and then choose **Concurrency**\. + +1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. + +1. Choose an alias or version\. + +1. Enter the amount of provisioned concurrency to allocate\. + +1. Choose **Save**\. + +You can also configure provisioned concurrency using the Lambda API with the following operations: ++ [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) ++ [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) ++ [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) ++ [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) + +To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: + +``` +aws lambda put-provisioned-concurrency-config --function-name my-function \ +--qualifier BLUE --provisioned-concurrent-executions 100 +``` + +You should see the following output: + +``` +{ + "Requested ProvisionedConcurrentExecutions": 100, + "Allocated ProvisionedConcurrentExecutions": 0, + "Status": "IN_PROGRESS", + "LastModified": "2019-11-21T19:32:12+0000" +} +``` + +To view your account's concurrency quotas in a Region, use `get-account-settings`\. + +``` +aws lambda get-account-settings +``` + +You should see the following output: + +``` +{ + "AccountLimit": { + "TotalCodeSize": 80530636800, + "CodeSizeUnzipped": 262144000, + "CodeSizeZipped": 52428800, + "ConcurrentExecutions": 1000, + "UnreservedConcurrentExecutions": 900 + }, + "AccountUsage": { + "TotalCodeSize": 174913095, + "FunctionCount": 52 + } +} +``` + +You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. + +Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. + +When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. + +Lambda emits the following metrics for provisioned concurrency: + +**Provisioned concurrency metrics** ++ `ProvisionedConcurrentExecutions` ++ `ProvisionedConcurrencyInvocations` ++ `ProvisionedConcurrencySpilloverInvocations` ++ `ProvisionedConcurrencyUtilization` + +For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + +## Optimizing latency with provisioned concurrency + +Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) + +**Legend** ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency + +To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. + +To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. + +If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. + +For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. + +## Managing provisioned concurrency with Application Auto Scaling + +Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. + +To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` [Application Auto Scaling API ](configuration-concurrency.md#configuration-concurrency-api) operations to register a target and create a scaling policy: + +1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `function`my\-: + + ``` + aws application-autoscaling register-scalable-target --service-namespace lambda \ + --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ + --scalable-dimension lambda:function:ProvisionedConcurrency + ``` + +1. Apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent\. + + ``` + aws application-autoscaling put-scaling-policy --service-namespace lambda \ + --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ + --policy-name my-policy --policy-type TargetTrackingScaling \ + --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' + ``` + + You should see the following output: + + ``` + { + "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", + "Alarms": [ + { + "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7", + "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7" + }, + { + "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66", + "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66" + } + ] + } + ``` + +Application Auto Scaling creates two alarms in CloudWatch\. The first alarm triggers when the utilization of provisioned concurrency consistently exceeds 70 percent\. When this happens, Application Auto Scaling allocates more provisioned concurrency to reduce utilization\. The second alarm triggers when utilization is consistently less than 63 percent \(90 percent of the 70 percent target\)\. When this happens, Application Auto Scaling reduces the alias's provisioned concurrency\. + +In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) + +**Legend** ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency \ No newline at end of file diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 332f2077..6a259e73 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,7 +1,7 @@ # AWS Lambda context object in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 1c7113cd..422d65cf 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,7 +1,7 @@ # AWS Lambda function errors in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. @@ -35,7 +35,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index 9849eb94..f566411b 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,7 +1,7 @@ # Lambda function handler in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. @@ -35,12 +35,15 @@ When Lambda invokes your function handler, the [Lambda runtime](lambda-runtimes. ## Returning a value -Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [Using AWS Lambda with other services](lambda-services.md)\. For example: +Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [service](lambda-services.md) that invoked the function\. For example: + If you use the `RequestResponse` invocation type, such as [Synchronous invocation](invocation-sync.md), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function on the console, the console will display the returned value\. + If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. + If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. + If you use an `Event` an [Asynchronous invocation](invocation-async.md) invocation type, the value is discarded\. +**Note** +In Python 3\.9 and later releases, Lambda includes the requestId of the invocation in the error response\. + ## Examples The following section shows examples of Python functions you can use with Lambda\. If you use the Lambda console to author your function, you do not need to attach a [\.zip archive file](python-package.md) to run the functions in this section\. These functions use standard Python libraries which are included with the Lambda runtime you selected\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. @@ -107,7 +110,7 @@ You can use any event data to [invoke the function](https://docs.aws.amazon.com/ Lambda runtimes set several environment variables during initialization\. For more information on the environment variables returned in the response at runtime, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke API Response Syntax](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax)\. +The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke](API_Invoke.md) Response Syntax\. ### Returning a calculation diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b9008b74..b95a618d 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,7 +1,7 @@ # Deploy Python Lambda functions with container images **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda @@ -17,13 +17,14 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Python](#python-image-base) + [Python runtime interface clients](#python-image-clients) -+ [Deploying Python with an AWS base image](#python-image-create) ++ [Create a Python image from an AWS base image](#python-image-create) + [Create a Python image from an alternative base image](#python-image-create-alt) ++ [Deploy the container image](#python-image-deploy) ## AWS base images for Python @@ -32,7 +33,8 @@ AWS provides the following base images for Python: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 3, 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | +| 3, 3\.9 | Python 3\.9 | Amazon Linux 2 | [Dockerfile for Python 3\.9 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9) | +| 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | | 3\.7 | Python 3\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | | 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | @@ -53,7 +55,7 @@ For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. -## Deploying Python with an AWS base image +## Create a Python image from an AWS base image When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. @@ -93,4 +95,8 @@ When you build a container image for Python using an AWS base image, you only ne ## Create a Python image from an alternative base image -For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. \ No newline at end of file +For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. + +## Deploy the container image + +For a new function, you deploy the Python image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index 22221d64..fdf6f8c0 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,7 +1,7 @@ # AWS Lambda function logging in Python **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. @@ -73,7 +73,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/python-package-create.md b/doc_source/python-package-create.md deleted file mode 100644 index 732f0120..00000000 --- a/doc_source/python-package-create.md +++ /dev/null @@ -1,454 +0,0 @@ -# Tutorial: Creating a Lambda function in Python 3\.8 - -This tutorial guides you through building the code and assets to create a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. - -**Topics** -+ [Prerequisites](#python-package-create-prereqs) -+ [Creating a function without runtime dependencies](#python-package-create-no-dependency) -+ [Creating a function with runtime dependencies](#python-package-create-with-dependency) - -## Prerequisites - -This section describes the tools and resources required to complete the steps in the tutorial\. - -### Install the AWS CLI - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -### Create an execution role - -Your Lambda function's [execution role](lambda-intro-execution-role.md) is an AWS Identity and Access Management \(IAM\) role that grants your function permission to access AWS services and resources\. Create an execution role in IAM with [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html) permission\. - -**To create the execution role** - -1. Open a command prompt and use the [create\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/create-role.html) command to create an execution role named `lambda-ex`\. - ------- -#### [ macOS/Linux ] - - ``` - aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' - ``` - ------- -#### [ Windows ] - - ``` - aws iam create-role --role-name lambda-ex --assume-role-policy-document "{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}" - ``` - ------- - - This command produces the following output\. Save the value returned in `Arn`\. - - ``` - { - "Role": { - "Path": "/", - "RoleName": "lambda-ex", - "RoleId": "AROAWNZPPVHULXRJXQJD5", - "Arn": "arn:aws:iam::your-account-id:role/lambda-ex", - "CreateDate": "2021-01-05T18:00:30Z", - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - } - } - ``` - -1. Use the [attach\-role\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/attach-role-policy.html) command to add `AWSLambdaBasicExecutionRole` permissions to the role\. - - ``` - $ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole - ``` - - This command produces no output\. - -## Creating a function without runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - - For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) - -This section describes how to create a Lambda function without runtime dependencies\. - -**Topics** -+ [Overview](#python-package-create-about-no-dependency) -+ [Create the deployment package](#python-package-create-package-no-dependency) -+ [Create the Lambda function](#python-package-create-createfunction-no-dependency) -+ [Invoke the Lambda function](#python-package-create-invokefunction-no-dependency) -+ [What's next?](#python-package-create-next-no-dependency) -+ [Clean up your resources](#python-package-create-cleanup-no-dependency) - -### Overview - -In this tutorial, you use the [sample code from the AWS SDK for Python \(Boto3\) project on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) to create a Lambda function using the AWS CLI\. You'll learn how to: -+ Set up the directory structure of a deployment package \(\.zip file\)\. -+ Create a deployment package for a Lambda function without any runtime dependencies\. -+ Use the AWS CLI to upload the deployment package and create the Lambda function\. -+ Invoke the Lambda function to return a mathematical calculation\. - -The sample code contains standard math and logging Python libraries, which are used to return a calculation based on user input\. Standard Python libraries are included with the `python3.8` [runtime](lambda-runtimes.md)\. Although the function's code doesn't depend on any other Python libraries and has no additional application dependencies, Lambda still requires a deployment package to create a function\. - -### Create the deployment package - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -Create the \.zip file that Lambda uses as your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: - - ``` - mkdir my-math-function - ``` - -1. Navigate to the `my-math-function` project directory\. - - ``` - cd my-math-function - ``` - -1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: - - ``` - my-math-function$ - | lambda_function.py - ``` - -1. Add the `lambda_function.py` file to the root of the \.zip file\. - - ``` - zip my-deployment-package.zip lambda_function.py - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: lambda_function.py (deflated 50%) - ``` - -### Create the Lambda function - -Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. - -Create the Lambda function using the execution role and deployment package that you created in the previous steps\. - -**To create the function** - -1. Navigate to the `my-math-function` project directory\. - - ``` - cd my-math-function - ``` - -1. Create a function named `my-math-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. - - ``` - aws lambda create-function --function-name my-math-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex - ``` - - This command produces the following output: - - ``` - { - "FunctionName": "my-math-function", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-math-function", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 753, - "Description": "", - "Timeout": 3, - "MemorySize": 128, - "LastModified": "2021-01-05T18:39:44.847+0000", - "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", - "State": "Active", - "LastUpdateStatus": "Successful" - } - ``` - - The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -### Invoke the Lambda function - -Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. - -**To invoke the function** -+ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. - - ``` - aws lambda invoke \ - --function-name my-math-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"action": "square","number": 3}' output.txt - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - - This command produces the following output: - - ``` - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - ``` - - For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. - - You should see the following mathematical calculation in `output.txt`: - - ``` - {"result": 9} - ``` - -### What's next? -+ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. -+ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. -+ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. - -### Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** -+ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. - - ``` - aws lambda delete-function --function-name my-function - ``` - - This command produces no output\. - -**To delete the execution role policy** -+ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. - - ``` - aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole - ``` - -**To delete the execution role** -+ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. - - ``` - aws iam delete-role --role-name lambda-ex - ``` - -## Creating a function with runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies) - -This section describes how to create a Lambda function with runtime dependencies\. - -**Topics** -+ [Overview](#python-package-create-about) -+ [Create the deployment package](#python-package-create-package-with-dependency) -+ [Create the Lambda function](#python-package-create-createfunction-with-dependency) -+ [Invoke the Lambda function](#python-package-create-invokefunction-with-dependency) -+ [What's next?](#python-package-create-next-with-dependency) -+ [Clean up your resources](#python-package-create-cleanup-with-dependency) - -### Overview - -In this tutorial, you use sample code to create a Lambda function using the AWS CLI\. The sample code uses the requests library to get the source code for [https://www\.test\.com/](https://www.test.com/)\. The requests library is not included with the `python3.8` [runtime](lambda-runtimes.md), so you install it to a `package` directory\. - -You'll learn how to: -+ Set up the directory structure of a deployment package \(\.zip file\)\. -+ Create a deployment package for a Lambda function with runtime dependencies\. -+ Use the AWS CLI to upload the deployment package and create the Lambda function\. -+ Invoke the Lambda function to return the source code\. - -### Create the deployment package - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -Create the \.zip file that Lambda uses as your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: - - ``` - mkdir my-sourcecode-function - ``` - -1. Navigate to the `my-sourcecode-function` project directory\. - - ``` - cd my-sourcecode-function - ``` - -1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: - - ``` - import requests - def main(event, context): - response = requests.get("https://www.test.com/") - print(response.text) - return response.text - if __name__ == "__main__": - main('', '') - ``` - - Your directory structure should look like this: - - ``` - my-sourcecode-function$ - | lambda_function.py - ``` - -1. Install the requests library to a new `package` directory\. - - ``` - pip install --target ./package requests - ``` - -1. Create a deployment package with the installed library at the root\. - - ``` - cd package - zip -r ../my-deployment-package.zip . - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: chardet/ (stored 0%) - adding: chardet/enums.py (deflated 58%) - ... - ``` - -1. Add the `lambda_function.py` file to the root of the zip file\. - - ``` - cd .. - zip -g my-deployment-package.zip lambda_function.py - ``` - -### Create the Lambda function - -Lambda needs to know the [runtime](lambda-runtimes.md) environment to use for your function's code, the [handler](python-handler.md) in your function code, and the [execution role](lambda-intro-execution-role.md) that it can use to invoke your function\. - -Create the Lambda function using the execution role and deployment package that you created in the previous steps\. - -**To create the function** - -1. Navigate to the `my-sourcecode-function` project directory\. - - ``` - cd my-sourcecode-function - ``` - -1. Create a function named `my-sourcecode-function`\. Substitute the value for `role` with the `Arn` you copied in previous steps\. - - ``` - aws lambda create-function --function-name my-sourcecode-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.main --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex - ``` - - This command produces the following output: - - ``` - { - "FunctionName": "my-sourcecode-function", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:my-sourcecode-function", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "lambda_function.main", - "CodeSize": 753, - "Description": "", - "Timeout": 3, - "MemorySize": 128, - "LastModified": "2021-01-11T18:39:44.847+0000", - "CodeSha256": "82RtIE7p1ET5Od6bk4xSleJbUybUnZX52m92x/fEH84=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "589e5115-f3c0-446c-bc62-4e05cf0a3c85", - "State": "Active", - "LastUpdateStatus": "Successful" - } - ``` - - The Lambda function in this step uses a function handler of `lambda_function.main`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -### Invoke the Lambda function - -Invoke the Lambda function [synchronously](invocation-sync.md) using the event input defined for the sample code\. For more information, see [How it works](python-handler.md#python-handler-how) in **AWS Lambda function handler in Python**\. - -**To invoke the function** -+ Use the [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command\. - - ``` - aws lambda invoke \ - --function-name my-sourcecode-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - - This command produces the following output: - - ``` - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - ``` - - For the `RequestResponse` invocation type, the status code is `200`\. For more information, see the [Invoke](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_ResponseSyntax) API reference\. - - You should see the source code in `output.txt`\. - -### What's next? -+ Learn how to update your Lambda function, see [Updating a Lambda function in Python 3\.8](python-package-update.md)\. -+ Learn how to show logging events for your Lambda function, see [AWS Lambda function logging in Python](python-logging.md)\. -+ Explore other [AWS SDK examples in Python on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/python/example_code/lambda)\. - -### Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** -+ Use the [delete\-function](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-function.html) command\. - - ``` - aws lambda delete-function --function-name my-function - ``` - - This command produces no output\. - -**To delete the execution role policy** -+ Use the [delete\-policy](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-policy.html) command\. - - ``` - aws iam delete-role-policy --role-name lambda-ex --policy-name AWSLambdaBasicExecutionRole - ``` - -**To delete the execution role** -+ Use the [delete\-role](https://docs.aws.amazon.com/cli/latest/reference/iam/delete-role.html) command\. - - ``` - aws iam delete-role --role-name lambda-ex - ``` \ No newline at end of file diff --git a/doc_source/python-package-update.md b/doc_source/python-package-update.md deleted file mode 100644 index b94099d2..00000000 --- a/doc_source/python-package-update.md +++ /dev/null @@ -1,215 +0,0 @@ -# Updating a Lambda function in Python 3\.8 - -This tutorial guides you through the process of installing a Python library, creating a deployment package, and updating a Lambda function in Python 3\.8 using the AWS Command Line Interface \(AWS CLI\)\. - -The following steps assume that you have created a Lambda function and are updating the \.zip file used as your deployment package\. If you haven't created a function yet, see [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md)\. - -**Topics** -+ [Prerequisites](#python-package-update-prereqs) -+ [Updating a function without runtime dependencies](#python-package-update-codeonly) -+ [Updating a function with runtime dependencies](#python-package-update-dependencies) -+ [Using a virtual environment](#python-package-update-venv) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Updating a function without runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - -The following steps show how to create a deployment package that contains only your function code, and upload it to Lambda using the AWS CLI\. - -**To update a Python function without runtime dependencies** - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function$ zip my-deployment-package.zip lambda_function.py - ``` - -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 815, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "d1e983e3-ca8e-434b-8dc1-7add83d72ebd", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -## Updating a function with runtime dependencies - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. The steps assume that you are not using a virtual environment\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with dependencies** - -1. Install libraries in a `package` directory with `pip`'s `--target` option\. - - ``` - ~/my-function$ pip install --target ./package requests - ``` -**Note** -To prevent `distutils` errors on [Debian\-based systems](https://github.com/pypa/pip/issues/3826) such as Ubuntu, you may need to pass the `--system` option\. - -1. Navigate to the `package` directory\. - - ``` - cd package - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - ~/my-function$ zip -r ../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. - -1. Navigate back to the `my-function` directory\. - - ``` - cd .. - ``` - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [update\-function\-code](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html) command with the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 2269409, - "CodeSha256": "GcZ05oeHoJi61VpQj7vCLPs8DwCXmX5sE/fE2IHsizc=", - "Version": "$LATEST", - "RevisionId": "a9c05ffd-8ad6-4d22-b6cd-d34a00c1702c", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. - -## Using a virtual environment - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - - For more information, see [What is a runtime dependency?](python-package.md#python-package-dependencies)\. - - The following steps show how to install the [requests](https://pypi.org/project/requests/) library, create a deployment package, and upload it to Lambda using the AWS CLI\. It also assumes that your function code uses Python 3\.8 and the [`python3.8` Lambda runtime](lambda-runtimes.md)\. - -**Note** -If you are creating a deployment package used in a layer, see [Including library dependencies in a layer](configuration-layers.md#configuration-layers-path)\. - -**To update a Python function with a virtual environment** - -1. Activate the virtual environment\. For example: - - ``` - ~/my-function$ source myvenv/bin/activate - ``` - -1. Install libraries with pip\. - - ``` - (myvenv) ~/my-function$ pip install requests - ``` - -1. Deactivate the virtual environment\. - - ``` - (myvenv) ~/my-function$ deactivate - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - ~/my-function$cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. -**Tip** -A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -1. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) prefix to upload the binary \.zip file to Lambda and update the function code\. - - ``` - ~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 5912988, - "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", - "Version": "$LATEST", - "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", - ... - } - ``` - -The Lambda function in this step uses a function handler of `lambda_function.lambda_handler`\. For more information about function handler naming conventions, see [Naming](python-handler.md#naming) in **AWS Lambda function handler in Python**\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index cf4e4866..2fc0a040 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,7 +1,7 @@ # Deploy Python Lambda functions with \.zip file archives **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. @@ -13,19 +13,21 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. +**Note** +A python package may contain initialization code in the \_\_init\_\_\.py file\. Prior to Python 3\.9, Lambda did not run the \_\_init\_\_\.py code for packages in the function handler’s directory or parent directories\. In Python 3\.9 and later releases, Lambda runs the init code for packages in these directories during initialization\. +Note that Lambda runs the init code only when the execution environment is first initialized, not for each function invocation in that intialized environment\. **Topics** + [Prerequisites](#python-package-prereqs) + [What is a runtime dependency?](#python-package-dependencies) -+ [Tutorial: Creating a Lambda function in Python 3\.8](python-package-create.md) -+ [Updating a Lambda function in Python 3\.8](python-package-update.md) ++ [Deployment package with no dependencies](#python-package-create-package-no-dependency) ++ [Deployment package with dependencies](#python-package-create-package-with-dependency) ++ [Using a virtual environment](#python-package-update-venv) ++ [Deploy your \.zip file to the function](#python-package-upload-code) ## Prerequisites -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) +You need the AWS Command Line Interface \(AWS CLI\) to call service API operations\. To install the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the AWS Command Line Interface User Guide\. ## What is a runtime dependency? @@ -33,8 +35,185 @@ A [deployment package](gettingstarted-package.md) is required to create or updat A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. -The following example describes a Lambda function without runtime dependencies: -+ If your function's code is in Python 3\.8, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the `python3.8` runtime\. -+ If your function's code depends only on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with the `python3.8` runtime\. +The following describes a Lambda function without runtime dependencies: ++ If your function's code is in Python 3\.8 or later, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the Python runtime\. ++ If your function's code depends on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with Python3\.8 and later runtimes\. + +Note: Lambda periodically updates the Boto3 libraries to enable the latest set of features and security updates\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + +## Deployment package with no dependencies + +Create the \.zip file for your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: + + ``` + mkdir my-math-function + ``` + +1. Navigate to the `my-math-function` project directory\. + + ``` + cd my-math-function + ``` + +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: + + ``` + my-math-function$ + | lambda_function.py + ``` + +1. Add the `lambda_function.py` file to the root of the \.zip file\. + + ``` + zip my-deployment-package.zip lambda_function.py + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: lambda_function.py (deflated 50%) + ``` + +## Deployment package with dependencies + +Create the \.zip file for your deployment package\. + +**To create the deployment package** + +1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: + + ``` + mkdir my-sourcecode-function + ``` + +1. Navigate to the `my-sourcecode-function` project directory\. + + ``` + cd my-sourcecode-function + ``` + +1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: + + ``` + import requests + def main(event, context): + response = requests.get("https://www.test.com/") + print(response.text) + return response.text + if __name__ == "__main__": + main('', '') + ``` + + Your directory structure should look like this: + + ``` + my-sourcecode-function$ + | lambda_function.py + ``` + +1. Install the requests library to a new `package` directory\. + + ``` + pip install --target ./package requests + ``` + +1. Create a deployment package with the installed library at the root\. + + ``` + cd package + zip -r ../my-deployment-package.zip . + ``` + + This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: + + ``` + adding: chardet/ (stored 0%) + adding: chardet/enums.py (deflated 58%) + ... + ``` + +1. Add the `lambda_function.py` file to the root of the zip file\. + + ``` + cd .. + zip -g my-deployment-package.zip lambda_function.py + ``` + +## Using a virtual environment + +**To update a Python function using a virtual environment** + +1. Activate the virtual environment\. For example: + + ``` + ~/my-function$ source myvenv/bin/activate + ``` + +1. Install libraries with pip\. + + ``` + (myvenv) ~/my-function$ pip install requests + ``` + +1. Deactivate the virtual environment\. + + ``` + (myvenv) ~/my-function$ deactivate + ``` + +1. Create a deployment package with the installed libraries at the root\. + + ``` + ~/my-function$cd myvenv/lib/python3.8/site-packages + zip -r ../../../../my-deployment-package.zip . + ``` + + The last command saves the deployment package to the root of the `my-function` directory\. +**Tip** +A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. + +1. Add function code files to the root of your deployment package\. + + ``` + ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ + ~/my-function$ zip -g my-deployment-package.zip lambda_function.py + ``` + + After you complete this step, you should have the following directory structure: + + ``` + my-deployment-package.zip$ + │ lambda_function.py + │ __pycache__ + │ certifi/ + │ certifi-2020.6.20.dist-info/ + │ chardet/ + │ chardet-3.0.4.dist-info/ + ... + ``` + +## Deploy your \.zip file to the function + +To deploy the new code to your function, you upload the new \.zip file deployment package\. You can use the [Lambda console](configuration-function-zip.md#configuration-function-update) to upload a \.zip file to the function, or you can use the [UpdateFunctionCode](API_UpdateFunctionCode.md) CLI command\. + +The following example uploads a file named my\-deployment\-package\.zip\. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) file prefix to upload the binary \.zip file to Lambda\. -For a complete list of AWS SDKs, see [Tools to Build on AWS](http://aws.amazon.com/tools/)\. \ No newline at end of file +``` +~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip + { + "FunctionName": "mylambdafunction", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", + "Runtime": "python3.8", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "lambda_function.lambda_handler", + "CodeSize": 5912988, + "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", + "Version": "$LATEST", + "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", + ... + } +``` \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 57dcf1ac..d83fb5a0 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,13 +1,13 @@ # Instrumenting Python code in AWS Lambda **Note** -End of support for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 0e87f7b6..eaf8e0ea 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -57,7 +57,7 @@ A `4xx` series error indicates an error that the invoking client or service can **`5xx`** A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. -For a complete list of invocation errors, see [Invoke API Errors](API_Invoke.md#API_Invoke_Errors)\. +For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. ## Using the Lambda console diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 45a3011b..72a40323 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -14,7 +14,14 @@ The workflow for a function defined as a container image includes these steps: 1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. -1. [Create](configuration-images.md) the Lambda function and deploy the image\. +1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. + +**Topics** ++ [AWS base images for Ruby](#ruby-image-base) ++ [Using a Ruby base image](#ruby-image-instructions) ++ [Ruby runtime interface clients](#ruby-image-clients) ++ [Create a Ruby image from an AWS base image](#ruby-image-create) ++ [Deploy the container image](#ruby-image-deploy) ## AWS base images for Ruby @@ -48,7 +55,7 @@ For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. -## Deploying Ruby with an AWS base image +## Create a Ruby image from an AWS base image When you build a container image for Ruby using an AWS base image, you only need to copy the ruby app to the container and install any dependencies\. @@ -87,4 +94,8 @@ When you build a container image for Ruby using an AWS base image, you only need CMD [ "app.LambdaFunction::Handler.process" ] ``` -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. \ No newline at end of file +1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. + +## Deploy the container image + +For a new function, you deploy the Ruby image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 3ee0dbba..9a31503b 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -103,7 +103,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend intrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index baa12817..0d124cc1 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -10,8 +10,6 @@ To create the deployment package for a \.zip file archive, you can use a built\- For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. -This section describes how to create a \.zip file as your deployment package, and then use the \.zip file to deploy your function code to Lambda using the AWS Command Line Interface \(AWS CLI\)\. - **Topics** + [Prerequisites](#ruby-package-prereqs) + [Tools and libraries](#ruby-package-libraries) diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index df3ebaa3..e1da11a2 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -4,7 +4,7 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize La The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. -[images/sample-errorprocessor-servicemap-l.png](images/sample-errorprocessor-servicemap-l.png) +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index b44d706a..0ae9240f 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -9,7 +9,7 @@ In phase 2, which starts at least 30 days after the start of phase 1, you can no Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. **Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime starts on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. The following runtimes have reached or are scheduled for end of support: @@ -38,4 +38,4 @@ In almost all cases, the end\-of\-life date of a language version or operating s + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 09fccb9a..0b670b5b 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -15,7 +15,7 @@ The function's runtime and each external extension are processes that run within ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md index 2c973af3..371cc746 100644 --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -58,8 +58,6 @@ Initialization counts towards billed execution time and timeout\. When an execut REPORT RequestId: f8ac1208... Init Duration: 48.26 ms Duration: 237.17 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 26 MB ``` -![\[Initialization time in an X-Ray trace.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/runtimes-custom-init.png) - While it runs, a runtime uses the [Lambda runtime interface](runtimes-api.md) to manage incoming events and report errors\. After completing initialization tasks, the runtime processes incoming events in a loop\. In your runtime code, perform the following steps in order\. **Processing tasks** diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index e98d8c92..21057e3d 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -15,6 +15,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support extensions: + Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.9 \(`python3.9`\) + Python 3\.8 \(`python3.8`\) + Python 3\.7 \(`python3.7`\) + Ruby 2\.7 \(`ruby2.7`\) @@ -36,7 +37,7 @@ For example extensions and wrapper scripts, see [AWS Lambda Extensions](https:// ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index 9f42c839..ce22aa51 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -12,7 +12,7 @@ AWS provides a set of open\-source base images that you can use\. You can also u You can use one of the AWS base images for Lambda to build the container image for your function code\. The base images are preloaded with a language runtime and other components required to run a container image on Lambda\. You add your function code and dependencies to the base image and then package it as a container image\. -AWS will maintain and regularly update these images\. In addition, AWS will release an AWS base images when any new managed runtime becomes available\. +AWS will maintain and regularly update these images\. In addition, AWS will release AWS base images when any new managed runtime becomes available\. Lambda provides base images for the following runtimes: + [Node\.js](nodejs-image.md) diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 024979c1..a571dd38 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -146,6 +146,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: + Node\.js 14\.x + Node\.js 12\.x + Node\.js 10\.x ++ Python 3\.9 + Python 3\.8 + Ruby 2\.7 + Java 11 diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md index 38688e57..792a6905 100644 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -2,8 +2,6 @@ The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank.png) - Variants of this sample application are available for the following languages: **Variants** @@ -72,8 +70,6 @@ The sample application doesn't include an Amazon SQS queue to send events, but u The sample application's resources are defined in an AWS CloudFormation template and deployed with the AWS CLI\. The project includes simple shell scripts that automate the process of setting up, deploying, invoking, and tearing down the application\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-blank-stack.png) - The application template uses an AWS Serverless Application Model \(AWS SAM\) resource type to define the model\. AWS SAM simplifies template authoring for serverless applications by automating the definition of execution roles, APIs, and other resources\. The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. @@ -168,9 +164,7 @@ The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/a ## Instrumentation with the AWS X\-Ray -The sample function is configured for tracing with [AWS X\-Ray](https://console.aws.amazon.com/xray/home)\. With the tracing mode set to active, Lambda records timing information for a subset of invocations and sends it to X\-Ray\. X\-Ray processes the data to generate a *service map* that shows a client node and two service nodes: - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap-basic.png) +The sample function is configured for tracing with [AWS X\-Ray](https://console.aws.amazon.com/xray/home)\. With the tracing mode set to active, Lambda records timing information for a subset of invocations and sends it to X\-Ray\. X\-Ray processes the data to generate a *service map* that shows a client node and two service nodes\. The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. @@ -188,12 +182,8 @@ const lambda = new AWS.Lambda() Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-servicemap.png) - The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-trace.png) - You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. ## Dependency management with layers diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md index 67e825cc..efac9def 100644 --- a/doc_source/samples-errorprocessor.md +++ b/doc_source/samples-errorprocessor.md @@ -2,8 +2,6 @@ The Error Processor sample application demonstrates the use of AWS Lambda to handle events from an [Amazon CloudWatch Logs subscription](services-cloudwatchlogs.md)\. CloudWatch Logs lets you invoke a Lambda function when a log entry matches a pattern\. The subscription in this application monitors the log group of a function for entries that contain the word `ERROR`\. It invokes a processor Lambda function in response\. The processor function retrieves the full log stream and trace data for the request that caused the error, and stores them for later use\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor.png) - Function code is available in the following files: + Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/random-error/index.js) + Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/processor/index.js) @@ -64,13 +62,9 @@ The processor function uses information from the CloudWatch Logs event to downlo ## Instrumentation with AWS X\-Ray -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the random error function generating errors for some requests\. It also shows the processor function calling X\-Ray, CloudWatch Logs, and Amazon S3\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -The two Node\.js functions are configured for active tracing in the template, and are instrumented with the AWS X\-Ray SDK for Node\.js in code\. With active tracing, Lambda tags adds a tracing header to incoming requests and sends a trace with timing details to X\-Ray\. Additionally, the random error function uses the X\-Ray SDK to record the request ID and user information in annotations\. The annotations are attached to the trace, and you can use them to locate the trace for a specific request\. +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-trace.png) +The two Node\.js functions are configured for active tracing in the template, and are instrumented with the AWS X\-Ray SDK for Node\.js in code\. With active tracing, Lambda tags adds a tracing header to incoming requests and sends a trace with timing details to X\-Ray\. Additionally, the random error function uses the X\-Ray SDK to record the request ID and user information in annotations\. The annotations are attached to the trace, and you can use them to locate the trace for a specific request\. The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md index 7225177f..bcff6ee1 100644 --- a/doc_source/samples-listmanager.md +++ b/doc_source/samples-listmanager.md @@ -2,8 +2,6 @@ The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png) - Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: @@ -94,14 +92,10 @@ When it's decoded, the data contains a record\. The function uses the record to ## Instrumentation with AWS X\-Ray -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The following service map shows the function communicating with two DynamoDB tables and a MySQL database\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-servicemap.png) +The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/listmanager-trace.png) - The function uses the AWS SDK for JavaScript in Node\.js to read and write to two tables for each record\. The primary table stores the current state of each combination of list name and user\. The aggregate table stores lists that combine data from multiple users\. ## AWS CloudFormation templates and additional resources diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 0da22207..54f85687 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -29,11 +29,11 @@ For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.a You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* customer master keys \(CMKs\)\. If you don't configure a customer managed key, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. ++ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* CMKs\. For functions that do not have a configured customer managed CMK, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. + **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. +Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index 21dd686a..95765510 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -52,7 +52,7 @@ IAM roles with temporary credentials are useful in the following situations: + **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. + **Cross\-service access** – Some AWS services use features in other AWS services\. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3\. A service might do this using the calling principal's permissions, using a service role, or using a service\-linked role\. + **Principal permissions** – When you use an IAM user or role to perform actions in AWS, you are considered a principal\. Policies grant permissions to a principal\. When you use some services, you might perform an action that then triggers another action in a different service\. In this case, you must have permissions to perform both actions\. To see whether an action requires additional dependent actions in a policy, see [Actions, Resources, and Condition Keys for AWS Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) in the *Service Authorization Reference*\. - + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. Service roles provide access only within your account and cannot be used to grant access to services in other accounts\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. + **Service\-linked role** – A service\-linked role is a type of service role that is linked to an AWS service\. The service can assume the role to perform an action on your behalf\. Service\-linked roles appear in your IAM account and are owned by the service\. An IAM administrator can view, but not edit the permissions for service\-linked roles\. + **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM role to grant permissions to applications running on Amazon EC2 instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md index 00003eb3..0484b839 100644 --- a/doc_source/security-infrastructure.md +++ b/doc_source/security-infrastructure.md @@ -1,6 +1,6 @@ # Infrastructure security in AWS Lambda -As a managed service, AWS Lambda is protected by the AWS global network security procedures that are described in the [Amazon Web Services: Overview of security processes](https://d0.awsstatic.com/whitepapers/Security/AWS_Security_Whitepaper.pdf) whitepaper\. +As a managed service, AWS Lambda is protected by the AWS global network security procedures that are described in the [ Best Practices for Security, Identity, and Compliance](http://aws.amazon.com/architecture/security-identity-compliance/)\. You use AWS published API calls to access Lambda through the network\. Clients must support Transport Layer Security \(TLS\) 1\.0 or later\. We recommend TLS 1\.2 or later\. Clients must also support cipher suites with perfect forward secrecy \(PFS\) such as Ephemeral Diffie\-Hellman \(DHE\) or Elliptic Curve Ephemeral Diffie\-Hellman \(ECDHE\)\. Most modern systems such as Java 7 and later support these modes\. diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md index 0aa543bb..4e9450c7 100644 --- a/doc_source/security-resilience.md +++ b/doc_source/security-resilience.md @@ -8,6 +8,6 @@ In addition to the AWS global infrastructure, Lambda offers several features to + **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. + **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [Lambda function scaling](invocation-scaling.md)\. + **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -+ **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. ++ **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. + **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. -+ **Dead\-letter queue** – For asynchronous invocations, you can configure Lambda to send requests to a dead\-letter queue if all retries fail\. A dead\-letter queue is an Amazon SNS topic or Amazon SQS queue that receives events for troubleshooting or reprocessing\. For details, see [AWS Lambda function dead\-letter queues](invocation-async.md#dlq)\. \ No newline at end of file ++ **Dead\-letter queue** – For asynchronous invocations, you can configure Lambda to send requests to a dead\-letter queue if all retries fail\. A dead\-letter queue is an Amazon SNS topic or Amazon SQS queue that receives events for troubleshooting or reprocessing\. For details, see [Dead\-letter queues](invocation-async.md#invocation-dlq)\. \ No newline at end of file diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md index a2daed09..855ce6b5 100644 --- a/doc_source/services-alexa.md +++ b/doc_source/services-alexa.md @@ -3,8 +3,9 @@ You can use Lambda functions to build services that give new skills to Alexa, the Voice assistant on Amazon Echo\. The Alexa Skills Kit provides the APIs, tools, and documentation to create these new skills, powered by your own services running as Lambda functions\. Amazon Echo users can access these new skills by asking Alexa questions or making requests\. The Alexa Skills Kit is available on GitHub\. -+ [Alexa Skills Kit SDK for Node\.js ](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) + [Alexa Skills Kit SDK for Java](https://github.com/alexa/alexa-skills-kit-sdk-for-java) ++ [Alexa Skills Kit SDK for Node\.js ](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) ++ [Alexa Skills Kit SDK for Python](https://github.com/alexa/alexa-skills-kit-sdk-for-python) **Example Alexa smart home event** diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md index 58b86895..2ae4edde 100644 --- a/doc_source/services-apigateway-blueprint.md +++ b/doc_source/services-apigateway-blueprint.md @@ -16,16 +16,17 @@ Follow the steps in this section to create a new Lambda function and an API Gate 1. Choose **Create Lambda function**\. -1. Choose **Blueprint**\. +1. Choose **Use a blueprint**\. -1. Enter **microservice** in the search bar\. Choose the **microservice\-http\-endpoint** blueprint and then choose **Configure**\. +1. Enter **microservice** in the search bar\. Choose the **microservice\-http\-endpoint** blueprint\. -1. Configure the following settings\. +1. Configure your function with the following settings\. + **Name** – **lambda\-microservice**\. + **Role** – **Create a new role from AWS policy templates**\. + **Role name** – **lambda\-apigateway\-role**\. + **Policy templates** – **Simple microservice permissions**\. - + **API** – **Create a new API**\. + + **API** – **Create an API**\. + + **API Type** – **HTTP API**\. + **Security** – **Open**\. Choose **Create function**\. @@ -36,11 +37,11 @@ A proxy resource has an `AWS_PROXY` integration type and a catch\-all method `AN ## Test sending an HTTP request -In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets) +In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets)\. **To test the API** -1. With your `lambda-microservice` function still open in the console, choose the **Test** tab\. +1. With your `lambda-microservice` function still open in the Lambda console, choose the **Test** tab\. 1. Choose **New event**\. @@ -59,6 +60,18 @@ In this step, you will use the console to test the Lambda function\. In addition } ``` -1. After entering the text above choose **Create event**\. + This `GET` command scans your DynamoDB table and returns all items found\. -1. Choose the event that you created and choose **Invoke**\. \ No newline at end of file +1. After entering the text above choose **Test**\. + +Verify that the test succeeded\. In the function response, you should see the following: + +``` +{ + "statusCode": "200", + "body": "{\"Items\":[],\"Count\":0,\"ScannedCount\":0}", + "headers": { + "Content-Type": "application/json" + } +} +``` \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 58b5bfdb..6459ae67 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -29,8 +29,8 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an + **Rule** – **Create a new rule**\. + **Rule name** – **CheckWebsiteScheduledEvent**\. + **Rule description** – **CheckWebsiteScheduledEvent trigger**\. + + **Rule type** – **Schedule expression**\. + **Schedule expression** – **rate\(1 minute\)**\. - + **Enabled** – True \(checked\)\. + **Environment variables** + **site** – **https://docs\.aws\.amazon\.com/lambda/latest/dg/welcome\.html**\. + **expected** – **What is AWS Lambda?**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 030e742a..8c773506 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -1,5 +1,8 @@ # Using AWS Lambda with Amazon CloudWatch Events +**Note** +Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. + [Amazon CloudWatch events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchEvents.html) help you to respond to state changes in your AWS resources\. When your resources change state, they automatically send events into an event stream\. You can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. CloudWatch Events invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md index 5b41419f..d19a6f3f 100644 --- a/doc_source/services-ec2-tutorial.md +++ b/doc_source/services-ec2-tutorial.md @@ -4,8 +4,6 @@ You can use the AWS SDK for \.NET to manage Amazon EC2 spot instances with C\# c This tutorial provides code that performs these tasks and a sample application that you can run locally or on AWS\. It includes a sample project that you can deploy to AWS Lambda's \.NET Core 2\.1 runtime\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot.png) - For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\. @@ -280,12 +278,8 @@ View the logs and trace information to see the spot request ID and sequence of c To view the service map, open the [Service map page](https://console.aws.amazon.com/xray/home#/service-map) in the X\-Ray console\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-servicemap.png) - Choose a node in the service map and then choose **View traces** to see a list of traces\. Choose a trace from the list to see the timeline of calls that the function made to Amazon EC2\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-timeline.png) - ## Clean up The code provided in this tutorial is designed to create and delete spot instance requests, and to terminate the instances that they launch\. However, if an error occurs, the requests and instances might not be cleaned up automatically\. View the spot requests and instances in the Amazon EC2 console\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md new file mode 100644 index 00000000..1c80121c --- /dev/null +++ b/doc_source/services-s3-object-lambda.md @@ -0,0 +1,5 @@ +# Transforming S3 Objects with S3 Object Lambda + +With S3 Object Lambda you can add your own code to Amazon S3 GET requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. + +For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index c509f9e0..210cff81 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -2,8 +2,6 @@ You can use AWS X\-Ray to visualize the components of your application, identify performance bottlenecks, and troubleshoot requests that resulted in an error\. Your Lambda functions send trace data to X\-Ray, and X\-Ray processes the data to generate a service map and searchable trace summaries\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. @@ -40,13 +38,9 @@ The `Overhead` subsegment represents the phase that occurs between the time when **Note** -If your Lambda function uses [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), your X\-Ray trace might display a function initialization with a very long duration\. +If your Lambda function uses [provisioned concurrency](provisioned-concurrency.md), your X\-Ray trace might display a function initialization with a very long duration\. Provisioned concurrency initializes function instances in advance, to reduce lag at the time of invocation\. Over time, provisioned concurrency refreshes these instances by creating new instances to replace the old ones\. For workloads with steady traffic, the new instances are initialized well in advance of their first invocation\. The time gap gets recorded in the X\-Ray trace as the initialization duration\. -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - **Important** In Lambda, you can use the X\-Ray SDK to extend the `Invocation` subsegment with additional subsegments for downstream calls, annotations, and metadata\. You can't access the function segment directly or record work done outside of the handler invocation scope\. diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index d0f78cc5..0f426b7a 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -16,4 +16,4 @@ Retry the function invocation\. If the retry fails, validate that the files requ **Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* -Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. +Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index e0776c69..afdc6aef 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -23,7 +23,7 @@ For more information, see [AWS Lambda permissions](lambda-permissions.md)\. When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. -For more information, see [Monitoring the state of a function with the Lambda API](functions-states.md)\. +For more information, see [Lambda function states](functions-states.md)\. ## Lambda: Function is stuck in Pending @@ -64,8 +64,8 @@ Lambda uses a simple probabilistic model to distribute the traffic between the t **Issue:** *You see cold starts after enabling provisioned concurrency\.* -When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: -+ [Check that provisioned concurrency is enabled](configuration-concurrency.md#configuration-concurrency-provisioned) on the function version or alias\. +When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](provisioned-concurrency.md), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: ++ [Check that provisioned concurrency is enabled](provisioned-concurrency.md) on the function version or alias\. **Note** Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. + Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index 6b72a4eb..fa3f7d21 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -17,6 +17,7 @@ The following [Lambda runtimes](lambda-runtimes.md) support extensions: + Node\.js 14\.x \(`nodejs14.x`\) + Node\.js 12\.x \(`nodejs12.x`\) + Node\.js 10\.x \(`nodejs10.x`\) ++ Python 3\.9 \(`python3.9`\) + Python 3\.8 \(`python3.8`\) + Python 3\.7 \(`python3.7`\) + Ruby 2\.7 \(`ruby2.7`\) @@ -39,7 +40,7 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](configuration-concurrency.md#configuration-concurrency-provisioned)\. ++ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. + `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 31bb5ad9..d8b66f15 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -2,8 +2,6 @@ In this tutorial, you create a simple Android mobile application that uses Amazon Cognito to get credentials and invokes a Lambda function\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambda-android.png) - The mobile application retrieves AWS credentials from an Amazon Cognito identity pool and uses them to invoke a Lambda function with an event that contains request data\. The function processes the request and returns a response to the front\-end\. ## Prerequisites diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 0287e764..bbd900f8 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -79,7 +79,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -152,7 +152,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) @@ -324,19 +324,15 @@ An increasing trend in iterator age can indicate issues with your function\. For Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. -Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -### Tumbling windows - -Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. +Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. ### Aggregation and processing -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: -**Example `TimeWindowEventReponse` values** +**Example `TimeWindowEventResponse` values** ``` { @@ -349,7 +345,7 @@ Your user managed function is invoked both for aggregation and for processing th ``` **Note** -For Java functions, we recommend using a Map to represent the state\. +For Java functions, we recommend using a `Map` to represent the state\. At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index ef7a8d36..fafa324b 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -15,20 +15,38 @@ For an example of how to use self\-managed Kafka as an event source, see [Using Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. ``` -{ "eventSource": "aws:kafka", - "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", - "records": { - "mytopic-0": [ - { - "topic": "mytopic" - "partition": "0", - "offset": 15, - "timestamp": 1545084650987, - "timestampType": "CREATE_TIME", - "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - } +{ + "eventSource":"aws:SelfManagedKafka", + "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", + "records":{ + "mytopic-0":[ + { + "topic":"mytopic", + "partition":"0", + "offset":15, + "timestamp":1545084650987, + "timestampType":"CREATE_TIME", + "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "headers":[ + { + "headerKey":[ + 104, + 101, + 97, + 100, + 101, + 114, + 86, + 97, + 108, + 117, + 101 + ] + } + ] + } ] - } + } } ``` @@ -114,10 +132,10 @@ Lambda supports several methods to authenticate with your self\-managed Apache K If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. + SASL/SCRAM - With Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication, the cluster encrypts the credentials using SSL encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + SASL/PLAIN - With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. + Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. @@ -194,7 +212,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Using a VPC @@ -211,7 +229,7 @@ aws lambda create-event-source-mapping "abc2.xyz.com:9092"]}}' ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Viewing the status using the AWS CLI @@ -226,11 +244,11 @@ aws lambda get-event-source-mapping When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -Lambda reads event data from the Kafka topics that you specify in [ `Topics`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-Topics) based on the starting position that you specify in [ `StartingPosition`](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-StartingPosition)\. After successful processing, your Kafka topic is committed to your Kafka cluster\. +Lambda reads event data from the Kafka topics that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `Topics` based on the starting position that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `StartingPosition`\. After successful processing, your Kafka topic is committed to your Kafka cluster\. If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. -Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize), until the function catches up with the topic\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) >`BatchSize`, until the function catches up with the topic\. If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. @@ -251,7 +269,7 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index 23fbf996..ef3459c1 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -1,8 +1,6 @@ # Tutorial: Using AWS Lambda with Amazon Kinesis -In this tutorial, you create a Lambda function to consume events from a Kinesis stream\. The following diagram illustrates the application flow: - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/kinesis-pull-10.png) +In this tutorial, you create a Lambda function to consume events from a Kinesis stream\. 1. Custom app writes records to the stream\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 1bfce67b..58861b70 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -59,7 +59,7 @@ If your function returns an error, Lambda retries the batch until processing suc You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. For more information, see [ New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -167,7 +167,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) @@ -342,19 +342,15 @@ An increasing trend in iterator age can indicate issues with your function\. For Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. -Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with windowing enabled, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -### Tumbling windows - -Lambda functions can aggregate data using tumbling windows: distinct time windows that open and close at regular intervals\. Tumbling windows enable you to process streaming data sources through contiguous, non\-overlapping time windows\. +Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. ### Aggregation and processing -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. You can also process records and return a new state, which is passed in the next invocation\. Lambda returns a `TimeWindowEventResponse` in JSON in the following format: +Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: -**Example `TimeWindowEventReponse` values** +**Example `TimeWindowEventResponse` values** ``` { @@ -367,7 +363,7 @@ Your user managed function is invoked both for aggregation and for processing th ``` **Note** -For Java functions, we recommend using a Map to represent the state\. +For Java functions, we recommend using a `Map` to represent the state\. At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index d047239c..b0a3db67 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -38,7 +38,7 @@ Lambda will pull messages until it has processed a maximum of 6 MB, until timeou **Note** The maximum function invocation time is 14 minutes\. -You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing concurrency for a Lambda function](configuration-concurrency.md)\. +You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. **Example Amazon MQ record events** @@ -82,9 +82,9 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { "eventSource": "aws:rmq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:pizzaBroker:b-9bcfa592-423a-4942-879d-eb284b418fc8", "rmqMessagesByQueue": { - "test::/": [ + "pizzaQueue::/": [ { "basicProperties": { "contentType": "text/plain", @@ -132,7 +132,7 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut } } ``` -In the RabbitMQ example, `test` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `test::/`\. +In the RabbitMQ example, `pizzaQueue` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `pizzaQueue::/`\. ## Execution role permissions @@ -182,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 3ae31b37..01414df9 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -4,7 +4,7 @@ Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. @@ -13,20 +13,38 @@ Lambda allows a function to run for up to 14 minutes before stopping it\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. ``` -{ "eventSource": "aws:kafka", - "eventSourceArn": "arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", - "records": { - "mytopic-0": [ - { - "topic": "mytopic" - "partition": "0", - "offset": 15, - "timestamp": 1545084650987, - "timestampType": "CREATE_TIME", - "value": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - } +{ + "eventSource":"aws:kafka", + "eventSourceArn":"arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", + "records":{ + "mytopic-0":[ + { + "topic":"mytopic", + "partition":"0", + "offset":15, + "timestamp":1545084650987, + "timestampType":"CREATE_TIME", + "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", + "headers":[ + { + "headerKey":[ + 104, + 101, + 97, + 100, + 101, + 114, + 86, + 97, + 108, + 117, + 101 + ] + } + ] + } ] - } + } } ``` @@ -76,7 +94,7 @@ By default, IAM users and roles do not have permission to perform Amazon MSK API ### Using SASL/SCRAM authentication -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. Note that Amazon MSK does not support SASL/PLAIN authentication\. @@ -151,7 +169,7 @@ aws lambda create-event-source-mapping \ --function-name my-kafka-function ``` -For more information, see the [CreateEventSourceMapping](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html) API reference documentation\. +For more information, see the API reference documentation\. #### Viewing the status using the AWS CLI diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 0d23320b..1df57f0d 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -207,4 +207,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the subscription you created\. -1. Choose **Delete**, **Delete**\. +1. Choose **Delete**, **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 037e18ea..c063c40f 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -1,6 +1,6 @@ -# Tutorial: Using AWS Lambda with Amazon Simple Queue Service +# Tutorial: Using Lambda with Amazon SQS -In this tutorial, you create a Lambda function to consume messages from an [Amazon SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/Welcome.html) queue\. +In this tutorial, you create a Lambda function that consumes messages from an [Amazon Simple Queue Service \(Amazon SQS\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html) queue\. ## Prerequisites @@ -24,11 +24,11 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 ## Create the execution role -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +Create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. **To create an execution role** -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the AWS Identity and Access Management \(IAM\) console\. 1. Choose **Create role**\. @@ -37,14 +37,14 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your func + **Permissions** – **AWSLambdaSQSQueueExecutionRole**\. + **Role name** – **lambda\-sqs\-role**\. -The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and write logs to CloudWatch Logs\. +The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. ## Create the function -The following example shows how to process each Amazon SQS message in the event input\. See [Using AWS Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) for an example of an event with multiple messages\. In the example, the code writes each message to a log in CloudWatch Logs\. +Create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. **Note** -For sample code in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. +For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. **Example index\.js** @@ -59,8 +59,10 @@ exports.handler = async function(event, context) { ``` **To create the function** +**Note** +Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. -1. Copy the sample code into a file named `index.js`\. +1. Save the code example as a file named `index.js`\. 1. Create a deployment package\. @@ -68,7 +70,7 @@ exports.handler = async function(event, context) { zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. +1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. ``` aws lambda create-function --function-name ProcessSQSRecord \ @@ -78,11 +80,11 @@ exports.handler = async function(event, context) { ## Test the function -Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command and a sample Amazon Simple Queue Service event\. +Invoke your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. -If the handler returns normally without exceptions, Lambda considers the message processed successfully and begins reading new messages in the queue\. Once a message is processed successfully, it is automatically deleted from the queue\. If the handler throws an exception, Lambda considers the input of messages as not processed and invokes the function with the same batch of messages\. +If the handler returns normally without exceptions, Lambda considers the message successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. -1. Copy the following JSON into a file and save it as `input.txt`\. +1. Save the following JSON as a file named `input.txt`\. ``` { @@ -107,7 +109,9 @@ If the handler returns normally without exceptions, Lambda considers the message } ``` -1. Run the following `invoke` command\. + The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. + +1. Run the following `invoke` AWS CLI command\. ``` aws lambda invoke --function-name ProcessSQSRecord \ @@ -116,7 +120,7 @@ If the handler returns normally without exceptions, Lambda considers the message The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. -1. Verify the output in the `outputfile.txt` file\. +1. Verify the output in the file `outputfile.txt`\. ## Create an Amazon SQS queue @@ -124,43 +128,43 @@ Create an Amazon SQS queue that the Lambda function can use as an event source\. **To create a queue** -1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. - -1. In the Amazon SQS console, create a queue\. - -1. Write down or otherwise record the identifying queue ARN \(Amazon Resource Name\)\. You need this in the next step when you associate the queue with your Lambda function\. +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -Create an event source mapping in AWS Lambda\. This event source mapping associates the Amazon SQS queue with your Lambda function\. After you create this event source mapping, AWS Lambda starts polling the queue\. +1. Choose **Create queue**, and then configure the queue\. For detailed instructions, see [Creating an Amazon SQS queue \(console\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) in the *Amazon Simple Queue Service Developer Guide*\. -Test the end\-to\-end experience\. As you perform queue updates, Amazon Simple Queue Service writes messages to the queue\. AWS Lambda polls the queue, detects new records and invokes your Lambda function on your behalf by passing events, in this case Amazon SQS messages, to the function\. +1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. ## Configure the event source -To create a mapping between the specified Amazon SQS queue and the Lambda function, run the following AWS CLI `create-event-source-mapping` command\. After the command runs, write down or otherwise record the UUID\. You'll need this UUID to refer to the event source mapping in any other commands, for example, if you choose to delete the event source mapping\. +To create a mapping between your Amazon SQS queue and your Lambda function, run the following `create-event-source-mapping` AWS CLI command\. ``` aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` -You can get the list of event source mappings by running the following command\. +To get a list of your event source mappings, run the following command\. ``` aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue ``` -The list returns all of the event source mappings you created, and for each mapping it shows the `LastProcessingResult`, among other things\. This field is used to provide an informative message if there are any problems\. Values such as `No records processed` \(indicates that AWS Lambda has not started polling or that there are no records in the queue\) and `OK` \(indicates AWS Lambda successfully read records from the queue and invoked your Lambda function\) indicate that there no issues\. If there are issues, you receive an error message\. - ## Test the setup Now you can test the setup as follows: -1. In the Amazon SQS console, send messages to the queue\. Amazon SQS writes records of these actions to the queue\. +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose the name of the queue that you created earlier\. + +1. Choose **Send and receive messages**\. + +1. Under **Message body**, enter a test message\. -1. AWS Lambda polls the queue and when it detects updates, it invokes your Lambda function by passing in the event data it finds in the queue\. +1. Choose **Send message**\. -1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. +Lambda polls the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. ## Clean up your resources diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index d1eba474..4d89b8bd 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda invokes your function as soon as records are available in the SQS queue\. Lambda will poll up to 10 messages in your queue at once and will send that batch to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. @@ -85,7 +85,7 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) -+ [Tutorial: Using AWS Lambda with Amazon Simple Queue Service](with-sqs-example.md) ++ [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) @@ -146,7 +146,9 @@ Lambda supports the following options for Amazon SQS event sources\. Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. + **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. Set your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. +**Note** +If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, your effective queue visibility timeout will be `(batch window) + (function timeout) + 30s`\. Lambda processes up to 5 batches at a time\. This means there are a maximum of 5 workers available to batch and process messages in parallel at any one time\. Each worker will show a distinct Lambda invocation for its current batch of messages\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. @@ -161,7 +163,7 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) From 640845bd869baabd7086201321bef3a4c1497e84 Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Thu, 30 Sep 2021 16:48:59 +0000 Subject: [PATCH 133/243] Documentation for new feature: Lambda functions on Graviton2 --- doc_source/API_CreateEventSourceMapping.md | 22 +- doc_source/API_CreateFunction.md | 21 +- doc_source/API_FunctionConfiguration.md | 11 +- doc_source/API_GetFunction.md | 1 + doc_source/API_GetFunctionConfiguration.md | 11 +- doc_source/API_GetLayerVersion.md | 7 + doc_source/API_GetLayerVersionByArn.md | 7 + doc_source/API_LayerVersionsListItem.md | 7 + doc_source/API_ListFunctions.md | 1 + doc_source/API_ListLayerVersions.md | 9 +- doc_source/API_ListLayers.md | 9 +- doc_source/API_ListVersionsByFunction.md | 1 + doc_source/API_PublishLayerVersion.md | 15 + doc_source/API_PublishVersion.md | 11 +- doc_source/API_UpdateEventSourceMapping.md | 16 + doc_source/API_UpdateFunctionCode.md | 19 +- doc_source/API_UpdateFunctionConfiguration.md | 11 +- doc_source/applications-tutorial.md | 2 +- doc_source/best-practices.md | 2 +- doc_source/configuration-envvars.md | 94 +-- doc_source/configuration-function-common.md | 3 + doc_source/configuration-function-zip.md | 120 +++- doc_source/configuration-images.md | 41 +- doc_source/configuration-layers.md | 57 +- doc_source/configuration-vpc.md | 2 +- doc_source/csharp-exceptions.md | 14 +- doc_source/csharp-image.md | 16 +- doc_source/csharp-package.md | 3 + doc_source/deploying-lambda-apps.md | 3 +- doc_source/foundation-arch.md | 76 +++ doc_source/functions-states.md | 2 +- doc_source/gettingstarted-concepts.md | 11 +- doc_source/gettingstarted-limits.md | 2 +- doc_source/gettingstarted-package.md | 44 +- doc_source/go-image.md | 9 +- doc_source/golang-exceptions.md | 14 +- doc_source/images-create.md | 10 +- doc_source/images-test.md | 34 +- doc_source/index.md | 160 ++--- doc_source/invocation-async.md | 4 +- doc_source/invocation-eventsourcemapping.md | 10 +- doc_source/invocation-images.md | 2 +- doc_source/invocation-layers.md | 25 + doc_source/invocation-scaling.md | 4 +- doc_source/java-exceptions.md | 14 +- doc_source/java-image.md | 9 +- doc_source/lambda-csharp.md | 8 +- doc_source/lambda-foundation.md | 4 +- doc_source/lambda-functions.md | 2 +- doc_source/lambda-golang.md | 6 +- doc_source/lambda-images.md | 4 + doc_source/lambda-invocation.md | 5 +- doc_source/lambda-java.md | 10 +- doc_source/lambda-nodejs.md | 10 +- doc_source/lambda-powershell.md | 8 +- doc_source/lambda-python.md | 14 +- doc_source/lambda-releases.md | 5 +- doc_source/lambda-ruby.md | 8 +- doc_source/lambda-runtimes.md | 64 +- doc_source/lambda-services.md | 167 +++--- doc_source/logging-using-cloudtrail.md | 3 + doc_source/monitoring-code-profiler.md | 3 + doc_source/monitoring-insights.md | 2 +- doc_source/nodejs-exceptions.md | 14 +- doc_source/nodejs-image.md | 9 +- doc_source/nodejs-package.md | 1 + doc_source/powershell-devenv.md | 2 +- doc_source/powershell-exceptions.md | 16 +- doc_source/python-exceptions.md | 14 +- doc_source/python-image.md | 37 +- doc_source/python-package.md | 1 + doc_source/ruby-exceptions.md | 14 +- doc_source/ruby-image.md | 9 +- doc_source/ruby-package.md | 1 + doc_source/runtimes-avx2.md | 3 + doc_source/runtimes-images.md | 3 + doc_source/security-dataprotection.md | 14 +- doc_source/services-apigateway-tutorial.md | 563 ++++++++---------- doc_source/services-apigateway.md | 2 +- .../services-cloudwatchevents-expressions.md | 2 +- .../services-cloudwatchevents-tutorial.md | 8 +- doc_source/services-cloudwatchevents.md | 22 +- doc_source/services-ec2.md | 8 +- doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-rds-tutorial.md | 2 +- doc_source/services-rds.md | 2 +- doc_source/troubleshooting-deployment.md | 2 +- doc_source/troubleshooting-execution.md | 44 +- doc_source/troubleshooting-images.md | 36 ++ doc_source/with-ddb-example.md | 2 +- doc_source/with-ddb.md | 35 +- doc_source/with-kafka.md | 21 +- doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 36 +- doc_source/with-mq.md | 28 +- doc_source/with-s3-example.md | 2 +- doc_source/with-s3-tutorial.md | 2 +- ...th-scheduledevents-example-use-app-spec.md | 2 +- doc_source/with-sns-example.md | 2 +- doc_source/with-sns.md | 2 +- doc_source/with-sqs-cross-account-example.md | 234 ++++++++ doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 34 +- 103 files changed, 1665 insertions(+), 859 deletions(-) create mode 100644 doc_source/foundation-arch.md create mode 100644 doc_source/with-sqs-cross-account-example.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index c16ceb8e..66941c8f 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -2,13 +2,13 @@ Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. -For details about each event source type, see the following topics\. -+ [ Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) -+ [ Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Configuring an Amazon SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) -+ [ Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) -+ [ Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [ Configuring Self\-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) +For details about how to configure different event sources, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. @@ -17,6 +17,14 @@ The following error handling options are only available for stream sources \(Dyn + `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\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. +For information about which configuration parameters apply to each event source, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) + ## Request Syntax ``` diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 45fcf6b0..0bfba5c1 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -4,7 +4,7 @@ Creates a Lambda function\. To create a function, you need a [deployment package You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. -You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. +You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. If you do not specify the architecture, the default value is `x86-64`\. When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. @@ -25,6 +25,7 @@ POST /2015-03-31/functions HTTP/1.1 Content-type: application/json { + "Architectures": [ "string" ], "Code": { "ImageUri": "string", "S3Bucket": "string", @@ -84,6 +85,13 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. + ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** +The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ Code ](#API_CreateFunction_RequestSyntax) ** The code for the function\. Type: [ FunctionCode ](API_FunctionCode.md) object @@ -213,6 +221,7 @@ HTTP/1.1 201 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -291,6 +300,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_CreateFunction_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -339,7 +354,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -366,7 +381,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 3f9d6178..2896643e 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -4,6 +4,13 @@ Details about a function's configuration\. ## Contents + ** Architectures ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** CodeSha256 ** The SHA256 hash of the function's deployment package\. Type: String @@ -62,7 +69,7 @@ Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object Required: No ** KMSKeyArn ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No @@ -95,7 +102,7 @@ Type: Array of [ Layer ](API_Layer.md) objects Required: No ** MasterArn ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md index 1335cd85..5e0c4c28 100644 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -50,6 +50,7 @@ Content-type: application/json "ReservedConcurrentExecutions": number }, "Configuration": { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index b3307f36..e6d676ba 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -42,6 +42,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -120,6 +121,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_GetFunctionConfiguration_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -168,7 +175,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -195,7 +202,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md index b32f1a07..16ddd063 100644 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -33,6 +33,7 @@ HTTP/1.1 200 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -56,6 +57,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_GetLayerVersion_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md index fcbd7e96..8bb8a9d9 100644 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -29,6 +29,7 @@ HTTP/1.1 200 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -52,6 +53,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_GetLayerVersionByArn_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md index 38f30a79..06495845 100644 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -4,6 +4,13 @@ Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/la ## Contents + ** CompatibleArchitectures ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` +Required: No + ** CompatibleRuntimes ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md index ebce0f00..06195eff 100644 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -45,6 +45,7 @@ Content-type: application/json { "Functions": [ { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md index 29e89342..76259787 100644 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,17 +1,21 @@ # ListLayerVersions -Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. +Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. ## Request Syntax ``` -GET /2018-10-31/layers/LayerName/versions?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 +GET /2018-10-31/layers/LayerName/versions?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 ``` ## URI Request Parameters The request uses the following URI parameters\. + ** [ CompatibleArchitecture ](#API_ListLayerVersions_RequestSyntax) ** +The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` @@ -42,6 +46,7 @@ Content-type: application/json { "LayerVersions": [ { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "CreatedDate": "string", "Description": "string", diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md index 6aa4022b..a95db624 100644 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,17 +1,21 @@ # ListLayers -Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. +Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. ## Request Syntax ``` -GET /2018-10-31/layers?CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 +GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 ``` ## URI Request Parameters The request uses the following URI parameters\. + ** [ CompatibleArchitecture ](#API_ListLayers_RequestSyntax) ** +The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` @@ -37,6 +41,7 @@ Content-type: application/json "Layers": [ { "LatestMatchingVersion": { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "CreatedDate": "string", "Description": "string", diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md index a82e1aed..ad35ed08 100644 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -45,6 +45,7 @@ Content-type: application/json "NextMarker": "string", "Versions": [ { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md index cbbeb2c9..2c9adb46 100644 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -11,6 +11,7 @@ POST /2018-10-31/layers/LayerName/versions HTTP/1.1 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "S3Bucket": "string", @@ -37,6 +38,13 @@ Required: Yes The request accepts the following data in JSON format\. + ** [ CompatibleArchitectures ](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. Type: Array of strings @@ -71,6 +79,7 @@ HTTP/1.1 201 Content-type: application/json { + "CompatibleArchitectures": [ "string" ], "CompatibleRuntimes": [ "string" ], "Content": { "CodeSha256": "string", @@ -94,6 +103,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ CompatibleArchitectures ](#API_PublishLayerVersion_ResponseSyntax) ** +A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Type: Array of strings +Array Members: Maximum number of 2 items\. +Valid Values:` x86_64 | arm64` + ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index dc6a4d58..12c42030 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -62,6 +62,7 @@ HTTP/1.1 201 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -140,6 +141,12 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_PublishVersion_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -188,7 +195,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -215,7 +222,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 8d4f4782..09a0dcd3 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -2,6 +2,14 @@ Updates an event source mapping\. You can change the function that AWS Lambda invokes, or pause invocation and resume later from the same location\. +For details about how to configure different event sources, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) + The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. @@ -9,6 +17,14 @@ The following error handling options are only available for stream sources \(Dyn + `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\. + `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. +For information about which configuration parameters apply to each event source, see the following topics\. ++ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) ++ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) ++ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) ++ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) ++ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) ++ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) + ## Request Syntax ``` diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index dd684e92..1547566f 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -14,6 +14,7 @@ PUT /2015-03-31/functions/FunctionName/code HTTP/1.1 Content-type: application/json { + "Architectures": [ "string" ], "DryRun": boolean, "ImageUri": "string", "Publish": boolean, @@ -45,6 +46,13 @@ Required: Yes The request accepts the following data in JSON format\. + ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** +The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` +Required: No + ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean @@ -96,6 +104,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -174,6 +183,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_UpdateFunctionCode_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -222,7 +237,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -249,7 +264,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index a2cb4777..a32e845b 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -166,6 +166,7 @@ HTTP/1.1 200 Content-type: application/json { + "Architectures": [ "string" ], "CodeSha256": "string", "CodeSize": number, "DeadLetterConfig": { @@ -244,6 +245,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [ Architectures ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. +Type: Array of strings +Array Members: Fixed number of 1 item\. +Valid Values:` x86_64 | arm64` + ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String @@ -292,7 +299,7 @@ The function's image configuration values\. Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed CMK\. +The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` @@ -319,7 +326,7 @@ The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configurat Type: Array of [ Layer ](API_Layer.md) objects ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the master function\. +For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 197c620b..5f7c9b22 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -6,7 +6,7 @@ In this tutorial, you create the following resources\. + **Application** – A Node\.js Lambda function, build specification, and AWS Serverless Application Model \(AWS SAM\) template\. + **Pipeline** – An AWS CodePipeline pipeline that connects the other resources to enable continuous delivery\. + **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Trigger** – An Amazon CloudWatch Events rule that watches the main branch of the repository and triggers the pipeline\. ++ **Trigger** – An Amazon EventBridge \(CloudWatch Events\) rule that watches the main branch of the repository and triggers the pipeline\. + **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare the application template for deployment\. + **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the processed AWS SAM template from the build output, and deploy the new version with AWS CloudFormation\. + **Bucket** – An Amazon Simple Storage Service \(Amazon S3\) bucket for deployment artifact storage\. diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 0a9fe11f..0cc90bf8 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -62,7 +62,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ## Working with streams -+ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. [BatchSize](API_CreateEventSourceMapping.md#SSS-CreateEventSourceMapping-request-BatchSize) controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. ++ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 6a130191..9c9bcbff 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -207,34 +207,71 @@ The sample values shown reflect the latest runtimes\. The presence of specific v ## Securing environment variables -Lambda encrypts environment variables with a key that it creates in your account \(an AWS managed customer master key \(CMK\)\)\. Use of this key is free\. You can also choose to provide your own key for Lambda to use instead of the default key\. +For securing your environment variables, you can use server\-side encryption to protect your data at rest and client\-side encryption to protect your data in transit\. -When you provide the key, only users in your account with access to the key can view or manage environment variables on the function\. Your organization might also have internal or external requirements to manage keys that are used for encryption and to control when they're rotated\. +**Note** +To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. -**To use a customer managed CMK** +**Security at rest** +Lambda always provides server\-side encryption at rest with an AWS KMS key\. By default, Lambda uses an AWS managed key\. If this default behavior suits your workflow, you don't need to set anything else up\. Lambda creates the AWS managed key in your account and manages permissions to it for you\. AWS doesn't charge you to use this key\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +If you prefer, you can provide an AWS KMS customer managed key instead\. You might do this to have control over rotation of the KMS key or to meet the requirements of your organization for managing KMS keys\. When you use a customer managed key, only users in your account with access to the KMS key can view or manage environment variables on the function\. -1. Choose a function\. +Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS produt pages*\. -1. Choose **Configuration**, then choose **Environment variables**\. +**Security in transit** +For additional security, you can enable helpers for encryption in transit, which ensures that your environment variables are encrypted client\-side for protection in transit\. -1. Under **Environment variables**, choose **Edit**\. +**To configure encryption for your environment variables** + +1. Use the AWS Key Management Service \(AWS KMS\) to create any customer managed keys for Lambda to use for server\-side and client\-side encryption\. For more information, see [Creating keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) in the *[AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/)*\. + +1. Using the Lambda console, navigate to the **Edit environment variables** page\. + + 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + + 1. Choose a function\. + + 1. Choose **Configuration**, then choose **Environment variables** from the left navigation bar\. -1. Expand **Encryption configuration**\. + 1. In the **Environment variables** section, choose **Edit**\. -1. Choose **Use a customer master key**\. + 1. Expand **Encryption configuration**\. -1. Choose your customer managed CMK\. +1. Optionally, enable console encryption helpers to use client\-side encryption to protect your data in transit\. + + 1. Under **Encryption in transit**, choose **Enable helpers for encryption in transit**\. + + 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next ot the environment variable\. + + 1. Under AWS KMS key to encrypt in transit, choose a customer managed key that you created at the beginning of this procedure\. + + 1. Choose **Execution role policy** and copy the policy\. This policy grants permission to your function's execution role to decrypt the environment variables\. + + Save this policy to use in the last step of this procedure\. + + 1. Add code to your function that decrypts the environment variables\. Choose **Decrypt secrets snippet** to see an example\. + +1. Optionally, specify your customer managed key for encryption at rest\. + + 1. Choose **Use a customer master key**\. + + 1. Choose a customer managed key that you created at the beginning of this procedure\. 1. Choose **Save**\. -Customer managed CMKs incur standard [AWS KMS charges](https://aws.amazon.com/kms/pricing/)\. +1. Set up permissions\. + + If you're using a customer managed key with server\-side encryption, grant permissions to any AWS Identity and Access Management \(IAM\) users or roles that you want to be able to view or manange environment variables on the function\. For more information, see [Managing permissions to your server\-side encryption KMS key](#managing-permissions-to-your-server-side-encryption-key)\. -No AWS KMS permissions are required for your user or the function's execution role to use the default encryption key\. To use a customer managed CMK, you need permission to use the key\. Lambda uses your permissions to create a grant on the key\. This allows Lambda to use it for encryption\. + If you're enabling client\-side encryption for security in transit, your function needs permission to call the `kms:Decrypt` API operation\. Add the policy that you saved previously in this procedure to the function's [execution role](lambda-intro-execution-role.md)\. + +### Managing permissions to your server\-side encryption KMS key + +No AWS KMS permissions are required for your user or the function's execution role to use the default encryption key\. To use a customer managed key, you need permission to use the key\. Lambda uses your permissions to create a grant on the key\. This allows Lambda to use it for encryption\. + `kms:ListAliases` – To view keys in the Lambda console\. -+ `kms:CreateGrant`, `kms:Encrypt` – To configure a customer managed CMK on a function\. -+ `kms:Decrypt` – To view and manage environment variables that are encrypted with a customer managed CMK\. ++ `kms:CreateGrant`, `kms:Encrypt` – To configure a customer managed key on a function\. ++ `kms:Decrypt` – To view and manage environment variables that are encrypted with a customer managed key\. You can get these permissions from your user account or from a key's resource\-based permissions policy\. `ListAliases` is provided by the [managed policies for Lambda](access-control-identity-based.md)\. Key policies grant the remaining permissions to users in the **Key users** group\. @@ -260,34 +297,7 @@ Users without `Decrypt` permissions can still manage functions, but they can't v ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/env-accessdenied.png) -For details on managing key permissions, see [Using key policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)\. - -You can also encrypt environment variable values on the client side before sending them to Lambda, and decrypt them in your function code\. This obscures secret values in the Lambda console and API output, even for users who have permission to use the key\. In your code, you retrieve the encrypted value from the environment and decrypt it by using the AWS KMS API\. - -**To encrypt environment variables on the client side** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration**, then choose **Environment variables**\. - -1. Under **Environment variables**, choose **Edit**\. - -1. Expand **Encryption configuration**\. - -1. Choose **Enable helpers for encryption in transit**\. - -1. Choose **Encrypt** next to a variable to encrypt its value\. - -1. Choose **Save**\. - -**Note** -When you use the console encryption helpers, your function needs permission to call the `kms:Decrypt` API operation in its [execution role](lambda-intro-execution-role.md)\. - -To view sample code for your function's language, choose **Code** next to an environment variable\. The sample code shows how to retrieve an environment variable in a function and decrypt its value\. - -Another option is to store passwords in AWS Secrets Manager secrets\. You can reference the secret in your AWS CloudFormation templates to set passwords on databases\. You can also set the value of an environment variable on the Lambda function\. For an example, see the next section\. +For details on managing key permissions, see [Using key policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide\. ## Sample code and templates diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index a62fe9f9..1c963dc4 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -95,6 +95,9 @@ You can configure the memory of your function in the Lambda console\. If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. +**Note** +Compute Optimizer supports only functions that use x86\_64 architecture\. + When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. **To accept a function memory recommendation** diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md index 32fa7a5e..5e4ed1d7 100644 --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -1,8 +1,8 @@ # Creating Lambda functions defined as \.zip file archives -When you create a Lambda function, you package your function code into a [deployment package](gettingstarted-package.md)\. Lambda supports two types of deployment packages: [container images](configuration-images.md) and \.zip file archives\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function depends on the deployment package type\. To configure a function defined as a container image, see [Creating Lambda functions defined as container images](configuration-images.md)\. -You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. +You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. **Note** You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. @@ -11,7 +11,8 @@ You cannot convert an existing container image function to use a \.zip file arch + [Creating a function \(console\)](#configuration-function-create) + [Using the console code editor](#configuration-functions-console-update) + [Updating function code \(console\)](#configuration-function-update) -+ [Configuring runtime settings \(console\)](#configuration-function-runtime) ++ [Change the runtime or runtime version \(console\)](#configuration-function-runtime) ++ [Change the architecture \(console\)](#configuration-function-arch) + [Using the Lambda API](#configuration-function-api) + [AWS CloudFormation](#configuration-function-cloudformation) @@ -33,6 +34,8 @@ When you create a function defined with a \.zip file archive, you choose a code 1. For **Runtime**, choose the language version to use for your function\. + 1. \(Optional\) For **Architecture**, choose the instruction set architecture to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + 1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. You can create a new **Execution role** or use an existing role\. 1. \(Optional\) Expand **Advanced settings**\. You can choose a **Code signing configuration** for the function\. You can also configure an \(Amazon VPC\) for the function to access\. @@ -52,7 +55,7 @@ When you save your function code, the Lambda console creates a \.zip file archiv ## Updating function code \(console\) -For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. To add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. You can upload the zip archive from your local machine\. If the \.zip archive is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. +For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. If the code is larger than 3MB, or if you need to add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. If the \.zip file archive is smaller than 50 MB, you can upload the \.zip file archive from your local machine\. If the file is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. **To upload function code as a \.zip archive** @@ -62,19 +65,56 @@ For scripting languages \(Node\.js, Python, and Ruby\), you can edit your functi 1. Under **Code source**, choose **Upload from**\. -1. Choose **\.zip file** and then choose **Upload**\. +1. Choose **\.zip file**, and then choose **Upload**\. - 1. In the file chooser, select the new image version and choose **Open**, then choose **Save**\. + 1. In the file chooser, select the new image version, choose **Open**, and then choose **Save**\. 1. \(Alternative to step 4\) Choose **Amazon S3 location**\. 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. -## Configuring runtime settings \(console\) +## Change the runtime or runtime version \(console\) + +If you update the function configuration to use a new runtime version, you may need to update the function code to be compatible with the new version\. If you update the function configuration to use a different runtime, you **must** provide new function code that is compatible with the runtime and architecture\. For instructions on how to create a deployment package for the function code, see the handler page for the runtime that the function uses\. + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -When you create a function that uses a \.zip file deployment package, you must specify the runtime to use and the name of the function handler\. +------ +#### [ C\# ] -**To update the runtime settings** + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ + +**To change the runtime or runtime version** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -86,6 +126,65 @@ When you create a function that uses a \.zip file deployment package, you must s 1. For **Handler**, specify file name and handler for your function\. + 1. For **Architecture**, choose the instruction set architecture to use for your function\. + +1. Choose **Save**\. + +## Change the architecture \(console\) + +Before you can change the instruction set architecture, you need to ensure that your function's code is compatible with the target architecture\. + +If you use Node\.js, Python, or Ruby and you edit your function code in the embedded [editor](foundation-console.md#code-editor), the existing code may run without modification\. + +However, if you provide your function code using a \.zip file archive deployment package, you must prepare a new \.zip file archive that is compiled and built correctly for the target runtime and instruction\-set architecture\. For instructions, see the handler page for your function runtime\. + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ + +**To change the instruction set architecture** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to update and choose the **Code** tab\. + +1. Under **Runtime settings**, choose **Edit**\. + +1. For **Architecture**, choose the instruction set architecture to use for your function\. + 1. Choose **Save**\. ## Using the Lambda API @@ -103,4 +202,5 @@ In the `AWS::Lambda::Function` resource, set the following properties to create + AWS::Lambda::Function + PackageType – Set to `Zip`\. + Code – Enter the Amazon S3 bucket name and \.zip file name in the `S3Bucket` and `S3Key`fields\. For Node\.js or Python, you can provide inline source code of your Lambda function\. - + Runtime – Set the runtime value\. \ No newline at end of file + + Runtime – Set the runtime value\. + + Architecture – Set the architecture value to `arm64` to use the AWS Graviton2 processor\. By default, the architecture value is `x86_64`\. \ No newline at end of file diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index e980dd4e..e0159494 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -1,6 +1,6 @@ # Creating Lambda functions defined as container images -When you create a Lambda function, you use a [deployment package](gettingstarted-package.md) to deploy your function code\. Lambda supports two types of deployment packages: [\.zip file archives](configuration-function-zip.md) and container images\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function is different depending on the deployment package type\. To configure a function defined as a \.zip file archive, see [Creating Lambda functions defined as \.zip file archives](configuration-function-zip.md)\. You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. @@ -85,28 +85,33 @@ To create a function defined as a container image, you must first [create the im 1. For **Function name**, enter the function name\. - 1. For **Container image URI**, enter the Amazon ECR image URI\. + 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. + + You can enter the Amazon ECR image URI or browse for the Amazon ECR image\. + + Enter the Amazon ECR image URI\. + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. - 1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: - + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: +1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: + + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: - ``` - "/usr/bin/npx", "aws-lambda-ric" - ``` - + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: + ``` + "/usr/bin/npx", "aws-lambda-ric" + ``` + + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: - ``` - "app.handler" - ``` - + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: + ``` + "app.handler" + ``` + + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: - ``` - "/var/task" - ``` + ``` + "/var/task" + ``` **Note** For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. +1. \(Optional\) For **Architecture**, choose the instruction set architecture for the function\. The default architecture is x86\_64\. Note: when you build the container image for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + 1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. 1. Choose **Create function**\. @@ -154,7 +159,11 @@ To manage functions defined as container images, use the following API operation + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. Note that you must create the function from the same account as the container registry in Amazon EFS\. +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. + +When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. + + Note that you must create the function from the same account as the container registry in Amazon ECR\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index 76a659bf..bdff631f 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -22,7 +22,9 @@ When you create a layer, you must bundle all its content into a \.zip file archi ## Compiling the \.zip file archive for your layer -You build your layer code into a \.zip file archive using the same procedure as you would for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. +You build your layer code into a \.zip file archive using the same procedure that you would use for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. + +When you create a layer, you can specify whether the layer is compatible with one or both of the instruction set architectures\. You may need to set specific compile flags to build a layer that is compatible with the `arm64` architecture\. One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. @@ -104,13 +106,43 @@ For more information about path settings in the Lambda execution environment, se ## Language\-specific instructions For language\-specific instructions on how to create a \.zip file archive, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ## Creating a layer @@ -132,6 +164,8 @@ Layers can have one or more version\. When you create a layer, Lambda sets the l + To upload a \.zip file from your computer, choose **Upload a \.zip file**\. Then, choose **Upload** to select your local \.zip file\. + To upload a file from Amazon S3, choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. +1. \(Optional\) For **Compatible instruction set architectures**, choose one value or both values\. + 1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. 1. \(Optional\) For **License**, enter any necessary license information\. @@ -140,12 +174,13 @@ Layers can have one or more version\. When you create a layer, Lambda sets the l **To create a layer \(API\)** -To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, and list of [runtimes](lambda-runtimes.md) that are compatible with the layer\. The list of runtimes is optional\. +To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, a list of [runtimes](lambda-runtimes.md) and a list of architectures that are compatible with the layer\. The runtimes and architecture parameters are optional\. ``` aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ --license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ --compatible-runtimes python3.6 python3.7 python3.8 + --compatible-architectures "arm64" "x86_64" ``` You should see output similar to the following: @@ -162,6 +197,10 @@ You should see output similar to the following: "Description": "My layer", "CreatedDate": "2018-11-14T23:03:52.894+0000", "Version": 1, + "CompatibleArchitectures": [ + "arm64", + "x86_64" + ], "LicenseInfo": "MIT", "CompatibleRuntimes": [ "python3.6", diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 829b2388..bb9b45ed 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -287,7 +287,7 @@ By default, Lambda runs your functions in a secure VPC with access to AWS servic **Note** Several AWS services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)\. You can use VPC endpoints to connect to AWS services from within a VPC without internet access\. -Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) +Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. An idle NAT gateway connection will [ time out after 350 seconds\.](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html#nat-gateway-troubleshooting-timeout) For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) ## VPC tutorials diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index 3d4ec84d..767bfdc4 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -153,19 +153,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index d8893f72..4a8b6105 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -1,12 +1,22 @@ # Deploy \.NET Lambda functions with container images -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your \.NET function: +You can deploy your Lambda function code as a [container image](images-create.md)\. + +**Note** +Lambda does not support arm64 architecture for \.NET runtimes\. + +AWS provides the following resources to help you build a container image for your \.NET function: + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index cf47126e..b616ac68 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -4,6 +4,9 @@ A \.NET Core deployment package \(\.zip file archive\) contains your function's Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. +**Note** +Lambda does not support arm64 architecture for \.NET runtimes\. + **Topics** + [\.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) \ No newline at end of file diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index 9e76814a..a8fcdf26 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -16,5 +16,4 @@ For more information about designing Lambda applications, see [Application desig + [Managing applications in the AWS Lambda console](applications-console.md) + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) -+ [Common Lambda application types and use cases](applications-usecases.md) -+ [Best practices for working with AWS Lambda functions](best-practices.md) \ No newline at end of file ++ [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md new file mode 100644 index 00000000..72c0156a --- /dev/null +++ b/doc_source/foundation-arch.md @@ -0,0 +1,76 @@ +# Lambda instruction set architectures + + The *instruction set architecture* of a Lambda function determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: ++ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. ++ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. + +## Advantages of using arm64 architecture + +Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. + +The Graviton2 CPU uses the Neoverse N1 core and supports Armv8\.2 \(including CRC and crypto extensions\) plus several other architectural extensions\. + +Graviton2 reduces memory read time by providing a larger L2 cache per vCPU, which improves the latency performance of web and mobile backends, microservices, and data processing systems\. Graviton2 also provides improved encryption performance and supports instruction sets that improve the latency of CPU\-based machine learning inference\. + +For more information about AWS Graviton2, see [AWS Graviton Processor](http://aws.amazon.com/ec2/graviton)\. + +## Function migration to arm64 architecture + +When you select a Lambda function to migrate to arm64 architecture, to ensure a smooth migration, make sure that your function meets the following requirements: ++ The function currently uses a Lambda Amazon Linux 2 runtime\. ++ The deployment package contains only open\-source components and source code that you control, so that you can make any necessary updates for the migration\. ++ If the function code includes third\-party dependencies, each library or package provides an arm64 version\. + +## Function code compatibility with arm64 architecture + +Your Lambda function code must be compatible with the instruction set architecture of the function\. Before you migrate a function to arm64 architecture, note the following points about the current function code: ++ If you added your function code using the embedded code editor, your code probably runs on either architecture without modification\. ++ If you uploaded your function code, you must upload new code that is compatible with your target architecture\. ++ If your function uses layers, you must [check each layer](invocation-layers.md#configuration-layers-finding) to ensure that it is compatible with the new architecture\. If a layer is not compatible, edit the function to replace the current layer version with a compatible layer version\. ++ If your function uses Lambda extensions, you must check each extension to ensure that it is compatible with the new architecture\. ++ If your function uses a container image deployment package type, you must create a new container image that is compatible with the architecture of the function\. + +## Suggested migration steps + + + +To migrate a Lambda function to the arm64 architecture, we recommend following these steps: + +1. Build the list of dependencies for your application or workload\. Common dependencies include: + + All the libraries and packages that the function uses\. + + The tools that you use to build, deploy, and test the function, such as compilers, test suites, continuous integration and continuous delivery \(CI/CD\) pipelines, provisioning tools, and scripts\. + + The Lambda extensions and third\-party tools that you use to monitor the function in production\. + +1. For each of the dependencies, check the version, and then check whether arm64 versions are available\. + +1. Build an environment to migrate your application\. + +1. Bootstrap the application\. + +1. Test and debug the application\. + +1. Test the performance of the arm64 function\. Compare the performance with the x86\_64 version\. + +1. Update your infrastructure pipeline to support arm64 Lambda functions\. + +1. Stage your deployment to production\. + + For example, use [alias routing configuration](configuration-aliases.md#configuring-alias-routing) to split traffic between the x86 and arm64 versions of the function, and compare the performance and latency\. + +For more information about how to create a code environment for arm64 architecture, including language\-specific information for Java, Go, \.NET, and Python, see the [Getting started with AWS Graviton](https://github.com/aws/aws-graviton-getting-started) GitHub repository\. + +## Configuring the instruction set architecture + +You can configure the instruction set architecture for new Lambda functions using the Lambda console, AWS SDKs, AWS Command Line Interface \(AWS CLI\), or AWS CloudFormation\. You can deploy the function code to Lambda with either a \.zip archive file or a container image deployment package\. + +Lambda provides the following runtimes for the arm64 architecture\. These runtimes all use the Amazon Linux 2 operating system\. ++ Node\.js 12, Node\.js 14 ++ Python 3\.8, Python 3\.9 ++ Java 8 \(AL2\), Java 11 ++ \.NET Core 3\.1 ++ Ruby 2\.7 ++ Custom Runtime on Amazon Linux 2 + +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 instruction set architecture\. You can use the custom runtime \(provided\.al2\) to run Go functions with arm64 architecture\. + +For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index 4a90a65a..a79655f9 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -8,7 +8,7 @@ Function states do not change the behavior of function invocations or how your f + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter with the [AWS SDK for Java API Reference](https://docs.aws.amazon.com/sdk-for-java/latest/reference/AWSLambdaWaiters.html)\. +Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. To view the function's state with the AWS CLI, use `get-function-configuration`\. diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 73a69950..f910270b 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -1,12 +1,13 @@ # Lambda concepts -Lambda runs instances of your function to process events\. To send events to your function, you can invoke it using the Lambda API, or you can configure an AWS service or resource to invoke it\. +Lambda runs instances of your function to process events\. You can invoke your function directly using the Lambda API, or you can configure an AWS service or resource to invoke your function\. **Topics** + [Function](#gettingstarted-concepts-function) + [Trigger](#gettingstarted-concepts-trigger) + [Event](#gettingstarted-concepts-event) + [Execution environment](#gettingstarted-concepts-ee) ++ [Instruction set architecture](#gettingstarted-concepts-arch) + [Deployment package](#gettingstarted-concepts-dp) + [Runtime](#gettingstarted-concepts-runtime) + [Layer](#gettingstarted-concepts-layer) @@ -64,6 +65,14 @@ An *execution environment* provides a secure and isolated runtime environment fo For more information, see [AWS Lambda execution environment](runtimes-context.md)\. +## Instruction set architecture + + The *instruction set architecture* determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: ++ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. ++ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. + +For more information, see [Lambda instruction set architectures](foundation-arch.md)\. + ## Deployment package You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index 68d60802..f19a906e 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -25,7 +25,7 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Resource | Quota | | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [timeout](configuration-function-common.md) | 900 seconds \(15 minutes\) | +| Function [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index f48a2107..73502536 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -45,13 +45,43 @@ The following steps demonstrate how to upload a \.zip file as your deployment pa ### Using the AWS CLI You can upload a \.zip file as your deployment package using the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ### Using Amazon S3 diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 39b72669..d1cb58d3 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 5f18cfbc..b3d6032e 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -71,19 +71,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md index d2337734..98a267a9 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -47,6 +47,8 @@ To deploy a container image to Lambda, note the following requirements: 1. Lambda supports only Linux\-based container images\. +1. Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. + ## Container image settings Lambda supports the following container image settings in the Dockerfile: @@ -67,7 +69,13 @@ When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sur ## Create an image from an AWS base image for Lambda -To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. +To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. Lambda provides two types of base images: ++ Multi\-architecture base image + + Specify one of the main image tags \(such as `python:3.9` or `java:11`\) to choose this type of image\. ++ Architecture\-specific base image + + Specify an image tag with an architecture suffix\. For example, specify `3.9-arm64` to choose the arm64 base image for Python 3\.9\. **Note** AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from Docker Hub\. To use the updated base image, you must rebuild your container image and [update the function code](configuration-images.md#configuration-images-update)\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 4ce6881d..3cf4ccd3 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -2,7 +2,7 @@ The AWS Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. -The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. +The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. Note that there are separate RIE components for the x86\-64 architecture and the arm64 architecture\. You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your Lambda function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, you can use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. @@ -19,7 +19,7 @@ For examples of how to use the RIE, see [Container image support for Lambda](htt Note the following guidelines when using the Runtime Interface Emulator: + The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. -+ The emulator supports only Linux x86\-64 architectures\. ++ Lambda provides an emulator for each of the instruction set architectures\. + The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. ## Environment variables @@ -41,7 +41,7 @@ The emulator does not populate the following Lambda environment variables\. Howe ## Test an image with RIE included in the image -The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps if you built the RIE into your alternative base image\. +The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps after you build the RIE into your alternative base image\. **To test your Lambda function with the emulator** @@ -69,7 +69,7 @@ The AWS base images for Lambda include the runtime interface emulator\. You can ## Build RIE into your base image -You can build RIE into a base image\. Download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. +You can build RIE into a base image\. The following steps show how to download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. **To build the emulator into your image** @@ -99,13 +99,25 @@ You can build RIE into a base image\. Download the RIE from GitHub to your local fi ``` -1. Download the [runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from GitHub into your project directory\. +1. Download the runtime interface emulator for your target architecture from GitHub into your project directory\. Lambda provides an emulator for each of the instruction set architectures\. + + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie) + + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie-arm64) -1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile: +1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile\. + + To use the default x86\-64 architecture: ``` COPY ./entry_script.sh /entry_script.sh - ADD aws-lambda-rie /usr/local/bin/aws-lambda-rie + ADD aws-lambda-rie-x86_64 /usr/local/bin/aws-lambda-rie + ENTRYPOINT [ "/entry_script.sh" ] + ``` + + To use the arm64 architecture: + + ``` + COPY ./entry_script.sh /entry_script.sh + ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie ENTRYPOINT [ "/entry_script.sh" ] ``` @@ -121,7 +133,7 @@ You install the runtime interface emulator to your local machine\. When you run **To test an image without adding RIE to the image** -1. From your project directory, run the following command to download the RIE from GitHub and install it on your local machine\. +1. From your project directory, run the following command to download the RIE \(x86\-64 architecture\) from GitHub and install it on your local machine\. ``` mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ @@ -129,6 +141,12 @@ You install the runtime interface emulator to your local machine\. When you run && chmod +x ~/.aws-lambda-rie/aws-lambda-rie ``` + To download the RIE for arm64 architecture, use the previous command with a different GitHub download url\. + + ``` + https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 \ + ``` + 1. Run your Lambda function using the `docker run` command\. ``` diff --git a/doc_source/index.md b/doc_source/index.md index 69d4573c..b74e136a 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -23,11 +23,11 @@ Amazon's trademarks and trade dress may not be used in + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + + [Lambda instruction set architectures](foundation-arch.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) - + [Lambda quotas](gettingstarted-limits.md) + [AWS Lambda permissions](lambda-permissions.md) + [AWS Lambda execution role](lambda-intro-execution-role.md) + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) @@ -60,15 +60,6 @@ Amazon's trademarks and trade dress may not be used in + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) - + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) - + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) - + [Sample function code](with-android-create-package.md) -+ [AWS Lambda applications](deploying-lambda-apps.md) - + [Managing applications in the AWS Lambda console](applications-console.md) - + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) - + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) - + [Common Lambda application types and use cases](applications-usecases.md) - + [Best practices for working with AWS Lambda functions](best-practices.md) + [Lambda runtimes](lambda-runtimes.md) + [Runtime support policy](runtime-support-policy.md) + [AWS Lambda execution environment](runtimes-context.md) @@ -83,75 +74,6 @@ Amazon's trademarks and trade dress may not be used in + [Using container images with Lambda](lambda-images.md) + [Creating Lambda container images](images-create.md) + [Testing Lambda container images locally](images-test.md) -+ [Using AWS Lambda with other services](lambda-services.md) - + [Using AWS Lambda with Alexa](services-alexa.md) - + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) - + [Tutorial: Using AWS Lambda with Amazon API Gateway](services-apigateway-tutorial.md) - + [Sample function code](services-apigateway-code.md) - + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) - + [AWS SAM template for an API Gateway application](services-apigateway-template.md) - + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) - + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) - + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) - + [Sample function code](with-cloudtrail-create-package.md) - + [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md) - + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) - + [AWS SAM template for a CloudWatch Events application](with-scheduledevents-example-use-app-spec.md) - + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) - + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) - + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) - + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) - + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) - + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) - + [Using AWS Lambda with Amazon Cognito](services-cognito.md) - + [Using AWS Lambda with AWS Config](services-config.md) - + [Using Lambda with Amazon Connect](services-connect.md) - + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) - + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) - + [Sample function code](with-ddb-create-package.md) - + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) - + [Using AWS Lambda with Amazon EC2](services-ec2.md) - + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) - + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) - + [Using AWS Lambda with an Application Load Balancer](services-alb.md) - + [Using Amazon EFS with Lambda](services-efs.md) - + [Using AWS Lambda with AWS IoT](services-iot.md) - + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) - + [Using Lambda with self-managed Apache Kafka](with-kafka.md) - + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) - + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) - + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) - + [Sample function code](with-kinesis-create-package.md) - + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) - + [Using AWS Lambda with Amazon Lex](services-lex.md) - + [Using Lambda with Amazon MQ](with-mq.md) - + [Using Lambda with Amazon MSK](with-msk.md) - + [Using AWS Lambda with Amazon RDS](services-rds.md) - + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) - + [Using AWS Lambda with Amazon S3](with-s3.md) - + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) - + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) - + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) - + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) - + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) - + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) - + [Using AWS Lambda with Amazon SES](services-ses.md) - + [Using Lambda with Amazon SNS](with-sns.md) - + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) - + [Sample function code](with-sns-create-package.md) - + [Using AWS Lambda with Amazon SQS](with-sqs.md) - + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) - + [Sample Amazon SQS function code](with-sqs-create-package.md) - + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) - + [Using AWS Lambda with AWS X-Ray](services-xray.md) -+ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) - + [State machine application patterns](stepfunctions-patterns.md) - + [Managing state machines in the Lambda console](stepfunctions-lc.md) - + [Orchestration examples with Step Functions](services-stepfunctions.md) -+ [Lambda sample applications](lambda-samples.md) - + [Blank function sample application for AWS Lambda](samples-blank.md) - + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) - + [List manager sample application for AWS Lambda](samples-listmanager.md) + [Building Lambda functions with Node.js](lambda-nodejs.md) + [AWS Lambda function handler in Node.js](nodejs-handler.md) + [Deploy Node.js Lambda functions with .zip file archives](nodejs-package.md) @@ -212,6 +134,69 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in PowerShell](powershell-context.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) + [AWS Lambda function errors in PowerShell](powershell-exceptions.md) ++ [Using AWS Lambda with other services](lambda-services.md) + + [Common Lambda application types and use cases](applications-usecases.md) + + [Using AWS Lambda with Alexa](services-alexa.md) + + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) + + [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) + + [Sample function code](services-apigateway-code.md) + + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) + + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + + [Sample function code](with-cloudtrail-create-package.md) + + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) + + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) + + [AWS SAM template for a EventBridge (CloudWatch Events) application](with-scheduledevents-example-use-app-spec.md) + + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) + + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) + + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) + + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) + + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) + + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) + + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + + [Using AWS Lambda with AWS Config](services-config.md) + + [Using Lambda with Amazon Connect](services-connect.md) + + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) + + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + + [Sample function code](with-ddb-create-package.md) + + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) + + [Using AWS Lambda with Amazon EC2](services-ec2.md) + + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) + + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + + [Using Amazon EFS with Lambda](services-efs.md) + + [Using AWS Lambda with AWS IoT](services-iot.md) + + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) + + [Using Lambda with self-managed Apache Kafka](with-kafka.md) + + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) + + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) + + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + + [Sample function code](with-kinesis-create-package.md) + + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) + + [Using AWS Lambda with Amazon Lex](services-lex.md) + + [Using Lambda with Amazon MQ](with-mq.md) + + [Using Lambda with Amazon MSK](with-msk.md) + + [Using AWS Lambda with Amazon RDS](services-rds.md) + + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) + + [Using AWS Lambda with Amazon S3](with-s3.md) + + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) + + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) + + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) + + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) + + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) + + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) + + [Using AWS Lambda with Amazon SES](services-ses.md) + + [Using AWS Lambda with Amazon SNS](with-sns.md) + + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + + [Sample function code](with-sns-create-package.md) + + [Using AWS Lambda with Amazon SQS](with-sqs.md) + + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + + [Tutorial: Using a cross-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + + [Sample Amazon SQS function code](with-sqs-create-package.md) + + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) @@ -235,6 +220,23 @@ Amazon's trademarks and trade dress may not be used in + [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) + [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) + [Troubleshoot container image issues in Lambda](troubleshooting-images.md) ++ [AWS Lambda applications](deploying-lambda-apps.md) + + [Managing applications in the AWS Lambda console](applications-console.md) + + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) + + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) + + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) + + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) + + [Sample function code](with-android-create-package.md) ++ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) + + [State machine application patterns](stepfunctions-patterns.md) + + [Managing state machines in the Lambda console](stepfunctions-lc.md) + + [Orchestration examples with Step Functions](services-stepfunctions.md) ++ [Best practices for working with AWS Lambda functions](best-practices.md) ++ [Lambda quotas](gettingstarted-limits.md) ++ [Lambda sample applications](lambda-samples.md) + + [Blank function sample application for AWS Lambda](samples-blank.md) + + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) + + [List manager sample application for AWS Lambda](samples-listmanager.md) + [AWS Lambda releases](lambda-releases.md) + [API reference](API_Reference.md) + [Actions](API_Operations.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 792b6e0a..abac18f4 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -208,10 +208,10 @@ As an alternative to an [on\-failure destination](#invocation-async-destinations To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md) and invoke a function\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -+ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using Lambda with Amazon SNS](with-sqs.md)\. ++ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. Create a topic in the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 9065b832..d6bddbb5 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -13,11 +13,11 @@ An event source mapping is an AWS Lambda resource that reads from an event sourc An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index 1ae816c4..e8f2e3ac 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -25,4 +25,4 @@ Lambda then runs the function by calling the code entry point specified in the f ## Image security -When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using customer managed AWS Key Management Service \(AWS KMS\) customer master keys \(CMKs\)\. To track and audit Lambda's usage of CMKs, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file +When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using AWS KMS customer managed keys\. To track and audit Lambda's usage of customer managed keys, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index 98619e6c..ec2ca6c8 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -19,6 +19,31 @@ A Lambda function can use up to five layers at a time\. The total unzipped size If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. +**Note** +Make sure that the layers that you add to a function are compatible with the runtime and instruction set architecture of the function\. + +Console + +**Configuring a function to use layers \(Console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Under **Layers**, choose **Add a layer** + +1. Under **Add layer**, choose a layer source\. + +1. For the **AWS layers** or **Custom layers** layer source: + + 1. Choose a layer from the pull\-down menu\. + + 1. Choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + +1. For the **Specify an ARN** layer source:: + + 1. Enter an ARN in the text box + +API + To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. ``` diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md index 009e8b5f..28d91bcf 100644 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,6 +2,8 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. +The default regional concurrency limit starts at 1,000\. For more information, or to request an increase on this limit, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. + Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. **Burst concurrency quotas** @@ -22,8 +24,6 @@ The following example shows a function processing a spike in traffic\. As invoca The function continues to scale until the account's concurrency limit for the function's Region is reached\. The function catches up to demand, requests subside, and unused instances of the function are stopped after being idle for some time\. Unused instances are frozen while they're waiting for requests and don't incur any charges\. -The regional concurrency limit starts at 1,000\. You can increase the limit by submitting a request in the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency creates a pool that can only be used by its function, and also prevents its function from using unreserved concurrency\. - When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index 1948d663..0c6a36c8 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -133,19 +133,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/java-image.md b/doc_source/java-image.md index a8a43259..9e9810fa 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index 82c2db32..3bbe3c5b 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -21,10 +21,10 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md index 6a5146eb..0b30cb7a 100644 --- a/doc_source/lambda-foundation.md +++ b/doc_source/lambda-foundation.md @@ -6,8 +6,8 @@ The Lambda function is the foundational principle of Lambda\. You can configure + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) ++ [Lambda instruction set architectures](foundation-arch.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) -+ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) -+ [Lambda quotas](gettingstarted-limits.md) \ No newline at end of file ++ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md index 2c1d4d68..02878bd5 100644 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,6 @@ # Configuring AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. +You can use the AWS Lambda API or console to create functions and configure function settings\. When you create the function, you chose the type of deployment package for the function\. The deployment package type cannot be changed later\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index 7d80d110..a23df8db 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -5,9 +5,9 @@ The following sections explain how common programming patterns and core concepts **Go runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | Lambda provides the following tools and libraries for the Go runtime: diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md index 186814f5..47a5c9d1 100644 --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-images.md @@ -6,6 +6,10 @@ AWS provides a set of open\-source base images that you can use to build the con Additionally, AWS provides a runtime interface emulator for you to test your functions locally using tools such as the Docker CLI\. +**Note** +You create each container image to be compatible with one of the instruction set architectures that Lambda supports\. Lambda provides base images for each of the instruction set architectures and Lambda also provides base images that support both architectures\. +The image that you build for your function must target only one of the architectures\. + There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. **Topics** diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index f74d5090..9ec12a32 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -8,7 +8,7 @@ To use your function to process data automatically, add one or more triggers\. A To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. -Other AWS services and resources invoke your function directly\. For example, you can configure CloudWatch Events to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. +Other AWS services and resources invoke your function directly\. For example, you can configure EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. @@ -19,5 +19,4 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) -+ [Invoking functions defined as container images](invocation-images.md) -+ [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file ++ [Invoking functions defined as container images](invocation-images.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index c5f091d0..a663fb65 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -7,11 +7,11 @@ Lambda supports the following Java runtimes\. **Java runtimes** -| Name | Identifier | JDK | Operating system | -| --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +| Name | Identifier | JDK | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 5d0a13db..930c21b6 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -7,11 +7,11 @@ Lambda supports the following Node\.js runtimes\. **Node\.js runtimes** -| Name | Identifier | SDK for JavaScript | Operating system | -| --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | +| Name | Identifier | SDK for JavaScript | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index 0645f6d8..9ac3d29e 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -5,10 +5,10 @@ The following sections explain how common programming patterns and core concepts **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | Lambda provides the following sample applications for the PowerShell runtime: + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 04feb72f..34dfa0c5 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -10,13 +10,13 @@ End of support for the Python 2\.7 runtime started on July 15, 2021\. For more i **Python runtimes** -| Name | Identifier | AWS SDK for Python | Operating system | -| --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Name | Identifier | AWS SDK for Python | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **To create a Python function** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 02d80f28..7e9f089a 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | | [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | | [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | | [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | @@ -28,7 +29,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | | [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | | [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | -| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss#SSS-GetFunctionConfiguration-response-LastUpdateStatusReasonCode) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | +| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | | [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | | [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | @@ -97,7 +98,7 @@ The following table describes the important changes in each release of the *AWS | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | | Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | +| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | | Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | | Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | | The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index b9d679da..d03e8d90 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -7,10 +7,10 @@ Lambda supports the following Ruby runtimes\. **Ruby runtimes** -| Name | Identifier | SDK for Ruby | Operating system | -| --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +| Name | Identifier | SDK for Ruby | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | +| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 405bbf3f..37de18f6 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -19,11 +19,11 @@ A runtime can support a single version of a language, multiple versions of a lan **Node\.js runtimes** -| Name | Identifier | SDK for JavaScript | Operating system | -| --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | +| Name | Identifier | SDK for JavaScript | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -31,13 +31,13 @@ For end of support information about Node\.js 10, see [Runtime support policy](r **Python runtimes** -| Name | Identifier | AWS SDK for Python | Operating system | -| --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | +| Name | Identifier | AWS SDK for Python | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. @@ -45,10 +45,10 @@ Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) **Ruby runtimes** -| Name | Identifier | SDK for Ruby | Operating system | -| --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | +| Name | Identifier | SDK for Ruby | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | +| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. @@ -56,26 +56,26 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run **Java runtimes** -| Name | Identifier | JDK | Operating system | -| --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | +| Name | Identifier | JDK | Operating system | Architectures | +| --- | --- | --- | --- | --- | +| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | +| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | **Go runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | **\.NET runtimes** -| Name | Identifier | Operating system | -| --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. @@ -85,10 +85,10 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- **Custom runtime** -| Name | Identifier | Operating system | -| --- | --- | --- | -| Custom Runtime | `provided.al2` | Amazon Linux 2 | -| Custom Runtime | `provided` | Amazon Linux | +| Name | Identifier | Operating system | Architectures | +| --- | --- | --- | --- | +| Custom Runtime | `provided.al2` | Amazon Linux 2 | x86\_64, arm64 | +| Custom Runtime | `provided` | Amazon Linux | x86\_64 | **Topics** + [Runtime support policy](runtime-support-policy.md) diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index b30be145..d9fe0023 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -1,96 +1,75 @@ # Using AWS Lambda with other services -AWS Lambda integrates with other AWS services to invoke functions\. You can configure triggers to invoke a function in response to resource lifecycle events, respond to incoming HTTP requests, consume events from a queue, or [run on a schedule](services-cloudwatchevents.md)\. - -Each service that integrates with Lambda sends data to your function in JSON as an event\. The structure of the event document is different for each event type, and contains data about the resource or request that triggered the function\. Lambda runtimes convert the event into an object and pass it to your function\. - -The following example shows a test event from an [Application Load Balancer](services-alb.md) that represents a GET request to `/lambda?query=1234ABCD`\. - -**Example event from an Application Load Balancer** - -``` -{ - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/lambda-279XGJDqGZ5rsrHC2Fjr/49e9d65c45c6791a" - } - }, - "httpMethod": "GET", - "path": "/lambda", - "queryStringParameters": { - "query": "1234ABCD" - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", - "accept-encoding": "gzip", - "accept-language": "en-US,en;q=0.9", - "connection": "keep-alive", - "host": "lambda-alb-123578498.us-east-2.elb.amazonaws.com", - "upgrade-insecure-requests": "1", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", - "x-amzn-trace-id": "Root=1-5c536348-3d683b8b04734faae651f476", - "x-forwarded-for": "72.12.164.125", - "x-forwarded-port": "80", - "x-forwarded-proto": "http", - "x-imforwards": "20" - }, - "body": "", - "isBase64Encoded": false -} -``` - -**Note** -The Lambda runtime converts the event document into an object and passes it to your [function handler](gettingstarted-concepts.md)\. For compiled languages, Lambda provides definitions for event types in a library\. See the following topics for more information\. -[Building Lambda functions with Java](lambda-java.md) -[Building Lambda functions with Go](lambda-golang.md) -[Building Lambda functions with C\#](lambda-csharp.md) -[Building Lambda functions with PowerShell](lambda-powershell.md) - -For services that generate a queue or data stream, you create an [event source mapping](invocation-eventsourcemapping.md) in Lambda and grant Lambda permission to access the other service in the [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. - -**Services that Lambda reads events from** -+ [Amazon DynamoDB](with-ddb.md) -+ [Amazon Kinesis](with-kinesis.md) -+ [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) - -Other services invoke your function directly\. You grant the other service permission in the function's [resource\-based policy](access-control-resource-based.md), and configure the other service to generate events and invoke your function\. Depending on the service, the invocation can be synchronous or asynchronous\. For synchronous invocation, the other service waits for the response from your function and might [retry on errors](invocation-retries.md)\. - -For more information about Lambda service architectures, see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. - -**Services that invoke Lambda functions synchronously** -+ [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) -+ [Amazon Cognito](services-cognito.md) -+ [Amazon connect](services-connect.md) -+ [Amazon Lex](services-lex.md) -+ [Amazon Alexa](services-alexa.md) -+ [Amazon API Gateway](services-apigateway.md) -+ [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) -+ [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) -+ [Amazon Simple Storage Service Batch](services-s3-batch.md) -+ [Secrets Manager](with-secrets-manager.md) - -For asynchronous invocation, Lambda queues the event before passing it to your function\. The other service gets a success response as soon as the event is queued and isn't aware of what happens afterwards\. If an error occurs, Lambda handles [retries](invocation-retries.md), and can send failed events to a [destination](invocation-async.md#invocation-async-destinations) that you configure\. You can disable retries for a function by setting the function's reserved concurrency value to zero\. - -**Services that invoke Lambda functions asynchronously** -+ [Amazon Simple Storage Service](with-s3.md) -+ [Amazon Simple Notification Service](with-sns.md) -+ [Amazon Simple Email Service](services-ses.md) -+ [AWS CloudFormation](services-cloudformation.md) -+ [Amazon CloudWatch Logs](services-cloudwatchlogs.md) -+ [Amazon CloudWatch Events](services-cloudwatchevents.md) -+ [AWS CodeCommit](services-codecommit.md) -+ [AWS Config](services-config.md) -+ [AWS IoT](services-iot.md) -+ [AWS IoT Events](services-iotevents.md) -+ [AWS CodePipeline](services-codepipeline.md) - -Additionally, some services integrate with Lambda in other ways that don't involve invoking functions\. - -**Services that integrate with Lambda in other ways** -+ [Amazon Elastic File System](services-efs.md) -+ [AWS X\-Ray](services-xray.md) - -See the topics in this chapter for more details about each service, and example events that you can use to test your function\. \ No newline at end of file +AWS Lambda integrates with other AWS services to invoke functions or take other actions\. These are some common use cases: ++ Invoke a function in response to resource lifecycle events, such as with Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using AWS Lambda with Amazon S3](with-s3.md)\. ++ Respond to incoming HTTP requests\. For more information, see [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md)\. ++ Consume events from a queue\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ Run a function on a schedule\. For more information, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. + +Depending on which service you're using with Lambda, the invocation generally works in one of two ways\. An event drives the invocation or Lambda polls a queue or data stream and invokes the function in response to activity in the queue or data stream\. Lambda integrates with Amazon Elastic File System and AWS X\-Ray in a way that doesn't involve invoking functions\. + +For more information, see [Event\-driven invocation](#event-driven-invocation) and [Lambda polling](#lambda-polling)\. Or, look up the service that you want to work with in the following section to find a link to information about using that service with Lambda\. + +## Listing of services and links to more information + +Find the service that you want to work with in the following table, to determine which method of invocation you should use\. Follow the link from the service name to find information about how to set up the integration between the services\. These topics also include example events that you can use to test your function\. + +**Tip** +Entries in this table are alphabetical by service name, excluding the "Amazon" or "AWS" prefix\. You can also use your browser's search functionality to find your service in the list\. + + +**** + +| Service | Method of invocation | +| --- | --- | +| [Amazon Alexa](services-alexa.md) | Event\-driven; synchronous invocation | +| [Amazon Managed Streaming for Apache Kafka](with-msk.md) | Lambda polling | +| [Self\-managed Apache Kafka](with-kafka.md) | Lambda polling | +| [Amazon API Gateway](services-apigateway.md) | Event\-driven; synchronous invocation | +| [AWS CloudFormation](services-cloudformation.md) | Event\-driven; asynchronous invocation | +| [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) | Event\-driven; synchronous invocation | +| [Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md) | Event\-driven; asynchronous invocation | +| [Amazon CloudWatch Logs](services-cloudwatchlogs.md) | Event\-driven; asynchronous invocation | +| [AWS CodeCommit](services-codecommit.md) | Event\-driven; asynchronous invocation | +| [AWS CodePipeline](services-codepipeline.md) | Event\-driven; asynchronous invocation | +| [Amazon Cognito](services-cognito.md) | Event\-driven; synchronous invocation | +| [AWS Config](services-config.md) | Event\-driven; asynchronous invocation | +| [Amazon Connect](services-connect.md) | Event\-driven; synchronous invocation | +| [Amazon DynamoDB](with-ddb.md) | Lambda polling | +| [Amazon Elastic File System](services-efs.md) | Special integration | +| [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) | Event\-driven; synchronous invocation | +| [AWS IoT](services-iot.md) | Event\-driven; asynchronous invocation | +| [AWS IoT Events](services-iotevents.md) | Event\-driven; asynchronous invocation | +| [Amazon Kinesis](with-kinesis.md) | Lambda polling | +| [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) | Event\-driven; synchronous invocation | +| [Amazon Lex](services-lex.md) | Event\-driven; synchronous invocation | +| [Amazon MQ](with-mq.md) | Lambda polling | +| [Amazon Simple Email Service](services-ses.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Notification Service](with-sns.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Queue Service \(Amazon S3\)](with-sqs.md) | Lambda polling | +| [Amazon Simple Storage Service](with-s3.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Storage Service Batch](services-s3-batch.md) | Event\-driven; synchronous invocation | +| [Secrets Manager](with-secrets-manager.md) | Event\-driven; synchronous invocation | +| [AWS X\-Ray](services-xray.md) | Special integration | + +## Event\-driven invocation + +Some services generate events that can invoke your Lambda function\. For more information about designing these types of architectures , see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. + +When you implement an event\-driven architecture, you grant the event\-generating service permission to invoke your function in the function's [resource\-based policy](access-control-resource-based.md)\. Then you configure that service to generate events that invoke your function\. + +The events are data structured in JSON format\. The JSON structure varies depending on the service that generates it and the event type, but they all contain the data that the function needs to process the event\. + +Lambda converts the event document into an object and passes it to your [function handler](gettingstarted-concepts.md)\. For compiled languages, Lambda provides definitions for event types in a library\. For more information, see the topic about building functions with your language: [Building Lambda functions with C\#](lambda-csharp.md), [Building Lambda functions with Go](lambda-golang.md), [Building Lambda functions with Java](lambda-java.md), or [Building Lambda functions with PowerShell](lambda-powershell.md)\. + +Depending on the service, the event\-driven invocation can be synchronous or asynchronous\. ++ For synchronous invocation, the service that generates the event waits for the response from your function\. That service defines the data that the function needs to return in the response\. The service controls the error strategy, such as whether to retry on errors\. For more information, see [Synchronous invocation](invocation-sync.md)\. ++ For asynchronous invocation, Lambda queues the event before passing it to your function\. When Lambda queues the event, it immediately sends a success response to the service that generated the event\. After the function processes the event, Lambda doesn’t return a response to the event\-generating service\. For more information, see [Asynchronous invocation](invocation-async.md)\. + +For more information about how Lambda manages error handling for synchronously and asychronously invoked functions, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. + +## Lambda polling + +For services that generate a queue or data stream, you set up an [event source mapping](invocation-eventsourcemapping.md) in Lambda to have Lambda poll the queue or a data stream\. + +When you implement a Lambda polling architecture, you grant Lambda permission to access the other service in the function's [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. \ No newline at end of file diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index 2e8afa81..e991b198 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -115,6 +115,9 @@ The `eventName` may include date and version information, such as `"GetFunction2 CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. +**Note** +CloudTrail logs only authenticated and authorized requests\. CloudTrail does not log requests that fail authentication \(credentials are missing or the provided credentials are not valid\) or requests with credentials that are not authorized to invoke the function\. + ### Using CloudTrail to troubleshoot disabled event sources One data event that can be encountered is a `LambdaESMDisabled` event\. There are five general categories of error that are associated with this event: diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md index fe2f6951..d22d8d66 100644 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -14,6 +14,9 @@ You can activate CodeGuru Profiler from the Lambda console if your function's ru + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. +**Note** +CodeGuru Profiler supports functions that use x86\_64 architecture and arm64 architecture\.????? + ## Activating CodeGuru Profiler from the Lambda console This section describes how to activate CodeGuru Profiler from the Lambda console\. diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 95336612..250d5255 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -For each Lambda function enabled for Lambda Insights, you only pay for what you use for metrics and logs\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +When you enable Lambda Insights for your Lambda function, Lambda Insights reports 8 metrics per function and every function invocation sends about 1KB of log data to CloudWatch\. You only pay for the metrics and logs reported for your function by Lambda Insights\. There are no minimum fees or mandatory service usage polices\. You do not pay for Lambda Insights if the function is not invoked\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index 28a57dee..3a33a915 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -66,19 +66,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 79680e2b..b72acc36 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md index a030d52a..0ff1e4e3 100644 --- a/doc_source/nodejs-package.md +++ b/doc_source/nodejs-package.md @@ -8,6 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Topics** diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md index 0e4feffc..4bac0a7f 100644 --- a/doc_source/powershell-devenv.md +++ b/doc_source/powershell-devenv.md @@ -1,6 +1,6 @@ # Setting Up a PowerShell Development Environment -Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for Powershell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. +Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for PowerShell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. The AWSLambdaPSCore module includes the following cmdlets to help author and publish PowerShell Lambda functions: + **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 02469114..09ee08eb 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -2,7 +2,7 @@ When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. -This page describes how to view Lambda function invocation errors for the Powershell runtime using the Lambda console and the AWS CLI\. +This page describes how to view Lambda function invocation errors for the PowerShell runtime using the Lambda console and the AWS CLI\. **Topics** + [Syntax](#powershell-exceptions-syntax) @@ -90,19 +90,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index 422d65cf..883eff54 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -45,19 +45,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md index b95a618d..ea83bd21 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -7,9 +7,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -21,9 +26,9 @@ The workflow for a function defined as a container image includes these steps: **Topics** + [AWS base images for Python](#python-image-base) -+ [Python runtime interface clients](#python-image-clients) + [Create a Python image from an AWS base image](#python-image-create) + [Create a Python image from an alternative base image](#python-image-create-alt) ++ [Python runtime interface clients](#python-image-clients) + [Deploy the container image](#python-image-deploy) ## AWS base images for Python @@ -43,18 +48,6 @@ Docker Hub repository: amazon/aws\-lambda\-python Amazon ECR repository: gallery\.ecr\.aws/lambda/python -## Python runtime interface clients - -Install the runtime interface client for Python using the pip package manager: - -``` -pip install awslambdaric -``` - -For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. - -You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. - ## Create a Python image from an AWS base image When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. @@ -95,8 +88,22 @@ When you build a container image for Python using an AWS base image, you only ne ## Create a Python image from an alternative base image +When you use an alternative base image, you need to install the [Python runtime interface client](#python-image-clients) + For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. +## Python runtime interface clients + +Install the [runtime interface client](runtimes-images.md#runtimes-api-client) for Python using the pip package manager: + +``` +pip install awslambdaric +``` + +For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. + +You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. + ## Deploy the container image For a new function, you deploy the Python image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 2fc0a040..513209a5 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -11,6 +11,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Note** diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index eaf8e0ea..b17df846 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -67,19 +67,17 @@ You can invoke your function on the Lambda console by configuring a test event a 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -1. Choose a function\. +1. Choose the function to test, and choose **Test**\. -1. Choose **Test**\. - -1. Select **New event** and then choose an **Event template** from the dropdown list\. +1. Under **Test event**, select **New event**\. -1. Enter a name for the test event\. +1. Select a **Template**\. -1. Enter the JSON for the test event\. +1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. -1. Choose **Create event**\. +1. Choose **Save changes**\. -1. Choose **Invoke**\. +1. Choose **Test**\. The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 72a40323..07e9023a 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -4,9 +4,14 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients - If you use a community or private enterprise base image, add a runtime interface client to the base image to make it compatible with Lambda\. + AWS provides base images for x86\_64 architecture and arm64 architecture\. ++ Open\-source runtime interface clients \(RIC\) + + If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. ++ Open\-source runtime interface emulator \(RIE\) + + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md index 0d124cc1..1ce93c9a 100644 --- a/doc_source/ruby-package.md +++ b/doc_source/ruby-package.md @@ -8,6 +8,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- + If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. ++ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. + Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. **Topics** diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md index a3fa3b30..b68b7491 100644 --- a/doc_source/runtimes-avx2.md +++ b/doc_source/runtimes-avx2.md @@ -2,6 +2,9 @@ Advanced Vector Extensions 2 \(AVX2\) is a vectorization extension to the Intel x86 instruction set that can perform single instruction multiple data \(SIMD\) instructions over vectors of 256 bits\. For vectorizable algorithms with [highly parallelizable](https://en.wikipedia.org/wiki/Massively_parallel) operation, using AVX2 can enhance CPU performance, resulting in lower latencies and higher throughput\. Use the AVX2 instruction set for compute\-intensive workloads such as machine learning inferencing, multimedia processing, scientific simulations, and financial modeling applications\. +**Note** +Lambda arm64 uses NEON SIMD architecture and does not support the x86 AVX2 extensions\. + To use AVX2 with your Lambda function, make sure that your function code is accessing AVX2\-optimized code\. For some languages, you can install the AVX2\-supported version of libraries and packages\. For other languages, you can recompile your code and dependencies with the appropriate compiler flags set \(if the compiler supports auto\-vectorization\)\. You can also compile your code with third\-party libraries that use AVX2 to optimize math operations\. For example, Intel Math Kernel Library \(Intel MKL\), OpenBLAS \(Basic Linear Algebra Subprograms\), and AMD BLAS\-like Library Instantiation Software \(BLIS\)\. Auto\-vectorized languages, such as Java, automatically use AVX2 for computations\. You can create new Lambda workloads or move existing AVX2\-enabled workloads to Lambda at no additional cost\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index ce22aa51..a2e180f8 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -2,6 +2,9 @@ AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. +**Note** +Each base image is compatible with one or more of the instruction set architectures that Lambda supports\. You need to build the function image for only one architcture\. Lambda does not support multi\-architecture images\. + **Topics** + [AWS base images for Lambda](#runtimes-images-lp) + [Base images for custom runtimes](#runtimes-images-custom) diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md index 54f85687..28df3a13 100644 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -18,21 +18,17 @@ We strongly recommend that you never put confidential or sensitive information, ## Encryption in transit -Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. +Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. -When you [connect your function to a file system](configuration-filesystem.md), Lambda uses [Encryption in transit](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) for all connections\. +When you [connect your function to a file system](configuration-filesystem.md), Lambda uses encryption in transit for all connections\. For more information, see [Data encryption in Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) in the *Amazon Elastic File System User Guide*\. -For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. +When you use [environment variables](configuration-envvars.md), you can enable console encryption helpers to use client\-side encryption to protect the environment variables in transit\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. ## Encryption at rest -You can use environment variables to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. +You can use [environment variables](configuration-envvars.md) to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. By default, Lambda uses an AWS KMS key that Lambda creates in your account to encrypt your environment variables\. This AWS managed key is named `aws/lambda`\. -Additionally, you can use the following features to customize how environment variables are encrypted\. -+ **Key configuration** – On a per\-function basis, you can configure Lambda to use an encryption key that you create and manage in AWS Key Management Service\. These are referred to as *customer managed* CMKs\. For functions that do not have a configured customer managed CMK, Lambda uses an AWS managed CMK named `aws/lambda`, which Lambda creates in your account\. -+ **Encryption helpers** – The Lambda console lets you encrypt environment variable values client side, before sending them to Lambda\. This enhances security further by preventing secrets from being displayed unencrypted in the Lambda console, or in function configuration that's returned by the Lambda API\. The console also provides sample code that you can adapt to decrypt the values in your function handler\. - -For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. +On a per\-function basis, you can optionally configure Lambda to use a customer managed key instead of the default AWS managed key to encrypt your environment variables\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index 41828285..6a4cf921 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -1,61 +1,29 @@ -# Tutorial: Using AWS Lambda with Amazon API Gateway +# Tutorial: Using Lambda with API Gateway -In this example you create a simple API using Amazon API Gateway\. An Amazon API Gateway is a collection of resources and methods\. For this tutorial, you create one resource \(`DynamoDBManager`\) and define one method \(`POST`\) on it\. The method is backed by a Lambda function \(`LambdaFunctionOverHttps`\)\. That is, when you call the API through an HTTPS endpoint, Amazon API Gateway invokes the Lambda function\. +In this tutorial, you use Amazon API Gateway to create a REST API and a resource \(`DynamoDBManager`\)\. You define one method \(`POST`\) on the resource, and create a Lambda function \(`LambdaFunctionOverHttps`\) that backs the `POST` method\. That way, when you call the API through an HTTPS endpoint, API Gateway invokes the Lambda function\. -The `POST` method on the `DynamoDBManager` resource supports the following DynamoDB operations: +The `POST` method that you define on the `DynamoDBManager` resource supports the following Amazon DynamoDB operations: + Create, update, and delete an item\. + Read an item\. + Scan an item\. + Other operations \(echo, ping\), not related to DynamoDB, that you can use for testing\. -The request payload you send in the `POST` request identifies the DynamoDB operation and provides necessary data\. For example: -+ The following is a sample request payload for a DynamoDB create item operation: - - ``` - { - "operation": "create", - "tableName": "lambda-apigateway", - "payload": { - "Item": { - "id": "1", - "name": "Bob" - } - } - } - ``` -+ The following is a sample request payload for a DynamoDB read item operation: - - - - ``` - { - "operation": "read", - "tableName": "lambda-apigateway", - "payload": { - "Key": { - "id": "1" - } - } - } - ``` -+ The following is a sample request payload for an `echo` operation\. You send an HTTP POST request to the endpoint, using the following data in the request body\. - - ``` - { - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } - } - ``` +Using API Gateway with Lambda also provides advanced capabilities, such as: ++ **Full request passthrough** – Using the Lambda proxy \(`AWS_PROXY`\) integration type, a Lambda function can receive an entire HTTP request \(instead of just the request body\) and set the HTTP response \(instead of just the response body\)\. ++ **Catch\-all methods** – Using the `ANY` catch\-all method, you can map all methods of an API resource to a single Lambda function with a single mapping\. ++ **Catch\-all resources** – Using a greedy path variable \(`{proxy+}`\), you can map all sub\-paths of a resource to a Lambda function without any additional configuration\. + +For more information about these API Gateway features, see [Set up a proxy integration with a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html) in the *API Gateway Developer Guide*\. -**Note** -API Gateway offers advanced capabilities, such as: -**Pass through the entire request** – A Lambda function can receive the entire HTTP request \(instead of just the request body\) and set the HTTP response \(instead of just the response body\) using the `AWS_PROXY` integration type\. -**Catch\-all methods** – Map all methods of an API resource to a single Lambda function with a single mapping, using the `ANY` catch\-all method\. -**Catch\-all resources** – Map all sub\-paths of a resource to a Lambda function without any additional configuration using the new path parameter \(`{proxy+})`\. -To learn more about these API Gateway features, see [Configure proxy integration for a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html)\. +**Topics** ++ [Prerequisites](#services-apigateway-tutorial-prereqs) ++ [Create an execution role](#services-apigateway-tutorial-role) ++ [Create the function](#services-apigateway-tutorial-function) ++ [Test the function](#services-apigateway-tutorial-test) ++ [Create a REST API using API Gateway](#services-apigateway-tutorial-api) ++ [Create a DynamoDB table](#services-apigateway-tutorial-table) ++ [Test the setup](#services-apigateway-tutorial-test-setup) ++ [Clean up your resources](#cleanup) ## Prerequisites @@ -77,17 +45,17 @@ For long commands, an escape character \(`\`\) is used to split a command over m On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -## Create the execution role +## Create an execution role -Create the [execution role](lambda-intro-execution-role.md)\. This role uses a custom policy to give your function permission to access the required AWS resources\. You first create the policy and then create the execution role\. +Create an [execution role](lambda-intro-execution-role.md)\. This AWS Identity and Access Management \(IAM\) role uses a custom policy to give your Lambda function permission to access the required AWS resources\. Note that you must first create the policy and then create the execution role\. **To create a custom policy** -1. Open the [policy page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. +1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. 1. Choose **Create Policy**\. -1. Choose the **JSON** tab\. Paste the following custom policy into the input box\. +1. Choose the **JSON** tab, and then paste the following custom policy into the JSON editor\. ``` { @@ -120,44 +88,50 @@ Create the [execution role](lambda-intro-execution-role.md)\. This role uses a c } ``` -1. Choose **Next: Tags**\. + This policy includes permissions for your function to access DynamoDB and Amazon CloudWatch Logs\. -1. Choose **Next: Review**\. +1. Choose **Next: Tags**\. -1. For the policy name, enter **lambda\-apigateway\-policy**\. +1. Choose **Next: Review**\. -1. Enter **Create policy**\. +1. Under **Review policy**, for the policy **Name**, enter **lambda\-apigateway\-policy**\. -This policy includes permissions for the function to access DynamoDB and CloudWatch Logs\. +1. Choose **Create policy**\. **To create an execution role** -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. 1. Choose **Create role**\. -1. For the trusted entity, choose **AWS Service**, and for the use case choose **Lambda**\. +1. For the type of trusted entity, choose **AWS service**\. + +1. For the use case, choose **Lambda**\. 1. Choose **Next: Permissions**\. -1. In the policy search box, enter **lambda\-apigateway\-policy**\. +1. In the policy search box, enter **lambda\-apigateway\-policy**\. -1. In the results, select `lambda-apigateway-policy` and choose **Next: Tags**\. +1. In the search results, select the policy that you created \(`lambda-apigateway-policy`\), and then choose **Next: Tags**\. 1. Choose **Next: Review**\. -1. For the role name, enter **lambda\-apigateway\-role**\. +1. Under **Review**, for the **Role name**, enter **lambda\-apigateway\-role**\. + +1. Choose **Create role**\. + +1. On the **Roles** page, choose the name of your role \(`lambda-apigateway-role`\)\. + +1. On the **Summary** page, copy the **Role ARN**\. You need this later in the tutorial\. -1. Enter **Create role**\. - Note the Amazon Resource Name \(ARN\) of the execution role for later use\. ## Create the function -The following example code receives a API Gateway event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +The following code example receives an API Gateway event input and processes the messages that this input contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. -**Note** -For sample code in other languages, see [Sample function code](services-apigateway-code.md)\. +------ +#### [ Node\.js ] **Example index\.js** @@ -213,7 +187,7 @@ exports.handler = function(event, context, callback) { **To create the function** -1. Copy the sample code into a file named `index.js`\. +1. Save the code example as a file named `index.js`\. 1. Create a deployment package\. @@ -221,7 +195,7 @@ exports.handler = function(event, context, callback) { zip function.zip index.js ``` -1. Create a Lambda function with the `create-function` command\. For the `role` parameter, enter the ARN of the execution role that you created earlier\. +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. ``` aws lambda create-function --function-name LambdaFunctionOverHttps \ @@ -229,339 +203,304 @@ exports.handler = function(event, context, callback) { --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` -## Test the Lambda function +------ +#### [ Python 3 ] + +**Example LambdaFunctionOverHttps\.py** + +``` +from __future__ import print_function + +import boto3 +import json + +print('Loading function') + + +def handler(event, context): + '''Provide an event that contains the following keys: + + - operation: one of the operations in the operations dict below + - tableName: required for operations that interact with DynamoDB + - payload: a parameter to pass to the operation being performed + ''' + #print("Received event: " + json.dumps(event, indent=2)) -Invoke the function manually using the sample event data\. We recommend that you invoke the function using the console because the console UI provides a user\-friendly interface for reviewing the execution results, including the execution summary, logs written by your code, and the results returned by the function \(because the console always performs synchronous execution—invokes the Lambda function using the `RequestResponse` invocation type\)\. + operation = event['operation'] -**To test the Lambda function** + if 'tableName' in event: + dynamo = boto3.resource('dynamodb').Table(event['tableName']) -1. Copy the following JSON into a file and save it as `input.txt`\. + operations = { + 'create': lambda x: dynamo.put_item(**x), + 'read': lambda x: dynamo.get_item(**x), + 'update': lambda x: dynamo.update_item(**x), + 'delete': lambda x: dynamo.delete_item(**x), + 'list': lambda x: dynamo.scan(**x), + 'echo': lambda x: x, + 'ping': lambda x: 'pong' + } + + if operation in operations: + return operations[operation](event.get('payload')) + else: + raise ValueError('Unrecognized operation "{}"'.format(operation)) +``` + +**To create the function** + +1. Save the code example as a file named `LambdaFunctionOverHttps.py`\. + +1. Create a deployment package\. ``` - { - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } - } + zip function.zip LambdaFunctionOverHttps.py ``` -1. Run the following `invoke` command: +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. ``` - aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload file://input.txt outputfile.txt + aws lambda create-function --function-name LambdaFunctionOverHttps \ + --zip-file fileb://function.zip --handler LambdaFunctionOverHttps.handler --runtime python3.8 \ + --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +------ +#### [ Go ] -## Create an API using Amazon API Gateway +**Example LambdaFunctionOverHttps\.go** -In this step, you associate your Lambda function with a method in the API that you created using Amazon API Gateway and test the end\-to\-end experience\. That is, when an HTTP request is sent to an API method, Amazon API Gateway invokes your Lambda function\. +``` +package main + +import ( + "context" + "fmt" + "github.com/aws/aws-lambda-go/events" + runtime "github.com/aws/aws-lambda-go/lambda" +) -First, you create an API \(`DynamoDBOperations`\) using Amazon API Gateway with one resource \(`DynamoDBManager`\) and one method \(`POST`\)\. You associate the `POST` method with your Lambda function\. Then, you test the end\-to\-end experience\. +func main() { + runtime.Start(handleRequest) +} -### Create the API +func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { + fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) + fmt.Printf("Body size = %d.\n", len(request.Body)) -Run the following `create-rest-api` command to create the `DynamoDBOperations` API for this tutorial\. + fmt.Println("Headers:") + for key, value := range request.Headers { + fmt.Printf(" %s: %s\n", key, value) + } -``` -aws apigateway create-rest-api --name DynamoDBOperations + return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil +} ``` -You should see the following output: +**To create the function** -``` -{ - "id": "bs8fqo6bp0", - "name": "DynamoDBOperations", - "createdDate": 1539803980, - "apiKeySource": "HEADER", - "endpointConfiguration": { - "types": [ - "EDGE" - ] - } -} -``` +1. Save the code example as a file named `LambdaFunctionOverHttps.go`\. -Save the API ID for use in further commands\. You also need the ID of the API root resource\. To get the ID, run the `get-resources` command\. +1. Compile your executable\. -``` -API=bs8fqo6bp0 -aws apigateway get-resources --rest-api-id $API -``` + ``` + GOOS=linux go build LambdaFunctionOverHttps.go + ``` -You should see the following output: +1. Create a deployment package\. -``` -{ - "items": [ - { - "path": "/", - "id": "e8kitthgdb" - } - ] -} -``` + ``` + zip function.zip LambdaFunctionOverHttps + ``` -At this time you only have the root resource, but you add more resources in the next step\. +1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. -### Create a resource in the API + ``` + aws lambda create-function --function-name LambdaFunctionOverHttps \ + --zip-file fileb://function.zip --handler LambdaFunctionOverHttps --runtime go1.x \ + --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role + ``` -Run the following `create-resource` command to create a resource \(`DynamoDBManager`\) in the API that you created in the preceding section\. +------ -``` -aws apigateway create-resource --rest-api-id $API --path-part DynamoDBManager \ ---parent-id e8kitthgdb -``` +## Test the function -You should see the following output: +Test the Lambda function manually using the following sample event data\. You can invoke the function using the `invoke` AWS CLI command or by [using the Lambda console](configuration-function-common.md#configuration-common-test)\. -``` -{ - "path": "/DynamoDBManager", - "pathPart": "DynamoDBManager", - "id": "iuig5w", - "parentId": "e8kitthgdb" -} -``` +**To test the Lambda function \(AWS CLI\)** -Note the ID in the response\. This is the ID of the `DynamoDBManager` resource that you created\. +1. Save the following JSON as a file named `input.txt`\. -### Create POST method on the resource + ``` + { + "operation": "echo", + "payload": { + "somekey1": "somevalue1", + "somekey2": "somevalue2" + } + } + ``` -Run the following `put-method` command to create a `POST` method on the `DynamoDBManager` resource in your API\. +1. Run the following `invoke` AWS CLI command: -``` -RESOURCE=iuig5w -aws apigateway put-method --rest-api-id $API --resource-id $RESOURCE \ ---http-method POST --authorization-type NONE -``` + ``` + aws lambda invoke --function-name LambdaFunctionOverHttps \ + --payload file://input.txt outputfile.txt + ``` -You should see the following output: + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. -``` -{ - "apiKeyRequired": false, - "httpMethod": "POST", - "authorizationType": "NONE" -} -``` +1. Verify the output in the file `outputfile.txt`\. -We specify `NONE` for the `--authorization-type` parameter, which means that unauthenticated requests for this method are supported\. This is fine for testing but in production you should use either the key\-based or role\-base authentication\. +## Create a REST API using API Gateway -### Set the Lambda function as the destination for the POST method +In this section, you create an API Gateway REST API \(`DynamoDBOperations`\) with one resource \(`DynamoDBManager`\) and one method \(`POST`\)\. You associate the `POST` method with your Lambda function\. Then, you test the setup\. -Run the following command to set the Lambda function as the integration point for the `POST` method\. This is the method Amazon API Gateway invokes when you make an HTTP request for the `POST` method endpoint\. This command and others use ARNs that include your account ID and region\. Save these to variables \(you can find your account ID in the role ARN that you used to create the function\)\. +When your API method receives an HTTP request, API Gateway invokes your Lambda function\. -``` -REGION=us-east-2 -ACCOUNT=123456789012 -aws apigateway put-integration --rest-api-id $API --resource-id $RESOURCE \ ---http-method POST --type AWS --integration-http-method POST \ ---uri arn:aws:apigateway:$REGION:lambda:path/2015-03-31/functions/arn:aws:lambda:$REGION:$ACCOUNT:function:LambdaFunctionOverHttps/invocations -``` +### Create the API -You should see the following output: +In the following steps, you create the `DynamoDBOperations` REST API using the API Gateway console\. -``` -{ - "type": "AWS", - "httpMethod": "POST", - "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps/invocations", - "passthroughBehavior": "WHEN_NO_MATCH", - "timeoutInMillis": 29000, - "cacheNamespace": "iuig5w", - "cacheKeyParameters": [] -} -``` +**To create the API** -`--integration-http-method` is the method that API Gateway uses to communicate with AWS Lambda\. `--uri` is unique identifier for the endpoint to which Amazon API Gateway can send request\. +1. Open the [API Gateway console](https://console.aws.amazon.com/apigateway)\. -Set `content-type` of the `POST` method response and integration response to JSON as follows: -+ Run the following command to set the `POST` method response to JSON\. This is the response type that your API method returns\. +1. Choose **Create API**\. - ``` - aws apigateway put-method-response --rest-api-id $API \ - --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-models application/json=Empty - ``` +1. In the **REST API** box, choose **Build**\. - You should see the following output: +1. Under **Create new API**, choose **New API**\. - ``` - { - "statusCode": "200", - "responseModels": { - "application/json": "Empty" - } - } - ``` -+ Run the following command to set the `POST` method integration response to JSON\. This is the response type that Lambda function returns\. +1. Under **Settings**, do the following: - ``` - aws apigateway put-integration-response --rest-api-id $API \ - --resource-id $RESOURCE --http-method POST \ - --status-code 200 --response-templates application/json="" - ``` + 1. For **API name**, enter **DynamoDBOperations**\. - You should see the following output: + 1. For **Endpoint Type**, choose **Regional**\. - ``` - { - "statusCode": "200", - "responseTemplates": { - "application/json": null - } - } - ``` -**Note** -If you encounter an error running this command, you can use escape characters around the response template field for more clarity\. The text `application/json=""` becomes `"{\"application/json"\":""\"\"}""`\. +1. Choose **Create API**\. -### Deploy the API +### Create a resource in the API -In this step, you deploy the API that you created to a stage called `prod`\. +In the following steps, you create a resource named `DynamoDBManager` in your REST API\. -``` -aws apigateway create-deployment --rest-api-id $API --stage-name prod -``` +**To create the resource** -You should see the following output: +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that the root \(`/`\) level is highlighted\. Then, choose **Actions**, **Create Resource**\. -``` -{ - "id": "20vgsz", - "createdDate": 1539820012 -} -``` +1. Under **New child resource**, do the following: -## Grant invoke permission to the API + 1. For **Resource Name**, enter **DynamoDBManager**\. -Now that you have an API created using Amazon API Gateway and you've deployed it, you can test\. First, you need to add permissions so that Amazon API Gateway can invoke your Lambda function when you send HTTP request to the `POST` method\. + 1. Keep **Resource Path** set to `/dynamodbmanager`\. -To do this, you need to add a permission to the permissions policy associated with your Lambda function\. Run the following `add-permission` AWS Lambda command to grant the Amazon API Gateway service principal \(`apigateway.amazonaws.com`\) permissions to invoke your Lambda function \(`LambdaFunctionOverHttps`\)\. +1. Choose **Create Resource**\. -``` -aws lambda add-permission --function-name LambdaFunctionOverHttps \ ---statement-id apigateway-test-2 --action lambda:InvokeFunction \ ---principal apigateway.amazonaws.com \ ---source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/*/POST/DynamoDBManager" -``` +### Create a POST method on the resource -You should see the following output: +In the following steps, you create a `POST` method on the `DynamoDBManager` resource that you created in the previous section\. -``` -{ - "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/*/POST/DynamoDBManager\"}}}" -} -``` +**To create the method** -You must grant this permission to enable testing \(if you go to the Amazon API Gateway and choose **Test** to test the API method, you need this permission\)\. Note the `--source-arn` specifies a wildcard character \(\*\) as the stage value \(indicates testing only\)\. This allows you to test without deploying the API\. +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that `/dynamodbmanager` is highlighted\. Then, choose **Actions**, **Create Method**\. -**Note** -If your function and API are in different regions, the region identifier in the source ARN must match the region of the function, not the region of the API\. +1. In the small dropdown menu that appears under `/dynamodbmanager`, choose `POST`, and then choose the check mark icon\. -Now, run the same command again, but this time you grant to your deployed API permissions to invoke the Lambda function\. +1. In the method's **Setup** pane, do the following: -``` -aws lambda add-permission --function-name LambdaFunctionOverHttps \ ---statement-id apigateway-prod-2 --action lambda:InvokeFunction \ ---principal apigateway.amazonaws.com \ ---source-arn "arn:aws:execute-api:$REGION:$ACCOUNT:$API/prod/POST/DynamoDBManager" -``` + 1. For **Integration type**, choose **Lambda Function**\. -You should see the following output: + 1. For **Lambda Region**, choose the same AWS Region as your Lambda function\. -``` -{ - "Statement": "{\"Sid\":\"apigateway-prod-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:LambdaFunctionOverHttps\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1yprki7/prod/POST/DynamoDBManager\"}}}" -} -``` + 1. For **Lambda Function**, enter the name of your function \(**LambdaFunctionOverHttps**\)\. + + 1. Select **Use Default Timeout**\. + + 1. Choose **Save**\. -You grant this permission so that your deployed API has permissions to invoke the Lambda function\. Note that the `--source-arn` specifies a `prod` which is the stage name we used when deploying the API\. +1. In the **Add Permission to Lambda Function** dialog box, choose **OK**\. -## Create a Amazon DynamoDB table +## Create a DynamoDB table -Create the DynamoDB table that the Lambda function uses\. +Create the DynamoDB table that your Lambda function uses\. -**To create a DynamoDB table** +**To create the DynamoDB table** -1. Open the [DynamoDB console](https://console.aws.amazon.com/dynamodb)\. +1. Open the [Tables page](https://console.aws.amazon.com/dynamodbv2#tables) of the DynamoDB console\. 1. Choose **Create table**\. -1. Create a table with the following settings\. - + **Table name** – **lambda\-apigateway** - + **Primary key** – **id** \(string\) +1. Under **Table details**, do the following: -1. Choose **Create**\. + 1. For **Table name**, enter **lambda\-apigateway**\. -## Trigger the function with an HTTP request + 1. For **Partition key**, enter **id**, and keep the data type set as **String**\. -In this step, you are ready to send an HTTP request to the `POST` method endpoint\. You can use either Curl or a method \(`test-invoke-method`\) provided by Amazon API Gateway\. +1. Under **Settings**, keep the **Default settings**\. -You can use Amazon API Gateway CLI commands to send an HTTP `POST` request to the resource \(`DynamoDBManager`\) endpoint\. Because you deployed your Amazon API Gateway, you can use Curl to invoke the methods for the same operation\. +1. Choose **Create table**\. -The Lambda function supports using the `create` operation to create an item in your DynamoDB table\. To request this operation, use the following JSON: +## Test the setup -**Example create\-item\.json** +You're now ready to test the setup\. You can send requests to your `POST` method directly from the API Gateway console\. In this step, you use a `create` operation followed by an `update` operation\. -``` -{ - "operation": "create", - "tableName": "lambda-apigateway", - "payload": { - "Item": { - "id": "1234ABCD", - "number": 5 - } - } -} -``` +**To create an item in your DynamoDB table** -Save the test input to a file named `create-item.json`\. Run the `test-invoke-method` Amazon API Gateway command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint\. +Your Lambda function can use the `create` operation to create an item in your DynamoDB table\. -``` -aws apigateway test-invoke-method --rest-api-id $API \ ---resource-id $RESOURCE --http-method POST --path-with-query-string "" \ ---body file://create-item.json -``` +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), choose the name of your REST API \(`DynamoDBOperations`\)\. -Or, you can use the following Curl command: +1. In the **Resources** tree, under `/dynamodbmanager`, choose your `POST` method\. -``` -curl -X POST -d "{\"operation\":\"create\",\"tableName\":\"lambda-apigateway\",\"payload\":{\"Item\":{\"id\":\"1\",\"name\":\"Bob\"}}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` +1. In the **Method Execution** pane, in the **Client** box, choose **Test**\. -To send request for the `echo` operation that your Lambda function supports, you can use the following request payload: +1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. For **Request Body**, paste the following JSON: -**Example echo\.json** + ``` + { + "operation": "create", + "tableName": "lambda-apigateway", + "payload": { + "Item": { + "id": "1234ABCD", + "number": 5 + } + } + } + ``` -``` -{ - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } -} -``` +1. Choose **Test**\. -Save the test input to a file named `echo.json`\. Run the `test-invoke-method` Amazon API Gateway CLI command to send an HTTP `POST` method request to the resource \(`DynamoDBManager`\) endpoint using the preceding JSON in the request body\. +The test results should show status `200`, indicating that the `create` operation was successful\. To confirm, you can check that your DynamoDB table now contains an item with `"id": "1234ABCD"` and `"number": "5"`\. -``` -aws apigateway test-invoke-method --rest-api-id $API \ ---resource-id $RESOURCE --http-method POST --path-with-query-string "" \ ---body file://echo.json -``` +**To update the item in your DynamoDB table** -Or, you can use the following Curl command: +You can also update items in the table using the `update` operation\. -``` -curl -X POST -d "{\"operation\":\"echo\",\"payload\":{\"somekey1\":\"somevalue1\",\"somekey2\":\"somevalue2\"}}" https://$API.execute-api.$REGION.amazonaws.com/prod/DynamoDBManager -``` +1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), return to your POST method's **Method Test** pane\. + +1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. In **Request Body**, paste the following JSON: + + ``` + { + "operation": "update", + "tableName": "lambda-apigateway", + "payload": { + "Key": { + "id": "1234ABCD" + }, + "AttributeUpdates": { + "number": { + "Value": 10 + } + } + } + } + ``` + +1. Choose **Test**\. + +The test results should show status `200`, indicating that the `update` operation was successful\. To confirm, you can check that your DynamoDB table now contains an updated item with `"id": "1234ABCD"` and `"number": "10"`\. ## Clean up your resources @@ -573,7 +512,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 1b99debe..88435c0b 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -118,7 +118,7 @@ Resources in your API define one or more methods, such as GET or POST\. Methods + [Handling errors with an API Gateway API](#services-apigateway-errors) + [Choosing an API type](#services-apigateway-apitypes) + [Sample applications](#services-apigateway-samples) -+ [Tutorial: Using AWS Lambda with Amazon API Gateway](services-apigateway-tutorial.md) ++ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) + [Sample function code](services-apigateway-code.md) + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + [AWS SAM template for an API Gateway application](services-apigateway-template.md) diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md index 74c7e746..62a4d36a 100644 --- a/doc_source/services-cloudwatchevents-expressions.md +++ b/doc_source/services-cloudwatchevents-expressions.md @@ -1,6 +1,6 @@ # Schedule expressions using rate or cron -AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute\. CloudWatch Events rate expressions have the following format\. +AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute\. EventBridge \(CloudWatch Events\) rate expressions have the following format\. ``` rate(Value Unit) diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 6459ae67..079c939f 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -1,7 +1,7 @@ # Tutorial: Using AWS Lambda with scheduled events In this tutorial, you do the following: -+ Create a Lambda function using the **lambda\-canary** blueprint\. You configure the Lambda function to run every minute\. Note that if the function returns an error, AWS Lambda logs error metrics to CloudWatch\. ++ Create a Lambda function using the **lambda\-canary** blueprint\. You configure the Lambda function to run every minute\. Note that if the function returns an error, Lambda logs error metrics to Amazon CloudWatch\. + Configure a CloudWatch alarm on the `Errors` metric of your Lambda function to post a message to your Amazon SNS topic when AWS Lambda emits error metrics to CloudWatch\. You subscribe to the Amazon SNS topics to get email notification\. In this tutorial, you do the following to set this up: + Create an Amazon SNS topic\. + Subscribe to the topic so you can get email notifications when a new message is posted to the topic\. @@ -37,7 +37,7 @@ This tutorial assumes that you have some knowledge of basic Lambda operations an 1. Choose **Create function**\. -CloudWatch Events emits an event every minute, based on the schedule expression\. The event triggers the Lambda function, which verifies that the expected string appears in the specified page\. For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. +EventBridge \(CloudWatch Events\) emits an event every minute, based on the schedule expression\. The event triggers the Lambda function, which verifies that the expected string appears in the specified page\. For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. ## Test the Lambda function @@ -49,7 +49,7 @@ Test the function with a sample event provided by the Lambda console\. 1. Choose **Test**\. -1. Create a new event using the **CloudWatch Events** event template\. +1. Create a new event using the **EventBridge \(CloudWatch Events\)** event template\. 1. Choose **Create event**\. @@ -135,7 +135,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md index 8c773506..a59998ed 100644 --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -1,13 +1,15 @@ -# Using AWS Lambda with Amazon CloudWatch Events +# Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\) **Note** -Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. +Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch Events or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. -[Amazon CloudWatch events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchEvents.html) help you to respond to state changes in your AWS resources\. When your resources change state, they automatically send events into an event stream\. You can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. +EventBridge \(CloudWatch Events\) helps you to respond to state changes in your AWS resources\. For more information about EventBridge, see [What is Amazon EventBridge?](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge User Guide*\. -CloudWatch Events invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. +When your resources change state, they automatically send events into an event stream\. With EventBridge \(CloudWatch Events\), you can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. -**Example CloudWatch Events event** +EventBridge \(CloudWatch Events\) invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. + +**Example EventBridge \(CloudWatch Events\) event** ``` { @@ -36,7 +38,7 @@ CloudWatch Events invokes your function asynchronously with an event document th You can also create a Lambda function and direct AWS Lambda to invoke it on a regular schedule\. You can specify a fixed rate \(for example, invoke a Lambda function every hour or 15 minutes\), or you can specify a Cron expression\. -**Example CloudWatch Events message event** +**Example EventBridge \(CloudWatch Events\) message event** ``` { @@ -54,7 +56,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re } ``` -**To configure CloudWatch Events to invoke your function** +**To configure EventBridge \(CloudWatch Events\) to invoke your function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -62,7 +64,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re 1. Under **Function overview**, choose **Add trigger**\. -1. Set the trigger type to **EventBridge\(CloudWatch Events\)**\. +1. Set the trigger type to **EventBridge \(CloudWatch Events\)**\. 1. For **Rule**, choose **Create a new rule**\. @@ -70,9 +72,9 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. -Each AWS account can have up to 100 unique event sources of the **CloudWatch Events\- Schedule** source type\. Each of these can be the event source for up to five Lambda functions\. That is, you can have up to 500 Lambda functions that can be executing on a schedule in your AWS account\. +Each AWS account can have up to 100 unique event sources of the **EventBridge \(CloudWatch Events\)\- Schedule** source type\. Each of these can be the event source for up to five Lambda functions\. That is, you can have up to 500 Lambda functions that can be executing on a schedule in your AWS account\. **Topics** + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) -+ [AWS SAM template for a CloudWatch Events application](with-scheduledevents-example-use-app-spec.md) ++ [AWS SAM template for a EventBridge \(CloudWatch Events\) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) \ No newline at end of file diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index bdce5f13..ee9b970d 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -1,8 +1,8 @@ # Using AWS Lambda with Amazon EC2 -You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute Cloud and manage Amazon EC2 resources\. Amazon EC2 sends events to Amazon CloudWatch Events for lifecycle events such as when an instance changes state, when an Amazon Elastic Block Store volume snapshot completes, or when a spot instance is scheduled to be terminated\. You configure CloudWatch Events to forward those events to a Lambda function for processing\. +You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute Cloud and manage Amazon EC2 resources\. Amazon EC2 sends events to Amazon EventBridge \(CloudWatch Events\) for lifecycle events such as when an instance changes state, when an Amazon Elastic Block Store volume snapshot completes, or when a spot instance is scheduled to be terminated\. You configure EventBridge \(CloudWatch Events\) to forward those events to a Lambda function for processing\. -CloudWatch Events invokes your Lambda function asynchronously with the event document from Amazon EC2\. +EventBridge \(CloudWatch Events\) invokes your Lambda function asynchronously with the event document from Amazon EC2\. **Example instance lifecycle event** @@ -25,13 +25,13 @@ CloudWatch Events invokes your Lambda function asynchronously with the event doc } ``` -For details on configuring events in CloudWatch Events, see [Using AWS Lambda with Amazon CloudWatch Events](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon CloudWatch Events for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. +For details on configuring events in EventBridge \(CloudWatch Events\), see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon EventBridge \(CloudWatch Events\) for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. ## Permissions -To process lifecycle events from Amazon EC2, CloudWatch Events needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the CloudWatch Events console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: +To process lifecycle events from Amazon EC2, EventBridge \(CloudWatch Events\) needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the EventBridge \(CloudWatch Events\) console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: **Example resource\-based policy statement for Amazon EC2 lifecycle notifications** diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index 048ecc12..785af70b 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -146,7 +146,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 2af5cd7b..33b28b27 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -181,7 +181,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md index 7e346dbb..8917eda2 100644 --- a/doc_source/services-rds.md +++ b/doc_source/services-rds.md @@ -38,4 +38,4 @@ You can use AWS Lambda to process event notifications from an Amazon Relational The following section shows additional configurations and topics we recommend as part of this tutorial\. + If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. + For more information on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notifications](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\. -+ For more information on using Amazon SNS as trigger, see [Using Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file ++ For more information on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index a0c24ba6..e7b4e4fd 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -23,7 +23,7 @@ chmod 755 $(find . -type d) **Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* -When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the [S3Bucket and S3Key](API_UpdateFunctionCode.md#SSS-UpdateFunctionCode-request-S3Bucket) parameters\. +When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the S3Bucket and S3Key parameters\. **Note** When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 02d46203..34538767 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -44,13 +44,43 @@ Some libraries don't return promises but can be wrapped in code that does\. For **Issue:** *The AWS SDK included on the runtime updates automatically* Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ +#### [ Node\.js ] + +[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + +------ +#### [ Python ] + + [Deploy Python Lambda functions with \.zip file archives](python-package.md) + +------ +#### [ Ruby ] + + [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) + +------ +#### [ Java ] + + [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) + +------ +#### [ Go ] + + [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + +------ +#### [ C\# ] + + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + +------ +#### [ PowerShell ] + + [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) + +------ ## Python: Libraries load incorrectly diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index 0f426b7a..670f8e91 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -1,5 +1,41 @@ # Troubleshoot container image issues in Lambda +## Container: CodeArtifactUserException errors related to the code artifact\. + +**Issue:** *CodeArtifactUserPendingException error message* + +The CodeArtifact is pending optimization\. The function transitions to active state when Lambda completes the optimization\. HTTP response code 500\. + +**Issue:** *CodeArtifactUserDeletedException error message* + +The CodeArtifact is scheduled to be deleted\. HTTP response code 409\. + +**Issue:** *CodeArtifactUserFailedException error message* + +Lambda failed to optimize the code\. You need to correct the code and upload it again\. HTTP response code 409\. + +## Container: ManifestKeyCustomerException errors related to the code manifest key\. + +**Issue:** *KMSAccessDeniedException error message* + +You do not have permissions to access the key to decrypt the manifest\. HTTP response code 502\. + +**Issue:** *TooManyRequestsException error message* + +The client is being throttled\. The current request rate exceeds the KMS subscription rate\. HTTP response code 429\. + +**Issue:** *KMSNotFoundException error message* + +Lambda cannot find the key to decrypt the manifest\. HTTP response code 502\. + +**Issue:** *KMSDisabledException error message* + +The key to decrypt the manifest is disabled\. HTTP response code 502\. + +**Issue:** *KMSInvalidStateException error message* + +The key is in a state \(such as pending deletion or unavailable\) such that Lambda cannot use the key to decrypt the manifest\. HTTP response code 502\. + ## Container: Error occurs on runtime InvalidEntrypoint **Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 24b2ad24..68549657 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -268,7 +268,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index bbd900f8..b95e9aa0 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -89,6 +89,7 @@ Configure the `ParallelizationFactor` setting to process one shard of a Kinesis + [Amazon CloudWatch metrics](#events-dynamodb-metrics) + [Time windows](#services-ddb-windows) + [Reporting batch item failures](#services-ddb-batchfailurereporting) ++ [Amazon DynamoDB Streams configuration parameters](#services-ddb-params) + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) + [Sample function code](with-ddb-create-package.md) + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) @@ -152,11 +153,11 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. @@ -601,4 +602,26 @@ def handler(event, context): return {"batchItemFailures":[]} ``` ------- \ No newline at end of file +------ + +## Amazon DynamoDB Streams configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to DynamoDB Streams\. + + +**Event source parameters that apply to DynamoDB Streams** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| BisectBatchOnFunctionError | N | false | | +| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | +| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| ParallelizationFactor | N | 1 | Maximum: 10 | +| StartingPosition | Y | | TRIM\_HORIZON or LATEST | +| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index fafa324b..47bcaace 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -59,7 +59,7 @@ Lambda sends the batch of messages in the event parameter when it invokes your L + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) -+ [Event source configuration parameters](#services-kafka-parms) ++ [Self\-managed Apache Kafka configuration parameters](#services-kafka-parms) ## Managing access and permissions @@ -74,11 +74,14 @@ To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda f ### Optional Lambda function permissions -Your Lambda function might need permission to describe your AWS Secrets Manager secret or your AWS Key Management Service \(AWS KMS\) [customer managed customer master key \(CMK\)](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), or to access your virtual private cloud \(VPC\)\. +Your Lambda function might need these permissions: ++ Describe your AWS Secrets Manager secret ++ Access your AWS Key Management Service \(AWS KMS\) customer managed key ++ Access your Amazon Virtual Private Cloud \(Amazon VPC\) #### Secrets Manager and AWS KMS permissions -If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed CMK\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) + [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) @@ -269,11 +272,11 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ## Event source mapping errors @@ -296,7 +299,7 @@ The function configuration is not valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. -## Event source configuration parameters +## Self\-managed Apache Kafka configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index ef3459c1..247b3ac0 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -225,7 +225,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 58861b70..975cb443 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -70,6 +70,7 @@ Configure the `ParallelizationFactor` setting to process one shard of a Kinesis + [Amazon CloudWatch metrics](#events-kinesis-metrics) + [Time windows](#services-kinesis-windows) + [Reporting batch item failures](#services-kinesis-batchfailurereporting) ++ [Amazon Kinesis configuration parameters](#services-kinesis-params) + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) + [Sample function code](with-kinesis-create-package.md) + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) @@ -167,11 +168,11 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) To create the event source mapping with the AWS CLI, use the `create-event-source-mapping` command\. The following example uses the AWS CLI to map a function named `my-function` to a Kinesis data stream\. The data stream is specified by an Amazon Resource Name \(ARN\), with a batch size of 500, starting from the timestamp in Unix time\. @@ -550,4 +551,27 @@ def handler(event, context): return {"batchItemFailures":[]} ``` ------- \ No newline at end of file +------ + +## Amazon Kinesis configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Kinesis\. + + +**Event source parameters that apply to Kinesis** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| BisectBatchOnFunctionError | N | false | | +| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | +| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | +| ParallelizationFactor | N | 1 | Maximum: 10 | +| StartingPosition | Y | | AT\_TIMESTAMP, TRIM\_HORIZON, or LATEST | +| StartingPositionTimestamp | N | | Only valid if StartingPosition is set to AT\_TIMESTAMP\. The time from which to start reading, in Unix time seconds | +| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index b0a3db67..00a045be 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -28,6 +28,7 @@ By default, Amazon MQ has a weekly maintenance window for brokers\. During that + [Configuring a broker as an event source](#services-mq-eventsourcemapping) + [Event source mapping API](#services-mq-api) + [Event source mapping errors](#services-mq-errors) ++ [Amazon MQ and RabbitMQ configuration parameters](#services-mq-params) ## Lambda consumer group @@ -182,11 +183,11 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. @@ -300,4 +301,19 @@ The function's configuration is not valid\. Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a dead\-letter queue \(DLQ\)\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. **Note** -Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. \ No newline at end of file +Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. + +## Amazon MQ and RabbitMQ configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MQ and RabbitMQ\. + + +**Event source parameters that apply to Amazon MQ and RabbitMQ** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| Enabled | N | true | | +| FunctionName | Y | | | +| Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 9f6c28d6..b49efe60 100644 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -259,7 +259,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 5464af60..c96428d9 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -658,7 +658,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-scheduledevents-example-use-app-spec.md b/doc_source/with-scheduledevents-example-use-app-spec.md index 5b7a9ce0..4cb7c422 100644 --- a/doc_source/with-scheduledevents-example-use-app-spec.md +++ b/doc_source/with-scheduledevents-example-use-app-spec.md @@ -1,4 +1,4 @@ -# AWS SAM template for a CloudWatch Events application +# AWS SAM template for a EventBridge \(CloudWatch Events\) application You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index 1df57f0d..b005ec46 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -197,7 +197,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md index c9564cb0..3bcc95cb 100644 --- a/doc_source/with-sns.md +++ b/doc_source/with-sns.md @@ -1,4 +1,4 @@ -# Using Lambda with Amazon SNS +# Using AWS Lambda with Amazon SNS You can use a Lambda function to process Amazon Simple Notification Service \(Amazon SNS\) notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md new file mode 100644 index 00000000..f1112160 --- /dev/null +++ b/doc_source/with-sqs-cross-account-example.md @@ -0,0 +1,234 @@ +# Tutorial: Using a cross\-account Amazon SQS queue as an event source + +In this tutorial, you create a Lambda function that consumes messages from an Amazon Simple Queue Service \(Amazon SQS\) queue in a different AWS account\. This tutorial involves two AWS accounts: **Account A** refers to the account that contains your Lambda function, and **Account B** refers to the account that contains the Amazon SQS queue\. + +## Prerequisites + +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +aws --version +``` + +You should see the following output: + +``` +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 +``` + +For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + +On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + +## Create the execution role \(Account A\) + +In **Account A**, create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. + +**To create an execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the AWS Identity and Access Management \(IAM\) console\. + +1. Choose **Create role**\. + +1. Create a role with the following properties\. + + **Trusted entity** – **AWS Lambda** + + **Permissions** – **AWSLambdaSQSQueueExecutionRole** + + **Role name** – **cross\-account\-lambda\-sqs\-role** + +The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. + +## Create the function \(Account A\) + +In **Account A**, create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. + +**Note** +For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. + +**Example index\.js** + +``` +exports.handler = async function(event, context) { + event.Records.forEach(record => { + const { body } = record; + console.log(body); + }); + return {}; +} +``` + +**To create the function** +**Note** +Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. + +1. Save the code example as a file named `index.js`\. + +1. Create a deployment package\. + + ``` + zip function.zip index.js + ``` + +1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. + + ``` + aws lambda create-function --function-name CrossAccountSQSExample \ + --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ + --role arn:aws:iam:::role/cross-account-lambda-sqs-role + ``` + +## Test the function \(Account A\) + +In **Account A**, test your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. + +If the handler returns normally without exceptions, Lambda considers the message to be successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. + +1. Save the following JSON as a file named `input.txt`\. + + ``` + { + "Records": [ + { + "messageId": "059f36b4-87a3-44ab-83d2-661975830a7d", + "receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...", + "body": "test", + "attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1545082649183", + "SenderId": "AIDAIENQZJOLO23YVJ4VO", + "ApproximateFirstReceiveTimestamp": "1545082649185" + }, + "messageAttributes": {}, + "md5OfBody": "098f6bcd4621d373cade4e832627b4f6", + "eventSource": "aws:sqs", + "eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:example-queue", + "awsRegion": "us-east-1" + } + ] + } + ``` + + The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. + +1. Run the following `invoke` AWS CLI command\. + + ``` + aws lambda invoke --function-name CrossAccountSQSExample \ + --payload file://input.txt outputfile.txt + ``` + + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + +1. Verify the output in the file `outputfile.txt`\. + +## Create an Amazon SQS queue \(Account B\) + +In **Account B**, create an Amazon SQS queue that the Lambda function in **Account A** can use as an event source\. + +**To create a queue** + +1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose **Create queue**\. + +1. Create a queue with the following properties\. + + **Type** – **Standard** + + **Name** – **LambdaCrossAccountQueue** + + **Configuration** – Keep the default settings\. + + **Access policy** – Choose **Advanced**\. Paste in the following JSON policy: + + ``` + { + "Version": "2012-10-17", + "Id": "Queue1_Policy_UUID", + "Statement": [{ + "Sid":"Queue1_AllActions", + "Effect": "Allow", + "Principal": { + "AWS": [ + "arn:aws:iam:::role/cross-account-lambda-sqs-role" + ] + }, + "Action": "sqs:*", + "Resource": "arn:aws:sqs:us-east-1::LambdaCrossAccountQueue" + } + ] + } + ``` + + This policy grants the Lambda execution role in **Account A** permissions to consume messages from this Amazon SQS queue\. + +1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. + +## Configure the event source \(Account A\) + +In **Account A**, create an event source mapping between the Amazon SQS queue in **Account B**and your Lambda function by running the following `create-event-source-mapping` AWS CLI command\. + +``` +aws lambda create-event-source-mapping --function-name CrossAccountSQSExample --batch-size 10 \ +--event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue +``` + +To get a list of your event source mappings, run the following command\. + +``` +aws lambda list-event-source-mappings --function-name CrossAccountSQSExample \ +--event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue +``` + +## Test the setup + +You can now test the setup as follows: + +1. In **Account B**, open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + +1. Choose **LambdaCrossAccountQueue**, which you created earlier\. + +1. Choose **Send and receive messages**\. + +1. Under **Message body**, enter a test message\. + +1. Choose **Send message**\. + +Your Lambda function in **Account A** should receive the message\. Lambda will continue to poll the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +In **Account A**, clean up your execution role and Lambda function\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, then choose **Delete**\. + +1. Choose **Delete**\. + +In **Account B**, clean up the Amazon SQS queue\. + +**To delete the Amazon SQS queue** + +1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. + +1. Select the queue you created\. + +1. Choose **Delete**\. + +1. Enter **delete** in the text box\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index c063c40f..1ef0ff70 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -186,7 +186,7 @@ You can now delete the resources that you created for this tutorial, unless you 1. Select the function that you created\. -1. Choose **Actions**, **Delete**\. +1. Choose **Actions**, then choose **Delete**\. 1. Choose **Delete**\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 4d89b8bd..1cdf12bf 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -47,6 +47,9 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +**Note** +If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function\. This is true even if you set a batch window lower than 20 seconds\. + For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. **Example Amazon SQS message event \(FIFO queue\)** @@ -85,7 +88,9 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) ++ [Amazon SQS configuration parameters](#services-sqs-params) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) ++ [Tutorial: Using a cross\-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) @@ -101,7 +106,7 @@ Your function can scale in concurrency to the number of active message groups\. [Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [timeout](configuration-function-common.md) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. @@ -163,11 +168,11 @@ Configure your function timeout to allow enough time to process an entire batch ## Event source mapping APIs To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. @@ -190,4 +195,19 @@ You should see the following output: "State": "Creating", "StateTransitionReason": "USER_INITIATED" } -``` \ No newline at end of file +``` + +## Amazon SQS configuration parameters + +All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon SQS\. + + +**Event source parameters that apply to Amazon SQS** + +| Parameter | Required | Default | Notes | +| --- | --- | --- | --- | +| BatchSize | N | 100 | Maximum: 10000 | +| Enabled | N | true | | +| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| FunctionName | Y | | | +| MaximumBatchingWindowInSeconds | N | 0 | | \ No newline at end of file From eb7312d28e717234abcf6a5935780a8664ef0c13 Mon Sep 17 00:00:00 2001 From: Paul Mowat Date: Fri, 1 Oct 2021 14:07:49 +0100 Subject: [PATCH 134/243] fix: removing duplicate better --- doc_source/foundation-arch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md index 72c0156a..42d7fc33 100644 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -6,7 +6,7 @@ ## Advantages of using arm64 architecture -Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. +Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. The Graviton2 CPU uses the Neoverse N1 core and supports Armv8\.2 \(including CRC and crypto extensions\) plus several other architectural extensions\. From 57ac64264003ae7b0704eb213ddcec591a03194c Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:08:17 -0700 Subject: [PATCH 135/243] Restore the create bucket script. Create bucket script commented out. --- sample-apps/blank-python/1-create-bucket.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-apps/blank-python/1-create-bucket.sh b/sample-apps/blank-python/1-create-bucket.sh index 160f00ed..64a5f749 100755 --- a/sample-apps/blank-python/1-create-bucket.sh +++ b/sample-apps/blank-python/1-create-bucket.sh @@ -1,5 +1,5 @@ #!/bin/bash -# BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -# BUCKET_NAME=lambda-artifacts-$BUCKET_ID -# echo $BUCKET_NAME > bucket-name.txt -# aws s3 mb s3://$BUCKET_NAME +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME From 29e141060c25a28481e3c3904754d76b8cdbd255 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:26:21 -0700 Subject: [PATCH 136/243] Change pip to pip3 Python 2.7 has reached end of support. --- sample-apps/blank-python/2-build-layer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-python/2-build-layer.sh b/sample-apps/blank-python/2-build-layer.sh index 58f407b8..8f047d17 100755 --- a/sample-apps/blank-python/2-build-layer.sh +++ b/sample-apps/blank-python/2-build-layer.sh @@ -2,4 +2,4 @@ set -eo pipefail rm -rf package cd function -pip install --target ../package/python -r requirements.txt +pip3 install --target ../package/python -r requirements.txt From d6ab3f74ff30b26a1ac23538ec3e6daaa61dc374 Mon Sep 17 00:00:00 2001 From: Barry Devlin <54854911+devlinbd2@users.noreply.github.com> Date: Tue, 19 Oct 2021 07:29:00 -0700 Subject: [PATCH 137/243] Updated the list of supported Python versions. --- sample-apps/blank-python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-python/README.md b/sample-apps/blank-python/README.md index d33f2661..1c6d5710 100644 --- a/sample-apps/blank-python/README.md +++ b/sample-apps/blank-python/README.md @@ -11,7 +11,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements -- [Python 3.7](https://www.python.org/downloads/) +- [Python 3.7](https://www.python.org/downloads/). Sample also works with Python 3.8 and 3.9. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. From 8fbf1410c073f6b42ffbecb5a672441e93ef2e47 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Tue, 19 Oct 2021 09:58:04 -0700 Subject: [PATCH 138/243] fix: use valid json for the active mq example --- doc_source/with-mq.md | 64 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 00a045be..0de8fa33 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -45,38 +45,36 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { - "eventSource": "aws:amq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages": { - [ - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/text-message", - "data": "QUJDOkFBQUE=", - "connectionId": "myJMSCoID", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - }, - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data": "3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId": "myJMSCoID1", - "persistent": false, - "destination": { - "physicalname": "testQueue" - }, - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - } - ] - } + "eventSource":"aws:amq", + "eventSourceArn":"arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages":[ + { + "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/text-message", + "data":"QUJDOkFBQUE=", + "connectionId":"myJMSCoID", + "redelivered":false, + "destination":{ + "physicalname":"testQueue" + }, + "timestamp":1598827811958, + "brokerInTime":1598827811958, + "brokerOutTime":1598827811959 + }, + { + "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType":"jms/bytes-message", + "data":"3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId":"myJMSCoID1", + "persistent":false, + "destination":{ + "physicalname":"testQueue" + }, + "timestamp":1598827811958, + "brokerInTime":1598827811958, + "brokerOutTime":1598827811959 + } + ] } ``` @@ -316,4 +314,4 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | -| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | From bc06498ecce1bd2b7079cefa2db98d3981592817 Mon Sep 17 00:00:00 2001 From: Alfie John Date: Tue, 19 Oct 2021 21:57:12 +0000 Subject: [PATCH 139/243] Typo in the subcommand --- doc_source/invocation-layers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index ec2ca6c8..a7cda28c 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -151,7 +151,7 @@ The following procedure assumes that you have packaged the updated layer code in 1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. ``` - aws lambda get-function-config --function-name my-function --query 'Layers[*].Arn' --output yaml + aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml ``` 1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: @@ -217,4 +217,4 @@ The GitHub repository for this guide provides blank sample applications that dem + **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) + **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. From 20e3f1a7f209ad067207d36fc645f0ba1119900a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rski?= Date: Wed, 3 Nov 2021 21:42:20 +0100 Subject: [PATCH 140/243] Update info about json serialization --- doc_source/csharp-handler.md | 88 +++++++++++++++--------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md index 7ec210e0..c53803cc 100644 --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -50,47 +50,9 @@ All other types, as listed below, require you to specify a serializer\. + For asynchronous invocations the return\-type will be ignored by Lambda\. The return type may be set to void in such cases\. + If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with AWS Lambda](#csharp-handler-async)\. -Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializer that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. +Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.Json` in your `.csproj` file\. - -``` - - - netcoreapp3.1 - true - AssemblyName - - - - - - - - - -``` - - The example below illustrates the flexibility you can leverage by specifying the default Json\.NET serializer on one method and another of your choosing on a different method: - -``` -public class ProductService{ - [LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] - public Product DescribeProduct(DescribeProductRequest request) - { - return catalogService.DescribeProduct(request.Id); - } - - [LambdaSerializer(typeof(MyJsonSerializer))] - public Customer DescribeCustomer(DescribeCustomerRequest request) - { - return customerService.DescribeCustomer(request.Id); - } -} -``` - -**Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. +Instruction how to define serialize you can find in [Serializing Lambda functions](#csharp-handler-serializer)\. ## Handler signatures @@ -128,9 +90,8 @@ If the method specified in your handler string is overloaded, you must provide t ## Serializing Lambda functions For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: -+ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. -**Note** -If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda\.Serialization\.SystemTextJson](https://github.com/aws/aws-lambda-dotnet/tree/master/Libraries/src/Amazon.Lambda.Serialization.SystemTextJson) serializer\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`\. ++ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses native .net core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but please note that there are some limitation documented in the [Microsoft's documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. It is only available for \.net core 3\.1 runtimes or higher\. ++ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses `Newtonsoft.Json` NuGet package to handle serialization\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` @@ -139,24 +100,47 @@ If you are using \.NET Core 3\.1, we recommend that you use the [ Amazon\.Lambda You implement this method to serialize the result returned from the Lambda function handler into the response payload that is returned by the `Invoke` API\. -You use whichever serializer you wish by adding it as a dependency to your `MyProject.csproj` file\. + +To use serializer you need to add a dependency to your `csproj` file\. ``` -... - - + + + ``` -You then add it to your AssemblyInfo\.cs file\. For example, if you are using the default Json\.NET serializer, this is what you would add: +Next you need to define the serializer. For example you can define it in the AssemblyInfo\.cs file\. If you are using `Amazon.Lambda.Serialization.SystemTextJson`, the serializercan be defined that way: ``` -[assembly:LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] +[assembly: LambdaSerializer(typeof(DefaultLambdaJsonSerializer))] +``` + +Using `Amazon.Lambda.Serialization.Json`, it will be: + +``` +[assembly: LambdaSerializer(typeof(JsonSerializer))] ``` -**Note** -You can define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. For more information, see [Handling standard data types](#csharp-handler-types)\. +You can also define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. + +``` +public class ProductService{ + + [LambdaSerializer(typeof(JsonSerializer))] + public Product DescribeProduct(DescribeProductRequest request) + { + return catalogService.DescribeProduct(request.Id); + } + + [LambdaSerializer(typeof(MyJsonSerializer))] + public Customer DescribeCustomer(DescribeCustomerRequest request) + { + return customerService.DescribeCustomer(request.Id); + } +} +``` ## Lambda function handler restrictions @@ -216,4 +200,4 @@ If you use this pattern, there are some considerations you must take into accoun // Lambda may return before printing all tests since we're only waiting for one to finish. await Task.WhenAny(task1, task2, task3); } - ``` \ No newline at end of file + ``` From fed3290d83b61873ecae443a9cc2b876a6398b1e Mon Sep 17 00:00:00 2001 From: callezenwaka Date: Thu, 11 Nov 2021 11:06:22 +0100 Subject: [PATCH 141/243] Update typos in configuration-tags.md Update typos in configuration-tags.md --- doc_source/configuration-tags.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 1cd6d2af..e543d27a 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -43,7 +43,7 @@ You can filter functions based on the presence or value of a tag with the Lambda The search bar also supports searching for tag keys\. Type `tag` to see just a list of tag keys, or start typing the name of a key to find it in the list\. -With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. +With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. ## Using Tags with the AWS CLI @@ -77,7 +77,7 @@ If you want to view the tags that are applied to a specific Lambda function, you ``` aws lambda list-tags --resource function arn ``` -+ [GetFunction](API_GetFunction.md) – You supply your Lambda function name to a view a list of the tags associated with this function: ++ [GetFunction](API_GetFunction.md) – You supply your Lambda function name to view a list of the tags associated with this function: ``` aws lambda get-function --function-name my-function @@ -93,4 +93,4 @@ The following requirements apply to tags: + Maximum value length—256 Unicode characters in UTF\-8 + Tag keys and values are case sensitive\. + Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file ++ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. From afca60967a1e1a56c6ee4b6d00131b9c0dbc3f9d Mon Sep 17 00:00:00 2001 From: Barry Devlin Date: Fri, 12 Nov 2021 23:57:06 +0000 Subject: [PATCH 142/243] periodic content update --- doc_source/API_CreateEventSourceMapping.md | 1 + doc_source/API_CreateFunction.md | 2 +- doc_source/API_Invoke.md | 3 +- doc_source/API_SourceAccessConfiguration.md | 2 +- doc_source/API_UpdateEventSourceMapping.md | 1 + doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/configuration-envvars.md | 2 +- doc_source/configuration-filesystem.md | 96 ++++++----- doc_source/configuration-images.md | 51 +++++- doc_source/configuration-tags.md | 65 ++++++-- doc_source/configuration-versions.md | 7 +- doc_source/configuration-vpc.md | 21 ++- doc_source/csharp-image.md | 9 +- doc_source/csharp-package.md | 3 - doc_source/foundation-arch.md | 10 +- doc_source/foundation-networking.md | 106 ++++++++++++ doc_source/functions-states.md | 27 +-- doc_source/gettingstarted-images.md | 2 + doc_source/gettingstarted-limits.md | 5 +- doc_source/go-image.md | 4 +- doc_source/golang-package.md | 35 +++- doc_source/images-create.md | 2 +- doc_source/images-test.md | 4 +- doc_source/index.md | 3 +- doc_source/invocation-eventsourcemapping.md | 2 +- doc_source/invocation-layers.md | 133 +++++++++------ doc_source/java-image.md | 4 +- doc_source/lambda-api-permissions-ref.md | 2 +- doc_source/lambda-foundation.md | 1 + doc_source/lambda-golang.md | 3 + doc_source/lambda-java.md | 2 +- doc_source/lambda-nodejs.md | 6 +- doc_source/lambda-python.md | 8 +- doc_source/lambda-runtimes.md | 19 ++- doc_source/lambda-services.md | 4 +- doc_source/logging-using-cloudtrail.md | 35 ++-- doc_source/monitoring-code-profiler.md | 3 - doc_source/nodejs-image.md | 4 +- doc_source/provisioned-concurrency.md | 62 ++++--- doc_source/python-image.md | 8 +- doc_source/ruby-image.md | 4 +- doc_source/runtime-support-policy.md | 10 +- doc_source/runtimes-context.md | 3 + doc_source/runtimes-logs-api.md | 25 ++- doc_source/services-apigateway.md | 155 ++++++++++-------- .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-s3-object-lambda.md | 6 +- doc_source/using-extensions.md | 2 +- doc_source/with-ddb.md | 2 +- doc_source/with-kafka.md | 34 +--- doc_source/with-kinesis.md | 2 +- doc_source/with-mq.md | 64 ++++---- doc_source/with-msk.md | 71 +++++++- doc_source/with-s3-tutorial.md | 2 +- doc_source/with-sqs.md | 2 +- 55 files changed, 760 insertions(+), 383 deletions(-) create mode 100644 doc_source/foundation-networking.md diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 66941c8f..1e63ae7f 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -84,6 +84,7 @@ The maximum number of records in each batch that Lambda pulls from your stream o + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 0bfba5c1..b2cbf94b 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -86,7 +86,7 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index 2f449d7b..36f2c5ec 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -65,7 +65,8 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. ** [ Payload ](#API_Invoke_RequestSyntax) ** -The JSON that you want to provide to your Lambda function as input\. +The JSON that you want to provide to your Lambda function as input\. +You can enter the JSON directly\. For example, `--payload '{ "key": "value" }'`\. You can also specify a file path\. For example, `--payload file://payload.json`\. ## Response Syntax diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 5b108d1c..88c9fcdb 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -12,7 +12,7 @@ The type of authentication protocol, VPC components, or virtual host for your ev + `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. -+ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. ++ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. Type: String Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` Required: No diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index 09a0dcd3..260e96cd 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -78,6 +78,7 @@ The maximum number of records in each batch that Lambda pulls from your stream o + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index 1547566f..4d310a1b 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -47,7 +47,7 @@ Required: Yes The request accepts the following data in JSON format\. ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values\. The default value is `x86_64`\. +The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 9c9bcbff..4de65981 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -217,7 +217,7 @@ Lambda always provides server\-side encryption at rest with an AWS KMS key\. By If you prefer, you can provide an AWS KMS customer managed key instead\. You might do this to have control over rotation of the KMS key or to meet the requirements of your organization for managing KMS keys\. When you use a customer managed key, only users in your account with access to the KMS key can view or manage environment variables on the function\. -Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS produt pages*\. +Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS product pages*\. **Security in transit** For additional security, you can enable helpers for encryption in transit, which ensures that your environment variables are encrypted client\-side for protection in transit\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 9c510546..dfc08d2d 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -3,39 +3,27 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. **Topics** -+ [Connecting to a file system \(console\)](#configuration-filesystem-config) -+ [Configuring a file system and access point](#configuration-filesystem-setup) + [Execution role and user permissions](#configuration-filesystem-permissions) ++ [Configuring a file system and access point](#configuration-filesystem-setup) ++ [Connecting to a file system \(console\)](#configuration-filesystem-config) + [Configuring file system access with the Lambda API](#configuration-filesystem-api) + [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) + [Sample applications](#configuration-filesystem-samples) -## Connecting to a file system \(console\) - -A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. - -**Note** -If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. - -**To configure file system access** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Choose a function\. +## Execution role and user permissions -1. Choose **Configuration** and then choose **File systems**\. +Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): -1. Under **File system**, choose **Add file system**\. +**Execution role permissions** ++ **elasticfilesystem:ClientMount** ++ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** -1. Configure the following properties: - + **EFS file system** – The access point for a file system in the same VPC\. - + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. +These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. -**Pricing** -Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. -Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. +When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: -For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. +**User permissions** ++ **elasticfilesystem:DescribeMountTargets** ## Configuring a file system and access point @@ -61,20 +49,32 @@ For more information, see the following topics in the *Amazon Elastic File Syste + [Creating resources for Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html) + [Working with users, groups, and permissions](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions.html) -## Execution role and user permissions +## Connecting to a file system \(console\) -Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): +A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. -**Execution role permissions** -+ **elasticfilesystem:ClientMount** -+ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** +**Note** +If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. +**To configure file system access** -When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. -**User permissions** -+ **elasticfilesystem:DescribeMountTargets** +1. Choose a function\. + +1. Choose **Configuration** and then choose **File systems**\. + +1. Under **File system**, choose **Add file system**\. + +1. Configure the following properties: + + **EFS file system** – The access point for a file system in the same VPC\. + + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. + +**Pricing** +Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. +Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. + +For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. ## Configuring file system access with the Lambda API @@ -130,6 +130,7 @@ You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SA **Example template\.yml – File system configuration** ``` +Transform: AWS::Serverless-2016-10-31 Resources: VPC: Type: AWS::EC2::VPC @@ -141,20 +142,33 @@ Resources: VpcId: Ref: VPC CidrBlock: 10.0.1.0/24 - AvailabilityZone: "eu-central-1a" + AvailabilityZone: "us-west-2a" EfsSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: VpcId: Ref: VPC GroupDescription: "mnt target sg" - SecurityGroupEgress: + SecurityGroupIngress: - IpProtocol: -1 CidrIp: "0.0.0.0/0" FileSystem: Type: AWS::EFS::FileSystem Properties: PerformanceMode: generalPurpose + AccessPoint: + Type: AWS::EFS::AccessPoint + Properties: + FileSystemId: + Ref: FileSystem + PosixUser: + Uid: "1001" + Gid: "1001" + RootDirectory: + CreationInfo: + OwnerGid: "1001" + OwnerUid: "1001" + Permissions: "755" MountTarget1: Type: AWS::EFS::MountTarget Properties: @@ -167,11 +181,17 @@ Resources: MyFunctionWithEfs: Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) Properties: - CodeUri: function/. - Description: Use a file system. + Handler: index.handler + Runtime: python3.9 + VpcConfig: + SecurityGroupIds: + - Ref: EfsSecurityGroup + SubnetIds: + - Ref: Subnet1 FileSystemConfigs: - - Arn: "arn:aws:elasticfilesystem:eu-central-1:123456789101:access-point/fsap-015cxmplb72b405fd" - LocalMountPath: "/mnt/efs0" + - Arn: !GetAtt AccessPoint.Arn + LocalMountPath: "/mnt/efs" + Description: Use a file system. DependsOn: "MountTarget1" ``` diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md index e0159494..f5ffb645 100644 --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -37,7 +37,7 @@ When you deploy code as a container image to a Lambda function, the image underg ## Amazon ECR permissions -For your function to access the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: +For a function in the same account as the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: ``` { @@ -59,6 +59,53 @@ If the Amazon ECR repository does not include these permissions, Lambda adds `ec To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. +### Amazon ECR cross\-account permissions + +A different account in the same region can create a function that uses a container image owned by your account\. In the following example, your Amazon ECR repository permissions policy needs the following statements to grant access to account number 123456789012\. ++ **CrossAccountPermission** – Allows account 123456789012 to create and update Lambda functions that use images from this ECR repository\. ++ **LambdaECRImageCrossAccountRetrievalPolicy** – Lambda will eventually set a function's state to inactive if it is not invoked for an extended period\. This statement is required so that Lambda can retrieve the container image for optimization and caching on behalf of the function owned by 123456789012\. + +**Example Add cross\-account permission to your repository** + +``` +{"Version": "2012-10-17", + "Statement": [ + { + "Sid": "CrossAccountPermission", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "AWS": "arn:aws:iam::123456789012:root" + } + }, + { + "Sid": "LambdaECRImageCrossAccountRetrievalPolicy", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Condition": { + "StringLike": { + "aws:sourceARN": + "arn:aws:lambda:us-east-1:123456789012:function:*" + } + } + } + ] +} +``` + +To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. + +If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. + ## Override the container settings You can use the Lambda console or the Lambda API to override the following container image settings: @@ -163,7 +210,7 @@ To create a function defined as container image, use the `create-function` comma When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. - Note that you must create the function from the same account as the container registry in Amazon ECR\. + You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. ``` aws lambda create-function --region sa-east-1 --function-name my-function \ diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 1cd6d2af..feec12c4 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -1,16 +1,25 @@ -# Tagging Lambda Functions +# Using tags on AWS Lambda functions You can tag Lambda functions to organize them by owner, project or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources and adding detail to billing reports\. **Topics** -+ [Adding tags to a function \(console\)](#configuration-tags-config) -+ [Using tags to filter functions \(console\)](#configuration-tags-filter) -+ [Using Tags with the AWS CLI](#configuration-tags-cli) -+ [Tag Key and Value Requirements](#configuration-tags-restrictions) ++ [Using tags with the Lambda console](#using-tags-with-the-console) ++ [Using tags with the AWS Command Line Interface](#configuration-tags-cli) ++ [Requirements for tags](#configuration-tags-restrictions) -## Adding tags to a function \(console\) +## Using tags with the Lambda console -**To add tags to a function** +You can use the console to add tags to existing functions and to filter functions by the tags that you add\. + +### Adding tags to a function + +**To add tags to a function \(console\)** + +1. Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: + + **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to view the function\. + + **lambda:TagResource**—Grant this permission to anyone who needs to add tags to a function\. + + For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -20,16 +29,24 @@ You can tag Lambda functions to organize them by owner, project or department\. 1. Under **Tags**, choose **Manage tags**\. -1. Enter a key and value\. To add additional tags, choose **Add new tag**\. +1. Enter a key and value\. To add additional tags, choose **Add new tag**\. + + Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-add.png) 1. Choose **Save**\. -## Using tags to filter functions \(console\) +### Filtering functions by tag + +You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. -You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. +Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. -**To filter functions with tags** +**To filter functions with tags \(console\)** + +1. Make sure that you have the permissions you need: + + lambda:ListTags grants permission to view functions that have tags\. + + lambda:TagResource grants permission to add tags to a function\. 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -45,7 +62,21 @@ The search bar also supports searching for tag keys\. Type `tag` to see just a l With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. -## Using Tags with the AWS CLI +## Using tags with the AWS Command Line Interface + +You can use the console to create functions that have tags, add tags to existing functions, and to filter functions by the tags that you add\. + +### Permissions required for working with tags + +Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: ++ **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to call `GetFunction` or `ListTags` on it\. ++ **lambda:TagResource**—Grant this permission to anyone who needs to call `CreateFunction` or `TagResource`\. + +For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. + +### Creating tags when you create a function + +Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. When you create a new Lambda function, you can include tags with the `--tags` option\. @@ -71,6 +102,8 @@ aws lambda untag-resource --resource function arn \ --tag-keys Department ``` +### Viewing tags on a function + If you want to view the tags that are applied to a specific Lambda function, you can use either of the following Lambda API commands: + [ListTags](API_ListTags.md) – You supply your Lambda function ARN \(Amazon Resource Name\) to view a list of the tags associated with this function: @@ -83,9 +116,13 @@ If you want to view the tags that are applied to a specific Lambda function, you aws lambda get-function --function-name my-function ``` -You can also use the AWS Tagging Service’s [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. For more information about the AWS Tagging Service, see [Working with Resource Groups](https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/resource-groups.html)\. +#### Filtering functions by tag + +You can use the AWS Resource Groups Tagging API [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) action to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. + +For more information about the AWS Resource Groups service, see [What are resource groups?](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) in the *AWS Resource Groups and Tags User Guide*\. -## Tag Key and Value Requirements +## Requirements for tags The following requirements apply to tags: + Maximum number of tags per resource—50 diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index d0890f5a..e8b3b26e 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -2,10 +2,13 @@ You can use versions to manage the deployment of your functions\. For example, you can publish a new version of a function for beta testing without affecting users of the stable production version\. Lambda creates a new version of your function each time that you publish the function\. The new version is a copy of the unpublished version of the function\. +**Note** +Lambda doesn't create a new version if the code in the unpublished version is the same as the previous published version\. You need to deploy code changes in $LATEST before you can create a new version\. + A function version includes the following information: + The function code and all associated dependencies\. + The Lambda runtime that invokes the function\. -+ All of the function settings, including the environment variables\. ++ All the function settings, including the environment variables\. + A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. **Topics** @@ -16,7 +19,7 @@ A function version includes the following information: ## Creating function versions -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, the code and most of the settings are locked to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. +You can change the function code and settings only on the unpublished version of a function\. When you publish a version, Lambda locks the code and most of the settings to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. You can create a function version using the Lambda console\. diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index bb9b45ed..de3d4e65 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -2,17 +2,14 @@ You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources while the function is running\. -When you connect a function to a VPC, Lambda creates an [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) for each subnet in your function's VPC configuration\. This process can take several minutes\. +When you connect a function to a VPC, Lambda assigns your function to a Hyperplane ENI \(elastic network interface\) for each subnet in your function's VPC configuration\. Lambda creates a Hyperplane ENI the first time a unique subnet and security group combination is defined for a VPC\-enabled function in an account\. -While Lambda creates a network interface, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For more information about function states, see [Lambda function states](functions-states.md)\. - -Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) that has an existing Lambda\-managed network interface is much quicker than having Lambda create additional network interfaces\. However, if you have many functions or functions with high network usage, Lambda might still create additional network interfaces\. - -If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. +While Lambda creates a Hyperplane ENI, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For details about the Hyperplane ENI lifecycle, see [Lambda Hyperplane ENIs](foundation-networking.md#foundation-nw-eni)\. Lambda functions can't connect directly to a VPC with [ dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. **Topics** ++ [Managing VPC connections](#vpc-managing-eni) + [Execution role and user permissions](#vpc-permissions) + [Configuring VPC access \(console\)](#vpc-configuring) + [Configuring VPC access \(API\)](#vpc-configuring-api) @@ -21,6 +18,18 @@ Lambda functions can't connect directly to a VPC with [ dedicated instance tenan + [VPC tutorials](#vpc-tutorials) + [Sample VPC configurations](#vpc-samples) +## Managing VPC connections + +This section provides a summary of Lambda VPC connections\. For details about VPC networking in Lambda, see [ VPC networking for Lambda](foundation-networking.md)\. + +Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) that has an existing Lambda\-managed network interface is much quicker than creating a new network interface\. + +If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. + +If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects funtion invocations to the previous VPC\. After the update is complete, new invocations start using the the new VPC and the Lambda function is no longer connected to the older VPC\. + +For short\-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself\. To ensure connection reuse for short\-lived/infrequently invoked functions, we recommend that you use *TCP keep\-alive* for connections that were created during your function initialization, to avoid creating new connections for subsequent invokes\. For more information on reusing connections using keep\-alive, refer to [Lambda documentation on reusing connections](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)[\.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) + ## Execution role and user permissions Lambda uses your function's permissions to create and manage network interfaces\. To connect to a VPC, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 4a8b6105..9ca53129 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -2,21 +2,18 @@ You can deploy your Lambda function code as a [container image](images-create.md)\. -**Note** -Lambda does not support arm64 architecture for \.NET runtimes\. - AWS provides the following resources to help you build a container image for your \.NET function: + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -39,7 +36,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/blob/master/LambdaRuntimeDockerfiles/dotnet5/Dockerfile) | +| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md index b616ac68..cf47126e 100644 --- a/doc_source/csharp-package.md +++ b/doc_source/csharp-package.md @@ -4,9 +4,6 @@ A \.NET Core deployment package \(\.zip file archive\) contains your function's Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. -**Note** -Lambda does not support arm64 architecture for \.NET runtimes\. - **Topics** + [\.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md index 42d7fc33..5e278770 100644 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -4,6 +4,13 @@ + arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. + x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. +**Topics** ++ [Advantages of using arm64 architecture](#foundation-arch-adv) ++ [Function migration to arm64 architecture](#foundation-arch-consider) ++ [Function code compatibility with arm64 architecture](#foundation-arch-considerations) ++ [Suggested migration steps](#foundation-arch-steps) ++ [Configuring the instruction set architecture](#foundation-arch-adv) + ## Advantages of using arm64 architecture Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. @@ -71,6 +78,7 @@ Lambda provides the following runtimes for the arm64 architecture\. These runtim + Ruby 2\.7 + Custom Runtime on Amazon Linux 2 -Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 instruction set architecture\. You can use the custom runtime \(provided\.al2\) to run Go functions with arm64 architecture\. +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. For example, see [Build a Go function for the provided\.al2 runtime](golang-package.md#golang-package-al2) or [Create a Go image from the provided\.al2 base image](go-image.md#go-image-al2)\. For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md new file mode 100644 index 00000000..be157636 --- /dev/null +++ b/doc_source/foundation-networking.md @@ -0,0 +1,106 @@ +# VPC networking for Lambda + +Amazon Virtual Private Cloud \(Amazon VPC\) is a virtual network in the AWS cloud, dedicated to your AWS account\. You can use Amazon VPC to create a private network for resources such as databases, cache instances, or internal services\. For more information about Amazon VPC, see [What is Amazon VPC?](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) + +A Lambda function always runs inside a VPC owned by the Lambda service\. Lambda applies network access and security rules to this VPC and Lambda maintains and monitors the VPC automatically\. If your Lambda function needs to access the resources in your account VPC, [ configure the function to access the VPC](configuration-vpc.md)\. Lambda provides managed resources named Hyperplane ENIs, which your Lambda function uses to connect from the Lambda VPC to an ENI \(Elastic network interface\) in your account VPC\. + +There's no additional charge for using a VPC or a Hyperplane ENI\. There are charges for some VPC components, such as NAT gateways\. For more information, see [Amazon VPC Pricing](http://aws.amazon.com/vpc/pricing)\. + +**Topics** ++ [VPC network elements](#foundation-nw-concepts) ++ [Connecting Lambda functions to your VPC](#foundation-nw-connecting) ++ [Lambda Hyperplane ENIs](#foundation-nw-eni) ++ [Connections](#foundation-nw-addressing) ++ [Security](#foundation-nw-security) ++ [Observability](#foundation-nw-obs) + +## VPC network elements + +Amazon VPC networks includes the following network elements: ++ Elastic network interface – [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) is a logical networking component in a VPC that represents a virtual network card\. ++ Subnet – A range of IP addresses in your VPC\. You can add AWS resources to a specified subnet\. Use a public subnet for resources that must connect to the internet, and a private subnet for resources that don't connect to the internet\. ++ Security group – use security groups to control access to the AWS resources in each subnet\. ++ Access control list \(ACL\) – use a network ACL to provide additional security in a subnet\. The default subnet ACL allows all inbound and outbound traffic\. ++ Route table – contains a set of routes that AWS uses to direct the network traffic for your VPC\. You can explicitly associate a subnet with a particular route table\. By default, the subnet is associated with the main route table\. ++ Route – each route in a route table specifies a range of IP addresses and the destination where Lambda sends the traffic for that range\. The route also specifies a target, which is the gateway, network interface, or connection through which to send the traffic\. ++ NAT gateway – An AWS Network Address Translation \(NAT\) service that controls access from a private VPC private subnet to the Internet\. ++ VPC endpoints – You can use an Amazon VPC endpoint to create private connectivity to services hosted in AWS, without requiring access over the internet or through a NAT device, VPN connection, or AWS Direct Connect connection\. For more information, see [AWS PrivateLink and VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-overview.html)\. + +For more information about Amazon VPC networking definitions, see [ How Amazon VPC works](https://docs.aws.amazon.com/vpc/latest/userguide/how-it-works.html) in the Amazon VPC Developer Guide and the [Amazon VPC FAQs\.](http://aws.amazon.com/vpc/faqs.html) + +## Connecting Lambda functions to your VPC + +By default, Lambda runs your functions in a secure VPC\. Lambda owns this VPC, which isn't connected to your account's [default VPC](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. + +Lambda accesses resources in your VPC using a Hyperplane ENI\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC using VPC\-to\-VPC NAT \(V2N\)\. V2N provides connectivity from the Lambda VPC to your account VPC, but not in the other direction\. + +When you create a Lambda function \(or update its VPC settings\), Lambda allocates a Hyperplane ENI for each subnet in your function's VPC configuration\. Multiple Lambda functions can share a network interface, if the functions share the same subnet and security group\. + +To connect to another AWS service, you can use [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) for private communications between your VPC and supported AWS services\. An alternative approach is to use a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) to route outbound traffic to another AWS service\. + +To give your function access to the internet, route outbound traffic to a NAT gateway in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. + +For information about how to configure Lambda VPC networking, see [Lambda networking](configuration-vpc.md)\. + +## Lambda Hyperplane ENIs + +The Hyperplane ENI is a managed network resource that the Lambda service creates and manages\. Multiple execution environments in the Lambda VPC can use a Hyperplane ENI to securely access resources inside of VPCs in your account\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC\. For more information about Hyperplane ENIs, see [Improved VPC networking for AWS Lambda functions ](http://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/) in the AWS compute blog\. + +Each unique security group and subnet combination in your account requires a different network interface\. Functions in the account that share the same security group and subnet combination use the same network interfaces\. + +Because the functions in your account share the ENI resources, the ENI lifecycle is more complex than other Lambda resources\. The following sections describe the ENI lifecycle\. + +**Topics** ++ [Creating ENIs](#foundation-nw-eni-create) ++ [Managing ENIs](#foundation-nw-eni-man) ++ [Deleting ENIs](#foundation-nw-eni-delete) + +### Creating ENIs + +Lambda may create Hyperplane ENI resources for a newly created VPC\-enabled function or for a VPC configuration change to an existing function\. The function remains in pending state while Lambda creates the required resources\. When the Hyperplane ENI is ready, the function transitions to active state and the ENI becomes available for use\. Lambda can require several minutes to create a Hyperplane ENI\. + +For a newly created VPC\-enabled function, any invocations or other API actions that operate on the function fail until the function state transitions to active\. + +For a VPC configuration change to an existing function, any function invocations continue to use the Hyperplane ENI associated with the old subnet and security group configuration until the function state transitions to active\. + +If a Lambda function remains idle for consecutive weeks, Lambda reclaims the unused Hyperplane ENIs and sets the function state to idle\. The next invocation causes Lambda to reactivate the idle function\. The invocation fails, and the function enters pending state until Lambda completes the creation or allocation of a Hyperplane ENI\. + +For more information about function states, see [Lambda function states](functions-states.md)\. + +### Managing ENIs + +Lambda uses permissions in your function's execution role to create and manage network interfaces\. Lambda creates a Hyperplane ENI when you define a unique subnet plus security group combination for a VPC\-enabled function in an account\. Lambda reuses the Hyperplane ENI for other VPC\-enabled functions in your account that use the same subnet and security group combination\. + +There is no quota on the number of Lambda functions that can use the same Hyperplane ENI\. However, each Hyperplane ENI supports up to 65,000 connections/ports\. If the number of connections exceeds 65,000, Lambda creates a new Hyperplane ENI to provide additional connections\. + +When you update your function configuration to access a different VPC, Lambda terminates connectivity to the Hyperplane ENI in the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, invocations to the function continue to use the previous VPC\. After the update is complete, new invocations start using the Hyperplane ENI in the new VPC\. At this point, the Lambda function is no longer connected to the previous VPC\. + +### Deleting ENIs + +When you update a function to remove its VPC configuration, Lambda requires up to 20 minutes to delete the attached Hyperplane ENI\. Lambda only deletes the ENI if no other function \(or published function version\) is using that Hyperplane ENI\. + +Lambda relies on permissions in the function [ execution role](lambda-intro-execution-role.md) to delete the Hyperplane ENI\. If you delete the execution role before Lambda deletes the Hyperplane ENI, Lambda won't be able to delete the Hyperplane ENI\. You can manually perform the deletion\. + +Lambda doesn't delete network interfaces that are in use by functions or function versions in your account\. You can use the [Lambda ENI Finder](https://github.com/awslabs/aws-support-tools/tree/master/Lambda/FindEniMappings) to identify the functions or function versions that are using a Hyperplane ENI\. For any functions or function versions that you no longer need, you can remove the VPC configuration so that Lambda deletes the Hyperplane ENI\. + +## Connections + +Lambda supports two types of connections: TCP \(Transmission Control Protocol\) and UDP \(User Datagram Protocol\)\. + +When you create a VPC, Lambda automatically creates a set of DHCP options and associates them with the VPC\. You can configure your own DHCP options set for your VPC\. For more details, refer to [Amazon VPC DHCP options](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)\. + +Amazon provides a DNS server \(the Amazon Route 53 resolver\) for your VPC\. For more information, see [DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html)\. + +## Security + +AWS provides [https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) and [https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html) to increase security in your VPC\. Security groups control inbound and outbound traffic for your instances, and network ACLs control inbound and outbound traffic for your subnets\. Security groups provide enough access control for most subnets\. You can use network ACLs if you want an additional layer of security for your VPC\. For more information, see [Internetwork traffic privacy in Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Security.html)\. Every subnet that you create is automatically associated with the VPC's default network ACL\. You can change the association, and you can change the contents of the default network ACL\. + +For general security best practices, see [VPC security best practices](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html)\. For details on how you can use IAM to manage access to the Lambda API and resources, see [AWS Lambda permissions](lambda-permissions.md)\. + +You can use Lambda\-specific condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For more information about VPC condition keys, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. + +## Observability + +You can use [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html) to capture information about the IP traffic going to and from network interfaces in your VPC\. You can publish Flow log data to Amazon CloudWatch Logs or Amazon S3\. After you've created a flow log, you can retrieve and view its data in the chosen destination\. + +Note: when you attach a function to a VPC, the CloudWatch log messages do not use the VPC routes\. Lambda sends them using the regular routing for logs\. \ No newline at end of file diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index a79655f9..aec7996c 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -1,37 +1,24 @@ # Lambda function states -When you create or update a function, AWS Lambda provisions the compute and networking resources that enable it to run\. In most cases your function is ready to be invoked or modified after a few seconds\. However, there are situations where this action can take longer, for example, configuring your function to connect to a virtual private cloud \(VPC\)\. This may lead to situations where invocation of your function fails due to resources not being available\. To indicate when your function is ready to invoke, Lambda includes a state field in the function configuration for all functions\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. - -Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: +Lambda includes a state field in the function configuration for all functions to indicate when your function is ready to invoke\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: + `Pending` – After Lambda creates the function, it sets the state to pending\. While in pending state, Lambda attempts to create or configure resources for the function, such as VPC or EFS resources\. Lambda does not invoke a function during pending state\. Any invocations or other API actions that operate on the function will fail\. + `Active` – Your function transitions to active state after Lambda completes resource configuration and provisioning\. Functions can only be successfully invoked while active\. + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -Check a function's state before invocation to verify that it is active\. You can do this using the Lambda API action [GetFunctionConfiguration](API_GetFunctionConfiguration.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. - -To view the function's state with the AWS CLI, use `get-function-configuration`\. +If you are utilzing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` -aws lambda get-function-configuration --function-name my-function +aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' ``` You should see the following output: ``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "TracingConfig": { - "Mode": "Active" - }, - "State": "Pending", - "StateReason": "The function is being created.", - "StateReasonCode": "Creating", - ... -} +[ + "Active", + "Successful" +] ``` Functions have two other attributes, `StateReason` and `StateReasonCode`\. These provide information and context about the function’s state when it is not active for troubleshooting issues\. diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index fbf47dbd..d185ab0a 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -88,6 +88,8 @@ In the following commands, replace `123456789012` with your AWS account ID\. ## Upload the image to the Amazon ECR repository +In the following commands, replace `123456789012` with your AWS account ID\. + 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index f19a906e..1cf0c322 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -4,11 +4,14 @@ Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. +**Note** +New AWS accounts might start out with limits that are lower than these defaults\. Lambda monitors usage and raises your limits automatically based on your usage\. + | Resource | Default quota | Can be increased up to | | --- | --- | --- | | Concurrent executions | 1,000 | Tens of thousands | -| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. | 75 GB | Terabytes | +| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. For best practices on managing your code storage, see [Monitoring Lambda code storage](https://docs.aws.amazon.com/lambda/latest/operatorguide/code-storage.html) in the *Lambda Operator Guide*\. | 75 GB | Terabytes | | Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | | [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | diff --git a/doc_source/go-image.md b/doc_source/go-image.md index d1cb58d3..28da6942 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index c9ae5298..bca5bf0f 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -10,6 +10,7 @@ This page describes how to create a \.zip file as your deployment package for th + [Sample applications](#golang-package-sample) + [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) + [Creating a \.zip file on Windows](#golang-package-windows) ++ [Build Go with the provided\.al2 runtime](#golang-package-al2) ## Prerequisites @@ -116,4 +117,36 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ~\Go\Bin\build-lambda-zip.exe -output main.zip main ``` ------- \ No newline at end of file +------ + +## Build Go with the provided\.al2 runtime + +Go is implemented differently than other native runtimes\. Lambda treats Go as a custom runtime, so you can create a Go function on the provided\.al2 runtime\. You can use the AWS SAM build command to build the \.zip file package\. + +**Using AWS SAM to build Go for AL2 function** + +1. Update the AWS SAM template to use the provided\.al2 runtime\. Also set the BuildMethod to makefile\. + + ``` + Resources: + HelloWorldFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: hello-world/ + Handler: my.bootstrap.file + Runtime: provided.al2 + Architectures: [arm64] + Metadata: + BuildMethod: makefile + ``` + + Remove the `Architectures` property to build the package for the x86\_64 instruction set architecture\. + +1. Add file makefile to the project folder, with the following contents: + + ``` + GOOS=linux go build -o bootstrap + cp ./bootstrap $(ARTIFACTS_DIR)/. + ``` + +For an example application, download [ Go on AL2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. The readme file contains the instructions to build and run the application\. You can also view the blog post [ Migrating AWS Lambda functions to Amazon Linux 2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 98a267a9..2c5c7ce2 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -1,6 +1,6 @@ # Creating Lambda container images -You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. Note that you must create the Lambda function from the same account as the container registry in Amazon ECR\. +You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. diff --git a/doc_source/images-test.md b/doc_source/images-test.md index 3cf4ccd3..0dad96f2 100644 --- a/doc_source/images-test.md +++ b/doc_source/images-test.md @@ -100,8 +100,8 @@ You can build RIE into a base image\. The following steps show how to download t ``` 1. Download the runtime interface emulator for your target architecture from GitHub into your project directory\. Lambda provides an emulator for each of the instruction set architectures\. - + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie) - + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/aws-lambda-rie-arm64) + + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) + + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64) 1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile\. diff --git a/doc_source/index.md b/doc_source/index.md index b74e136a..8c8ead85 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -24,6 +24,7 @@ Amazon's trademarks and trade dress may not be used in + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) + + [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) @@ -50,7 +51,7 @@ Amazon's trademarks and trade dress may not be used in + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Configuring code signing for AWS Lambda](configuration-codesigning.md) - + [Tagging Lambda Functions](configuration-tags.md) + + [Using tags on AWS Lambda functions](configuration-tags.md) + [Using layers with your Lambda function](invocation-layers.md) + [Invoking AWS Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index d6bddbb5..854d36dd 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -14,7 +14,7 @@ An event source mapping uses permissions in the function's [execution role](lamb To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index a7cda28c..fdafb450 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -5,44 +5,79 @@ A Lambda layer is a \.zip file archive that can contain additional code or other You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](lambda-images.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. **Topics** -+ [Configuring a function to use layers](#invocation-layers-using) -+ [Accessing the contents of a layer](#invocation-layers-accessing) ++ [Configuring functions to use layers](#invocation-layers-using) ++ [Accessing layer content from your function](#invocation-layers-accessing) + [Finding layer information](#configuration-layers-finding) -+ [Updating a layer version that your function uses](#invocation-layers-script) + [Adding layer permissions](#invocation-layers-permissions) + [Using AWS SAM to add a layer to a function](#invocation-layers-cloudformation) + [Sample applications](#invocation-layers-samples) -## Configuring a function to use layers +## Configuring functions to use layers -A Lambda function can use up to five layers at a time\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. +You can add up to five layers to a Lambda function\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. **Note** Make sure that the layers that you add to a function are compatible with the runtime and instruction set architecture of the function\. -Console +### Configuring layers with the console -**Configuring a function to use layers \(Console\)** +**Adding a layer to a function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Choose the function to configure\. + 1. Under **Layers**, choose **Add a layer** -1. Under **Add layer**, choose a layer source\. +1. Under **Choose a layer**, choose a layer source\. 1. For the **AWS layers** or **Custom layers** layer source: 1. Choose a layer from the pull\-down menu\. - 1. Choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + 1. Under **Version**, choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. + + 1. Choose **Add**\. + +1. For the **Specify an ARN** layer source: + + 1. Enter an ARN in the text box and choose **Verify**\. + + 1. Choose **Add**\. + +The order in which you add the layers is the order in which Lambda later merges the layer content into the execution environment\. You can change the layer merge order using the console\. + +**Update layer order for your function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to configure\. + +1. Under **Layers**, choose **Edit** + +1. Choose one of the layers\. + +1. Choose **Merge earlier** or **Merge later** to adjust the order of the layers\. + +1. Choose **Save**\. + +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the console to update your function's layer versions\. + +**Update layer versions for your function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + +1. Choose the function to configure\. -1. For the **Specify an ARN** layer source:: +1. Under **Layers**, choose **Edit** - 1. Enter an ARN in the text box +1. Under **Layer version**, enter the new layer version\. You can change the version for one or more of the listed layers\. -API +1. Choose **Save**\. + +### Configuring layers with the API To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. @@ -75,7 +110,11 @@ You should see output similar to the following: } ``` -To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. Or, to remove all layers, specify an empty list\. +To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. The order in which you add the layers is the order in which Lambda later extracts the layer content into the execution environment\. + + + +To remove all layers, specify an empty list\. ``` aws lambda update-function-configuration --function-name my-function --layers [] @@ -83,9 +122,38 @@ aws lambda update-function-configuration --function-name my-function --layers [] The creator of a layer can delete a version of the layer\. If you're using that layer version in a function, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. -## Accessing the contents of a layer +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the API to update the layer versions that your function uses\. + +**Update layer versions for your function** -When you include a layer in a Lambda function, Lambda extracts the layer's contents into the `/opt` directory in the function execution environment\. Lambda extracts layers in the order that you specified them, merging any folders with the same name\. If the same file appears in multiple layers, the function uses the version in the last extracted layer\. +To update one or more layer versions for your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to include all of the layer versions for the function, even if you are updating one of the layer versions\. If the function already has layers, the new list overwrites the previous list\. + +The following procedure steps assume that you have packaged the updated layer code into a local file named `layer.zip`\. + +1. \(Optional\) If the new layer version is not published yet, publish the new version\. + + ``` + aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ + --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 + ``` + +1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. + + ``` + aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml + ``` + +1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: + + ``` + aws lambda update-function-configuration --function-name my-function \ + --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ + arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 + ``` + +## Accessing layer content from your function + +If your Lambda function includes layers, Lambda extracts the layer contents into the `/opt` directory in the function execution environment\. Lambda extracts the layers in the order \(low to high\) listed by the function\. Lambda merges folders with the same name, so if the same file appears in multiple layers, the function uses the version in the last extracted layer\. Each [Lambda runtime](lambda-runtimes.md) adds specific `/opt` directory folders to the PATH variable\. Your function code can access the layer content without the need to specify the path\. For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. @@ -129,39 +197,6 @@ You can also get the latest version of a layer using the list\-layer\-versions c aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn ``` -## Updating a layer version that your function uses - -Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. - -To add an updated layer version to your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to list all of the layer versions that you want to add\. If the function already has layers, the new list overwrites the previous list\. - -To update only one of the layer versions, you must include the ARNs of the existing layer versions with the `--layers` option\. - -The following procedure assumes that you have packaged the updated layer code into a local file named `layer.zip`\. - -**Add an updated layer version to your function** - -1. \(Optional\) If the new layer version is not published yet, publish the new version\. - - ``` - aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ - --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 - ``` - -1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. - - ``` - aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml - ``` - -1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: - - ``` - aws lambda update-function-configuration --function-name my-function \ - --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ - arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 - ``` - ## Adding layer permissions To use a Lambda function with a layer, you need permission to call the [GetLayerVersion](API_GetLayerVersion.md) API operation on the layer version\. For functions in your AWS account, you can add this permission from your [user policy](access-control-identity-based.md)\. @@ -217,4 +252,4 @@ The GitHub repository for this guide provides blank sample applications that dem + **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) + **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 9e9810fa..c0a7aa29 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index ee55ebda..456ac147 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -112,7 +112,7 @@ The following identity\-based policy statement denies access to the `lambda:GetF ``` { - "Version": "2020-07-20", + "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md index 0b30cb7a..44c8728c 100644 --- a/doc_source/lambda-foundation.md +++ b/doc_source/lambda-foundation.md @@ -7,6 +7,7 @@ The Lambda function is the foundational principle of Lambda\. You can configure + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) ++ [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index a23df8db..a30f8d0d 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -9,6 +9,9 @@ The following sections explain how common programming patterns and core concepts | --- | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. + Lambda provides the following tools and libraries for the Go runtime: **Tools and libraries for Go** diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index a663fb65..f533c6e3 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -11,7 +11,7 @@ Lambda supports the following Java runtimes\. | --- | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | +| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index 930c21b6..096ad77c 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,9 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | +| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index 34dfa0c5..14d40a41 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -12,10 +12,10 @@ End of support for the Python 2\.7 runtime started on July 15, 2021\. For more i | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **To create a Python function** diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index 37de18f6..ad4c92be 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -21,9 +21,9 @@ A runtime can support a single version of a language, multiple versions of a lan | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.952\.0 | Amazon Linux 2 | x86\_64 | +| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | **Note** For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. @@ -33,10 +33,10 @@ For end of support information about Node\.js 10, see [Runtime support policy](r | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | | Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | **Important** @@ -60,7 +60,7 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | --- | --- | --- | --- | --- | | Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | | Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | java\-1\.8\.0\-openjdk | Amazon Linux | x86\_64 | +| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | **Go runtimes** @@ -69,6 +69,9 @@ For end of support information about Ruby 2\.5, see [Runtime support policy](run | --- | --- | --- | --- | | Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | +**Note** +Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. + **\.NET runtimes** diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md index d9fe0023..1b101428 100644 --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -46,8 +46,8 @@ Entries in this table are alphabetical by service name, excluding the "Amazon" o | [Amazon MQ](with-mq.md) | Lambda polling | | [Amazon Simple Email Service](services-ses.md) | Event\-driven; asynchronous invocation | | [Amazon Simple Notification Service](with-sns.md) | Event\-driven; asynchronous invocation | -| [Amazon Simple Queue Service \(Amazon S3\)](with-sqs.md) | Lambda polling | -| [Amazon Simple Storage Service](with-s3.md) | Event\-driven; asynchronous invocation | +| [Amazon Simple Queue Service](with-sqs.md) | Lambda polling | +| [Amazon Simple Storage Service \(Amazon S3\)](with-s3.md) | Event\-driven; asynchronous invocation | | [Amazon Simple Storage Service Batch](services-s3-batch.md) | Event\-driven; synchronous invocation | | [Secrets Manager](with-secrets-manager.md) | Event\-driven; synchronous invocation | | [AWS X\-Ray](services-xray.md) | Special integration | diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index e991b198..4a104587 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -6,15 +6,30 @@ To learn more about CloudTrail, including how to configure and enable it, see th ## AWS Lambda information in CloudTrail -CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)\. +CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. -For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following: +For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. + +For more information, see the following topics in the *AWS CloudTrail User Guide*: + [Overview for creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) + [CloudTrail supported services and integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations) + [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) -AWS Lambda supports logging the following actions as events in CloudTrail log files: +Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. + +You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. + +You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. + +You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. + +### List of supported Lambda API actions + +Lambda supports logging the following actions as events in CloudTrail log files\. + +**Note** +In the CloudTrail log file, the `eventName` might include date and version information, but it is still referring to the same public API\. For example the, `GetFunction` action might appear as `"GetFunction20150331"`\. To see the `eventName` for a particular action, view a log file entry in your event history\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) + [AddPermission](API_AddPermission.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) @@ -37,20 +52,15 @@ AWS Lambda supports logging the following actions as events in CloudTrail log fi \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. - -You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. - -You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. - -You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. - ## Understanding AWS Lambda log file entries CloudTrail log files contain one or more log entries where each entry is made up of multiple JSON\-formatted events\. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on\. The log entries are not guaranteed to be in any particular order\. That is, they are not an ordered stack trace of the public API calls\. The following example shows CloudTrail log entries for the `GetFunction` and `DeleteFunction` actions\. +**Note** +The `eventName` might include date and version information, such as `"GetFunction20150331"`, but it is still referring to the same public API\. + ``` { "Records": [ @@ -108,9 +118,6 @@ The following example shows CloudTrail log entries for the `GetFunction` and `De } ``` -**Note** -The `eventName` may include date and version information, such as `"GetFunction20150331"`, but it is still referring to the same public API\. For more information, see [ Services supported by CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-supported-services.html#view-cloudtrail-events-supported-apis-lambda) in the *AWS CloudTrail User Guide*\. - ## Using CloudTrail to track function invocations CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md index d22d8d66..fe2f6951 100644 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -14,9 +14,6 @@ You can activate CodeGuru Profiler from the Lambda console if your function's ru + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. -**Note** -CodeGuru Profiler supports functions that use x86\_64 architecture and arm64 architecture\.????? - ## Activating CodeGuru Profiler from the Lambda console This section describes how to activate CodeGuru Profiler from the Lambda console\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index b72acc36..b5d19e03 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md index 3521229a..280429ed 100644 --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -6,11 +6,12 @@ There are two types of concurrency controls available: This topic details how to manage and configure provisioned concurrency\. If you want to configure reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. -When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. As your function scales up, this causes the portion of requests that are served by new instances to have higher latency than the rest\. +When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. When your function has not been used for some time, needs to scale up, or when you update a function, Lambda creates new execution environments\. This causes the portion of requests that are served by new instances to have higher latency than the rest, otherwise known as a cold start\. -By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. You can configure provisioned concurrency on a version of a function, or on an alias\. +By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. Lambda functions configured with provisioned concurrency run with consistent start\-up latency, making them ideal for building interactive mobile or web backends, latency sensitive microservices, and synchronously invoked APIs\. -Provisioned concurrency counts towards a function's reserved concurrency and Regional quotas\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. +**Note** +Provisioned concurrency counts towards a function's reserved concurrency and [Regional quotas](gettingstarted-limits.md)\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. Lambda also integrates with Application Auto Scaling, allowing you to manage provisioned concurrency on a schedule or based on utilization\. @@ -21,7 +22,14 @@ Lambda also integrates with Application Auto Scaling, allowing you to manage pro ## Configuring provisioned concurrency -To manage provisioned concurrency settings for a version or alias, use the Lambda console\. +To manage provisioned concurrency settings for a version or alias, use the Lambda console\. You can configure provisioned concurrency on a version of a function, or on an alias\. + + Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. + + If you change the version that an alias points to, Lambda deallocates the provisioned concurrency from the old version and allocates it to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. For more information, see [Lambda function aliases](configuration-aliases.md)\. Note that you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. + +**Note** + Provisioned Concurrency is not supported on $LATEST\. Ensure your client application is not pointing to $LATEST before configuring provisioned concurrency\. **To allocate provisioned concurrency for an alias or version** @@ -89,19 +97,15 @@ You should see the following output: You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. -Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. Also, you can't allocate provisioned concurrency on an alias that points to the unpublished version \(`$LATEST`\)\. - -When you change the version that an alias points to, provisioned concurrency is deallocated from the old version and then allocated to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. However, you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. - Lambda emits the following metrics for provisioned concurrency: **Provisioned concurrency metrics** -+ `ProvisionedConcurrentExecutions` -+ `ProvisionedConcurrencyInvocations` -+ `ProvisionedConcurrencySpilloverInvocations` -+ `ProvisionedConcurrencyUtilization` ++ `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on provisioned concurrency\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. ++ `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on provisioned concurrency\. ++ `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. ++ `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, \.5 indicates that 50 percent of allocated provisioned concurrency is in use\. -For details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +For more details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. ## Optimizing latency with provisioned concurrency @@ -123,27 +127,33 @@ If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PR For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. +For more information on optimizing functions using provisioned concurrency, see the [Lambda Operator Guide\.](https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html) + ## Managing provisioned concurrency with Application Auto Scaling -Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. +Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use a target tracking scaling policy if want your function to maintain a specified utilization percentage, and scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. + +### Target tracking -To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` [Application Auto Scaling API ](configuration-concurrency.md#configuration-concurrency-api) operations to register a target and create a scaling policy: + With target tracking, Application Auto Scaling creates and manages the CloudWatch alarms that trigger a scaling policy and calculates the scaling adjustment based on a metric and target value that you define\. This is ideal for applications that don’t have a scheduled time of increased traffic, but have certain traffic patterns\. + +To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` Application Auto Scaling API operations to register a target and create a scaling policy: 1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `function`my\-: ``` aws application-autoscaling register-scalable-target --service-namespace lambda \ - --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ - --scalable-dimension lambda:function:ProvisionedConcurrency + --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ + --scalable-dimension lambda:function:ProvisionedConcurrency ``` 1. Apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent\. ``` aws application-autoscaling put-scaling-policy --service-namespace lambda \ - --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ - --policy-name my-policy --policy-type TargetTrackingScaling \ - --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' + --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ + --policy-name my-policy --policy-type TargetTrackingScaling \ + --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' ``` You should see the following output: @@ -174,4 +184,14 @@ In the following example, a function scales between a minimum and maximum amount + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency \ No newline at end of file ++ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency + + Both of these alarms use the *average* statistic by default\. Functions that have traffic patterns of quick bursts may not trigger your provisioned concurrency to scale up\. For example, if your Lambda function executes quickly \(20–100 ms\) and your traffic pattern comes in quick bursts, this may cause incoming requests to exceed your allocated provisioned concurrency during the burst, but if the burst doesn’t last 3 minutes, auto scaling will not trigger\. Additionally, if CloudWatch doesn’t get three data points that hit the target average, the auto scaling policy will not trigger\. + + If your scaling policy does not trigger and your provisioned concurrency does not scale, check that the alarms were triggered\. If not, deploy your function with a custom CloudWatch alarm set to use the *max* statistic\. + +For more information on target tracking scaling policies, see [Target tracking scaling policies for Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. + +### Scheduled scaling + + Scaling based on a schedule allows you to set your own scaling schedule according to predictable load changes\. For more information and examples, see [Scheduling AWS Lambda Provisioned Concurrency for recurring peak usage](https://aws.amazon.com/blogs/compute/scheduling-aws-lambda-provisioned-concurrency-for-recurring-peak-usage/)\. \ No newline at end of file diff --git a/doc_source/python-image.md b/doc_source/python-image.md index ea83bd21..55bfb071 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -8,13 +8,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: @@ -50,7 +50,9 @@ Amazon ECR repository: gallery\.ecr\.aws/lambda/python ## Create a Python image from an AWS base image -When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. +When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. + +If your function has dependencies, your local Python environment must match the version in the base image that you specify in the Dockerfile\. **To build and deploy a Python function with the `python:3.8` base image\.** diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index 07e9023a..b205730c 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -5,13 +5,13 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - AWS provides base images for x86\_64 architecture and arm64 architecture\. + For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. + Open\-source runtime interface emulator \(RIE\) - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE to [testing your image](images-test.md) locally\. + Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. The workflow for a function defined as a container image includes these steps: diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md index 0ae9240f..7fe3e7f4 100644 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -11,17 +11,17 @@ Lambda does not block invocations of functions that use deprecated runtime versi **Important** Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. -The following runtimes have reached or are scheduled for end of support: +In the table below, each of the phases starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached or are scheduled for end of support: **Runtime end of support dates** | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Sept 20, 2021 | Oct 20, 2021 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Sept 30, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Aug 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Sept 17, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Oct 26, 2021 | Nov 30, 2021 | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Nov 22, 2021 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Nov 30, 2021 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Nov 30, 2021 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md index 0b670b5b..75729f85 100644 --- a/doc_source/runtimes-context.md +++ b/doc_source/runtimes-context.md @@ -49,6 +49,9 @@ The invoke phase ends after the runtime and all extensions signal that they are If the Lambda function crashes or times out during the `Invoke` phase, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. +**Note** +The Lambda reset does not clear the `/tmp` directory content prior to the next init phase\. This behavior is consistent with the regular shutdown phase\. + ![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) ### Shutdown phase diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index e25263ad..7c8d7571 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -79,21 +79,20 @@ The following example shows a request to subscribe to the platform and function ``` PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 -{ - "schemaVersion": "2020-08-15", - "types": [ - "platform", - "function" +{ "schemaVersion": "2020-08-15", + "types": [ + "platform", + "function" ], - "buffering": { - "maxItems": 1000, - "maxBytes": 262144, - "timeoutMs": 100 + "buffering": { + "maxItems": 1000, + "maxBytes": 262144, + "timeoutMs": 100 }, - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080/lambda_logs" - } + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080/lambda_logs" + } } ``` diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md index 88435c0b..3222c7a8 100644 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -2,6 +2,24 @@ You can create a web API with an HTTP endpoint for your Lambda function by using Amazon API Gateway\. API Gateway provides tools for creating and documenting web APIs that route HTTP requests to Lambda functions\. You can secure access to your API with authentication and authorization controls\. Your APIs can serve traffic over the internet or can be accessible only within your VPC\. +Resources in your API define one or more methods, such as GET or POST\. Methods have an integration that routes requests to a Lambda function or another integration type\. You can define each resource and method individually, or use special resource and method types to match all requests that fit a pattern\. A *proxy resource* catches all paths beneath a resource\. The `ANY` method catches all HTTP methods\. + +**Topics** ++ [Adding an endpoint to your Lambda function](#apigateway-add) ++ [Proxy integration](#apigateway-proxy) ++ [Event format](#apigateway-example-event) ++ [Response format](#apigateway-types-transforms) ++ [Permissions](#apigateway-permissions) ++ [Handling errors with an API Gateway API](#services-apigateway-errors) ++ [Choosing an API type](#services-apigateway-apitypes) ++ [Sample applications](#services-apigateway-samples) ++ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) ++ [Sample function code](services-apigateway-code.md) ++ [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) ++ [AWS SAM template for an API Gateway application](services-apigateway-template.md) + +## Adding an endpoint to your Lambda function + **To add a public endpoint to your Lambda function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. @@ -14,10 +32,14 @@ You can create a web API with an HTTP endpoint for your Lambda function by using 1. For **API**, choose **Create an API**\. +1. For **API type**, choose **HTTP API**\. For more information, see [API types](#services-apigateway-apitypes) + 1. For **Security**, choose **Open**\. 1. Choose **Add**\. +## Proxy integration + API Gateway APIs are comprised of stages, resources, methods, and integrations\. The stage and resource determine the path of the endpoint: **API path format** @@ -28,48 +50,50 @@ API Gateway APIs are comprised of stages, resources, methods, and integrations\. A Lambda integration maps a path and HTTP method combination to a Lambda function\. You can configure API Gateway to pass the body of the HTTP request as\-is \(custom integration\), or to encapsulate the request body in a document that includes all of the request information including headers, resource, path, and method\. +## Event format + Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. **Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** ``` { - "resource": "/", - "path": "/", - "httpMethod": "GET", - "requestContext": { - "resourcePath": "/", - "httpMethod": "GET", - "path": "/Prod/", - ... - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "accept-encoding": "gzip, deflate, br", - "Host": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", - "X-Amzn-Trace-Id": "Root=1-5e66d96f-7491f09xmpl79d18acf3d050", - ... - }, - "multiValueHeaders": { - "accept": [ - "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" - ], - "accept-encoding": [ - "gzip, deflate, br" - ], - ... - }, - "queryStringParameters": null, - "multiValueQueryStringParameters": null, - "pathParameters": null, - "stageVariables": null, - "body": null, - "isBase64Encoded": false -} + "resource": "/", + "path": "/", + "httpMethod": "GET", + "requestContext": { + "resourcePath": "/", + "httpMethod": "GET", + "path": "/Prod/", + ... + }, + "headers": { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "accept-encoding": "gzip, deflate, br", + "Host": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", + "X-Amzn-Trace-Id": "Root=1-5e66d96f-7491f09xmpl79d18acf3d050", + ... + }, + "multiValueHeaders": { + "accept": [ + "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" + ], + "accept-encoding": [ + "gzip, deflate, br" + ], + ... + }, + "queryStringParameters": null, + "multiValueQueryStringParameters": null, + "pathParameters": null, + "stageVariables": null, + "body": null, + "isBase64Encoded": false + } ``` -This example shows an event for a GET request to the root path of the Prod stage of a REST API\. Event shape and contents vary by [API type](#services-apigateway-apitypes) and configuration\. +## Response format API Gateway waits for a response from your function and relays the result to the caller\. For a custom integration, you define an integration response and a method response to convert the output from the function to an HTTP response\. For a proxy integration, the function must respond with a representation of the response in a specific format\. @@ -79,16 +103,16 @@ The following example shows a response object from a Node\.js function\. The res ``` var response = { - "statusCode": 200, - "headers": { - "Content-Type": "application/json" - }, - "isBase64Encoded": false, - "multiValueHeaders": { - "X-Custom-Header": ["My value", "My other value"], - }, - "body": "{\n \"TotalCodeSize\": 104330022,\n \"FunctionCount\": 26\n}" - } + "statusCode": 200, + "headers": { + "Content-Type": "application/json" + }, + "isBase64Encoded": false, + "multiValueHeaders": { + "X-Custom-Header": ["My value", "My other value"], + }, + "body": "{\n \"TotalCodeSize\": 104330022,\n \"FunctionCount\": 26\n}" + } ``` The Lambda runtime serializes the response object into JSON and sends it to the API\. The API parses the response and uses it to create an HTTP response, which it then sends to the client that made the original request\. @@ -97,32 +121,20 @@ The Lambda runtime serializes the response object into JSON and sends it to the ``` < HTTP/1.1 200 OK -< Content-Type: application/json -< Content-Length: 55 -< Connection: keep-alive -< x-amzn-RequestId: 32998fea-xmpl-4268-8c72-16138d629356 -< X-Custom-Header: My value -< X-Custom-Header: My other value -< X-Amzn-Trace-Id: Root=1-5e6aa925-ccecxmplbae116148e52f036 -< -{ - "TotalCodeSize": 104330022, - "FunctionCount": 26 -} + < Content-Type: application/json + < Content-Length: 55 + < Connection: keep-alive + < x-amzn-RequestId: 32998fea-xmpl-4268-8c72-16138d629356 + < X-Custom-Header: My value + < X-Custom-Header: My other value + < X-Amzn-Trace-Id: Root=1-5e6aa925-ccecxmplbae116148e52f036 + < + { + "TotalCodeSize": 104330022, + "FunctionCount": 26 + } ``` -Resources in your API define one or more methods, such as GET or POST\. Methods have an integration that routes requests to a Lambda function or another integration type\. You can define each resource and method individually, or use special resource and method types to match all requests that fit a pattern\. A *proxy resource* catches all paths beneath a resource\. The `ANY` method catches all HTTP methods\. - -**Topics** -+ [Permissions](#apigateway-permissions) -+ [Handling errors with an API Gateway API](#services-apigateway-errors) -+ [Choosing an API type](#services-apigateway-apitypes) -+ [Sample applications](#services-apigateway-samples) -+ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) -+ [Sample function code](services-apigateway-code.md) -+ [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) -+ [AWS SAM template for an API Gateway application](services-apigateway-template.md) - ## Permissions Amazon API Gateway gets permission to invoke your function from the function's [resource\-based policy](access-control-resource-based.md)\. You can grant invoke permission to an entire API, or grant limited access to a stage, resource, or method\. @@ -143,10 +155,13 @@ When you add an API to your function by using the Lambda console, using the API "Service": "apigateway.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:nodejs-apig-function-1G3MXMPLXVXYI", + "Resource": "arn:aws:lambda:us-east-2:111122223333:function:nodejs-apig-function-1G3MXMPLXVXYI", "Condition": { + "StringEquals": { + "aws:SourceAccount": "111122223333" + }, "ArnLike": { - "AWS:SourceArn": "arn:aws:execute-api:us-east-2:123456789012:ktyvxmpls1/*/GET/" + "aws:SourceArn": "arn:aws:execute-api:us-east-2:111122223333:ktyvxmpls1/*/GET/" } } } diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md index 079c939f..7cbe0277 100644 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -49,7 +49,7 @@ Test the function with a sample event provided by the Lambda console\. 1. Choose **Test**\. -1. Create a new event using the **EventBridge \(CloudWatch Events\)** event template\. +1. Create a new event using the **CloudWatch** event template\. 1. Choose **Create event**\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md index 1c80121c..00b5768b 100644 --- a/doc_source/services-s3-object-lambda.md +++ b/doc_source/services-s3-object-lambda.md @@ -2,4 +2,8 @@ With S3 Object Lambda you can add your own code to Amazon S3 GET requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. -For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. \ No newline at end of file +For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. + +**Tutorials** ++ [Transforming data for your application with Amazon S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-uppercase.html) ++ [Detecting and redacting PII data with Amazon S3 Object Lambda and Amazon Comprehend](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-redact-pii.html) \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md index fa3f7d21..845a69f2 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -108,7 +108,7 @@ RUN pip install -r requirements.txt # Add an extension from the local directory into /opt ADD my-extension.zip /opt -CMD python ./index.py +CMD python ./my-function.py ``` ## Next steps diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index b95e9aa0..30a003a7 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -154,7 +154,7 @@ To manage the event source configuration later, choose the trigger in the design To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md index 47bcaace..3d26a22c 100644 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -79,7 +79,7 @@ Your Lambda function might need these permissions: + Access your AWS Key Management Service \(AWS KMS\) customer managed key + Access your Amazon Virtual Private Cloud \(Amazon VPC\) -#### Secrets Manager and AWS KMS permissions +#### Secrets Manager and AWS KMS permissions If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) @@ -97,31 +97,9 @@ If only users within a VPC can access your self\-managed Apache Kafka cluster, y ### Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's execution role\. -By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. - -``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"arn:aws:ec2:us-east-1:01234567890:instance/my-instance-name" - } - ] - } -``` - -For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md) ### Adding users to an IAM policy @@ -215,7 +193,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Using a VPC @@ -232,7 +210,7 @@ aws lambda create-event-source-mapping "abc2.xyz.com:9092"]}}' ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Viewing the status using the AWS CLI @@ -273,7 +251,7 @@ When you add your Kafka cluster as an [event source](invocation-eventsourcemappi To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 975cb443..d60e978d 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -169,7 +169,7 @@ To manage the event source configuration later, choose the trigger in the design To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md index 0de8fa33..d9414499 100644 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -45,36 +45,36 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { - "eventSource":"aws:amq", - "eventSourceArn":"arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages":[ - { - "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/text-message", - "data":"QUJDOkFBQUE=", - "connectionId":"myJMSCoID", - "redelivered":false, - "destination":{ - "physicalname":"testQueue" - }, - "timestamp":1598827811958, - "brokerInTime":1598827811958, - "brokerOutTime":1598827811959 - }, - { - "messageID":"ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType":"jms/bytes-message", - "data":"3DTOOW7crj51prgVLQaGQ82S48k=", - "connectionId":"myJMSCoID1", - "persistent":false, - "destination":{ - "physicalname":"testQueue" - }, - "timestamp":1598827811958, - "brokerInTime":1598827811958, - "brokerOutTime":1598827811959 - } - ] + "eventSource": "aws:amq", + "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "messages": [ + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/text-message", + "data": "QUJDOkFBQUE=", + "connectionId": "myJMSCoID", + "redelivered": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + }, + { + "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", + "messageType": "jms/bytes-message", + "data": "3DTOOW7crj51prgVLQaGQ82S48k=", + "connectionId": "myJMSCoID1", + "persistent": false, + "destination": { + "physicalname": "testQueue" + }, + "timestamp": 1598827811958, + "brokerInTime": 1598827811958, + "brokerOutTime": 1598827811959 + } + ] } ``` @@ -182,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) @@ -314,4 +314,4 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | -| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | +| SourceAccessConfigurations | N | | An array of the authentication protocol, VPC components, or virtual host to secure and define your Amazon MQ event source\. | \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md index 01414df9..21cbc233 100644 --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -6,9 +6,9 @@ Amazon MSK as an event source operates similarly to using Amazon Simple Queue Se For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. -Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function times out or returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -Lambda allows a function to run for up to 14 minutes before stopping it\. +For Amazon MSK invocations, Lambda allows the function to run for up to 14 minutes\. Set your function timeout value to 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. @@ -57,7 +57,9 @@ Lambda sends the batch of messages in the event parameter when it invokes your f ## Managing access and permissions -For Lambda to poll your Kafka topic and update other cluster resources, your Lambda function—as well as your IAM users and roles—must have the following permissions\. +You can use IAM access control to handle both authentication and authorization for your Amazon MSK cluster\. This eliminates the need to use one mechanism for authentication and a different mechanism for authorization\. For example, when a client tries to write to your cluster, Amazon MSK uses IAM to check whether that client is an authenticated identity and also whether it is authorized to produce to your cluster\. + +As an alternative, you can use SASL/SCRAM to authenticate clients and [Apache Kafka ACLs](https://docs.aws.amazon.com/msk/latest/developerguide/msk-acls.html) to control access\. ### Required Lambda function permissions @@ -74,6 +76,36 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) must hav + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +### Additional function permissions for IAM authorization + +If you plan to use IAM authorization, you need to add the following additional permissions: + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "kafka-cluster:Connect", + "kafka-cluster:DescribeGroup", + "kafka-cluster:AlterGroup", + "kafka-cluster:DescribeTopic", + "kafka-cluster:ReadData", + "kafka-cluster:DescribeClusterDynamicConfiguration" + ], + "Resource": [ + "arn:aws:kafka:::cluster//", + "arn:aws:kafka:::topic///", + "arn:aws:kafka:::group///" + ] + } + ] +} +``` + +You can scope these permissions to a specific cluster, topic and group\. See [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that Lambda uses is equivalent to the event source mapping’s UUID\. + ### Adding a policy to your execution role Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. @@ -98,6 +130,30 @@ Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Re Note that Amazon MSK does not support SASL/PLAIN authentication\. +### Authentication and authorization Errors + +If any of the required permissions to consume data from the Amazon MSK cluster are missing, Lambda displays an error message in the event source mapping under **LastProcessingResult**\. + +The following error message results from authorization errors\. + +**Example Cluster failed to authorize Lambda** +For SASL/SCRAM, the provided user does not have all of the required Kafka ACL permissions: ++ DescribeConfigs Cluster ++ Describe Group ++ Read Group ++ Describe Topic ++ Read Topic +For IAM access control, the execution role is missing one or more of the permissions required to access the group or topic\. To add the missing permissions to the role, see the example in [Additional function permissions for IAM authorization](#msk-permissions-iam-auth) +When you create either Kafka ACLs or an IAM policy with the required kafka\-cluster permissions listed previously, you must specify the topic and group as resources\. The topic name must match the topic in the event source mapping and the group name must match the event source mapping’s UUID\. +After you add the required permissions to the execution role, there might be a delay of several minutes before the changes take effect\. + +The following error message results from authentication failures\. + +**Example SASL authentication failed** +For SASL/SCRAM, this failure indicates that the provided username and password are invalid\. +For IAM access control, the execution role is missing `kafka-cluster:Connect` permissions for the cluster\. Add this permission to the role and specify the cluster ARN as a resource\. +You might see this error intermittently if the cluster rejects connections because it reached the TCP connection limit set by [Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. The last processing result will eventually change to “OK” after Lambda successfully connects to and polls from the cluster\. + ## Network configuration Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. @@ -105,8 +161,9 @@ Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resou Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. ++ Inbound rules – Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ if you are using VPC endpoints instead of NAT Gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. **Note** Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. @@ -147,7 +204,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. + 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. If you are using IAM access control, do not choose a secret key\. 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. @@ -169,7 +226,7 @@ aws lambda create-event-source-mapping \ --function-name my-kafka-function ``` -For more information, see the API reference documentation\. +For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. #### Viewing the status using the AWS CLI diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index c96428d9..91b550fc 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -636,7 +636,7 @@ This procedure configures the S3 bucket to invoke your function every time that + **Destination** – **Lambda function** + **Lambda function** – **CreateThumbnail** -For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service Console User Guide*\. +For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service User Guide*\. ## Step 9\. Test using the S3 trigger diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 1cdf12bf..50c5db97 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -169,7 +169,7 @@ Configure your function timeout to allow enough time to process an entire batch To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) From c1e1349f3cf5742e5ee52d977c0003383262d743 Mon Sep 17 00:00:00 2001 From: Olivier Truong Date: Wed, 1 Dec 2021 09:47:06 +0100 Subject: [PATCH 143/243] Typo in functions-states.md --- doc_source/functions-states.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index aec7996c..aad0bb8c 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -6,7 +6,7 @@ Lambda includes a state field in the function configuration for all functions to + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -If you are utilzing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. +If you are utilizing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' @@ -66,4 +66,4 @@ The following is the result of `get-function-configuration` on a function underg The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) \ No newline at end of file ++ [PublishVersion](API_PublishVersion.md) From e3582b92e6a2e9c624990ebaffae2f811fc13784 Mon Sep 17 00:00:00 2001 From: Mark Sailes Date: Fri, 10 Dec 2021 15:42:04 +0000 Subject: [PATCH 144/243] Update to the version of log4j2 which isn't effected by CVE-2021-44228 --- doc_source/java-logging.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 6302d70b..7e1fef2a 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,10 +310,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } From 806bcc0ba63a12eba477cb20f12856cdb00b441d Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Fri, 10 Dec 2021 21:28:49 -0800 Subject: [PATCH 145/243] update log4j2 --- sample-apps/blank-java/build.gradle | 8 ++++---- sample-apps/blank-java/pom.xml | 10 +++++----- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 6 +++--- sample-apps/java-events-v1sdk/build.gradle | 8 ++++---- sample-apps/java-events-v1sdk/pom.xml | 10 +++++----- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 6 +++--- sample-apps/s3-java/build.gradle | 8 ++++---- sample-apps/s3-java/pom.xml | 10 +++++----- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 710d433f..626717f6 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index b1b40871..a191854c 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index d32fc80a..91089ad8 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.13.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 721a9cf7..ffa65ebe 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,19 +25,19 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 test org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 test org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index bcbb32f5..f9850483 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index a5a095b8..aea29069 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 0f68f99a..637fcac8 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 0d13721a..f7353d97 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,17 +30,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 425f06e1..47f73baa 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,10 +15,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.15.0' + implementation 'org.apache.logging.log4j:log4j-core:2.15.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index b82a458e..5463b5f5 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.1.0 + 1.3.0 com.google.code.gson @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.13.0 + 2.15.0 org.apache.logging.log4j log4j-core - 2.13.2 + 2.15.2 org.apache.logging.log4j log4j-slf4j18-impl - 2.13.0 + 2.15.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.15.0 From 34a84a59fb314c5bb784674c987bb6f5a04e2747 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 14:50:49 -0800 Subject: [PATCH 146/243] Updating log4 dependencies. --- doc_source/java-logging.md | 8 ++++---- sample-apps/blank-java/build.gradle | 8 ++++---- sample-apps/blank-java/pom.xml | 8 ++++---- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 4 ++-- sample-apps/java-events-v1sdk/build.gradle | 8 ++++---- sample-apps/java-events-v1sdk/pom.xml | 8 ++++---- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 4 ++-- sample-apps/s3-java/build.gradle | 8 ++++---- sample-apps/s3-java/pom.xml | 8 ++++---- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 7e1fef2a..08319924 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,10 +310,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 626717f6..f8853ba6 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index a191854c..7e9a8dbc 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 91089ad8..14bdf57a 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.15.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.15.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index ffa65ebe..ecab98f3 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 test @@ -37,7 +37,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index f9850483..739d8653 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,10 +17,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index aea29069..49a7678d 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 637fcac8..8f82c06a 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index f7353d97..ad471866 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,7 +30,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 47f73baa..daa1b295 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,10 +15,10 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.15.0' - implementation 'org.apache.logging.log4j:log4j-core:2.15.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.3.0' + implementation 'org.apache.logging.log4j:log4j-api:2.16.0' + implementation 'org.apache.logging.log4j:log4j-core:2.16.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 5463b5f5..e25eb6f0 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.3.0 + 1.4.0 com.google.code.gson @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.16.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.15.0 + 2.16.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.15.0 + 2.16.0 From f3f0e84281afd426aeff43f2c473dee1ca25ca18 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 15:12:27 -0800 Subject: [PATCH 147/243] Updating to newest version. --- doc_source/java-logging.md | 6 +++--- sample-apps/blank-java/build.gradle | 6 +++--- sample-apps/blank-java/pom.xml | 6 +++--- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 4 ++-- sample-apps/java-events-v1sdk/build.gradle | 6 +++--- sample-apps/java-events-v1sdk/pom.xml | 6 +++--- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 4 ++-- sample-apps/s3-java/build.gradle | 6 +++--- sample-apps/s3-java/pom.xml | 6 +++--- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 08319924..d7724a64 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,9 +310,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index f8853ba6..5a7587da 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 7e9a8dbc..2d36e63d 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 14bdf57a..cf3cfba1 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.16.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.16.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + testImplementation 'org.apache.logging.log4j:log4j-api:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index ecab98f3..0f3372cd 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,7 +25,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 test @@ -37,7 +37,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 739d8653..c5daa3a6 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 49a7678d..62ce5b20 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 8f82c06a..4563c3ae 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index ad471866..f066fd3a 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,7 +30,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index daa1b295..acde5657 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,9 +15,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.16.0' - implementation 'org.apache.logging.log4j:log4j-core:2.16.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index e25eb6f0..3ad2cbb8 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-api - 2.16.0 + 2.17.0 org.apache.logging.log4j @@ -45,7 +45,7 @@ org.apache.logging.log4j log4j-slf4j18-impl - 2.16.0 + 2.17.0 com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.16.0 + 2.17.0 From f54ddb8a7bdc0167983c79fddbb1e6f3902ec193 Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 20 Dec 2021 15:20:10 -0800 Subject: [PATCH 148/243] Missed some outdated log4 versions. --- doc_source/java-package.md | 10 +++++----- sample-apps/blank-java/pom.xml | 2 +- sample-apps/java-basic/pom.xml | 2 +- sample-apps/java-events-v1sdk/pom.xml | 2 +- sample-apps/java-events/pom.xml | 2 +- sample-apps/s3-java/pom.xml | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 4bf6634f..c2af7569 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -112,10 +112,10 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 + 2.17.0 diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 2d36e63d..5063e4fd 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 0f3372cd..128e931f 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -31,7 +31,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 test diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 62ce5b20..8e24bf3d 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index f066fd3a..09f530e6 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -35,7 +35,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3ad2cbb8..3785d1b7 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -40,7 +40,7 @@ org.apache.logging.log4j log4j-core - 2.15.2 + 2.17.0 org.apache.logging.log4j From 5640d93efd12cf9d546029f5a099396aed3f8b57 Mon Sep 17 00:00:00 2001 From: eriboo Date: Tue, 21 Dec 2021 11:35:04 -0800 Subject: [PATCH 149/243] Updating aws-lambda-java-log4j2 to 1.5.0 --- doc_source/java-logging.md | 2 +- doc_source/java-package.md | 2 +- sample-apps/blank-java/build.gradle | 2 +- sample-apps/blank-java/pom.xml | 2 +- sample-apps/java-events-v1sdk/build.gradle | 2 +- sample-apps/java-events-v1sdk/pom.xml | 2 +- sample-apps/s3-java/build.gradle | 2 +- sample-apps/s3-java/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index d7724a64..cd0960cf 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -313,7 +313,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/doc_source/java-package.md b/doc_source/java-package.md index c2af7569..d90feb27 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -115,7 +115,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 5a7587da..a52c2d1e 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 5063e4fd..b58c4b7a 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index c5daa3a6..8de68744 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 8e24bf3d..7b618f7b 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index acde5657..1b83d37f 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -18,7 +18,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-api:2.17.0' implementation 'org.apache.logging.log4j:log4j-core:2.17.0' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.4.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3785d1b7..0a71ebd2 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -25,7 +25,7 @@ com.amazonaws aws-lambda-java-log4j2 - 1.4.0 + 1.5.0 com.google.code.gson From 4e865dc34c1b370ee5046833d3e6e623cc2777e6 Mon Sep 17 00:00:00 2001 From: Popa Alexandru Date: Thu, 23 Dec 2021 14:18:46 +0900 Subject: [PATCH 150/243] Fix typo in monitoring-insights.md --- doc_source/monitoring-insights.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index 250d5255..c82bcc99 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -23,7 +23,7 @@ The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for t ## Pricing -When you enable Lambda Insights for your Lambda function, Lambda Insights reports 8 metrics per function and every function invocation sends about 1KB of log data to CloudWatch\. You only pay for the metrics and logs reported for your function by Lambda Insights\. There are no minimum fees or mandatory service usage polices\. You do not pay for Lambda Insights if the function is not invoked\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. +When you enable Lambda Insights for your Lambda function, Lambda Insights reports 8 metrics per function and every function invocation sends about 1KB of log data to CloudWatch\. You only pay for the metrics and logs reported for your function by Lambda Insights\. There are no minimum fees or mandatory service usage policies\. You do not pay for Lambda Insights if the function is not invoked\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. ## Supported runtimes @@ -134,4 +134,4 @@ You can use the single\-function view on the Lambda Insights dashboard to identi ## What's next? + Learn how to create a CloudWatch Logs dashboard in [Create a Dashboard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create_dashboard.html) in the *Amazon CloudWatch User Guide*\. -+ Learn how to add queries to a CloudWatch Logs dashboard in [Add Query to Dashboard or Export Query Results](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ExportQueryResults.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file ++ Learn how to add queries to a CloudWatch Logs dashboard in [Add Query to Dashboard or Export Query Results](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ExportQueryResults.html) in the *Amazon CloudWatch User Guide*\. From f72c2ddfe0e0d877f37cc0664d9ee8d4a14f999e Mon Sep 17 00:00:00 2001 From: eriboo Date: Mon, 3 Jan 2022 20:20:10 -0800 Subject: [PATCH 151/243] Updating aws-sdk versions. --- sample-apps/blank-nodejs/package.json | 2 +- sample-apps/error-processor/package.json | 2 +- sample-apps/list-manager/processor/package.json | 2 +- sample-apps/nodejs-apig/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-apps/blank-nodejs/package.json b/sample-apps/blank-nodejs/package.json index 9fa06adb..b1b429f8 100644 --- a/sample-apps/blank-nodejs/package.json +++ b/sample-apps/blank-nodejs/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0", + "aws-sdk": "2.814.0", "jest": "25.4.0" }, "dependencies": { diff --git a/sample-apps/error-processor/package.json b/sample-apps/error-processor/package.json index bd2bfa96..700647b0 100644 --- a/sample-apps/error-processor/package.json +++ b/sample-apps/error-processor/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0" + "aws-sdk": "2.814.0" }, "dependencies": { "aws-xray-sdk-core": "1.1.2", diff --git a/sample-apps/list-manager/processor/package.json b/sample-apps/list-manager/processor/package.json index 1428d7bd..18e2befc 100644 --- a/sample-apps/list-manager/processor/package.json +++ b/sample-apps/list-manager/processor/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": {}, "devDependencies": { - "aws-sdk": "2.488.0", + "aws-sdk": "2.814.0", "aws-xray-sdk-core": "2.4.0", "aws-xray-sdk-mysql": "2.4.0", "md5": "2.2.1", diff --git a/sample-apps/nodejs-apig/package.json b/sample-apps/nodejs-apig/package.json index 271c8428..efb1ca11 100644 --- a/sample-apps/nodejs-apig/package.json +++ b/sample-apps/nodejs-apig/package.json @@ -3,6 +3,6 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.631.0" + "aws-sdk": "2.814.0" } } From 0efbd3a3e7ac9e83f689246b996bcc40a69b3281 Mon Sep 17 00:00:00 2001 From: eriboo Date: Wed, 12 Jan 2022 11:30:26 -0800 Subject: [PATCH 152/243] Updating log4j versions. --- doc_source/java-logging.md | 6 +++--- doc_source/java-package.md | 8 ++++---- sample-apps/blank-java/build.gradle | 6 +++--- sample-apps/blank-java/pom.xml | 8 ++++---- sample-apps/java-basic/build.gradle | 6 +++--- sample-apps/java-basic/pom.xml | 6 +++--- sample-apps/java-events-v1sdk/build.gradle | 6 +++--- sample-apps/java-events-v1sdk/pom.xml | 8 ++++---- sample-apps/java-events/build.gradle | 6 +++--- sample-apps/java-events/pom.xml | 6 +++--- sample-apps/s3-java/build.gradle | 6 +++--- sample-apps/s3-java/pom.xml | 8 ++++---- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index cd0960cf..2297df33 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -310,9 +310,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/doc_source/java-package.md b/doc_source/java-package.md index d90feb27..5c43578a 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -112,9 +112,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index a52c2d1e..0c2e47ef 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index b58c4b7a..85cc2f58 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) software.amazon.awssdk @@ -118,7 +118,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index cf3cfba1..2e9e324b 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -9,9 +9,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.google.code.gson:gson:2.8.6' - testImplementation 'org.apache.logging.log4j:log4j-api:2.17.0' - testImplementation 'org.apache.logging.log4j:log4j-core:2.17.0' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + testImplementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + testImplementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 128e931f..9aa99c47 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -25,19 +25,19 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) test org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) test org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) test diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 8de68744..0a7d3bdc 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -17,9 +17,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index 7b618f7b..bb3fe158 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) com.amazonaws @@ -122,7 +122,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 4563c3ae..f98131dc 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -10,9 +10,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 09f530e6..771e1af6 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -30,17 +30,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) org.junit.jupiter diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 1b83d37f..0c8eb35a 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -15,9 +15,9 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 0a71ebd2..31a30dcf 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -35,17 +35,17 @@ org.apache.logging.log4j log4j-api - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-core - 2.17.0 + [2.17.1,) org.apache.logging.log4j log4j-slf4j18-impl - 2.17.0 + [2.17.1,) com.amazonaws @@ -117,7 +117,7 @@ com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - 2.17.0 + [2.17.1,) From 29a8287a6b80eaa4d8b31c3245e83e94398d7e97 Mon Sep 17 00:00:00 2001 From: Wesley Moy Date: Wed, 26 Jan 2022 13:17:38 -0500 Subject: [PATCH 153/243] Replace curly quotes in code block This removes the extraneous JSON syntax highlighting in the code block in https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc-endpoints.html#vpc-endpoint-policy. --- doc_source/configuration-vpc-endpoints.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md index 6f84d7d5..3f0bb42e 100644 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -97,10 +97,10 @@ You need to include both the qualified and the unqualified function ARN in the r "lambda:InvokeFunction" ], "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-function”, - "arn:aws:lambda:us-east-2:123456789012:function:my-function:*” + "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "arn:aws:lambda:us-east-2:123456789012:function:my-function:*" ] } ] } -``` \ No newline at end of file +``` From 65e8707ad8704b1b2ba456c6c2f62c80b5594efa Mon Sep 17 00:00:00 2001 From: Jhon Anderson Cardenas Date: Thu, 10 Feb 2022 07:57:03 -0800 Subject: [PATCH 154/243] Small text fix **Account B**and -> **Account B** and --- doc_source/with-sqs-cross-account-example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md index f1112160..819cc3b2 100644 --- a/doc_source/with-sqs-cross-account-example.md +++ b/doc_source/with-sqs-cross-account-example.md @@ -163,7 +163,7 @@ In **Account B**, create an Amazon SQS queue that the Lambda function in **Accou ## Configure the event source \(Account A\) -In **Account A**, create an event source mapping between the Amazon SQS queue in **Account B**and your Lambda function by running the following `create-event-source-mapping` AWS CLI command\. +In **Account A**, create an event source mapping between the Amazon SQS queue in **Account B** and your Lambda function by running the following `create-event-source-mapping` AWS CLI command\. ``` aws lambda create-event-source-mapping --function-name CrossAccountSQSExample --batch-size 10 \ @@ -231,4 +231,4 @@ In **Account B**, clean up the Amazon SQS queue\. 1. Enter **delete** in the text box\. -1. Choose **Delete**\. \ No newline at end of file +1. Choose **Delete**\. From 2be81b8fa0e4b7ecb20892909bcd01da2e6cb61c Mon Sep 17 00:00:00 2001 From: eriboo Date: Wed, 23 Feb 2022 15:26:34 -0800 Subject: [PATCH 155/243] Syncing with dev guide. --- doc_source/API_AccountLimit.md | 10 +- doc_source/API_AccountUsage.md | 8 +- doc_source/API_AddLayerVersionPermission.md | 40 +-- doc_source/API_AddPermission.md | 38 +-- doc_source/API_AliasConfiguration.md | 10 +- doc_source/API_AliasRoutingConfiguration.md | 8 +- doc_source/API_AllowedPublishers.md | 8 +- doc_source/API_CodeSigningConfig.md | 12 +- doc_source/API_CodeSigningPolicies.md | 8 +- doc_source/API_Concurrency.md | 8 +- doc_source/API_CreateAlias.md | 44 +-- doc_source/API_CreateCodeSigningConfig.md | 32 +- doc_source/API_CreateEventSourceMapping.md | 135 ++++---- doc_source/API_CreateFunction.md | 166 +++++----- doc_source/API_DeadLetterConfig.md | 8 +- doc_source/API_DeleteAlias.md | 22 +- doc_source/API_DeleteCodeSigningConfig.md | 20 +- doc_source/API_DeleteEventSourceMapping.md | 83 +++-- doc_source/API_DeleteFunction.md | 24 +- .../API_DeleteFunctionCodeSigningConfig.md | 20 +- doc_source/API_DeleteFunctionConcurrency.md | 20 +- .../API_DeleteFunctionEventInvokeConfig.md | 24 +- doc_source/API_DeleteLayerVersion.md | 24 +- .../API_DeleteProvisionedConcurrencyConfig.md | 22 +- doc_source/API_DestinationConfig.md | 12 +- doc_source/API_Environment.md | 8 +- doc_source/API_EnvironmentError.md | 8 +- doc_source/API_EnvironmentResponse.md | 10 +- .../API_EventSourceMappingConfiguration.md | 21 +- doc_source/API_FileSystemConfig.md | 8 +- doc_source/API_Filter.md | 20 ++ doc_source/API_FilterCriteria.md | 18 + doc_source/API_FunctionCode.md | 8 +- doc_source/API_FunctionCodeLocation.md | 8 +- doc_source/API_FunctionConfiguration.md | 22 +- doc_source/API_FunctionEventInvokeConfig.md | 10 +- doc_source/API_GetAccountSettings.md | 26 +- doc_source/API_GetAlias.md | 36 +- doc_source/API_GetCodeSigningConfig.md | 24 +- doc_source/API_GetEventSourceMapping.md | 83 +++-- doc_source/API_GetFunction.md | 36 +- .../API_GetFunctionCodeSigningConfig.md | 24 +- doc_source/API_GetFunctionConcurrency.md | 24 +- doc_source/API_GetFunctionConfiguration.md | 104 +++--- .../API_GetFunctionEventInvokeConfig.md | 36 +- doc_source/API_GetLayerVersion.md | 44 +-- doc_source/API_GetLayerVersionByArn.md | 42 +-- doc_source/API_GetLayerVersionPolicy.md | 28 +- doc_source/API_GetPolicy.md | 26 +- .../API_GetProvisionedConcurrencyConfig.md | 34 +- doc_source/API_ImageConfig.md | 8 +- doc_source/API_ImageConfigError.md | 8 +- doc_source/API_ImageConfigResponse.md | 12 +- doc_source/API_Invoke.md | 40 +-- doc_source/API_InvokeAsync.md | 26 +- doc_source/API_Layer.md | 10 +- doc_source/API_LayerVersionContentInput.md | 10 +- doc_source/API_LayerVersionContentOutput.md | 10 +- doc_source/API_LayerVersionsListItem.md | 10 +- doc_source/API_LayersListItem.md | 12 +- doc_source/API_ListAliases.md | 32 +- doc_source/API_ListCodeSigningConfigs.md | 28 +- doc_source/API_ListEventSourceMappings.md | 39 ++- .../API_ListFunctionEventInvokeConfigs.md | 32 +- doc_source/API_ListFunctions.md | 34 +- .../API_ListFunctionsByCodeSigningConfig.md | 28 +- doc_source/API_ListLayerVersions.md | 36 +- doc_source/API_ListLayers.md | 34 +- .../API_ListProvisionedConcurrencyConfigs.md | 30 +- doc_source/API_ListTags.md | 24 +- doc_source/API_ListVersionsByFunction.md | 30 +- doc_source/API_OnFailure.md | 8 +- doc_source/API_OnSuccess.md | 8 +- doc_source/API_Operations.md | 116 +++---- ...PI_ProvisionedConcurrencyConfigListItem.md | 8 +- doc_source/API_PublishLayerVersion.md | 58 ++-- doc_source/API_PublishVersion.md | 110 +++--- .../API_PutFunctionCodeSigningConfig.md | 26 +- doc_source/API_PutFunctionConcurrency.md | 28 +- .../API_PutFunctionEventInvokeConfig.md | 46 +-- .../API_PutProvisionedConcurrencyConfig.md | 36 +- doc_source/API_Reference.md | 0 .../API_RemoveLayerVersionPermission.md | 28 +- doc_source/API_RemovePermission.md | 28 +- doc_source/API_SelfManagedEventSource.md | 8 +- doc_source/API_SourceAccessConfiguration.md | 12 +- doc_source/API_TagResource.md | 22 +- doc_source/API_TracingConfig.md | 10 +- doc_source/API_TracingConfigResponse.md | 8 +- doc_source/API_Types.md | 74 +++-- doc_source/API_UntagResource.md | 22 +- doc_source/API_UpdateAlias.md | 46 +-- doc_source/API_UpdateCodeSigningConfig.md | 34 +- doc_source/API_UpdateEventSourceMapping.md | 123 ++++--- doc_source/API_UpdateFunctionCode.md | 132 ++++---- doc_source/API_UpdateFunctionConfiguration.md | 148 ++++----- .../API_UpdateFunctionEventInvokeConfig.md | 44 +-- doc_source/API_VpcConfig.md | 8 +- doc_source/API_VpcConfigResponse.md | 8 +- doc_source/access-control-identity-based.md | 0 doc_source/access-control-resource-based.md | 4 +- doc_source/applications-console.md | 0 doc_source/applications-tutorial.md | 0 doc_source/applications-usecases.md | 0 doc_source/best-practices.md | 5 +- doc_source/configuration-aliases.md | 8 +- doc_source/configuration-codesigning.md | 2 +- doc_source/configuration-concurrency.md | 2 +- doc_source/configuration-database.md | 6 +- doc_source/configuration-envvars.md | 6 +- doc_source/configuration-filesystem.md | 6 +- doc_source/configuration-function-common.md | 12 +- doc_source/configuration-function-zip.md | 10 +- doc_source/configuration-images.md | 8 +- doc_source/configuration-layers.md | 4 +- doc_source/configuration-tags.md | 6 +- doc_source/configuration-versions.md | 2 +- doc_source/configuration-vpc-endpoints.md | 0 doc_source/configuration-vpc.md | 4 +- doc_source/csharp-context.md | 0 doc_source/csharp-exceptions.md | 10 +- doc_source/csharp-handler.md | 197 ++++++++--- doc_source/csharp-image.md | 3 +- doc_source/csharp-logging.md | 27 +- doc_source/csharp-package-cli.md | 37 ++- doc_source/csharp-package-toolkit.md | 11 +- doc_source/csharp-package.md | 0 doc_source/csharp-tracing.md | 2 +- doc_source/deploying-lambda-apps.md | 0 doc_source/foundation-arch.md | 2 +- doc_source/foundation-console.md | 0 doc_source/foundation-networking.md | 0 doc_source/foundation-progmodel.md | 0 doc_source/functions-states.md | 4 +- doc_source/getting-started-create-function.md | 8 +- doc_source/getting-started.md | 0 doc_source/gettingstarted-awscli.md | 0 doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 4 +- doc_source/gettingstarted-images.md | 12 +- doc_source/gettingstarted-limits.md | 4 +- doc_source/gettingstarted-package.md | 0 doc_source/glossary.md | 0 doc_source/go-image.md | 2 +- doc_source/golang-context.md | 0 doc_source/golang-envvars.md | 0 doc_source/golang-exceptions.md | 4 +- doc_source/golang-handler.md | 0 doc_source/golang-logging.md | 2 +- doc_source/golang-package.md | 0 doc_source/golang-tracing.md | 2 +- doc_source/images-create.md | 0 doc_source/images-test.md | 0 doc_source/index.md | 20 +- doc_source/invocation-async.md | 14 +- doc_source/invocation-eventfiltering.md | 312 ++++++++++++++++++ doc_source/invocation-eventsourcemapping.md | 39 ++- doc_source/invocation-images.md | 0 doc_source/invocation-layers.md | 6 +- doc_source/invocation-retries.md | 2 +- doc_source/invocation-scaling.md | 14 +- doc_source/invocation-sync.md | 0 doc_source/java-context.md | 0 doc_source/java-exceptions.md | 4 +- doc_source/java-handler.md | 0 doc_source/java-image.md | 2 +- doc_source/java-logging.md | 17 +- doc_source/java-package-eclipse.md | 0 doc_source/java-package.md | 24 +- doc_source/java-samples.md | 0 doc_source/java-tracing.md | 2 +- doc_source/kinesis-tutorial-spec.md | 2 +- doc_source/lambda-api-permissions-ref.md | 96 ++---- doc_source/lambda-csharp.md | 5 +- doc_source/lambda-edge.md | 0 doc_source/lambda-foundation.md | 0 doc_source/lambda-functions.md | 0 doc_source/lambda-golang.md | 0 doc_source/lambda-images.md | 0 doc_source/lambda-intro-execution-role.md | 33 +- doc_source/lambda-invocation.md | 15 +- doc_source/lambda-java.md | 0 doc_source/lambda-managing.md | 0 doc_source/lambda-monitoring.md | 4 +- doc_source/lambda-nodejs.md | 15 + doc_source/lambda-permissions.md | 0 doc_source/lambda-powershell.md | 1 + doc_source/lambda-python.md | 0 doc_source/lambda-releases.md | 3 +- doc_source/lambda-rolling-deployments.md | 0 doc_source/lambda-ruby.md | 0 doc_source/lambda-runtimes.md | 1 + doc_source/lambda-samples.md | 0 doc_source/lambda-security.md | 0 doc_source/lambda-services.md | 2 +- doc_source/lambda-settingup.md | 0 doc_source/lambda-stepfunctions.md | 0 doc_source/lambda-troubleshooting.md | 0 doc_source/logging-using-cloudtrail.md | 22 +- doc_source/monitoring-cloudwatchlogs.md | 11 +- doc_source/monitoring-code-profiler.md | 4 +- .../monitoring-functions-access-metrics.md | 34 +- doc_source/monitoring-insights.md | 2 +- doc_source/monitoring-metrics.md | 43 +-- doc_source/monitoring-servicemap.md | 4 +- doc_source/nodejs-context.md | 0 doc_source/nodejs-exceptions.md | 4 +- doc_source/nodejs-handler.md | 8 + doc_source/nodejs-image.md | 5 +- doc_source/nodejs-logging.md | 2 +- doc_source/nodejs-package.md | 0 doc_source/nodejs-tracing.md | 2 +- doc_source/permissions-boundary.md | 0 doc_source/powershell-context.md | 0 doc_source/powershell-devenv.md | 0 doc_source/powershell-exceptions.md | 4 +- doc_source/powershell-handler.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/powershell-package.md | 0 doc_source/provisioned-concurrency.md | 4 +- doc_source/python-context.md | 0 doc_source/python-exceptions.md | 4 +- doc_source/python-handler.md | 2 +- doc_source/python-image.md | 2 +- doc_source/python-logging.md | 2 +- doc_source/python-package.md | 6 +- doc_source/python-tracing.md | 2 +- doc_source/ruby-context.md | 0 doc_source/ruby-exceptions.md | 4 +- doc_source/ruby-handler.md | 0 doc_source/ruby-image.md | 2 +- doc_source/ruby-logging.md | 2 +- doc_source/ruby-package.md | 0 doc_source/ruby-tracing.md | 2 +- doc_source/runtime-support-policy.md | 8 +- doc_source/runtimes-api.md | 0 doc_source/runtimes-avx2.md | 0 doc_source/runtimes-context.md | 0 doc_source/runtimes-custom.md | 0 doc_source/runtimes-extensions-api.md | 2 +- doc_source/runtimes-images.md | 0 doc_source/runtimes-logs-api.md | 0 doc_source/runtimes-modify.md | 0 doc_source/runtimes-walkthrough.md | 2 +- doc_source/samples-blank.md | 2 +- doc_source/samples-errorprocessor.md | 0 doc_source/samples-listmanager.md | 0 doc_source/security-compliance.md | 0 doc_source/security-configuration.md | 0 doc_source/security-dataprotection.md | 0 doc_source/security-iam.md | 0 doc_source/security-infrastructure.md | 0 doc_source/security-resilience.md | 0 .../security_iam_id-based-policy-examples.md | 0 doc_source/security_iam_service-with-iam.md | 0 doc_source/security_iam_troubleshoot.md | 0 doc_source/services-alb.md | 0 doc_source/services-alexa.md | 0 doc_source/services-apigateway-blueprint.md | 0 doc_source/services-apigateway-code.md | 0 doc_source/services-apigateway-template.md | 0 doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-apigateway.md | 2 +- doc_source/services-cloudformation.md | 0 .../services-cloudwatchevents-expressions.md | 0 .../services-cloudwatchevents-tutorial.md | 4 +- doc_source/services-cloudwatchevents.md | 3 +- doc_source/services-cloudwatchlogs.md | 0 doc_source/services-codecommit.md | 0 doc_source/services-codepipeline.md | 0 doc_source/services-cognito.md | 0 doc_source/services-config.md | 0 doc_source/services-connect.md | 0 doc_source/services-ec2-tutorial.md | 0 doc_source/services-ec2.md | 0 doc_source/services-efs.md | 0 doc_source/services-elasticache-tutorial.md | 0 doc_source/services-iot.md | 0 doc_source/services-iotevents.md | 0 doc_source/services-kinesisfirehose.md | 0 doc_source/services-lex.md | 0 doc_source/services-rds-tutorial.md | 0 doc_source/services-rds.md | 0 doc_source/services-s3-batch.md | 2 +- doc_source/services-s3-object-lambda.md | 0 doc_source/services-ses.md | 0 doc_source/services-stepfunctions.md | 0 doc_source/services-xray.md | 2 +- doc_source/stepfunctions-lc.md | 0 doc_source/stepfunctions-patterns.md | 0 doc_source/troubleshooting-deployment.md | 0 doc_source/troubleshooting-execution.md | 0 doc_source/troubleshooting-images.md | 0 doc_source/troubleshooting-invocation.md | 0 doc_source/troubleshooting-networking.md | 20 +- doc_source/using-extensions.md | 2 +- doc_source/welcome.md | 2 +- doc_source/with-android-create-package.md | 0 doc_source/with-android-example.md | 2 +- doc_source/with-cloudtrail-create-package.md | 0 doc_source/with-cloudtrail-example.md | 0 doc_source/with-cloudtrail.md | 2 +- doc_source/with-ddb-create-package.md | 0 doc_source/with-ddb-example.md | 6 +- doc_source/with-ddb.md | 34 +- doc_source/with-kafka.md | 288 ++++++++++++---- doc_source/with-kinesis-create-package.md | 0 .../with-kinesis-example-use-app-spec.md | 0 doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 26 +- doc_source/with-mq.md | 16 +- doc_source/with-msk.md | 237 ++++++++++--- doc_source/with-on-demand-custom-android.md | 0 doc_source/with-s3-example-use-app-spec.md | 2 +- doc_source/with-s3-example.md | 6 +- doc_source/with-s3-tutorial.md | 10 +- doc_source/with-s3.md | 2 +- ...th-scheduledevents-example-use-app-spec.md | 52 --- doc_source/with-secrets-manager.md | 0 doc_source/with-sns-create-package.md | 0 doc_source/with-sns-example.md | 54 +-- doc_source/with-sns.md | 0 doc_source/with-sqs-create-package.md | 0 doc_source/with-sqs-cross-account-example.md | 2 +- doc_source/with-sqs-example-use-app-spec.md | 2 +- doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 140 ++++++-- 327 files changed, 3156 insertions(+), 2220 deletions(-) mode change 100644 => 100755 doc_source/API_AccountLimit.md mode change 100644 => 100755 doc_source/API_AccountUsage.md mode change 100644 => 100755 doc_source/API_AddLayerVersionPermission.md mode change 100644 => 100755 doc_source/API_AddPermission.md mode change 100644 => 100755 doc_source/API_AliasConfiguration.md mode change 100644 => 100755 doc_source/API_AliasRoutingConfiguration.md mode change 100644 => 100755 doc_source/API_AllowedPublishers.md mode change 100644 => 100755 doc_source/API_CodeSigningConfig.md mode change 100644 => 100755 doc_source/API_CodeSigningPolicies.md mode change 100644 => 100755 doc_source/API_Concurrency.md mode change 100644 => 100755 doc_source/API_CreateAlias.md mode change 100644 => 100755 doc_source/API_CreateCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_CreateEventSourceMapping.md mode change 100644 => 100755 doc_source/API_CreateFunction.md mode change 100644 => 100755 doc_source/API_DeadLetterConfig.md mode change 100644 => 100755 doc_source/API_DeleteAlias.md mode change 100644 => 100755 doc_source/API_DeleteCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_DeleteEventSourceMapping.md mode change 100644 => 100755 doc_source/API_DeleteFunction.md mode change 100644 => 100755 doc_source/API_DeleteFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_DeleteFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_DeleteFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_DeleteLayerVersion.md mode change 100644 => 100755 doc_source/API_DeleteProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_DestinationConfig.md mode change 100644 => 100755 doc_source/API_Environment.md mode change 100644 => 100755 doc_source/API_EnvironmentError.md mode change 100644 => 100755 doc_source/API_EnvironmentResponse.md mode change 100644 => 100755 doc_source/API_EventSourceMappingConfiguration.md mode change 100644 => 100755 doc_source/API_FileSystemConfig.md create mode 100755 doc_source/API_Filter.md create mode 100755 doc_source/API_FilterCriteria.md mode change 100644 => 100755 doc_source/API_FunctionCode.md mode change 100644 => 100755 doc_source/API_FunctionCodeLocation.md mode change 100644 => 100755 doc_source/API_FunctionConfiguration.md mode change 100644 => 100755 doc_source/API_FunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_GetAccountSettings.md mode change 100644 => 100755 doc_source/API_GetAlias.md mode change 100644 => 100755 doc_source/API_GetCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_GetEventSourceMapping.md mode change 100644 => 100755 doc_source/API_GetFunction.md mode change 100644 => 100755 doc_source/API_GetFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_GetFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_GetFunctionConfiguration.md mode change 100644 => 100755 doc_source/API_GetFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_GetLayerVersion.md mode change 100644 => 100755 doc_source/API_GetLayerVersionByArn.md mode change 100644 => 100755 doc_source/API_GetLayerVersionPolicy.md mode change 100644 => 100755 doc_source/API_GetPolicy.md mode change 100644 => 100755 doc_source/API_GetProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_ImageConfig.md mode change 100644 => 100755 doc_source/API_ImageConfigError.md mode change 100644 => 100755 doc_source/API_ImageConfigResponse.md mode change 100644 => 100755 doc_source/API_Invoke.md mode change 100644 => 100755 doc_source/API_InvokeAsync.md mode change 100644 => 100755 doc_source/API_Layer.md mode change 100644 => 100755 doc_source/API_LayerVersionContentInput.md mode change 100644 => 100755 doc_source/API_LayerVersionContentOutput.md mode change 100644 => 100755 doc_source/API_LayerVersionsListItem.md mode change 100644 => 100755 doc_source/API_LayersListItem.md mode change 100644 => 100755 doc_source/API_ListAliases.md mode change 100644 => 100755 doc_source/API_ListCodeSigningConfigs.md mode change 100644 => 100755 doc_source/API_ListEventSourceMappings.md mode change 100644 => 100755 doc_source/API_ListFunctionEventInvokeConfigs.md mode change 100644 => 100755 doc_source/API_ListFunctions.md mode change 100644 => 100755 doc_source/API_ListFunctionsByCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_ListLayerVersions.md mode change 100644 => 100755 doc_source/API_ListLayers.md mode change 100644 => 100755 doc_source/API_ListProvisionedConcurrencyConfigs.md mode change 100644 => 100755 doc_source/API_ListTags.md mode change 100644 => 100755 doc_source/API_ListVersionsByFunction.md mode change 100644 => 100755 doc_source/API_OnFailure.md mode change 100644 => 100755 doc_source/API_OnSuccess.md mode change 100644 => 100755 doc_source/API_Operations.md mode change 100644 => 100755 doc_source/API_ProvisionedConcurrencyConfigListItem.md mode change 100644 => 100755 doc_source/API_PublishLayerVersion.md mode change 100644 => 100755 doc_source/API_PublishVersion.md mode change 100644 => 100755 doc_source/API_PutFunctionCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_PutFunctionConcurrency.md mode change 100644 => 100755 doc_source/API_PutFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_PutProvisionedConcurrencyConfig.md mode change 100644 => 100755 doc_source/API_Reference.md mode change 100644 => 100755 doc_source/API_RemoveLayerVersionPermission.md mode change 100644 => 100755 doc_source/API_RemovePermission.md mode change 100644 => 100755 doc_source/API_SelfManagedEventSource.md mode change 100644 => 100755 doc_source/API_SourceAccessConfiguration.md mode change 100644 => 100755 doc_source/API_TagResource.md mode change 100644 => 100755 doc_source/API_TracingConfig.md mode change 100644 => 100755 doc_source/API_TracingConfigResponse.md mode change 100644 => 100755 doc_source/API_Types.md mode change 100644 => 100755 doc_source/API_UntagResource.md mode change 100644 => 100755 doc_source/API_UpdateAlias.md mode change 100644 => 100755 doc_source/API_UpdateCodeSigningConfig.md mode change 100644 => 100755 doc_source/API_UpdateEventSourceMapping.md mode change 100644 => 100755 doc_source/API_UpdateFunctionCode.md mode change 100644 => 100755 doc_source/API_UpdateFunctionConfiguration.md mode change 100644 => 100755 doc_source/API_UpdateFunctionEventInvokeConfig.md mode change 100644 => 100755 doc_source/API_VpcConfig.md mode change 100644 => 100755 doc_source/API_VpcConfigResponse.md mode change 100644 => 100755 doc_source/access-control-identity-based.md mode change 100644 => 100755 doc_source/access-control-resource-based.md mode change 100644 => 100755 doc_source/applications-console.md mode change 100644 => 100755 doc_source/applications-tutorial.md mode change 100644 => 100755 doc_source/applications-usecases.md mode change 100644 => 100755 doc_source/best-practices.md mode change 100644 => 100755 doc_source/configuration-aliases.md mode change 100644 => 100755 doc_source/configuration-codesigning.md mode change 100644 => 100755 doc_source/configuration-concurrency.md mode change 100644 => 100755 doc_source/configuration-database.md mode change 100644 => 100755 doc_source/configuration-envvars.md mode change 100644 => 100755 doc_source/configuration-filesystem.md mode change 100644 => 100755 doc_source/configuration-function-common.md mode change 100644 => 100755 doc_source/configuration-function-zip.md mode change 100644 => 100755 doc_source/configuration-images.md mode change 100644 => 100755 doc_source/configuration-layers.md mode change 100644 => 100755 doc_source/configuration-tags.md mode change 100644 => 100755 doc_source/configuration-versions.md mode change 100644 => 100755 doc_source/configuration-vpc-endpoints.md mode change 100644 => 100755 doc_source/configuration-vpc.md mode change 100644 => 100755 doc_source/csharp-context.md mode change 100644 => 100755 doc_source/csharp-exceptions.md mode change 100644 => 100755 doc_source/csharp-handler.md mode change 100644 => 100755 doc_source/csharp-image.md mode change 100644 => 100755 doc_source/csharp-logging.md mode change 100644 => 100755 doc_source/csharp-package-cli.md mode change 100644 => 100755 doc_source/csharp-package-toolkit.md mode change 100644 => 100755 doc_source/csharp-package.md mode change 100644 => 100755 doc_source/csharp-tracing.md mode change 100644 => 100755 doc_source/deploying-lambda-apps.md mode change 100644 => 100755 doc_source/foundation-arch.md mode change 100644 => 100755 doc_source/foundation-console.md mode change 100644 => 100755 doc_source/foundation-networking.md mode change 100644 => 100755 doc_source/foundation-progmodel.md mode change 100644 => 100755 doc_source/functions-states.md mode change 100644 => 100755 doc_source/getting-started-create-function.md mode change 100644 => 100755 doc_source/getting-started.md mode change 100644 => 100755 doc_source/gettingstarted-awscli.md mode change 100644 => 100755 doc_source/gettingstarted-concepts.md mode change 100644 => 100755 doc_source/gettingstarted-features.md mode change 100644 => 100755 doc_source/gettingstarted-images.md mode change 100644 => 100755 doc_source/gettingstarted-limits.md mode change 100644 => 100755 doc_source/gettingstarted-package.md mode change 100644 => 100755 doc_source/glossary.md mode change 100644 => 100755 doc_source/go-image.md mode change 100644 => 100755 doc_source/golang-context.md mode change 100644 => 100755 doc_source/golang-envvars.md mode change 100644 => 100755 doc_source/golang-exceptions.md mode change 100644 => 100755 doc_source/golang-handler.md mode change 100644 => 100755 doc_source/golang-logging.md mode change 100644 => 100755 doc_source/golang-package.md mode change 100644 => 100755 doc_source/golang-tracing.md mode change 100644 => 100755 doc_source/images-create.md mode change 100644 => 100755 doc_source/images-test.md mode change 100644 => 100755 doc_source/index.md mode change 100644 => 100755 doc_source/invocation-async.md create mode 100755 doc_source/invocation-eventfiltering.md mode change 100644 => 100755 doc_source/invocation-eventsourcemapping.md mode change 100644 => 100755 doc_source/invocation-images.md mode change 100644 => 100755 doc_source/invocation-layers.md mode change 100644 => 100755 doc_source/invocation-retries.md mode change 100644 => 100755 doc_source/invocation-scaling.md mode change 100644 => 100755 doc_source/invocation-sync.md mode change 100644 => 100755 doc_source/java-context.md mode change 100644 => 100755 doc_source/java-exceptions.md mode change 100644 => 100755 doc_source/java-handler.md mode change 100644 => 100755 doc_source/java-image.md mode change 100644 => 100755 doc_source/java-logging.md mode change 100644 => 100755 doc_source/java-package-eclipse.md mode change 100644 => 100755 doc_source/java-package.md mode change 100644 => 100755 doc_source/java-samples.md mode change 100644 => 100755 doc_source/java-tracing.md mode change 100644 => 100755 doc_source/kinesis-tutorial-spec.md mode change 100644 => 100755 doc_source/lambda-api-permissions-ref.md mode change 100644 => 100755 doc_source/lambda-csharp.md mode change 100644 => 100755 doc_source/lambda-edge.md mode change 100644 => 100755 doc_source/lambda-foundation.md mode change 100644 => 100755 doc_source/lambda-functions.md mode change 100644 => 100755 doc_source/lambda-golang.md mode change 100644 => 100755 doc_source/lambda-images.md mode change 100644 => 100755 doc_source/lambda-intro-execution-role.md mode change 100644 => 100755 doc_source/lambda-invocation.md mode change 100644 => 100755 doc_source/lambda-java.md mode change 100644 => 100755 doc_source/lambda-managing.md mode change 100644 => 100755 doc_source/lambda-monitoring.md mode change 100644 => 100755 doc_source/lambda-nodejs.md mode change 100644 => 100755 doc_source/lambda-permissions.md mode change 100644 => 100755 doc_source/lambda-powershell.md mode change 100644 => 100755 doc_source/lambda-python.md mode change 100644 => 100755 doc_source/lambda-releases.md mode change 100644 => 100755 doc_source/lambda-rolling-deployments.md mode change 100644 => 100755 doc_source/lambda-ruby.md mode change 100644 => 100755 doc_source/lambda-runtimes.md mode change 100644 => 100755 doc_source/lambda-samples.md mode change 100644 => 100755 doc_source/lambda-security.md mode change 100644 => 100755 doc_source/lambda-services.md mode change 100644 => 100755 doc_source/lambda-settingup.md mode change 100644 => 100755 doc_source/lambda-stepfunctions.md mode change 100644 => 100755 doc_source/lambda-troubleshooting.md mode change 100644 => 100755 doc_source/logging-using-cloudtrail.md mode change 100644 => 100755 doc_source/monitoring-cloudwatchlogs.md mode change 100644 => 100755 doc_source/monitoring-code-profiler.md mode change 100644 => 100755 doc_source/monitoring-functions-access-metrics.md mode change 100644 => 100755 doc_source/monitoring-insights.md mode change 100644 => 100755 doc_source/monitoring-metrics.md mode change 100644 => 100755 doc_source/monitoring-servicemap.md mode change 100644 => 100755 doc_source/nodejs-context.md mode change 100644 => 100755 doc_source/nodejs-exceptions.md mode change 100644 => 100755 doc_source/nodejs-handler.md mode change 100644 => 100755 doc_source/nodejs-image.md mode change 100644 => 100755 doc_source/nodejs-logging.md mode change 100644 => 100755 doc_source/nodejs-package.md mode change 100644 => 100755 doc_source/nodejs-tracing.md mode change 100644 => 100755 doc_source/permissions-boundary.md mode change 100644 => 100755 doc_source/powershell-context.md mode change 100644 => 100755 doc_source/powershell-devenv.md mode change 100644 => 100755 doc_source/powershell-exceptions.md mode change 100644 => 100755 doc_source/powershell-handler.md mode change 100644 => 100755 doc_source/powershell-logging.md mode change 100644 => 100755 doc_source/powershell-package.md mode change 100644 => 100755 doc_source/provisioned-concurrency.md mode change 100644 => 100755 doc_source/python-context.md mode change 100644 => 100755 doc_source/python-exceptions.md mode change 100644 => 100755 doc_source/python-handler.md mode change 100644 => 100755 doc_source/python-image.md mode change 100644 => 100755 doc_source/python-logging.md mode change 100644 => 100755 doc_source/python-package.md mode change 100644 => 100755 doc_source/python-tracing.md mode change 100644 => 100755 doc_source/ruby-context.md mode change 100644 => 100755 doc_source/ruby-exceptions.md mode change 100644 => 100755 doc_source/ruby-handler.md mode change 100644 => 100755 doc_source/ruby-image.md mode change 100644 => 100755 doc_source/ruby-logging.md mode change 100644 => 100755 doc_source/ruby-package.md mode change 100644 => 100755 doc_source/ruby-tracing.md mode change 100644 => 100755 doc_source/runtime-support-policy.md mode change 100644 => 100755 doc_source/runtimes-api.md mode change 100644 => 100755 doc_source/runtimes-avx2.md mode change 100644 => 100755 doc_source/runtimes-context.md mode change 100644 => 100755 doc_source/runtimes-custom.md mode change 100644 => 100755 doc_source/runtimes-extensions-api.md mode change 100644 => 100755 doc_source/runtimes-images.md mode change 100644 => 100755 doc_source/runtimes-logs-api.md mode change 100644 => 100755 doc_source/runtimes-modify.md mode change 100644 => 100755 doc_source/runtimes-walkthrough.md mode change 100644 => 100755 doc_source/samples-blank.md mode change 100644 => 100755 doc_source/samples-errorprocessor.md mode change 100644 => 100755 doc_source/samples-listmanager.md mode change 100644 => 100755 doc_source/security-compliance.md mode change 100644 => 100755 doc_source/security-configuration.md mode change 100644 => 100755 doc_source/security-dataprotection.md mode change 100644 => 100755 doc_source/security-iam.md mode change 100644 => 100755 doc_source/security-infrastructure.md mode change 100644 => 100755 doc_source/security-resilience.md mode change 100644 => 100755 doc_source/security_iam_id-based-policy-examples.md mode change 100644 => 100755 doc_source/security_iam_service-with-iam.md mode change 100644 => 100755 doc_source/security_iam_troubleshoot.md mode change 100644 => 100755 doc_source/services-alb.md mode change 100644 => 100755 doc_source/services-alexa.md mode change 100644 => 100755 doc_source/services-apigateway-blueprint.md mode change 100644 => 100755 doc_source/services-apigateway-code.md mode change 100644 => 100755 doc_source/services-apigateway-template.md mode change 100644 => 100755 doc_source/services-apigateway-tutorial.md mode change 100644 => 100755 doc_source/services-apigateway.md mode change 100644 => 100755 doc_source/services-cloudformation.md mode change 100644 => 100755 doc_source/services-cloudwatchevents-expressions.md mode change 100644 => 100755 doc_source/services-cloudwatchevents-tutorial.md mode change 100644 => 100755 doc_source/services-cloudwatchevents.md mode change 100644 => 100755 doc_source/services-cloudwatchlogs.md mode change 100644 => 100755 doc_source/services-codecommit.md mode change 100644 => 100755 doc_source/services-codepipeline.md mode change 100644 => 100755 doc_source/services-cognito.md mode change 100644 => 100755 doc_source/services-config.md mode change 100644 => 100755 doc_source/services-connect.md mode change 100644 => 100755 doc_source/services-ec2-tutorial.md mode change 100644 => 100755 doc_source/services-ec2.md mode change 100644 => 100755 doc_source/services-efs.md mode change 100644 => 100755 doc_source/services-elasticache-tutorial.md mode change 100644 => 100755 doc_source/services-iot.md mode change 100644 => 100755 doc_source/services-iotevents.md mode change 100644 => 100755 doc_source/services-kinesisfirehose.md mode change 100644 => 100755 doc_source/services-lex.md mode change 100644 => 100755 doc_source/services-rds-tutorial.md mode change 100644 => 100755 doc_source/services-rds.md mode change 100644 => 100755 doc_source/services-s3-batch.md mode change 100644 => 100755 doc_source/services-s3-object-lambda.md mode change 100644 => 100755 doc_source/services-ses.md mode change 100644 => 100755 doc_source/services-stepfunctions.md mode change 100644 => 100755 doc_source/services-xray.md mode change 100644 => 100755 doc_source/stepfunctions-lc.md mode change 100644 => 100755 doc_source/stepfunctions-patterns.md mode change 100644 => 100755 doc_source/troubleshooting-deployment.md mode change 100644 => 100755 doc_source/troubleshooting-execution.md mode change 100644 => 100755 doc_source/troubleshooting-images.md mode change 100644 => 100755 doc_source/troubleshooting-invocation.md mode change 100644 => 100755 doc_source/troubleshooting-networking.md mode change 100644 => 100755 doc_source/using-extensions.md mode change 100644 => 100755 doc_source/welcome.md mode change 100644 => 100755 doc_source/with-android-create-package.md mode change 100644 => 100755 doc_source/with-android-example.md mode change 100644 => 100755 doc_source/with-cloudtrail-create-package.md mode change 100644 => 100755 doc_source/with-cloudtrail-example.md mode change 100644 => 100755 doc_source/with-cloudtrail.md mode change 100644 => 100755 doc_source/with-ddb-create-package.md mode change 100644 => 100755 doc_source/with-ddb-example.md mode change 100644 => 100755 doc_source/with-ddb.md mode change 100644 => 100755 doc_source/with-kafka.md mode change 100644 => 100755 doc_source/with-kinesis-create-package.md mode change 100644 => 100755 doc_source/with-kinesis-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-kinesis-example.md mode change 100644 => 100755 doc_source/with-kinesis.md mode change 100644 => 100755 doc_source/with-mq.md mode change 100644 => 100755 doc_source/with-msk.md mode change 100644 => 100755 doc_source/with-on-demand-custom-android.md mode change 100644 => 100755 doc_source/with-s3-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-s3-example.md mode change 100644 => 100755 doc_source/with-s3-tutorial.md mode change 100644 => 100755 doc_source/with-s3.md delete mode 100644 doc_source/with-scheduledevents-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-secrets-manager.md mode change 100644 => 100755 doc_source/with-sns-create-package.md mode change 100644 => 100755 doc_source/with-sns-example.md mode change 100644 => 100755 doc_source/with-sns.md mode change 100644 => 100755 doc_source/with-sqs-create-package.md mode change 100644 => 100755 doc_source/with-sqs-cross-account-example.md mode change 100644 => 100755 doc_source/with-sqs-example-use-app-spec.md mode change 100644 => 100755 doc_source/with-sqs-example.md mode change 100644 => 100755 doc_source/with-sqs.md diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md old mode 100644 new mode 100755 index 8f1ca0c8..24a89f4d --- a/doc_source/API_AccountLimit.md +++ b/doc_source/API_AccountLimit.md @@ -25,7 +25,7 @@ Type: Long Required: No ** UnreservedConcurrentExecutions ** -The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. +The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. Type: Integer Valid Range: Minimum value of 0\. Required: No @@ -33,7 +33,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md old mode 100644 new mode 100755 index d316b7b8..5717c170 --- a/doc_source/API_AccountUsage.md +++ b/doc_source/API_AccountUsage.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md old mode 100644 new mode 100755 index f06b3e02..1ee2de37 --- a/doc_source/API_AddLayerVersionPermission.md +++ b/doc_source/API_AddLayerVersionPermission.md @@ -1,8 +1,8 @@ # AddLayerVersionPermission -Adds permissions to the resource\-based policy of a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. +Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. -To revoke permission, call [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. +To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. ## Request Syntax @@ -22,16 +22,16 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ LayerName ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ RevisionId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ VersionNumber ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -39,27 +39,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Action ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. Type: String Length Constraints: Maximum length of 22\. Pattern: `lambda:GetLayerVersion` Required: Yes - ** [ OrganizationId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** With the principal set to `*`, grant permission to all accounts in the specified organization\. Type: String Length Constraints: Maximum length of 34\. Pattern: `o-[a-z0-9]{10,32}` Required: No - ** [ Principal ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. Type: String Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` Required: Yes - ** [ StatementId ](#API_AddLayerVersionPermission_RequestSyntax) ** + ** [StatementId](#API_AddLayerVersionPermission_RequestSyntax) ** An identifier that distinguishes the policy from others on the same layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -84,11 +84,11 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ RevisionId ](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [RevisionId](#API_AddLayerVersionPermission_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String - ** [ Statement ](#API_AddLayerVersionPermission_ResponseSyntax) ** + ** [Statement](#API_AddLayerVersionPermission_ResponseSyntax) ** The permission statement\. Type: String @@ -125,12 +125,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md old mode 100644 new mode 100755 index 4889c9d4..17759770 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -27,7 +27,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_AddPermission_RequestSyntax) ** + ** [FunctionName](#API_AddPermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -39,7 +39,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_AddPermission_RequestSyntax) ** + ** [Qualifier](#API_AddPermission_RequestSyntax) ** Specify a version or alias to add permissions to a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -48,45 +48,45 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ Action ](#API_AddPermission_RequestSyntax) ** + ** [Action](#API_AddPermission_RequestSyntax) ** The action that the principal can use on the function\. For example, `lambda:InvokeFunction` or `lambda:GetFunction`\. Type: String Pattern: `(lambda:[*]|lambda:[a-zA-Z]+|[*])` Required: Yes - ** [ EventSourceToken ](#API_AddPermission_RequestSyntax) ** + ** [EventSourceToken](#API_AddPermission_RequestSyntax) ** For Alexa Smart Home functions, a token that must be supplied by the invoker\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Pattern: `[a-zA-Z0-9._\-]+` Required: No - ** [ Principal ](#API_AddPermission_RequestSyntax) ** + ** [Principal](#API_AddPermission_RequestSyntax) ** The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. Type: String Pattern: `[^\s]+` Required: Yes - ** [ RevisionId ](#API_AddPermission_RequestSyntax) ** + ** [RevisionId](#API_AddPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. Type: String Required: No - ** [ SourceAccount ](#API_AddPermission_RequestSyntax) ** + ** [SourceAccount](#API_AddPermission_RequestSyntax) ** For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. Type: String Length Constraints: Maximum length of 12\. Pattern: `\d{12}` Required: No - ** [ SourceArn ](#API_AddPermission_RequestSyntax) ** + ** [SourceArn](#API_AddPermission_RequestSyntax) ** For AWS services, the ARN of the AWS resource that invokes the function\. For example, an Amazon S3 bucket or Amazon SNS topic\. Note that Lambda configures the comparison using the `StringLike` operator\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [ StatementId ](#API_AddPermission_RequestSyntax) ** + ** [StatementId](#API_AddPermission_RequestSyntax) ** A statement identifier that differentiates the statement from others in the same policy\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 100\. @@ -110,7 +110,7 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Statement ](#API_AddPermission_ResponseSyntax) ** + ** [Statement](#API_AddPermission_ResponseSyntax) ** The permission statement that's added to the function policy\. Type: String @@ -147,12 +147,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md old mode 100644 new mode 100755 index 13d6487b..b6aa0d1b --- a/doc_source/API_AliasConfiguration.md +++ b/doc_source/API_AliasConfiguration.md @@ -37,13 +37,13 @@ Required: No ** RoutingConfig ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md old mode 100644 new mode 100755 index 8eab8c2a..c2c4021b --- a/doc_source/API_AliasRoutingConfiguration.md +++ b/doc_source/API_AliasRoutingConfiguration.md @@ -15,7 +15,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md old mode 100644 new mode 100755 index 1060d3b2..498de6b5 --- a/doc_source/API_AllowedPublishers.md +++ b/doc_source/API_AllowedPublishers.md @@ -14,7 +14,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md old mode 100644 new mode 100755 index 10c2381f..99a1c44d --- a/doc_source/API_CodeSigningConfig.md +++ b/doc_source/API_CodeSigningConfig.md @@ -6,7 +6,7 @@ Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/ ** AllowedPublishers ** List of allowed publishers\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: Yes ** CodeSigningConfigArn ** @@ -24,7 +24,7 @@ Required: Yes ** CodeSigningPolicies ** The code signing policy controls the validation failure action for signature mismatch or expiry\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: Yes ** Description ** @@ -41,7 +41,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md old mode 100644 new mode 100755 index fdeb3b45..6ce8eb1a --- a/doc_source/API_CodeSigningPolicies.md +++ b/doc_source/API_CodeSigningPolicies.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md old mode 100644 new mode 100755 index b9c53c9d..f555752a --- a/doc_source/API_Concurrency.md +++ b/doc_source/API_Concurrency.md @@ -11,7 +11,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md old mode 100644 new mode 100755 index 710f21c9..328a580c --- a/doc_source/API_CreateAlias.md +++ b/doc_source/API_CreateAlias.md @@ -26,7 +26,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_CreateAlias_RequestSyntax) ** + ** [FunctionName](#API_CreateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -42,29 +42,29 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Description ](#API_CreateAlias_RequestSyntax) ** + ** [Description](#API_CreateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ FunctionVersion ](#API_CreateAlias_RequestSyntax) ** + ** [FunctionVersion](#API_CreateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: Yes - ** [ Name ](#API_CreateAlias_RequestSyntax) ** + ** [Name](#API_CreateAlias_RequestSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` Required: Yes - ** [ RoutingConfig ](#API_CreateAlias_RequestSyntax) ** + ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -93,35 +93,35 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_CreateAlias_ResponseSyntax) ** + ** [AliasArn](#API_CreateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Description ](#API_CreateAlias_ResponseSyntax) ** + ** [Description](#API_CreateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_CreateAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_CreateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_CreateAlias_ResponseSyntax) ** + ** [Name](#API_CreateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_CreateAlias_ResponseSyntax) ** + ** [RevisionId](#API_CreateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_CreateAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_CreateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -148,12 +148,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md old mode 100644 new mode 100755 index eaa6639a..399ed29b --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -27,17 +27,17 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ AllowedPublishers ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: Yes - ** [ CodeSigningPolicies ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** The code signing policies define the actions to take if the validation checks fail\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: No - ** [ Description ](#API_CreateCodeSigningConfig_RequestSyntax) ** + ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -71,9 +71,9 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_CreateCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** The code signing configuration\. -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -88,12 +88,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md old mode 100644 new mode 100755 index 1e63ae7f..e24d8261 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -44,6 +44,13 @@ Content-type: application/json }, "Enabled": boolean, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionName": "string", "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, @@ -77,7 +84,7 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ BatchSize ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. @@ -89,23 +96,23 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [ DestinationConfig ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ Enabled ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. Default: True Type: Boolean Required: No - ** [ EventSourceArn ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [EventSourceArn](#API_CreateEventSourceMapping_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -115,7 +122,12 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No - ** [ FunctionName ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [FilterCriteria](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object +Required: No + + ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -129,14 +141,14 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. @@ -144,25 +156,25 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [ Queues ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** \(MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -170,29 +182,29 @@ Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` Required: No - ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** The Self\-Managed Apache Kafka cluster to send records\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No - ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [ StartingPosition ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No - ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp Required: No - ** [ Topics ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. @@ -200,7 +212,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No - ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_RequestSyntax) ** + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -224,6 +236,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -260,113 +279,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_CreateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionResponseTypes ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_CreateEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -395,12 +418,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md old mode 100644 new mode 100755 index b2cbf94b..ac3dcc1f --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -6,17 +6,17 @@ You set the package type to `Image` if the deployment package is a [container im You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. If you do not specify the architecture, the default value is `x86-64`\. -When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. -The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([ TagResource ](API_TagResource.md)\) and per\-function concurrency limits \([ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\)\. +The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [ UpdateFunctionCode ](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. +You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. -If another account or an AWS service invokes your function, use [ AddPermission ](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. +If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. -To invoke your function directly, use [ Invoke ](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. +To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. ## Request Syntax @@ -85,48 +85,48 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. - ** [ Architectures ](#API_CreateFunction_RequestSyntax) ** + ** [Architectures](#API_CreateFunction_RequestSyntax) ** The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` Required: No - ** [ Code ](#API_CreateFunction_RequestSyntax) ** + ** [Code](#API_CreateFunction_RequestSyntax) ** The code for the function\. -Type: [ FunctionCode ](API_FunctionCode.md) object +Type: [FunctionCode](API_FunctionCode.md) object Required: Yes - ** [ CodeSigningConfigArn ](#API_CreateFunction_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: No - ** [ DeadLetterConfig ](#API_CreateFunction_RequestSyntax) ** + ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No - ** [ Description ](#API_CreateFunction_RequestSyntax) ** + ** [Description](#API_CreateFunction_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ Environment ](#API_CreateFunction_RequestSyntax) ** + ** [Environment](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [ Environment ](API_Environment.md) object +Type: [Environment](API_Environment.md) object Required: No - ** [ FileSystemConfigs ](#API_CreateFunction_RequestSyntax) ** + ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [ FunctionName ](#API_CreateFunction_RequestSyntax) ** + ** [FunctionName](#API_CreateFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -139,79 +139,79 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Handler ](#API_CreateFunction_RequestSyntax) ** -The name of the method within your code that Lambda calls to execute your function\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. + ** [Handler](#API_CreateFunction_RequestSyntax) ** +The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - ** [ ImageConfig ](#API_CreateFunction_RequestSyntax) ** + ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No - ** [ KMSKeyArn ](#API_CreateFunction_RequestSyntax) ** + ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No - ** [ Layers ](#API_CreateFunction_RequestSyntax) ** + ** [Layers](#API_CreateFunction_RequestSyntax) ** A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [ MemorySize ](#API_CreateFunction_RequestSyntax) ** + ** [MemorySize](#API_CreateFunction_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [ PackageType ](#API_CreateFunction_RequestSyntax) ** + ** [PackageType](#API_CreateFunction_RequestSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. Type: String Valid Values:` Zip | Image` Required: No - ** [ Publish ](#API_CreateFunction_RequestSyntax) ** + ** [Publish](#API_CreateFunction_RequestSyntax) ** Set to true to publish the first version of the function during creation\. Type: Boolean Required: No - ** [ Role ](#API_CreateFunction_RequestSyntax) ** + ** [Role](#API_CreateFunction_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: Yes - ** [ Runtime ](#API_CreateFunction_RequestSyntax) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. + ** [Runtime](#API_CreateFunction_RequestSyntax) ** +The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Tags ](#API_CreateFunction_RequestSyntax) ** + ** [Tags](#API_CreateFunction_RequestSyntax) ** A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. Type: String to string map Required: No - ** [ Timeout ](#API_CreateFunction_RequestSyntax) ** + ** [Timeout](#API_CreateFunction_RequestSyntax) ** The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [ TracingConfig ](#API_CreateFunction_RequestSyntax) ** + ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [ TracingConfig ](API_TracingConfig.md) object +Type: [TracingConfig](API_TracingConfig.md) object Required: No - ** [ VpcConfig ](#API_CreateFunction_RequestSyntax) ** + ** [VpcConfig](#API_CreateFunction_RequestSyntax) ** For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [ VpcConfig ](API_VpcConfig.md) object +Type: [VpcConfig](API_VpcConfig.md) object Required: No ## Response Syntax @@ -300,157 +300,157 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_CreateFunction_ResponseSyntax) ** + ** [Architectures](#API_CreateFunction_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_CreateFunction_ResponseSyntax) ** + ** [CodeSha256](#API_CreateFunction_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_CreateFunction_ResponseSyntax) ** + ** [CodeSize](#API_CreateFunction_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_CreateFunction_ResponseSyntax) ** + ** [DeadLetterConfig](#API_CreateFunction_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_CreateFunction_ResponseSyntax) ** + ** [Description](#API_CreateFunction_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_CreateFunction_ResponseSyntax) ** + ** [Environment](#API_CreateFunction_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_CreateFunction_ResponseSyntax) ** + ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_CreateFunction_ResponseSyntax) ** + ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionName ](#API_CreateFunction_ResponseSyntax) ** + ** [FunctionName](#API_CreateFunction_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Handler ](#API_CreateFunction_ResponseSyntax) ** + ** [Handler](#API_CreateFunction_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_CreateFunction_ResponseSyntax) ** + ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_CreateFunction_ResponseSyntax) ** + ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_CreateFunction_ResponseSyntax) ** + ** [LastModified](#API_CreateFunction_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ LastUpdateStatus ](#API_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatus](#API_CreateFunction_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [ LastUpdateStatusReason ](#API_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_CreateFunction_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_CreateFunction_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_CreateFunction_ResponseSyntax) ** + ** [Layers](#API_CreateFunction_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_CreateFunction_ResponseSyntax) ** + ** [MasterArn](#API_CreateFunction_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ MemorySize ](#API_CreateFunction_ResponseSyntax) ** + ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_CreateFunction_ResponseSyntax) ** + ** [PackageType](#API_CreateFunction_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_CreateFunction_ResponseSyntax) ** + ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_CreateFunction_ResponseSyntax) ** + ** [Role](#API_CreateFunction_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_CreateFunction_ResponseSyntax) ** + ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_CreateFunction_ResponseSyntax) ** + ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_CreateFunction_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_CreateFunction_ResponseSyntax) ** + ** [State](#API_CreateFunction_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [ StateReason ](#API_CreateFunction_ResponseSyntax) ** + ** [StateReason](#API_CreateFunction_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_CreateFunction_ResponseSyntax) ** + ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_CreateFunction_ResponseSyntax) ** + ** [Timeout](#API_CreateFunction_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [ TracingConfig ](#API_CreateFunction_ResponseSyntax) ** + ** [TracingConfig](#API_CreateFunction_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_CreateFunction_ResponseSyntax) ** + ** [Version](#API_CreateFunction_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_CreateFunction_ResponseSyntax) ** + ** [VpcConfig](#API_CreateFunction_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -493,12 +493,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md old mode 100644 new mode 100755 index 472781c8..66c1b753 --- a/doc_source/API_DeadLetterConfig.md +++ b/doc_source/API_DeadLetterConfig.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md old mode 100644 new mode 100755 index a2009314..e2c9e069 --- a/doc_source/API_DeleteAlias.md +++ b/doc_source/API_DeleteAlias.md @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteAlias_RequestSyntax) ** + ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Name ](#API_DeleteAlias_RequestSyntax) ** + ** [Name](#API_DeleteAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md old mode 100644 new mode 100755 index 4736a717..871eeff3 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ b/doc_source/API_DeleteCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_DeleteCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -53,12 +53,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md old mode 100644 new mode 100755 index 614c5471..ff0a29db --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -1,6 +1,6 @@ # DeleteEventSourceMapping -Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. +Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. When you delete an event source mapping, it enters a `Deleting` state and might not be completely deleted for several seconds\. @@ -14,7 +14,7 @@ DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [ UUID ](#API_DeleteEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -40,6 +40,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -76,113 +83,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_DeleteEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionResponseTypes ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_DeleteEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -211,12 +222,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md old mode 100644 new mode 100755 index 2b753d6f..a6c75339 --- a/doc_source/API_DeleteFunction.md +++ b/doc_source/API_DeleteFunction.md @@ -2,7 +2,7 @@ Deletes a Lambda function\. To delete a specific function version, use the `Qualifier` parameter\. Otherwise, all versions and aliases are deleted\. -To delete Lambda event source mappings that invoke a function, use [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. +To delete Lambda event source mappings that invoke a function, use [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunction_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** The name of the Lambda function or version\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_DeleteFunction_RequestSyntax) ** + ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** Specify a version to delete\. You can't delete a version that's referenced by an alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index 140631dd..e75f7f19 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ b/doc_source/API_DeleteFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -67,12 +67,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md old mode 100644 new mode 100755 index a5d54266..2021e7f2 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ b/doc_source/API_DeleteFunctionConcurrency.md @@ -12,7 +12,7 @@ DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -63,12 +63,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 8ae03cdb..97c1014e --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ b/doc_source/API_DeleteFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Deletes the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifie The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md old mode 100644 new mode 100755 index 7b64f0e2..4c05bfd8 --- a/doc_source/API_DeleteLayerVersion.md +++ b/doc_source/API_DeleteLayerVersion.md @@ -1,6 +1,6 @@ # DeleteLayerVersion -Deletes a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. +Deletes a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. ## Request Syntax @@ -12,13 +12,13 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_DeleteLayerVersion_RequestSyntax) ** + ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_DeleteLayerVersion_RequestSyntax) ** + ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -49,12 +49,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 3bbd703f..8791b35c --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ b/doc_source/API_DeleteProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qual The request uses the following URI parameters\. - ** [ FunctionName ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -69,12 +69,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md old mode 100644 new mode 100755 index a0fb8fc5..9d70476f --- a/doc_source/API_DestinationConfig.md +++ b/doc_source/API_DestinationConfig.md @@ -6,18 +6,18 @@ A configuration object that specifies the destination of an event after Lambda p ** OnFailure ** The destination configuration for failed invocations\. -Type: [ OnFailure ](API_OnFailure.md) object +Type: [OnFailure](API_OnFailure.md) object Required: No ** OnSuccess ** The destination configuration for successful invocations\. -Type: [ OnSuccess ](API_OnSuccess.md) object +Type: [OnSuccess](API_OnSuccess.md) object Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md old mode 100644 new mode 100755 index 0c18270f..f6431eea --- a/doc_source/API_Environment.md +++ b/doc_source/API_Environment.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md old mode 100644 new mode 100755 index 1532e16f..2ddf454e --- a/doc_source/API_EnvironmentError.md +++ b/doc_source/API_EnvironmentError.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md old mode 100644 new mode 100755 index f1dadee3..d3e1bb12 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -6,7 +6,7 @@ The results of an operation to update or read environment variables\. If the ope ** Error ** Error messages for environment variables that couldn't be applied\. -Type: [ EnvironmentError ](API_EnvironmentError.md) object +Type: [EnvironmentError](API_EnvironmentError.md) object Required: No ** Variables ** @@ -18,7 +18,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md old mode 100644 new mode 100755 index 6303741e..4cccf1a0 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -1,6 +1,6 @@ # EventSourceMappingConfiguration -A mapping between an AWS resource and a Lambda function\. For details, see [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md)\. +A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. ## Contents @@ -19,13 +19,18 @@ Required: No ** DestinationConfig ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** EventSourceArn ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` +Required: No + + ** FilterCriteria ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object Required: No ** FunctionArn ** @@ -87,12 +92,12 @@ Required: No ** SelfManagedEventSource ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object Required: No ** SourceAccessConfigurations ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No @@ -139,7 +144,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md old mode 100644 new mode 100755 index 9c5257df..36843cd4 --- a/doc_source/API_FileSystemConfig.md +++ b/doc_source/API_FileSystemConfig.md @@ -21,7 +21,7 @@ Required: Yes ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_Filter.md b/doc_source/API_Filter.md new file mode 100755 index 00000000..ab0a6041 --- /dev/null +++ b/doc_source/API_Filter.md @@ -0,0 +1,20 @@ +# Filter + + A structure within a `FilterCriteria` object that defines an event filtering pattern\. + +## Contents + + ** Pattern ** + A filter pattern\. For more information on the syntax of a filter pattern, see [ Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax)\. +Type: String +Length Constraints: Minimum length of 0\. Maximum length of 4096\. +Pattern: `.*` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Filter) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Filter) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Filter) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Filter) \ No newline at end of file diff --git a/doc_source/API_FilterCriteria.md b/doc_source/API_FilterCriteria.md new file mode 100755 index 00000000..06d99095 --- /dev/null +++ b/doc_source/API_FilterCriteria.md @@ -0,0 +1,18 @@ +# FilterCriteria + + An object that contains the filters for an event source\. + +## Contents + + ** Filters ** + A list of filters\. +Type: Array of [Filter](API_Filter.md) objects +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FilterCriteria) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FilterCriteria) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FilterCriteria) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FilterCriteria) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md old mode 100644 new mode 100755 index 0a3dfa0f..1289dcdb --- a/doc_source/API_FunctionCode.md +++ b/doc_source/API_FunctionCode.md @@ -36,7 +36,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md old mode 100644 new mode 100755 index d21a8936..0a9aff6c --- a/doc_source/API_FunctionCodeLocation.md +++ b/doc_source/API_FunctionCodeLocation.md @@ -27,7 +27,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md old mode 100644 new mode 100755 index 2896643e..4590062b --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -23,7 +23,7 @@ Required: No ** DeadLetterConfig ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No ** Description ** @@ -34,12 +34,12 @@ Required: No ** Environment ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object Required: No ** FileSystemConfigs ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No @@ -65,7 +65,7 @@ Required: No ** ImageConfigResponse ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object Required: No ** KMSKeyArn ** @@ -98,7 +98,7 @@ Required: No ** Layers ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects Required: No ** MasterArn ** @@ -173,7 +173,7 @@ Required: No ** TracingConfig ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object Required: No ** Version ** @@ -185,13 +185,13 @@ Required: No ** VpcConfig ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 1ea75549..d5e27544 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ b/doc_source/API_FunctionEventInvokeConfig.md @@ -10,7 +10,7 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No ** FunctionArn ** @@ -39,7 +39,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md old mode 100644 new mode 100755 index f18742f2..dd4292cf --- a/doc_source/API_GetAccountSettings.md +++ b/doc_source/API_GetAccountSettings.md @@ -43,13 +43,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AccountLimit ](#API_GetAccountSettings_ResponseSyntax) ** + ** [AccountLimit](#API_GetAccountSettings_ResponseSyntax) ** Limits that are related to concurrency and code storage\. -Type: [ AccountLimit ](API_AccountLimit.md) object +Type: [AccountLimit](API_AccountLimit.md) object - ** [ AccountUsage ](#API_GetAccountSettings_ResponseSyntax) ** + ** [AccountUsage](#API_GetAccountSettings_ResponseSyntax) ** The number of functions and amount of storage in use\. -Type: [ AccountUsage ](API_AccountUsage.md) object +Type: [AccountUsage](API_AccountUsage.md) object ## Errors @@ -64,12 +64,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md old mode 100644 new mode 100755 index 9c1f7756..fdb3ced6 --- a/doc_source/API_GetAlias.md +++ b/doc_source/API_GetAlias.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetAlias_RequestSyntax) ** + ** [FunctionName](#API_GetAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Name ](#API_GetAlias_RequestSyntax) ** + ** [Name](#API_GetAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -60,35 +60,35 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_GetAlias_ResponseSyntax) ** + ** [AliasArn](#API_GetAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Description ](#API_GetAlias_ResponseSyntax) ** + ** [Description](#API_GetAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_GetAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_GetAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_GetAlias_ResponseSyntax) ** + ** [Name](#API_GetAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_GetAlias_ResponseSyntax) ** + ** [RevisionId](#API_GetAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_GetAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_GetAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -111,12 +111,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md old mode 100644 new mode 100755 index 7c2d839d..544fa093 --- a/doc_source/API_GetCodeSigningConfig.md +++ b/doc_source/API_GetCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_GetCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -50,9 +50,9 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_GetCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -71,12 +71,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md old mode 100644 new mode 100755 index cb995038..3a417bb2 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -1,6 +1,6 @@ # GetEventSourceMapping -Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ ListEventSourceMappings ](API_ListEventSourceMappings.md)\. +Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 The request uses the following URI parameters\. - ** [ UUID ](#API_GetEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -38,6 +38,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -74,113 +81,117 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_GetEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionResponseTypes ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_GetEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -205,12 +216,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md old mode 100644 new mode 100755 index 5e0c4c28..9c4083a3 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunction_RequestSyntax) ** + ** [FunctionName](#API_GetFunction_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetFunction_RequestSyntax) ** + ** [Qualifier](#API_GetFunction_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -133,19 +133,19 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Code ](#API_GetFunction_ResponseSyntax) ** + ** [Code](#API_GetFunction_ResponseSyntax) ** The deployment package of the function or version\. -Type: [ FunctionCodeLocation ](API_FunctionCodeLocation.md) object +Type: [FunctionCodeLocation](API_FunctionCodeLocation.md) object - ** [ Concurrency ](#API_GetFunction_ResponseSyntax) ** + ** [Concurrency](#API_GetFunction_ResponseSyntax) ** The function's [reserved concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. -Type: [ Concurrency ](API_Concurrency.md) object +Type: [Concurrency](API_Concurrency.md) object - ** [ Configuration ](#API_GetFunction_ResponseSyntax) ** + ** [Configuration](#API_GetFunction_ResponseSyntax) ** The configuration of the function or version\. -Type: [ FunctionConfiguration ](API_FunctionConfiguration.md) object +Type: [FunctionConfiguration](API_FunctionConfiguration.md) object - ** [ Tags ](#API_GetFunction_ResponseSyntax) ** + ** [Tags](#API_GetFunction_ResponseSyntax) ** The function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. Type: String to string map @@ -170,12 +170,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index ebfabc08..be6ec7ca --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ b/doc_source/API_GetFunctionCodeSigningConfig.md @@ -12,7 +12,7 @@ GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,13 +46,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigArn ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [ FunctionName ](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** + ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -85,12 +85,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md old mode 100644 new mode 100755 index 017f6474..c6757228 --- a/doc_source/API_GetFunctionConcurrency.md +++ b/doc_source/API_GetFunctionConcurrency.md @@ -1,6 +1,6 @@ # GetFunctionConcurrency -Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. +Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -45,7 +45,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ ReservedConcurrentExecutions ](#API_GetFunctionConcurrency_ResponseSyntax) ** + ** [ReservedConcurrentExecutions](#API_GetFunctionConcurrency_ResponseSyntax) ** The number of simultaneous executions that are reserved for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -71,12 +71,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md old mode 100644 new mode 100755 index e6d676ba..05ae9974 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -1,8 +1,8 @@ # GetFunctionConfiguration -Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. -To get all of a function's details, including function\-level settings, use [ GetFunction ](API_GetFunction.md)\. +To get all of a function's details, including function\-level settings, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1. The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetFunctionConfiguration_RequestSyntax) ** + ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** Specify a version or alias to get details about a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -121,157 +121,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Architectures](#API_GetFunctionConfiguration_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [CodeSha256](#API_GetFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [CodeSize](#API_GetFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [DeadLetterConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Description](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionName ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [FunctionName](#API_GetFunctionConfiguration_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Handler ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Handler](#API_GetFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastModified](#API_GetFunctionConfiguration_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ LastUpdateStatus ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatus](#API_GetFunctionConfiguration_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [ LastUpdateStatusReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [MasterArn](#API_GetFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ MemorySize ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Role](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [ StateReason ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [StateReason](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [ TracingConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [TracingConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [Version](#API_GetFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_GetFunctionConfiguration_ResponseSyntax) ** + ** [VpcConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -294,12 +294,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 4f593364..8c634b3e --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ b/doc_source/API_GetFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Retrieves the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier H The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -26,7 +26,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -63,7 +63,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -71,23 +71,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ LastModified ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -113,12 +113,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md old mode 100644 new mode 100755 index 16ddd063..072c87e2 --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -1,6 +1,6 @@ # GetLayerVersion -Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_GetLayerVersion_RequestSyntax) ** + ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_GetLayerVersion_RequestSyntax) ** + ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** The version number\. Required: Yes @@ -57,49 +57,49 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_GetLayerVersion_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_GetLayerVersion_ResponseSyntax) ** + ** [CreatedDate](#API_GetLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Description](#API_GetLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LayerArn](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [ LayerVersionArn ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LayerVersionArn](#API_GetLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [ LicenseInfo ](#API_GetLayerVersion_ResponseSyntax) ** + ** [LicenseInfo](#API_GetLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_GetLayerVersion_ResponseSyntax) ** + ** [Version](#API_GetLayerVersion_ResponseSyntax) ** The version number\. Type: Long @@ -124,12 +124,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md old mode 100644 new mode 100755 index 8bb8a9d9..459cc51f --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -1,6 +1,6 @@ # GetLayerVersionByArn -Returns information about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. +Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 The request uses the following URI parameters\. - ** [ Arn ](#API_GetLayerVersionByArn_RequestSyntax) ** + ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** The ARN of the layer version\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` @@ -53,49 +53,49 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_GetLayerVersionByArn_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [CreatedDate](#API_GetLayerVersionByArn_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Description](#API_GetLayerVersionByArn_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LayerArn](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [ LayerVersionArn ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LayerVersionArn](#API_GetLayerVersionByArn_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [ LicenseInfo ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [LicenseInfo](#API_GetLayerVersionByArn_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_GetLayerVersionByArn_ResponseSyntax) ** + ** [Version](#API_GetLayerVersionByArn_ResponseSyntax) ** The version number\. Type: Long @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md old mode 100644 new mode 100755 index 4fe6a68b..ad5f3319 --- a/doc_source/API_GetLayerVersionPolicy.md +++ b/doc_source/API_GetLayerVersionPolicy.md @@ -1,6 +1,6 @@ # GetLayerVersionPolicy -Returns the permission policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. +Returns the permission policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,13 +12,13 @@ GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 The request uses the following URI parameters\. - ** [ LayerName ](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ VersionNumber ](#API_GetLayerVersionPolicy_RequestSyntax) ** + ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** The version number\. Required: Yes @@ -44,11 +44,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Policy ](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** The policy document\. Type: String - ** [ RevisionId ](#API_GetLayerVersionPolicy_ResponseSyntax) ** + ** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String @@ -73,12 +73,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md old mode 100644 new mode 100755 index c8bac1f3..68add8e0 --- a/doc_source/API_GetPolicy.md +++ b/doc_source/API_GetPolicy.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetPolicy_RequestSyntax) ** + ** [FunctionName](#API_GetPolicy_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetPolicy_RequestSyntax) ** + ** [Qualifier](#API_GetPolicy_RequestSyntax) ** Specify a version or alias to get the policy for that resource\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,11 +51,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Policy ](#API_GetPolicy_ResponseSyntax) ** + ** [Policy](#API_GetPolicy_ResponseSyntax) ** The resource\-based policy\. Type: String - ** [ RevisionId ](#API_GetPolicy_ResponseSyntax) ** + ** [RevisionId](#API_GetPolicy_ResponseSyntax) ** A unique identifier for the current revision of the policy\. Type: String @@ -80,12 +80,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 16674dc4..b8da47c5 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifi The request uses the following URI parameters\. - ** [ FunctionName ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,7 +24,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -56,31 +56,31 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AllocatedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [ AvailableProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [ LastModified ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String - ** [ RequestedProvisionedConcurrentExecutions ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [ Status ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [ StatusReason ](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String @@ -109,12 +109,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md old mode 100644 new mode 100755 index 151d0ad7..a50ee895 --- a/doc_source/API_ImageConfig.md +++ b/doc_source/API_ImageConfig.md @@ -25,7 +25,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md old mode 100644 new mode 100755 index f64556b5..9a1372b5 --- a/doc_source/API_ImageConfigError.md +++ b/doc_source/API_ImageConfigError.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md old mode 100644 new mode 100755 index 3337f9ed..fdba6bfb --- a/doc_source/API_ImageConfigResponse.md +++ b/doc_source/API_ImageConfigResponse.md @@ -6,18 +6,18 @@ Response to GetFunctionConfiguration request\. ** Error ** Error response to GetFunctionConfiguration\. -Type: [ ImageConfigError ](API_ImageConfigError.md) object +Type: [ImageConfigError](API_ImageConfigError.md) object Required: No ** ImageConfig ** Configuration values that override the container image Dockerfile\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md old mode 100644 new mode 100755 index 36f2c5ec..fbbf3396 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -29,10 +29,10 @@ Payload The request uses the following URI parameters\. - ** [ ClientContext ](#API_Invoke_RequestSyntax) ** + ** [ClientContext](#API_Invoke_RequestSyntax) ** Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. - ** [ FunctionName ](#API_Invoke_RequestSyntax) ** + ** [FunctionName](#API_Invoke_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -44,18 +44,18 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ InvocationType ](#API_Invoke_RequestSyntax) ** + ** [InvocationType](#API_Invoke_RequestSyntax) ** Choose from the following options\. + `RequestResponse` \(default\) \- Invoke the function synchronously\. Keep the connection open until the function returns a response or times out\. The API response includes the function response and additional data\. + `Event` \- Invoke the function asynchronously\. Send events that fail multiple times to the function's dead\-letter queue \(if it's configured\)\. The API response only includes a status code\. + `DryRun` \- Validate parameter values and verify that the user or role has permission to invoke the function\. Valid Values:` Event | RequestResponse | DryRun` - ** [ LogType ](#API_Invoke_RequestSyntax) ** + ** [LogType](#API_Invoke_RequestSyntax) ** Set to `Tail` to include the execution log in the response\. Applies to synchronously invoked functions only\. Valid Values:` None | Tail` - ** [ Qualifier ](#API_Invoke_RequestSyntax) ** + ** [Qualifier](#API_Invoke_RequestSyntax) ** Specify a version or alias to invoke a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -64,7 +64,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following binary data\. - ** [ Payload ](#API_Invoke_RequestSyntax) ** + ** [Payload](#API_Invoke_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. You can enter the JSON directly\. For example, `--payload '{ "key": "value" }'`\. You can also specify a file path\. For example, `--payload file://payload.json`\. @@ -83,25 +83,25 @@ Payload If the action is successful, the service sends back the following HTTP response\. - ** [ StatusCode ](#API_Invoke_ResponseSyntax) ** + ** [StatusCode](#API_Invoke_ResponseSyntax) ** The HTTP status code is in the 200 range for a successful request\. For the `RequestResponse` invocation type, this status code is 200\. For the `Event` invocation type, this status code is 202\. For the `DryRun` invocation type, the status code is 204\. The response returns the following HTTP headers\. - ** [ ExecutedVersion ](#API_Invoke_ResponseSyntax) ** + ** [ExecutedVersion](#API_Invoke_ResponseSyntax) ** The version of the function that executed\. When you invoke a function with an alias, this indicates which version the alias resolved to\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ FunctionError ](#API_Invoke_ResponseSyntax) ** + ** [FunctionError](#API_Invoke_ResponseSyntax) ** If present, indicates that an error occurred during function execution\. Details about the error are included in the response payload\. - ** [ LogResult ](#API_Invoke_ResponseSyntax) ** + ** [LogResult](#API_Invoke_ResponseSyntax) ** The last 4 KB of the execution log, which is base64 encoded\. The response returns the following as the HTTP body\. - ** [ Payload ](#API_Invoke_ResponseSyntax) ** + ** [Payload](#API_Invoke_ResponseSyntax) ** The response from the function, or an error object\. ## Errors @@ -213,12 +213,12 @@ HTTP Status Code: 415 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md old mode 100644 new mode 100755 index 0ed67594..8a6281c5 --- a/doc_source/API_InvokeAsync.md +++ b/doc_source/API_InvokeAsync.md @@ -3,7 +3,7 @@ *This action has been deprecated\.* **Important** -For asynchronous function invocation, use [ Invoke ](API_Invoke.md)\. +For asynchronous function invocation, use [Invoke](API_Invoke.md)\. Invokes a function asynchronously\. @@ -19,7 +19,7 @@ InvokeArgs The request uses the following URI parameters\. - ** [ FunctionName ](#API_InvokeAsync_RequestSyntax) ** + ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -35,7 +35,7 @@ Required: Yes The request accepts the following binary data\. - ** [ InvokeArgs ](#API_InvokeAsync_RequestSyntax) ** + ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** The JSON that you want to provide to your Lambda function as input\. Required: Yes @@ -49,7 +49,7 @@ HTTP/1.1 Status If the action is successful, the service sends back the following HTTP response\. - ** [ Status ](#API_InvokeAsync_ResponseSyntax) ** + ** [Status](#API_InvokeAsync_ResponseSyntax) ** The status code\. ## Errors @@ -77,12 +77,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md old mode 100644 new mode 100755 index 8c2f129a..89f0c7a8 --- a/doc_source/API_Layer.md +++ b/doc_source/API_Layer.md @@ -1,6 +1,6 @@ # Layer -An [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +An [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -31,7 +31,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md old mode 100644 new mode 100755 index 461e603b..3a7d97d3 --- a/doc_source/API_LayerVersionContentInput.md +++ b/doc_source/API_LayerVersionContentInput.md @@ -1,6 +1,6 @@ # LayerVersionContentInput -A ZIP archive that contains the contents of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. +A ZIP archive that contains the contents of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. ## Contents @@ -31,7 +31,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md old mode 100644 new mode 100755 index a56a36b3..68c14788 --- a/doc_source/API_LayerVersionContentOutput.md +++ b/doc_source/API_LayerVersionContentOutput.md @@ -1,6 +1,6 @@ # LayerVersionContentOutput -Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -32,7 +32,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md old mode 100644 new mode 100755 index 06495845..a1128be9 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -1,6 +1,6 @@ # LayerVersionsListItem -Details about a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents @@ -50,7 +50,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md old mode 100644 new mode 100755 index 4064a303..76e34d54 --- a/doc_source/API_LayersListItem.md +++ b/doc_source/API_LayersListItem.md @@ -1,12 +1,12 @@ # LayersListItem -Details about an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. +Details about an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. ## Contents ** LatestMatchingVersion ** The newest version of the layer\. -Type: [ LayerVersionsListItem ](API_LayerVersionsListItem.md) object +Type: [LayerVersionsListItem](API_LayerVersionsListItem.md) object Required: No ** LayerArn ** @@ -26,7 +26,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md old mode 100644 new mode 100755 index 96a8f132..e785f1fb --- a/doc_source/API_ListAliases.md +++ b/doc_source/API_ListAliases.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&M The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListAliases_RequestSyntax) ** + ** [FunctionName](#API_ListAliases_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,15 +24,15 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ FunctionVersion ](#API_ListAliases_RequestSyntax) ** + ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** Specify a function version to only list aliases that invoke that version\. Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Marker ](#API_ListAliases_RequestSyntax) ** + ** [Marker](#API_ListAliases_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListAliases_RequestSyntax) ** + ** [MaxItems](#API_ListAliases_RequestSyntax) ** Limit the number of aliases returned\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -71,11 +71,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Aliases ](#API_ListAliases_ResponseSyntax) ** + ** [Aliases](#API_ListAliases_ResponseSyntax) ** A list of aliases\. -Type: Array of [ AliasConfiguration ](API_AliasConfiguration.md) objects +Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects - ** [ NextMarker ](#API_ListAliases_ResponseSyntax) ** + ** [NextMarker](#API_ListAliases_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -100,12 +100,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md old mode 100644 new mode 100755 index e5fcdff9..7e951ff5 --- a/doc_source/API_ListCodeSigningConfigs.md +++ b/doc_source/API_ListCodeSigningConfigs.md @@ -12,10 +12,10 @@ GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 The request uses the following URI parameters\. - ** [ Marker ](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListCodeSigningConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -54,11 +54,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigs ](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** The code signing configurations -Type: Array of [ CodeSigningConfig ](API_CodeSigningConfig.md) objects +Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects - ** [ NextMarker ](#API_ListCodeSigningConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -75,12 +75,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md old mode 100644 new mode 100755 index 05fffac7..4c9b3cc4 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -12,7 +12,7 @@ GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionNam The request uses the following URI parameters\. - ** [ EventSourceArn ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. @@ -20,7 +20,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionName ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -32,10 +32,10 @@ The length constraint applies only to the full ARN\. If you specify only the fun Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Marker ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [Marker](#API_ListEventSourceMappings_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListEventSourceMappings_RequestSyntax) ** + ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -63,6 +63,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -102,11 +109,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ EventSourceMappings ](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) ** A list of event source mappings\. -Type: Array of [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) objects +Type: Array of [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) objects - ** [ NextMarker ](#API_ListEventSourceMappings_ResponseSyntax) ** + ** [NextMarker](#API_ListEventSourceMappings_ResponseSyntax) ** A pagination token that's returned when the response doesn't contain all event source mappings\. Type: String @@ -131,12 +138,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md old mode 100644 new mode 100755 index 86f29bc5..56f281a8 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ b/doc_source/API_ListFunctionEventInvokeConfigs.md @@ -2,7 +2,7 @@ Retrieves a list of configurations for asynchronous invocation for a function\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -14,7 +14,7 @@ GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&Ma The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -26,10 +26,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Marker ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** The maximum number of configurations to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -70,11 +70,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ FunctionEventInvokeConfigs ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [FunctionEventInvokeConfigs](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** A list of configurations\. -Type: Array of [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) objects +Type: Array of [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) objects - ** [ NextMarker ](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -99,12 +99,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md old mode 100644 new mode 100755 index 06195eff..507ab5ef --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -5,7 +5,7 @@ Returns a list of Lambda functions, with the version\-specific configuration of Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. **Note** -The `ListFunctions` action returns a subset of the [ FunctionConfiguration ](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [ GetFunction ](API_GetFunction.md)\. +The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -17,18 +17,18 @@ GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterR The request uses the following URI parameters\. - ** [ FunctionVersion ](#API_ListFunctions_RequestSyntax) ** + ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** Set to `ALL` to include entries for all published versions of each function\. Valid Values:` ALL` - ** [ Marker ](#API_ListFunctions_RequestSyntax) ** + ** [Marker](#API_ListFunctions_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MasterRegion ](#API_ListFunctions_RequestSyntax) ** + ** [MasterRegion](#API_ListFunctions_RequestSyntax) ** For Lambda@Edge functions, the AWS Region of the master function\. For example, `us-east-1` filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East \(N\. Virginia\)\. If specified, you must set `FunctionVersion` to `ALL`\. Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` - ** [ MaxItems ](#API_ListFunctions_RequestSyntax) ** + ** [MaxItems](#API_ListFunctions_RequestSyntax) ** The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -127,11 +127,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Functions ](#API_ListFunctions_ResponseSyntax) ** + ** [Functions](#API_ListFunctions_ResponseSyntax) ** A list of Lambda functions\. -Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects +Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects - ** [ NextMarker ](#API_ListFunctions_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctions_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -152,12 +152,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md old mode 100644 new mode 100755 index 04be90ec..60377544 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ b/doc_source/API_ListFunctionsByCodeSigningConfig.md @@ -12,16 +12,16 @@ GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marke The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` Required: Yes - ** [ Marker ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** + ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** Maximum number of items to return\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -47,12 +47,12 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ FunctionArns ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The function ARNs\. Type: Array of strings Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ NextMarker ](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** + ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String @@ -73,12 +73,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md old mode 100644 new mode 100755 index 76259787..c5d0bf21 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -1,6 +1,6 @@ # ListLayerVersions -Lists the versions of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. +Lists the versions of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. ## Request Syntax @@ -12,24 +12,24 @@ GET /2018-10-31/layers/LayerName/versions?CompatibleArchitecture=CompatibleArchi The request uses the following URI parameters\. - ** [ CompatibleArchitecture ](#API_ListLayerVersions_RequestSyntax) ** + ** [CompatibleArchitecture](#API_ListLayerVersions_RequestSyntax) ** The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntime ](#API_ListLayerVersions_RequestSyntax) ** + ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ LayerName ](#API_ListLayerVersions_RequestSyntax) ** + ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ Marker ](#API_ListLayerVersions_RequestSyntax) ** + ** [Marker](#API_ListLayerVersions_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListLayerVersions_RequestSyntax) ** + ** [MaxItems](#API_ListLayerVersions_RequestSyntax) ** The maximum number of versions to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -65,11 +65,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ LayerVersions ](#API_ListLayerVersions_ResponseSyntax) ** + ** [LayerVersions](#API_ListLayerVersions_ResponseSyntax) ** A list of versions\. -Type: Array of [ LayerVersionsListItem ](API_LayerVersionsListItem.md) objects +Type: Array of [LayerVersionsListItem](API_LayerVersionsListItem.md) objects - ** [ NextMarker ](#API_ListLayerVersions_ResponseSyntax) ** + ** [NextMarker](#API_ListLayerVersions_ResponseSyntax) ** A pagination token returned when the response doesn't contain all versions\. Type: String @@ -94,12 +94,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md old mode 100644 new mode 100755 index a95db624..a8379dd6 --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -1,6 +1,6 @@ # ListLayers -Lists [ AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. +Lists [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. ## Request Syntax @@ -12,18 +12,18 @@ GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleR The request uses the following URI parameters\. - ** [ CompatibleArchitecture ](#API_ListLayers_RequestSyntax) ** + ** [CompatibleArchitecture](#API_ListLayers_RequestSyntax) ** The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntime ](#API_ListLayers_RequestSyntax) ** + ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Marker ](#API_ListLayers_RequestSyntax) ** + ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. - ** [ MaxItems ](#API_ListLayers_RequestSyntax) ** + ** [MaxItems](#API_ListLayers_RequestSyntax) ** The maximum number of layers to return\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,11 +63,11 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Layers ](#API_ListLayers_ResponseSyntax) ** + ** [Layers](#API_ListLayers_ResponseSyntax) ** A list of function layers\. -Type: Array of [ LayersListItem ](API_LayersListItem.md) objects +Type: Array of [LayersListItem](API_LayersListItem.md) objects - ** [ NextMarker ](#API_ListLayers_ResponseSyntax) ** + ** [NextMarker](#API_ListLayers_ResponseSyntax) ** A pagination token returned when the response doesn't contain all layers\. Type: String @@ -88,12 +88,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md old mode 100644 new mode 100755 index bd1e9916..e05f6c95 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ b/doc_source/API_ListProvisionedConcurrencyConfigs.md @@ -12,7 +12,7 @@ GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=M The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Marker ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** + ** [MaxItems](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** Specify a number to limit the number of configurations returned\. Valid Range: Minimum value of 1\. Maximum value of 50\. @@ -63,13 +63,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ NextMarker ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [NextMarker](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ ProvisionedConcurrencyConfigs ](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** + ** [ProvisionedConcurrencyConfigs](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** A list of provisioned concurrency configurations\. -Type: Array of [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) objects +Type: Array of [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) objects ## Errors @@ -92,12 +92,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md old mode 100644 new mode 100755 index 394361bc..bf96edde --- a/doc_source/API_ListTags.md +++ b/doc_source/API_ListTags.md @@ -1,6 +1,6 @@ # ListTags -Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [ GetFunction ](API_GetFunction.md)\. +Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [GetFunction](API_GetFunction.md)\. ## Request Syntax @@ -12,7 +12,7 @@ GET /2017-03-31/tags/ARN HTTP/1.1 The request uses the following URI parameters\. - ** [ ARN ](#API_ListTags_RequestSyntax) ** + ** [ARN](#API_ListTags_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Note: Lambda does not support adding tags to aliases or versions\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes @@ -40,7 +40,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Tags ](#API_ListTags_ResponseSyntax) ** + ** [Tags](#API_ListTags_ResponseSyntax) ** The function's tags\. Type: String to string map @@ -65,12 +65,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md old mode 100644 new mode 100755 index ad35ed08..fe5215a2 --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -12,7 +12,7 @@ GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems The request uses the following URI parameters\. - ** [ FunctionName ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -24,10 +24,10 @@ Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Marker ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - ** [ MaxItems ](#API_ListVersionsByFunction_RequestSyntax) ** + ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -126,13 +126,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ NextMarker ](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [NextMarker](#API_ListVersionsByFunction_ResponseSyntax) ** The pagination token that's included if more results are available\. Type: String - ** [ Versions ](#API_ListVersionsByFunction_ResponseSyntax) ** + ** [Versions](#API_ListVersionsByFunction_ResponseSyntax) ** A list of Lambda function versions\. -Type: Array of [ FunctionConfiguration ](API_FunctionConfiguration.md) objects +Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects ## Errors @@ -155,12 +155,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md old mode 100644 new mode 100755 index e85b7838..6bb084a9 --- a/doc_source/API_OnFailure.md +++ b/doc_source/API_OnFailure.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md old mode 100644 new mode 100755 index 5447b3fa..7dd22ba6 --- a/doc_source/API_OnSuccess.md +++ b/doc_source/API_OnSuccess.md @@ -14,7 +14,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md old mode 100644 new mode 100755 index 8c67257d..70a90b0c --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -1,61 +1,61 @@ # Actions The following actions are supported: -+ [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md) -+ [ AddPermission ](API_AddPermission.md) -+ [ CreateAlias ](API_CreateAlias.md) -+ [ CreateCodeSigningConfig ](API_CreateCodeSigningConfig.md) -+ [ CreateEventSourceMapping ](API_CreateEventSourceMapping.md) -+ [ CreateFunction ](API_CreateFunction.md) -+ [ DeleteAlias ](API_DeleteAlias.md) -+ [ DeleteCodeSigningConfig ](API_DeleteCodeSigningConfig.md) -+ [ DeleteEventSourceMapping ](API_DeleteEventSourceMapping.md) -+ [ DeleteFunction ](API_DeleteFunction.md) -+ [ DeleteFunctionCodeSigningConfig ](API_DeleteFunctionCodeSigningConfig.md) -+ [ DeleteFunctionConcurrency ](API_DeleteFunctionConcurrency.md) -+ [ DeleteFunctionEventInvokeConfig ](API_DeleteFunctionEventInvokeConfig.md) -+ [ DeleteLayerVersion ](API_DeleteLayerVersion.md) -+ [ DeleteProvisionedConcurrencyConfig ](API_DeleteProvisionedConcurrencyConfig.md) -+ [ GetAccountSettings ](API_GetAccountSettings.md) -+ [ GetAlias ](API_GetAlias.md) -+ [ GetCodeSigningConfig ](API_GetCodeSigningConfig.md) -+ [ GetEventSourceMapping ](API_GetEventSourceMapping.md) -+ [ GetFunction ](API_GetFunction.md) -+ [ GetFunctionCodeSigningConfig ](API_GetFunctionCodeSigningConfig.md) -+ [ GetFunctionConcurrency ](API_GetFunctionConcurrency.md) -+ [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) -+ [ GetFunctionEventInvokeConfig ](API_GetFunctionEventInvokeConfig.md) -+ [ GetLayerVersion ](API_GetLayerVersion.md) -+ [ GetLayerVersionByArn ](API_GetLayerVersionByArn.md) -+ [ GetLayerVersionPolicy ](API_GetLayerVersionPolicy.md) -+ [ GetPolicy ](API_GetPolicy.md) -+ [ GetProvisionedConcurrencyConfig ](API_GetProvisionedConcurrencyConfig.md) -+ [ Invoke ](API_Invoke.md) -+ [ InvokeAsync ](API_InvokeAsync.md) -+ [ ListAliases ](API_ListAliases.md) -+ [ ListCodeSigningConfigs ](API_ListCodeSigningConfigs.md) -+ [ ListEventSourceMappings ](API_ListEventSourceMappings.md) -+ [ ListFunctionEventInvokeConfigs ](API_ListFunctionEventInvokeConfigs.md) -+ [ ListFunctions ](API_ListFunctions.md) -+ [ ListFunctionsByCodeSigningConfig ](API_ListFunctionsByCodeSigningConfig.md) -+ [ ListLayers ](API_ListLayers.md) -+ [ ListLayerVersions ](API_ListLayerVersions.md) -+ [ ListProvisionedConcurrencyConfigs ](API_ListProvisionedConcurrencyConfigs.md) -+ [ ListTags ](API_ListTags.md) -+ [ ListVersionsByFunction ](API_ListVersionsByFunction.md) -+ [ PublishLayerVersion ](API_PublishLayerVersion.md) -+ [ PublishVersion ](API_PublishVersion.md) -+ [ PutFunctionCodeSigningConfig ](API_PutFunctionCodeSigningConfig.md) -+ [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md) -+ [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md) -+ [ PutProvisionedConcurrencyConfig ](API_PutProvisionedConcurrencyConfig.md) -+ [ RemoveLayerVersionPermission ](API_RemoveLayerVersionPermission.md) -+ [ RemovePermission ](API_RemovePermission.md) -+ [ TagResource ](API_TagResource.md) -+ [ UntagResource ](API_UntagResource.md) -+ [ UpdateAlias ](API_UpdateAlias.md) -+ [ UpdateCodeSigningConfig ](API_UpdateCodeSigningConfig.md) -+ [ UpdateEventSourceMapping ](API_UpdateEventSourceMapping.md) -+ [ UpdateFunctionCode ](API_UpdateFunctionCode.md) -+ [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) -+ [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file ++ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) ++ [AddPermission](API_AddPermission.md) ++ [CreateAlias](API_CreateAlias.md) ++ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) ++ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) ++ [CreateFunction](API_CreateFunction.md) ++ [DeleteAlias](API_DeleteAlias.md) ++ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) ++ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) ++ [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) ++ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) ++ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) ++ [DeleteLayerVersion](API_DeleteLayerVersion.md) ++ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) ++ [GetAccountSettings](API_GetAccountSettings.md) ++ [GetAlias](API_GetAlias.md) ++ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) ++ [GetEventSourceMapping](API_GetEventSourceMapping.md) ++ [GetFunction](API_GetFunction.md) ++ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) ++ [GetFunctionConcurrency](API_GetFunctionConcurrency.md) ++ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) ++ [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) ++ [GetLayerVersion](API_GetLayerVersion.md) ++ [GetLayerVersionByArn](API_GetLayerVersionByArn.md) ++ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) ++ [GetPolicy](API_GetPolicy.md) ++ [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) ++ [Invoke](API_Invoke.md) ++ [InvokeAsync](API_InvokeAsync.md) ++ [ListAliases](API_ListAliases.md) ++ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) ++ [ListEventSourceMappings](API_ListEventSourceMappings.md) ++ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) ++ [ListFunctions](API_ListFunctions.md) ++ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) ++ [ListLayers](API_ListLayers.md) ++ [ListLayerVersions](API_ListLayerVersions.md) ++ [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) ++ [ListTags](API_ListTags.md) ++ [ListVersionsByFunction](API_ListVersionsByFunction.md) ++ [PublishLayerVersion](API_PublishLayerVersion.md) ++ [PublishVersion](API_PublishVersion.md) ++ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) ++ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) ++ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) ++ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) ++ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) ++ [RemovePermission](API_RemovePermission.md) ++ [TagResource](API_TagResource.md) ++ [UntagResource](API_UntagResource.md) ++ [UpdateAlias](API_UpdateAlias.md) ++ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) ++ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md old mode 100644 new mode 100755 index 4f1830eb..71a88d0f --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -47,7 +47,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md old mode 100644 new mode 100755 index 2c9adb46..90016955 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -1,8 +1,8 @@ # PublishLayerVersion -Creates an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. +Creates an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. -Add layers to your function with [ CreateFunction ](API_CreateFunction.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ LayerName ](#API_PublishLayerVersion_RequestSyntax) ** + ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` @@ -38,32 +38,32 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CompatibleArchitectures ](#API_PublishLayerVersion_RequestSyntax) ** + ** [CompatibleArchitectures](#API_PublishLayerVersion_RequestSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` Required: No - ** [ CompatibleRuntimes ](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ ListLayers ](API_ListLayers.md) and [ ListLayerVersions ](API_ListLayerVersions.md)\. + ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** +A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Content ](#API_PublishLayerVersion_RequestSyntax) ** + ** [Content](#API_PublishLayerVersion_RequestSyntax) ** The function layer archive\. -Type: [ LayerVersionContentInput ](API_LayerVersionContentInput.md) object +Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object Required: Yes - ** [ Description ](#API_PublishLayerVersion_RequestSyntax) ** + ** [Description](#API_PublishLayerVersion_RequestSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ LicenseInfo ](#API_PublishLayerVersion_RequestSyntax) ** + ** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** The layer's software license\. It can be any of the following: + An [SPDX license identifier](https://spdx.org/licenses/)\. For example, `MIT`\. + The URL of a license hosted on the internet\. For example, `https://opensource.org/licenses/MIT`\. @@ -103,49 +103,49 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ CompatibleArchitectures ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CompatibleArchitectures](#API_PublishLayerVersion_ResponseSyntax) ** A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. Type: Array of strings Array Members: Maximum number of 2 items\. Valid Values:` x86_64 | arm64` - ** [ CompatibleRuntimes ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ Content ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. -Type: [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) object +Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - ** [ CreatedDate ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ Description ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Description](#API_PublishLayerVersion_ResponseSyntax) ** The description of the version\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ LayerArn ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - ** [ LayerVersionArn ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LayerVersionArn](#API_PublishLayerVersion_ResponseSyntax) ** The ARN of the layer version\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - ** [ LicenseInfo ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [LicenseInfo](#API_PublishLayerVersion_ResponseSyntax) ** The layer's software license\. Type: String Length Constraints: Maximum length of 512\. - ** [ Version ](#API_PublishLayerVersion_ResponseSyntax) ** + ** [Version](#API_PublishLayerVersion_ResponseSyntax) ** The version number\. Type: Long @@ -174,12 +174,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md old mode 100644 new mode 100755 index 12c42030..b7ef43ae --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -2,9 +2,9 @@ Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. - AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [ UpdateFunctionCode ](API_UpdateFunctionCode.md) or [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. + AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. -Clients can invoke versions directly or with an alias\. To create an alias, use [ CreateAlias ](API_CreateAlias.md)\. +Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. ## Request Syntax @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PublishVersion_RequestSyntax) ** + ** [FunctionName](#API_PublishVersion_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -39,18 +39,18 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CodeSha256 ](#API_PublishVersion_RequestSyntax) ** -Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [ UpdateFunctionCode ](API_UpdateFunctionCode.md)\. + ** [CodeSha256](#API_PublishVersion_RequestSyntax) ** +Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [UpdateFunctionCode](API_UpdateFunctionCode.md)\. Type: String Required: No - ** [ Description ](#API_PublishVersion_RequestSyntax) ** + ** [Description](#API_PublishVersion_RequestSyntax) ** A description for the version to override the description in the function configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ RevisionId ](#API_PublishVersion_RequestSyntax) ** + ** [RevisionId](#API_PublishVersion_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid publishing a version if the function configuration has changed since you last updated it\. Type: String Required: No @@ -141,157 +141,157 @@ If the action is successful, the service sends back an HTTP 201 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_PublishVersion_ResponseSyntax) ** + ** [Architectures](#API_PublishVersion_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_PublishVersion_ResponseSyntax) ** + ** [CodeSha256](#API_PublishVersion_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_PublishVersion_ResponseSyntax) ** + ** [CodeSize](#API_PublishVersion_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_PublishVersion_ResponseSyntax) ** + ** [DeadLetterConfig](#API_PublishVersion_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_PublishVersion_ResponseSyntax) ** + ** [Description](#API_PublishVersion_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_PublishVersion_ResponseSyntax) ** + ** [Environment](#API_PublishVersion_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_PublishVersion_ResponseSyntax) ** + ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_PublishVersion_ResponseSyntax) ** + ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionName ](#API_PublishVersion_ResponseSyntax) ** + ** [FunctionName](#API_PublishVersion_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Handler ](#API_PublishVersion_ResponseSyntax) ** + ** [Handler](#API_PublishVersion_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_PublishVersion_ResponseSyntax) ** + ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_PublishVersion_ResponseSyntax) ** + ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_PublishVersion_ResponseSyntax) ** + ** [LastModified](#API_PublishVersion_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ LastUpdateStatus ](#API_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatus](#API_PublishVersion_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [ LastUpdateStatusReason ](#API_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_PublishVersion_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_PublishVersion_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_PublishVersion_ResponseSyntax) ** + ** [Layers](#API_PublishVersion_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_PublishVersion_ResponseSyntax) ** + ** [MasterArn](#API_PublishVersion_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ MemorySize ](#API_PublishVersion_ResponseSyntax) ** + ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_PublishVersion_ResponseSyntax) ** + ** [PackageType](#API_PublishVersion_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_PublishVersion_ResponseSyntax) ** + ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_PublishVersion_ResponseSyntax) ** + ** [Role](#API_PublishVersion_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_PublishVersion_ResponseSyntax) ** + ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_PublishVersion_ResponseSyntax) ** + ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_PublishVersion_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_PublishVersion_ResponseSyntax) ** + ** [State](#API_PublishVersion_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [ StateReason ](#API_PublishVersion_ResponseSyntax) ** + ** [StateReason](#API_PublishVersion_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_PublishVersion_ResponseSyntax) ** + ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_PublishVersion_ResponseSyntax) ** + ** [Timeout](#API_PublishVersion_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [ TracingConfig ](#API_PublishVersion_ResponseSyntax) ** + ** [TracingConfig](#API_PublishVersion_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_PublishVersion_ResponseSyntax) ** + ** [Version](#API_PublishVersion_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_PublishVersion_ResponseSyntax) ** + ** [VpcConfig](#API_PublishVersion_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -326,12 +326,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md old mode 100644 new mode 100755 index f8d5b31e..c2cf8b73 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ b/doc_source/API_PutFunctionCodeSigningConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -33,7 +33,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. @@ -58,13 +58,13 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfigArn ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Type: String Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - ** [ FunctionName ](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** + ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** The name of the Lambda function\. **Name formats** @@ -105,12 +105,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md old mode 100644 new mode 100755 index 20dac787..22521e8a --- a/doc_source/API_PutFunctionConcurrency.md +++ b/doc_source/API_PutFunctionConcurrency.md @@ -2,9 +2,9 @@ Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level\. -Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [ GetFunction ](API_GetFunction.md) to see the current setting for a function\. +Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [GetFunction](API_GetFunction.md) to see the current setting for a function\. -Use [ GetAccountSettings ](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. +Use [GetAccountSettings](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. ## Request Syntax @@ -21,7 +21,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -37,7 +37,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_RequestSyntax) ** + ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_RequestSyntax) ** The number of simultaneous executions to reserve for the function\. Type: Integer Valid Range: Minimum value of 0\. @@ -60,7 +60,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ ReservedConcurrentExecutions ](#API_PutFunctionConcurrency_ResponseSyntax) ** + ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_ResponseSyntax) ** The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. Type: Integer Valid Range: Minimum value of 0\. @@ -90,12 +90,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 306e9aaf..48345d0c --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ b/doc_source/API_PutFunctionEventInvokeConfig.md @@ -1,8 +1,8 @@ # PutFunctionEventInvokeConfig -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [ UpdateFunctionEventInvokeConfig ](API_UpdateFunctionEventInvokeConfig.md)\. +Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. -By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [ UpdateFunctionConfiguration ](API_UpdateFunctionConfiguration.md)\. +By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. To send an invocation record to a queue, topic, function, or event bus, specify a [destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)\. You can configure separate destinations for successful invocations \(on\-success\) and events that fail all processing attempts \(on\-failure\)\. You can configure destinations in addition to or instead of a dead\-letter queue\. @@ -30,7 +30,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -42,7 +42,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -51,7 +51,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -59,16 +59,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -102,7 +102,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -110,23 +110,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ LastModified ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -156,12 +156,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md old mode 100644 new mode 100755 index 7dca3a23..bcea56b2 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -17,7 +17,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -29,7 +29,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -39,7 +39,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ ProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** + ** [ProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** The amount of provisioned concurrency to allocate for the version or alias\. Type: Integer Valid Range: Minimum value of 1\. @@ -67,31 +67,31 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ AllocatedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency allocated\. Type: Integer Valid Range: Minimum value of 0\. - ** [ AvailableProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [AvailableProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency available\. Type: Integer Valid Range: Minimum value of 0\. - ** [ LastModified ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [LastModified](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. Type: String - ** [ RequestedProvisionedConcurrentExecutions ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [RequestedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The amount of provisioned concurrency requested\. Type: Integer Valid Range: Minimum value of 1\. - ** [ Status ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [Status](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** The status of the allocation process\. Type: String Valid Values:` IN_PROGRESS | READY | FAILED` - ** [ StatusReason ](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** + ** [StatusReason](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** For failed allocations, the reason that provisioned concurrency could not be allocated\. Type: String @@ -120,12 +120,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_Reference.md b/doc_source/API_Reference.md old mode 100644 new mode 100755 diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md old mode 100644 new mode 100755 index c9d5478d..8c1673de --- a/doc_source/API_RemoveLayerVersionPermission.md +++ b/doc_source/API_RemoveLayerVersionPermission.md @@ -1,6 +1,6 @@ # RemoveLayerVersionPermission -Removes a statement from the permissions policy for a version of an [ AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [ AddLayerVersionPermission ](API_AddLayerVersionPermission.md)\. +Removes a statement from the permissions policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. ## Request Syntax @@ -12,22 +12,22 @@ DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?Re The request uses the following URI parameters\. - ** [ LayerName ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` Required: Yes - ** [ RevisionId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ StatementId ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** The identifier that was specified when the statement was added\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_]+)` Required: Yes - ** [ VersionNumber ](#API_RemoveLayerVersionPermission_RequestSyntax) ** + ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** The version number\. Required: Yes @@ -70,12 +70,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md old mode 100644 new mode 100755 index bc601ef3..58c33758 --- a/doc_source/API_RemovePermission.md +++ b/doc_source/API_RemovePermission.md @@ -1,6 +1,6 @@ # RemovePermission -Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [ GetPolicy ](API_GetPolicy.md)\. +Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [GetPolicy](API_GetPolicy.md)\. ## Request Syntax @@ -12,7 +12,7 @@ DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier The request uses the following URI parameters\. - ** [ FunctionName ](#API_RemovePermission_RequestSyntax) ** + ** [FunctionName](#API_RemovePermission_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -24,15 +24,15 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_RemovePermission_RequestSyntax) ** + ** [Qualifier](#API_RemovePermission_RequestSyntax) ** Specify a version or alias to remove permissions from a published version of the function\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` - ** [ RevisionId ](#API_RemovePermission_RequestSyntax) ** + ** [RevisionId](#API_RemovePermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - ** [ StatementId ](#API_RemovePermission_RequestSyntax) ** + ** [StatementId](#API_RemovePermission_RequestSyntax) ** Statement ID of the permission to remove\. Length Constraints: Minimum length of 1\. Maximum length of 100\. Pattern: `([a-zA-Z0-9-_.]+)` @@ -77,12 +77,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md old mode 100644 new mode 100755 index 26ec3da5..04777747 --- a/doc_source/API_SelfManagedEventSource.md +++ b/doc_source/API_SelfManagedEventSource.md @@ -17,7 +17,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md old mode 100644 new mode 100755 index 88c9fcdb..12faeaad --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -13,8 +13,10 @@ The type of authentication protocol, VPC components, or virtual host for your ev + `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. + `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. + `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. ++ `CLIENT_CERTIFICATE_TLS_AUTH` \- \(Amazon MSK, Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the certificate chain \(X\.509 PEM\), private key \(PKCS\#8 PEM\), and private key password \(optional\) used for mutual TLS authentication of your MSK/Apache Kafka brokers\. ++ `SERVER_ROOT_CA_CERTIFICATE` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the root CA certificate \(X\.509 PEM\) used for TLS encryption of your Apache Kafka brokers\. Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST` +Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE` Required: No ** URI ** @@ -27,7 +29,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md old mode 100644 new mode 100755 index 45444747..0104ba08 --- a/doc_source/API_TagResource.md +++ b/doc_source/API_TagResource.md @@ -19,7 +19,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ ARN ](#API_TagResource_RequestSyntax) ** + ** [ARN](#API_TagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes @@ -28,7 +28,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Tags ](#API_TagResource_RequestSyntax) ** + ** [Tags](#API_TagResource_RequestSyntax) ** A list of tags to apply to the function\. Type: String to string map Required: Yes @@ -68,12 +68,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md old mode 100644 new mode 100755 index a4348db1..4833a916 --- a/doc_source/API_TracingConfig.md +++ b/doc_source/API_TracingConfig.md @@ -1,6 +1,6 @@ # TracingConfig -The function's [ AWS X\-Ray ](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. +The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. ## Contents @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md old mode 100644 new mode 100755 index 9d666f16..d5bf88f8 --- a/doc_source/API_TracingConfigResponse.md +++ b/doc_source/API_TracingConfigResponse.md @@ -13,7 +13,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md old mode 100644 new mode 100755 index f6188166..9d81625a --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -1,39 +1,41 @@ # Data Types The following data types are supported: -+ [ AccountLimit ](API_AccountLimit.md) -+ [ AccountUsage ](API_AccountUsage.md) -+ [ AliasConfiguration ](API_AliasConfiguration.md) -+ [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) -+ [ AllowedPublishers ](API_AllowedPublishers.md) -+ [ CodeSigningConfig ](API_CodeSigningConfig.md) -+ [ CodeSigningPolicies ](API_CodeSigningPolicies.md) -+ [ Concurrency ](API_Concurrency.md) -+ [ DeadLetterConfig ](API_DeadLetterConfig.md) -+ [ DestinationConfig ](API_DestinationConfig.md) -+ [ Environment ](API_Environment.md) -+ [ EnvironmentError ](API_EnvironmentError.md) -+ [ EnvironmentResponse ](API_EnvironmentResponse.md) -+ [ EventSourceMappingConfiguration ](API_EventSourceMappingConfiguration.md) -+ [ FileSystemConfig ](API_FileSystemConfig.md) -+ [ FunctionCode ](API_FunctionCode.md) -+ [ FunctionCodeLocation ](API_FunctionCodeLocation.md) -+ [ FunctionConfiguration ](API_FunctionConfiguration.md) -+ [ FunctionEventInvokeConfig ](API_FunctionEventInvokeConfig.md) -+ [ ImageConfig ](API_ImageConfig.md) -+ [ ImageConfigError ](API_ImageConfigError.md) -+ [ ImageConfigResponse ](API_ImageConfigResponse.md) -+ [ Layer ](API_Layer.md) -+ [ LayersListItem ](API_LayersListItem.md) -+ [ LayerVersionContentInput ](API_LayerVersionContentInput.md) -+ [ LayerVersionContentOutput ](API_LayerVersionContentOutput.md) -+ [ LayerVersionsListItem ](API_LayerVersionsListItem.md) -+ [ OnFailure ](API_OnFailure.md) -+ [ OnSuccess ](API_OnSuccess.md) -+ [ ProvisionedConcurrencyConfigListItem ](API_ProvisionedConcurrencyConfigListItem.md) -+ [ SelfManagedEventSource ](API_SelfManagedEventSource.md) -+ [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) -+ [ TracingConfig ](API_TracingConfig.md) -+ [ TracingConfigResponse ](API_TracingConfigResponse.md) -+ [ VpcConfig ](API_VpcConfig.md) -+ [ VpcConfigResponse ](API_VpcConfigResponse.md) \ No newline at end of file ++ [AccountLimit](API_AccountLimit.md) ++ [AccountUsage](API_AccountUsage.md) ++ [AliasConfiguration](API_AliasConfiguration.md) ++ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) ++ [AllowedPublishers](API_AllowedPublishers.md) ++ [CodeSigningConfig](API_CodeSigningConfig.md) ++ [CodeSigningPolicies](API_CodeSigningPolicies.md) ++ [Concurrency](API_Concurrency.md) ++ [DeadLetterConfig](API_DeadLetterConfig.md) ++ [DestinationConfig](API_DestinationConfig.md) ++ [Environment](API_Environment.md) ++ [EnvironmentError](API_EnvironmentError.md) ++ [EnvironmentResponse](API_EnvironmentResponse.md) ++ [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) ++ [FileSystemConfig](API_FileSystemConfig.md) ++ [Filter](API_Filter.md) ++ [FilterCriteria](API_FilterCriteria.md) ++ [FunctionCode](API_FunctionCode.md) ++ [FunctionCodeLocation](API_FunctionCodeLocation.md) ++ [FunctionConfiguration](API_FunctionConfiguration.md) ++ [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [ImageConfig](API_ImageConfig.md) ++ [ImageConfigError](API_ImageConfigError.md) ++ [ImageConfigResponse](API_ImageConfigResponse.md) ++ [Layer](API_Layer.md) ++ [LayersListItem](API_LayersListItem.md) ++ [LayerVersionContentInput](API_LayerVersionContentInput.md) ++ [LayerVersionContentOutput](API_LayerVersionContentOutput.md) ++ [LayerVersionsListItem](API_LayerVersionsListItem.md) ++ [OnFailure](API_OnFailure.md) ++ [OnSuccess](API_OnSuccess.md) ++ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) ++ [SelfManagedEventSource](API_SelfManagedEventSource.md) ++ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) ++ [TracingConfig](API_TracingConfig.md) ++ [TracingConfigResponse](API_TracingConfigResponse.md) ++ [VpcConfig](API_VpcConfig.md) ++ [VpcConfigResponse](API_VpcConfigResponse.md) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md old mode 100644 new mode 100755 index 88cfb1be..8abf4139 --- a/doc_source/API_UntagResource.md +++ b/doc_source/API_UntagResource.md @@ -12,12 +12,12 @@ DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 The request uses the following URI parameters\. - ** [ ARN ](#API_UntagResource_RequestSyntax) ** + ** [ARN](#API_UntagResource_RequestSyntax) ** The function's Amazon Resource Name \(ARN\)\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ TagKeys ](#API_UntagResource_RequestSyntax) ** + ** [TagKeys](#API_UntagResource_RequestSyntax) ** A list of tag keys to remove from the function\. Required: Yes @@ -60,12 +60,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md old mode 100644 new mode 100755 index 98f85781..c1ffe2e9 --- a/doc_source/API_UpdateAlias.md +++ b/doc_source/API_UpdateAlias.md @@ -24,7 +24,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateAlias_RequestSyntax) ** + ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -36,7 +36,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Name ](#API_UpdateAlias_RequestSyntax) ** + ** [Name](#API_UpdateAlias_RequestSyntax) ** The name of the alias\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` @@ -46,27 +46,27 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Description ](#API_UpdateAlias_RequestSyntax) ** + ** [Description](#API_UpdateAlias_RequestSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ FunctionVersion ](#API_UpdateAlias_RequestSyntax) ** + ** [FunctionVersion](#API_UpdateAlias_RequestSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` Required: No - ** [ RevisionId ](#API_UpdateAlias_RequestSyntax) ** + ** [RevisionId](#API_UpdateAlias_RequestSyntax) ** Only update the alias if the revision ID matches the ID that's specified\. Use this option to avoid modifying an alias that has changed since you last read it\. Type: String Required: No - ** [ RoutingConfig ](#API_UpdateAlias_RequestSyntax) ** + ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object Required: No ## Response Syntax @@ -95,35 +95,35 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ AliasArn ](#API_UpdateAlias_ResponseSyntax) ** + ** [AliasArn](#API_UpdateAlias_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the alias\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Description ](#API_UpdateAlias_ResponseSyntax) ** + ** [Description](#API_UpdateAlias_ResponseSyntax) ** A description of the alias\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ FunctionVersion ](#API_UpdateAlias_ResponseSyntax) ** + ** [FunctionVersion](#API_UpdateAlias_ResponseSyntax) ** The function version that the alias invokes\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ Name ](#API_UpdateAlias_ResponseSyntax) ** + ** [Name](#API_UpdateAlias_ResponseSyntax) ** The name of the alias\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - ** [ RevisionId ](#API_UpdateAlias_ResponseSyntax) ** + ** [RevisionId](#API_UpdateAlias_ResponseSyntax) ** A unique identifier that changes when you update the alias\. Type: String - ** [ RoutingConfig ](#API_UpdateAlias_ResponseSyntax) ** + ** [RoutingConfig](#API_UpdateAlias_ResponseSyntax) ** The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [ AliasRoutingConfiguration ](API_AliasRoutingConfiguration.md) object +Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object ## Errors @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md old mode 100644 new mode 100755 index 181a153a..5ea4611b --- a/doc_source/API_UpdateCodeSigningConfig.md +++ b/doc_source/API_UpdateCodeSigningConfig.md @@ -23,7 +23,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ CodeSigningConfigArn ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** The The Amazon Resource Name \(ARN\) of the code signing configuration\. Length Constraints: Maximum length of 200\. Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` @@ -33,17 +33,17 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ AllowedPublishers ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** Signing profiles for this code signing configuration\. -Type: [ AllowedPublishers ](API_AllowedPublishers.md) object +Type: [AllowedPublishers](API_AllowedPublishers.md) object Required: No - ** [ CodeSigningPolicies ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** The code signing policy\. -Type: [ CodeSigningPolicies ](API_CodeSigningPolicies.md) object +Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object Required: No - ** [ Description ](#API_UpdateCodeSigningConfig_RequestSyntax) ** + ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** Descriptive name for this code signing configuration\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. @@ -77,9 +77,9 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ CodeSigningConfig ](#API_UpdateCodeSigningConfig_ResponseSyntax) ** + ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** The code signing configuration -Type: [ CodeSigningConfig ](API_CodeSigningConfig.md) object +Type: [CodeSigningConfig](API_CodeSigningConfig.md) object ## Errors @@ -98,12 +98,12 @@ HTTP Status Code: 500 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md old mode 100644 new mode 100755 index 260e96cd..eb06196f --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -43,6 +43,13 @@ Content-type: application/json } }, "Enabled": boolean, + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionName": "string", "FunctionResponseTypes": [ "string" ], "MaximumBatchingWindowInSeconds": number, @@ -63,7 +70,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ UUID ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** The identifier of the event source mapping\. Required: Yes @@ -71,7 +78,7 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ BatchSize ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. @@ -83,23 +90,28 @@ Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. Required: No - ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. Type: Boolean Required: No - ** [ DestinationConfig ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ Enabled ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. Default: True Type: Boolean Required: No - ** [ FunctionName ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [FilterCriteria](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object +Required: No + + ** [FunctionName](#API_UpdateEventSourceMapping_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -113,14 +125,14 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: No - ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` Required: No - ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. @@ -128,31 +140,31 @@ Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No - ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No - ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No - ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The number of batches to process from each shard concurrently\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. Required: No - ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No - ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_RequestSyntax) ** + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. @@ -176,6 +188,13 @@ Content-type: application/json } }, "EventSourceArn": "string", + "FilterCriteria": { + "Filters": [ + { + "Pattern": "string" + } + ] + }, "FunctionArn": "string", "FunctionResponseTypes": [ "string" ], "LastModified": number, @@ -212,113 +231,117 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. - ** [ BatchSize ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. - ** [ BisectBatchOnFunctionError ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. Type: Boolean - ** [ DestinationConfig ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ EventSourceArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the event source\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ FunctionArn ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [FilterCriteria](#API_UpdateEventSourceMapping_ResponseSyntax) ** +\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +Type: [FilterCriteria](API_FilterCriteria.md) object + + ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** The ARN of the Lambda function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionResponseTypes ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` - ** [ LastModified ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. Type: Timestamp - ** [ LastProcessingResult ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** The result of the last Lambda invocation of your function\. Type: String - ** [ MaximumBatchingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. Default: 0 Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. - ** [ MaximumRecordAgeInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 604800\. - ** [ MaximumRetryAttempts ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. - ** [ ParallelizationFactor ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10\. - ** [ Queues ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 1000\. Pattern: `[\s\S]*` - ** [ SelfManagedEventSource ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** The self\-managed Apache Kafka cluster for your event source\. -Type: [ SelfManagedEventSource ](API_SelfManagedEventSource.md) object +Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - ** [ SourceAccessConfigurations ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [ SourceAccessConfiguration ](API_SourceAccessConfiguration.md) objects +Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - ** [ StartingPosition ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - ** [ StartingPositionTimestamp ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. Type: Timestamp - ** [ State ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. Type: String - ** [ StateTransitionReason ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** Indicates whether a user or Lambda made the last change to the event source mapping\. Type: String - ** [ Topics ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** The name of the Kafka topic\. Type: Array of strings Array Members: Fixed number of 1 item\. Length Constraints: Minimum length of 1\. Maximum length of 249\. Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - ** [ TumblingWindowInSeconds ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** \(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. - ** [ UUID ](#API_UpdateEventSourceMapping_ResponseSyntax) ** + ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** The identifier of the event source mapping\. Type: String @@ -351,12 +374,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md old mode 100644 new mode 100755 index 4d310a1b..1af1d49a --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -2,6 +2,12 @@ Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. +If the function's package type is `Image`, you must specify the code package in `ImageUri` as the URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. + +If the function's package type is `Zip`, you must specify the deployment package as a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. Enter the Amazon S3 bucket and key of the code \.zip file location\. You can also provide the function code inline using the `ZipFile` field\. + +The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. + The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\. **Note** @@ -30,7 +36,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -46,54 +52,54 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ Architectures ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [Architectures](#API_UpdateFunctionCode_RequestSyntax) ** The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` Required: No - ** [ DryRun ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** Set to true to validate the request parameters and access permissions without modifying the function code\. Type: Boolean Required: No - ** [ ImageUri ](#API_UpdateFunctionCode_RequestSyntax) ** -URI of a container image in the Amazon ECR registry\. + ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** +URI of a container image in the Amazon ECR registry\. Do not use for a function defined with a \.zip file archive\. Type: String Required: No - ** [ Publish ](#API_UpdateFunctionCode_RequestSyntax) ** -Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [ PublishVersion ](API_PublishVersion.md) separately\. + ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** +Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [PublishVersion](API_PublishVersion.md) separately\. Type: Boolean Required: No - ** [ RevisionId ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [RevisionId](#API_UpdateFunctionCode_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No - ** [ S3Bucket ](#API_UpdateFunctionCode_RequestSyntax) ** -An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. + ** [S3Bucket](#API_UpdateFunctionCode_RequestSyntax) ** +An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Use only with a function defined with a \.zip file archive deployment package\. Type: String Length Constraints: Minimum length of 3\. Maximum length of 63\. Pattern: `^[0-9A-Za-z\.\-_]*(? -The Amazon S3 key of the deployment package\. + ** [S3Key](#API_UpdateFunctionCode_RequestSyntax) ** +The Amazon S3 key of the deployment package\. Use only with a function defined with a \.zip file archive deployment package\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - ** [ S3ObjectVersion ](#API_UpdateFunctionCode_RequestSyntax) ** + ** [S3ObjectVersion](#API_UpdateFunctionCode_RequestSyntax) ** For versioned objects, the version of the deployment package object to use\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Required: No - ** [ ZipFile ](#API_UpdateFunctionCode_RequestSyntax) ** -The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. + ** [ZipFile](#API_UpdateFunctionCode_RequestSyntax) ** +The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Use only with a function defined with a \.zip file archive deployment package\. Type: Base64\-encoded binary data object Required: No @@ -183,157 +189,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Architectures](#API_UpdateFunctionCode_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [CodeSha256](#API_UpdateFunctionCode_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionName ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [FunctionName](#API_UpdateFunctionCode_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Handler ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Handler](#API_UpdateFunctionCode_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionCode_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ LastUpdateStatus ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastUpdateStatus](#API_UpdateFunctionCode_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [ LastUpdateStatusReason ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ MemorySize ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [ StateReason ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [StateReason](#API_UpdateFunctionCode_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [ TracingConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [TracingConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_UpdateFunctionCode_ResponseSyntax) ** + ** [VpcConfig](#API_UpdateFunctionCode_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -380,12 +386,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md old mode 100644 new mode 100755 index a32e845b..94358f2a --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -2,11 +2,11 @@ Modify the version\-specific settings of a Lambda function\. -When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [ GetFunctionConfiguration ](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. +When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. These settings can vary between versions of a function and are locked when you publish a version\. You can't modify the configuration of a published version, only the unpublished version\. -To configure function concurrency, use [ PutFunctionConcurrency ](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [ AddPermission ](API_AddPermission.md)\. +To configure function concurrency, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [AddPermission](API_AddPermission.md)\. ## Request Syntax @@ -57,7 +57,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** The name of the Lambda function\. **Name formats** @@ -73,90 +73,90 @@ Required: Yes The request accepts the following data in JSON format\. - ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object Required: No - ** [ Description ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** A description of the function\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No - ** [ Environment ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. -Type: [ Environment ](API_Environment.md) object +Type: [Environment](API_Environment.md) object Required: No - ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** Connection settings for an Amazon EFS file system\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. Required: No - ** [ Handler ](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The name of the method within your code that Lambda calls to execute your function\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. + ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` Required: No - ** [ ImageConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Docker file\. -Type: [ ImageConfig ](API_ImageConfig.md) object +Type: [ImageConfig](API_ImageConfig.md) object Required: No - ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` Required: No - ** [ Layers ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) ** A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. Type: Array of strings Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` Required: No - ** [ MemorySize ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. Required: No - ** [ RevisionId ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. Type: String Required: No - ** [ Role ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) ** The Amazon Resource Name \(ARN\) of the function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` Required: No - ** [ Runtime ](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. + ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No - ** [ Timeout ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. Type: Integer Valid Range: Minimum value of 1\. Required: No - ** [ TracingConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [ TracingConfig ](API_TracingConfig.md) object +Type: [TracingConfig](API_TracingConfig.md) object Required: No - ** [ VpcConfig ](#API_UpdateFunctionConfiguration_RequestSyntax) ** + ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [ VpcConfig ](API_VpcConfig.md) object +Type: [VpcConfig](API_VpcConfig.md) object Required: No ## Response Syntax @@ -245,157 +245,157 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ Architectures ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Architectures](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. Type: Array of strings Array Members: Fixed number of 1 item\. Valid Values:` x86_64 | arm64` - ** [ CodeSha256 ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The SHA256 hash of the function's deployment package\. Type: String - ** [ CodeSize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The size of the function's deployment package, in bytes\. Type: Long - ** [ DeadLetterConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's dead letter queue\. -Type: [ DeadLetterConfig ](API_DeadLetterConfig.md) object +Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - ** [ Description ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's description\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. - ** [ Environment ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: [ EnvironmentResponse ](API_EnvironmentResponse.md) object +Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - ** [ FileSystemConfigs ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [ FileSystemConfig ](API_FileSystemConfig.md) objects +Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects Array Members: Maximum number of 1 item\. - ** [ FunctionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's Amazon Resource Name \(ARN\)\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ FunctionName ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [FunctionName](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The name of the function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 170\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ Handler ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Handler](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function that Lambda calls to begin executing your function\. Type: String Length Constraints: Maximum length of 128\. Pattern: `[^\s]+` - ** [ ImageConfigResponse ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's image configuration values\. -Type: [ ImageConfigResponse ](API_ImageConfigResponse.md) object +Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - ** [ KMSKeyArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. Type: String Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - ** [ LastModified ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. Type: String - ** [ LastUpdateStatus ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. Type: String Valid Values:` Successful | Failed | InProgress` - ** [ LastUpdateStatusReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the last update that was performed on the function\. Type: String - ** [ LastUpdateStatusReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the last update that was performed on the function\. Type: String Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Layers ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [ Layer ](API_Layer.md) objects +Type: Array of [Layer](API_Layer.md) objects - ** [ MasterArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** For Lambda@Edge functions, the ARN of the main function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ MemorySize ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of memory available to the function at runtime\. Type: Integer Valid Range: Minimum value of 128\. Maximum value of 10240\. - ** [ PackageType ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. Type: String Valid Values:` Zip | Image` - ** [ RevisionId ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The latest updated revision of the function or alias\. Type: String - ** [ Role ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's execution role\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - ** [ Runtime ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - ** [ SigningJobArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ SigningProfileVersionArn ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing profile version\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - ** [ State ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. Type: String Valid Values:` Pending | Active | Inactive | Failed` - ** [ StateReason ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason for the function's current state\. Type: String - ** [ StateReasonCode ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. Type: String Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - ** [ Timeout ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The amount of time in seconds that Lambda allows a function to run before stopping it\. Type: Integer Valid Range: Minimum value of 1\. - ** [ TracingConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's AWS X\-Ray tracing configuration\. -Type: [ TracingConfigResponse ](API_TracingConfigResponse.md) object +Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - ** [ Version ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The version of the Lambda function\. Type: String Length Constraints: Minimum length of 1\. Maximum length of 1024\. Pattern: `(\$LATEST|[0-9]+)` - ** [ VpcConfig ](#API_UpdateFunctionConfiguration_ResponseSyntax) ** + ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The function's networking configuration\. -Type: [ VpcConfigResponse ](API_VpcConfigResponse.md) object +Type: [VpcConfigResponse](API_VpcConfigResponse.md) object ## Errors @@ -438,12 +438,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md old mode 100644 new mode 100755 index 35d1ba27..cd8ae575 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ b/doc_source/API_UpdateFunctionEventInvokeConfig.md @@ -2,7 +2,7 @@ Updates the configuration for asynchronous invocation for a function, version, or alias\. -To configure options for asynchronous invocation, use [ PutFunctionEventInvokeConfig ](API_PutFunctionEventInvokeConfig.md)\. +To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. ## Request Syntax @@ -28,7 +28,7 @@ Content-type: application/json The request uses the following URI parameters\. - ** [ FunctionName ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The name of the Lambda function, version, or alias\. **Name formats** @@ -40,7 +40,7 @@ Length Constraints: Minimum length of 1\. Maximum length of 140\. Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` Required: Yes - ** [ Qualifier ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A version number or alias name\. Length Constraints: Minimum length of 1\. Maximum length of 128\. Pattern: `(|[a-zA-Z0-9$_-]+)` @@ -49,7 +49,7 @@ Pattern: `(|[a-zA-Z0-9$_-]+)` The request accepts the following data in JSON format\. - ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -57,16 +57,16 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object Required: No - ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. Required: No - ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -100,7 +100,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. - ** [ DestinationConfig ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** A destination for events after they have been sent to a function for processing\. **Destinations** @@ -108,23 +108,23 @@ A destination for events after they have been sent to a function for processing\ + **Queue** \- The ARN of an SQS queue\. + **Topic** \- The ARN of an SNS topic\. + **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [ DestinationConfig ](API_DestinationConfig.md) object +Type: [DestinationConfig](API_DestinationConfig.md) object - ** [ FunctionArn ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [FunctionArn](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The Amazon Resource Name \(ARN\) of the function\. Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - ** [ LastModified ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [LastModified](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The date and time that the configuration was last updated, in Unix time seconds\. Type: Timestamp - ** [ MaximumEventAgeInSeconds ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum age of a request that Lambda sends to a function for processing\. Type: Integer Valid Range: Minimum value of 60\. Maximum value of 21600\. - ** [ MaximumRetryAttempts ](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** + ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** The maximum number of times to retry when the function returns an error\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 2\. @@ -154,12 +154,12 @@ HTTP Status Code: 429 ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md old mode 100644 new mode 100755 index 5cf2d276..00a22693 --- a/doc_source/API_VpcConfig.md +++ b/doc_source/API_VpcConfig.md @@ -19,7 +19,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md old mode 100644 new mode 100755 index af0b36fd..24c5badc --- a/doc_source/API_VpcConfigResponse.md +++ b/doc_source/API_VpcConfigResponse.md @@ -24,7 +24,7 @@ Required: No ## See Also For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [ AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) -+ [ AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [ AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) -+ [ AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md old mode 100644 new mode 100755 diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md old mode 100644 new mode 100755 index f1bb64c7..32620b0f --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -6,7 +6,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc **To view a function's resource\-based policy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -27,7 +27,7 @@ For Lambda functions, you can [grant an account permission](#permissions-resourc "Service": "s3.amazonaws.com" }, "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function:*", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function", "Condition": { "StringEquals": { "AWS:SourceAccount": "123456789012" diff --git a/doc_source/applications-console.md b/doc_source/applications-console.md old mode 100644 new mode 100755 diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md old mode 100644 new mode 100755 diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md old mode 100644 new mode 100755 index 0cc90bf8..a8793dde --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -36,6 +36,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. ++ **Do not use non\-documented, non\-public APIs** in your Lambda function code\. For AWS Lambda managed runtimes, Lambda periodically applies security and functional updates to Lambda's internal APIs\. These internal API updates may be backwards\-incompatible, leading to unintended consequences such as invocation failures if your function has a dependency on these non\-public APIs\. See [the API reference](API_Operations.md) for a list of publicly available APIs\. ## Function configuration + **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: @@ -58,12 +59,12 @@ For more information about best practices for Lambda applications, see [Applicat + In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\. ## Metrics and alarms -+ **Use [Working with AWS Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. ++ **Use [Working with Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ## Working with streams + **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. - By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. + By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. + **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. + **Use [Amazon CloudWatch](https://docs.aws.amazon.com/streams/latest/dev/monitoring-with-cloudwatch.html)** on IteratorAge to determine if your Kinesis stream is being processed\. For example, configure a CloudWatch alarm with a maximum setting to 30000 \(30 seconds\)\. \ No newline at end of file diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md old mode 100644 new mode 100755 index 1b3f53ba..ba8e9806 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -15,7 +15,7 @@ You can create a function alias using the Lambda console\. **To create an alias** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -62,7 +62,7 @@ aws lambda delete-alias --function-name my-function --name alias-name Each alias has a unique ARN\. An alias can point only to a function version, not to another alias\. You can update an alias to point to a new version of the function\. -Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. +Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. In a resource policy, you can grant permissions for event sources to use your Lambda function\. If you specify an alias ARN in the policy, you don't need to update the policy when the function version changes\. @@ -97,7 +97,7 @@ You can point an alias to a maximum of two Lambda function versions\. The versio **Note** Verify that the function has at least two published versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -155,7 +155,7 @@ When you configure traffic weights between two function versions, there are two `19:44:37 START RequestId: request id Version: $version ` - For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. + For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. \ No newline at end of file diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md old mode 100644 new mode 100755 index f61f5d92..49be75a6 --- a/doc_source/configuration-codesigning.md +++ b/doc_source/configuration-codesigning.md @@ -119,7 +119,7 @@ To enable code signing for a function, you associate a code signing configuratio **To associate a code signing configuration with a function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function for which you want to enable code signing\. diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md old mode 100644 new mode 100755 index eece79db..bbfbefac --- a/doc_source/configuration-concurrency.md +++ b/doc_source/configuration-concurrency.md @@ -20,7 +20,7 @@ To manage reserved concurrency settings for a function, use the Lambda console\. **To reserve concurrency for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md old mode 100644 new mode 100755 index b7a76747..04478967 --- a/doc_source/configuration-database.md +++ b/doc_source/configuration-database.md @@ -13,7 +13,7 @@ You can use the Lambda console to create an Amazon RDS Proxy database proxy\. **To create a database proxy** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -85,9 +85,9 @@ For more information, see [IAM database authentication](https://docs.aws.amazon. Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: + [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - [ ![\[The dbadmin function relays queries to a database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-rdsmysql.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) + [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) + [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - [ ![\[The processor function processes Kinesis events and stores the events in a MySQL database.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-listmanager.png)](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) + [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md old mode 100644 new mode 100755 index 4de65981..ff33dc53 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -24,7 +24,7 @@ You create an environment variable for your function by defining a key and a val **To set environment variables in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -228,7 +228,7 @@ For additional security, you can enable helpers for encryption in transit, which 1. Using the Lambda console, navigate to the **Edit environment variables** page\. - 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. + 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -242,7 +242,7 @@ For additional security, you can enable helpers for encryption in transit, which 1. Under **Encryption in transit**, choose **Enable helpers for encryption in transit**\. - 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next ot the environment variable\. + 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next to the environment variable\. 1. Under AWS KMS key to encrypt in transit, choose a customer managed key that you created at the beginning of this procedure\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md old mode 100644 new mode 100755 index dfc08d2d..93ea99d0 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -12,13 +12,13 @@ You can configure a function to mount an Amazon Elastic File System \(Amazon EFS ## Execution role and user permissions -Lambda uses your function's permissions to mount file systems\. To connect to a file system, your function's execution role must have the following permissions in addition to the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions): +If the file system doesn't have a user\-configured IAM policy, EFS uses a default policy that grants full access to any client that can connect to the file system using a file system mount target\. If the file system has a user\-configured IAM policy, your function's execution role must have the correct `elasticfilesystem` permissions\. **Execution role permissions** + **elasticfilesystem:ClientMount** + **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** -These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. +These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. Additionally, your execution role must have the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions)\. When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: @@ -58,7 +58,7 @@ If your function is not already connected to a VPC, see [Configuring a Lambda fu **To configure file system access** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md old mode 100644 new mode 100755 index 1c963dc4..840bb9ad --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -30,7 +30,7 @@ The **Function overview** shows a visualization of your function and its upstrea ## Configuring functions \(console\) -For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **configuration** tab provides the following sections: +For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **Configuration** tab provides the following sections: + **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. + **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. @@ -81,7 +81,7 @@ You can configure the memory of your function in the Lambda console\. **To update the memory of a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -102,7 +102,7 @@ When you've opted in and your [Lambda function meets Compute Optimizer requireme **To accept a function memory recommendation** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -120,7 +120,7 @@ For details about how services trigger Lambda functions, see [Using AWS Lambda w **To add a trigger to your function\.** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. @@ -136,7 +136,7 @@ You can create test events for your function from the **Test** tab\. **To create a test event** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -152,7 +152,7 @@ Saved test events are also available from the **Code** tab, under the **Test** m **To test the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md old mode 100644 new mode 100755 index 5e4ed1d7..dead45ae --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -22,7 +22,7 @@ When you create a function defined with a \.zip file archive, you choose a code **To create the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -30,7 +30,7 @@ When you create a function defined with a \.zip file archive, you choose a code 1. Under **Basic information**, do the following: - 1. For **Function name**, enter the function name\. + 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. 1. For **Runtime**, choose the language version to use for your function\. @@ -59,7 +59,7 @@ For scripting languages \(Node\.js, Python, and Ruby\), you can edit your functi **To upload function code as a \.zip archive** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. @@ -116,7 +116,7 @@ If you update the function configuration to use a new runtime version, you may n **To change the runtime or runtime version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. @@ -177,7 +177,7 @@ However, if you provide your function code using a \.zip file archive deployment **To change the instruction set architecture** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update and choose the **Code** tab\. diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md old mode 100644 new mode 100755 index f5ffb645..0d8ff94c --- a/doc_source/configuration-images.md +++ b/doc_source/configuration-images.md @@ -122,7 +122,7 @@ To create a function defined as a container image, you must first [create the im **To create the function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -130,7 +130,7 @@ To create a function defined as a container image, you must first [create the im 1. Under **Basic information**, do the following: - 1. For **Function name**, enter the function name\. + 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. @@ -169,7 +169,7 @@ After you deploy a container image to a function, the image is read\-only\. To u **To configure the function to use an updated container image** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. @@ -187,7 +187,7 @@ You can use the Lambda console to override the configuration values in the conta **To override the configuration values in the container image** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to update\. diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md old mode 100644 new mode 100755 index bdff631f..63b41caa --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -1,6 +1,8 @@ # Creating and sharing Lambda layers -A Lambda layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. +Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. + +A layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](lambda-images.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md old mode 100644 new mode 100755 index 8e85efb3..3c3cc12e --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -21,7 +21,7 @@ You can use the console to add tags to existing functions and to filter function For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -48,7 +48,7 @@ Tags apply at the function level, not to versions or aliases\. Tags are not part + lambda:ListTags grants permission to view functions that have tags\. + lambda:TagResource grants permission to add tags to a function\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Click within the search bar to see a list of function attributes and tag keys\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) @@ -130,4 +130,4 @@ The following requirements apply to tags: + Maximum value length—256 Unicode characters in UTF\-8 + Tag keys and values are case sensitive\. + Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. ++ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md old mode 100644 new mode 100755 index e8b3b26e..da0fcc7c --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -25,7 +25,7 @@ You can create a function version using the Lambda console\. **To create a new function version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function and then choose **Versions**\. diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md old mode 100644 new mode 100755 diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md old mode 100644 new mode 100755 index de3d4e65..8ac162f6 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -54,7 +54,7 @@ If your [IAM permissions](#vpc-conditions) allow you only to create Lambda funct **To configure a VPC when you create a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -72,7 +72,7 @@ To access private resources, connect your function to private subnets\. If your **To configure a VPC for an existing function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/csharp-context.md b/doc_source/csharp-context.md old mode 100644 new mode 100755 diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md old mode 100644 new mode 100755 index 767bfdc4..dc25eefe --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -14,7 +14,7 @@ This page describes how to view Lambda function invocation errors for the C\# ru ## Syntax -In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions ](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: +In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: ``` { @@ -151,7 +151,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -184,7 +184,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: @@ -204,7 +204,7 @@ cat output.txt You should see the invocation response in your command prompt\. -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in C\#](csharp-logging.md)\. +Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [Lambda function logging in C\#](csharp-logging.md)\. ## Error handling in other AWS services @@ -219,4 +219,4 @@ We recommend using AWS X\-Ray to determine the source of an error and its cause\ For more information, see [Instrumenting C\# code in AWS Lambda](csharp-tracing.md)\. ## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file ++ Learn how to show logging events for your Lambda function on the [Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md old mode 100644 new mode 100755 index c53803cc..f2423e9b --- a/doc_source/csharp-handler.md +++ b/doc_source/csharp-handler.md @@ -1,8 +1,8 @@ -# AWS Lambda function handler in C\# +# Lambda function handler in C\# The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. -You define a Lambda function handler as an instance or static method in a class\. If you want access to the Lambda context object, it is available by defining a method parameter of type *ILambdaContext*, an interface you can use to access information about the current invocation, such as the name of the current function, the memory limit, execution time remaining, and logging\. +You define a Lambda function handler as an instance or static method in a class\. For access to the Lambda context object, you can define a method parameter of type *ILambdaContext*\. You can use this to access information about the current invocation, such as the name of the function, memory limit, remaining execution time, and logging\. ``` returnType handler-name(inputType input, ILambdaContext context) { @@ -11,17 +11,17 @@ returnType handler-name(inputType input, ILambdaContext context) { ``` In the syntax, note the following: -+ *inputType* – The first handler parameter is the input to the handler, which can be event data \(published by an event source\) or custom input that you provide such as a string or any custom data object\. -+ *returnType* – If you plan to invoke the Lambda function synchronously \(using the `RequestResponse` invocation type\), you can return the output of your function using any of the supported data types\. For example, if you use a Lambda function as a mobile application backend, you are invoking it synchronously\. Your output data type will be serialized into JSON\. ++ *inputType* – The first handler parameter is the input to the handler\. This can be event data \(that an event source publishes\) or custom input that you provide, such as a string or any custom data object\. ++ *returnType* – If you plan to invoke the Lambda function synchronously \(using the `RequestResponse` invocation type\), you can return the output of your function using any of the supported data types\. For example, if you use a Lambda function as a mobile application backend, you are invoking it synchronously\. Your output data type is serialized into JSON\. - If you plan to invoke the Lambda function asynchronously \(using the `Event` invocation type\), the `returnType` should be `void`\. For example, if you use AWS Lambda with event sources such as Amazon S3 or Amazon SNS, these event sources invoke the Lambda function using the `Event` invocation type\. -+ `ILambdaContext context` – The second argument in the handler signature is optional\. It provides access to the [context object](csharp-context.md) which has information about the function and request\. + If you plan to invoke the Lambda function asynchronously \(using the `Event` invocation type\), the `returnType` should be `void`\. For example, if you use Lambda with event sources such as Amazon Simple Storage Service \(Amazon S3\) or Amazon Simple Notification Service \(Amazon SNS\), these event sources invoke the Lambda function using the `Event` invocation type\. ++ `ILambdaContext context` – The second argument in the handler signature is optional\. It provides access to the [context object](csharp-context.md), which has information about the function and request\. ## Handling streams -Only the `System.IO.Stream` type is supported as an input parameter by default\. +By default, Lambda supports only the `System.IO.Stream` type as an input parameter\. -For example, consider the following C\# example code\. +For example, consider the following C\# example code\. ``` using System.IO; @@ -38,34 +38,130 @@ namespace Example } ``` -In the example C\# code, the first handler parameter is the input to the handler \(MyHandler\), which can be event data \(published by an event source such as Amazon S3\) or custom input you provide such as a `Stream` \(as in this example\) or any custom data object\. The output is of type `Stream`\. +In the example C\# code, the first handler parameter is the input to the handler \(MyHandler\)\. This can be event data \(published by an event source such as Amazon S3\) or custom input that you provide, such as a `Stream` \(as in this example\) or any custom data object\. The output is of type `Stream`\. ## Handling standard data types -All other types, as listed below, require you to specify a serializer\. -+ Primitive \.NET types \(such as string or int\)\. -+ Collections and maps \- IList, IEnumerable, IList, Array, IDictionary, IDictionary +All the following other types require you to specify a serializer: ++ Primitive \.NET types \(such as string or int\) ++ Collections and maps – IList, IEnumerable, IList, Array, IDictionary, IDictionary + POCO types \(Plain old CLR objects\) + Predefined AWS event types -+ For asynchronous invocations the return\-type will be ignored by Lambda\. The return type may be set to void in such cases\. -+ If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with AWS Lambda](#csharp-handler-async)\. ++ For asynchronous invocations, Lambda ignores the return type\. In such cases, the return type may be set to void\. ++ If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with Lambda](#csharp-handler-async)\. -Unless your function input and output parameters are of type `System.IO.Stream`, you will need to serialize them\. AWS Lambda provides a default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. +Unless your function input and output parameters are of type `System.IO.Stream`, you must serialize them\. Lambda provides default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. -Instruction how to define serialize you can find in [Serializing Lambda functions](#csharp-handler-serializer)\. + To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.SystemTextJson` in your `.csproj` file\. + +``` + + + + net6.0 + enable + enable + true + Lambda + + true + + true + + + + + + + + +``` + +The example below illustrates the flexibility you can leverage by specifying the default System\.Text\.Json serializer on one method and another of your choosing on a different method: + +``` +public class ProductService + { + [LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] + public Product DescribeProduct(DescribeProductRequest request) + { + return catalogService.DescribeProduct(request.Id); + } + + [LambdaSerializer(typeof(MyJsonSerializer))] + public Customer DescribeCustomer(DescribeCustomerRequest request) + { + return customerService.DescribeCustomer(request.Id); + } +} +``` + +### Source generation for JSON serialization + +C\# 9 provides source generators that allow code generation during compilation\. Starting with \.NET 6, the native JSON library `System.Text.Json` can use source generators, allowing JSON parsing without the need for reflection APIs\. This can help improve cold start performance\. + +**To use the source generator** + +1. In your project, define an empty, partial class that derives from `System.Text.Json.Serialization.JsonSerializerContext`\. + +1. Add the `JsonSerializable` attribute for each \.NET type that the source generator must generate serialization code for\. + +**Example API Gateway integration leveraging source generation** + +``` +using System.Collections.Generic; +using System.Net; +using System.Text.Json.Serialization; + +using Amazon.Lambda.Core; +using Amazon.Lambda.APIGatewayEvents; +using Amazon.Lambda.Serialization.SystemTextJson; + +[assembly: +LambdaSerializer(typeof(SourceGeneratorLambdaJsonSerializer))] + +namespace SourceGeneratorExample; + +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyRequest))] +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyResponse))] +public partial class HttpApiJsonSerializerContext : JsonSerializerContext +{ +} + +public class Functions +{ + public APIGatewayProxyResponse Get(APIGatewayHttpApiV2ProxyRequest +request, ILambdaContext context) + { + context.Logger.LogInformation("Get Request"); + var response = new APIGatewayHttpApiV2ProxyResponse + { + StatusCode = (int)HttpStatusCode.OK, + Body = "Hello AWS Serverless", + Headers = new Dictionary { { "Content-Type", +"text/plain" } } + }; + + return response; + } +} +``` + +When you invoke your function, Lambda uses the source\-generated JSON serialization code to handle the serialization of Lambda events and responses\. ## Handler signatures -When creating Lambda functions, you have to provide a handler string that tells AWS Lambda where to look for the code to invoke\. In C\#, the format is: +When creating Lambda functions, you have to provide a handler string that tells Lambda where to look for the code to invoke\. In C\#, the format is: *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in \.csproj, the *ASSEMBLY* name will be the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume the \.csproj file is `HelloWorldApp.csproj`\. ++ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in the \.csproj file, the *ASSEMBLY* name is the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume that the \.csproj file is `HelloWorldApp.csproj`\. + *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. + *METHOD* is name of the function handler, in this case `MyHandler`\. -Ultimately, the signature will be of this format: *Assembly::Namespace\.ClassName::MethodName* +Ultimately, the signature is of this format: *Assembly::Namespace\.ClassName::MethodName* -Again, consider the following example: +Consider the following example: ``` using System.IO; @@ -85,25 +181,44 @@ namespace Example The handler string would be: `HelloWorldApp::Example.Hello::MyHandler` **Important** -If the method specified in your handler string is overloaded, you must provide the exact signature of the method Lambda should invoke\. AWS Lambda will reject an otherwise valid signature if the resolution would require selecting among multiple \(overloaded\) signatures\. +If the method specified in your handler string is overloaded, you must provide the exact signature of the method that Lambda should invoke\. If the resolution would require selecting among multiple \(overloaded\) signatures, Lambda will reject an otherwise valid signature\. + +## Using top\-level statements + +Starting with \.NET 6, you can write functions using *top\-level statements*\. Top\-level statements remove some of the boilerplate code required for \.NET projects, reducing the number of lines of code that you write\. For example, you can rewrite the previous example using top\-level statements: + +``` +using Amazon.Lambda.RuntimeSupport; + +var handler = (Stream stream) => +{ + //function logic +}; + +await LambdaBootstrapBuilder.Create(handler).Build().RunAsync(); +``` + + When using top\-level statements, you only include the `ASSEMBLY` name when providing the handler signature\. Continuing from the previous example, the handler string would be `HelloWorldApp`\. + + By setting the handler to the assembly name Lambda will treat the assembly as an executable and execute it at startup\. You must add the NuGet package `Amazon.Lambda.RuntimeSupport` to the project so that the executable that runs at startup starts the Lambda runtime client\. ## Serializing Lambda functions -For any Lambda functions that use input or output types other than a `Stream` object, you will need to add a serialization library to your application\. You can do this in the following ways: -+ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses native .net core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but please note that there are some limitation documented in the [Microsoft's documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. It is only available for \.net core 3\.1 runtimes or higher\. -+ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses `Newtonsoft.Json` NuGet package to handle serialization\. +For any Lambda functions that use input or output types other than a `Stream` object, you must add a serialization library to your application\. You can do this in the following ways: ++ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses the native \.NET Core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but note the limitations described in the [ Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. This library is available for \.NET Core 3\.1 and later runtimes\. ++ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. + Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: + `T Deserialize(Stream requestStream);` You implement this method to deserialize the request payload from the `Invoke` API into the object that is passed to the Lambda function handler\. + `T Serialize(T response, Stream responseStream);`\. - You implement this method to serialize the result returned from the Lambda function handler into the response payload that is returned by the `Invoke` API\. - + You implement this method to serialize the result returned from the Lambda function handler into the response payload that the `Invoke` API operation returns\. -To use serializer you need to add a dependency to your `csproj` file\. +To use the serializer, you must add a dependency to your `MyProject.csproj` file\. ``` +... @@ -111,19 +226,19 @@ To use serializer you need to add a dependency to your `csproj` file\. ``` -Next you need to define the serializer. For example you can define it in the AssemblyInfo\.cs file\. If you are using `Amazon.Lambda.Serialization.SystemTextJson`, the serializercan be defined that way: +Next, you must define the serializer\. The following example defines the ` Amazon.Lambda.Serialization.SystemTextJson` serializer in the AssemblyInfo\.cs file\. ``` [assembly: LambdaSerializer(typeof(DefaultLambdaJsonSerializer))] ``` - -Using `Amazon.Lambda.Serialization.Json`, it will be: + +The following example defines the `Amazon.Lambda.Serialization.Json` serializer in the AssemblyInfo\.cs file\. ``` [assembly: LambdaSerializer(typeof(JsonSerializer))] ``` -You can also define a custom serialization attribute at the method level, which will override the default serializer specified at the assembly level\. +You can define a custom serialization attribute at the method level, which overrides the default serializer specified at the assembly level\. ``` public class ProductService{ @@ -145,14 +260,14 @@ public class ProductService{ ## Lambda function handler restrictions Note that there are some restrictions on the handler signature\. -+ It may not be `unsafe` and use pointer types in the handler signature, though `unsafe` context can be used inside the handler method and its dependencies\. For more information, see [unsafe \(C\# reference\)](https://msdn.microsoft.com/en-us/library/chfa2zb8.aspx)\. -+ It may not pass a variable number of parameters using the `params` keyword, or use `ArgIterator` as an input or return parameter which is used to support variable number of parameters\. -+ The handler may not be a generic method \(e\.g\. IList Sort\(IList input\)\)\. ++ It may not be `unsafe` and use pointer types in the handler signature, though you can use `unsafe` context inside the handler method and its dependencies\. For more information, see [unsafe \(C\# Reference\)](https://msdn.microsoft.com/en-us/library/chfa2zb8.aspx) on the Microsoft Docs website\. ++ It may not pass a variable number of parameters using the `params` keyword, or use `ArgIterator` as an input or a return parameter, which is used to support a variable number of parameters\. ++ The handler may not be a generic method, for example, IList Sort\(IList input\)\. + Async handlers with signature `async void` are not supported\. -## Using async in C\# functions with AWS Lambda +## Using async in C\# functions with Lambda -If you know your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. +If you know that your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from Amazon DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. ``` public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) @@ -162,8 +277,8 @@ public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) } ``` -If you use this pattern, there are some considerations you must take into account: -+ AWS Lambda does not support `async void` methods\. +If you use this pattern, consider the following: ++ Lambda does not support `async void` methods\. + If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function invocation completes\. ``` @@ -172,7 +287,7 @@ If you use this pattern, there are some considerations you must take into accoun client.DoAsyncWork(input); } ``` -+ Your Lambda function can include multiple async calls, which can be invoked in parallel\. You can use the `Task.WhenAll` and `Task.WhenAny` methods to work with multiple tasks\. To use the `Task.WhenAll` method, you pass a list of the operations as an array to the method\. Note that in the example below, if you neglect to include any operation to the array, that call may return before its operation completes\. ++ Your Lambda function can include multiple async calls, which can be invoked in parallel\. You can use the `Task.WhenAll` and `Task.WhenAny` methods to work with multiple tasks\. To use the `Task.WhenAll` method, you pass a list of the operations as an array to the method\. Note that in the following example, if you neglect to include any operation to the array, that call may return before its operation completes\. ``` public async Task DoesNotWaitForAllTasks1() @@ -197,7 +312,7 @@ If you use this pattern, there are some considerations you must take into accoun var task2 = Task.Run(() => Console.WriteLine("Test2")); var task3 = Task.Run(() => Console.WriteLine("Test3")); - // Lambda may return before printing all tests since we're only waiting for one to finish. + // Lambda may return before printing all tests since we're waiting for only one to finish. await Task.WhenAny(task1, task2, task3); } - ``` + ``` \ No newline at end of file diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md old mode 100644 new mode 100755 index 9ca53129..14631ea0 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -7,7 +7,7 @@ AWS provides the following resources to help you build a container image for you These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -36,6 +36,7 @@ AWS provides the following base images for \.NET: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | +| 6 | \.NET 6\.0 | Amazon Linux 2 | [Dockerfile for \.NET 6\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/tree/master/LambdaRuntimeDockerfiles/Images/net6) | | 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | | core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md old mode 100644 new mode 100755 index 02a49dc3..9acc742d --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -1,4 +1,4 @@ -# AWS Lambda function logging in C\# +# Lambda function logging in C\# AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. @@ -6,6 +6,7 @@ This page describes how to produce log output from your Lambda function's code, **Topics** + [Creating a function that returns logs](#csharp-logging-output) ++ [Using log levels](#log-levels) + [Using the Lambda console](#csharp-logging-console) + [Using the CloudWatch console](#csharp-logging-cwconsole) + [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-logging-cli) @@ -13,7 +14,7 @@ This page describes how to produce log output from your Lambda function's code, ## Creating a function that returns logs - To output logs from your function code, you can use methods on [the Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. +To output logs from your function code, you can use methods on the [Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. **Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** @@ -37,7 +38,7 @@ public async Task FunctionHandler(SQSEvent invocationEvent, ILambd } ``` -**Example Log format** +**Example log format** ``` START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST @@ -87,6 +88,24 @@ The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocatio + **SegmentId** – For traced requests, the X\-Ray segment ID\. + **Sampled** – For traced requests, the sampling result\. +## Using log levels + +Starting with \.NET 6, you can use log levels for additional logging from Lambda functions\. Log levels provide filtering and categorization for the logs that your function writes to Amazon EventBridge \(CloudWatch Events\)\. + +The log levels available are: ++ `LogCritical` ++ `LogError` ++ `LogWarning` ++ `LogInformation` ++ `LogDebug` ++ `LogTrace` + + By default, Lambda writes `LogInformation` level logs and above to CloudWatch\. You can adjust the level of logs that Lambda writes using the `AWS_LAMBDA_HANDLER_LOG_LEVEL` environment variable\. Set the value of the environment variable to the string enum value for the level desired, as outlined in the [LogLevel enum](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.Core/ILambdaLogger.cs#L7)\. For example, if you set `AWS_LAMBDA_HANDLER_LOG_LEVEL` to `Error`, Lambda writes `LogError` and `LogCritical` messages to CloudWatch\. + + Lambda writes `Console.WriteLine` calls as info level messages, and `Console.Error.WriteLine` calls as error level messages\. + + If you prefer the previous style of logging in \.NET, set `AWS_LAMBDA_HANDLER_LOG_FORMAT` to `Unformatted`\. + ## Using the Lambda console You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. @@ -151,7 +170,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md old mode 100644 new mode 100755 index 4e984227..9f0c3583 --- a/doc_source/csharp-package-cli.md +++ b/doc_source/csharp-package-cli.md @@ -2,7 +2,7 @@ The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes that you have installed the \.NET Core CLI\. If you haven't, see [Download \.NET](https://dotnet.microsoft.com/download) on the Microsoft website\. -In the \.NET CLI, you use the `new` command to create \.NET projects from a command line\. This is useful if you want to create a project outside of Visual Studio\. To view a list of the available project types, open a command line and navigate to where you installed the \.NET Core runtime and run the following command: +In the \.NET CLI, you use the `new` command to create \.NET projects from a command line\. This is useful if you want to create a project outside of Visual Studio\. To view a list of the available project types, open a command line, navigate to where you installed the \.NET Core runtime, and then run the following command: ``` dotnet new -all @@ -21,7 +21,7 @@ Examples: dotnet new --help ``` -Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) nuget package\. To install this package, run the following command: +Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) NuGet package\. To install this package, run the following command: ``` dotnet new -i Amazon.Lambda.Templates @@ -53,8 +53,7 @@ Under the `src/myfunction` directory, examine the following files: "profile" : "default", "region" : "us-east-2", "configuration" : "Release", - "framework" : "netcoreapp2.1", - "function-runtime":"dotnetcore3.1", + "function-runtime":"dotnet6", "function-memory-size" : 256, "function-timeout" : 30, "function-handler" : "MyFunction::MyFunction.Function::FunctionHandler" @@ -70,16 +69,16 @@ Under the `src/myfunction` directory, examine the following files: using Amazon.Lambda.Core; // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. - [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] + [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] namespace MyFunction { public class Function { - public string FunctionHandler1(string input, ILambdaContext context) + public string FunctionHandler(string input, ILambdaContext context) { - return input?.ToUpper(); + return input.ToUpper(); } } } @@ -90,12 +89,20 @@ Under the `src/myfunction` directory, examine the following files: - netcoreapp2.1 + net6.0 + enable + enable + true + Lambda + + true + + true - - + + @@ -103,13 +110,13 @@ Under the `src/myfunction` directory, examine the following files: + **Readme**: Use this file to document your Lambda function\. Under the `myfunction/test` directory, examine the following files: -+ **myFunction\.Tests\.csproj**: As noted previously, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, allowing you to seamlessly integrate any Lambda templates required to test your function\. ++ **myFunction\.Tests\.csproj**: As noted previously, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, so you can seamlessly integrate any Lambda templates required to test your function\. ``` ... - + ... ``` + **FunctionTest\.cs**: The same C\# code template file that it is included in the `src` directory\. Edit this file to mirror your function's production code and test it before uploading your Lambda function to a production environment\. @@ -167,16 +174,14 @@ dotnet lambda deploy-function MyFunction --function-role role After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - ``` -dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" ``` If everything is successful, you see the following: ``` -dotnet lambda invoke-function MyFunction --cli-binary-format raw-in-base64-out --payload "Just Checking If Everything is OK" +dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" Payload: "JUST CHECKING IF EVERYTHING IS OK" diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md old mode 100644 new mode 100755 index 316b45f8..88473f87 --- a/doc_source/csharp-package-toolkit.md +++ b/doc_source/csharp-package-toolkit.md @@ -1,6 +1,6 @@ # AWS Toolkit for Visual Studio -You can build \.NET\-based Lambda applications using the Lambda plugin to the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. +You can build \.NET\-based Lambda applications using the Lambda plugin for the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. 1. Launch Microsoft Visual Studio and choose **New project**\. @@ -8,21 +8,20 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. In the **New Project** window, choose **Lambda Project \(\.NET Core\)**, and then choose **OK**\. - 1. In the **Select Blueprint** window, you can select from a list of sample applications that provide you with sample code to get started with creating a \.NET\-based Lambda application\. + 1. In the **Select Blueprint** window, select from the list of sample applications with sample code to help you get started with creating a \.NET\-based Lambda application\. 1. To create a Lambda application from scratch, choose **Empty Function**, and then choose **Finish**\. 1. Review the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which the Lambda tooling reads by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) - + **function\-handler** – This is where the `function handler` is specified, which is why you don't have to set it in the wizard\. However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. + + **function\-handler** – The field where you specify the `function handler`\. \(This is why you don't have to set it in the wizard\.\) However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. ``` { "profile":"default", "region" : "us-east-2", "configuration" : "Release", - "framework" : "netcoreapp2.1", - "function-runtime":"dotnetcore3.1", + "function-runtime":"dotnet6", "function-memory-size" : 256, "function-timeout" : 30, "function-handler" : "Assembly::Namespace.Class::Function" @@ -31,7 +30,7 @@ You can build \.NET\-based Lambda applications using the Lambda plugin to the [A 1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. -1. Once you have written the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. +1. After writing the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. 1. In the **Upload Lambda Function** window, enter a name for the function, or select a previously published function to republish\. Then choose **Next**\. diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md old mode 100644 new mode 100755 diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md old mode 100644 new mode 100755 index 21a62e9f..f468b4d5 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md old mode 100644 new mode 100755 index 5e278770..579df015 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -81,4 +81,4 @@ Lambda provides the following runtimes for the arm64 architecture\. These runtim **Note** Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. For example, see [Build a Go function for the provided\.al2 runtime](golang-package.md#golang-package-al2) or [Create a Go image from the provided\.al2 base image](go-image.md#go-image-al2)\. -For an example of how to create a function with arm64 architecture, see [ AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file +For an example of how to create a function with arm64 architecture, see [AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md old mode 100644 new mode 100755 diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md old mode 100644 new mode 100755 diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md old mode 100644 new mode 100755 index aad0bb8c..b4747281 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -6,7 +6,7 @@ Lambda includes a state field in the function configuration for all functions to + `Failed` – Indicates that resource configuration or provisioning encountered an error\. + `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. -If you are utilizing SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. +If you are using SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. ``` aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' @@ -66,4 +66,4 @@ The following is the result of `get-function-configuration` on a function underg The following operations fail while an asynchronous update is in progress: + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) ++ [PublishVersion](API_PublishVersion.md) \ No newline at end of file diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md old mode 100644 new mode 100755 index 90bea1d8..f24cab66 --- a/doc_source/getting-started-create-function.md +++ b/doc_source/getting-started-create-function.md @@ -1,6 +1,6 @@ # Create a Lambda function with the console -In this getting started exercise, you create a Lambda function using the console\.The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. +In this getting started exercise, you create a Lambda function using the console\. The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. For compiled languages, you must create a [\.zip archive deployment package](gettingstarted-package.md#gettingstarted-package-zip) to upload your Lambda function code\. **Topics** + [Create the function](#gettingstarted-zip-function) @@ -13,7 +13,7 @@ You create a Node\.js Lambda function using the Lambda console\. Lambda automati **To create a Lambda function with the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -59,7 +59,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. ## Clean up @@ -67,7 +67,7 @@ If you are done working with the example function, delete it\. You can also dele **To delete a Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md old mode 100644 new mode 100755 diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md old mode 100644 new mode 100755 diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md old mode 100644 new mode 100755 index f910270b..2389af5e --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -24,7 +24,7 @@ For more information, see [Configuring AWS Lambda functions](lambda-functions.md ## Trigger -A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking AWS Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. +A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. ## Event diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md old mode 100644 new mode 100755 index 47b34567..302d59af --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -14,7 +14,7 @@ Lambda provides a management console and API for managing and invoking functions ## Scaling -Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You only pay for the time that your function is initializing or processing events\. +Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You pay only for the time that your function is initializing or processing events\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) @@ -50,7 +50,7 @@ To process items from a stream or queue, you can create an *event source mapping Event source mappings maintain a local queue of unprocessed items and handle retries if the function returns an error or is throttled\. You can configure an event source mapping to customize batching behavior and error handling, or to send a record of items that fail processing to a destination\. -For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md)\. +For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. ## Destinations diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md old mode 100644 new mode 100755 index d185ab0a..100149e1 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -33,7 +33,7 @@ This exercise uses Docker CLI commands to create the container image\. To instal ## Create the container image -AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [ AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. +AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. In the following commands, replace `123456789012` with your AWS account ID\. @@ -88,7 +88,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. ## Upload the image to the Amazon ECR repository -In the following commands, replace `123456789012` with your AWS account ID\. +In the following commands, replace `123456789012` with your AWS account ID and set the region value to the region where you want to create the ECR repository\. 1. Authenticate the Docker CLI to your Amazon ECR registry\. @@ -99,7 +99,7 @@ In the following commands, replace `123456789012` with your AWS account ID\. 1. Create a repository in Amazon ECR using the `create-repository` command\. ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + aws ecr create-repository --region us-east-1 --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE ``` 1. Tag your image to match your repository name using the `docker tag` command\. @@ -140,7 +140,7 @@ Use the Lambda console to create a function defined as a container image\. **To create the function with the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -188,7 +188,7 @@ Invoke your Lambda function using the sample event data provided in the console\ 1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. ## Clean up @@ -198,7 +198,7 @@ If you are done working with your function, delete it\. You can also delete the **To delete a Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md old mode 100644 new mode 100755 index 1cf0c322..ac8debc9 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -5,7 +5,7 @@ Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. **Note** -New AWS accounts might start out with limits that are lower than these defaults\. Lambda monitors usage and raises your limits automatically based on your usage\. +A few new AWS accounts might start out with limits that are lower than these defaults\. AWS monitors usage and raises your limits automatically based on your usage\. | Resource | Default quota | Can be increased up to | @@ -28,7 +28,7 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Resource | Quota | | --- | --- | | Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | -| Function [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) | 900 seconds \(15 minutes\) | +| Function timeout | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md old mode 100644 new mode 100755 diff --git a/doc_source/glossary.md b/doc_source/glossary.md old mode 100644 new mode 100755 diff --git a/doc_source/go-image.md b/doc_source/go-image.md old mode 100644 new mode 100755 index 28da6942..5e2efbb7 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/golang-context.md b/doc_source/golang-context.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md old mode 100644 new mode 100755 index b3d6032e..1c8300a9 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -69,7 +69,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -102,7 +102,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md old mode 100644 new mode 100755 index a6dac31c..ba85177c --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,7 +136,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md old mode 100644 new mode 100755 diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md old mode 100644 new mode 100755 index c7564059..1c22aaf7 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/images-create.md b/doc_source/images-create.md old mode 100644 new mode 100755 diff --git a/doc_source/images-test.md b/doc_source/images-test.md old mode 100644 new mode 100755 diff --git a/doc_source/index.md b/doc_source/index.md old mode 100644 new mode 100755 index 8c8ead85..3c817e0b --- a/doc_source/index.md +++ b/doc_source/index.md @@ -53,10 +53,11 @@ Amazon's trademarks and trade dress may not be used in + [Configuring code signing for AWS Lambda](configuration-codesigning.md) + [Using tags on AWS Lambda functions](configuration-tags.md) + [Using layers with your Lambda function](invocation-layers.md) -+ [Invoking AWS Lambda functions](lambda-invocation.md) ++ [Invoking Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) - + [AWS Lambda event source mappings](invocation-eventsourcemapping.md) + + [Lambda event source mappings](invocation-eventsourcemapping.md) + + [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) @@ -119,13 +120,13 @@ Amazon's trademarks and trade dress may not be used in + [Instrumenting Go code in AWS Lambda](golang-tracing.md) + [Using environment variables](golang-envvars.md) + [Building Lambda functions with C#](lambda-csharp.md) - + [AWS Lambda function handler in C#](csharp-handler.md) + + [Lambda function handler in C#](csharp-handler.md) + [Deploy C# Lambda functions with .zip file archives](csharp-package.md) + [.NET Core CLI](csharp-package-cli.md) + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) + [Deploy .NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C#](csharp-context.md) - + [AWS Lambda function logging in C#](csharp-logging.md) + + [Lambda function logging in C#](csharp-logging.md) + [AWS Lambda function errors in C#](csharp-exceptions.md) + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) @@ -144,12 +145,11 @@ Amazon's trademarks and trade dress may not be used in + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) - + [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) + + [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) - + [AWS SAM template for a EventBridge (CloudWatch Events) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) @@ -192,16 +192,16 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with Amazon SNS](with-sns.md) + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) + [Sample function code](with-sns-create-package.md) - + [Using AWS Lambda with Amazon SQS](with-sqs.md) + + [Using Lambda with Amazon SQS](with-sqs.md) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Tutorial: Using a cross-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) + [Sample Amazon SQS function code](with-sqs-create-package.md) + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) + [Using AWS Lambda with AWS X-Ray](services-xray.md) + [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) - + [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) + + [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) - + [Working with AWS Lambda function metrics](monitoring-metrics.md) + + [Working with Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) @@ -315,6 +315,8 @@ Amazon's trademarks and trade dress may not be used in + [EnvironmentResponse](API_EnvironmentResponse.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) + [FileSystemConfig](API_FileSystemConfig.md) + + [Filter](API_Filter.md) + + [FilterCriteria](API_FilterCriteria.md) + [FunctionCode](API_FunctionCode.md) + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md old mode 100644 new mode 100755 index abac18f4..6ded61d8 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -25,7 +25,7 @@ aws lambda invoke \ --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` { @@ -52,7 +52,7 @@ You can also configure Lambda to send an invocation record to another service\. The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an Amazon SQS queue or Amazon SNS topic as a [dead\-letter queue](#invocation-dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. **Note** -To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda immediately sends all events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. +To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda begins sending new events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. ## Configuring error handling for asynchronous invocation @@ -60,7 +60,7 @@ Use the Lambda console to configure error handling settings on a function, a ver **To configure error handling** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -94,7 +94,7 @@ Add destinations to your function in the Lambda console's function visualization **To configure a destination for asynchronous invocation records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -208,7 +208,7 @@ As an alternative to an [on\-failure destination](#invocation-async-destinations To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. + [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. @@ -225,7 +225,7 @@ After creating the target and updating your function's execution role, add the d **To configure a dead\-letter queue** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -257,4 +257,4 @@ Lambda sends the event to the dead\-letter queue as\-is, with additional informa If Lambda can't send a message to the dead\-letter queue, it deletes the event and emits the [DeadLetterErrors](monitoring-metrics.md) metric\. This can happen because of lack of permissions, or if the total size of the message exceeds the limit for the target queue or topic\. For example, if an Amazon SNS notification with a body close to 256 KB triggers a function that results in an error, the additional event data added by Amazon SNS, combined with the attributes added by Lambda, can cause the message to exceed the maximum size allowed in the dead\-letter queue\. -If you're using Amazon SQS as an event source, configure a dead\-letter queue on the Amazon SQS queue itself and not on the Lambda function\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. \ No newline at end of file +If you're using Amazon SQS as an event source, configure a dead\-letter queue on the Amazon SQS queue itself and not on the Lambda function\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. \ No newline at end of file diff --git a/doc_source/invocation-eventfiltering.md b/doc_source/invocation-eventfiltering.md new file mode 100755 index 00000000..cf9d458f --- /dev/null +++ b/doc_source/invocation-eventfiltering.md @@ -0,0 +1,312 @@ +# Lambda event filtering + +For Amazon Kinesis, Amazon DynamoDB, and Amazon Simple Queue Service \(Amazon SQS\) event sources, you can use event filtering to control which events Lambda sends to your function for processing\. For example, you can define filter criteria so that you process only the records from a Kinesis stream that have the status code `ERROR`\. + +You can define up to five different filters for a single event source\. If an event satisfies any one of these five filters, Lambda sends the event to your function\. Otherwise, Lambda discards the event\. An event either satisfies the filter criteria or it doesn't\. If you're using batching windows, Lambda applies your filter criteria to each new event to determine whether to add it to the current batch\. + +**Topics** ++ [Event filtering basics](#filtering-basics) ++ [Filter rule syntax](#filtering-syntax) ++ [Filtering examples](#filtering-examples) ++ [Attaching filter criteria to an event source mapping \(console\)](#filtering-console) ++ [Attaching filter criteria to an event source mapping \(AWS CLI\)](#filtering-cli) ++ [Properly filtering Amazon SQS messages](#filtering-sqs) ++ [Properly filtering Kinesis and DynamoDB messages](#filtering-streams) + +## Event filtering basics + +A filter criteria \(`FilterCriteria`\) object is a structure that consists of a list of filters \(`Filters`\)\. Each filter \(`Filter`\) is a structure that defines an event filtering pattern \(`Pattern`\)\. A `Pattern` is a string representation of a JSON filter rule\. A `FilterCriteria` object looks like the following example: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"Metadata1\": [ rule1 ], \"data\": { \"Data1\": [ rule2 ] }}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON: + +``` +{ + "Metadata1": [ pattern1 ], + "data": { + "Data1": [ pattern2 ] + } +} +``` + +There are three main parts to a `FilterCriteria` object: metadata properties, data properties, and filter patterns\. For example, suppose you receive a Kinesis event from your event source that looks like the following: + +``` +"kinesis": { + "partitionKey": "1", + "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", + "data": { + "City": "Seattle", + "State": "WA", + "Temperature": "46", + "Month": "December" + }, + "approximateArrivalTimestamp": 1545084650.987 +} +``` ++ **Metadata properties** are the fields of the event object\. In the example `FilterCriteria`, `Metadata1` refers to a metadata property\. In the Kinesis event example, `Metadata1` could refer to a field such as `partitionKey`\. ++ **Data properties** are the fields of the event body\. In the example `FilterCriteria`, `Data1` refers to a data property\. In the Kinesis event example, `Data1` could refer to fields such as `City` and `Temperature`\. +**Note** +To filter on data properties, make sure to contain them in `FilterCriteria` within the proper key\. This key depends on the event source\. For Kinesis event sources, the data key is `data`\. For Amazon SQS event sources, the data key is `body`\. For DynamoDB event sources, the data key is `dynamodb`\. ++ **Filter rules** define the filter that you want to apply to a specific property\. In the example `FilterCriteria`, `rule1` applies to `Metadata1`, and `rule2` applies to `Data1`\. The syntax of your filter rule depends on the comparison operator that you use\. For more information, see [Filter rule syntaxFiltering examples](#filtering-syntax)\. + +When you create a `FilterCriteria` object, specify only the metadata properties and data properties that you want the filter to match on\. For Lambda to consider the event a match, the event must contain all the field names included in a filter\. Lambda ignores the fields that aren't included in a filter\. + +## Filter rule syntax + +For filter rules, Lambda supports the same set of syntax and rules as Amazon EventBridge\. For more information, see [Amazon EventBridge event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the *Amazon EventBridge User Guide*\. + +The following is a summary of all the comparison operators available for Lambda event filtering\. + + +| Comparison operator | Example | Rule syntax | +| --- | --- | --- | +| Null | UserID is null | "UserID": \[ null \] | +| Empty | LastName is empty | "LastName": \[""\] | +| Equals | Name is "Alice" | "Name": \[ "Alice" \] | +| And | Location is "New York" and Day is "Monday" | "Location": \[ "New York" \], "Day": \["Monday"\] | +| Or | PaymentType is "Credit" or "Debit" | "PaymentType": \[ "Credit", "Debit"\] | +| Not | Weather is anything but "Raining" | "Weather": \[ \{ "anything\-but": \[ "Raining" \] \} \] | +| Numeric \(equals\) | Price is 100 | "Price": \[ \{ "numeric": \[ "=", 100 \] \} \] | +| Numeric \(range\) | Price is more than 10, and less than or equal to 20 | "Price": \[ \{ "numeric": \[ ">", 10, "<=", 20 \] \} \] | +| Exists | ProductName exists | "ProductName": \[ \{ "exists": true \} \] | +| Does not exist | ProductName does not exist | "ProductName": \[ \{ "exists": false \} \] | +| Begins with | Region is in the US | "Region": \[ \{"prefix": "us\-" \} \] | + +**Note** +Like EventBridge, for strings, Lambda uses exact character\-by\-character matching without case\-folding or any other string normalization\. For numbers, Lambda also uses string representation\. For example, 300, 300\.0, and 3\.0e2 are not considered equal\. + +## Filtering examples + +Suppose you have a Kinesis event source, and you want your function to handle only events with a specific `partitionKey` \(a metadata property\)\. In addition, you want to process only events with the `Location` field \(a data property\) equal to "Los Angeles"\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"partitionKey\": [ \"1\" ], \"data\": { \"Location\": [ \"Los Angeles\" ] }}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "partitionKey": [ "1" ], + "data": { + "Location": [ "Los Angeles" ] + } +} +``` + +The previous example uses the **Equals** comparison operator for both `partitionKey` and `Location`\. + +As another example, suppose that you want to handle only events where the `Temperature` data property is greater than 50 but less than or equal to 60\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"data\": { \"Temperature\": [ {\"numeric\": [ \">\", 50, \"<=\", 60 ] }]}" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "data": { + "Temperature": [ {"numeric": [ ">", 50, "<=", 60 ] } ] + } +} +``` + +The previous example uses the **Numeric \(range\)** comparison operator for `Temperature`\. + +### Multi\-level filtering + +You can also use event filtering to handle multi\-level JSON filtering\. For example, suppose you receive a DynamoDB stream event with a data object that looks like the following: + +``` +"dynamodb": { + "Keys": { + "Id": { + "N": "101" + } + }, + "NewImage": { + "Message": { + "S": "New item!" + }, + "Id": { + "N": "101" + } + }, + "SequenceNumber": "111", + "SizeBytes": 26, + "StreamViewType": "NEW_AND_OLD_IMAGES" +} +``` + +Suppose you only wanted to handle events where the Key ID value, `N`, is 101\. In this case, your `FilterCriteria` object would look like this: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"dynamodb\": { \"Keys\": { \"Id\": { \"N\": [ "101" ] } } } }" + } + ] +} +``` + +For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. + +``` +{ + "dynamodb": { + "Keys": { + "Id": { + "N": [ "101" ] + } + } + } +} +``` + +The previous example uses the **Equals** comparison operator for `N`, which is nested multiple layers within the `dynamodb` data field\. + +## Attaching filter criteria to an event source mapping \(console\) + +Follow these steps to create a new event source mapping with filter criteria using the Lambda console\. + +**To create a new event source mapping with filter criteria \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of a function to create an event source mapping for\. + +1. Under **Function overview**, choose **Add trigger**\. + +1. For **Trigger configuration**, choose a trigger type that supports event filtering\. These include **SQS**, **DynamoDB**, and **Kinesis**\. + +1. Expand **Additional settings**\. + +1. Under **Filter criteria**, define and enter your filters\. For example, you can enter the following: + + ``` + { "a" : [ 1, 2 ] } + ``` + + This instructs Lambda to process only the records where field `a` is equal to 1 or 2\. + +1. Choose **Add**\. + +When you enter filter criteria using the console, you provide only the filter pattern\. In step 6 of the preceding instructions, `{ "a" : [ 1, 2 ] }` corresponds to the following `FilterCriteria`: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"a\" : [ 1, 2 ] }" + } + ] +} +``` + +After creating your event source mapping in the console, you can see the formatted `FilterCriteria` in the trigger details\. Note that when entering filters using the console, you don't need to provide the `Pattern` key or escape quotes\. + +**Note** +By default, you can have five different filters per event source\. You can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) for up to 10 filters per event source\. The Lambda console lets you add up to 10 filters depending on the current quota for your account\. If you attempt to add more filters than your current quota allows, Lambda throws an error when you try to create the event source\. + +## Attaching filter criteria to an event source mapping \(AWS CLI\) + +Suppose you want an event source mapping to have the following `FilterCriteria`: + +``` +{ + "Filters": [ + { + "Pattern": "{ \"a\" : [ 1, 2 ] }" + } + ] +} +``` + +To create a new event source mapping with these filter criteria using the AWS Command Line Interface \(AWS CLI\), run the following command: + +``` +aws lambda create-event-source-mapping \ + --function-name my-function \ + --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue \ + --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" +``` + +This [CreateEventSourceMapping](API_CreateEventSourceMapping.md) command creates a new Amazon SQS event source mapping for function `my-function` with the specified `FilterCriteria`\. + +To add these filter criteria to an existing event source mapping, run the following command: + +``` +aws lambda update-event-source-mapping \ + --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ + --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" +``` + +Note that to update an event source mapping, you need its UUID\. You can get the UUID from a [ListEventSourceMappings](API_ListEventSourceMappings.md) call\. Lambda also returns the UUID in the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API response\. + +To remove filter criteria from an event source, you can run the following [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) command with an empty `FilterCriteria` object: + +``` +aws lambda update-event-source-mapping \ + --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ + --filter-criteria "{}" +``` + +## Properly filtering Amazon SQS messages + +If an Amazon SQS message doesn't satisfy your filter criteria, Lambda automatically removes the message from the queue\. You don't have to manually delete these messages in Amazon SQS\. + +For Amazon SQS, the message `body` can be any string\. However, this can be problematic if your `FilterCriteria` expects `body` to be in a valid JSON format\. The reverse scenario is also true—if the incoming message `body` is in a valid JSON format, this can lead to unintended behavior if your filter criteria expects `body` to be a plain string\. + +To avoid this issue, ensure that the format of `body` in your `FilterCriteria` matches the expected format of `body` in messages that you receive from your queue\. Before filtering your messages, Lambda automatically evaluates the format of the incoming message `body` and of your filter pattern for `body`\. If there is a mismatch, Lambda drops the message\. The following table summarizes this evaluation: + + +| Incoming message `body` format | Filter pattern `body` format | Resulting action | +| --- | --- | --- | +| Plain string | Plain string | Lambda filters based on your filter criteria\. | +| Plain string | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Plain string | Valid JSON | Lambda drops the message\. | +| Valid JSON | Plain string | Lambda drops the message\. | +| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | + +If you don't include `body` as part of your `FilterCriteria`, Lambda skips this check\. + +## Properly filtering Kinesis and DynamoDB messages + +Once your filter criteria processes an Kinesis or DynamoDB record, the streams iterator advances past this record\. If the record doesn't satisfy your filter criteria, you don't have to manually delete the record from your event source\. After the retention period, Kinesis and DynamoDB automatically delete these old records\. If you want records to be deleted sooner, see [Changing the Data Retention Period](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-extended-retention.html)\. + +To properly filter events from stream event sources, both the data field and your filter criteria for the data field must be in valid JSON format\. \(For Kinesis, the data field is `data`\. For DynamoDB, the data field is `dynamodb`\.\) If either field isn't in a valid JSON format, Lambda drops the message or throws an exception\. The following table summarizes the specific behavior: + + +| Incoming data format \(`data` or `dynamodb`\) | Filter pattern format for data properties | Resulting action | +| --- | --- | --- | +| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | +| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | +| Non\-JSON | Valid JSON | Lambda drops the record\. | +| Non\-JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Non\-JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | \ No newline at end of file diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md old mode 100644 new mode 100755 index 854d36dd..60882025 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -1,25 +1,25 @@ -# AWS Lambda event source mappings +# Lambda event source mappings -An event source mapping is an AWS Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. +An event source mapping is a Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. **Services that Lambda reads events from** + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) ++ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) ++ [Self\-managed Apache Kafka](with-kafka.md) ++ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. +The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ @@ -47,17 +47,30 @@ You should see the following output: } ``` -Event source mappings read items from a stream or queue in batches\. They include multiple items in the event that your function receives\. You can configure the size of the batch that the event source mapping sends to your function, up to a maximum that varies by service\. The number of items in the event can be smaller than the batch size if there aren't enough items available, or if the batch is too large to send in one event and has to be split up\. +## Batching behavior + +Event source mappings read items from a target event source\. By default, an event source mapping batches records together into a single payload that Lambda sends to your function\. To fine\-tune batching behavior, you can configure a batching window \(`MaximumBatchingWindowInSeconds`\) and a batch size \(`BatchSize`\)\. A batching window is the maximum amount of time to gather records into a single payload\. A batch size is the maximum number of records in a single batch\. Lambda invokes your function when one of the following three criteria is met: ++ **The batching window reaches its maximum value\.** Batching window behavior varies depending on the specific event source\. + + **For Kinesis, DynamoDB, and Amazon SQS event sources:** The default batching window is 0 seconds\. This means that Lambda sends batches to your function as quickly as possible\. If you configure a `MaximumBatchingWindowInSeconds`, the next batching window begins as soon as the previous function invocation completes\. + + **For Amazon MSK, self\-managed Apache Kafka, and Amazon MQ event sources:** The default batching window is 500 ms\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. A batching window begins as soon as the first record arrives\. +**Note** +Because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. ++ **The batch size is met\.** The minimum batch size is 1\. The default and maximum batch size depend on the event source\. For details about these values, see the [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize) specification for the `CreateEventSourceMapping` API operation\. ++ **The payload size reaches [6 MB](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)\.** You cannot modify this limit\. + +The following diagram illustrates these three conditions\. Suppose a batching window begins at `t = 7` seconds\. In the first scenario, the batching window reaches its 40 second maximum at `t = 47` seconds after accumulating 5 records\. In the second scenario, the batch size reaches 10 before the batching window expires, so the batching window ends early\. In the third scenario, the maximum payload size is reached before the batching window expires, so the batching window ends early\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/batching-window.png) The following example shows an event source mapping that reads from a Kinesis stream\. If a batch of events fails all processing attempts, the event source mapping sends details about the batch to an SQS queue\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png) -The event batch is the event that Lambda sends to the function\. It is a batch of records or messages compiled from the items that the event source mapping reads from a stream or queue\. Batch size and other settings only apply to the event batch\. +The event batch is the event that Lambda sends to the function\. It is a batch of records or messages compiled from the items that the event source mapping reads up until the current batching window expires\. -For streams, an event source mapping creates an iterator for each shard in the stream and processes items in each shard in order\. You can configure the event source mapping to read only new items that appear in the stream, or to start with older items\. Processed items aren't removed from the stream and can be processed by other functions or consumers\. +For streams, an event source mapping creates an iterator for each shard in the stream and processes items in each shard in order\. You can configure the event source mapping to read only new items that appear in the stream, or to start with older items\. Processed items aren't removed from the stream, and other functions or consumers can process them\. -By default, if your function returns an error, the entire batch is reprocessed until the function succeeds, or the items in the batch expire\. To ensure in\-order processing, processing for the affected shard is paused until the error is resolved\. You can configure the event source mapping to discard old events, restrict the number of retries, or process multiple batches in parallel\. If you process multiple batches in parallel, in\-order processing is still guaranteed for each partition key, but multiple partition keys in the same shard are processed simultaneously\. +By default, if your function returns an error, the event source mapping reprocesses the entire batch until the function succeeds, or the items in the batch expire\. To ensure in\-order processing, the event source mapping pauses processing for the affected shard until the error is resolved\. You can configure the event source mapping to discard old events, restrict the number of retries, or process multiple batches in parallel\. If you process multiple batches in parallel, in\-order processing is still guaranteed for each partition key, but the event source mapping simultaneously processes multiple partition keys in the same shard\. You can also configure the event source mapping to send an invocation record to another service when it discards an event batch\. Lambda supports the following [destinations](invocation-async.md#invocation-async-destinations) for event source mappings\. + **Amazon SQS** – An SQS queue\. @@ -67,7 +80,7 @@ The invocation record contains details about the failed event batch in JSON form The following example shows an invocation record for a Kinesis stream\. -**Example invocation Record** +**Example invocation record** ``` { @@ -96,6 +109,6 @@ The following example shows an invocation record for a Kinesis stream\. } ``` -Lambda also supports in\-order processing for [FIFO \(first\-in, first\-out\) queues](with-sqs.md), scaling up to the number of active message groups\. For standard queues, items aren't necessarily processed in order\. Lambda scales up to process a standard queue as quickly as possible\. When an error occurs, batches are returned to the queue as individual items and might be processed in a different grouping than the original batch\. Occasionally, the event source mapping might receive the same item from the queue twice, even if no function error occurred\. Lambda deletes items from the queue after they're processed successfully\. You can configure the source queue to send items to a dead\-letter queue if they can't be processed\. +Lambda also supports in\-order processing for [FIFO \(first\-in, first\-out\) queues](with-sqs.md), scaling up to the number of active message groups\. For standard queues, items aren't necessarily processed in order\. Lambda scales up to process a standard queue as quickly as possible\. When an error occurs, Lambda returns batches to the queue as individual items and might process them in a different grouping than the original batch\. Occasionally, the event source mapping might receive the same item from the queue twice, even if no function error occurred\. Lambda deletes items from the queue after they're processed successfully\. You can configure the source queue to send items to a dead\-letter queue if Lambda can't process them\. For information about services that invoke Lambda functions directly, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md old mode 100644 new mode 100755 diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md old mode 100644 new mode 100755 index fdafb450..4dd05457 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -25,7 +25,7 @@ Make sure that the layers that you add to a function are compatible with the run **Adding a layer to a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. @@ -51,7 +51,7 @@ The order in which you add the layers is the order in which Lambda later merges **Update layer order for your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. @@ -67,7 +67,7 @@ Layers are versioned, and the content of each layer version is immutable\. The l **Update layer versions for your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to configure\. diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md old mode 100644 new mode 100755 index 649fd7ad..116a32b1 --- a/doc_source/invocation-retries.md +++ b/doc_source/invocation-retries.md @@ -32,7 +32,7 @@ When you invoke a function indirectly, you need to be aware of the retry behavio + **Asynchronous invocation** – Lambda retries function errors twice\. If the function doesn't have enough capacity to handle all incoming requests, events might wait in the queue for hours or days to be sent to the function\. You can configure a dead\-letter queue on the function to capture events that weren't successfully processed\. For more information, see [Asynchronous invocation](invocation-async.md)\. + **Event source mappings** – Event source mappings that read from streams retry the entire batch of items\. Repeated errors block processing of the affected shard until the error is resolved or the items expire\. To detect stalled shards, you can monitor the [Iterator Age](monitoring-metrics.md) metric\. - For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [AWS Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. + For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. + **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. For example, Amazon S3 batch operations retries the operation if the Lambda function returns a `TemporaryFailure` response code\. Services that proxy requests from an upstream user or client may have a retry strategy or may relay the error response back to the requestor\. For example, API Gateway always relays the error response back to the requestor\. For asynchronous invocation, the behavior is the same as when you invoke the function synchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md old mode 100644 new mode 100755 index 28d91bcf..ccec4642 --- a/doc_source/invocation-scaling.md +++ b/doc_source/invocation-scaling.md @@ -2,9 +2,9 @@ The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. -The default regional concurrency limit starts at 1,000\. For more information, or to request an increase on this limit, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. +The default regional concurrency quota starts at 1,000 instances\. For more information, or to request an increase on this quota, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. - Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all of your functions in the Region\. +Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all your functions in the Region\. **Burst concurrency quotas** + **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) @@ -24,7 +24,7 @@ The following example shows a function processing a spike in traffic\. As invoca The function continues to scale until the account's concurrency limit for the function's Region is reached\. The function catches up to demand, requests subside, and unused instances of the function are stopped after being idle for some time\. Unused instances are frozen while they're waiting for requests and don't incur any charges\. -When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](configuration-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. +When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](provisioned-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) @@ -34,7 +34,9 @@ When your function scales up, the first request served by each instance is impac + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -When you allocate provisioned concurrency, your function is ready to serve a burst of incoming requests with very low latency\. When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. +When you configure a number for provisioned concurrency, Lambda initializes that number of execution environments\. Your function is ready to serve a burst of incoming requests with very low latency\. Note that configuring [provisioned concurrency](provisioned-concurrency.md) incurs charges to your AWS account\. + + When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. Application Auto Scaling takes this a step further by providing autoscaling for provisioned concurrency\. With Application Auto Scaling, you can create a target tracking scaling policy that adjusts provisioned concurrency levels automatically, based on the utilization metric that Lambda emits\. [Use the Application Auto Scaling API](configuration-concurrency.md#configuration-concurrency-api) to register an alias as a scalable target and create a scaling policy\. @@ -50,7 +52,7 @@ In the following example, a function scales between a minimum and maximum amount When you invoke your function asynchronously, by using an event source mapping or another AWS service, scaling behavior varies\. For example, event source mappings that read from a stream are limited by the number of shards in the stream\. Scaling capacity that is unused by an event source is available for use by other clients and event sources\. For more information, see the following topics\. + [Asynchronous invocation](invocation-async.md) -+ [AWS Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event source mappings](invocation-eventsourcemapping.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using AWS Lambda with other services](lambda-services.md) @@ -64,4 +66,4 @@ You can monitor concurrency levels in your account by using the following metric + `ProvisionedConcurrencySpilloverInvocations` + `ProvisionedConcurrencyUtilization` -For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file +For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md old mode 100644 new mode 100755 diff --git a/doc_source/java-context.md b/doc_source/java-context.md old mode 100644 new mode 100755 diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md old mode 100644 new mode 100755 index 0c6a36c8..58fb0f89 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -131,7 +131,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -164,7 +164,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/java-image.md b/doc_source/java-image.md old mode 100644 new mode 100755 index c0a7aa29..0e5bc56e --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md old mode 100644 new mode 100755 index 2297df33..e9ebaa81 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,7 +150,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash @@ -219,6 +219,11 @@ Log groups aren't deleted automatically when you delete a function\. To avoid st ## Advanced logging with Log4j 2 and SLF4J +**Note** + AWS Lambda does not include Log4j2 in its managed runtimes or base container images\. These are therefore not affected by the issues described in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. + For cases where a customer function includes an impacted Log4j2 version, we have applied a change to the Lambda Java [managed runtimes](lambda-runtimes.md) and [base container images](java-image.md) that helps to mitigate the issues in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. As a result of this change, customers using Log4J2 may see an additional log entry, similar to "`Transforming org/apache/logging/log4j/core/lookup/JndiLookup (java.net.URLClassLoader@...)`"\. Any log strings that reference the jndi mapper in the Log4J2 output will be replaced with "`Patched JndiLookup::lookup()`"\. + Independent of this change, we strongly encourage all customers whose functions include Log4j2 to update to the latest version\. Specifically, customers using the aws\-lambda\-java\-log4j2 library in their functions should update to version 1\.5\.0 \(or later\), and redeploy their functions\. This version updates the underlying Log4j2 utility dependencies to version 2\.17\.0 \(or later\)\. The updated aws\-lambda\-java\-log4j2 binary is available at the [Maven repository](https://repo1.maven.org/maven2/com/amazonaws/aws-lambda-java-log4j2/) and its source code is available in [Github](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2)\. + To customize log output, support logging during unit tests, and log AWS SDK calls, use Apache Log4j 2 with SLF4J\. Log4j is a logging library for Java programs that enables you to configure log levels and use appender libraries\. SLF4J is a facade library that lets you change which library you use without changing your function code\. To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. @@ -308,12 +313,12 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.0' + implementation 'org.apache.logging.log4j:log4j-core:2.17.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md old mode 100644 new mode 100755 diff --git a/doc_source/java-package.md b/doc_source/java-package.md old mode 100644 new mode 100755 index 5c43578a..7f3c20f0 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -30,8 +30,8 @@ These libraries are available through [Maven Central Repository](https://search. ``` dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' } ``` @@ -48,12 +48,12 @@ dependencies { com.amazonaws aws-lambda-java-events - 3.1.0 + 3.11.0 com.amazonaws aws-lambda-java-log4j2 - 1.2.0 + 1.5.1 ``` @@ -69,7 +69,7 @@ You can upload your deployment package by using the Lambda console, the Lambda A **To upload a deployment package with the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -110,12 +110,12 @@ dependencies { implementation platform('software.amazon.awssdk:bom:2.10.73') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.1.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' + implementation 'org.apache.logging.log4j:log4j-api:2.13.0' + implementation 'org.apache.logging.log4j:log4j-core:2.13.0' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -169,7 +169,7 @@ To build the deployment package, use the `mvn package` command\. [INFO] [INFO] --- maven-shade-plugin:3.2.2:shade (default) @ java-maven --- [INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.1 in the shaded jar. -[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.1.0 in the shaded jar. +[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.11.0 in the shaded jar. [INFO] Including joda-time:joda-time:jar:2.6 in the shaded jar. [INFO] Including com.google.code.gson:gson:jar:2.8.6 in the shaded jar. [INFO] Replacing original artifact with shaded artifact. @@ -214,7 +214,7 @@ If you use the appender library \(`aws-lambda-java-log4j2`\), you must also conf com.github.edwgiz maven-shade-plugin.log4j2-cachefile-transformer - [2.17.1,) + 2.13.0 diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md old mode 100644 new mode 100755 diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md old mode 100644 new mode 100755 index db2726ad..1087a16c --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/kinesis-tutorial-spec.md b/doc_source/kinesis-tutorial-spec.md old mode 100644 new mode 100755 index 7c16045e..250afe05 --- a/doc_source/kinesis-tutorial-spec.md +++ b/doc_source/kinesis-tutorial-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for a DynamoDB application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the [tutorial application](with-ddb-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md old mode 100644 new mode 100755 index 456ac147..5b7f022f --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -76,108 +76,72 @@ For more information on resources and conditions for Lambda and other AWS servic ## Function resource names -You reference a Lambda function in a policy statement using an Amazon Resource Names \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function, a function [version](configuration-versions.md), or an [alias](configuration-aliases.md)\. +You reference a Lambda function in a policy statement using an Amazon Resource Name \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function \(unqualified\) or a function [version](configuration-versions.md) or [alias](configuration-aliases.md) \(qualified\)\. -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with the `FunctionName` passed in the API calls\. +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with both the `FunctionName` and `Qualifier` passed in API calls\. If there is a misamtch, Lambda denies the request\. -You must use the correct function ARN types in your policies to achieve the results that you expect, especially in policies that deny access\. We recommend that you follow the best practices for using Deny statements with functions\. +Whether you are allowing or denying an action on your function, you must use the correct function ARN types in your policy statement to achieve the results that you expect\. For example, if your policy references the unqualified ARN, Lambda accepts requests that reference the unqualified ARN but denies requests that reference a qualified ARN\. - - -### Best practices for using Deny statements with functions - -The following table summarizes the resources to use in Deny effects\. In the **Resource** column, `MyFunction` is the name of the function, `:1` refers to version 1 of the function, and `MyAlias` is the name of a function alias\. - - -**Resource best practices** - -| Policy objective | Resource | -| --- | --- | -| Deny access to all versions of a function | `MyFunction*` | -| Deny access to a specific alias | `MyFunction:MyAlias` and `MyFunction` | -| Deny access to a specific version of a function | `MyFunction:1` and `MyFunction` | - -The following sections provide example policy statements for each of the policy objectives\. - -**Note** -You can use only identity\-based policies to deny specific function resources\. Currently, Lambda does not support the `Deny` effect in resource\-based policies\. - -For the action list in a policy statement, you can add any of the [ actions defined by Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) that act on a function resource\. - -#### Deny access to all function versions - -The following identity\-based policy statement denies access to the `lambda:GetFunctionConfiguration` action for all versions of the `my-function` function\. The wildcard character at the end of the function ARN ensures that this policy applies to all version and alias ARNs\. - -**Example identity\-based policy** +**Example allowing invocation of an unqualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Effect": "Deny", - "Action": [ - "lambda:GetFunctionConfiguration" - ], - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function*" - } + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction" ] } ``` -#### Deny access to a specific function alias - -To deny access to a specific alias, you must specify both the alias ARN and the unqualified function ARN in the policy\. This prevents users from accessing the specific alias by passing the unqualified ARN as the `FunctionName` and the alias as the `Qualifier`\. - -**Note** -If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. +If your policy references a specific qualified ARN, Lambda accepts requests that reference that ARN but denies requests that reference the unqualified ARN or a different qualified ARN, for example, `myFunction:2`\. -The following identity\-based policy statement denies access to the `lambda:InvokeFunction` action in the `my-alias` alias of the `my-function` function\. - -**Example identity\-based policy** +**Example allowing invocation of a specific qualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Sid": "DenySpecificAlias", - "Effect": "Deny", + "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": [ - "arn:aws:lambda:us-west-2:123456789012:function:my-function:my-alias", - "arn:aws:lambda:us-west-2:123456789012:function:my-function" - ] + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:1" } ] } ``` -#### Deny access to a specific function version +If your policy references any qualified ARN using `:*`, Lambda accepts any qualified ARN but denies requests that reference the unqualified ARN\. -To deny access to a specific version, you must specify both the qualified ARN and the unqualified ARN in the policy\. This prevents users from accessing the specific version by passing the unqualified ARN as the `FunctionName` and the version as the `Qualifier`\. +**Example allowing invocation of any qualified arn** -**Note** -If you create this type of policy, API calls need to refer to the unpublished version of the function by specifying a qualified ARN with the $LATEST suffix in the `FunctionName` parameter\. +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:*" + } + ] +} +``` -The following identity\-based policy statement denies access to the invoke action in version 1 of the `my-function` function\. +If your policy references any ARN using `*`, Lambda accepts any qualified or unqualified ARN\. -**Example identity\-based policy** +**Example allowing invocation of any qualified or unqualified arn** ``` { "Version": "2012-10-17", "Statement": [ { - "Sid": "DenySpecificFunctionVersion", - "Effect": "Deny", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": [ - "arn:aws:lambda:us-west-2:123456789012:function:my-function:1", - "arn:aws:lambda:us-west-2:123456789012:function:my-function" - ] + "Effect": "Allow", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction*" } ] } diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md old mode 100644 new mode 100755 index 3bbe3c5b..fae83b69 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -23,6 +23,7 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | @@ -36,10 +37,10 @@ To get started with application development in your local environment, deploy on + [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. **Topics** -+ [AWS Lambda function handler in C\#](csharp-handler.md) ++ [Lambda function handler in C\#](csharp-handler.md) + [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + [Deploy \.NET Lambda functions with container images](csharp-image.md) + [AWS Lambda context object in C\#](csharp-context.md) -+ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function errors in C\#](csharp-exceptions.md) + [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-edge.md b/doc_source/lambda-edge.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-images.md b/doc_source/lambda-images.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md old mode 100644 new mode 100755 index 81eac920..6871fb4d --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -4,7 +4,7 @@ A Lambda function's execution role is an AWS Identity and Access Management \(IA **To view a function's execution role** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -125,17 +125,20 @@ aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:p ## AWS managed policies for Lambda features -The following AWS managed policies provide permissions that are required to use Lambda features: -+ **AWSLambdaBasicExecutionRole** – Permission to upload logs to CloudWatch\. -+ **AWSLambdaDynamoDBExecutionRole** – Permission to read records from an Amazon DynamoDB stream\. -+ **AWSLambdaKinesisExecutionRole** – Permission to read events from an Amazon Kinesis data stream or consumer\. -+ **AWSLambdaMQExecutionRole** – Permission to read records from an Amazon MQ broker\. -+ **AWSLambdaMSKExecutionRole** – Permission to read records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster\. -+ **AWSLambdaSQSQueueExecutionRole** – Permission to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue\. -+ **AWSLambdaVPCAccessExecutionRole** – Permission to manage elastic network interfaces to connect your function to a virtual private cloud \(VPC\)\. -+ **AWSXRayDaemonWriteAccess** – Permission to upload trace data to X\-Ray\. -+ **CloudWatchLambdaInsightsExecutionRolePolicy** – Permission to write runtime metrics to CloudWatch Lambda Insights\. -+ **AmazonS3ObjectLambdaExecutionRolePolicy** – Permission to interact with Amazon S3 Object Lambda\. +The following AWS managed policies provide permissions that are required to use Lambda features\. + + +| Change | Description | Date | +| --- | --- | --- | +| **[ AWSLambdaBasicExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaBasicExecutionRole` grants permissions to upload logs to CloudWatch\. | February 14, 2022 | +| **[ AWSLambdaDynamoDBExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaDynamoDBExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaDynamoDBExecutionRole` grants permissions to read records from an Amazon DynamoDB stream and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaKinesisExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaKinesisExecutionRole` grants permissions to read events from an Amazon Kinesis data stream and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaMSKExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaMSKExecutionRole` grants permissions to read and access records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster, manage elastic network interfaces \(ENIs\), and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaSQSQueueExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaSQSQueueExecutionRole` grants permissions to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSLambdaVPCAccessExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaVPCAccessExecutionRole` grants permissions to manage ENIs within an Amazon VPC and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess)** – Lambda started tracking changes to this policy\. | `AWSXRayDaemonWriteAccess` grants permissions to upload trace data to X\-Ray\. | February 14, 2022 | +| **[ CloudWatchLambdaInsightsExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `CloudWatchLambdaInsightsExecutionRolePolicy` grants permissions to write runtime metrics to CloudWatch Lambda Insights\. | February 14, 2022 | +| **[ AmazonS3ObjectLambdaExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AmazonS3ObjectLambdaExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `AmazonS3ObjectLambdaExecutionRolePolicy` grants permissions to interact with Amazon S3 Object Lambda and write to CloudWatch Logs\. | February 14, 2022 | For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. @@ -145,8 +148,8 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Amazon DynamoDB](with-ddb.md) + [Amazon Kinesis](with-kinesis.md) + [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka](with-msk.md) -+ [self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service](with-sqs.md) ++ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) ++ [Self\-managed Apache Kafka](with-kafka.md) ++ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md old mode 100644 new mode 100755 index 9ec12a32..d545ac54 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -1,21 +1,22 @@ -# Invoking AWS Lambda functions +# Invoking Lambda functions -You can invoke Lambda functions directly [with the Lambda console](getting-started-create-function.md#get-started-invoke-manually), the Lambda API, the AWS SDK, the AWS CLI, and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. +You can invoke Lambda functions directly [using the Lambda console](getting-started-create-function.md#get-started-invoke-manually), the Lambda API, an AWS SDK, the AWS Command Line Interface \(AWS CLI\), and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. -To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function only has data from one client or trigger\. +To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function has data from only one client or trigger\. -To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon SQS queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. +To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon Simple Queue Service \(Amazon SQS\) queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. -Other AWS services and resources invoke your function directly\. For example, you can configure EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon S3 to invoke your function when an object is created\. Each service varies in the method it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. +Other AWS services and resources invoke your function directly\. For example, you can configure Amazon EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon Simple Storage Service \(Amazon S3\) to invoke your function when an object is created\. Each service varies in the method that it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For details, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. +Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For more information, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. **Topics** + [Synchronous invocation](invocation-sync.md) + [Asynchronous invocation](invocation-async.md) -+ [AWS Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event source mappings](invocation-eventsourcemapping.md) ++ [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Using Lambda extensions](using-extensions.md) diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md old mode 100644 new mode 100755 index e2f9ba06..94bdeada --- a/doc_source/lambda-monitoring.md +++ b/doc_source/lambda-monitoring.md @@ -7,9 +7,9 @@ You can use other AWS services to troubleshoot your Lambda functions\. This sect For more information about monitoring Lambda applications, see [Monitoring and observability](https://docs.aws.amazon.com/lambda/latest/operatorguide/monitoring-observability.html) in the *Lambda operator guide*\. **Topics** -+ [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md) ++ [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) -+ [Working with AWS Lambda function metrics](monitoring-metrics.md) ++ [Working with Lambda function metrics](monitoring-metrics.md) + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) + [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md old mode 100644 new mode 100755 index 096ad77c..2c167189 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -77,7 +77,22 @@ The function runtime passes a context object to the handler, in addition to the Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](nodejs-logging.md) during invocation\. If your function [returns an error](nodejs-exceptions.md), Lambda formats the error and returns it to the invoker\. +## Node\.js initialization + +Node\.js has a unique event loop model that causes its initialization behavior to be different from other runtimes\. Specifically, Node\.js uses a non\-blocking I/O model that supports asynchronous operations\. This model allows Node\.js to perform efficiently for most workloads\. For example, if a Node\.js function makes a network call, that request may be designated as an asynchronous operation and placed into a callback queue\. The function may continue to process other operations within the main call stack without getting blocked by waiting for the network call to return\. Once the network call is returned, its callback is executed and then removed from the callback queue\. + + Some initialization tasks may run asynchronously\. These asynchronous tasks are not guaranteed to complete execution prior to an invocation\. For example, code that makes a network call to fetch a parameter from AWS Parameter Store may not be complete by the time Lambda executes the handler function\. As a result, the variable may be null during an invocation\. To avoid this, ensure that variables and other asynchronous code are fully initialized before continuing with the rest of the function’s core business logic\. + +### Designating a function handler as an ES module + +Starting with Node 14, you can guarantee completion of asynchronous initialization code prior to handler invocations by designating your code as an ES module, and using top\-level await\. Packages are designated as CommonJS modules by default, meaning you must first designate your function code as an ES module to use top\-level await\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. + +In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. + +For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. + **Topics** ++ [Node\.js initialization](#nodejs-initialization) + [AWS Lambda function handler in Node\.js](nodejs-handler.md) + [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + [Deploy Node\.js Lambda functions with container images](nodejs-image.md) diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md old mode 100644 new mode 100755 index 9ac3d29e..eee3dc93 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -7,6 +7,7 @@ The following sections explain how common programming patterns and core concepts | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md old mode 100644 new mode 100755 index 7e9f089a..de0e7e9c --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | November 19, 2021 | | [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | | [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | | [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | @@ -56,7 +57,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | | [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | | [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | -| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [ AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | +| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | | [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | | [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | | [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md old mode 100644 new mode 100755 index ad4c92be..2b7980e6 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -77,6 +77,7 @@ Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not sup | Name | Identifier | Operating system | Architectures | | --- | --- | --- | --- | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md old mode 100644 new mode 100755 index 1b101428..a69e0a4b --- a/doc_source/lambda-services.md +++ b/doc_source/lambda-services.md @@ -3,7 +3,7 @@ AWS Lambda integrates with other AWS services to invoke functions or take other actions\. These are some common use cases: + Invoke a function in response to resource lifecycle events, such as with Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using AWS Lambda with Amazon S3](with-s3.md)\. + Respond to incoming HTTP requests\. For more information, see [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md)\. -+ Consume events from a queue\. For more information, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. ++ Consume events from a queue\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. + Run a function on a schedule\. For more information, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Depending on which service you're using with Lambda, the invocation generally works in one of two ways\. An event drives the invocation or Lambda polls a queue or data stream and invokes the function in response to activity in the queue or data stream\. Lambda integrates with Amazon Elastic File System and AWS X\-Ray in a way that doesn't involve invoking functions\. diff --git a/doc_source/lambda-settingup.md b/doc_source/lambda-settingup.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-stepfunctions.md b/doc_source/lambda-stepfunctions.md old mode 100644 new mode 100755 diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md old mode 100644 new mode 100755 diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md old mode 100644 new mode 100755 index 4a104587..526ce6c7 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -1,14 +1,14 @@ -# Logging AWS Lambda API calls with AWS CloudTrail +# Logging Lambda API calls with CloudTrail -AWS Lambda is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in AWS Lambda\. CloudTrail captures API calls for AWS Lambda as events\. The calls captured include calls from the AWS Lambda console and code calls to the AWS Lambda API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for AWS Lambda\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to AWS Lambda, the IP address from which the request was made, who made the request, when it was made, and additional details\. +Lambda is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Lambda\. CloudTrail captures API calls for Lambda as events\. The calls captured include calls from the Lambda console and code calls to the Lambda API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon Simple Storage Service \(Amazon S3\) bucket, including events for Lambda\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to Lambda, the IP address from which the request was made, who made the request, when it was made, and additional details\. -To learn more about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. +For more information about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. -## AWS Lambda information in CloudTrail +## Lambda information in CloudTrail -CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in AWS Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. +CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. -For an ongoing record of events in your AWS account, including events for AWS Lambda, you create a trail\. A *trail* enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. +For an ongoing record of events in your AWS account, including events for Lambda, you create a *trail*\. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. For more information, see the following topics in the *AWS CloudTrail User Guide*: + [Overview for creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) @@ -16,13 +16,13 @@ For more information, see the following topics in the *AWS CloudTrail User Guide + [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) + [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) -Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. +Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or AWS Identity and Access Management \(IAM\) user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. -You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. +You can choose to have CloudTrail publish Amazon Simple Notification Service \(Amazon SNS\) notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. -You can also aggregate AWS Lambda log files from multiple AWS regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. +You can also aggregate Lambda log files from multiple Regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. ### List of supported Lambda API actions @@ -52,7 +52,7 @@ In the CloudTrail log file, the `eventName` might include date and version infor \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -## Understanding AWS Lambda log file entries +## Understanding Lambda log file entries CloudTrail log files contain one or more log entries where each entry is made up of multiple JSON\-formatted events\. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on\. The log entries are not guaranteed to be in any particular order\. That is, they are not an ordered stack trace of the public API calls\. @@ -120,7 +120,7 @@ The `eventName` might include date and version information, such as `"GetFunctio ## Using CloudTrail to track function invocations -CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [ Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. +CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. **Note** CloudTrail logs only authenticated and authorized requests\. CloudTrail does not log requests that fail authentication \(credentials are missing or the provided credentials are not valid\) or requests with credentials that are not authorized to invoke the function\. diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md old mode 100644 new mode 100755 index 7134c54a..df53ca0f --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -32,18 +32,13 @@ There is no additional charge for using Lambda logs; however, standard CloudWatc ## Using the Lambda console -The following section describes how to view logs for your function on the Lambda console\. - **To view logs using the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitor**\. -![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/)![\[Events\]](http://docs.aws.amazon.com/lambda/latest/dg/) - - A graphical representation of the metrics for the Lambda function are shown\. +1. Choose **Monitor**\. 1. Choose **View logs in CloudWatch**\. @@ -55,7 +50,7 @@ To debug and validate that your code is working as expected, you can output logs + [AWS Lambda function logging in Ruby](ruby-logging.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function logging in Go](golang-logging.md) -+ [AWS Lambda function logging in C\#](csharp-logging.md) ++ [Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function logging in PowerShell](powershell-logging.md) ## What's next? diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md old mode 100644 new mode 100755 index fe2f6951..e0409175 --- a/doc_source/monitoring-code-profiler.md +++ b/doc_source/monitoring-code-profiler.md @@ -10,7 +10,7 @@ You can use Amazon CodeGuru Profiler to gain insights into runtime performance o ## Supported runtimes -You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python 3\.8, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. +You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python3\.8, Python3\.9, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. + For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. + For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. @@ -20,7 +20,7 @@ This section describes how to activate CodeGuru Profiler from the Lambda console **To activate CodeGuru Profiler from the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md old mode 100644 new mode 100755 index 015532fb..69ecea60 --- a/doc_source/monitoring-functions-access-metrics.md +++ b/doc_source/monitoring-functions-access-metrics.md @@ -1,6 +1,6 @@ -# Monitoring functions in the AWS Lambda console +# Monitoring functions on the Lambda console -AWS Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. +Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. This page describes the basics of using the Lambda console to view function metrics, including total requests, duration, and error rates\. @@ -10,15 +10,15 @@ CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatc ## Using the Lambda console -You can use the Lambda console's monitoring dashboard to monitor your Lambda functions and applications\. +You can monitor your Lambda functions and applications on the Lambda console\. **To monitor a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. ## Types of monitoring graphs @@ -26,9 +26,9 @@ The following section describes the monitoring graphs on the Lambda console\. **Lambda monitoring graphs** + **Invocations** – The number of times that the function was invoked\. -+ **Duration** – The average, minimum, and maximum execution times\. -+ **Error count and success rate \(%\)** – The number of errors and the percentage of executions that completed without error\. -+ **Throttles** – The number of times that execution failed due to concurrency limits\. ++ **Duration** – The average, minimum, and maximum amount of time your function code spends processing an event\. ++ **Error count and success rate \(%\)** – The number of errors and the percentage of invocations that completed without error\. ++ **Throttles** – The number of times that an invocation failed due to concurrency limits\. + **IteratorAge** – For stream event sources, the age of the last item in the batch when Lambda received it and invoked the function\. + **Async delivery failures** – The number of errors that occurred when Lambda attempted to write to a destination or dead\-letter queue\. + **Concurrent executions** – The number of function instances that are processing events\. @@ -39,29 +39,29 @@ The following section describes how to view CloudWatch monitoring graphs on the **To view monitoring graphs for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. -1. Choose from the predefined time ranges, or choose a custom time range\. +1. On the **Metrics**, **Logs**, or **Traces** tab, choose from the predefined time ranges, or choose a custom time range\. -1. To see the definition of a graph in CloudWatch, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard in CloudWatch\. +1. To see the definition of a graph in CloudWatch, choose the three vertical dots \(**Widget actions**\), and then choose **View in metrics** to open the **Metrics** dashboard on the CloudWatch console\. ![\[An example monitoring definition on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-definition.png) -## Viewing queries in the CloudWatch Logs console +## Viewing queries on the CloudWatch Logs console The following section describes how to view and add reports from CloudWatch Logs Insights to a custom dashboard on the CloudWatch Logs console\. **To view reports for a function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Monitoring**\. +1. Choose the **Monitor** tab\. 1. Choose **View logs in CloudWatch**\. @@ -76,5 +76,5 @@ The following section describes how to view and add reports from CloudWatch Logs ![\[The CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) ## What's next? -+ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with AWS Lambda function metrics](monitoring-metrics.md)\. -+ Learn how to use Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file ++ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with Lambda function metrics](monitoring-metrics.md)\. ++ Learn how to use CloudWatch Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md old mode 100644 new mode 100755 index 250d5255..ee06278c --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -35,7 +35,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu **To enable Lambda Insights in the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md old mode 100644 new mode 100755 index d0d94b1a..9a953755 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,20 +1,20 @@ -# Working with AWS Lambda function metrics +# Working with Lambda function metrics -When your function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics in the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. +When your Lambda function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics on the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. **Topics** -+ [Viewing metrics in the CloudWatch console](#monitoring-metrics-console) ++ [Viewing metrics on the CloudWatch console](#monitoring-metrics-console) + [Types of metrics](#monitoring-metrics-types) -## Viewing metrics in the CloudWatch console +## Viewing metrics on the CloudWatch console You can use the CloudWatch console to filter and sort function metrics by function name, alias, or version\. -**To view metrics in the CloudWatch console** +**To view metrics on the CloudWatch console** -1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) on the CloudWatch console\. +1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) of the CloudWatch console\. 1. Choose a dimension\. + **By Function Name** \(`FunctionName`\) – View aggregate metrics for all versions and aliases of a function\. @@ -27,28 +27,28 @@ You can use the CloudWatch console to filter and sort function metrics by functi By default, graphs use the `Sum` statistic for all metrics\. To choose a different statistic and customize the graph, use the options on the **Graphed metrics** tab\. **Note** -The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the execution, this can be several minutes before the metric is emitted\. If, for example, your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. +The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the invocation, this can be several minutes before the metric is emitted\. For example, if your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. ## Types of metrics -The following section describes the type of metrics available on the CloudWatch console\. +The following section describes the types of metrics available on the CloudWatch console\. ### Using invocation metrics -Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of one minute\. +Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of 1 minute\. -You should view the following metrics with the `Sum` statistic\. +View the following metrics with the `Sum` statistic\. **Invocation metrics** -+ `Invocations` – The number of times your function code is executed, including successful executions and executions that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise resulted in an invocation error\. This equals the number of requests billed\. -+ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions thrown by your code and exceptions thrown by the Lambda runtime\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. -+ `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `DestinationDeliveryFailures` – For asynchronous invocation, the number of times Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with `TooManyRequestsException`\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. -+ `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on [provisioned concurrency](configuration-concurrency.md)\. -+ `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. ++ `Invocations` – The number of times that your function code is invoked, including successful invocations and invocations that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise results in an invocation error\. This equals the number of requests billed\. ++ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions that your code throws and exceptions that the Lambda runtime throws\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. ++ `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times that Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. ++ `DestinationDeliveryFailures` – For asynchronous invocation, the number of times that Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. ++ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with a `TooManyRequestsException` error\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. ++ `ProvisionedConcurrencyInvocations` – The number of times that your function code is invoked on [provisioned concurrency](configuration-concurrency.md)\. ++ `ProvisionedConcurrencySpilloverInvocations` – The number of times that your function code is invoked on standard concurrency when all provisioned concurrency is in use\. ### Using performance metrics @@ -57,16 +57,17 @@ Performance metrics provide performance details about a single invocation\. For **Performance metrics** + `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. + `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. -+ `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when the stream receives the record and when the event source mapping sends the event to the function\. ++ `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when a stream receives the record and when the event source mapping sends the event to the function\. ++ `OffsetLag` – For self\-managed Apache Kafka and Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event sources, the difference in offset between the last record written to a topic and the last record that your Lambda function processed\. Though a Kafka topic can have multiple partitions, this metric measures the offset lag at the topic level\. -`Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the P95 statistic shows the maximum duration of 95 percent of executions, excluding the slowest 5 percent\. +`Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the p95 statistic shows the maximum duration of 95 percent of invocations, excluding the slowest 5 percent\. ### Using concurrency metrics Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. **Concurrency metrics** -+ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, additional invocation requests are throttled\. ++ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, Lambda throttles additional invocation requests\. + `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on [provisioned concurrency](configuration-concurrency.md)\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. + `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, `.5` indicates that 50 percent of allocated provisioned concurrency is in use\. -+ `UnreservedConcurrentExecutions` – For an AWS Region, the number of events that are being processed by functions that don't have reserved concurrency\. \ No newline at end of file ++ `UnreservedConcurrentExecutions` – For a Region, the number of events that functions without reserved concurrency are processing\. \ No newline at end of file diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md old mode 100644 new mode 100755 index efa356d5..a757edae --- a/doc_source/monitoring-servicemap.md +++ b/doc_source/monitoring-servicemap.md @@ -20,7 +20,7 @@ AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray **To enable AWS X\-Ray on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose your function\. @@ -52,7 +52,7 @@ You can choose a node to see detailed insights about the correlated metrics, log **To view service map and traces using the CloudWatch console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md old mode 100644 new mode 100755 diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md old mode 100644 new mode 100755 index 3a33a915..e1545e48 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -64,7 +64,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -97,7 +97,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md old mode 100644 new mode 100755 index 541044fd..24bba014 --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -62,6 +62,14 @@ exports.handler = async function(event) { } ``` +### Using Node\.js modules and top\-level await + +You can designate your function code as an ES module, allowing you to use `await` at the top level of the file, outside the scope of your function handler\. This guarantees completion of asynchronous initialization code prior to handler invocations, maximizing the effectiveness of [provisioned concurrency](provisioned-concurrency.md) in reducing cold start latency\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. + +In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. + +For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. + ## Non\-async handlers The following example function checks a URL and returns the status code to the invoker\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md old mode 100644 new mode 100755 index f6ed4c67..48ce65af --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -36,6 +36,7 @@ AWS provides the following base images for Node\.js: | --- | --- | --- | --- | | 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | +| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | Docker Hub repository: amazon/aws\-lambda\-nodejs @@ -61,4 +62,4 @@ You can also download the [Node\.js runtime interface client](https://github.com ## Deploy the container image -For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. +For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md old mode 100644 new mode 100755 index d3e16881..41bb4637 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,7 +129,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md old mode 100644 new mode 100755 diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md old mode 100644 new mode 100755 index 5ee8eef0..65896465 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/permissions-boundary.md b/doc_source/permissions-boundary.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-context.md b/doc_source/powershell-context.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md old mode 100644 new mode 100755 diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md old mode 100644 new mode 100755 index 09ee08eb..00fb56d4 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -88,7 +88,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -121,7 +121,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md old mode 100644 new mode 100755 index 8b640b5a..819a900c --- a/doc_source/powershell-handler.md +++ b/doc_source/powershell-handler.md @@ -17,7 +17,7 @@ This script returns the FunctionName property that's obtained from the $LambdaCo **Note** You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [ AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. +When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. ## Returning data diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md old mode 100644 new mode 100755 index 9043989d..f2bb52f6 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,7 +139,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md old mode 100644 new mode 100755 diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md old mode 100644 new mode 100755 index 280429ed..da53abaf --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -33,7 +33,7 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd **To allocate provisioned concurrency for an alias or version** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -105,7 +105,7 @@ Lambda emits the following metrics for provisioned concurrency: + `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. + `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, \.5 indicates that 50 percent of allocated provisioned concurrency is in use\. -For more details, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +For more details, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Optimizing latency with provisioned concurrency diff --git a/doc_source/python-context.md b/doc_source/python-context.md old mode 100644 new mode 100755 diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md old mode 100644 new mode 100755 index 883eff54..7793b3eb --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -43,7 +43,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -76,7 +76,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md old mode 100644 new mode 100755 index f566411b..a8a3bc70 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -114,7 +114,7 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-image.md b/doc_source/python-image.md old mode 100644 new mode 100755 index 55bfb071..6709b05d --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -8,7 +8,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md old mode 100644 new mode 100755 index fdf6f8c0..5fba3a46 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -121,7 +121,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/python-package.md b/doc_source/python-package.md old mode 100644 new mode 100755 index 513209a5..cd9c70dd --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -60,7 +60,7 @@ Create the \.zip file for your deployment package\. cd my-math-function ``` -1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/boto_client_examples/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: +1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: ``` my-math-function$ @@ -101,12 +101,10 @@ Create the \.zip file for your deployment package\. ``` import requests - def main(event, context): + def lambda_handler(event, context): response = requests.get("https://www.test.com/") print(response.text) return response.text - if __name__ == "__main__": - main('', '') ``` Your directory structure should look like this: diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md old mode 100644 new mode 100755 index d83fb5a0..7b1a6c85 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -13,7 +13,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/ruby-context.md b/doc_source/ruby-context.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md old mode 100644 new mode 100755 index b17df846..345344ea --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -65,7 +65,7 @@ You can invoke your function on the Lambda console by configuring a test event a **To invoke a function on the Lambda console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the function to test, and choose **Test**\. @@ -98,7 +98,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md old mode 100644 new mode 100755 index b205730c..d42ca1e3 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -5,7 +5,7 @@ You can deploy your Lambda function code as a [container image](images-create.md These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - For runtimes that use the Amazon Linux 2 operating system, AWS provides base images for x86\_64 architecture and arm64 architecture\. + AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md old mode 100644 new mode 100755 index 9a31503b..9a57855a --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ``` #!/bin/bash diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md old mode 100644 new mode 100755 diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md old mode 100644 new mode 100755 index e1da11a2..0ea13d40 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -10,7 +10,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md old mode 100644 new mode 100755 index 7fe3e7f4..201e3cf2 --- a/doc_source/runtime-support-policy.md +++ b/doc_source/runtime-support-policy.md @@ -18,10 +18,10 @@ In the table below, each of the phases starts at midnight \(Pacific time zone\) | Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Oct 26, 2021 | Nov 30, 2021 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Nov 22, 2021 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Nov 30, 2021 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Nov 30, 2021 | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Jan 5, 2022 | Feb 14, 2022 | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Feb 14, 2022 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Feb 14, 2022 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Feb 14, 2022 | | Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | | Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | | Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-context.md b/doc_source/runtimes-context.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md old mode 100644 new mode 100755 index 21057e3d..94d26b24 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -110,7 +110,7 @@ Here is an example payload: **Note** Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. -To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with Lambda function metrics](monitoring-metrics.md)\. Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md old mode 100644 new mode 100755 diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md old mode 100644 new mode 100755 index c49f6e76..843fb4fc --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -218,7 +218,7 @@ runtime-tutorial$ aws lambda update-function-code --function-name bash-runtime - Invoke the function to verify that it works with the runtime layer\. ``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt +runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out { "StatusCode": 200, "ExecutedVersion": "$LATEST" diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md old mode 100644 new mode 100755 index 792a6905..62588858 --- a/doc_source/samples-blank.md +++ b/doc_source/samples-blank.md @@ -64,7 +64,7 @@ var serialize = function(object) { The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using AWS Lambda with Amazon SQS](with-sqs.md)\. +The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using Lambda with Amazon SQS](with-sqs.md)\. ## Deployment automation with AWS CloudFormation and the AWS CLI diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md old mode 100644 new mode 100755 diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md old mode 100644 new mode 100755 diff --git a/doc_source/security-compliance.md b/doc_source/security-compliance.md old mode 100644 new mode 100755 diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md old mode 100644 new mode 100755 diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md old mode 100644 new mode 100755 diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md old mode 100644 new mode 100755 diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md old mode 100644 new mode 100755 diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_service-with-iam.md b/doc_source/security_iam_service-with-iam.md old mode 100644 new mode 100755 diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md old mode 100644 new mode 100755 diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md old mode 100644 new mode 100755 diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-template.md b/doc_source/services-apigateway-template.md old mode 100644 new mode 100755 diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md old mode 100644 new mode 100755 index 6a4cf921..feb395a0 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -348,7 +348,7 @@ Test the Lambda function manually using the following sample event data\. You ca --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md old mode 100644 new mode 100755 index 3222c7a8..df218f34 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -22,7 +22,7 @@ Resources in your API define one or more methods, such as GET or POST\. Methods **To add a public endpoint to your Lambda function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md old mode 100644 new mode 100755 index 7cbe0277..27d178da --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -43,7 +43,7 @@ EventBridge \(CloudWatch Events\) emits an event every minute, based on the sche Test the function with a sample event provided by the Lambda console\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the **lambda\-canary** function\. @@ -113,7 +113,7 @@ Update the function configuration to cause the function to return an error, whic **To trigger an alarm** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the **lambda\-canary** function\. diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md old mode 100644 new mode 100755 index a59998ed..85e0862f --- a/doc_source/services-cloudwatchevents.md +++ b/doc_source/services-cloudwatchevents.md @@ -58,7 +58,7 @@ You can also create a Lambda function and direct AWS Lambda to invoke it on a re **To configure EventBridge \(CloudWatch Events\) to invoke your function** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function @@ -76,5 +76,4 @@ Each AWS account can have up to 100 unique event sources of the **EventBridge \( **Topics** + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) -+ [AWS SAM template for a EventBridge \(CloudWatch Events\) application](with-scheduledevents-example-use-app-spec.md) + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) \ No newline at end of file diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md old mode 100644 new mode 100755 diff --git a/doc_source/services-codecommit.md b/doc_source/services-codecommit.md old mode 100644 new mode 100755 diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md old mode 100644 new mode 100755 diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md old mode 100644 new mode 100755 diff --git a/doc_source/services-config.md b/doc_source/services-config.md old mode 100644 new mode 100755 diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md old mode 100644 new mode 100755 diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md old mode 100644 new mode 100755 diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md old mode 100644 new mode 100755 diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md old mode 100644 new mode 100755 diff --git a/doc_source/services-kinesisfirehose.md b/doc_source/services-kinesisfirehose.md old mode 100644 new mode 100755 diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md old mode 100644 new mode 100755 diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md old mode 100644 new mode 100755 diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md old mode 100644 new mode 100755 diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md old mode 100644 new mode 100755 index 848b668a..c579ed57 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -55,7 +55,7 @@ Note that you can't reuse an existing Amazon S3 event\-based function for batch In the [resource\-based policy](access-control-resource-based.md) that you create for the Amazon S3 batch job, ensure that you set permission for the job to invoke your Lambda function\. -In the [execution role](lambda-intro-execution-role.md) for the function, set a trust policy for Amazon S3 to assume the role when it runs your function\. +In the execution role for the function, set a [trust policy for Amazon S3 to assume the role when it runs your function](https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-iam-role-policies.html)\. If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md old mode 100644 new mode 100755 diff --git a/doc_source/services-ses.md b/doc_source/services-ses.md old mode 100644 new mode 100755 diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md old mode 100644 new mode 100755 diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md old mode 100644 new mode 100755 index 210cff81..71fe5a4a --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -8,7 +8,7 @@ To trace requests that don't have a tracing header, enable active tracing in you **To enable active tracing** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md old mode 100644 new mode 100755 diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md old mode 100644 new mode 100755 diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md old mode 100644 new mode 100755 index b5bf14db..8ae59be7 --- a/doc_source/troubleshooting-networking.md +++ b/doc_source/troubleshooting-networking.md @@ -1,27 +1,31 @@ # Troubleshoot networking issues in Lambda -By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with VPC resources\. +By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with Amazon Virtual Private Cloud \(Amazon VPC\) resources\. -Network connectivity errors can result from issues in routing configuration, security group rules, role permissions, network address translation, or the availability of resources such as IP addresses or network interfaces\. They may result in a specific error or, if a request can't reach its destination, a timeout\. +Network connectivity errors can result from issues with your VPC's routing configuration, security group rules, AWS Identity and Access Management \(IAM\) role permissions, or network address translation \(NAT\), or from the availability of resources such as IP addresses or network interfaces\. Depending on the issue, you might see a specific error or timeout if a request can't reach its destination\. ## VPC: Function loses internet access or times out -**Issue:** *Function loses internet access after connecting to a VPC* +**Issue:** *Your Lambda function loses internet access after connecting to a VPC\.* **Error:** *Error: connect ETIMEDOUT 176\.32\.98\.189:443* **Error:** *Error: Task timed out after 10\.00 seconds* -When you connect a function to a VPC, all outbound requests go through your VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +**Error:** *ReadTimeoutError: Read timed out\. \(read timeout=15\)* + +When you connect a function to a VPC, all outbound requests go through the VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. + +If some of your TCP connections are timing out, this may be due to packet fragmentation\. Lambda functions cannot handle incoming fragmented TCP requests, since Lambda does not support IP fragmentation for TCP or ICMP\. ## VPC: Function needs access to AWS services without using the internet -**Issue:** *Function needs access to AWS services without using the internet* +**Issue:** *Your Lambda function needs access to AWS services without using the internet\.* -To connect to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample template with VPC endpoints for DynamoDB and Amazon S3, see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. +To connect a function to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample AWS CloudFormation template with VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB \(DynamoDB\), see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. -## VPC: Limit was reached for the function's VPC +## VPC: Elastic network interface limit reached **Error:** *ENILimitReachedException: The elastic network interface limit was reached for the function's VPC\.* -When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. These network interfaces are limited to 250 per VPC, but this limit can be increased\. To request an increase, use the [Support Center console](https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase)\. \ No newline at end of file +When you connect a Lambda function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. The default service quota is 250 network interfaces per VPC\. To request a quota increase, use the [Service Quotas console](https://console.aws.amazon.com/servicequotas/home/services/lambda/quotas/L-9FEE3D26)\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md old mode 100644 new mode 100755 index 845a69f2..a19746ec --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -72,7 +72,7 @@ You add the extension to your function using the same method as you would for an **Add an extension to your function \(console\)** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md old mode 100644 new mode 100755 index a6b1bedb..2071ad2b --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -24,7 +24,7 @@ Lambda is a highly available service\. For more information, see the [AWS Lambda ## When should I use Lambda? -Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. +Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. Lambda is best suited for shorter, event\-driven workloads, since Lambda functions run for up to 15 minutes per invocation\. When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md old mode 100644 new mode 100755 index d8b66f15..205569ac --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -97,7 +97,7 @@ Invoke the function manually using the sample event data\. --payload file://file-path/input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-cloudtrail-create-package.md b/doc_source/with-cloudtrail-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md old mode 100644 new mode 100755 diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md old mode 100644 new mode 100755 index a3d20878..9f23f3e6 --- a/doc_source/with-cloudtrail.md +++ b/doc_source/with-cloudtrail.md @@ -80,6 +80,6 @@ In this scenario, CloudTrail writes access logs to your S3 bucket\. As for AWS L For detailed information about how to configure Amazon S3 as the event source, see [Using AWS Lambda with Amazon S3](with-s3.md)\. **Topics** -+ [Logging AWS Lambda API calls with AWS CloudTrail](logging-using-cloudtrail.md) ++ [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) \ No newline at end of file diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md old mode 100644 new mode 100755 index 68549657..1ddadfdb --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -185,7 +185,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The function returns the string `message` in the response body\. @@ -215,10 +215,12 @@ Create an Amazon DynamoDB table with a stream enabled\. 1. Choose the **lambda\-dynamodb\-stream** table\. -1. Under **Overview**, choose **Manage stream**\. +1. Under **Exports and streams**, choose **DynamoDB stream details**\. 1. Choose **Enable**\. +1. Choose **Enable stream**\. + Write down the stream ARN\. You need this in the next step when you associate the stream with your Lambda function\. For more information on enabling streams, see [Capturing table activity with DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)\. ## Add an event source in AWS Lambda diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md old mode 100644 new mode 100755 index 30a003a7..635f7a30 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -32,7 +32,7 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "INSERT", - "eventSourceARN": eventsourcearn, + "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", "eventSource": "aws:dynamodb" }, { @@ -66,20 +66,21 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "MODIFY", - "eventSourceARN": sourcearn, + "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", "eventSource": "aws:dynamodb" } + ]} ``` Lambda polls shards in your DynamoDB stream for records at a base rate of 4 times per second\. When records are available, Lambda invokes your function and waits for the result\. If processing succeeds, Lambda resumes polling until it receives more records\. -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Execution role permissions](#events-dynamodb-permissions) @@ -101,11 +102,10 @@ Lambda needs the following permissions to manage resources related to your Dynam + [dynamodb:GetRecords](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html) + [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) + [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) -+ [dynamodb:ListShards](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListShards.html) The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. -To send records of failed batches to a queue or topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: +To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) @@ -117,15 +117,15 @@ To configure your function to read from DynamoDB Streams in the Lambda console, **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for DynamoDB event sources\. @@ -138,11 +138,11 @@ Lambda supports the following options for DynamoDB event sources\. + **Trim horizon** – Process all records in the stream\. After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records because it's too old or has exhausted all retries, it sends details about the batch to the queue or topic\. ++ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. -+ **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. ++ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. **Note** @@ -152,14 +152,14 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping APIs -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that is specified by its Amazon Resource Name \(ARN\), with a batch size of 500\. +The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ @@ -256,7 +256,7 @@ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b112 ## Error handling -The event source mapping that reads records from your DynamoDB stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. +The event source mapping that reads records from your DynamoDB stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. @@ -266,7 +266,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -319,7 +319,7 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Time windows @@ -613,7 +613,7 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 100 | Maximum: 1,000 | | BisectBatchOnFunctionError | N | false | | | DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | | Enabled | N | true | | diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md old mode 100644 new mode 100755 index 3d26a22c..8a6a4dc6 --- a/doc_source/with-kafka.md +++ b/doc_source/with-kafka.md @@ -8,9 +8,9 @@ This topic describes how to use Lambda with a self\-managed Kafka cluster\. In A Apache Kafka as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. - +For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. +For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. @@ -51,43 +51,146 @@ Lambda sends the batch of messages in the event parameter when it invokes your L ``` **Topics** -+ [Managing access and permissions](#smaa-permissions) -+ [Kafka authentication](#smaa-authentication) -+ [Network configuration](#services-msk-vpc-config) ++ [Kafka cluster authentication](#smaa-authentication) ++ [Managing API access and permissions](#smaa-permissions) ++ [Authentication and authorization errors](#kafka-permissions-errors) ++ [Network configuration](#services-kafka-vpc-config) + [Adding a Kafka cluster as an event source](#services-smaa-topic-add) + [Using a Kafka cluster as an event source](#kafka-using-cluster) + [Auto scaling of the Kafka event source](#services-kafka-scaling) + [Event source API operations](#kafka-hosting-api-operations) + [Event source mapping errors](#services-event-errors) ++ [Amazon CloudWatch metrics](#services-kafka-metrics) + [Self\-managed Apache Kafka configuration parameters](#services-kafka-parms) -## Managing access and permissions +## Kafka cluster authentication + +Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of these supported authentication methods\. For more information about Kafka security, see the [Security](http://kafka.apache.org/documentation.html#security) section of the Kafka documentation\. + +### VPC access + +If only Kafka users within your VPC access your Kafka brokers, you must configure the Kafka event source for Amazon Virtual Private Cloud \(Amazon VPC\) access\. + +### SASL/SCRAM authentication + +Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. + +Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, Lambda sends credentials as clear text \(unencrypted\) to the server\. -For Lambda to poll your Apache Kafka topic and update other cluster resources, your Lambda function—as well as your AWS Identity and Access Management \(IAM\) users and roles—must have the following permissions\. +For SASL authentication, you store the user name and password as a secret in AWS Secrets Manager\. For more information about using Secrets Manager, see [Tutorial: Create and retrieve a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. + +### Mutual TLS authentication + +Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. + +In self\-managed Apache Kafka, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with your Kafka brokers\. The client certificate must be signed by a CA in the server's trust store\. + +The Kafka cluster sends a server certificate to Lambda to authenticate the Kafka brokers with Lambda\. The server certificate can be a public CA certificate or a private CA/self\-signed certificate\. The public CA certificate must be signed by a certificate authority \(CA\) that's in the Lambda trust store\. For a private CA/self\-signed certificate, you configure the server root CA certificate \(as a secret in Secrets Manager\)\. Lambda uses the root certificate to verify the Kafka brokers\. + +For more information about mTLS, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. + +### Configuring the client certificate secret + +The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. + +**Note** +Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. + +The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: + +``` +-----BEGIN CERTIFICATE----- + +-----END CERTIFICATE----- +``` + +Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. + +The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: + +``` +-----BEGIN PRIVATE KEY----- + +-----END PRIVATE KEY----- +``` + +For an encrypted private key, use the following structure: + +``` +-----BEGIN ENCRYPTED PRIVATE KEY----- + +-----END ENCRYPTED PRIVATE KEY----- +``` + +The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, include the private key password in the secret\. + +``` +{ + "privateKeyPassword": "testpassword", + "certificate": "-----BEGIN CERTIFICATE----- +MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw +... +j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk +cmUuiAii9R0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb +... +rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no +c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== +-----END CERTIFICATE-----", + "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp +... +QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ +zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== +-----END ENCRYPTED PRIVATE KEY-----" +} +``` + +### Configuring the server root CA certificate secret + +You create this secret if your Kafka brokers use TLS encryption with certificates signed by a private CA\. You can use TLS encryption for VPC, SASL/SCRAM, SASL/PLAIN, or mTLS authentication\. + +The server root CA certificate secret requires a field that contains the Kafka broker's root CA certificate in PEM format\. The following example shows the structure of the secret\. + +``` +{ + "certificate": "-----BEGIN CERTIFICATE----- + MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx + EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT + HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs + ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dG... + -----END CERTIFICATE-----" +``` + +## Managing API access and permissions + +In addition to accessing your self\-managed Kafka cluster, your Lambda function needs permissions to perform various API actions\. You add these permissions to the function's [execution role](lambda-intro-execution-role.md)\. If your users need access to any API actions, add the required permissions to the identity policy for the AWS Identity and Access Management \(IAM\) user or role\. ### Required Lambda function permissions -To create and store logs to a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its [execution role](lambda-intro-execution-role.md): +To create and store logs in a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its execution role: + [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) ### Optional Lambda function permissions -Your Lambda function might need these permissions: -+ Describe your AWS Secrets Manager secret -+ Access your AWS Key Management Service \(AWS KMS\) customer managed key -+ Access your Amazon Virtual Private Cloud \(Amazon VPC\) +Your Lambda function might also need permissions to: ++ Describe your Secrets Manager secret\. ++ Access your AWS Key Management Service \(AWS KMS\) customer managed key\. ++ Access your Amazon VPC\. -#### Secrets Manager and AWS KMS permissions +#### Secrets Manager and AWS KMS permissions -If your Apache Kafka users access your Kafka brokers over the internet, you must specify a Secrets Manager secret\. Your Lambda function might need permission to describe your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +Depending on the type of access control that you're configuring for your Kafka brokers, your Lambda function might need permission to access your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's execution role must have the following permissions: + [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) + [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) #### VPC permissions -If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon Virtual Private Cloud \(Amazon VPC\) resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: +If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon VPC resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's execution role must have the following permissions: + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) + [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) @@ -97,40 +200,92 @@ If only users within a VPC can access your self\-managed Apache Kafka cluster, y ### Adding permissions to your execution role -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's execution role\. +To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. + +By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. + +``` +{ + "Version":"2012-10-17", + "Statement":[ + { + "Effect":"Allow", + "Action":[ + "ec2:CreateNetworkInterface", + "ec2:DescribeNetworkInterfaces", + "ec2:DescribeVpcs", + "ec2:DeleteNetworkInterface", + "ec2:DescribeSubnets", + "ec2:DescribeSecurityGroups" + ], + "Resource":"*" + } + ] + } +``` + +For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. -By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an IAM trust policy, and then attach the policy to your execution role\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md) +### Granting users access with an IAM policy -### Adding users to an IAM policy +By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you create or update an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. -By default, IAM users and roles do not have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you might need to create an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. +## Authentication and authorization errors -## Kafka authentication +If any of the permissions required to consume data from the Kafka cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. -Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of the following authentication methods that Lambda supports: -+ VPC +**Topics** ++ [Cluster failed to authorize Lambda](#kafka-authorize-errors) ++ [SASL authentication failed](#kafka-sasl-errors) ++ [Server failed to authenticate Lambda](#kafka-mtls-errors-server) ++ [Lambda failed to authenticate server](#kafka-mtls-errors-lambda) ++ [Provided certificate or private key is invalid](#kafka-key-errors) + +### Cluster failed to authorize Lambda + +For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: ++ DescribeConfigs Cluster ++ Describe Group ++ Read Group ++ Describe Topic ++ Read Topic + +When you create Kafka ACLs with the required `kafka-cluster` permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. + +After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. - If only Kafka users within your VPC access your Kafka brokers, you must configure the event source with VPC access\. -+ SASL/SCRAM +### SASL authentication failed - Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. Because the credentials are encrypted, the connection to the cluster does not need to be encrypted\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. -+ SASL/PLAIN +For SASL/SCRAM or SASL/PLAIN, this error indicates that the provided user name and password aren't valid\. - Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, credentials are sent as clear text \(unencrypted\) to the server\. Because the credentials are clear text, the connection to the server must use TLS encryption\. +### Server failed to authenticate Lambda -For SASL authentication, you must store the user name and password as a secret in Secrets Manager\. For more information, see [Tutorial: Creating and retrieving a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. +This error indicates that the Kafka broker failed to authenticate Lambda\. This can occur for any of the following reasons: ++ You didn't provide a client certificate for mTLS authentication\. ++ You provided a client certificate, but the Kafka brokers aren't configured to use mTLS authentication\. ++ A client certificate isn't trusted by the Kafka brokers\. -## Network configuration +### Lambda failed to authenticate server -If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources\. +This error indicates that Lambda failed to authenticate the Kafka broker\. This can occur for any of the following reasons: ++ The Kafka brokers use self\-signed certificates or a private CA, but didn't provide the server root CA certificate\. ++ The server root CA certificate doesn't match the root CA that signed the broker's certificate\. ++ Hostname validation failed because the broker's certificate doesn't contain the broker's DNS name or IP address as a subject alternative name\. -Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. +### Provided certificate or private key is invalid + +This error indicates that the Kafka consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. + +## Network configuration + +If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If the broker uses authentication, also deploy a VPC endpoint for Secrets Manager\. Alternatively, ensure that the VPC associated with your Kafka cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on all ports for the security group specified as your event source\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. +Configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. ++ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. @@ -142,7 +297,7 @@ This section describes how to create an event source mapping using the Lambda co ### Prerequisites + A self\-managed Apache Kafka cluster\. Lambda supports Apache Kafka version 0\.10\.0\.0 and later\. -+ A Lambda execution role with permission to access the AWS resources that your self\-managed Kafka cluster uses\. ++ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. ### Adding a self\-managed Kafka cluster \(console\) @@ -168,23 +323,36 @@ Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka to 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. -1. Under **Authentication method**, choose the access or authentication protocol of the Kafka brokers in your cluster\. If only users within your VPC access your Kafka brokers, you must configure VPC access\. If users access your Kafka brokers over the internet, you must configure SASL authentication\. - + To configure VPC access, choose the **VPC** for your Kafka cluster, then choose **VPC subnets** and **VPC security groups**\. - + To configure SASL authentication, under **Secret key**, choose **Add**, then do the following: + 1. \(Optional\) For **VPC**, choose the Amazon VPC for your Kafka cluster\. Then, choose the **VPC subnets** and **VPC security groups**\. + + This setting is required if only users within your VPC access your brokers\. - 1. Choose the key type\. If your Kafka broker uses SASL plaintext, choose **BASIC\_AUTH**\. Otherwise, choose one of the **SASL\_SCRAM** options\. + - 1. Choose the name of the Secrets Manager secret key that contains the credentials for your Kafka cluster\. + 1. \(Optional\) For **Authentication**, choose **Add**, and then do the following: + + 1. Choose the access or authentication protocol of the Kafka brokers in your cluster\. + + If your Kafka broker uses SASL plaintext authentication, choose **BASIC\_AUTH**\. + + If your broker uses SASL/SCRAM authentication, choose one of the **SASL\_SCRAM** protocols\. + + If you're configuring mTLS authentication, choose the **CLIENT\_CERTIFICATE\_TLS\_AUTH** protocol\. + + 1. For SASL/SCRAM or mTLS authentication, choose the Secrets Manager secret key that contains the credentials for your Kafka cluster\. + + 1. \(Optional\) For **Encryption**, choose the Secrets Manager secret containing the root CA certificate that your Kafka brokers use for TLS encryption, if your Kafka brokers use certificates signed by a private CA\. + + This setting applies to TLS encryption for SASL/SCRAM or SASL/PLAIN, and to mTLS authentication\. + + 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. 1. To create the trigger, choose **Add**\. -### Adding a self\-managed Kafka cluster \(AWS CLI\) +### Adding a self\-managed Kafka cluster \(AWS CLI\) Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. -#### Using SASL/SCRAM +#### Using SASL/SCRAM -If Kafka users access your Kafka brokers over the internet, you must specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. +If Kafka users access your Kafka brokers over the internet, specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. ``` aws lambda create-event-source-mapping --topics AWSKafkaTopic @@ -195,7 +363,7 @@ aws lambda create-event-source-mapping --topics AWSKafkaTopic For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. -#### Using a VPC +#### Using a VPC If only Kafka users within your VPC access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. @@ -212,7 +380,7 @@ aws lambda create-event-source-mapping For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. -#### Viewing the status using the AWS CLI +#### Viewing the status using the AWS CLI The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. @@ -225,21 +393,21 @@ aws lambda get-event-source-mapping When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. -Lambda reads event data from the Kafka topics that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `Topics` based on the starting position that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) `StartingPosition`\. After successful processing, your Kafka topic is committed to your Kafka cluster\. +Lambda reads event data from the Kafka topics that you specify as `Topics` in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, based on the `StartingPosition` that you specify\. After successful processing, your Kafka topic is committed to your Kafka cluster\. -If you specify `LATEST` as the starting position, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda does not read any messages produced during this window\. +If you specify the `StartingPosition` as `LATEST`, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda doesn't read any messages produced during this window\. -Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your Lambda function\. When more records are available, Lambda continues processing records in batches, based on the value that you specify in [CreateEventSourceMapping](API_CreateEventSourceMapping.md) >`BatchSize`, until the function catches up with the topic\. +Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your function\. When more records are available, Lambda continues processing records in batches, based on the `BatchSize` value that you specify in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, until your function catches up with the topic\. -If your Lambda function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -The maximum amount of time that Lambda lets a function run before stopping it is 14 minutes\. +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. ## Auto scaling of the Kafka event source -When you initially create an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. +When you initially create an an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. +In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. @@ -249,7 +417,7 @@ To monitor the throughput of your Kafka topic, you can view the Apache Kafka con When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -263,20 +431,26 @@ When you add your Apache Kafka cluster as an [event source](invocation-eventsour To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: **`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. +The event source mapping configuration isn't valid\. **`EVENT_SOURCE_AUTHN_ERROR`** -Lambda could not authenticate the event source\. +Lambda couldn't authenticate the event source\. **`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda does not have the required permissions to access the event source\. +Lambda doesn't have the required permissions to access the event source\. **`FUNCTION_CONFIG_NOT_VALID`** -The function configuration is not valid\. +The function configuration isn't valid\. **Note** If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. +## Amazon CloudWatch metrics + +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. + +An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + ## Self\-managed Apache Kafka configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-kinesis-example-use-app-spec.md b/doc_source/with-kinesis-example-use-app-spec.md old mode 100644 new mode 100755 diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md old mode 100644 new mode 100755 index 247b3ac0..269b3479 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -122,7 +122,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The response is saved to `out.txt`\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md old mode 100644 new mode 100755 index d60e978d..139150a5 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -53,13 +53,13 @@ Lambda reads records from the data stream and invokes your function [synchronous } ``` -By default, Lambda invokes your function as soon as records are available in the stream\. If the batch that Lambda reads from the stream only has one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a *batch window*\. Before invoking the function, Lambda continues to read records from the stream until it has gathered a full batch, or until the batch window expires\. +By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when `ParallelizationFactor` is set to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. +Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. **Topics** + [Configuring your data stream and function](#services-kinesis-configure) @@ -118,7 +118,7 @@ Lambda needs the following permissions to manage resources that are related to y The `AWSLambdaKinesisExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. -To send records of failed batches to a queue or topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: +To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) + **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) @@ -130,15 +130,15 @@ To configure your function to read from Kinesis in the Lambda console, create a **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Kinesis event sources\. @@ -153,11 +153,11 @@ Lambda supports the following options for Kinesis event sources\. + **At timestamp** – Process records starting from a specific time\. After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records because it's too old or has exhausted all retries, it sends details about the batch to the queue or topic\. ++ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. + **Split batch on error** – When the function returns an error, split the batch into two before retrying\. -+ **Concurrent batches per shard** – Process multiple batches from the same shard concurrently\. ++ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. **Note** @@ -167,7 +167,7 @@ To manage the event source configuration later, choose the trigger in the design ## Event source mapping API -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -274,7 +274,7 @@ aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b112 ## Error handling -The event source mapping that reads records from your Kinesis stream invokes your function synchronously and retries on errors\. If the function is throttled or the Lambda service returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. +The event source mapping that reads records from your Kinesis stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. @@ -284,7 +284,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. **To configure a destination for failed\-event records** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. @@ -302,7 +302,7 @@ To retain a record of discarded batches, configure a failed\-event destination\. The following example shows an invocation record for a Kinesis stream\. -**Example invocation Record** +**Example invocation record** ``` { @@ -337,7 +337,7 @@ You can use this information to retrieve the affected records from the stream fo Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with AWS Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Time windows diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md old mode 100644 new mode 100755 index d9414499..b3fa1075 --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -34,10 +34,12 @@ By default, Amazon MQ has a weekly maintenance window for brokers\. During that To interact with Amazon MQ, Lambda creates a consumer group which can read from your Amazon MQ brokers\. The consumer group is created with the same ID as the event source mapping UUID\. -Lambda will pull messages until it has processed a maximum of 6 MB, until timeout, or until the batch size is fulfilled\. When configured, batch size determines the maximum number of items to retrieve in a single batch\. Your batch is converted into a Lambda payload, and your target function is invoked\. Messages are neither persisted nor deserialized\. Instead, they are retrieved by the consumer group as a BLOB of bytes and are base64\-encoded for a JSON payload\. +For Amazon MQ event sources, Lambda batches records together and sends them to your function in a single payload\. To control behavior, you can configure the batching window and batch size\. Lambda pulls messages until it processes the payload size maximum of 6 MB, the batching window expires, or the number of records reaches the full batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. + +Lambda converts your batch into a single payload, and then invokes your function\. Messages are neither persisted nor deserialized\. Instead, the consumer group retrieves them as a BLOB of bytes, and then base64\-encodes them into a JSON payload\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. **Note** -The maximum function invocation time is 14 minutes\. +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. @@ -159,15 +161,15 @@ To configure your function to read from Amazon MQ, create an **MQ** trigger in t **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. 1. Choose a trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Amazon MQ event sources: + **MQ broker** – Select an Amazon MQ broker\. @@ -180,7 +182,7 @@ To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in ## Event source mapping API -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -310,7 +312,7 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 100 | Maximum: 10,000 | | Enabled | N | true | | | FunctionName | Y | | | | Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md old mode 100644 new mode 100755 index 21cbc233..e40d9def --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -1,14 +1,16 @@ # Using Lambda with Amazon MSK -[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Additionally, Amazon MSK supports multiple open\-source versions of Kafka\. +[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Amazon MSK supports multiple open\-source versions of Kafka\. Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) -For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. Also, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs for a complete tutorial\. +For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. -Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function times out or returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. +For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. -For Amazon MSK invocations, Lambda allows the function to run for up to 14 minutes\. Set your function timeout value to 14 minutes or less \(the default timeout value is 3 seconds\)\. +Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. + +Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. @@ -48,37 +50,46 @@ Lambda sends the batch of messages in the event parameter when it invokes your f } ``` +For an example of how to use Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. + **Topics** -+ [Managing access and permissions](#msk-permissions) ++ [MSK cluster authentication](#msk-cluster-permissions) ++ [Managing API access and permissions](#msk-permissions) ++ [Authentication and authorization errors](#msk-permissions-errors) + [Network configuration](#services-msk-vpc-config) + [Adding Amazon MSK as an event source](#services-msk-topic-add) + [Auto scaling of the Amazon MSK event source](#services-msk-ops-scaling) ++ [Amazon CloudWatch metrics](#services-msk-metrics) + [Amazon MSK configuration parameters](#services-msk-parms) -## Managing access and permissions +## MSK cluster authentication -You can use IAM access control to handle both authentication and authorization for your Amazon MSK cluster\. This eliminates the need to use one mechanism for authentication and a different mechanism for authorization\. For example, when a client tries to write to your cluster, Amazon MSK uses IAM to check whether that client is an authenticated identity and also whether it is authorized to produce to your cluster\. +Lambda needs permission to access the Amazon MSK cluster, retrieve records, and perform other tasks\. Amazon MSK supports several options for controlling client access to the MSK cluster\. -As an alternative, you can use SASL/SCRAM to authenticate clients and [Apache Kafka ACLs](https://docs.aws.amazon.com/msk/latest/developerguide/msk-acls.html) to control access\. +**Topics** ++ [Unauthenticated access](#msk-permissions-none) ++ [SASL/SCRAM authentication](#msk-permissions-add-secret) ++ [IAM role\-based authentication](#msk-permissions-iam-policy) ++ [Mutual TLS authentication](#msk-permissions-mTLS) ++ [Configuring the mTLS secret](#smaa-auth-secret) -### Required Lambda function permissions +### Unauthenticated access -Your Lambda function's [execution role](lambda-intro-execution-role.md) must have permission to read records from your Amazon MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +If no clients access the cluster over the internet, you can use unauthenticated access\. + +### SASL/SCRAM authentication -### Additional function permissions for IAM authorization +Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. For Lambda to connect to the cluster, you store the authentication credentials \(user name and password\) in an AWS Secrets Manager secret\. -If you plan to use IAM authorization, you need to add the following additional permissions: +For more information about using Secrets Manager, see [User name and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +Amazon MSK doesn't support SASL/PLAIN authentication\. + +### IAM role\-based authentication + +You can use IAM to authenticate the identity of clients that connect to the MSK cluster\. To create and deploy IAM user or role\-based policies, use the IAM console or API\. For more information, see [IAM access control](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +To allow Lambda to connect to the MSK cluster, read records, and perform other required actions, add the following permissions to your function's [execution role](lambda-intro-execution-role.md)\. ``` { @@ -95,18 +106,110 @@ If you plan to use IAM authorization, you need to add the following additional p "kafka-cluster:DescribeClusterDynamicConfiguration" ], "Resource": [ - "arn:aws:kafka:::cluster//", - "arn:aws:kafka:::topic///", - "arn:aws:kafka:::group///" + "arn:aws:kafka:region:account-id:cluster/cluster-name/cluster-uuid", + "arn:aws:kafka:region:account-id:topic/cluster-name/cluster-uuid/topic-name", + "arn:aws:kafka:region:account-id:group/cluster-name/cluster-uuid/group-name" ] } ] } ``` -You can scope these permissions to a specific cluster, topic and group\. See [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that Lambda uses is equivalent to the event source mapping’s UUID\. +You can scope these permissions to a specific cluster, topic, and group\. For more information, see the [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that IAM uses is equivalent to the event source mapping's UUID\. + +### Mutual TLS authentication + +Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. + +For Amazon MSK, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with the brokers in your MSK cluster\. The client certificate must be signed by a CA in the server's trust store\. The MSK cluster sends a server certificate to Lambda to authenticate the brokers with Lambda\. The server certificate must be signed by a certificate authority \(CA\) that's in the AWS trust store\. + +For instructions on how to generate a client certificate, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. + +Amazon MSK doesn't support self\-signed server certificates, because all brokers in Amazon MSK use [public certificates](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html) signed by [Amazon Trust Services CAs](https://www.amazontrust.com/repository/), which Lambda trusts by default\. + + + +For more information about mTLS for Amazon MSK, see [Mutual TLS Authentication](https://docs.aws.amazon.com/msk/latest/developerguide/msk-authentication.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + +### Configuring the mTLS secret + +The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. + +**Note** +Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. + +The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: + +``` +-----BEGIN CERTIFICATE----- + +-----END CERTIFICATE----- +``` + +Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. + +The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: + +``` +-----BEGIN PRIVATE KEY----- + +-----END PRIVATE KEY----- +``` -### Adding a policy to your execution role +For an encrypted private key, use the following structure: + +``` +-----BEGIN ENCRYPTED PRIVATE KEY----- + +-----END ENCRYPTED PRIVATE KEY----- +``` + +The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, you include the private key password in the secret\. + +``` +{ + "privateKeyPassword": "testpassword", + "certificate": "-----BEGIN CERTIFICATE----- +MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw +... +j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk +cmUuiAii9R0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb +... +rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no +c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== +-----END CERTIFICATE-----", + "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp +... +QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ +zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== +-----END ENCRYPTED PRIVATE KEY-----" +} +``` + +## Managing API access and permissions + +In addition to accessing the Amazon MSK cluster, your function needs permissions to perform various Amazon MSK API actions\. You add these permissions to the function's execution role\. If your users need access to any of the Amazon MSK API actions, add the required permissions to the identity policy for the IAM user or role\. + +### Required Lambda function execution role permissions + +Your Lambda function's [execution role](lambda-intro-execution-role.md) must have the following permissions to access the MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) ++ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) ++ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) ++ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) ++ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) ++ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) ++ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) ++ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) ++ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) ++ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) + +### Adding permissions to your execution role Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. @@ -120,9 +223,9 @@ Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to 1. On the **Attach policy** page, select your execution role from the list, and then choose **Attach policy**\. -### Granting users access with an IAM policy +### Granting users access with an IAM policy -By default, IAM users and roles do not have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you might need an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you can add or update an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ### Using SASL/SCRAM authentication @@ -130,43 +233,63 @@ Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Re Note that Amazon MSK does not support SASL/PLAIN authentication\. -### Authentication and authorization Errors +## Authentication and authorization errors -If any of the required permissions to consume data from the Amazon MSK cluster are missing, Lambda displays an error message in the event source mapping under **LastProcessingResult**\. +If any of the permissions required to consume data from the Amazon MSK cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. -The following error message results from authorization errors\. +**Topics** ++ [Cluster failed to authorize Lambda](#msk-authorize-errors) ++ [SASL authentication failed](#msk-sasl-errors) ++ [Server failed to authenticate Lambda](#msk-mtls-errors) ++ [Provided certificate or private key is invalid](#msk-key-errors) + +### Cluster failed to authorize Lambda -**Example Cluster failed to authorize Lambda** -For SASL/SCRAM, the provided user does not have all of the required Kafka ACL permissions: +For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: + DescribeConfigs Cluster + Describe Group + Read Group + Describe Topic + Read Topic -For IAM access control, the execution role is missing one or more of the permissions required to access the group or topic\. To add the missing permissions to the role, see the example in [Additional function permissions for IAM authorization](#msk-permissions-iam-auth) -When you create either Kafka ACLs or an IAM policy with the required kafka\-cluster permissions listed previously, you must specify the topic and group as resources\. The topic name must match the topic in the event source mapping and the group name must match the event source mapping’s UUID\. -After you add the required permissions to the execution role, there might be a delay of several minutes before the changes take effect\. -The following error message results from authentication failures\. +For IAM access control, your function's execution role is missing one or more of the permissions required to access the group or topic\. Review the list of required permissions in [ IAM role\-based authentication](#msk-permissions-iam-policy)\. + +When you create either Kafka ACLs or an IAM policy with the required Kafka cluster permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. + +After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. + +### SASL authentication failed -**Example SASL authentication failed** -For SASL/SCRAM, this failure indicates that the provided username and password are invalid\. -For IAM access control, the execution role is missing `kafka-cluster:Connect` permissions for the cluster\. Add this permission to the role and specify the cluster ARN as a resource\. -You might see this error intermittently if the cluster rejects connections because it reached the TCP connection limit set by [Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. The last processing result will eventually change to “OK” after Lambda successfully connects to and polls from the cluster\. +For SASL/SCRAM, this error indicates that the provided user name and password aren't valid\. + +For IAM access control, the execution role is missing the `kafka-cluster:Connect` permission for the MSK cluster\. Add this permission to the role and specify the cluster's Amazon Resource Name \(ARN\) as a resource\. + +You might see this error occurring intermittently\. The cluster rejects connections after the number of TCP connections exceeds the [Amazon MSK service quota](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. After Lambda connects to the cluster and polls for records, the last processing result changes to `OK`\. + +### Server failed to authenticate Lambda + +This error indicates that the Amazon MSK Kafka brokers failed to authenticate with Lambda\. This can occur for any of the following reasons: ++ You didn't provide a client certificate for mTLS authentication\. ++ You provided a client certificate, but the brokers aren't configured to use mTLS\. ++ A client certificate isn't trusted by the brokers\. + +### Provided certificate or private key is invalid + +This error indicates that the Amazon MSK consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. ## Network configuration Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. -Alternatively, ensure that the VPC associated with your Amazon MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. +Alternatively, ensure that the VPC associated with your MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -You must configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ if you are using VPC endpoints instead of NAT Gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. +Configure your Amazon VPC security groups with the following rules \(at minimum\): ++ Inbound rules – Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. ++ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. **Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html), and does not need to be configured during setup using the create\-event\-source\-mapping command\. +Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html)\. You don't need to configure it during setup using the create\-event\-source\-mapping command\. For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. @@ -178,7 +301,7 @@ This section describes how to create an event source mapping using the Lambda co ### Prerequisites + An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ A [Lambda execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your Amazon MSK cluster uses\. ++ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. ### Adding an Amazon MSK trigger \(console\) @@ -204,7 +327,7 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - 1. \(Optional\) For **Secret key**, choose the secret key for SASL/SCRAM authentication of the brokers in your Amazon MSK cluster\. If you are using IAM access control, do not choose a secret key\. + 1. \(Optional\) For **Authentication**, choose the secret key for authenticating with the brokers in your MSK cluster\. 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. @@ -239,16 +362,22 @@ aws lambda get-event-source-mapping \ ## Auto scaling of the Amazon MSK event source -When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all of the partitions in the Kafka topic\. Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. +When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. -Every 15 minutes, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. +In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. -To monitor the throughput of your Kafka topic, you can view the [Amazon MSK consumer\-lag metrics](https://docs.aws.amazon.com/msk/latest/developerguide/consumer-lag.html)\. To help you find the metrics for this Lambda function, the value of the consumer group field in the logs is set to the event source UUID\. +To monitor the throughput of your Kafka topic, view the [Offset lag metric](#services-msk-metrics) Lambda emits while your function processes records\. To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. +## Amazon CloudWatch metrics + +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. + +An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + ## Amazon MSK configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MSK\. diff --git a/doc_source/with-on-demand-custom-android.md b/doc_source/with-on-demand-custom-android.md old mode 100644 new mode 100755 diff --git a/doc_source/with-s3-example-use-app-spec.md b/doc_source/with-s3-example-use-app-spec.md old mode 100644 new mode 100755 index 84dc7760..1195cf42 --- a/doc_source/with-s3-example-use-app-spec.md +++ b/doc_source/with-s3-example-use-app-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for an Amazon S3 application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-s3-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md old mode 100644 new mode 100755 index b49efe60..6eb4fcf1 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -46,7 +46,7 @@ Use a [function blueprint](gettingstarted-features.md#gettingstarted-features-bl **To create a Lambda function from a blueprint in the console** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose **Create function**\. @@ -238,14 +238,14 @@ Invoke your function when you upload a file to the Amazon S3 source bucket\. 1. On the **Upload** page, upload a few \.jpg or \.png image files to the bucket\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose the name of your function \(**my\-s3\-function**\)\. 1. To verify that the function ran once for each file that you uploaded, choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. The count in the **Invocations** graph should match the number of files that you uploaded to the Amazon S3 bucket\. ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - For more information on these graphs, see [Monitoring functions in the AWS Lambda console](monitoring-functions-access-metrics.md)\. + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. 1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md old mode 100644 new mode 100755 index 91b550fc..42c9c8bc --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -3,7 +3,7 @@ In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. **Note** -This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. +This tutorial requires a moderate level of AWS and Lambda domain knowledge, Docker operations, and [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: @@ -488,7 +488,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -502,7 +502,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -516,7 +516,7 @@ The sample function must include the sharp module in the deployment package\. --role arn:aws:iam::123456789012:role/lambda-s3-role ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. @@ -586,7 +586,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. --payload file://inputFile.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify that the thumbnail is created in the target S3 bucket\. diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md old mode 100644 new mode 100755 index 29b23cba..0900fa4b --- a/doc_source/with-s3.md +++ b/doc_source/with-s3.md @@ -32,7 +32,7 @@ Amazon S3 invokes your function [asynchronously](invocation-async.md) with an ev "s3SchemaVersion": "1.0", "configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1", "bucket": { - "name": "lambda-artifacts-deafc19498e3f2df", + "name": "DOC-EXAMPLE-BUCKET", "ownerIdentity": { "principalId": "A3I5XTEXAMAI3E" }, diff --git a/doc_source/with-scheduledevents-example-use-app-spec.md b/doc_source/with-scheduledevents-example-use-app-spec.md deleted file mode 100644 index 4cb7c422..00000000 --- a/doc_source/with-scheduledevents-example-use-app-spec.md +++ /dev/null @@ -1,52 +0,0 @@ -# AWS SAM template for a EventBridge \(CloudWatch Events\) application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](services-cloudwatchevents-tutorial.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Parameters: - NotificationEmail: - Type: String -Resources: - CheckWebsitePeriodically: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: LambdaFunctionOverHttps.handler - Runtime: runtime - Policies: AmazonDynamoDBFullAccess - Events: - CheckWebsiteScheduledEvent: - Type: Schedule - Properties: - Schedule: rate(1 minute) - - AlarmTopic: - Type: AWS::SNS::Topic - Properties: - Subscription: - - Protocol: email - Endpoint: !Ref NotificationEmail - - Alarm: - Type: AWS::CloudWatch::Alarm - Properties: - AlarmActions: - - !Ref AlarmTopic - ComparisonOperator: GreaterThanOrEqualToThreshold - Dimensions: - - Name: FunctionName - Value: !Ref CheckWebsitePeriodically - EvaluationPeriods: 1 - MetricName: Errors - Namespace: AWS/Lambda - Period: 60 - Statistic: Sum - Threshold: '1' -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md old mode 100644 new mode 100755 index b005ec46..e5f82e7b --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -24,19 +24,19 @@ On Linux and macOS, use your preferred shell and package manager\. On Windows 10 In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by using two [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html), each configured for use with a different account\. If you use profiles with different names, or the default profile and one named profile, modify the commands as needed\. -## Create an Amazon SNS topic +## Create an Amazon SNS topic \(account A\) -From account A \(01234567891A\), create the source Amazon SNS topic\. +In **Account A**, create the source Amazon SNS topic\. ``` aws sns create-topic --name sns-topic-for-lambda --profile accountA ``` -Note the topic ARN that is returned by the command\. You will need it when you add permissions to the Lambda function to subscribe to the topic\. +After creating the topic, record its Amazon Resource Name \(ARN\)\. You need it later when you add permissions to the Lambda function to subscribe to the topic\. -## Create the execution role +## Create the execution role \(account B\) -From account B \(01234567891B\), create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. +In **Account B**, create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. **To create an execution role** @@ -51,9 +51,9 @@ From account B \(01234567891B\), create the [execution role](lambda-intro-execut The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. -## Create a Lambda function +## Create a Lambda function \(account B\) -From account B \(01234567891B\), create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. +In **Account B**, create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. **Note** For sample code in other languages, see [Sample function code](with-sns-create-package.md)\. @@ -87,27 +87,27 @@ exports.handler = function(event, context, callback) { ``` aws lambda create-function --function-name Function-With-SNS \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::01234567891B:role/service-role/lambda-sns-execution-role \ + --role arn:aws:iam:::role/service-role/lambda-sns-execution-role \ --timeout 60 --profile accountB ``` -Note the function ARN that is returned by the command\. You will need it when you add permissions to allow Amazon SNS to invoke your function\. +After creating the function, record its function ARN\. You need it later when you add permissions to allow Amazon SNS to invoke your function\. -## Set up cross\-account permissions +## Set up cross\-account permissions \(account A and B\) -From account A \(01234567891A\), grant permission to account B \(01234567891B\) to subscribe to the topic: +In **Account A**, grant permission to **Account B** to subscribe to the topic: ``` -aws sns add-permission --label lambda-access --aws-account-id 12345678901B \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +aws sns add-permission --label lambda-access --aws-account-id \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --action-name Subscribe ListSubscriptionsByTopic --profile accountA ``` -From account B \(01234567891B\), add the Lambda permission to allow invocation from Amazon SNS\. +In **Account B**, add the Lambda permission to allow invocation from Amazon SNS\. ``` aws lambda add-permission --function-name Function-With-SNS \ ---source-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--source-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --statement-id function-with-sns --action "lambda:InvokeFunction" \ --principal sns.amazonaws.com --profile accountB ``` @@ -117,9 +117,9 @@ You should see the following output: ``` { "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda\"}}, + \"arn:aws:sns:us-east-2::sns-topic-for-lambda\"}}, \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2:01234567891B:function:Function-With-SNS\", + \"Resource\":\"arn:aws:lambda:us-east-2::function:Function-With-SNS\", \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, \"Sid\":\"function-with-sns1\"}" } @@ -130,14 +130,14 @@ Do not use the `--source-account` parameter to add a source account to the Lambd **Note** If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. -## Create a subscription +## Create a subscription \(account B\) -From account B, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in account A \(01234567891A\), Amazon SNS invokes the `Function-With-SNS` function in account B \(01234567891B\)\. +In **Account B**, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in **Account A**, Amazon SNS invokes the `Function-With-SNS` function in **Account B**\. ``` aws sns subscribe --protocol lambda \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ ---notification-endpoint arn:aws:lambda:us-east-2:12345678901B:function:Function-With-SNS \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ +--notification-endpoint arn:aws:lambda:us-east-2::function:Function-With-SNS \ --profile accountB ``` @@ -145,19 +145,19 @@ You should see the following output: ``` { - "SubscriptionArn": "arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" + "SubscriptionArn": "arn:aws:sns:us-east-2::sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" } ``` The output contains the ARN of the topic subscription\. -## Test subscription +## Test subscription \(account A\) -From account A \(01234567891A\), test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: +In **Account A**, test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: ``` aws sns publish --message file://message.txt --subject Test \ ---topic-arn arn:aws:sns:us-east-2:12345678901A:sns-topic-for-lambda \ +--topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ --profile accountA ``` @@ -169,6 +169,8 @@ To learn more about Amazon SNS, see [What is Amazon Simple Notification Service] You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. +In **Account A**, clean up your Amazon SNS topic\. + **To delete the Amazon SNS topic** 1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. @@ -181,6 +183,8 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Delete**\. +In **Account B**, clean up your execution role, Lambda function, and Amazon SNS subscription\. + **To delete the execution role** 1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md old mode 100644 new mode 100755 diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md old mode 100644 new mode 100755 index f1112160..758947c6 --- a/doc_source/with-sqs-cross-account-example.md +++ b/doc_source/with-sqs-cross-account-example.md @@ -118,7 +118,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs-example-use-app-spec.md b/doc_source/with-sqs-example-use-app-spec.md old mode 100644 new mode 100755 index 1749c182..93a3b751 --- a/doc_source/with-sqs-example-use-app-spec.md +++ b/doc_source/with-sqs-example-use-app-spec.md @@ -1,6 +1,6 @@ # AWS SAM template for an Amazon SQS application -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [ AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. +You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-sqs-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md old mode 100644 new mode 100755 index 1ef0ff70..e610dccd --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -118,7 +118,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [ AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md old mode 100644 new mode 100755 index 50c5db97..31304416 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -1,6 +1,6 @@ -# Using AWS Lambda with Amazon SQS +# Using Lambda with Amazon SQS -You can use an AWS Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. +You can use a Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. @@ -45,7 +45,7 @@ Lambda polls the queue and invokes your Lambda function [synchronously](invocati } ``` -By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to five minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until batch window expires, the [payload limit](gettingstarted-limits.md) is reached or full batch size is reached\. +By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until the batch window expires, the [invocation payload size quota](gettingstarted-limits.md) is reached, or the configured maximum batch size is reached\. **Note** If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function\. This is true even if you set a batch window lower than 20 seconds\. @@ -80,7 +80,7 @@ For FIFO queues, records contain additional attributes that are related to dedup } ``` -When Lambda reads a batch, the messages stay in the queue but become hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. If your function is [throttled](invocation-scaling.md), returns an error, or doesn't respond, the message becomes visible again\. All messages in a failed batch return to the queue, so your function code must be able to process the same message multiple times without side effects\. +When Lambda reads a batch, the messages stay in the queue but are hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. By default, if your function encounters an error while processing a batch, all messages in that batch become visible in the queue again\. For this reason, your function code must be able to process the same message multiple times without unintended side effects\. You can modify this reprocessing behavior by including batch item failures in your function response\. **Topics** + [Scaling and processing](#events-sqs-scaling) @@ -88,6 +88,7 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) + [Event source mapping APIs](#services-dynamodb-api) ++ [Reporting batch item failures](#services-sqs-batchfailurereporting) + [Amazon SQS configuration parameters](#services-sqs-params) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) + [Tutorial: Using a cross\-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) @@ -96,19 +97,19 @@ When Lambda reads a batch, the messages stay in the queue but become hidden for ## Scaling and processing -For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to 5 batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that can be processed simultaneously by an event source mapping is 1000\. +For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to five batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that an event source mapping can process simultaneously is 1,000\. -For FIFO queues, Lambda sends messages to your function in the order that it receives them\. When you send a message to a FIFO queue, you specify a [message group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)\. Amazon SQS ensures that messages in the same group are delivered to Lambda in order\. Lambda sorts the messages into groups and sends only one batch at a time for a group\. If the function returns an error, all retries are attempted on the affected messages before Lambda receives additional messages from the same group\. +For FIFO queues, Lambda sends messages to your function in the order that it receives them\. When you send a message to a FIFO queue, you specify a [message group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)\. Amazon SQS ensures that messages in the same group are delivered to Lambda in order\. Lambda sorts the messages into groups and sends only one batch at a time for a group\. If your function returns an error, the function attempts all retries on the affected messages before Lambda receives additional messages from the same group\. -Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](https://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. +Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](http://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. ## Configuring a queue to use with Lambda -[Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. +[Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least 6 times the [ timeout](https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/timeout.html) that you configure on your function\. The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch\. +To allow your function time to process each batch of records, set the source queue's visibility timeout to at least six times the [timeout that you configure](configuration-function-common.md#configuration-common-summary) on your function\. The extra time allows for Lambda to retry if your function is throttled while processing a previous batch\. -If a message fails to be processed multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. +If your function fails to process a message multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. **Note** Make sure that you configure the dead\-letter queue on the source queue, not on the Lambda function\. The dead\-letter queue that you configure on a function is used for the function's [asynchronous invocation queue](invocation-async.md), not for event source queues\. @@ -117,13 +118,11 @@ If your function returns an error, or can't be invoked because it's at maximum c ## Execution role permissions -Lambda needs the following permissions to manage messages in your Amazon SQS queue\. Add them to your function's execution role\. +Lambda needs the following permissions to manage messages in your Amazon SQS queue\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. + [sqs:ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) + [sqs:DeleteMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html) + [sqs:GetQueueAttributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html) -For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. - ## Configuring a queue as an event source Create an event source mapping to tell Lambda to send items from your queue to a Lambda function\. You can create multiple event source mappings to process items from multiple queues with a single function\. When Lambda invokes the target function, the event can contain multiple items, up to a configurable maximum *batch size*\. @@ -132,42 +131,42 @@ To configure your function to read from Amazon SQS in the Lambda console, create **To create a trigger** -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. 1. Under **Function overview**, choose **Add trigger**\. -1. Choose a trigger type\. +1. Choose the **SQS** trigger type\. -1. Configure the required options and then choose **Add**\. +1. Configure the required options, and then choose **Add**\. Lambda supports the following options for Amazon SQS event sources\. **Event source options** + **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of records to send to the function in each batch\. For a standard queue this can be up to 10,000 records\. For a FIFO queue the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. ++ **Batch size** – The number of records to send to the function in each batch\. For a standard queue, this can be up to 10,000 records\. For a FIFO queue, the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [invocation payload size quota](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. - Metadata is generated by both Lambda and Amazon SQS for each record\. This additional metadata is counted towards the total payload size and may cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields sent by Amazon SQS can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) documentation in the *Amazon Simple Queue Service API Reference*\. -+ **Batch window ** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. Only applicable to standard queues\. + Both Lambda and Amazon SQS generate metadata for each record\. This additional metadata is counted towards the total payload size and can cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields that Amazon SQS sends can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) API operation documentation in the *Amazon Simple Queue Service API Reference*\. ++ **Batch window ** – The maximum amount of time to gather records before invoking the function, in seconds\. This applies only to standard queues\. - If you are using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to 6 times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. + If you're using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to six times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. **Note** -If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, your effective queue visibility timeout will be `(batch window) + (function timeout) + 30s`\. +If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, then your effective queue visibility timeout is `(batch window) + (function timeout) + 30s`\. - Lambda processes up to 5 batches at a time\. This means there are a maximum of 5 workers available to batch and process messages in parallel at any one time\. Each worker will show a distinct Lambda invocation for its current batch of messages\. -+ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. + Lambda processes up to five batches at a time\. This means that there are a maximum of five workers available to batch and process messages in parallel at any one time\. Each worker shows a distinct Lambda invocation for its current batch of messages\. ++ **Enabled** – The status of the event source mapping\. Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** -Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon Simple Queue Service pricing](https://aws.amazon.com/sqs/pricing)\. +Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon SQS pricing](http://aws.amazon.com/sqs/pricing)\. -To manage the event source configuration later, choose the trigger in the designer\. +To manage the event source configuration later, in the Lambda console, choose the **SQS** trigger in the designer\. -Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of 5 concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the [reserved concurrency](configuration-concurrency.md) value to 1000, which is the maximum number of concurrent executions for an Amazon SQS event source\. +Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of five concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the reserved concurrency value to 1,000, which is the maximum number of concurrent executions for an Amazon SQS event source\. ## Event source mapping APIs -To manage an event source with the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: +To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [GetEventSourceMapping](API_GetEventSourceMapping.md) @@ -197,6 +196,86 @@ You should see the following output: } ``` +## Reporting batch item failures + +When your Lambda function encounters an error while processing a batch, all messages in that batch become visible in the queue again by default, including messages that Lambda processed successfully\. As a result, your function can end up processing the same message several times\. + +To avoid reprocessing all messages in a failed batch, you can configure your event source mapping to make only the failed messages visible again\. To do this, when configuring your event source mapping, include the value `ReportBatchItemFailures` in the `FunctionResponseTypes` list\. This lets your function return a partial success, which can help reduce the number of unnecessary retries on records\. + +### Report syntax + +After you include `ReportBatchItemFailures` in your event source mapping configuration, you can return a list of the failed message IDs in your function response\. For example, suppose you have a batch of five messages, with message IDs `id1`, `id2`, `id3`, `id4`, and `id5`\. Your function successfully processes `id1`, `id3`, and `id5`\. To make messages `id2` and `id4` visible again in your queue, your response syntax should look like the following: + +``` +{ + "batchItemFailures": [ + { + "itemIdentifier": "id2" + }, + { + "itemIdentifier": "id4" + } + ] +} +``` + +To return the list of failed message IDs in the batch, you can use a `SQSBatchResponse` class object or create your own custom class\. Here is an example of a response that uses the `SQSBatchResponse` object\. + +``` +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSBatchResponse; + +import java.util.ArrayList; +import java.util.List; + +public class ProcessSQSMessageBatch implements RequestHandler { + @Override + public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) { + + List batchItemFailures = new ArrayList(); + String messageId = ""; + for (SQSEvent.SQSMessage message : sqsEvent.getRecords()) { + try { + //process your message + messageId = message.getMessageId(); + } catch (Exception e) { + //Add failed message identifier to the batchItemFailures list + batchItemFailures.add(new SQSBatchResponse.BatchItemFailure(messageId)); + } + } + return new SQSBatchResponse(batchItemFailures); + } +} +``` + +To use this feature, your function must gracefully handle errors\. Have your function logic catch all exceptions and report the messages that result in failure in `batchItemFailures` in your function response\. If your function throws an exception, the entire batch is considered a complete failure\. + +**Note** +If you're using this feature with a FIFO queue, your function should stop processing messages after the first failure and return all failed and unprocessed messages in `batchItemFailures`\. This helps preserve the ordering of messages in your queue\. + +### Success and failure conditions + +Lambda treats a batch as a complete success if your function returns any of the following: ++ An empty `batchItemFailures` list ++ A null `batchItemFailures` list ++ An empty `EventResponse` ++ A null `EventResponse` + +Lambda treats a batch as a complete failure if your function returns any of the following: ++ An invalid JSON response ++ An empty string `itemIdentifier` ++ A null `itemIdentifier` ++ An `itemIdentifier` with a bad key name ++ An `itemIdentifier` value with a message ID that doesn't exist + +### CloudWatch metrics + +To determine whether your function is correctly reporting batch item failures, you can monitor the `NumberOfMessagesDeleted` and `ApproximateAgeOfOldestMessage` Amazon SQS metrics in Amazon CloudWatch\. ++ `NumberOfMessagesDeleted` tracks the number of messages removed from your queue\. If this drops to 0, this is a sign that your function response is not correctly returning failed messages\. ++ `ApproximateAgeOfOldestMessage` tracks how long the oldest message has stayed in your queue\. A sharp increase in this metric can indicate that your function is not correctly returning failed messages\. + ## Amazon SQS configuration parameters All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon SQS\. @@ -206,8 +285,9 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10000 | +| BatchSize | N | 10 | For standard queues, the maximum is 10,000\. For FIFO queues, the maximum is 10\. | | Enabled | N | true | | -| EventSourceArn | Y | | ARN of the data stream or a stream consumer | +| EventSourceArn | Y | | The ARN of the data stream or a stream consumer | | FunctionName | Y | | | +| FunctionResponseTypes | N | | To let your function report specific failures in a batch, include the value `ReportBatchItemFailures` in `FunctionResponseTypes`\. For more information, see [Reporting batch item failures](#services-sqs-batchfailurereporting)\. | | MaximumBatchingWindowInSeconds | N | 0 | | \ No newline at end of file From ede9859bb3db2dac41c3299f9a8e0711b31e86d6 Mon Sep 17 00:00:00 2001 From: Namit Saxena Date: Mon, 21 Mar 2022 11:21:24 +0530 Subject: [PATCH 156/243] Update with-s3-example.md In the Event JSON (Heading: Test in the console, Point: 2. iv), for the key "arn", the value "example-bucket" was written. Ideally, it should be "my-s3-bucket" because "my-s3-bucket" is the value for the bucket name. Also, in the test event JSON template that is provided in the "Configure test event" menu on lambda function's page, test/key is written as "test%2Fkey". So, updated that as well. --- doc_source/with-s3-example.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md index 6eb4fcf1..098bf115 100755 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -164,7 +164,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. For **Event name**, enter a name for the test event\. For example, **mys3testevent**\. - 1. In the test event JSON, replace the S3 bucket name \(`example-bucket`\) and object key \(`test/key`\) with your bucket name and test file name\. Your test event should look similar to the following: + 1. In the test event JSON, replace the S3 bucket name \(`example-bucket`\) and object key \(`test%2Fkey`\) with your bucket name and test file name (that you uploaded in your bucket)\. Your test event should look similar to the following: ``` { @@ -193,7 +193,7 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. "ownerIdentity": { "principalId": "EXAMPLE" }, - "arn": "arn:aws:s3:::example-bucket" + "arn": "arn:aws:s3:::my-s3-bucket" }, "object": { "key": "HappyFace.jpg", @@ -297,4 +297,4 @@ You can now delete the resources that you created for this tutorial, unless you ## Next steps -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. \ No newline at end of file +Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. From a68cfd0978cdbf540e10851e96ed3b154e93e96a Mon Sep 17 00:00:00 2001 From: RidwaanManuel <13217679+RidwaanManuel@users.noreply.github.com> Date: Mon, 11 Apr 2022 12:55:26 +0200 Subject: [PATCH 157/243] Update configuration-vpc.md adding additional VPC permssions to align it with IAM policy --- doc_source/configuration-vpc.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 8ac162f6..61e86e91 100755 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -38,6 +38,8 @@ Lambda uses your function's permissions to create and manage network interfaces\ + **ec2:CreateNetworkInterface** + **ec2:DescribeNetworkInterfaces** + **ec2:DeleteNetworkInterface** ++ **ec2:AssignPrivateIpAddresses** ++ **ec2:UnassignPrivateIpAddresses** These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. @@ -310,4 +312,4 @@ You can use the following sample AWS CloudFormation templates to create VPC conf + [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. + [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. -To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. \ No newline at end of file +To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. From 9064d7945540572e5be4eab71699da34ec35196e Mon Sep 17 00:00:00 2001 From: Timo Schilling Date: Fri, 20 May 2022 00:11:32 +0200 Subject: [PATCH 158/243] fix json example in services-s3-batch.md --- doc_source/services-s3-batch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md index c579ed57..e2c416f4 100755 --- a/doc_source/services-s3-batch.md +++ b/doc_source/services-s3-batch.md @@ -41,7 +41,7 @@ Your Lambda function must return a JSON object with the fields as shown in the f { "taskId": "dGFza2lkZ29lc2hlcmUK", "resultCode": "Succeeded", - "resultString": "["Alice", "Bob"]" + "resultString": "[\"Alice\", \"Bob\"]" } ] } @@ -65,4 +65,4 @@ If the Lambda function returns a `TemporaryFailure` response code, Amazon S3 ret For more information about Amazon S3 batch operations, see [Performing batch operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops.html) in the *Amazon S3 Developer Guide*\. -For an example of how to use a Lambda function in Amazon S3 batch operations, see [Invoking a Lambda function from Amazon S3 batch operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-invoke-lambda.html) in the *Amazon S3 Developer Guide*\. \ No newline at end of file +For an example of how to use a Lambda function in Amazon S3 batch operations, see [Invoking a Lambda function from Amazon S3 batch operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-invoke-lambda.html) in the *Amazon S3 Developer Guide*\. From c02b3c2523b64df1443e4bab8c8f5ca9a3d4a3f4 Mon Sep 17 00:00:00 2001 From: agaddamu Date: Fri, 3 Jun 2022 11:25:56 -0400 Subject: [PATCH 159/243] Lambda alias exception Updated the relationship between Lambda alias and function version. --- doc_source/configuration-aliases.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md index ba8e9806..5796b543 100755 --- a/doc_source/configuration-aliases.md +++ b/doc_source/configuration-aliases.md @@ -1,6 +1,6 @@ # Lambda function aliases -You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. +You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version with the exception that it can point to two function versions during [traffic shifting](https://aws.amazon.com/about-aws/whats-new/2017/11/aws-lambda-supports-traffic-shifting-and-phased-deployments-with-aws-codedeploy/)\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. **Topics** + [Creating a function alias \(Console\)](#configuration-aliases-config) @@ -158,4 +158,4 @@ When you configure traffic weights between two function versions, there are two For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. + **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. - \ No newline at end of file + From 4c88540480b84a2d2938ba64bca1827791664b66 Mon Sep 17 00:00:00 2001 From: Clay King Date: Fri, 10 Jun 2022 21:27:58 +0000 Subject: [PATCH 160/243] Periodic update - 06/10/2022 --- doc_source/.DS_Store | Bin 6148 -> 0 bytes doc_source/API_AccountLimit.md | 0 doc_source/API_AccountUsage.md | 0 doc_source/API_AddLayerVersionPermission.md | 0 doc_source/API_AddPermission.md | 19 +- doc_source/API_AliasConfiguration.md | 0 doc_source/API_AliasRoutingConfiguration.md | 0 doc_source/API_AllowedPublishers.md | 0 doc_source/API_CodeSigningConfig.md | 0 doc_source/API_CodeSigningPolicies.md | 0 doc_source/API_Concurrency.md | 0 doc_source/API_Cors.md | 57 +++ doc_source/API_CreateAlias.md | 0 doc_source/API_CreateCodeSigningConfig.md | 0 doc_source/API_CreateEventSourceMapping.md | 4 +- doc_source/API_CreateFunction.md | 19 +- doc_source/API_CreateFunctionUrlConfig.md | 144 ++++++++ doc_source/API_DeadLetterConfig.md | 0 doc_source/API_DeleteAlias.md | 0 doc_source/API_DeleteCodeSigningConfig.md | 0 doc_source/API_DeleteEventSourceMapping.md | 2 +- doc_source/API_DeleteFunction.md | 0 .../API_DeleteFunctionCodeSigningConfig.md | 0 doc_source/API_DeleteFunctionConcurrency.md | 0 .../API_DeleteFunctionEventInvokeConfig.md | 0 doc_source/API_DeleteFunctionUrlConfig.md | 75 ++++ doc_source/API_DeleteLayerVersion.md | 0 .../API_DeleteProvisionedConcurrencyConfig.md | 0 doc_source/API_DestinationConfig.md | 0 doc_source/API_Environment.md | 0 doc_source/API_EnvironmentError.md | 0 doc_source/API_EnvironmentResponse.md | 0 doc_source/API_EphemeralStorage.md | 19 + .../API_EventSourceMappingConfiguration.md | 2 +- doc_source/API_FileSystemConfig.md | 0 doc_source/API_Filter.md | 0 doc_source/API_FilterCriteria.md | 0 doc_source/API_FunctionCode.md | 0 doc_source/API_FunctionCodeLocation.md | 0 doc_source/API_FunctionConfiguration.md | 7 +- doc_source/API_FunctionEventInvokeConfig.md | 0 doc_source/API_FunctionUrlConfig.md | 46 +++ doc_source/API_GetAccountSettings.md | 0 doc_source/API_GetAlias.md | 0 doc_source/API_GetCodeSigningConfig.md | 0 doc_source/API_GetEventSourceMapping.md | 2 +- doc_source/API_GetFunction.md | 3 + .../API_GetFunctionCodeSigningConfig.md | 0 doc_source/API_GetFunctionConcurrency.md | 0 doc_source/API_GetFunctionConfiguration.md | 9 +- .../API_GetFunctionEventInvokeConfig.md | 0 doc_source/API_GetFunctionUrlConfig.md | 121 +++++++ doc_source/API_GetLayerVersion.md | 2 +- doc_source/API_GetLayerVersionByArn.md | 2 +- doc_source/API_GetLayerVersionPolicy.md | 0 doc_source/API_GetPolicy.md | 0 .../API_GetProvisionedConcurrencyConfig.md | 0 doc_source/API_ImageConfig.md | 0 doc_source/API_ImageConfigError.md | 0 doc_source/API_ImageConfigResponse.md | 0 doc_source/API_Invoke.md | 0 doc_source/API_InvokeAsync.md | 0 doc_source/API_Layer.md | 0 doc_source/API_LayerVersionContentInput.md | 0 doc_source/API_LayerVersionContentOutput.md | 0 doc_source/API_LayerVersionsListItem.md | 2 +- doc_source/API_LayersListItem.md | 0 doc_source/API_ListAliases.md | 0 doc_source/API_ListCodeSigningConfigs.md | 0 doc_source/API_ListEventSourceMappings.md | 0 .../API_ListFunctionEventInvokeConfigs.md | 0 doc_source/API_ListFunctionUrlConfigs.md | 109 ++++++ doc_source/API_ListFunctions.md | 3 + .../API_ListFunctionsByCodeSigningConfig.md | 0 doc_source/API_ListLayerVersions.md | 2 +- doc_source/API_ListLayers.md | 2 +- .../API_ListProvisionedConcurrencyConfigs.md | 0 doc_source/API_ListTags.md | 0 doc_source/API_ListVersionsByFunction.md | 3 + doc_source/API_OnFailure.md | 0 doc_source/API_OnSuccess.md | 0 doc_source/API_Operations.md | 7 +- ...PI_ProvisionedConcurrencyConfigListItem.md | 0 doc_source/API_PublishLayerVersion.md | 4 +- doc_source/API_PublishVersion.md | 9 +- .../API_PutFunctionCodeSigningConfig.md | 0 doc_source/API_PutFunctionConcurrency.md | 0 .../API_PutFunctionEventInvokeConfig.md | 0 .../API_PutProvisionedConcurrencyConfig.md | 0 doc_source/API_Reference.md | 0 .../API_RemoveLayerVersionPermission.md | 0 doc_source/API_RemovePermission.md | 0 doc_source/API_SelfManagedEventSource.md | 0 doc_source/API_SourceAccessConfiguration.md | 0 doc_source/API_TagResource.md | 0 doc_source/API_TracingConfig.md | 0 doc_source/API_TracingConfigResponse.md | 0 doc_source/API_Types.md | 3 + doc_source/API_UntagResource.md | 0 doc_source/API_UpdateAlias.md | 0 doc_source/API_UpdateCodeSigningConfig.md | 0 doc_source/API_UpdateEventSourceMapping.md | 4 +- doc_source/API_UpdateFunctionCode.md | 9 +- doc_source/API_UpdateFunctionConfiguration.md | 19 +- .../API_UpdateFunctionEventInvokeConfig.md | 0 doc_source/API_UpdateFunctionUrlConfig.md | 149 ++++++++ doc_source/API_VpcConfig.md | 0 doc_source/API_VpcConfigResponse.md | 0 doc_source/access-control-identity-based.md | 2 +- doc_source/access-control-resource-based.md | 54 ++- doc_source/applications-console.md | 0 doc_source/applications-tutorial.md | 2 +- doc_source/applications-usecases.md | 0 doc_source/best-practices.md | 2 +- doc_source/configuration-aliases.md | 0 doc_source/configuration-codesigning.md | 0 doc_source/configuration-concurrency.md | 0 doc_source/configuration-database.md | 0 doc_source/configuration-envvars.md | 4 +- doc_source/configuration-filesystem.md | 0 doc_source/configuration-function-common.md | 25 ++ doc_source/configuration-function-zip.md | 115 +++--- doc_source/configuration-images.md | 259 -------------- doc_source/configuration-layers.md | 8 +- doc_source/configuration-tags.md | 32 +- doc_source/configuration-versions.md | 0 doc_source/configuration-vpc-endpoints.md | 6 +- doc_source/configuration-vpc.md | 7 +- doc_source/csharp-context.md | 0 doc_source/csharp-exceptions.md | 0 doc_source/csharp-handler.md | 0 doc_source/csharp-image.md | 17 +- doc_source/csharp-logging.md | 6 +- doc_source/csharp-package-cli.md | 0 doc_source/csharp-package-toolkit.md | 0 doc_source/csharp-package.md | 0 doc_source/csharp-tracing.md | 8 +- doc_source/deploying-lambda-apps.md | 0 doc_source/extensions-api-partners.md | 27 ++ doc_source/foundation-arch.md | 4 +- doc_source/foundation-console.md | 2 +- doc_source/foundation-networking.md | 0 doc_source/foundation-progmodel.md | 0 doc_source/functions-states.md | 0 doc_source/getting-started-create-function.md | 98 ------ doc_source/getting-started.md | 100 +++++- doc_source/gettingstarted-awscli.md | 2 +- doc_source/gettingstarted-concepts.md | 2 +- doc_source/gettingstarted-features.md | 7 + doc_source/gettingstarted-images.md | 330 +++++++++++------- doc_source/gettingstarted-limits.md | 10 +- doc_source/gettingstarted-package.md | 2 +- doc_source/glossary.md | 0 doc_source/go-image.md | 20 +- doc_source/golang-context.md | 0 doc_source/golang-envvars.md | 0 doc_source/golang-exceptions.md | 0 doc_source/golang-handler.md | 0 doc_source/golang-logging.md | 4 +- doc_source/golang-package.md | 2 +- doc_source/golang-tracing.md | 8 +- doc_source/images-create.md | 88 ++--- doc_source/images-test.md | 0 doc_source/index.md | 58 +-- doc_source/invocation-async.md | 0 doc_source/invocation-eventfiltering.md | 0 doc_source/invocation-eventsourcemapping.md | 4 +- doc_source/invocation-images.md | 0 doc_source/invocation-layers.md | 20 +- doc_source/invocation-retries.md | 0 doc_source/invocation-scaling.md | 0 doc_source/invocation-sync.md | 6 +- doc_source/java-context.md | 0 doc_source/java-exceptions.md | 2 +- doc_source/java-handler.md | 0 doc_source/java-image.md | 16 +- doc_source/java-logging.md | 10 +- doc_source/java-package-eclipse.md | 0 doc_source/java-package.md | 6 +- doc_source/java-samples.md | 0 doc_source/java-tracing.md | 121 ++++--- doc_source/kinesis-tutorial-spec.md | 0 doc_source/lambda-api-permissions-ref.md | 27 +- doc_source/lambda-csharp.md | 3 +- ...a-images.md => lambda-deploy-functions.md} | 20 +- doc_source/lambda-edge.md | 0 doc_source/lambda-foundation.md | 0 doc_source/lambda-functions.md | 2 +- doc_source/lambda-golang.md | 0 doc_source/lambda-intro-execution-role.md | 2 +- doc_source/lambda-invocation.md | 3 +- doc_source/lambda-java.md | 2 +- doc_source/lambda-managing.md | 0 doc_source/lambda-monitoring.md | 0 doc_source/lambda-nodejs.md | 11 +- doc_source/lambda-permissions.md | 0 doc_source/lambda-powershell.md | 1 - doc_source/lambda-python.md | 14 +- doc_source/lambda-releases.md | 10 +- doc_source/lambda-rolling-deployments.md | 0 doc_source/lambda-ruby.md | 3 +- ...ntext.md => lambda-runtime-environment.md} | 17 +- doc_source/lambda-runtimes.md | 89 +++-- doc_source/lambda-samples.md | 0 doc_source/lambda-security.md | 0 doc_source/lambda-services.md | 0 doc_source/lambda-settingup.md | 2 +- doc_source/lambda-stepfunctions.md | 0 doc_source/lambda-troubleshooting.md | 0 doc_source/lambda-typescript.md | 47 +++ doc_source/lambda-urls.md | 20 ++ doc_source/logging-using-cloudtrail.md | 5 + doc_source/monitoring-cloudwatchlogs.md | 0 doc_source/monitoring-code-profiler.md | 0 .../monitoring-functions-access-metrics.md | 0 doc_source/monitoring-insights.md | 0 doc_source/monitoring-metrics.md | 4 +- doc_source/monitoring-servicemap.md | 0 doc_source/nodejs-context.md | 0 doc_source/nodejs-exceptions.md | 0 doc_source/nodejs-handler.md | 2 +- doc_source/nodejs-image.md | 16 +- doc_source/nodejs-logging.md | 4 +- doc_source/nodejs-package.md | 0 doc_source/nodejs-tracing.md | 10 +- doc_source/permissions-boundary.md | 0 doc_source/powershell-context.md | 0 doc_source/powershell-devenv.md | 0 doc_source/powershell-exceptions.md | 0 doc_source/powershell-handler.md | 0 doc_source/powershell-logging.md | 6 +- doc_source/powershell-package.md | 0 doc_source/provisioned-concurrency.md | 4 +- doc_source/python-context.md | 2 +- doc_source/python-exceptions.md | 2 +- doc_source/python-handler.md | 2 +- doc_source/python-image.md | 14 +- doc_source/python-logging.md | 6 +- doc_source/python-package.md | 4 +- doc_source/python-tracing.md | 12 +- doc_source/ruby-context.md | 0 doc_source/ruby-exceptions.md | 0 doc_source/ruby-handler.md | 2 +- doc_source/ruby-image.md | 16 +- doc_source/ruby-logging.md | 4 +- doc_source/ruby-package.md | 0 doc_source/ruby-tracing.md | 10 +- doc_source/runtime-support-policy.md | 41 --- doc_source/runtimes-api.md | 22 +- doc_source/runtimes-avx2.md | 0 doc_source/runtimes-custom.md | 2 +- doc_source/runtimes-extensions-api.md | 31 +- doc_source/runtimes-images.md | 6 +- doc_source/runtimes-logs-api.md | 4 +- doc_source/runtimes-modify.md | 2 +- doc_source/runtimes-walkthrough.md | 2 +- doc_source/samples-blank.md | 0 doc_source/samples-errorprocessor.md | 0 doc_source/samples-listmanager.md | 0 doc_source/security-compliance.md | 0 doc_source/security-configuration.md | 4 +- doc_source/security-dataprotection.md | 2 +- doc_source/security-iam.md | 0 doc_source/security-infrastructure.md | 0 doc_source/security-resilience.md | 0 .../security_iam_id-based-policy-examples.md | 0 doc_source/security_iam_service-with-iam.md | 0 doc_source/security_iam_troubleshoot.md | 0 doc_source/services-alb.md | 0 doc_source/services-alexa.md | 0 doc_source/services-apigateway-blueprint.md | 0 doc_source/services-apigateway-code.md | 0 doc_source/services-apigateway-template.md | 0 doc_source/services-apigateway-tutorial.md | 2 +- doc_source/services-apigateway.md | 12 +- doc_source/services-cloudformation.md | 0 .../services-cloudwatchevents-expressions.md | 0 .../services-cloudwatchevents-tutorial.md | 2 +- doc_source/services-cloudwatchevents.md | 0 doc_source/services-cloudwatchlogs.md | 0 doc_source/services-codecommit.md | 0 doc_source/services-codepipeline.md | 0 doc_source/services-cognito.md | 0 doc_source/services-config.md | 6 +- doc_source/services-connect.md | 0 doc_source/services-ec2-tutorial.md | 0 doc_source/services-ec2.md | 4 +- doc_source/services-efs.md | 0 doc_source/services-elasticache-tutorial.md | 2 +- doc_source/services-iot.md | 0 doc_source/services-iotevents.md | 0 doc_source/services-kinesisfirehose.md | 0 doc_source/services-lex.md | 0 doc_source/services-rds-tutorial.md | 2 +- doc_source/services-rds.md | 0 doc_source/services-s3-batch.md | 0 doc_source/services-s3-object-lambda.md | 0 doc_source/services-ses.md | 2 +- doc_source/services-stepfunctions.md | 0 doc_source/services-xray.md | 12 +- doc_source/stepfunctions-lc.md | 0 doc_source/stepfunctions-patterns.md | 0 doc_source/testing-functions.md | 98 ++++++ doc_source/troubleshooting-deployment.md | 0 doc_source/troubleshooting-execution.md | 0 doc_source/troubleshooting-images.md | 0 doc_source/troubleshooting-invocation.md | 2 +- doc_source/troubleshooting-networking.md | 0 doc_source/typescript-exceptions.md | 90 +++++ doc_source/typescript-handler.md | 99 ++++++ doc_source/typescript-image.md | 109 ++++++ doc_source/typescript-package.md | 249 +++++++++++++ doc_source/urls-auth.md | 237 +++++++++++++ doc_source/urls-configuration.md | 216 ++++++++++++ doc_source/urls-invocation.md | 203 +++++++++++ doc_source/urls-monitoring.md | 37 ++ doc_source/urls-tutorial.md | 181 ++++++++++ doc_source/using-extensions.md | 23 +- doc_source/welcome.md | 6 +- doc_source/with-android-create-package.md | 0 doc_source/with-android-example.md | 2 +- doc_source/with-cloudtrail-create-package.md | 0 doc_source/with-cloudtrail-example.md | 2 +- doc_source/with-cloudtrail.md | 0 doc_source/with-ddb-create-package.md | 0 doc_source/with-ddb-example.md | 2 +- doc_source/with-ddb.md | 22 +- doc_source/with-kafka.md | 2 +- doc_source/with-kinesis-create-package.md | 0 .../with-kinesis-example-use-app-spec.md | 0 doc_source/with-kinesis-example.md | 2 +- doc_source/with-kinesis.md | 7 +- doc_source/with-mq.md | 6 +- doc_source/with-msk.md | 6 +- doc_source/with-on-demand-custom-android.md | 0 doc_source/with-s3-example-use-app-spec.md | 0 doc_source/with-s3-example.md | 2 +- doc_source/with-s3-tutorial.md | 0 doc_source/with-s3.md | 0 doc_source/with-secrets-manager.md | 0 doc_source/with-sns-create-package.md | 0 doc_source/with-sns-example.md | 2 +- doc_source/with-sns.md | 0 doc_source/with-sqs-create-package.md | 0 doc_source/with-sqs-cross-account-example.md | 2 +- doc_source/with-sqs-example-use-app-spec.md | 0 doc_source/with-sqs-example.md | 2 +- doc_source/with-sqs.md | 0 348 files changed, 3403 insertions(+), 1118 deletions(-) delete mode 100644 doc_source/.DS_Store mode change 100755 => 100644 doc_source/API_AccountLimit.md mode change 100755 => 100644 doc_source/API_AccountUsage.md mode change 100755 => 100644 doc_source/API_AddLayerVersionPermission.md mode change 100755 => 100644 doc_source/API_AddPermission.md mode change 100755 => 100644 doc_source/API_AliasConfiguration.md mode change 100755 => 100644 doc_source/API_AliasRoutingConfiguration.md mode change 100755 => 100644 doc_source/API_AllowedPublishers.md mode change 100755 => 100644 doc_source/API_CodeSigningConfig.md mode change 100755 => 100644 doc_source/API_CodeSigningPolicies.md mode change 100755 => 100644 doc_source/API_Concurrency.md create mode 100644 doc_source/API_Cors.md mode change 100755 => 100644 doc_source/API_CreateAlias.md mode change 100755 => 100644 doc_source/API_CreateCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_CreateEventSourceMapping.md mode change 100755 => 100644 doc_source/API_CreateFunction.md create mode 100644 doc_source/API_CreateFunctionUrlConfig.md mode change 100755 => 100644 doc_source/API_DeadLetterConfig.md mode change 100755 => 100644 doc_source/API_DeleteAlias.md mode change 100755 => 100644 doc_source/API_DeleteCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_DeleteEventSourceMapping.md mode change 100755 => 100644 doc_source/API_DeleteFunction.md mode change 100755 => 100644 doc_source/API_DeleteFunctionCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_DeleteFunctionConcurrency.md mode change 100755 => 100644 doc_source/API_DeleteFunctionEventInvokeConfig.md create mode 100644 doc_source/API_DeleteFunctionUrlConfig.md mode change 100755 => 100644 doc_source/API_DeleteLayerVersion.md mode change 100755 => 100644 doc_source/API_DeleteProvisionedConcurrencyConfig.md mode change 100755 => 100644 doc_source/API_DestinationConfig.md mode change 100755 => 100644 doc_source/API_Environment.md mode change 100755 => 100644 doc_source/API_EnvironmentError.md mode change 100755 => 100644 doc_source/API_EnvironmentResponse.md create mode 100644 doc_source/API_EphemeralStorage.md mode change 100755 => 100644 doc_source/API_EventSourceMappingConfiguration.md mode change 100755 => 100644 doc_source/API_FileSystemConfig.md mode change 100755 => 100644 doc_source/API_Filter.md mode change 100755 => 100644 doc_source/API_FilterCriteria.md mode change 100755 => 100644 doc_source/API_FunctionCode.md mode change 100755 => 100644 doc_source/API_FunctionCodeLocation.md mode change 100755 => 100644 doc_source/API_FunctionConfiguration.md mode change 100755 => 100644 doc_source/API_FunctionEventInvokeConfig.md create mode 100644 doc_source/API_FunctionUrlConfig.md mode change 100755 => 100644 doc_source/API_GetAccountSettings.md mode change 100755 => 100644 doc_source/API_GetAlias.md mode change 100755 => 100644 doc_source/API_GetCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_GetEventSourceMapping.md mode change 100755 => 100644 doc_source/API_GetFunction.md mode change 100755 => 100644 doc_source/API_GetFunctionCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_GetFunctionConcurrency.md mode change 100755 => 100644 doc_source/API_GetFunctionConfiguration.md mode change 100755 => 100644 doc_source/API_GetFunctionEventInvokeConfig.md create mode 100644 doc_source/API_GetFunctionUrlConfig.md mode change 100755 => 100644 doc_source/API_GetLayerVersion.md mode change 100755 => 100644 doc_source/API_GetLayerVersionByArn.md mode change 100755 => 100644 doc_source/API_GetLayerVersionPolicy.md mode change 100755 => 100644 doc_source/API_GetPolicy.md mode change 100755 => 100644 doc_source/API_GetProvisionedConcurrencyConfig.md mode change 100755 => 100644 doc_source/API_ImageConfig.md mode change 100755 => 100644 doc_source/API_ImageConfigError.md mode change 100755 => 100644 doc_source/API_ImageConfigResponse.md mode change 100755 => 100644 doc_source/API_Invoke.md mode change 100755 => 100644 doc_source/API_InvokeAsync.md mode change 100755 => 100644 doc_source/API_Layer.md mode change 100755 => 100644 doc_source/API_LayerVersionContentInput.md mode change 100755 => 100644 doc_source/API_LayerVersionContentOutput.md mode change 100755 => 100644 doc_source/API_LayerVersionsListItem.md mode change 100755 => 100644 doc_source/API_LayersListItem.md mode change 100755 => 100644 doc_source/API_ListAliases.md mode change 100755 => 100644 doc_source/API_ListCodeSigningConfigs.md mode change 100755 => 100644 doc_source/API_ListEventSourceMappings.md mode change 100755 => 100644 doc_source/API_ListFunctionEventInvokeConfigs.md create mode 100644 doc_source/API_ListFunctionUrlConfigs.md mode change 100755 => 100644 doc_source/API_ListFunctions.md mode change 100755 => 100644 doc_source/API_ListFunctionsByCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_ListLayerVersions.md mode change 100755 => 100644 doc_source/API_ListLayers.md mode change 100755 => 100644 doc_source/API_ListProvisionedConcurrencyConfigs.md mode change 100755 => 100644 doc_source/API_ListTags.md mode change 100755 => 100644 doc_source/API_ListVersionsByFunction.md mode change 100755 => 100644 doc_source/API_OnFailure.md mode change 100755 => 100644 doc_source/API_OnSuccess.md mode change 100755 => 100644 doc_source/API_Operations.md mode change 100755 => 100644 doc_source/API_ProvisionedConcurrencyConfigListItem.md mode change 100755 => 100644 doc_source/API_PublishLayerVersion.md mode change 100755 => 100644 doc_source/API_PublishVersion.md mode change 100755 => 100644 doc_source/API_PutFunctionCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_PutFunctionConcurrency.md mode change 100755 => 100644 doc_source/API_PutFunctionEventInvokeConfig.md mode change 100755 => 100644 doc_source/API_PutProvisionedConcurrencyConfig.md mode change 100755 => 100644 doc_source/API_Reference.md mode change 100755 => 100644 doc_source/API_RemoveLayerVersionPermission.md mode change 100755 => 100644 doc_source/API_RemovePermission.md mode change 100755 => 100644 doc_source/API_SelfManagedEventSource.md mode change 100755 => 100644 doc_source/API_SourceAccessConfiguration.md mode change 100755 => 100644 doc_source/API_TagResource.md mode change 100755 => 100644 doc_source/API_TracingConfig.md mode change 100755 => 100644 doc_source/API_TracingConfigResponse.md mode change 100755 => 100644 doc_source/API_Types.md mode change 100755 => 100644 doc_source/API_UntagResource.md mode change 100755 => 100644 doc_source/API_UpdateAlias.md mode change 100755 => 100644 doc_source/API_UpdateCodeSigningConfig.md mode change 100755 => 100644 doc_source/API_UpdateEventSourceMapping.md mode change 100755 => 100644 doc_source/API_UpdateFunctionCode.md mode change 100755 => 100644 doc_source/API_UpdateFunctionConfiguration.md mode change 100755 => 100644 doc_source/API_UpdateFunctionEventInvokeConfig.md create mode 100644 doc_source/API_UpdateFunctionUrlConfig.md mode change 100755 => 100644 doc_source/API_VpcConfig.md mode change 100755 => 100644 doc_source/API_VpcConfigResponse.md mode change 100755 => 100644 doc_source/access-control-identity-based.md mode change 100755 => 100644 doc_source/access-control-resource-based.md mode change 100755 => 100644 doc_source/applications-console.md mode change 100755 => 100644 doc_source/applications-tutorial.md mode change 100755 => 100644 doc_source/applications-usecases.md mode change 100755 => 100644 doc_source/best-practices.md mode change 100755 => 100644 doc_source/configuration-aliases.md mode change 100755 => 100644 doc_source/configuration-codesigning.md mode change 100755 => 100644 doc_source/configuration-concurrency.md mode change 100755 => 100644 doc_source/configuration-database.md mode change 100755 => 100644 doc_source/configuration-envvars.md mode change 100755 => 100644 doc_source/configuration-filesystem.md mode change 100755 => 100644 doc_source/configuration-function-common.md mode change 100755 => 100644 doc_source/configuration-function-zip.md delete mode 100755 doc_source/configuration-images.md mode change 100755 => 100644 doc_source/configuration-layers.md mode change 100755 => 100644 doc_source/configuration-tags.md mode change 100755 => 100644 doc_source/configuration-versions.md mode change 100755 => 100644 doc_source/configuration-vpc-endpoints.md mode change 100755 => 100644 doc_source/configuration-vpc.md mode change 100755 => 100644 doc_source/csharp-context.md mode change 100755 => 100644 doc_source/csharp-exceptions.md mode change 100755 => 100644 doc_source/csharp-handler.md mode change 100755 => 100644 doc_source/csharp-image.md mode change 100755 => 100644 doc_source/csharp-logging.md mode change 100755 => 100644 doc_source/csharp-package-cli.md mode change 100755 => 100644 doc_source/csharp-package-toolkit.md mode change 100755 => 100644 doc_source/csharp-package.md mode change 100755 => 100644 doc_source/csharp-tracing.md mode change 100755 => 100644 doc_source/deploying-lambda-apps.md create mode 100644 doc_source/extensions-api-partners.md mode change 100755 => 100644 doc_source/foundation-arch.md mode change 100755 => 100644 doc_source/foundation-console.md mode change 100755 => 100644 doc_source/foundation-networking.md mode change 100755 => 100644 doc_source/foundation-progmodel.md mode change 100755 => 100644 doc_source/functions-states.md delete mode 100755 doc_source/getting-started-create-function.md mode change 100755 => 100644 doc_source/getting-started.md mode change 100755 => 100644 doc_source/gettingstarted-awscli.md mode change 100755 => 100644 doc_source/gettingstarted-concepts.md mode change 100755 => 100644 doc_source/gettingstarted-features.md mode change 100755 => 100644 doc_source/gettingstarted-images.md mode change 100755 => 100644 doc_source/gettingstarted-limits.md mode change 100755 => 100644 doc_source/gettingstarted-package.md mode change 100755 => 100644 doc_source/glossary.md mode change 100755 => 100644 doc_source/go-image.md mode change 100755 => 100644 doc_source/golang-context.md mode change 100755 => 100644 doc_source/golang-envvars.md mode change 100755 => 100644 doc_source/golang-exceptions.md mode change 100755 => 100644 doc_source/golang-handler.md mode change 100755 => 100644 doc_source/golang-logging.md mode change 100755 => 100644 doc_source/golang-package.md mode change 100755 => 100644 doc_source/golang-tracing.md mode change 100755 => 100644 doc_source/images-create.md mode change 100755 => 100644 doc_source/images-test.md mode change 100755 => 100644 doc_source/index.md mode change 100755 => 100644 doc_source/invocation-async.md mode change 100755 => 100644 doc_source/invocation-eventfiltering.md mode change 100755 => 100644 doc_source/invocation-eventsourcemapping.md mode change 100755 => 100644 doc_source/invocation-images.md mode change 100755 => 100644 doc_source/invocation-layers.md mode change 100755 => 100644 doc_source/invocation-retries.md mode change 100755 => 100644 doc_source/invocation-scaling.md mode change 100755 => 100644 doc_source/invocation-sync.md mode change 100755 => 100644 doc_source/java-context.md mode change 100755 => 100644 doc_source/java-exceptions.md mode change 100755 => 100644 doc_source/java-handler.md mode change 100755 => 100644 doc_source/java-image.md mode change 100755 => 100644 doc_source/java-logging.md mode change 100755 => 100644 doc_source/java-package-eclipse.md mode change 100755 => 100644 doc_source/java-package.md mode change 100755 => 100644 doc_source/java-samples.md mode change 100755 => 100644 doc_source/java-tracing.md mode change 100755 => 100644 doc_source/kinesis-tutorial-spec.md mode change 100755 => 100644 doc_source/lambda-api-permissions-ref.md mode change 100755 => 100644 doc_source/lambda-csharp.md rename doc_source/{lambda-images.md => lambda-deploy-functions.md} (52%) mode change 100755 => 100644 mode change 100755 => 100644 doc_source/lambda-edge.md mode change 100755 => 100644 doc_source/lambda-foundation.md mode change 100755 => 100644 doc_source/lambda-functions.md mode change 100755 => 100644 doc_source/lambda-golang.md mode change 100755 => 100644 doc_source/lambda-intro-execution-role.md mode change 100755 => 100644 doc_source/lambda-invocation.md mode change 100755 => 100644 doc_source/lambda-java.md mode change 100755 => 100644 doc_source/lambda-managing.md mode change 100755 => 100644 doc_source/lambda-monitoring.md mode change 100755 => 100644 doc_source/lambda-nodejs.md mode change 100755 => 100644 doc_source/lambda-permissions.md mode change 100755 => 100644 doc_source/lambda-powershell.md mode change 100755 => 100644 doc_source/lambda-python.md mode change 100755 => 100644 doc_source/lambda-releases.md mode change 100755 => 100644 doc_source/lambda-rolling-deployments.md mode change 100755 => 100644 doc_source/lambda-ruby.md rename doc_source/{runtimes-context.md => lambda-runtime-environment.md} (82%) mode change 100755 => 100644 mode change 100755 => 100644 doc_source/lambda-runtimes.md mode change 100755 => 100644 doc_source/lambda-samples.md mode change 100755 => 100644 doc_source/lambda-security.md mode change 100755 => 100644 doc_source/lambda-services.md mode change 100755 => 100644 doc_source/lambda-settingup.md mode change 100755 => 100644 doc_source/lambda-stepfunctions.md mode change 100755 => 100644 doc_source/lambda-troubleshooting.md create mode 100644 doc_source/lambda-typescript.md create mode 100644 doc_source/lambda-urls.md mode change 100755 => 100644 doc_source/logging-using-cloudtrail.md mode change 100755 => 100644 doc_source/monitoring-cloudwatchlogs.md mode change 100755 => 100644 doc_source/monitoring-code-profiler.md mode change 100755 => 100644 doc_source/monitoring-functions-access-metrics.md mode change 100755 => 100644 doc_source/monitoring-insights.md mode change 100755 => 100644 doc_source/monitoring-metrics.md mode change 100755 => 100644 doc_source/monitoring-servicemap.md mode change 100755 => 100644 doc_source/nodejs-context.md mode change 100755 => 100644 doc_source/nodejs-exceptions.md mode change 100755 => 100644 doc_source/nodejs-handler.md mode change 100755 => 100644 doc_source/nodejs-image.md mode change 100755 => 100644 doc_source/nodejs-logging.md mode change 100755 => 100644 doc_source/nodejs-package.md mode change 100755 => 100644 doc_source/nodejs-tracing.md mode change 100755 => 100644 doc_source/permissions-boundary.md mode change 100755 => 100644 doc_source/powershell-context.md mode change 100755 => 100644 doc_source/powershell-devenv.md mode change 100755 => 100644 doc_source/powershell-exceptions.md mode change 100755 => 100644 doc_source/powershell-handler.md mode change 100755 => 100644 doc_source/powershell-logging.md mode change 100755 => 100644 doc_source/powershell-package.md mode change 100755 => 100644 doc_source/provisioned-concurrency.md mode change 100755 => 100644 doc_source/python-context.md mode change 100755 => 100644 doc_source/python-exceptions.md mode change 100755 => 100644 doc_source/python-handler.md mode change 100755 => 100644 doc_source/python-image.md mode change 100755 => 100644 doc_source/python-logging.md mode change 100755 => 100644 doc_source/python-package.md mode change 100755 => 100644 doc_source/python-tracing.md mode change 100755 => 100644 doc_source/ruby-context.md mode change 100755 => 100644 doc_source/ruby-exceptions.md mode change 100755 => 100644 doc_source/ruby-handler.md mode change 100755 => 100644 doc_source/ruby-image.md mode change 100755 => 100644 doc_source/ruby-logging.md mode change 100755 => 100644 doc_source/ruby-package.md mode change 100755 => 100644 doc_source/ruby-tracing.md delete mode 100755 doc_source/runtime-support-policy.md mode change 100755 => 100644 doc_source/runtimes-api.md mode change 100755 => 100644 doc_source/runtimes-avx2.md mode change 100755 => 100644 doc_source/runtimes-custom.md mode change 100755 => 100644 doc_source/runtimes-extensions-api.md mode change 100755 => 100644 doc_source/runtimes-images.md mode change 100755 => 100644 doc_source/runtimes-logs-api.md mode change 100755 => 100644 doc_source/runtimes-modify.md mode change 100755 => 100644 doc_source/runtimes-walkthrough.md mode change 100755 => 100644 doc_source/samples-blank.md mode change 100755 => 100644 doc_source/samples-errorprocessor.md mode change 100755 => 100644 doc_source/samples-listmanager.md mode change 100755 => 100644 doc_source/security-compliance.md mode change 100755 => 100644 doc_source/security-configuration.md mode change 100755 => 100644 doc_source/security-dataprotection.md mode change 100755 => 100644 doc_source/security-iam.md mode change 100755 => 100644 doc_source/security-infrastructure.md mode change 100755 => 100644 doc_source/security-resilience.md mode change 100755 => 100644 doc_source/security_iam_id-based-policy-examples.md mode change 100755 => 100644 doc_source/security_iam_service-with-iam.md mode change 100755 => 100644 doc_source/security_iam_troubleshoot.md mode change 100755 => 100644 doc_source/services-alb.md mode change 100755 => 100644 doc_source/services-alexa.md mode change 100755 => 100644 doc_source/services-apigateway-blueprint.md mode change 100755 => 100644 doc_source/services-apigateway-code.md mode change 100755 => 100644 doc_source/services-apigateway-template.md mode change 100755 => 100644 doc_source/services-apigateway-tutorial.md mode change 100755 => 100644 doc_source/services-apigateway.md mode change 100755 => 100644 doc_source/services-cloudformation.md mode change 100755 => 100644 doc_source/services-cloudwatchevents-expressions.md mode change 100755 => 100644 doc_source/services-cloudwatchevents-tutorial.md mode change 100755 => 100644 doc_source/services-cloudwatchevents.md mode change 100755 => 100644 doc_source/services-cloudwatchlogs.md mode change 100755 => 100644 doc_source/services-codecommit.md mode change 100755 => 100644 doc_source/services-codepipeline.md mode change 100755 => 100644 doc_source/services-cognito.md mode change 100755 => 100644 doc_source/services-config.md mode change 100755 => 100644 doc_source/services-connect.md mode change 100755 => 100644 doc_source/services-ec2-tutorial.md mode change 100755 => 100644 doc_source/services-ec2.md mode change 100755 => 100644 doc_source/services-efs.md mode change 100755 => 100644 doc_source/services-elasticache-tutorial.md mode change 100755 => 100644 doc_source/services-iot.md mode change 100755 => 100644 doc_source/services-iotevents.md mode change 100755 => 100644 doc_source/services-kinesisfirehose.md mode change 100755 => 100644 doc_source/services-lex.md mode change 100755 => 100644 doc_source/services-rds-tutorial.md mode change 100755 => 100644 doc_source/services-rds.md mode change 100755 => 100644 doc_source/services-s3-batch.md mode change 100755 => 100644 doc_source/services-s3-object-lambda.md mode change 100755 => 100644 doc_source/services-ses.md mode change 100755 => 100644 doc_source/services-stepfunctions.md mode change 100755 => 100644 doc_source/services-xray.md mode change 100755 => 100644 doc_source/stepfunctions-lc.md mode change 100755 => 100644 doc_source/stepfunctions-patterns.md create mode 100644 doc_source/testing-functions.md mode change 100755 => 100644 doc_source/troubleshooting-deployment.md mode change 100755 => 100644 doc_source/troubleshooting-execution.md mode change 100755 => 100644 doc_source/troubleshooting-images.md mode change 100755 => 100644 doc_source/troubleshooting-invocation.md mode change 100755 => 100644 doc_source/troubleshooting-networking.md create mode 100644 doc_source/typescript-exceptions.md create mode 100644 doc_source/typescript-handler.md create mode 100644 doc_source/typescript-image.md create mode 100644 doc_source/typescript-package.md create mode 100644 doc_source/urls-auth.md create mode 100644 doc_source/urls-configuration.md create mode 100644 doc_source/urls-invocation.md create mode 100644 doc_source/urls-monitoring.md create mode 100644 doc_source/urls-tutorial.md mode change 100755 => 100644 doc_source/using-extensions.md mode change 100755 => 100644 doc_source/welcome.md mode change 100755 => 100644 doc_source/with-android-create-package.md mode change 100755 => 100644 doc_source/with-android-example.md mode change 100755 => 100644 doc_source/with-cloudtrail-create-package.md mode change 100755 => 100644 doc_source/with-cloudtrail-example.md mode change 100755 => 100644 doc_source/with-cloudtrail.md mode change 100755 => 100644 doc_source/with-ddb-create-package.md mode change 100755 => 100644 doc_source/with-ddb-example.md mode change 100755 => 100644 doc_source/with-ddb.md mode change 100755 => 100644 doc_source/with-kafka.md mode change 100755 => 100644 doc_source/with-kinesis-create-package.md mode change 100755 => 100644 doc_source/with-kinesis-example-use-app-spec.md mode change 100755 => 100644 doc_source/with-kinesis-example.md mode change 100755 => 100644 doc_source/with-kinesis.md mode change 100755 => 100644 doc_source/with-mq.md mode change 100755 => 100644 doc_source/with-msk.md mode change 100755 => 100644 doc_source/with-on-demand-custom-android.md mode change 100755 => 100644 doc_source/with-s3-example-use-app-spec.md mode change 100755 => 100644 doc_source/with-s3-example.md mode change 100755 => 100644 doc_source/with-s3-tutorial.md mode change 100755 => 100644 doc_source/with-s3.md mode change 100755 => 100644 doc_source/with-secrets-manager.md mode change 100755 => 100644 doc_source/with-sns-create-package.md mode change 100755 => 100644 doc_source/with-sns-example.md mode change 100755 => 100644 doc_source/with-sns.md mode change 100755 => 100644 doc_source/with-sqs-create-package.md mode change 100755 => 100644 doc_source/with-sqs-cross-account-example.md mode change 100755 => 100644 doc_source/with-sqs-example-use-app-spec.md mode change 100755 => 100644 doc_source/with-sqs-example.md mode change 100755 => 100644 doc_source/with-sqs.md diff --git a/doc_source/.DS_Store b/doc_source/.DS_Store deleted file mode 100644 index b69849dd92ef70b78b64791809fd6819225e77c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!AiqG5Pe%KM7{JPcwDdEiU+T;L_rWQMLbs06e}d8SjB7p!_VjP*;z_U z^biD5nSt52natZ|-$Et>z>S`YAus@t&;@%t96m95FW$0VjBFEKSmPWuN)(vkp_Ofc z->87x-9D~(W6$tdzdw%~+~W~*#xIC7R9F_vX_?n`DM#r*EANKmXm6yIE7F<(2u(HplnGX+cmQ{e9^z?v?zu43YY?>z)Au6 zK6tud8nICfpAHV81t9hr4#v6k62kEj(};~C-_V>=iAr^`#c)bz+{e5$Vxy>ZxY&HS zxU-8LiVM4QeIL@{Qbik00aIX8fh~O;Nc}(iy8quK*^?Pu=rTBmzjBzg$Vj8hgWQ1lv0zn2FOo1O&-~+==ODX^W diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md old mode 100755 new mode 100644 diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md old mode 100755 new mode 100644 diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md old mode 100755 new mode 100644 diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md old mode 100755 new mode 100644 index 17759770..be083542 --- a/doc_source/API_AddPermission.md +++ b/doc_source/API_AddPermission.md @@ -1,8 +1,8 @@ # AddPermission -Grants an AWS service or another account 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 to version $LATEST\. +Grants an AWS service, account, or organization 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 to version $LATEST\. -To grant permission to another account, specify the account ID as the `Principal`\. For AWS services, the principal is a domain\-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com`\. For AWS services, you can also specify the ARN of the associated resource as the `SourceArn`\. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function\. +To grant permission to another account, specify the account ID as the `Principal`\. To grant permission to an organization defined in AWS Organizations, specify the organization ID as the `PrincipalOrgID`\. For AWS services, the principal is a domain\-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com`\. For AWS services, you can also specify the ARN of the associated resource as the `SourceArn`\. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function\. This action adds a statement to a resource\-based permissions policy for the function\. For more information about function policies, see [Lambda Function Policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html)\. @@ -15,7 +15,9 @@ Content-type: application/json { "Action": "string", "EventSourceToken": "string", + "FunctionUrlAuthType": "string", "Principal": "string", + "PrincipalOrgID": "string", "RevisionId": "string", "SourceAccount": "string", "SourceArn": "string", @@ -59,6 +61,12 @@ For Alexa Smart Home functions, a token that must be supplied by the invoker\. Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. Pattern: `[a-zA-Z0-9._\-]+` +Required: No + + ** [FunctionUrlAuthType](#API_AddPermission_RequestSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` Required: No ** [Principal](#API_AddPermission_RequestSyntax) ** @@ -67,6 +75,13 @@ Type: String Pattern: `[^\s]+` Required: Yes + ** [PrincipalOrgID](#API_AddPermission_RequestSyntax) ** +The identifier for your organization in AWS Organizations\. Use this to grant permissions to all the AWS accounts under this organization\. +Type: String +Length Constraints: Minimum length of 12\. Maximum length of 34\. +Pattern: `^o-[a-z0-9]{10,32}$` +Required: No + ** [RevisionId](#API_AddPermission_RequestSyntax) ** Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. Type: String diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md old mode 100755 new mode 100644 diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md old mode 100755 new mode 100644 diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md old mode 100755 new mode 100644 diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Cors.md b/doc_source/API_Cors.md new file mode 100644 index 00000000..d291431d --- /dev/null +++ b/doc_source/API_Cors.md @@ -0,0 +1,57 @@ +# Cors + +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your Lambda function URL\. Use CORS to grant access to your function URL from any origin\. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL\. + +## Contents + + ** AllowCredentials ** +Whether to allow cookies or other credentials in requests to your function URL\. The default is `false`\. +Type: Boolean +Required: No + + ** AllowHeaders ** +The HTTP headers that origins can include in requests to your function URL\. For example: `Date`, `Keep-Alive`, `X-Custom-Header`\. +Type: Array of strings +Array Members: Maximum number of 100 items\. +Length Constraints: Maximum length of 1024\. +Pattern: `.*` +Required: No + + ** AllowMethods ** +The HTTP methods that are allowed when calling your function URL\. For example: `GET`, `POST`, `DELETE`, or the wildcard character \(`*`\)\. +Type: Array of strings +Array Members: Maximum number of 6 items\. +Length Constraints: Maximum length of 6\. +Pattern: `.*` +Required: No + + ** AllowOrigins ** +The origins that can access your function URL\. You can list any number of specific origins, separated by a comma\. For example: `https://www.example.com`, `http://localhost:60905`\. +Alternatively, you can grant access to all origins using the wildcard character \(`*`\)\. +Type: Array of strings +Array Members: Maximum number of 100 items\. +Length Constraints: Minimum length of 1\. Maximum length of 253\. +Pattern: `.*` +Required: No + + ** ExposeHeaders ** +The HTTP headers in your function response that you want to expose to origins that call your function URL\. For example: `Date`, `Keep-Alive`, `X-Custom-Header`\. +Type: Array of strings +Array Members: Maximum number of 100 items\. +Length Constraints: Maximum length of 1024\. +Pattern: `.*` +Required: No + + ** MaxAge ** +The maximum amount of time, in seconds, that web browsers can cache results of a preflight request\. By default, this is set to `0`, which means that the browser doesn't cache results\. +Type: Integer +Valid Range: Minimum value of 0\. Maximum value of 86400\. +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Cors) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Cors) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Cors) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Cors) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md old mode 100755 new mode 100644 diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md old mode 100755 new mode 100644 index e24d8261..5068cc50 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -87,7 +87,7 @@ The request accepts the following data in JSON format\. ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. -+ **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. ++ **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. @@ -309,7 +309,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md old mode 100755 new mode 100644 index ac3dcc1f..28bb37fe --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -43,6 +43,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -118,6 +121,11 @@ Required: No ** [Environment](#API_CreateFunction_RequestSyntax) ** Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object +Required: No + + ** [EphemeralStorage](#API_CreateFunction_RequestSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object Required: No ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** @@ -190,7 +198,7 @@ Required: Yes ** [Runtime](#API_CreateFunction_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Tags](#API_CreateFunction_RequestSyntax) ** @@ -237,6 +245,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -327,6 +338,10 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [EphemeralStorage](#API_CreateFunction_ResponseSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object + ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects @@ -407,7 +422,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_CreateFunction_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** The ARN of the signing job\. diff --git a/doc_source/API_CreateFunctionUrlConfig.md b/doc_source/API_CreateFunctionUrlConfig.md new file mode 100644 index 00000000..53bc5ac9 --- /dev/null +++ b/doc_source/API_CreateFunctionUrlConfig.md @@ -0,0 +1,144 @@ +# CreateFunctionUrlConfig + +Creates a Lambda function URL with the specified configuration parameters\. A function URL is a dedicated HTTP\(S\) endpoint that you can use to invoke your function\. + +## Request Syntax + +``` +POST /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 +Content-type: application/json + +{ + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + } +} +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_CreateFunctionUrlConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `my-function`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. ++ **Partial ARN** \- `123456789012:function:my-function`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** [Qualifier](#API_CreateFunctionUrlConfig_RequestSyntax) ** +The alias name\. +Length Constraints: Minimum length of 1\. Maximum length of 128\. +Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` + +## Request Body + +The request accepts the following data in JSON format\. + + ** [AuthType](#API_CreateFunctionUrlConfig_RequestSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` +Required: Yes + + ** [Cors](#API_CreateFunctionUrlConfig_RequestSyntax) ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object +Required: No + +## Response Syntax + +``` +HTTP/1.1 201 +Content-type: application/json + +{ + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + }, + "CreationTime": "string", + "FunctionArn": "string", + "FunctionUrl": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 201 response\. + +The following data is returned in JSON format by the service\. + + ** [AuthType](#API_CreateFunctionUrlConfig_ResponseSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` + + ** [Cors](#API_CreateFunctionUrlConfig_ResponseSyntax) ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object + + ** [CreationTime](#API_CreateFunctionUrlConfig_ResponseSyntax) ** +When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String + + ** [FunctionArn](#API_CreateFunctionUrlConfig_ResponseSyntax) ** +The Amazon Resource Name \(ARN\) of your function\. +Type: String +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + + ** [FunctionUrl](#API_CreateFunctionUrlConfig_ResponseSyntax) ** +The HTTP URL endpoint for your function\. +Type: String +Length Constraints: Minimum length of 40\. Maximum length of 100\. + +## Errors + + ** InvalidParameterValueException ** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + ** ResourceConflictException ** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + ** ResourceNotFoundException ** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + ** ServiceException ** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + ** TooManyRequestsException ** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunctionUrlConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md old mode 100755 new mode 100644 index ff0a29db..a1d967bf --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -113,7 +113,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteFunctionUrlConfig.md b/doc_source/API_DeleteFunctionUrlConfig.md new file mode 100644 index 00000000..d2a50b44 --- /dev/null +++ b/doc_source/API_DeleteFunctionUrlConfig.md @@ -0,0 +1,75 @@ +# DeleteFunctionUrlConfig + +Deletes a Lambda function URL\. When you delete a function URL, you can't recover it\. Creating a new function URL results in a different URL address\. + +## Request Syntax + +``` +DELETE /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_DeleteFunctionUrlConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `my-function`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. ++ **Partial ARN** \- `123456789012:function:my-function`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** [Qualifier](#API_DeleteFunctionUrlConfig_RequestSyntax) ** +The alias name\. +Length Constraints: Minimum length of 1\. Maximum length of 128\. +Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 204 +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. + +## Errors + + ** ResourceConflictException ** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + ** ResourceNotFoundException ** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + ** ServiceException ** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + ** TooManyRequestsException ** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionUrlConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md old mode 100755 new mode 100644 diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md old mode 100755 new mode 100644 diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md old mode 100755 new mode 100644 diff --git a/doc_source/API_EphemeralStorage.md b/doc_source/API_EphemeralStorage.md new file mode 100644 index 00000000..6bc86bb3 --- /dev/null +++ b/doc_source/API_EphemeralStorage.md @@ -0,0 +1,19 @@ +# EphemeralStorage + +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. + +## Contents + + ** Size ** +The size of the function’s /tmp directory\. +Type: Integer +Valid Range: Minimum value of 512\. Maximum value of 10240\. +Required: Yes + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EphemeralStorage) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EphemeralStorage) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EphemeralStorage) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EphemeralStorage) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md old mode 100755 new mode 100644 index 4cccf1a0..09daed13 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -40,7 +40,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:functi Required: No ** FunctionResponseTypes ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Filter.md b/doc_source/API_Filter.md old mode 100755 new mode 100644 diff --git a/doc_source/API_FilterCriteria.md b/doc_source/API_FilterCriteria.md old mode 100755 new mode 100644 diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md old mode 100755 new mode 100644 diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md old mode 100755 new mode 100644 diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md old mode 100755 new mode 100644 index 4590062b..33b13c87 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -35,6 +35,11 @@ Required: No ** Environment ** The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object +Required: No + + ** EphemeralStorage ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object Required: No ** FileSystemConfigs ** @@ -133,7 +138,7 @@ Required: No ** Runtime ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** SigningJobArn ** diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_FunctionUrlConfig.md b/doc_source/API_FunctionUrlConfig.md new file mode 100644 index 00000000..aa6c9f3a --- /dev/null +++ b/doc_source/API_FunctionUrlConfig.md @@ -0,0 +1,46 @@ +# FunctionUrlConfig + +Details about a Lambda function URL\. + +## Contents + + ** AuthType ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` +Required: Yes + + ** Cors ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object +Required: No + + ** CreationTime ** +When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String +Required: Yes + + ** FunctionArn ** +The Amazon Resource Name \(ARN\) of your function\. +Type: String +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** FunctionUrl ** +The HTTP URL endpoint for your function\. +Type: String +Length Constraints: Minimum length of 40\. Maximum length of 100\. +Required: Yes + + ** LastModifiedTime ** +When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String +Required: Yes + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionUrlConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionUrlConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionUrlConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md old mode 100755 new mode 100644 index 3a417bb2..f3497c58 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -111,7 +111,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md old mode 100755 new mode 100644 index 9c4083a3..be157bf2 --- a/doc_source/API_GetFunction.md +++ b/doc_source/API_GetFunction.md @@ -66,6 +66,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md old mode 100755 new mode 100644 index 05ae9974..c3774fbe --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -58,6 +58,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -148,6 +151,10 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [EphemeralStorage](#API_GetFunctionConfiguration_ResponseSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object + ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects @@ -228,7 +235,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetFunctionUrlConfig.md b/doc_source/API_GetFunctionUrlConfig.md new file mode 100644 index 00000000..cbfcdefb --- /dev/null +++ b/doc_source/API_GetFunctionUrlConfig.md @@ -0,0 +1,121 @@ +# GetFunctionUrlConfig + +Returns details about a Lambda function URL\. + +## Request Syntax + +``` +GET /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_GetFunctionUrlConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `my-function`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. ++ **Partial ARN** \- `123456789012:function:my-function`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** [Qualifier](#API_GetFunctionUrlConfig_RequestSyntax) ** +The alias name\. +Length Constraints: Minimum length of 1\. Maximum length of 128\. +Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + }, + "CreationTime": "string", + "FunctionArn": "string", + "FunctionUrl": "string", + "LastModifiedTime": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [AuthType](#API_GetFunctionUrlConfig_ResponseSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` + + ** [Cors](#API_GetFunctionUrlConfig_ResponseSyntax) ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object + + ** [CreationTime](#API_GetFunctionUrlConfig_ResponseSyntax) ** +When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String + + ** [FunctionArn](#API_GetFunctionUrlConfig_ResponseSyntax) ** +The Amazon Resource Name \(ARN\) of your function\. +Type: String +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + + ** [FunctionUrl](#API_GetFunctionUrlConfig_ResponseSyntax) ** +The HTTP URL endpoint for your function\. +Type: String +Length Constraints: Minimum length of 40\. Maximum length of 100\. + + ** [LastModifiedTime](#API_GetFunctionUrlConfig_ResponseSyntax) ** +When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String + +## Errors + + ** InvalidParameterValueException ** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + ** ResourceNotFoundException ** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + ** ServiceException ** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + ** TooManyRequestsException ** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionUrlConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md old mode 100755 new mode 100644 index 072c87e2..685e82bc --- a/doc_source/API_GetLayerVersion.md +++ b/doc_source/API_GetLayerVersion.md @@ -67,7 +67,7 @@ Valid Values:` x86_64 | arm64` The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md old mode 100755 new mode 100644 index 459cc51f..7f2e0380 --- a/doc_source/API_GetLayerVersionByArn.md +++ b/doc_source/API_GetLayerVersionByArn.md @@ -63,7 +63,7 @@ Valid Values:` x86_64 | arm64` The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md old mode 100755 new mode 100644 diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md old mode 100755 new mode 100644 diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md old mode 100755 new mode 100644 diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md old mode 100755 new mode 100644 diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md old mode 100755 new mode 100644 diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md old mode 100755 new mode 100644 index a1128be9..053e2f44 --- a/doc_source/API_LayerVersionsListItem.md +++ b/doc_source/API_LayerVersionsListItem.md @@ -15,7 +15,7 @@ Required: No The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** CreatedDate ** diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListFunctionUrlConfigs.md b/doc_source/API_ListFunctionUrlConfigs.md new file mode 100644 index 00000000..82f48986 --- /dev/null +++ b/doc_source/API_ListFunctionUrlConfigs.md @@ -0,0 +1,109 @@ +# ListFunctionUrlConfigs + +Returns a list of Lambda function URLs for the specified function\. + +## Request Syntax + +``` +GET /2021-10-31/functions/FunctionName/urls?Marker=Marker&MaxItems=MaxItems HTTP/1.1 +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_ListFunctionUrlConfigs_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `my-function`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. ++ **Partial ARN** \- `123456789012:function:my-function`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** [Marker](#API_ListFunctionUrlConfigs_RequestSyntax) ** +Specify the pagination token that's returned by a previous request to retrieve the next page of results\. + + ** [MaxItems](#API_ListFunctionUrlConfigs_RequestSyntax) ** +The maximum number of function URLs to return in the response\. Note that `ListFunctionUrlConfigs` returns a maximum of 50 items in each response, even if you set the number higher\. +Valid Range: Minimum value of 1\. Maximum value of 50\. + +## Request Body + +The request does not have a request body\. + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "FunctionUrlConfigs": [ + { + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + }, + "CreationTime": "string", + "FunctionArn": "string", + "FunctionUrl": "string", + "LastModifiedTime": "string" + } + ], + "NextMarker": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [FunctionUrlConfigs](#API_ListFunctionUrlConfigs_ResponseSyntax) ** +A list of function URL configurations\. +Type: Array of [FunctionUrlConfig](API_FunctionUrlConfig.md) objects + + ** [NextMarker](#API_ListFunctionUrlConfigs_ResponseSyntax) ** +The pagination token that's included if more results are available\. +Type: String + +## Errors + + ** InvalidParameterValueException ** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + ** ResourceNotFoundException ** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + ** ServiceException ** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + ** TooManyRequestsException ** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionUrlConfigs) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionUrlConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md old mode 100755 new mode 100644 index 507ab5ef..e8c4e4b5 --- a/doc_source/API_ListFunctions.md +++ b/doc_source/API_ListFunctions.md @@ -61,6 +61,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md old mode 100755 new mode 100644 index c5d0bf21..2a6bf434 --- a/doc_source/API_ListLayerVersions.md +++ b/doc_source/API_ListLayerVersions.md @@ -18,7 +18,7 @@ Valid Values:` x86_64 | arm64` ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** The name or Amazon Resource Name \(ARN\) of the layer\. diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md old mode 100755 new mode 100644 index a8379dd6..6f0e9aaa --- a/doc_source/API_ListLayers.md +++ b/doc_source/API_ListLayers.md @@ -18,7 +18,7 @@ Valid Values:` x86_64 | arm64` ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Marker](#API_ListLayers_RequestSyntax) ** A pagination token returned by a previous call\. diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md old mode 100755 new mode 100644 diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md old mode 100755 new mode 100644 index fe5215a2..d428616b --- a/doc_source/API_ListVersionsByFunction.md +++ b/doc_source/API_ListVersionsByFunction.md @@ -61,6 +61,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md old mode 100755 new mode 100644 diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md old mode 100755 new mode 100644 index 70a90b0c..2fa8ad5f --- a/doc_source/API_Operations.md +++ b/doc_source/API_Operations.md @@ -7,6 +7,7 @@ The following actions are supported: + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) ++ [CreateFunctionUrlConfig](API_CreateFunctionUrlConfig.md) + [DeleteAlias](API_DeleteAlias.md) + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) @@ -14,6 +15,7 @@ The following actions are supported: + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) ++ [DeleteFunctionUrlConfig](API_DeleteFunctionUrlConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) @@ -25,6 +27,7 @@ The following actions are supported: + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) ++ [GetFunctionUrlConfig](API_GetFunctionUrlConfig.md) + [GetLayerVersion](API_GetLayerVersion.md) + [GetLayerVersionByArn](API_GetLayerVersionByArn.md) + [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) @@ -38,6 +41,7 @@ The following actions are supported: + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) ++ [ListFunctionUrlConfigs](API_ListFunctionUrlConfigs.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -58,4 +62,5 @@ The following actions are supported: + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) \ No newline at end of file ++ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) ++ [UpdateFunctionUrlConfig](API_UpdateFunctionUrlConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md old mode 100755 new mode 100644 diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md old mode 100755 new mode 100644 index 90016955..2f0a5b46 --- a/doc_source/API_PublishLayerVersion.md +++ b/doc_source/API_PublishLayerVersion.md @@ -49,7 +49,7 @@ Required: No A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Content](#API_PublishLayerVersion_RequestSyntax) ** @@ -113,7 +113,7 @@ Valid Values:` x86_64 | arm64` The layer's compatible runtimes\. Type: Array of strings Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** Details about the layer version\. diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md old mode 100755 new mode 100644 index b7ef43ae..667417fc --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -78,6 +78,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -168,6 +171,10 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [EphemeralStorage](#API_PublishVersion_ResponseSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object + ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects @@ -248,7 +255,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_PublishVersion_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** The ARN of the signing job\. diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md old mode 100755 new mode 100644 diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Reference.md b/doc_source/API_Reference.md old mode 100755 new mode 100644 diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md old mode 100755 new mode 100644 diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md old mode 100755 new mode 100644 diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md old mode 100755 new mode 100644 diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md old mode 100755 new mode 100644 diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md old mode 100755 new mode 100644 diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md old mode 100755 new mode 100644 diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md old mode 100755 new mode 100644 index 9d81625a..416dd819 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -9,11 +9,13 @@ The following data types are supported: + [CodeSigningConfig](API_CodeSigningConfig.md) + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) ++ [Cors](API_Cors.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) + [Environment](API_Environment.md) + [EnvironmentError](API_EnvironmentError.md) + [EnvironmentResponse](API_EnvironmentResponse.md) ++ [EphemeralStorage](API_EphemeralStorage.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) + [FileSystemConfig](API_FileSystemConfig.md) + [Filter](API_Filter.md) @@ -22,6 +24,7 @@ The following data types are supported: + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) ++ [FunctionUrlConfig](API_FunctionUrlConfig.md) + [ImageConfig](API_ImageConfig.md) + [ImageConfigError](API_ImageConfigError.md) + [ImageConfigResponse](API_ImageConfigResponse.md) diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md old mode 100755 new mode 100644 diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md old mode 100755 new mode 100644 diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md old mode 100755 new mode 100644 index eb06196f..fe810a18 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -81,7 +81,7 @@ The request accepts the following data in JSON format\. ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. -+ **Amazon DynamoDB Streams** \- Default 100\. Max 1,000\. ++ **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. + **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. @@ -261,7 +261,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) A list of current response type enums applied to the event source mapping\. +\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. Type: Array of strings Array Members: Minimum number of 0 items\. Maximum number of 1 item\. Valid Values:` ReportBatchItemFailures` diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md old mode 100755 new mode 100644 index 1af1d49a..b963ced7 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -126,6 +126,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -216,6 +219,10 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [EphemeralStorage](#API_UpdateFunctionCode_ResponseSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object + ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects @@ -296,7 +303,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** The ARN of the signing job\. diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md old mode 100755 new mode 100644 index 94358f2a..9fe342d2 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -24,6 +24,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -87,6 +90,11 @@ Required: No ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** Environment variables that are accessible from function code during execution\. Type: [Environment](API_Environment.md) object +Required: No + + ** [EphemeralStorage](#API_UpdateFunctionConfiguration_RequestSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object Required: No ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -140,7 +148,7 @@ Required: No ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` Required: No ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** @@ -182,6 +190,9 @@ Content-type: application/json "string" : "string" } }, + "EphemeralStorage": { + "Size": number + }, "FileSystemConfigs": [ { "Arn": "string", @@ -272,6 +283,10 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object + ** [EphemeralStorage](#API_UpdateFunctionConfiguration_ResponseSyntax) ** +The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. +Type: [EphemeralStorage](API_EphemeralStorage.md) object + ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects @@ -352,7 +367,7 @@ Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The runtime environment for the Lambda function\. Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` +Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** The ARN of the signing job\. diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_UpdateFunctionUrlConfig.md b/doc_source/API_UpdateFunctionUrlConfig.md new file mode 100644 index 00000000..afdfc1c3 --- /dev/null +++ b/doc_source/API_UpdateFunctionUrlConfig.md @@ -0,0 +1,149 @@ +# UpdateFunctionUrlConfig + +Updates the configuration for a Lambda function URL\. + +## Request Syntax + +``` +PUT /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 +Content-type: application/json + +{ + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + } +} +``` + +## URI Request Parameters + +The request uses the following URI parameters\. + + ** [FunctionName](#API_UpdateFunctionUrlConfig_RequestSyntax) ** +The name of the Lambda function\. + +**Name formats** ++ **Function name** \- `my-function`\. ++ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. ++ **Partial ARN** \- `123456789012:function:my-function`\. +The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. +Length Constraints: Minimum length of 1\. Maximum length of 140\. +Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` +Required: Yes + + ** [Qualifier](#API_UpdateFunctionUrlConfig_RequestSyntax) ** +The alias name\. +Length Constraints: Minimum length of 1\. Maximum length of 128\. +Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` + +## Request Body + +The request accepts the following data in JSON format\. + + ** [AuthType](#API_UpdateFunctionUrlConfig_RequestSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` +Required: No + + ** [Cors](#API_UpdateFunctionUrlConfig_RequestSyntax) ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object +Required: No + +## Response Syntax + +``` +HTTP/1.1 200 +Content-type: application/json + +{ + "AuthType": "string", + "Cors": { + "AllowCredentials": boolean, + "AllowHeaders": [ "string" ], + "AllowMethods": [ "string" ], + "AllowOrigins": [ "string" ], + "ExposeHeaders": [ "string" ], + "MaxAge": number + }, + "CreationTime": "string", + "FunctionArn": "string", + "FunctionUrl": "string", + "LastModifiedTime": "string" +} +``` + +## Response Elements + +If the action is successful, the service sends back an HTTP 200 response\. + +The following data is returned in JSON format by the service\. + + ** [AuthType](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. +Type: String +Valid Values:` NONE | AWS_IAM` + + ** [Cors](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. +Type: [Cors](API_Cors.md) object + + ** [CreationTime](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String + + ** [FunctionArn](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +The Amazon Resource Name \(ARN\) of your function\. +Type: String +Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` + + ** [FunctionUrl](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +The HTTP URL endpoint for your function\. +Type: String +Length Constraints: Minimum length of 40\. Maximum length of 100\. + + ** [LastModifiedTime](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** +When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. +Type: String + +## Errors + + ** InvalidParameterValueException ** +One of the parameters in the request is invalid\. +HTTP Status Code: 400 + + ** ResourceConflictException ** +The resource already exists, or another operation is in progress\. +HTTP Status Code: 409 + + ** ResourceNotFoundException ** +The resource specified in the request does not exist\. +HTTP Status Code: 404 + + ** ServiceException ** +The AWS Lambda service encountered an internal error\. +HTTP Status Code: 500 + + ** TooManyRequestsException ** +The request throughput limit was exceeded\. +HTTP Status Code: 429 + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionUrlConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md old mode 100755 new mode 100644 diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md old mode 100755 new mode 100644 diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md old mode 100755 new mode 100644 index fec9dded..4e92f94e --- a/doc_source/access-control-identity-based.md +++ b/doc_source/access-control-identity-based.md @@ -23,7 +23,7 @@ AWS managed policies grant permission to API actions without restricting the Lam Use identity\-based policies to allow users to perform operations on Lambda functions\. **Note** -For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](configuration-images.md#configuration-images-permissions) +For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](gettingstarted-images.md#configuration-images-permissions) The following shows an example of a permissions policy with limited scope\. It allows a user to create and manage Lambda functions named with a designated prefix \(`intern-`\), and configured with a designated execution role\. diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md old mode 100755 new mode 100644 index 32620b0f..512d29da --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -1,8 +1,8 @@ # Using resource\-based policies for AWS Lambda -AWS Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. +AWS Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts or organizations on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. -For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can add multiple statements to grant access to several accounts, or let any account invoke your function\. You can also use the policy to [grant invoke permission to an AWS service](#permissions-resource-serviceinvoke) that invokes a function in response to activity in your account\. +For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can also use a single resource\-based policy to grant permissions to an entire organization in AWS Organizations\. You can also use resource\-based policies to [grant invoke permission to an AWS service](#permissions-resource-serviceinvoke) that invokes a function in response to activity in your account\. **To view a function's resource\-based policy** @@ -50,6 +50,7 @@ Resource\-based policies apply to a single function, version, alias, or layer ve **Topics** + [Granting function access to AWS services](#permissions-resource-serviceinvoke) ++ [Granting function access to an organization](#permissions-resource-xorginvoke) + [Granting function access to other accounts](#permissions-resource-xaccountinvoke) + [Granting layer access to other accounts](#permissions-resource-xaccountlayer) + [Cleaning up resource\-based policies](#permissions-resource-cleanup) @@ -88,19 +89,56 @@ aws lambda add-permission --function-name my-function --action lambda:InvokeFunc --principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket-123456 --source-account 123456789012 ``` +## Granting function access to an organization + +To grant permissions to an organization in AWS Organizations, specify the organization ID as the `principal-org-id`\. The following [AddPermission](API_AddPermission.md) AWS CLI command grants invocation access to all users in organization `o-a1b2c3d4e5f`\. + +``` +aws lambda add-permission --function-name example \ +--statement-id PrincipalOrgIDExample --action lambda:InvokeFunction \ +--principal * --principal-org-id o-a1b2c3d4e5f +``` + +**Note** +In this command, `Principal` is `*`\. This means that all users in the organization `o-a1b2c3d4e5f` get function invocation permissions\. If you specify an AWS account or role as the `Principal`, then only that principal gets function invocation permissions, but only if they are also part of the `o-a1b2c3d4e5f` organization\. + +This command creates a resource\-based policy that looks like the following: + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "PrincipalOrgIDExample", + "Effect": "Allow", + "Principal": "*", + "Action": "lambda:InvokeFunction", + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:example", + "Condition": { + "StringEquals": { + "aws:PrincipalOrgID": "o-a1b2c3d4e5f" + } + } + } + ] +} +``` + +For more information, see [ aws:PrincipalOrgID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-principalorgid) in the AWS Identity and Access Management user guide\. + ## Granting function access to other accounts -To grant permissions to another AWS account, specify the account ID as the `principal`\. The following example grants account `210987654321` permission to invoke `my-function` with the `prod` alias\. +To grant permissions to another AWS account, specify the account ID as the `principal`\. The following example grants account `111122223333` permission to invoke `my-function` with the `prod` alias\. ``` aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ ---principal 210987654321 --output text +--principal 111122223333 --output text ``` You should see the following output: ``` -{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} +{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} ``` The resource\-based policy grants permission for the other account to access the function, but doesn't allow users in that account to exceed their permissions\. Users in the other account must have the corresponding [user permissions](access-control-identity-based.md) to use the Lambda API\. @@ -128,7 +166,7 @@ You can grant cross\-account access for most API actions that [operate on an exi **Cross\-account APIs** -Currently, Lambda doesn’t currently support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: +Currently, Lambda doesn’t support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: + [Invoke](API_Invoke.md) + [GetFunction](API_GetFunction.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) @@ -156,13 +194,13 @@ To grant layer\-usage permission to another account, add a statement to the laye ``` aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +--action lambda:GetLayerVersion --principal 111122223333 --version-number 1 --output text ``` You should see output similar to the following: ``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} +e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. diff --git a/doc_source/applications-console.md b/doc_source/applications-console.md old mode 100755 new mode 100644 diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md old mode 100755 new mode 100644 index 5f7c9b22..95c2aea7 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -29,7 +29,7 @@ The pipeline maps a single branch in a repository to a single application stack\ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md old mode 100755 new mode 100644 diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md old mode 100755 new mode 100644 index a8793dde..4aae31ac --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -34,7 +34,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. + **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. + **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. -+ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](runtimes-context.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. ++ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](lambda-runtime-environment.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. + **Do not use non\-documented, non\-public APIs** in your Lambda function code\. For AWS Lambda managed runtimes, Lambda periodically applies security and functional updates to Lambda's internal APIs\. These internal API updates may be backwards\-incompatible, leading to unintended consequences such as invocation failures if your function has a dependency on these non\-public APIs\. See [the API reference](API_Operations.md) for a list of publicly available APIs\. diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md old mode 100755 new mode 100644 index ff33dc53..44ce603d --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -177,14 +177,14 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `_HANDLER` – The handler location configured on the function\. + `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. + `AWS_REGION` – The AWS Region where the Lambda function is executed\. -+ `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_`—for example, `AWS_Lambda_java8`\. ++ `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_` \(for example, `AWS_Lambda_java8`\)\. This environment variable is not defined for custom runtimes \(for example, runtimes that use the `provided` or `provided.al2` identifiers\)\. + `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. + `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. + `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. + `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. -+ `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. ++ `AWS_ACCESS_KEY`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. + `LAMBDA_TASK_ROOT` – The path to your Lambda function code\. + `LAMBDA_RUNTIME_DIR` – The path to runtime libraries\. diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md old mode 100755 new mode 100644 index 840bb9ad..da40c4d1 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -12,6 +12,7 @@ For function configuration best practices, see [Function configuration](best-pra + [Configuring functions \(console\)](#configuration-common-summary) + [Configuring functions \(API\)](#configuration-function-api) + [Configuring function memory \(console\)](#configuration-memory-console) ++ [Configuring ephemeral storage \(console\)](#configuration-ephemeral-storage) + [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) + [Configuring triggers \(console\)](#configuration-common-triggers) + [Testing functions \(console\)](#configuration-common-test) @@ -40,6 +41,7 @@ For the following function configurations, you can change the settings only for + **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. + **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. + **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. ++ **Function URL** – Configure a [function URL](lambda-urls.md) to add a unique HTTP\(S\) endpoint to your Lambda function\. You can configure a function URL on the `$LATEST` unpublished function version, or on any function alias\. You can configure the following options on a function, a function version, or an alias\. + **Triggers** – Configure [triggers](#configuration-common-triggers)\. @@ -72,6 +74,8 @@ To configure functions with the Lambda API, use the following actions: + [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. + [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. + [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. ++ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) – Create a function URL configuration\. ++ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) – Update an existing function URL configuration\. ## Configuring function memory \(console\) @@ -91,6 +95,27 @@ You can configure the memory of your function in the Lambda console\. 1. Choose **Save**\. +## Configuring ephemeral storage \(console\) + + By default, Lambda allocates 512 MB for a function’s /tmp directory\. You can increase or decrease this amount using the **Ephemeral storage \(MB\)** setting\. To configure the size of a function’s /tmp directory, set a whole number value between 512 MB and 10,240 MB\. + +**Note** + Configuring ephemeral storage past the default 512 MB allocated incurs a cost\. For more information, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. + +You can configure the size of a function’s /tmp directory in the Lambda console\. + +**To update the size of a function’s /tmp directory** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. For **Ephemeral storage \(MB\)**, set a value from 512 MB to 10,240 MB\. + +1. Choose **Save**\. + ## Accepting function memory recommendations \(console\) If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md old mode 100755 new mode 100644 index dead45ae..ce20435d --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -1,6 +1,6 @@ -# Creating Lambda functions defined as \.zip file archives +# Deploying Lambda functions as \.zip file archives -When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function depends on the deployment package type\. To configure a function defined as a container image, see [Creating Lambda functions defined as container images](configuration-images.md)\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function depends on the deployment package type\. To configure a function defined as a container image, see [Deploying Lambda functions as container images](gettingstarted-images.md)\. You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. @@ -8,15 +8,15 @@ You can use the Lambda console and the Lambda API to create a function defined w You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. **Topics** -+ [Creating a function \(console\)](#configuration-function-create) ++ [Creating the function](#configuration-function-create) + [Using the console code editor](#configuration-functions-console-update) -+ [Updating function code \(console\)](#configuration-function-update) -+ [Change the runtime or runtime version \(console\)](#configuration-function-runtime) -+ [Change the architecture \(console\)](#configuration-function-arch) ++ [Updating function code](#configuration-function-update) ++ [Changing the runtime or runtime version](#configuration-function-runtime) ++ [Changing the architecture](#configuration-function-arch) + [Using the Lambda API](#configuration-function-api) + [AWS CloudFormation](#configuration-function-cloudformation) -## Creating a function \(console\) +## Creating the function When you create a function defined with a \.zip file archive, you choose a code template, the language version, and the execution role for the function\. You add your function code after Lambda creates the function\. @@ -42,40 +42,7 @@ When you create a function defined with a \.zip file archive, you choose a code 1. Choose **Create function**\. -Lambda creates the new function\. You can now use the console to add the function code and configure other function parameters and features\. - -## Using the console code editor - -The console creates a Lambda function with a single source file\. For scripting languages, you can edit this file and add more files using the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. - -**Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. - -## Updating function code \(console\) - -For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. If the code is larger than 3MB, or if you need to add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. If the \.zip file archive is smaller than 50 MB, you can upload the \.zip file archive from your local machine\. If the file is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. - -**To upload function code as a \.zip archive** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update and choose the **Code** tab\. - -1. Under **Code source**, choose **Upload from**\. - -1. Choose **\.zip file**, and then choose **Upload**\. - - 1. In the file chooser, select the new image version, choose **Open**, and then choose **Save**\. - -1. \(Alternative to step 4\) Choose **Amazon S3 location**\. - - 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. - -## Change the runtime or runtime version \(console\) - -If you update the function configuration to use a new runtime version, you may need to update the function code to be compatible with the new version\. If you update the function configuration to use a different runtime, you **must** provide new function code that is compatible with the runtime and architecture\. For instructions on how to create a deployment package for the function code, see the handler page for the runtime that the function uses\. +Lambda creates the new function\. You can now use the console to add the function code and configure other function parameters and features\. For code deployment instructions, see the handler page for the runtime your function uses\. ------ #### [ Node\.js ] @@ -114,66 +81,64 @@ If you update the function configuration to use a new runtime version, you may n ------ -**To change the runtime or runtime version** +## Using the console code editor -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +The console creates a Lambda function with a single source file\. For scripting languages, you can edit this file and add more files using the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. -1. Choose the function to update and choose the **Code** tab\. +**Note** +The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. -1. Under **Runtime settings**, choose **Edit**\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. - 1. For **Runtime**, select the runtime version\. +## Updating function code - 1. For **Handler**, specify file name and handler for your function\. +For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. If the code is larger than 3MB, or if you need to add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. If the \.zip file archive is smaller than 50 MB, you can upload the \.zip file archive from your local machine\. If the file is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. - 1. For **Architecture**, choose the instruction set architecture to use for your function\. +**To upload function code as a \.zip archive** -1. Choose **Save**\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -## Change the architecture \(console\) +1. Choose the function to update and choose the **Code** tab\. -Before you can change the instruction set architecture, you need to ensure that your function's code is compatible with the target architecture\. +1. Under **Code source**, choose **Upload from**\. -If you use Node\.js, Python, or Ruby and you edit your function code in the embedded [editor](foundation-console.md#code-editor), the existing code may run without modification\. +1. Choose **\.zip file**, and then choose **Upload**\. -However, if you provide your function code using a \.zip file archive deployment package, you must prepare a new \.zip file archive that is compiled and built correctly for the target runtime and instruction\-set architecture\. For instructions, see the handler page for your function runtime\. + 1. In the file chooser, select the new image version, choose **Open**, and then choose **Save**\. ------- -#### [ Node\.js ] +1. \(Alternative to step 4\) Choose **Amazon S3 location**\. -[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) + 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. ------- -#### [ Python ] +## Changing the runtime or runtime version - [Deploy Python Lambda functions with \.zip file archives](python-package.md) +If you update the function configuration to use a new runtime version, you may need to update the function code to be compatible with the new version\. If you update the function configuration to use a different runtime, you **must** provide new function code that is compatible with the runtime and architecture\. For instructions on how to create a deployment package for the function code, see the handler page for the runtime that the function uses\. ------- -#### [ Ruby ] +**To change the runtime or runtime version** - [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. ------- -#### [ Java ] +1. Choose the function to update and choose the **Code** tab\. - [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) +1. Scroll down to the **Runtime settings** section, which is under the code editor\. ------- -#### [ Go ] +1. Choose **Edit**\. - [Deploy Go Lambda functions with \.zip file archives](golang-package.md) + 1. For **Runtime**, select the runtime version\. ------- -#### [ C\# ] + 1. For **Handler**, specify file name and handler for your function\. - [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) + 1. For **Architecture**, choose the instruction set architecture to use for your function\. ------- -#### [ PowerShell ] +1. Choose **Save**\. - [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) +## Changing the architecture ------- +Before you can change the instruction set architecture, you need to ensure that your function's code is compatible with the target architecture\. + +If you use Node\.js, Python, or Ruby and you edit your function code in the embedded [editor](foundation-console.md#code-editor), the existing code may run without modification\. + +However, if you provide your function code using a \.zip file archive deployment package, you must prepare a new \.zip file archive that is compiled and built correctly for the target runtime and instruction\-set architecture\. For instructions, see the handler page for your function runtime\. **To change the instruction set architecture** diff --git a/doc_source/configuration-images.md b/doc_source/configuration-images.md deleted file mode 100755 index 0d8ff94c..00000000 --- a/doc_source/configuration-images.md +++ /dev/null @@ -1,259 +0,0 @@ -# Creating Lambda functions defined as container images - -When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function is different depending on the deployment package type\. To configure a function defined as a \.zip file archive, see [Creating Lambda functions defined as \.zip file archives](configuration-function-zip.md)\. - -You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. - -**Note** -You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. - -When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. - -**Note** -In Amazon ECR, if you reassign the image tag to another image, Lambda does not update the image version\. - -**Topics** -+ [Function version $LATEST](#configuration-images-latest) -+ [Container image deployment](#configuration-images-optimization) -+ [Amazon ECR permissions](#configuration-images-permissions) -+ [Override the container settings](#configuration-images-settings) -+ [Creating a function \(console\)](#configuration-images-create) -+ [Updating the function code \(console\)](#configuration-images-update) -+ [Overriding the image parameters \(console\)](#configuration-images-parms) -+ [Using the Lambda API](#configuration-images-api) -+ [AWS CloudFormation](#configuration-images-cloudformation) - -## Function version $LATEST - -When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. By default, the console displays configuration information for the unpublished version of the function\. To view the versions of a function, choose **Qualifiers**\. The unpublished version is named **$LATEST**\. - -Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. - -For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. - -## Container image deployment - -When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. - -## Amazon ECR permissions - -For a function in the same account as the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: - -``` -{ - "Sid": "LambdaECRImageRetrievalPolicy", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ] -} -``` - -For more information about Amazon ECR repository permissions, see [Repository policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) in the *Amazon Elastic Container Registry User Guide*\. - -If the Amazon ECR repository does not include these permissions, Lambda adds `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` to the container image repository permissions\. Lambda can add these permissions only if the Principal calling Lambda has `ecr:getRepositoryPolicy` and `ecr:setRepositoryPolicy` permissions\. - -To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. - -### Amazon ECR cross\-account permissions - -A different account in the same region can create a function that uses a container image owned by your account\. In the following example, your Amazon ECR repository permissions policy needs the following statements to grant access to account number 123456789012\. -+ **CrossAccountPermission** – Allows account 123456789012 to create and update Lambda functions that use images from this ECR repository\. -+ **LambdaECRImageCrossAccountRetrievalPolicy** – Lambda will eventually set a function's state to inactive if it is not invoked for an extended period\. This statement is required so that Lambda can retrieve the container image for optimization and caching on behalf of the function owned by 123456789012\. - -**Example Add cross\-account permission to your repository** - -``` -{"Version": "2012-10-17", - "Statement": [ - { - "Sid": "CrossAccountPermission", - "Effect": "Allow", - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Principal": { - "AWS": "arn:aws:iam::123456789012:root" - } - }, - { - "Sid": "LambdaECRImageCrossAccountRetrievalPolicy", - "Effect": "Allow", - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Condition": { - "StringLike": { - "aws:sourceARN": - "arn:aws:lambda:us-east-1:123456789012:function:*" - } - } - } - ] -} -``` - -To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. - -If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. - -## Override the container settings - -You can use the Lambda console or the Lambda API to override the following container image settings: -+ ENTRYPOINT – Specifies the absolute path of the entry point to the application\. -+ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. -+ WORKDIR – Specifies the absolute path of the working directory\. -+ ENV – Specifies an environment variable for the Lambda function\. - -Any values that you provide in the Lambda console or the Lambda API override the values [in the Dockerfile](images-create.md#images-parms)\. - -## Creating a function \(console\) - -To create a function defined as a container image, you must first [create the image](images-create.md) and then store the image in the Amazon ECR repository\. - -**To create the function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Choose the **Container image** option\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. - - 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. - - You can enter the Amazon ECR image URI or browse for the Amazon ECR image\. - + Enter the Amazon ECR image URI\. - + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. - -1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: - + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: - - ``` - "/usr/bin/npx", "aws-lambda-ric" - ``` - + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: - - ``` - "app.handler" - ``` - + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: - - ``` - "/var/task" - ``` -**Note** -For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. - -1. \(Optional\) For **Architecture**, choose the instruction set architecture for the function\. The default architecture is x86\_64\. Note: when you build the container image for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. - -1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. - -1. Choose **Create function**\. - -## Updating the function code \(console\) - -After you deploy a container image to a function, the image is read\-only\. To update the function code, you must first deploy a new image version\. [Create a new image version](images-create.md), and then store the image in the Amazon ECR repository\. - -**To configure the function to use an updated container image** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update\. - -1. Under **Image**, choose **Deploy new image**\. - -1. Choose **Browse images**\. - -1. In the **Select container image** dialog box, select the Amazon ECR repository from the dropdown list, and then select the new image version\. - -1. Choose **Save**\. - -## Overriding the image parameters \(console\) - -You can use the Lambda console to override the configuration values in the container image\. - -**To override the configuration values in the container image** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update\. - -1. Under **Image configuration**, choose **Edit**\. - -1. Enter new values for any of the override settings, and then choose **Save**\. - -1. \(Optional\) To add or override environment variables, under **Environment variables**, choose **Edit**\. - - For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. - -## Using the Lambda API - -To manage functions defined as container images, use the following API operations: -+ [CreateFunction](API_CreateFunction.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. - -When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. - - You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. - -``` -aws lambda create-function --region sa-east-1 --function-name my-function \ - --package-type Image \ - --code ImageUri= \ - --role arn:aws:iam::123456789012:role/lambda-ex -``` - -To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\. - -**Note** -You cannot change the `package-type` of a function\. - -``` -aws lambda update-function-code --region sa-east-1 --function-name my-function \ - --image-uri \ -``` - -To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---image-config '{"EntryPoint": ["/usr/bin/npx", "aws-lambda-ric"], \ - "Command": ["app.handler"] , \ - "WorkingDirectory": "/var/task"}' -``` - -## AWS CloudFormation - -You can use AWS CloudFormation to create Lambda functions defined as container images\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. - -In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a container image: -+ AWS::Lambda::Function - + PackageType – Set to `Image`\. - + Code – Enter your container image URI in the `ImageUri` field\. - + ImageConfig – \(Optional\) Override the container image configuration properties\. - -The `ImageConfig` property in `AWS::Lambda::Function` contains the following fields: -+ Command – Specifies parameters that you want to pass in with `EntryPoint`\. -+ EntryPoint – Specifies the entry point to the application\. -+ WorkingDirectory – Specifies the working directory\. - -**Note** -If you declare an `ImageConfig` property in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. - -For more information, see [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md old mode 100755 new mode 100644 index 63b41caa..ce8669c5 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -4,7 +4,7 @@ Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) provid A layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](lambda-images.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](images-create.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. You can create layers using the Lambda console, the Lambda API, AWS CloudFormation, or the AWS Serverless Application Model \(AWS SAM\)\. For more information about creating layers with AWS SAM, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. @@ -233,13 +233,13 @@ To grant layer\-usage permission to another account, add a statement to the laye ``` aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 210987654321 --version-number 1 --output text +--action lambda:GetLayerVersion --principal 111122223333 --version-number 1 --output text ``` You should see output similar to the following: ``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::210987654321:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} +e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} ``` Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. @@ -272,7 +272,7 @@ Resources: Layers: - !Ref libs libs: - Type: AWS::Serverless::LayerVersion + Type: AWS::Lambda::LayerVersion Properties: LayerName: blank-nodejs-lib Description: Dependencies for the blank sample app. diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md old mode 100755 new mode 100644 index 3c3cc12e..7e67cbb3 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -1,6 +1,6 @@ # Using tags on AWS Lambda functions -You can tag Lambda functions to organize them by owner, project or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources and adding detail to billing reports\. +You can tag Lambda functions to organize them by owner, project, or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources, and adding detail to billing reports\. **Topics** + [Using tags with the Lambda console](#using-tags-with-the-console) @@ -9,11 +9,33 @@ You can tag Lambda functions to organize them by owner, project or department\. ## Using tags with the Lambda console -You can use the console to add tags to existing functions and to filter functions by the tags that you add\. +You can use the console to create functions that have tags, add tags to existing functions, and filter functions by the tags that you add\. ### Adding tags to a function -**To add tags to a function \(console\)** +**To add tags when you create a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose **Create function**\. + +1. Choose **Author from scratch** or **Container image**\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. + + 1. For **Runtime**, choose the language version to use for your function\. + + 1. \(Optional\) For **Architecture**, choose the instruction set architecture to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + +1. Expand **Advanced settings** and then select **Enable tags**\. + +1. Enter a **Key** and an optional **Value**\. To add more tags, choose **Add new tag**, then repeat this step\. + +1. Choose **Create function**\. + +**To add tags to an existing function** 1. Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: + **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to view the function\. @@ -42,7 +64,7 @@ You can filter functions based on the presence or value of a tag with the Lambda Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. -**To filter functions with tags \(console\)** +**To filter functions with tags** 1. Make sure that you have the permissions you need: + lambda:ListTags grants permission to view functions that have tags\. @@ -64,7 +86,7 @@ With AWS Billing and Cost Management, you can use tags to customize billing repo ## Using tags with the AWS Command Line Interface -You can use the console to create functions that have tags, add tags to existing functions, and to filter functions by the tags that you add\. +You can use the AWS CLI to create functions that have tags, add tags to existing functions, and to filter functions by the tags that you add\. ### Permissions required for working with tags diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md old mode 100755 new mode 100644 diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md old mode 100755 new mode 100644 index 6f84d7d5..d72cbf49 --- a/doc_source/configuration-vpc-endpoints.md +++ b/doc_source/configuration-vpc-endpoints.md @@ -90,15 +90,15 @@ You need to include both the qualified and the unqualified function ARN in the r { "Principal": { - "AWS": "arn:aws:iam::123412341234:user/MyUser" + "AWS": "arn:aws:iam::111122223333:user/MyUser" }, "Effect":"Allow", "Action":[ "lambda:InvokeFunction" ], "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-function”, - "arn:aws:lambda:us-east-2:123456789012:function:my-function:*” + "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "arn:aws:lambda:us-east-2:123456789012:function:my-function:*" ] } ] diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md old mode 100755 new mode 100644 index 8ac162f6..9d42b340 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -26,7 +26,7 @@ Multiple functions can share a network interface, if the functions share the sam If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. -If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects funtion invocations to the previous VPC\. After the update is complete, new invocations start using the the new VPC and the Lambda function is no longer connected to the older VPC\. +If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects function invocations to the previous VPC\. After the update is complete, new invocations start using the the new VPC and the Lambda function is no longer connected to the older VPC\. For short\-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself\. To ensure connection reuse for short\-lived/infrequently invoked functions, we recommend that you use *TCP keep\-alive* for connections that were created during your function initialization, to avoid creating new connections for subsequent invokes\. For more information on reusing connections using keep\-alive, refer to [Lambda documentation on reusing connections](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)[\.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) @@ -39,7 +39,10 @@ Lambda uses your function's permissions to create and manage network interfaces\ + **ec2:DescribeNetworkInterfaces** + **ec2:DeleteNetworkInterface** -These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. +These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. Note that these permissions are required only to create ENIs, not to invoke your VPC function\. In other words, you are still able to invoke your VPC function successfully even if you remove these permissions from your execution role\. To completely disassociate your Lambda function from the VPC, update the function's VPC configuration settings using the console or the [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) API\. + +**Note** +If you don't specify a resource ID for **DeleteNetworkInterface** in the execution role, your function may not be able to access the VPC\. Either specify a unique resource ID, or include all resource IDs, for example, `"Resource": "arn:aws:ec2:us-west-2:123456789012:*/*"`\. When you configure VPC connectivity, Lambda uses your permissions to verify network resources\. To configure a function to connect to a VPC, your AWS Identity and Access Management \(IAM\) user needs the following permissions: diff --git a/doc_source/csharp-context.md b/doc_source/csharp-context.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md old mode 100755 new mode 100644 index 14631ea0..7da8e942 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -3,11 +3,11 @@ You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your \.NET function: + +AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -19,9 +19,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for \.NET](#csharp-image-base) @@ -39,22 +39,17 @@ AWS provides the following base images for \.NET: | 6 | \.NET 6\.0 | Amazon Linux 2 | [Dockerfile for \.NET 6\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/tree/master/LambdaRuntimeDockerfiles/Images/net6) | | 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | -| core2\.1 | \.NET Core 2\.1 | Amazon Linux 2018\.03 | [Dockerfile for \.NET 2\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore2.1/Dockerfile.dotnetcore2.1) | -Docker Hub repository: amazon/aws\-lambda\-dotnet - -Amazon ECR repository: gallery\.ecr\.aws/lambda/dotnet +Amazon ECR repository: [gallery\.ecr\.aws/lambda/dotnet](https://gallery.ecr.aws/lambda/dotnet) ## Using a \.NET base image For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. -The instructions are also available on [Lambda base images for \.NET](https://hub.docker.com/r/amazon/aws-lambda-dotnet) in the *Docker Hub repository*\. - ## \.NET runtime interface clients Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. ## Deploy the container image -For a new function, you deploy the container image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the container image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md old mode 100755 new mode 100644 index 9acc742d..a7e07e07 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -44,7 +44,7 @@ public async Task FunctionHandler(SQSEvent invocationEvent, ILambd START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST ENVIRONMENT VARIABLES: { - "AWS_EXECUTION_ENV": "AWS_Lambda_dotnetcore2.1", + "AWS_EXECUTION_ENV": "AWS_Lambda_dotnet6", "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", @@ -122,7 +122,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -177,7 +177,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md old mode 100755 new mode 100644 diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md old mode 100755 new mode 100644 index f468b4d5..c6e20d97 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -23,11 +23,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. @@ -91,7 +91,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -102,7 +102,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md old mode 100755 new mode 100644 diff --git a/doc_source/extensions-api-partners.md b/doc_source/extensions-api-partners.md new file mode 100644 index 00000000..4afc6572 --- /dev/null +++ b/doc_source/extensions-api-partners.md @@ -0,0 +1,27 @@ +# AWS Lambda extensions partners + +AWS Lambda has partnered with several third party entities to provide extensions to integrate with your Lambda functions\. The following list details third party extensions that are ready for you to use at any time\. ++ [AppDynamics](https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime) – Provides automatic instrumentation of Node\.js or Python Lambda functions, providing visibility and alerting on function performance\. ++ [Check Point CloudGuard](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard) – An extension\-based runtime solution that offers full lifecycle security for serverless applications\. ++ [Datadog](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/) – Provides comprehensive, real\-time visibility to your serverless applications through the use of metrics, traces, and logs\. ++ [Dynatrace](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/) – Provides visibility into traces and metrics, and leverages AI for automated error detection and root cause analysis across the entire application stack\. ++ [Epsagon](https://docs.epsagon.com/docs/aws-lambda-layer) – Listens to invocation events, stores traces, and sends them in parallel to Lambda function executions\. ++ [HashiCorp Vault](https://learn.hashicorp.com/tutorials/vault/aws-lambda) – Manages secrets and makes them available for developers to use within function code, without making functions Vault aware\. ++ [Honeycomb](https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/) – Observability tool for debugging your app stack\. ++ [Lumigo](https://docs.lumigo.io/docs/lambda-extensions) – Profiles Lambda function invocations and collects metrics for troubleshooting issues in serverless and microservice environments\. ++ [New Relic](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring) – Runs alongside Lambda functions, automatically collecting, enhancing, and transporting telemetry to New Relic's unified observability platform\. ++ [Sentry](https://docs.sentry.io/product/integrations/aws-lambda/) – Diagnose, fix, and optimize performance of Lambda functions\. ++ [Site24x7](https://www.site24x7.com/help/aws/lambda-execution-logs.html) – Achieve real\-time observability into your Lambda environments ++ [Splunk](https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension) – Collects high\-resolution, low\-latency metrics for efficient and effective monitoring of Lambda functions\. ++ [Sumo Logic](https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension) – Provides visibility into the health and performance of serverless applications\. ++ [Thundra](https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions) – Provides asynchronous telemetry reporting, such as traces, metrics, and logs\. + +## AWS managed extensions + +AWS provides its own managed extensions, including: ++ [AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions.html#appconfig-integration-lambda-extensions-enabling) – Use feature flags and dynamic data to update your Lambda functions\. You can also use this extension to update other dynamic configuration, such as ops throttling and tuning\. ++ [Amazon CodeGuru Profiler](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) – Improves application performance and reduces cost by pinpointing an application's most expensive line of code and providing recommendations for improving code\. ++ [CloudWatch Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights.html) – Monitor, troubleshoot, and optimize the performance of your Lambda functions through automated dashboards\. ++ [AWS Distro for Open Telemetry](https://aws-otel.github.io/docs/getting-started/lambda) – Enables functions to send trace data to AWS monitoring services such as AWS X\-Ray, and to destinations that support OpenTelemetry such as Honeycomb and Lightstep\. + +For additional extensions samples and demo projects, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions)\. \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md old mode 100755 new mode 100644 index 579df015..7c28f27b --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -9,7 +9,7 @@ + [Function migration to arm64 architecture](#foundation-arch-consider) + [Function code compatibility with arm64 architecture](#foundation-arch-considerations) + [Suggested migration steps](#foundation-arch-steps) -+ [Configuring the instruction set architecture](#foundation-arch-adv) ++ [Configuring the instruction set architecture](#foundation-arch-config) ## Advantages of using arm64 architecture @@ -66,7 +66,7 @@ To migrate a Lambda function to the arm64 architecture, we recommend following t For more information about how to create a code environment for arm64 architecture, including language\-specific information for Java, Go, \.NET, and Python, see the [Getting started with AWS Graviton](https://github.com/aws/aws-graviton-getting-started) GitHub repository\. -## Configuring the instruction set architecture +## Configuring the instruction set architecture You can configure the instruction set architecture for new Lambda functions using the Lambda console, AWS SDKs, AWS Command Line Interface \(AWS CLI\), or AWS CloudFormation\. You can deploy the function code to Lambda with either a \.zip archive file or a container image deployment package\. diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md old mode 100755 new mode 100644 index 1cb4d6d6..c05eade3 --- a/doc_source/foundation-console.md +++ b/doc_source/foundation-console.md @@ -15,7 +15,7 @@ The [Applications](deploying-lambda-apps.md) page shows you a list of applicatio ## Functions -The functions page shows you a list of functions defined for your account in this region\. The initial console flow to create a function depends on whether the function uses a [container image](configuration-images.md) or [\.zip file archive](configuration-function-zip.md) for the deployment package\. Many of the optional [configuration tasks](configuration-function-common.md) are common to both types of function\. +The functions page shows you a list of functions defined for your account in this region\. The initial console flow to create a function depends on whether the function uses a [container image](gettingstarted-images.md) or [\.zip file archive](configuration-function-zip.md) for the deployment package\. Many of the optional [configuration tasks](configuration-function-common.md) are common to both types of function\. The console provides a [code editor](#code-editor) for your convenience\. diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md old mode 100755 new mode 100644 diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md old mode 100755 new mode 100644 diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md old mode 100755 new mode 100644 diff --git a/doc_source/getting-started-create-function.md b/doc_source/getting-started-create-function.md deleted file mode 100755 index f24cab66..00000000 --- a/doc_source/getting-started-create-function.md +++ /dev/null @@ -1,98 +0,0 @@ -# Create a Lambda function with the console - -In this getting started exercise, you create a Lambda function using the console\. The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. For compiled languages, you must create a [\.zip archive deployment package](gettingstarted-package.md#gettingstarted-package-zip) to upload your Lambda function code\. - -**Topics** -+ [Create the function](#gettingstarted-zip-function) -+ [Invoke the Lambda function](#get-started-invoke-manually) -+ [Clean up](#gettingstarted-cleanup) - -## Create the function - -You create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. - -**To create a Lambda function with the console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter **my\-function**\. - - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\), Go, Java, Node\.js, Python, and Ruby\. - -1. Choose **Create function**\. - -Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. - -## Invoke the Lambda function - -Invoke your Lambda function using the sample event data provided in the console\. - -**To invoke a function** - -1. After selecting your function, choose the **Test** tab\. - -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: - - ``` - { - "key1": "value1", - "key2": "value2", - "key3": "value3" - } - ``` - -1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. - - Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. - -1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. - -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. - -1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. - -## Clean up - -If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. - -**To delete a Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Actions**, **Delete**\. - -1. In the **Delete function** dialog box, choose **Delete**\. - -**To delete the log group** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. - -1. Select the function's log group \(`/aws/lambda/my-function`\)\. - -1. Choose **Actions**, **Delete log group\(s\)**\. - -1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management \(IAM\) console\. - -1. Select the function's role \(`my-function-role-31exxmpl`\)\. - -1. Choose **Delete role**\. - -1. In the **Delete role** dialog box, choose **Yes, delete**\. - -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md old mode 100755 new mode 100644 index 61859eb6..fdf9fafb --- a/doc_source/getting-started.md +++ b/doc_source/getting-started.md @@ -9,9 +9,99 @@ As a best practice, create an AWS Identity and Access Management \(IAM\) user wi You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. For an example tutorial, see [Create a Lambda function with the console](getting-started-create-function.md)\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. For an example tutorial, see [Create a function defined as a container image](gettingstarted-images.md)\. ++ A [\.zip file archive](configuration-function-zip.md) that contains your function code and its dependencies\. For a tutorial, see [Create a Lambda function with the console](#getting-started-create-function)\. ++ A [container image](images-create.md) that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. -**Topics** -+ [Create a Lambda function with the console](getting-started-create-function.md) -+ [Create a function defined as a container image](gettingstarted-images.md) \ No newline at end of file +## Create a Lambda function with the console + +In this getting started exercise, you create a Lambda function using the console\. The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. For compiled languages, you must create a [\.zip archive deployment package](gettingstarted-package.md#gettingstarted-package-zip) to upload your Lambda function code\. + +### Create the function + +You create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. + +**To create a Lambda function with the console** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose **Create function**\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter **my\-function**\. + + 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\), Go, Java, Node\.js, Python, and Ruby\. + +1. Choose **Create function**\. + +Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. + +### Invoke the Lambda function + +Invoke your Lambda function using the sample event data provided in the console\. + +**To invoke a function** + +1. After selecting your function, choose the **Test** tab\. + +1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: + + ``` + { + "key1": "value1", + "key2": "value2", + "key3": "value3" + } + ``` + +1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. + + Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. + +1. Upon successful completion, view the results in the console\. + + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. + + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. + + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. + +1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. + +1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. +![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) + + For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. + +### Clean up + +If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. + +**To delete a Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Choose **Actions**, **Delete**\. + +1. In the **Delete function** dialog box, choose **Delete**\. + +**To delete the log group** + +1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. + +1. Select the function's log group \(`/aws/lambda/my-function`\)\. + +1. Choose **Actions**, **Delete log group\(s\)**\. + +1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management \(IAM\) console\. + +1. Select the function's role \(`my-function-role-31exxmpl`\)\. + +1. Choose **Delete role**\. + +1. In the **Delete role** dialog box, choose **Yes, delete**\. + +You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md old mode 100755 new mode 100644 index 4e003bb0..2491b2e6 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -6,7 +6,7 @@ In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. For ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started-create-function.md)\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function)\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md old mode 100755 new mode 100644 index 2389af5e..0d12a4b1 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -63,7 +63,7 @@ For more information about events from AWS services, see [Using AWS Lambda with An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. -For more information, see [AWS Lambda execution environment](runtimes-context.md)\. +For more information, see [AWS Lambda execution environment](lambda-runtime-environment.md)\. ## Instruction set architecture diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md old mode 100755 new mode 100644 index 302d59af..29fcc73f --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -5,6 +5,7 @@ Lambda provides a management console and API for managing and invoking functions **Topics** + [Scaling](#gettingstarted-features-scaling) + [Concurrency controls](#gettingstarted-features-concurrency) ++ [Function URLs](#gettingstarted-features-urls) + [Asynchronous invocation](#gettingstarted-features-async) + [Event source mappings](#gettingstarted-features-eventsourcemapping) + [Destinations](#gettingstarted-features-destinations) @@ -32,6 +33,12 @@ To enable functions to scale without fluctuations in latency, use *provisioned c For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. +## Function URLs + +Lambda offers built\-in HTTP\(S\) endpoint support through *function URLs*\. With function URLs, you can assign a dedicated HTTP endpoint to your Lambda function\. When your function URL is configured, you can use it to invoke your function through a web browser, curl, Postman, or any HTTP client\. + +You can add a function URL to an existing function, or create a new function with a function URL\. For more information, see [Invoking Lambda function URLs](urls-invocation.md)\. + ## Asynchronous invocation When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With asynchronous invocation, Lambda queues the event for processing and returns a response immediately\. diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md old mode 100755 new mode 100644 index 100149e1..7afb727f --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -1,15 +1,23 @@ -# Create a function defined as a container image +# Deploying Lambda functions as container images -In this getting started exercise, you create a function defined as a container image\. First, you use the Docker CLI to create a container image for your function code, and then use the Lambda console to create a function from the container image\. +When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function is different depending on the deployment package type\. To configure a function defined as a \.zip file archive, see [Deploying Lambda functions as \.zip file archives](configuration-function-zip.md)\. + +You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. + +**Note** +You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. + +When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. **Topics** + [Prerequisites](#gettingstarted-images-prereq) -+ [Create the container image](#gettingstarted-images-package) -+ [Upload the image to the Amazon ECR repository](#gettingstarted-create-upload) -+ [Update the user permissions](#gettingstarted-images-permissions) -+ [Create a Lambda function defined as a container image](#gettingstarted-images-function) -+ [Invoke the Lambda function](#get-started-invoke-function) -+ [Clean up](#gettingstarted-image-cleanup) ++ [Permissions](#gettingstarted-images-permissions) ++ [Creating the function](#configuration-images-create) ++ [Testing the function](#get-started-invoke-function) ++ [Overriding container settings](#configuration-images-settings) ++ [Updating function code](#configuration-images-update) ++ [Using the Lambda API](#configuration-images-api) ++ [AWS CloudFormation](#configuration-images-cloudformation) ## Prerequisites @@ -29,134 +37,151 @@ For long commands, an escape character \(`\`\) is used to split a command over m On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -This exercise uses Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. - -## Create the container image - -AWS provides a set of base images in the Amazon Elastic Container Registry \(Amazon ECR\)\. In this getting started exercise, we use the Node\.js base image to create a container image\. For more information about base images, see [AWS base images for Lambda](runtimes-images.md#runtimes-images-lp)\. - -In the following commands, replace `123456789012` with your AWS account ID\. - -**To create an image using the AWS Node\.js 14 base image** - -1. On your local machine, create a project directory for your new function\. - -1. Create a file named `app.js` in your project directory\. Add the following code to `app.js`: - - ``` - exports.handler = async (event) => { - // TODO implement - const response = { - statusCode: 200, - body: JSON.stringify('Hello from Lambda!'), - }; - return response; - }; - ``` +Before you create the function, you must [create a container image and upload it to Amazon ECR](images-create.md)\. -1. Use a text editor to create a new file named `Dockerfile` in your project directory\. Add the following content to `Dockerfile`: +## Permissions - ``` - FROM public.ecr.aws/lambda/nodejs:14 - - # Copy function code - COPY app.js ${LAMBDA_TASK_ROOT} - - # Set the CMD to your handler - CMD [ "app.handler" ] - ``` +Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. -1. Build your Docker image\. From your project directory, run the following command: +For example, use the IAM console to create a role with the following policy: - ``` - docker build -t hello-world . - ``` +``` +{ +"Version": "2012-10-17", +"Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], + "Resource": "arn:aws:ecr:::repository//" + } +] +} +``` -1. \(Optional\) AWS base images include the Lambda runtime interface emulator, so you can test your function locally\. +### Amazon ECR permissions - 1. Run your Docker image\. From your project directory, run the `docker run` command: +For a function in the same account as the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: - ``` - docker run -p 9000:8080 hello-world:latest - ``` +``` +{ + "Sid": "LambdaECRImageRetrievalPolicy", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ] + } +``` - 1. Test your Lambda function\. In a new terminal window, run a `curl` command to invoke your function: +For more information about Amazon ECR repository permissions, see [Repository policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) in the *Amazon Elastic Container Registry User Guide*\. - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` +If the Amazon ECR repository does not include these permissions, Lambda adds `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` to the container image repository permissions\. Lambda can add these permissions only if the Principal calling Lambda has `ecr:getRepositoryPolicy` and `ecr:setRepositoryPolicy` permissions\. -## Upload the image to the Amazon ECR repository +To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. -In the following commands, replace `123456789012` with your AWS account ID and set the region value to the region where you want to create the ECR repository\. +#### Amazon ECR cross\-account permissions -1. Authenticate the Docker CLI to your Amazon ECR registry\. +A different account in the same region can create a function that uses a container image owned by your account\. In the following example, your Amazon ECR repository permissions policy needs the following statements to grant access to account number 123456789012\. ++ **CrossAccountPermission** – Allows account 123456789012 to create and update Lambda functions that use images from this ECR repository\. ++ **LambdaECRImageCrossAccountRetrievalPolicy** – Lambda will eventually set a function's state to inactive if it is not invoked for an extended period\. This statement is required so that Lambda can retrieve the container image for optimization and caching on behalf of the function owned by 123456789012\. - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` +**Example Add cross\-account permission to your repository** -1. Create a repository in Amazon ECR using the `create-repository` command\. +``` +{"Version": "2012-10-17", + "Statement": [ + { + "Sid": "CrossAccountPermission", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "AWS": "arn:aws:iam::123456789012:root" + } + }, + { + "Sid": "LambdaECRImageCrossAccountRetrievalPolicy", + "Effect": "Allow", + "Action": [ + "ecr:BatchGetImage", + "ecr:GetDownloadUrlForLayer" + ], + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Condition": { + "StringLike": { + "aws:sourceARN": + "arn:aws:lambda:us-east-1:123456789012:function:*" + } + } + } + ] + } +``` - ``` - aws ecr create-repository --region us-east-1 --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` +To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. -1. Tag your image to match your repository name using the `docker tag` command\. +If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` +## Creating the function -1. Deploy the image to Amazon ECR using the `docker push` command\. +To create a function defined as a container image, you must first [create the image](images-create.md) and then store the image in the Amazon ECR repository\. - ``` - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` +**To create the function** -## Update the user permissions +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. For information about user permissions to access images in the Amazon ECR repository, see [ Amazon ECR permissions](configuration-images.md#configuration-images-permissions) +1. Choose **Create function**\. -For example, use the IAM console to create a role with the following policy: +1. Choose the **Container image** option\. -``` -{ -"Version": "2012-10-17", -"Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], - "Resource": "arn:aws:ecr:::repository//" - } -] -} -``` +1. Under **Basic information**, do the following: -## Create a Lambda function defined as a container image + 1. For **Function name**, enter the function name\. -Use the Lambda console to create a function defined as a container image\. + 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. -**To create the function with the console** + You can enter the Amazon ECR image URI or browse for the Amazon ECR image\. + + Enter the Amazon ECR image URI\. + + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. +1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: + + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: -1. Choose **Create function**\. + ``` + "/usr/bin/npx", "aws-lambda-ric" + ``` + + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: -1. Choose the **Container image** option\. + ``` + "app.handler" + ``` + + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: -1. Under **Basic information**, do the following: + ``` + "/var/task" + ``` +**Note** +For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. - 1. For **Function name**, enter **my\-function**\. +1. \(Optional\) For **Architecture**, choose the instruction set architecture for the function\. The default architecture is x86\_64\. Note: when you build the container image for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. - 1. For **Container image URI**, enter the URI of the Amazon ECR image that you created previously\. +1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. 1. Choose **Create function**\. Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. -## Invoke the Lambda function +When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. + +## Testing the function Invoke your Lambda function using the sample event data provided in the console\. @@ -190,40 +215,111 @@ Invoke your Lambda function using the sample event data provided in the console\ For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. -## Clean up +## Overriding container settings -If you are finished with the container image, see [Deleting an image](https://docs.aws.amazon.com/AmazonECR/latest/userguide/delete_image.html) in the *Amazon Elastic Container Registry User Guide* +You can use the Lambda console or the Lambda API to override the following container image settings: ++ ENTRYPOINT – Specifies the absolute path of the entry point to the application\. ++ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. ++ WORKDIR – Specifies the absolute path of the working directory\. ++ ENV – Specifies an environment variable for the Lambda function\. -If you are done working with your function, delete it\. You can also delete the log group that stores the function's logs and the execution role that the console created\. +Any values that you provide in the Lambda console or the Lambda API override the values [in the Dockerfile](images-create.md#images-parms)\. -**To delete a Lambda function** +**To override the configuration values in the container image** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the function to update\. + +1. Under **Image configuration**, choose **Edit**\. + +1. Enter new values for any of the override settings, and then choose **Save**\. -1. Choose **Actions**, **Delete**\. +1. \(Optional\) To add or override environment variables, under **Environment variables**, choose **Edit**\. -1. In the **Delete function** dialog box, choose **Delete**\. + For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. -**To delete the log group** +## Updating function code -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. +After you deploy a container image to a function, the image is read\-only\. To update the function code, you must first deploy a new image version\. [Create a new image version](images-create.md), and then store the image in the Amazon ECR repository\. + +**To configure the function to use an updated container image** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Select the function's log group \(`/aws/lambda/my-function`\)\. +1. Choose the function to update\. -1. Choose **Actions**, **Delete log group\(s\)**\. +1. Under **Image**, choose **Deploy new image**\. -1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. +1. Choose **Browse images**\. + +1. In the **Select container image** dialog box, select the Amazon ECR repository from the dropdown list, and then select the new image version\. + +1. Choose **Save**\. + +### Function version $LATEST + +When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. By default, the console displays configuration information for the unpublished version of the function\. To view the versions of a function, choose **Qualifiers**\. The unpublished version is named **$LATEST**\. + +Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. + +For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. + +## Using the Lambda API + +To manage functions defined as container images, use the following API operations: ++ [CreateFunction](API_CreateFunction.md) ++ [UpdateFunctionCode](API_UpdateFunctionCode.md) ++ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + +To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. + +When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. + + You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. + +``` +aws lambda create-function --region sa-east-1 --function-name my-function \ + --package-type Image \ + --code ImageUri= \ + --role arn:aws:iam::123456789012:role/lambda-ex +``` + +To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\. + +**Note** +You cannot change the `package-type` of a function\. + +``` +aws lambda update-function-code --region sa-east-1 --function-name my-function \ + --image-uri \ +``` + +To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. + +``` +aws lambda update-function-configuration --function-name my-function \ +--image-config '{"EntryPoint": ["/usr/bin/npx", "aws-lambda-ric"], \ + "Command": ["app.handler"] , \ + "WorkingDirectory": "/var/task"}' +``` -**To delete the execution role** +## AWS CloudFormation -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the IAM console\. +You can use AWS CloudFormation to create Lambda functions defined as container images\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. -1. Select the function's role \(`my-function-role-31exxmpl`\)\. +In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a container image: ++ AWS::Lambda::Function + + PackageType – Set to `Image`\. + + Code – Enter your container image URI in the `ImageUri` field\. + + ImageConfig – \(Optional\) Override the container image configuration properties\. -1. Choose **Delete role**\. +The `ImageConfig` property in `AWS::Lambda::Function` contains the following fields: ++ Command – Specifies parameters that you want to pass in with `EntryPoint`\. ++ EntryPoint – Specifies the entry point to the application\. ++ WorkingDirectory – Specifies the working directory\. -1. In the **Delete role** dialog box, choose **Yes, delete**\. +**Note** +If you declare an `ImageConfig` property in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS CLI\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +For more information, see [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md old mode 100755 new mode 100644 index ac8debc9..caf5bc95 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -1,12 +1,12 @@ # Lambda quotas +**Important** +New AWS accounts have reduced concurrency and memory quotas\. AWS raises these quotas automatically based on your usage\. You can also [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)\. + ## Compute and storage Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. -**Note** -A few new AWS accounts might start out with limits that are lower than these defaults\. AWS monitors usage and raises your limits automatically based on your usage\. - | Resource | Default quota | Can be increased up to | | --- | --- | --- | @@ -35,9 +35,9 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | | [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | | [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped\) This quota applies to all the files you upload, including layers and custom runtimes\. 3 MB \(console editor\) | -| [Container image](lambda-images.md) code package size | 10 GB | +| [Container image](images-create.md) code package size | 10 GB | | Test events \(console editor\) | 10 | -| `/tmp` directory storage | 512 MB | +| `/tmp` directory storage | 512 MB to 10,240 MB, in 1\-MB increments\. | | File descriptors | 1,024 | | Execution processes/threads | 1,024 | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md old mode 100755 new mode 100644 index 73502536..f2d19702 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -16,7 +16,7 @@ Lambda provides a set of open\-source base images that you can use to build your You upload your container images to Amazon Elastic Container Registry \(Amazon ECR\), a managed AWS container image registry service\. To deploy the image to your function, you specify the Amazon ECR image URL using the Lambda console, the Lambda API, command line tools, or the AWS SDKs\. -For more information about Lambda container images, see [Using container images with Lambda](lambda-images.md)\. +For more information about Lambda container images, see [Creating Lambda container images](images-create.md)\. ## \.zip file archives diff --git a/doc_source/glossary.md b/doc_source/glossary.md old mode 100755 new mode 100644 diff --git a/doc_source/go-image.md b/doc_source/go-image.md old mode 100755 new mode 100644 index 5e2efbb7..2299c69a --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -4,8 +4,6 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -17,9 +15,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Go](#go-image-base) @@ -38,9 +36,7 @@ AWS provides the following base image for Go: | --- | --- | --- | --- | | 1 | Go 1\.x | Amazon Linux 2018\.03 | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | -Docker Hub repository: amazon/aws\-lambda\-go - -Amazon ECR repository: gallery\.ecr\.aws/lambda/go +Amazon ECR repository: [gallery\.ecr\.aws/lambda/go](https://gallery.ecr.aws/lambda/go) ## Go runtime interface clients @@ -48,9 +44,7 @@ AWS does not provide a separate runtime interface client for Go\. The `aws-lambd ## Using the Go:1\.x base image -For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. - -The instructions are also available on [Lambda base images for Go](https://hub.docker.com/r/amazon/aws-lambda-go) in the *Docker Hub repository*\. +For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. ## Create a Go image from the `provided.al2` base image @@ -112,7 +106,7 @@ Note that the first three steps are identical whether you deploy your function a docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` -Now that your container image resides in the Amazon ECR container registry, you can [create](configuration-images.md) the Lambda function and deploy the image\. +Now that your container image resides in the Amazon ECR container registry, you can [create](gettingstarted-images.md) the Lambda function and deploy the image\. ## Create a Go image from an alternative base image @@ -189,8 +183,8 @@ If you do not want to add the RIE to your image, you can test your image locally This command invokes the function running in the container image and returns a response\. -Now that your container image resides in the Amazon ECR container registry, you can you can [create](configuration-images.md) the Lambda function and deploy the image\. +Now that your container image resides in the Amazon ECR container registry, you can you can [create](gettingstarted-images.md) the Lambda function and deploy the image\. ## Deploy the container image -For a new function, you deploy the Go image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the Go image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/golang-context.md b/doc_source/golang-context.md old mode 100755 new mode 100644 diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md old mode 100755 new mode 100644 diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md old mode 100755 new mode 100644 diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md old mode 100755 new mode 100644 diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md old mode 100755 new mode 100644 index ba85177c..c97c8d57 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -88,7 +88,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -143,7 +143,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md old mode 100755 new mode 100644 index bca5bf0f..08e32f12 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -149,4 +149,4 @@ Go is implemented differently than other native runtimes\. Lambda treats Go as a cp ./bootstrap $(ARTIFACTS_DIR)/. ``` -For an example application, download [ Go on AL2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. The readme file contains the instructions to build and run the application\. You can also view the blog post [ Migrating AWS Lambda functions to Amazon Linux 2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. \ No newline at end of file +For an example application, download [ Go on AL2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. The readme file contains the instructions to build and run the application\. You can also view the blog post [ Migrating AWS Lambda functions to Amazon Linux 2](https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md old mode 100755 new mode 100644 index 1c22aaf7..f0e476b1 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -23,11 +23,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. @@ -73,7 +73,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -84,7 +84,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** diff --git a/doc_source/images-create.md b/doc_source/images-create.md old mode 100755 new mode 100644 index 2c5c7ce2..69aac407 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -1,24 +1,30 @@ # Creating Lambda container images -You can package your Lambda function code and dependencies as a container image, using tools such as the Docker CLI\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. - AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. -You can also use an alternative base image from another container registry\. Lambda provides open\-source runtime interface clients that you add to an alternative base image to make it compatible with Lambda\. - For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. -After you create a container image in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. - **Topics** ++ [Base images for Lambda](runtimes-images.md) ++ [Testing Lambda container images locally](images-test.md) ++ [Prerequisites](#images-reqs) + [Image types](#images-types) + [Container tools](#images-tools) -+ [Lambda requirements for container images](#images-reqs) + [Container image settings](#images-parms) -+ [Create an image from an AWS base image for Lambda](#images-create-from-base) -+ [Create an image from an alternative base image](#images-create-from-alt) ++ [Creating images from AWS base images](#images-create-from-base) ++ [Creating images from alternative base images](#images-create-from-alt) ++ [Upload the image to the Amazon ECR repository](#images-upload) + [Create an image using the AWS SAM toolkit](#images-create-sam) +## Prerequisites + +To deploy a container image to Lambda, you need the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [Docker CLI](https://docs.docker.com/get-docker)\. Additionally, note the following requirements: ++ The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. ++ The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. ++ The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. ++ Lambda supports only Linux\-based container images\. ++ Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. + ## Image types You can use an AWS provided base image or an alternative base image, such as Alpine or Debian\. Lambda supports any image that conforms to one of the following image manifest formats: @@ -35,20 +41,6 @@ To create your container image, you can use any development tool that supports o For example, you can use the Docker CLI to build, test, and deploy your container images\. -## Lambda requirements for container images - -To deploy a container image to Lambda, note the following requirements: - -1. The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. - -1. The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. - -1. The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. - -1. Lambda supports only Linux\-based container images\. - -1. Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. - ## Container image settings Lambda supports the following container image settings in the Dockerfile: @@ -67,7 +59,7 @@ You can specify the container image settings in the Dockerfile when you build yo **Warning** When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sure that you enter the absolute path\. Also, do not use symlinks as the entry point to the container\. -## Create an image from an AWS base image for Lambda +## Creating images from AWS base images To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. Lambda provides two types of base images: + Multi\-architecture base image @@ -77,23 +69,16 @@ To build a container image for a new Lambda function, you can start with an AWS Specify an image tag with an architecture suffix\. For example, specify `3.9-arm64` to choose the arm64 base image for Python 3\.9\. -**Note** -AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from Docker Hub\. To use the updated base image, you must rebuild your container image and [update the function code](configuration-images.md#configuration-images-update)\. - -**Prerequisites** -+ The AWS Command Line Interface \(AWS CLI\) - - The following instructions use the AWS CLI to call AWS service API operations\. To install the AWS CLI, see [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the *AWS Command Line Interface User Guide*\. -+ Docker Desktop +You can also use an [alternative base image from another container registry](#images-create-from-alt)\. Lambda provides open\-source runtime interface clients that you add to an alternative base image to make it compatible with Lambda\. - The following instructions use Docker CLI commands to create the container image\. To install the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. -+ Your function code +**Note** +AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from the Amazon ECR repository\. To use the updated base image, you must rebuild your container image and [update the function code](gettingstarted-images.md#configuration-images-update)\. **To create an image from an AWS base image for Lambda** 1. On your local machine, create a project directory for your new function\. -1. Create a directory named **app** in in the project directory, and then add your function handler code to the app directory\. +1. Create a directory named **app** in the project directory, and then add your function handler code to the app directory\. 1. Use a text editor to create a new Dockerfile\. @@ -110,7 +95,6 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do ``` FROM public.ecr.aws/lambda/nodejs:14 - # Alternatively, you can pull the base image from Docker Hub: amazon/aws-lambda-nodejs:12 # Assumes your function is named "app.js", and there is a package.json file in the app directory COPY app.js package.json ${LAMBDA_TASK_ROOT} @@ -183,28 +167,7 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do This command invokes the function running in the container image and returns a response\. -1. Authenticate the Docker CLI to your Amazon ECR registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Create a repository in Amazon ECR using the `create-repository` command\. - - ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` - -1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. - -## Create an image from an alternative base image +## Creating images from alternative base images **Prerequisites** + The AWS CLI @@ -278,6 +241,13 @@ Now that your container image resides in the Amazon ECR container registry, you 1. \(Optional\) Test your application locally using the [Runtime interface emulator](images-test.md)\. +## Upload the image to the Amazon ECR repository + +In the following commands, replace `123456789012` with your AWS account ID and set the region value to the region where you want to create the Amazon ECR repository\. + +**Note** +In Amazon ECR, if you reassign the image tag to another image, Lambda does not update the image version\. + 1. Authenticate the Docker CLI to your Amazon ECR registry\. ``` @@ -297,7 +267,7 @@ Now that your container image resides in the Amazon ECR container registry, you docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest ``` -Now that your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. +Now that your container image resides in the Amazon ECR container registry, you can [create and run](gettingstarted-images.md) the Lambda function\. ## Create an image using the AWS SAM toolkit diff --git a/doc_source/images-test.md b/doc_source/images-test.md old mode 100755 new mode 100644 diff --git a/doc_source/index.md b/doc_source/index.md old mode 100755 new mode 100644 index 3c817e0b..f6781c95 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -15,10 +15,8 @@ Amazon's trademarks and trade dress may not be used in ----- ## Contents + [What is AWS Lambda?](welcome.md) -+ [Setting up with Lambda](lambda-settingup.md) ++ [Prerequisites](lambda-settingup.md) + [Getting started with Lambda](getting-started.md) - + [Create a Lambda function with the console](getting-started-create-function.md) - + [Create a function defined as a container image](gettingstarted-images.md) + [AWS Lambda foundations](lambda-foundation.md) + [Lambda concepts](gettingstarted-concepts.md) + [Lambda features](gettingstarted-features.md) @@ -35,10 +33,24 @@ Amazon's trademarks and trade dress may not be used in + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) ++ [Lambda runtimes](lambda-runtimes.md) + + [Modifying the runtime environment](runtimes-modify.md) + + [Custom AWS Lambda runtimes](runtimes-custom.md) + + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) ++ [AWS Lambda execution environment](lambda-runtime-environment.md) + + [Lambda Extensions API](runtimes-extensions-api.md) + + [AWS Lambda runtime API](runtimes-api.md) + + [Lambda Logs API](runtimes-logs-api.md) + + [AWS Lambda extensions partners](extensions-api-partners.md) ++ [Deploying Lambda functions](lambda-deploy-functions.md) + + [Deploying Lambda functions as .zip file archives](configuration-function-zip.md) + + [Deploying Lambda functions as container images](gettingstarted-images.md) ++ [Creating Lambda container images](images-create.md) + + [Base images for Lambda](runtimes-images.md) + + [Testing Lambda container images locally](images-test.md) + [Configuring AWS Lambda functions](lambda-functions.md) - + [Creating Lambda functions defined as .zip file archives](configuration-function-zip.md) + [Creating and sharing Lambda layers](configuration-layers.md) - + [Creating Lambda functions defined as container images](configuration-images.md) + [Configuring Lambda function options](configuration-function-common.md) + [Using AWS Lambda environment variables](configuration-envvars.md) + [Lambda function versions](configuration-versions.md) @@ -60,22 +72,15 @@ Amazon's trademarks and trade dress may not be used in + [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + + [Testing Lambda functions in the console](testing-functions.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) -+ [Lambda runtimes](lambda-runtimes.md) - + [Runtime support policy](runtime-support-policy.md) - + [AWS Lambda execution environment](runtimes-context.md) - + [Runtime support for Lambda container images](runtimes-images.md) - + [AWS Lambda runtime API](runtimes-api.md) - + [Lambda Extensions API](runtimes-extensions-api.md) - + [Lambda Logs API](runtimes-logs-api.md) - + [Modifying the runtime environment](runtimes-modify.md) - + [Custom AWS Lambda runtimes](runtimes-custom.md) - + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) - + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) -+ [Using container images with Lambda](lambda-images.md) - + [Creating Lambda container images](images-create.md) - + [Testing Lambda container images locally](images-test.md) ++ [Lambda function URLs](lambda-urls.md) + + [Creating and managing Lambda function URLs](urls-configuration.md) + + [Security and auth model for Lambda function URLs](urls-auth.md) + + [Invoking Lambda function URLs](urls-invocation.md) + + [Monitoring Lambda function URLs](urls-monitoring.md) + + [Tutorial: Creating a Lambda function with a function URL](urls-tutorial.md) + [Building Lambda functions with Node.js](lambda-nodejs.md) + [AWS Lambda function handler in Node.js](nodejs-handler.md) + [Deploy Node.js Lambda functions with .zip file archives](nodejs-package.md) @@ -84,6 +89,11 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda function logging in Node.js](nodejs-logging.md) + [AWS Lambda function errors in Node.js](nodejs-exceptions.md) + [Instrumenting Node.js code in AWS Lambda](nodejs-tracing.md) ++ [Building Lambda functions with TypeScript](lambda-typescript.md) + + [AWS Lambda function handler in TypeScript](typescript-handler.md) + + [Deploy transpiled TypeScript code in Lambda with .zip file archives](typescript-package.md) + + [Deploy transpiled TypeScript code in Lambda with container images](typescript-image.md) + + [AWS Lambda function errors in TypeScript](typescript-exceptions.md) + [Building Lambda functions with Python](lambda-python.md) + [Lambda function handler in Python](python-handler.md) + [Deploy Python Lambda functions with .zip file archives](python-package.md) @@ -107,7 +117,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) - + [Instrumenting Java code in AWS Lambda](java-tracing.md) + + [Instrumenting Java code in Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Java sample applications for AWS Lambda](java-samples.md) + [Building Lambda functions with Go](lambda-golang.md) @@ -247,6 +257,7 @@ Amazon's trademarks and trade dress may not be used in + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) + + [CreateFunctionUrlConfig](API_CreateFunctionUrlConfig.md) + [DeleteAlias](API_DeleteAlias.md) + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) @@ -254,6 +265,7 @@ Amazon's trademarks and trade dress may not be used in + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) + + [DeleteFunctionUrlConfig](API_DeleteFunctionUrlConfig.md) + [DeleteLayerVersion](API_DeleteLayerVersion.md) + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) + [GetAccountSettings](API_GetAccountSettings.md) @@ -265,6 +277,7 @@ Amazon's trademarks and trade dress may not be used in + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) + + [GetFunctionUrlConfig](API_GetFunctionUrlConfig.md) + [GetLayerVersion](API_GetLayerVersion.md) + [GetLayerVersionByArn](API_GetLayerVersionByArn.md) + [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) @@ -278,6 +291,7 @@ Amazon's trademarks and trade dress may not be used in + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) + [ListFunctions](API_ListFunctions.md) + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) + + [ListFunctionUrlConfigs](API_ListFunctionUrlConfigs.md) + [ListLayers](API_ListLayers.md) + [ListLayerVersions](API_ListLayerVersions.md) + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) @@ -299,6 +313,7 @@ Amazon's trademarks and trade dress may not be used in + [UpdateFunctionCode](API_UpdateFunctionCode.md) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) + + [UpdateFunctionUrlConfig](API_UpdateFunctionUrlConfig.md) + [Data Types](API_Types.md) + [AccountLimit](API_AccountLimit.md) + [AccountUsage](API_AccountUsage.md) @@ -308,11 +323,13 @@ Amazon's trademarks and trade dress may not be used in + [CodeSigningConfig](API_CodeSigningConfig.md) + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) + + [Cors](API_Cors.md) + [DeadLetterConfig](API_DeadLetterConfig.md) + [DestinationConfig](API_DestinationConfig.md) + [Environment](API_Environment.md) + [EnvironmentError](API_EnvironmentError.md) + [EnvironmentResponse](API_EnvironmentResponse.md) + + [EphemeralStorage](API_EphemeralStorage.md) + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) + [FileSystemConfig](API_FileSystemConfig.md) + [Filter](API_Filter.md) @@ -321,6 +338,7 @@ Amazon's trademarks and trade dress may not be used in + [FunctionCodeLocation](API_FunctionCodeLocation.md) + [FunctionConfiguration](API_FunctionConfiguration.md) + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) + + [FunctionUrlConfig](API_FunctionUrlConfig.md) + [ImageConfig](API_ImageConfig.md) + [ImageConfigError](API_ImageConfigError.md) + [ImageConfigResponse](API_ImageConfigResponse.md) diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md old mode 100755 new mode 100644 diff --git a/doc_source/invocation-eventfiltering.md b/doc_source/invocation-eventfiltering.md old mode 100755 new mode 100644 diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md old mode 100755 new mode 100644 index 60882025..28436d2a --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -22,7 +22,7 @@ To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](http The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` -aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --maximum-batching-window-in-seconds 5 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 ``` @@ -32,7 +32,7 @@ You should see the following output: { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, - "MaximumBatchingWindowInSeconds": 0, + "MaximumBatchingWindowInSeconds": 5, "ParallelizationFactor": 1, "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md old mode 100755 new mode 100644 diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md old mode 100755 new mode 100644 index 4dd05457..de22876f --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -2,7 +2,7 @@ A Lambda layer is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a custom runtime, data, or configuration files\. Use layers to reduce deployment package size and to promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. -You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](lambda-images.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. +You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](images-create.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. **Topics** + [Configuring functions to use layers](#invocation-layers-using) @@ -63,19 +63,23 @@ The order in which you add the layers is the order in which Lambda later merges 1. Choose **Save**\. -Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the console to update your function's layer versions\. +Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the console to update your functions' layer versions\. **Update layer versions for your function** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose the function to configure\. +1. Under **Additional resources**, choose **Layers**\. -1. Under **Layers**, choose **Edit** +1. Choose the layer to modify\. -1. Under **Layer version**, enter the new layer version\. You can change the version for one or more of the listed layers\. +1. Under **Functions using this version**, select the functions you want to modify, then choose **Edit**\. -1. Choose **Save**\. +1. From **Layer version**, select the layer version to change to\. + +1. Choose **Update functions**\. + +You cannot update functions' layer versions across AWS accounts\. ### Configuring layers with the API @@ -84,7 +88,7 @@ To add layers to your function, use the update\-function\-configuration command\ ``` aws lambda update-function-configuration --function-name my-function \ --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2 +arn:aws:lambda:us-east-2:111122223333:layer:their-layer:2 ``` You should see output similar to the following: @@ -101,7 +105,7 @@ You should see output similar to the following: "CodeSize": 169 }, { - "Arn": "arn:aws:lambda:us-east-2:210987654321:layer:their-layer:2", + "Arn": "arn:aws:lambda:us-east-2:111122223333:layer:their-layer:2", "CodeSize": 169 } ], diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md old mode 100755 new mode 100644 diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md old mode 100755 new mode 100644 diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md old mode 100755 new mode 100644 index 08a3ff0d..b7d56c45 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -3,9 +3,11 @@ When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function completes, Lambda returns the response from the function's code with additional data, such as the version of the function that was invoked\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. ``` -aws lambda invoke --function-name my-function --payload '{ "key": "value" }' response.json +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json ``` +The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + You should see the following output: ``` @@ -29,7 +31,7 @@ For functions with a long timeout, your client might be disconnected during sync If Lambda isn't able to run the function, the error is displayed in the output\. ``` -aws lambda invoke --function-name my-function --payload value response.json +aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload value response.json ``` You should see the following output: diff --git a/doc_source/java-context.md b/doc_source/java-context.md old mode 100755 new mode 100644 diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md old mode 100755 new mode 100644 index 58fb0f89..a8335733 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -200,7 +200,7 @@ We recommend using AWS X\-Ray to determine the source of an error and its cause\ ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) -For more information, see [Instrumenting Java code in AWS Lambda](java-tracing.md)\. +For more information, see [Instrumenting Java code in Lambda](java-tracing.md)\. ## Sample applications diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md old mode 100755 new mode 100644 diff --git a/doc_source/java-image.md b/doc_source/java-image.md old mode 100755 new mode 100644 index 0e5bc56e..96b496c6 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -4,8 +4,6 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -17,9 +15,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Java](#java-image-base) @@ -38,16 +36,12 @@ AWS provides the following base images for Java: | 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | | 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | -Docker Hub repository: amazon/aws\-lambda\-java - -Amazon ECR repository: gallery\.ecr\.aws/lambda/java +Amazon ECR repository: [gallery\.ecr\.aws/lambda/java](https://gallery.ecr.aws/lambda/java) ## Using a Java base image For instructions on how to use a Java base image, choose the **usage** tab on [Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. -The instructions are also available on [Lambda base images for Java](https://hub.docker.com/r/amazon/aws-lambda-java) in the *Docker Hub repository*\. - ## Java runtime interface clients Install the runtime interface client for Java using the Apache Maven package manager\. Add the following to your `pom.xml` file: @@ -64,8 +58,8 @@ For package details, see [Lambda RIC](https://search.maven.org/artifact/com.amaz You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. -After your container image resides in the Amazon ECR container registry, you can [create and run](configuration-images.md) the Lambda function\. +After your container image resides in the Amazon ECR container registry, you can [create and run](gettingstarted-images.md) the Lambda function\. ## Deploy the container image -For a new function, you deploy the Java image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the Java image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md old mode 100755 new mode 100644 index e9ebaa81..67eee3ae --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -102,7 +102,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -157,7 +157,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** @@ -315,9 +315,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.0' - implementation 'org.apache.logging.log4j:log4j-core:2.17.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.1' + implementation 'org.apache.logging.log4j:log4j-core:2.17.1' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md old mode 100755 new mode 100644 diff --git a/doc_source/java-package.md b/doc_source/java-package.md old mode 100755 new mode 100644 index 7f3c20f0..87002652 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -112,9 +112,9 @@ dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.13.0' - implementation 'org.apache.logging.log4j:log4j-core:2.13.0' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' + implementation 'org.apache.logging.log4j:log4j-api:2.17.1' + implementation 'org.apache.logging.log4j:log4j-core:2.17.1' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md old mode 100755 new mode 100644 diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md old mode 100755 new mode 100644 index 1087a16c..54c41f2a --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -1,39 +1,35 @@ -# Instrumenting Java code in AWS Lambda +# Instrumenting Java code in Lambda -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. +Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +To send tracing data to X\-Ray, you can use one of two SDK libraries: ++ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. ++ [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) – A collection of libraries for generating and sending trace data to X\-Ray\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) +Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +**Important** +**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. -**To enable active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, enable **Active tracing**\. - -1. Choose **Save**\. - -**Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +**Topics** ++ [Using ADOT to instrument your Java functions](#java-adot) ++ [Using the X\-Ray SDK to instrument your Java functions](#java-xray-sdk) ++ [Activating tracing with the Lambda API](#java-tracing-api) ++ [Activating tracing with AWS CloudFormation](#java-tracing-cloudformation) ++ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#java-tracing-layers) ++ [X\-Ray tracing in sample applications \(X\-Ray SDK\)](#java-tracing-samples) -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +## Using ADOT to instrument your Java functions -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. +For Java runtimes, you can choose between two layers to consume: ++ **AWS managed Lambda layer for ADOT Java \(Auto\-instrumentation Agent\)** – This layer automatically transforms your function code at startup to collect tracing data\. For detailed instructions on how to consume this layer together with the ADOT Java agent, see [AWS Distro for OpenTelemetry Lambda Support for Java \(Auto\-instrumentation Agent\)](https://aws-otel.github.io/docs/getting-started/lambda/lambda-java-auto-instr) in the ADOT documentation\. ++ **AWS managed Lambda layer for ADOT Java** – This layer also provides built\-in instrumentation for Lambda functions, but it requires a few manual code changes to initialize the OTel SDK\. For detailed instructions on how to consume this layer, see [AWS Distro for OpenTelemetry Lambda Support for Java](https://aws-otel.github.io/docs/getting-started/lambda/lambda-java) in the ADOT documentation\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) +## Using the X\-Ray SDK to instrument your Java functions -To record detail about calls that your function makes to other resources and services, add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that enable automatic instrumentation of AWS SDK for Java 2\.x clients\. +To record data about calls that your function makes to other resources and services in your application, you can add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that activate automatic instrumentation of AWS SDK for Java 2\.x clients\. **Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** @@ -50,31 +46,56 @@ dependencies { } ``` -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +After you add the correct dependencies, activate tracing in your function's configuration: -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +**To turn on active tracing** -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java ](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the AWS X\-Ray Developer Guide\. +1. Choose **Configuration**, and then choose **Monitoring and operations tools**\. -**Topics** -+ [Enabling active tracing with the Lambda API](#java-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#java-tracing-cloudformation) -+ [Storing runtime dependencies in a layer](#java-tracing-layers) -+ [Tracing in sample applications](#java-tracing-samples) +1. Choose **Edit**\. + +1. Under **AWS X\-Ray**, turn on **Active tracing**\. + +1. Choose **Save**\. + +**Pricing** +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. + +Your function needs permissions to upload trace data to X\-Ray\. When you turn on active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. You can also manually add the AWS Identity and Access Management \(IAM\) policy [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) to your execution role\. + +After you've configured active tracing, you can observe specific requests through your application\. The [X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor sample application](samples-errorprocessor.md) shows an application with two Lambda functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first function's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +X\-Ray may not trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The default sample rule is one request per second and five percent of additional requests\. You cannot configure this sampling rate for your functions\. + +For each trace, Lambda records two segments, which creates two nodes on the service graph\. The following image highlights the primary function from the error processor example\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node on the right records the work of your function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment appears only for the first event that each instance of your function processes\. ++ **Invocation** – Represents the work that your handler code does\. ++ **Overhead** – Represents the work that the Lambda runtime does to prepare to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the *AWS X\-Ray Developer Guide*\. -## Enabling active tracing with the Lambda API +## Activating tracing with the Lambda API To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -83,9 +104,9 @@ aws lambda update-function-configuration --function-name my-function \ Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. -## Enabling active tracing with AWS CloudFormation +## Activating tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** @@ -112,11 +133,11 @@ Resources: ... ``` -## Storing runtime dependencies in a layer +## Storing runtime dependencies in a layer \(X\-Ray SDK\) -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients in your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time that you update your function code, package them in a Lambda layer\. -The following example shows an `AWS::Serverless::LayerVersion` resource that stores the SDK for Java and X\-Ray SDK for Java\. +The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS SDK for Java and X\-Ray SDK for Java\. **Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/template.yml) – Dependencies layer** @@ -140,13 +161,13 @@ Resources: - java8 ``` -With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application\. +Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application on GitHub\. -## Tracing in sample applications +## X\-Ray tracing in sample applications \(X\-Ray SDK\) -The GitHub repository for this guide includes sample applications that demonstrate the use of tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. +The GitHub repository for this guide includes sample applications that demonstrate the use of X\-Ray tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** + [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. @@ -158,4 +179,4 @@ All of the sample applications have active tracing enabled for Lambda functions\ ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-java-servicemap.png) -This example from the `blank-java` sample application shows nodes for the Lambda service, a function, and the Lambda API\. The function calls the Lambda API to monitor storage use in Lambda\. \ No newline at end of file +This example from the `blank-java` sample application shows nodes for the Lambda service, a function, and the Lambda API\. The function calls the Lambda API to monitor storage usage in Lambda\. \ No newline at end of file diff --git a/doc_source/kinesis-tutorial-spec.md b/doc_source/kinesis-tutorial-spec.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md old mode 100755 new mode 100644 index 5b7f022f..8df8a3bc --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -36,6 +36,15 @@ For example, the following policy allows a user in account `123456789012` to inv This is a special case where the action identifier \(`lambda:InvokeFunction`\) differs from the API operation \([Invoke](API_Invoke.md)\)\. For other actions, the action identifier is the operation name prefixed by `lambda:`\. +**Topics** ++ [Policy conditions](#authorization-conditions) ++ [Function resource names](#function-resources) ++ [Function actions](#permissions-resources-function) ++ [Event source mapping actions](#permissions-resources-eventsource) ++ [Layer actions](#permissions-resources-layers) + +## Policy conditions + Conditions are an optional policy element that applies additional logic to determine if an action is allowed\. In addition to [common conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) supported by all actions, Lambda defines condition types that you can use to restrict the values of additional parameters on some actions\. For example, the `lambda:Principal` condition lets you restrict the service or account that a user can grant invocation access to on a function's resource\-based policy\. The following policy lets a user grant permission to SNS topics to invoke a function named `test`\. @@ -68,12 +77,6 @@ The condition requires that the principal is Amazon SNS and not another service For more information on resources and conditions for Lambda and other AWS services, see [Actions, resources, and condition keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_actions-resources-contextkeys.html) in the *IAM User Guide*\. -**Topics** -+ [Function resource names](#function-resources) -+ [Function actions](#permissions-resources-function) -+ [Event source mapping actions](#permissions-resources-eventsource) -+ [Layer actions](#permissions-resources-layers) - ## Function resource names You reference a Lambda function in a policy statement using an Amazon Resource Name \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function \(unqualified\) or a function [version](configuration-versions.md) or [alias](configuration-aliases.md) \(qualified\)\. @@ -82,6 +85,9 @@ When making Lambda API calls, users can specify a version or alias by passing a Whether you are allowing or denying an action on your function, you must use the correct function ARN types in your policy statement to achieve the results that you expect\. For example, if your policy references the unqualified ARN, Lambda accepts requests that reference the unqualified ARN but denies requests that reference a qualified ARN\. +**Note** +You can't use a wildcard character to match the Account ID\. For more information on accepted syntax, see [IAM JSON policy reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)\. + **Example allowing invocation of an unqualified arn** ``` @@ -91,7 +97,8 @@ Whether you are allowing or denying an action on your function, you must use the { "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction" + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction" + } ] } ``` @@ -107,7 +114,7 @@ If your policy references a specific qualified ARN, Lambda accepts requests that { "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:1" + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction:1" } ] } @@ -124,7 +131,7 @@ If your policy references any qualified ARN using `:*`, Lambda accepts any quali { "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction:*" + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction:*" } ] } @@ -141,7 +148,7 @@ If your policy references any ARN using `*`, Lambda accepts any qualified or unq { "Effect": "Allow", "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:myFunction*" + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction*" } ] } diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md old mode 100755 new mode 100644 index fae83b69..b87a382c --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -25,10 +25,9 @@ These packages are available at [Nuget packages](https://www.nuget.org/packages/ | --- | --- | --- | --- | | \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** -For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. +For end of support information about \.NET Core 2\.1, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-images.md b/doc_source/lambda-deploy-functions.md old mode 100755 new mode 100644 similarity index 52% rename from doc_source/lambda-images.md rename to doc_source/lambda-deploy-functions.md index 47a5c9d1..7513748d --- a/doc_source/lambda-images.md +++ b/doc_source/lambda-deploy-functions.md @@ -1,4 +1,16 @@ -# Using container images with Lambda +# Deploying Lambda functions + +You can deploy code to your Lambda function by uploading a zip file archive, or by creating and uploading a container image\. + +## \.zip file archives + +A \.zip file archive includes your application code and its dependencies\. When you author functions using the Lambda console or a toolkit, Lambda automatically creates a \.zip file archive of your code\. + +When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. + +You can upload a \.zip file as your deployment package using the Lambda console, AWS Command Line Interface \(AWS CLI\), or to an Amazon Simple Storage Service \(Amazon S3\) bucket\. + +## Container images You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. @@ -13,5 +25,7 @@ The image that you build for your function must target only one of the architect There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. **Topics** -+ [Creating Lambda container images](images-create.md) -+ [Testing Lambda container images locally](images-test.md) \ No newline at end of file ++ [\.zip file archives](#deploying-zip-archives) ++ [Container images](#deploying-containers) ++ [Deploying Lambda functions as \.zip file archives](configuration-function-zip.md) ++ [Deploying Lambda functions as container images](gettingstarted-images.md) \ No newline at end of file diff --git a/doc_source/lambda-edge.md b/doc_source/lambda-edge.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md old mode 100755 new mode 100644 index 02878bd5..4957dbd0 --- a/doc_source/lambda-functions.md +++ b/doc_source/lambda-functions.md @@ -1,6 +1,6 @@ # Configuring AWS Lambda functions -You can use the AWS Lambda API or console to create functions and configure function settings\. When you create the function, you chose the type of deployment package for the function\. The deployment package type cannot be changed later\. The workflow to create a function is different for a function deployed as a [container image](configuration-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. +You can use the AWS Lambda API or console to create functions and configure function settings\. When you create the function, you chose the type of deployment package for the function\. The deployment package type cannot be changed later\. The workflow to create a function is different for a function deployed as a [container image](gettingstarted-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md old mode 100755 new mode 100644 index 6871fb4d..f271de16 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -26,7 +26,7 @@ When you add permissions to your function, make an update to its code or configu ## Creating an execution role in the IAM console -By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started-create-function.md)\. You can also create an execution role in the IAM console\. +By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started.md#getting-started-create-function)\. You can also create an execution role in the IAM console\. **To create an execution role in the IAM console** diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md old mode 100755 new mode 100644 index d545ac54..b2b7b7d0 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -1,6 +1,6 @@ # Invoking Lambda functions -You can invoke Lambda functions directly [using the Lambda console](getting-started-create-function.md#get-started-invoke-manually), the Lambda API, an AWS SDK, the AWS Command Line Interface \(AWS CLI\), and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. +You can invoke Lambda functions directly using [the Lambda console](getting-started.md#get-started-invoke-manually), a [function URL](lambda-urls.md) HTTP\(S\) endpoint, the Lambda API, an AWS SDK, the AWS Command Line Interface \(AWS CLI\), and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. @@ -19,5 +19,6 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Lambda event filtering](invocation-eventfiltering.md) + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) ++ [Testing Lambda functions in the console](testing-functions.md) + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md old mode 100755 new mode 100644 index f533c6e3..1ad435a2 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -78,6 +78,6 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) -+ [Instrumenting Java code in AWS Lambda](java-tracing.md) ++ [Instrumenting Java code in Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Java sample applications for AWS Lambda](java-samples.md) \ No newline at end of file diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md old mode 100755 new mode 100644 index 2c167189..c5b5f3b9 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -9,12 +9,9 @@ Lambda supports the following Node\.js runtimes\. | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | - -**Note** -For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. +| Node\.js 16 | `nodejs16.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -41,7 +38,7 @@ You can add permissions to the role later, or swap it out for a different role t 1. Configure the following settings: + **Name** – **my\-function**\. - + **Runtime** – **Node\.js 14\.x**\. + + **Runtime** – **Node\.js 16\.x**\. + **Role** – **Choose an existing role**\. + **Existing role** – **lambda\-role**\. diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md old mode 100755 new mode 100644 index eee3dc93..daafd65d --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -9,7 +9,6 @@ The following sections explain how common programming patterns and core concepts | --- | --- | --- | --- | | \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | Lambda provides the following sample applications for the PowerShell runtime: + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md old mode 100755 new mode 100644 index 14d40a41..e74a48f3 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -4,19 +4,17 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. - **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | +| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | + +The runtime information in this table undergoes continuous updates\. For more information on using AWS SDKs in Lambda, see [Managing AWS SDKs in Lambda functions](https://docs.aws.amazon.com/lambda/latest/operatorguide/sdks-functions.html)\. **To create a Python function** diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md old mode 100755 new mode 100644 index de0e7e9c..8fec4b94 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,12 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [Node\.js 16 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 16\. Node\.js 16 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 11, 2022 | +| [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss) | Lambda now supports function URLs, which are dedicated HTTP\(S\) endpoints for Lambda functions\. For details, see [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss)\. | April 6, 2022 | +| [Shared test events in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss) | Lambda now supports sharing test events with other IAM users in the same AWS account\. For details, see [Testing Lambda functions in the console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss)\. | March 16, 2022 | +| [PrincipalOrgId in resource\-based policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html?icmpid=docs_lambda_rss) | Lambda now supports granting permissions to an organization in AWS Organizations\. For details, see [Using resource\-based policies for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html?icmpid=docs_lambda_rss)\. | March 11, 2022 | +| [\.NET 6 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for \.NET 6\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | February 23, 2022 | +| [Event filtering for Kinesis, DynamoDB, and Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html?icmpid=docs_lambda_rss) | Lambda now supports event filtering for Kinesis, DynamoDB, and Amazon SQS event sources\. For details, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html?icmpid=docs_lambda_rss)\. | November 24, 2021 | | [mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | November 19, 2021 | | [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | | [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | @@ -13,7 +19,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | | [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | | [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | -| [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | +| [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | | [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | | [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | | [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | @@ -94,7 +100,7 @@ The following table describes the important changes in each release of the *AWS | Introduced the AWS SAM for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS SAM: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | | Asia Pacific \(Seoul\) Region | AWS Lambda is now available in the Asia Pacific \(Seoul\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | August 29, 2016 | | Asia Pacific \(Sydney\) Region | Lambda is now available in the Asia Pacific \(Sydney\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 23, 2016 | -| Updates to the Lambda console | The Lambda console has been updated to simplify the role\-creation process\. For more information, see [Create a Lambda function with the console](getting-started-create-function.md)\. | June 23, 2016 | +| Updates to the Lambda console | The Lambda console has been updated to simplify the role\-creation process\. For more information, see [Create a Lambda function with the console](getting-started.md#getting-started-create-function)\. | June 23, 2016 | | AWS Lambda now supports Node\.js runtime v4\.3 | AWS Lambda added support for Node\.js runtime v4\.3\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 07, 2016 | | Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md old mode 100755 new mode 100644 index d03e8d90..a5be3ac4 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -10,10 +10,9 @@ Lambda supports the following Ruby runtimes\. | Name | Identifier | SDK for Ruby | Operating system | Architectures | | --- | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** -For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. +For end of support information about Ruby 2\.5, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. diff --git a/doc_source/runtimes-context.md b/doc_source/lambda-runtime-environment.md old mode 100755 new mode 100644 similarity index 82% rename from doc_source/runtimes-context.md rename to doc_source/lambda-runtime-environment.md index 75729f85..569bb00c --- a/doc_source/runtimes-context.md +++ b/doc_source/lambda-runtime-environment.md @@ -1,8 +1,8 @@ -# AWS Lambda execution environment +# AWS Lambda execution environment -Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](using-extensions.md) associated with your function\. + Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](using-extensions.md) associated with your function\. -The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. +The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. @@ -12,6 +12,13 @@ When you create your Lambda function, you specify configuration information, suc The function's runtime and each external extension are processes that run within the execution environment\. Permissions, resources, credentials, and environment variables are shared between the function and the extensions\. +**Topics** ++ [Lambda Extensions API](runtimes-extensions-api.md) ++ [AWS Lambda runtime API](runtimes-api.md) ++ [Lambda Logs API](runtimes-logs-api.md) ++ [AWS Lambda extensions partners](extensions-api-partners.md) ++ [Lambda execution environment lifecycle](#runtimes-lifecycle) + ## Lambda execution environment lifecycle The lifecycle of the execution environment includes the following phases: @@ -56,13 +63,13 @@ The Lambda reset does not clear the `/tmp` directory content prior to the next i ### Shutdown phase -When Lambda is about to shut down the runtime, it sends a `Shutdown` event to the runtime and to each external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is a response to a `Next` API request\. +When Lambda is about to shut down the runtime, it sends a `Shutdown` event to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is a response to a `Next` API request\. **Duration**: The entire `Shutdown` phase is capped at 2 seconds\. If the runtime or any extension does not respond, Lambda terminates it via a signal \(`SIGKILL`\)\. After the function and all extensions have completed, Lambda maintains the execution environment for some time in anticipation of another function invocation\. In effect, Lambda freezes the execution environment\. When the function is invoked again, Lambda thaws the environment for reuse\. Reusing the execution environment has the following implications: + Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We recommend adding logic in your code to check if a connection exists before creating a new one\. -+ Each execution environment provides 512 MB of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. ++ Each execution environment provides 512 MB to 10,240 MB, in 1\-MB increments\. of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. + Background processes or callbacks that were initiated by your Lambda function and did not complete when the function ended resume if Lambda reuses the execution environment\. Make sure that any background processes or callbacks in your code are complete before the code exits\. When you write your function code, do not assume that Lambda automatically reuses the execution environment for subsequent function invocations\. Other factors may dictate a need for Lambda to create a new execution environment, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md old mode 100755 new mode 100644 index 2b7980e6..f0c76900 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -1,46 +1,42 @@ # Lambda runtimes -Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](configuration-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. +Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](gettingstarted-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. -When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-function-zip.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. +When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change or upgrade the runtime, you can [update your function's configuration](configuration-function-zip.md#configuration-function-runtime)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. **Amazon Linux** + Image – [amzn\-ami\-hvm\-2018\.03\.0\.20181129\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2) -+ Linux kernel – 4\.14\.171\-105\.231\.amzn1\.x86\_64 ++ Linux kernel – 4\.14 **Amazon Linux 2** + Image – Custom -+ Linux kernel – 4\.14\.165\-102\.205\.amzn2\.x86\_64 ++ Linux kernel – 4\.14 -Lambda invokes your function in an [execution environment](runtimes-context.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. +Lambda invokes your function in an [execution environment](lambda-runtime-environment.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. -A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](runtime-support-policy.md) when the version reaches end of life\. +A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](#runtime-support-policy) when the version reaches end of life\. **Node\.js runtimes** | Name | Identifier | SDK for JavaScript | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Node\.js 14 | `nodejs14.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 10 | `nodejs10.x` | 2\.1001\.0 | Amazon Linux 2 | x86\_64 | +| Node\.js 16 | `nodejs16.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | **Note** -For end of support information about Node\.js 10, see [Runtime support policy](runtime-support-policy.md)\. +For end of support information about Node\.js 10, see [Runtime deprecation policy](#runtime-support-policy)\. **Python runtimes** | Name | Identifier | AWS SDK for Python | Operating system | Architectures | | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.18\.55 botocore\-1\.21\.55 | Amazon Linux | x86\_64 | -| Python 2\.7 | `python2.7` | boto3\-1\.17\.100 botocore\-1\.20\.100 | Amazon Linux | x86\_64 | - -**Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. +| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | +| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | +| Python 3\.6 | `python3.6` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | **Ruby runtimes** @@ -48,10 +44,9 @@ Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) | Name | Identifier | SDK for Ruby | Operating system | Architectures | | --- | --- | --- | --- | --- | | Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | -| Ruby 2\.5 | `ruby2.5` | 3\.0\.1 | Amazon Linux | x86\_64 | **Note** -For end of support information about Ruby 2\.5, see [Runtime support policy](runtime-support-policy.md)\. +For end of support information about Ruby 2\.5, see [Runtime deprecation policy](#runtime-support-policy)\. **Java runtimes** @@ -79,10 +74,9 @@ Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not sup | --- | --- | --- | --- | | \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | x86\_64 | **Note** -For end of support information about \.NET Core 2\.1, see [Runtime support policy](runtime-support-policy.md)\. +For end of support information about \.NET Core 2\.1, see [Runtime deprecation policy](#runtime-support-policy)\. To use other languages in Lambda, you can implement a [custom runtime](runtimes-custom.md)\. The Lambda execution environment provides a [runtime interface](runtimes-api.md) for getting invocation events and sending responses\. You can deploy a custom runtime alongside your function code, or in a [layer](configuration-layers.md)\. @@ -95,13 +89,50 @@ To use other languages in Lambda, you can implement a [custom runtime](runtimes- | Custom Runtime | `provided` | Amazon Linux | x86\_64 | **Topics** -+ [Runtime support policy](runtime-support-policy.md) -+ [AWS Lambda execution environment](runtimes-context.md) -+ [Runtime support for Lambda container images](runtimes-images.md) -+ [AWS Lambda runtime API](runtimes-api.md) -+ [Lambda Extensions API](runtimes-extensions-api.md) -+ [Lambda Logs API](runtimes-logs-api.md) + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) ++ [Runtime deprecation policy](#runtime-support-policy) + +## Runtime deprecation policy + +[Lambda runtimes](#lambda-runtimes) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. + +Deprecation \(end of support\) for a runtime occurs in two phases\. + +Phase 1 \- Lambda no longer applies security patches or other updates to the runtime\. You can no longer **create** functions that use the runtime, but you can continue to update existing functions\. This includes updating the runtime version, and rolling back to the previous runtime version\. Note that functions that use a deprecated runtime are no longer eligible for technical support\. + +Phase 2 \- you can no longer **create or update** functions that use the runtime\. To update a function, you need to migrate it to a supported runtime version\. After you migrate the function to a supported runtime version, you cannot rollback the function to the previous runtime\. Phase 2 starts at least 30 days after the start of Phase 1\. + +Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. + +In the table below, each phase starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached or are scheduled for end of support: + + +**Runtime end of support dates** + +| Name | Identifier | Operating system | Deprecation Phase 1 | Deprecation Phase 2 | +| --- | --- | --- | --- | --- | +| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Jan 5, 2022 | Apr 13, 2022 | +| Python 3\.6 | `python3.6` | Amazon Linux | July 18, 2022 | Aug 17, 2022 | +| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Feb 14, 2022 | +| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | March 31, 2022 | +| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Feb 14, 2022 | +| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | +| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | +| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | +| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | | March 6, 2020 | +| Node\.js 0\.10 | `nodejs` | Amazon Linux | | October 31, 2016 | +| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | +| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | + +In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. + +**Language and framework support policies** ++ **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) ++ **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) ++ **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) ++ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) ++ **Go** – [golang\.org](https://golang.org/doc/devel/release.html) ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-settingup.md b/doc_source/lambda-settingup.md old mode 100755 new mode 100644 index 09907139..74d81bd2 --- a/doc_source/lambda-settingup.md +++ b/doc_source/lambda-settingup.md @@ -1,4 +1,4 @@ -# Setting up with Lambda +# Prerequisites To use AWS Lambda, you need an AWS account\. If you plan to configure and use Lambda functions from the command line, set up the AWS CLI\. You can set up other development and build tools as required for the environment and language that you are planning to use\. diff --git a/doc_source/lambda-stepfunctions.md b/doc_source/lambda-stepfunctions.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md old mode 100755 new mode 100644 diff --git a/doc_source/lambda-typescript.md b/doc_source/lambda-typescript.md new file mode 100644 index 00000000..4351befa --- /dev/null +++ b/doc_source/lambda-typescript.md @@ -0,0 +1,47 @@ +# Building Lambda functions with TypeScript + +You can use the Node\.js runtime to run TypeScript code in AWS Lambda\. Because Node\.js doesn't run TypeScript code natively, you must first transpile your TypeScript code into JavaScript\. Then, use the JavaScript files to deploy your function code to Lambda\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. + +## Setting up a TypeScript development environment + +Use a local integrated development environment \(IDE\), text editor, or [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-typescript.html) to write your TypeScript function code\. You can’t create TypeScript code on the Lambda console\. + +To transpile your TypeScript code, set up a compiler such as [esbuild](https://esbuild.github.io/) or Microsoft's TypeScript compiler \(`tsc`\) , which is bundled with the [TypeScript distribution](https://www.typescriptlang.org/download)\. You can use the [AWS Serverless Application Model \(AWS SAM\)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html) or the [AWS Cloud Development Kit \(CDK\)](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) to simplify building and deploying TypeScript code\. Both tools use esbuild to transpile TypeScript code into JavaScript\. + +When using esbuild, consider the following: ++ There are several [TypeScript caveats](https://esbuild.github.io/content-types/#typescript-caveats)\. ++ You must configure your TypeScript transpilation settings to match the Node\.js runtime that you plan to use\. For more information, see [Target](https://esbuild.github.io/api/#target) in the esbuild documentation\. For an example of a **tsconfig\.json** file that demonstrates how to target a specific Node\.js version supported by Lambda, refer to the [TypeScript GitHub repository](https://github.com/tsconfig/bases/blob/main/bases/node14.json)\. ++ esbuild doesn’t perform type checks\. To check types, use the `tsc` compiler\. Run `tsc -noEmit` or add a `"noEmit"` parameter to your **tsconfig\.json** file, as shown in the following example\. This configures `tsc` to not emit JavaScript files\. After checking types, use esbuild to convert the TypeScript files into JavaScript\. + +**Example tsconfig\.json** + +``` + { + "compilerOptions": { + "target": "es2020", + "strict": true, + "preserveConstEnums": true, + "noEmit": true, + "sourceMap": false, + "module":"commonjs", + "moduleResolution":"node", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + }, + "exclude": ["node_modules", "**/*.test.ts"] +} +``` + +**Topics** ++ [Setting up a TypeScript development environment](#typescript-dev) ++ [AWS Lambda function handler in TypeScript](typescript-handler.md) ++ [Deploy transpiled TypeScript code in Lambda with \.zip file archives](typescript-package.md) ++ [Deploy transpiled TypeScript code in Lambda with container images](typescript-image.md) ++ [AWS Lambda function errors in TypeScript](typescript-exceptions.md) + +The following topics about the Node\.js runtime are also relevant for TypeScript: ++ [AWS Lambda context object in Node\.js](nodejs-context.md) ++ [AWS Lambda function logging in Node\.js](nodejs-logging.md) ++ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-urls.md b/doc_source/lambda-urls.md new file mode 100644 index 00000000..8dce6e3f --- /dev/null +++ b/doc_source/lambda-urls.md @@ -0,0 +1,20 @@ +# Lambda function URLs + +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: + +``` +https://.lambda-url..on.aws +``` + +Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. + +Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After you configure a function URL for your function, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. Lambda function URLs use [resource\-based policies](access-control-resource-based.md) for security and access control\. Function URLs also support cross\-origin resource sharing \(CORS\) configuration options\. + +You can apply function URLs to any function alias, or to the `$LATEST` unpublished function version\. You can't add a function URL to any other function version\. + +**Topics** ++ [Creating and managing Lambda function URLs](urls-configuration.md) ++ [Security and auth model for Lambda function URLs](urls-auth.md) ++ [Invoking Lambda function URLs](urls-invocation.md) ++ [Monitoring Lambda function URLs](urls-monitoring.md) ++ [Tutorial: Creating a Lambda function with a function URL](urls-tutorial.md) \ No newline at end of file diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md old mode 100755 new mode 100644 index 526ce6c7..3bf9f78a --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -36,21 +36,26 @@ In the CloudTrail log file, the `eventName` might include date and version infor + [CreateFunction](API_CreateFunction.md) \(The `ZipFile` parameter is omitted from the CloudTrail logs for `CreateFunction`\.\) ++ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) ++ [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) + [GetEventSourceMapping](API_GetEventSourceMapping.md) + [GetFunction](API_GetFunction.md) ++ [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) + [GetPolicy](API_GetPolicy.md) + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctions](API_ListFunctions.md) ++ [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) + [RemovePermission](API_RemovePermission.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) ++ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) ## Understanding Lambda log file entries diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md old mode 100755 new mode 100644 diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md old mode 100755 new mode 100644 diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md old mode 100755 new mode 100644 diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md old mode 100755 new mode 100644 diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md old mode 100755 new mode 100644 index 9a953755..e89b82c7 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -1,6 +1,8 @@ # Working with Lambda function metrics -When your Lambda function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. You can build graphs and dashboards with these metrics on the CloudWatch console, and set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. +When your AWS Lambda function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. There is no charge for these metrics\. + +On the CloudWatch console, you can build graphs and dashboards with these metrics\. You can set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. If you want more immediate insight into your Lambda function, you can create high\-resolution [custom metrics](https://docs.aws.amazon.com/lambda/latest/operatorguide/custom-metrics.html)\. Charges apply for custom metrics and CloudWatch Alarms\. For more information, see [CloudWatch pricing\.](https://aws.amazon.com/cloudwatch/pricing/)\. This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md old mode 100755 new mode 100644 diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md old mode 100755 new mode 100644 diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md old mode 100755 new mode 100644 diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md old mode 100755 new mode 100644 index 24bba014..5cf5123d --- a/doc_source/nodejs-handler.md +++ b/doc_source/nodejs-handler.md @@ -21,7 +21,7 @@ The second argument is the [context object](nodejs-context.md), which contains i The third argument, `callback`, is a function that you can call in [non\-async handlers](#nodejs-handler-sync) to send a response\. The callback function takes two arguments: an `Error` and a response\. When you call it, Lambda waits for the event loop to be empty and then returns the response or error to the invoker\. The response object must be compatible with `JSON.stringify`\. -For async handlers, you return a response, error, or promise to the runtime instead of using `callback`\. +For asynchronous function handlers, you return a response, error, or promise to the runtime instead of using `callback`\. If your function has additional dependencies, [use npm to include them in your deployment package](nodejs-package.md#nodejs-package-dependencies)\. diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md old mode 100755 new mode 100644 index 48ce65af..261b1771 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -4,8 +4,6 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -17,9 +15,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Node\.js](#nodejs-image-base) @@ -34,20 +32,16 @@ AWS provides the following base images for Node\.js: | Tags | Runtime | Operating system | Dockerfile | | --- | --- | --- | --- | +| 16 | NodeJS 16\.x | Amazon Linux 2 | [Dockerfile for Node\.js 16\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs16.x/Dockerfile.nodejs16.x) | | 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | -| 10 | NodeJS 10\.x | Amazon Linux 2 | [Dockerfile for Node\.js 10\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs10.x/Dockerfile.nodejs10.x) | - -Docker Hub repository: amazon/aws\-lambda\-nodejs -Amazon ECR repository: gallery\.ecr\.aws/lambda/nodejs +Amazon ECR repository: [gallery\.ecr\.aws/lambda/nodejs](https://gallery.ecr.aws/lambda/nodejs) ## Using a Node\.js base image For instructions on how to use a Node\.js base image, choose the **usage** tab on [AWS Lambda base images for Node\.js](https://gallery.ecr.aws/lambda/nodejs) in the *Amazon ECR repository*\. -The instructions are also available on [AWS Lambda base images for Node\.js](https://hub.docker.com/r/amazon/aws-lambda-nodejs) in the *Docker Hub repository*\. - ## Node\.js runtime interface clients Install the runtime interface client for Node\.js using the npm package manager: @@ -62,4 +56,4 @@ You can also download the [Node\.js runtime interface client](https://github.com ## Deploy the container image -For a new function, you deploy the Node\.js image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the Node\.js image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md old mode 100755 new mode 100644 index 41bb4637..9027855e --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -81,7 +81,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -136,7 +136,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md old mode 100755 new mode 100644 diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md old mode 100755 new mode 100644 index 65896465..8aee76f8 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -23,11 +23,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. @@ -108,7 +108,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -119,7 +119,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** @@ -174,6 +174,6 @@ Resources: - nodejs12.x ``` -With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/permissions-boundary.md b/doc_source/permissions-boundary.md old mode 100755 new mode 100644 diff --git a/doc_source/powershell-context.md b/doc_source/powershell-context.md old mode 100755 new mode 100644 diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md old mode 100755 new mode 100644 diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md old mode 100755 new mode 100644 diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md old mode 100755 new mode 100644 diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md old mode 100755 new mode 100644 index f2bb52f6..5a322009 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -39,7 +39,7 @@ Importing module ./Modules/AWSPowerShell.NetCore/3.3.618.0/AWSPowerShell.NetCore [Information] - AWS_LAMBDA_FUNCTION_VERSION=$LATEST [Information] - AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/blank-powershell-function-18CIXMPLHFAJJ [Information] - AWS_LAMBDA_LOG_STREAM_NAME=2020/04/01/[$LATEST]53c5xmpl52d64ed3a744724d9c201089 -[Information] - AWS_EXECUTION_ENV=AWS_Lambda_dotnetcore2.1_powershell_1.0.0 +[Information] - AWS_EXECUTION_ENV=AWS_Lambda_dotnet6_powershell_1.0.0 [Information] - AWS_LAMBDA_FUNCTION_NAME=blank-powershell-function-18CIXMPLHFAJJ [Information] - PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin [Information] - ## Event @@ -91,7 +91,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -146,7 +146,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md old mode 100755 new mode 100644 diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md old mode 100755 new mode 100644 index da53abaf..9597a647 --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -29,7 +29,7 @@ To manage provisioned concurrency settings for a version or alias, use the Lambd If you change the version that an alias points to, Lambda deallocates the provisioned concurrency from the old version and allocates it to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. For more information, see [Lambda function aliases](configuration-aliases.md)\. Note that you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. **Note** - Provisioned Concurrency is not supported on $LATEST\. Ensure your client application is not pointing to $LATEST before configuring provisioned concurrency\. + Provisioned Concurrency is not supported on the unpublished version of the function \($LATEST\)\. Ensure your client application is not pointing to $LATEST before configuring provisioned concurrency\. **To allocate provisioned concurrency for an alias or version** @@ -139,7 +139,7 @@ Application Auto Scaling allows you to manage provisioned concurrency on a sched To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` Application Auto Scaling API operations to register a target and create a scaling policy: -1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `function`my\-: +1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `my-function`: ``` aws application-autoscaling register-scalable-target --service-namespace lambda \ diff --git a/doc_source/python-context.md b/doc_source/python-context.md old mode 100755 new mode 100644 index 6a259e73..59f1d264 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,7 +1,7 @@ # AWS Lambda context object in Python **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md old mode 100755 new mode 100644 index 7793b3eb..fd9b07ee --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,7 +1,7 @@ # AWS Lambda function errors in Python **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md old mode 100755 new mode 100644 index a8a3bc70..e19cc90e --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,7 +1,7 @@ # Lambda function handler in Python **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. diff --git a/doc_source/python-image.md b/doc_source/python-image.md old mode 100755 new mode 100644 index 6709b05d..9d80c4e5 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,14 +1,12 @@ # Deploy Python Lambda functions with container images **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -20,9 +18,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Python](#python-image-base) @@ -44,9 +42,7 @@ AWS provides the following base images for Python: | 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | | 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | -Docker Hub repository: amazon/aws\-lambda\-python - -Amazon ECR repository: gallery\.ecr\.aws/lambda/python +Amazon ECR repository: [gallery\.ecr\.aws/lambda/python](https://gallery.ecr.aws/lambda/python) ## Create a Python image from an AWS base image @@ -108,4 +104,4 @@ You can also download the [Python runtime interface client](https://github.com/a ## Deploy the container image -For a new function, you deploy the Python image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the Python image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md old mode 100755 new mode 100644 index 5fba3a46..cd833a4d --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,7 +1,7 @@ # AWS Lambda function logging in Python **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. @@ -73,7 +73,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -128,7 +128,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/python-package.md b/doc_source/python-package.md old mode 100755 new mode 100644 index cd9c70dd..0f757e90 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,7 +1,7 @@ # Deploy Python Lambda functions with \.zip file archives **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. @@ -16,7 +16,7 @@ To create the deployment package for a \.zip file archive, you can use a built\- **Note** A python package may contain initialization code in the \_\_init\_\_\.py file\. Prior to Python 3\.9, Lambda did not run the \_\_init\_\_\.py code for packages in the function handler’s directory or parent directories\. In Python 3\.9 and later releases, Lambda runs the init code for packages in these directories during initialization\. -Note that Lambda runs the init code only when the execution environment is first initialized, not for each function invocation in that intialized environment\. +Note that Lambda runs the init code only when the execution environment is first initialized, not for each function invocation in that initialized environment\. **Topics** + [Prerequisites](#python-package-prereqs) diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md old mode 100755 new mode 100644 index 7b1a6c85..40775db9 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,7 +1,7 @@ # Instrumenting Python code in AWS Lambda **Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime support policy](runtime-support-policy.md)\. +End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. @@ -26,11 +26,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. @@ -89,7 +89,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -100,7 +100,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** @@ -155,6 +155,6 @@ Resources: - python3.8 ``` -With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-context.md b/doc_source/ruby-context.md old mode 100755 new mode 100644 diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md old mode 100755 new mode 100644 diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md old mode 100755 new mode 100644 index fe3c6e88..bba1956f --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -36,4 +36,4 @@ The two objects that the handler accepts are the invocation event and context\. The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environment](runtimes-context.md)\. \ No newline at end of file +Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environment](lambda-runtime-environment.md)\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md old mode 100755 new mode 100644 index d42ca1e3..b8602556 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -4,8 +4,6 @@ You can deploy your Lambda function code as a [container image](images-create.md + AWS base images for Lambda These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - - AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. + Open\-source runtime interface clients \(RIC\) If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. @@ -17,9 +15,9 @@ The workflow for a function defined as a container image includes these steps: 1. Build your container image using the resources listed in this topic\. -1. Upload the image to your Amazon ECR container registry\. See steps 7\-9 in [Create image](images-create.md#images-create-from-base)\. +1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. -1. [Create](configuration-images.md#configuration-images-create) the Lambda function or [update the function code](configuration-images.md#configuration-images-update) to deploy the image to an existing function\. +1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. **Topics** + [AWS base images for Ruby](#ruby-image-base) @@ -38,15 +36,11 @@ AWS provides the following base images for Ruby: | 2, 2\.7 | Ruby 2\.7 | Amazon Linux 2 | [Dockerfile for Ruby 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.7/Dockerfile.ruby2.7) | | 2\.5 | Ruby 2\.5 | Amazon Linux 2018\.03 | [Dockerfile for Ruby 2\.5 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.5/Dockerfile.ruby2.5) | -Docker Hub repository: amazon/aws\-lambda\-ruby - -Amazon ECR repository: gallery\.ecr\.aws/lambda/ruby +Amazon ECR repository: [gallery\.ecr\.aws/lambda/ruby](https://gallery.ecr.aws/lambda/ruby) ## Using a Ruby base image -For instructions on how to use a Ruby base image, choose the **usage** tab on [AWS Lambda base images for Ruby](https://gallery.ecr.aws/lambda/ruby) in the *Amazon ECR repository*\. - -The instructions are also available on [AWS Lambda base images for Ruby](https://hub.docker.com/r/amazon/aws-lambda-ruby) in the *Docker Hub repository*\. +For instructions on how to use a Ruby base image, choose the **usage** tab on [AWS Lambda base images for Ruby](https://gallery.ecr.aws/lambda/ruby) in the *Amazon ECR repository*\. ## Ruby runtime interface clients @@ -103,4 +97,4 @@ When you build a container image for Ruby using an AWS base image, you only need ## Deploy the container image -For a new function, you deploy the Ruby image when you [create the function](configuration-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](configuration-images.md#configuration-images-update)\. \ No newline at end of file +For a new function, you deploy the Ruby image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md old mode 100755 new mode 100644 index 9a57855a..9376cf77 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -103,7 +103,7 @@ You can use the Amazon CloudWatch console to view logs for all Lambda function i 1. Choose a log stream\. -Each log stream corresponds to an [instance of your function](runtimes-context.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. +Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. @@ -158,7 +158,7 @@ The cli\-binary\-format option is required if you are using AWS CLI version 2\. aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out sed -i'' -e 's/"//g' out sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 +aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 ``` **Example macOS and Linux \(only\)** diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md old mode 100755 new mode 100644 diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md old mode 100755 new mode 100644 index 0ea13d40..f40b734a --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -23,11 +23,11 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. @@ -88,7 +88,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -99,7 +99,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** @@ -154,6 +154,6 @@ Resources: - ruby2.5 ``` -With this configuration, you only update library layer if you change your runtime dependencies\. The function deployment package only contains your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtime-support-policy.md b/doc_source/runtime-support-policy.md deleted file mode 100755 index 201e3cf2..00000000 --- a/doc_source/runtime-support-policy.md +++ /dev/null @@ -1,41 +0,0 @@ -# Runtime support policy - -[Lambda runtimes](lambda-runtimes.md) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. - -Deprecation \(end of support\) for a runtime occurs in two phases\. In phase 1, Lambda no longer applies security patches or other updates to the runtime\. You can no longer create functions that use the runtime, but you can continue to update existing functions\. This includes updating the runtime version, and rolling back to the previous runtime version\. Note that functions that use a deprecated runtime are no longer eligible for technical support\. - -In phase 2, which starts at least 30 days after the start of phase 1, you can no longer create or update functions that use the runtime\. To update a function, you need to migrate it to a supported runtime version\. After you migrate the function to a supported runtime version, you cannot rollback the function to the previous runtime\. - -Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. - -**Important** -Python 2\.7 reached end of life on January 1, 2020\. End of support \(phase 1\) for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Announcing end of support for Python 2\.7 in AWS Lambda](http://aws.amazon.com/blogs/compute/announcing-end-of-support-for-python-2-7-in-aws-lambda/) on the AWS Compute Blog\. - -In the table below, each of the phases starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached or are scheduled for end of support: - - -**Runtime end of support dates** - -| Name | Identifier | Operating system | End of support phase 1 start | End of support phase 2 start | -| --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Jan 5, 2022 | Feb 14, 2022 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Feb 14, 2022 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | Feb 14, 2022 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Feb 14, 2022 | -| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | -| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | -| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | -| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | | March 6, 2020 | -| Node\.js 0\.10 | `nodejs` | Amazon Linux | | October 31, 2016 | -| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | -| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | - -In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. - -**Language and framework support policies** -+ **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) -+ **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) -+ **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) -+ **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md old mode 100755 new mode 100644 index 8e13f1bf..69cc6f2d --- a/doc_source/runtimes-api.md +++ b/doc_source/runtimes-api.md @@ -2,6 +2,8 @@ AWS Lambda provides an HTTP API for [custom runtimes](runtimes-custom.md) to receive invocation events from Lambda and send response data back within the Lambda [execution environment](lambda-runtimes.md)\. +![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) + The OpenAPI specification for the runtime API version **2018\-06\-01** is available in [runtime\-api\.zip](samples/runtime-api.zip) To create an API request URL, runtimes get the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and add the desired resource path\. @@ -73,13 +75,13 @@ If the function returns an error or the runtime encounters an error during initi **Headers** -`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. +`Lambda-Runtime-Function-Error-Type` – Error type that the runtime encountered\. Required: no\. This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: + Runtime\.NoSuchHandler -+ Extension\.APIKeyNotFound -+ Extension\.ConfigInvalid -+ Extension\.UnknownReason ++ Runtime\.APIKeyNotFound ++ Runtime\.ConfigInvalid ++ Runtime\.UnknownReason **Body parameters** @@ -116,7 +118,7 @@ The following example shows a Lambda function error message in which the functio **Response codes** + 202 – Accepted + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. ++ 500 – Container error\. Non\-recoverable state\. Runtime should exit promptly\. **Example initialization error request** @@ -135,13 +137,13 @@ If the function returns an error or the runtime encounters an error, the runtime **Headers** -`Lambda-Runtime-Function-Error-Type` – Error type that the extension encountered\. Required: no\. +`Lambda-Runtime-Function-Error-Type` – Error type that the runtime encountered\. Required: no\. This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: + Runtime\.NoSuchHandler -+ Extension\.APIKeyNotFound -+ Extension\.ConfigInvalid -+ Extension\.UnknownReason ++ Runtime\.APIKeyNotFound ++ Runtime\.ConfigInvalid ++ Runtime\.UnknownReason **Body parameters** @@ -179,7 +181,7 @@ The following example shows a Lambda function error message in which the functio + 202 – Accepted + 400 – Bad Request + 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. ++ 500 – Container error\. Non\-recoverable state\. Runtime should exit promptly\. **Example error request** diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md old mode 100755 new mode 100644 diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md old mode 100755 new mode 100644 index 371cc746..06960cfd --- a/doc_source/runtimes-custom.md +++ b/doc_source/runtimes-custom.md @@ -38,7 +38,7 @@ cd $LAMBDA_TASK_ROOT ./node-v11.1.0-linux-x64/bin/node runtime.js ``` -Your runtime code is responsible for completing some initialization tasks\. Then it processes invocation events in a loop until it's terminated\. The initialization tasks run once [per instance of the function](runtimes-context.md) to prepare the environment to handle invocations\. +Your runtime code is responsible for completing some initialization tasks\. Then it processes invocation events in a loop until it's terminated\. The initialization tasks run once [per instance of the function](lambda-runtime-environment.md) to prepare the environment to handle invocations\. **Initialization tasks** + **Retrieve settings** – Read environment variables to get details about the function and environment\. diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md old mode 100755 new mode 100644 index 94d26b24..484cd1a6 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -1,27 +1,12 @@ # Lambda Extensions API -Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, AWS Partners, and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. +Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, [AWS Partners](extensions-api-partners.md), and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/aws/getting-started-with-using-your-favorite-operational-tools-on-aws-lambda-extensions-are-now-generally-available/) on the AWS Compute Blog\. -As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](runtimes-context.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. +![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) -An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with all of the supported runtimes\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. +As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](lambda-runtime-environment.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. -The following [Lambda runtimes](lambda-runtimes.md) support extensions: -+ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) -+ Custom runtime \(`provided`\) -+ Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Java 11 \(Corretto\) \(`java11`\) -+ Java 8 \(Corretto\) \(`java8.al2`\) -+ Node\.js 14\.x \(`nodejs14.x`\) -+ Node\.js 12\.x \(`nodejs12.x`\) -+ Node\.js 10\.x \(`nodejs10.x`\) -+ Python 3\.9 \(`python3.9`\) -+ Python 3\.8 \(`python3.8`\) -+ Python 3\.7 \(`python3.7`\) -+ Ruby 2\.7 \(`ruby2.7`\) -+ Ruby 2\.5 \(`ruby2.5`\) - -Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. +An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with supported runtimes\. All [Lambda runtimes](lambda-runtimes.md) support extensions\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. @@ -116,10 +101,10 @@ Function developers can run different versions of their functions side by side t ### Shutdown phase -When Lambda is about to shut down the runtime, it sends a `Shutdown` event to the runtime and then to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. +When Lambda is about to shut down the runtime, it sends a `Shutdown` to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. **Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: -+ 300 ms – A function with no registered extensions ++ 0 ms – A function with no registered extensions + 500 ms – A function with a registered internal extension + 2,000 ms – A function with one or more registered external extensions @@ -281,7 +266,7 @@ The extension uses this method to report an initialization error to Lambda\. Cal `Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Runtime\.NoSuchHandler ++ Extension\.NoSuchHandler + Extension\.APIKeyNotFound + Extension\.ConfigInvalid + Extension\.UnknownReason @@ -338,7 +323,7 @@ The extension uses this method to report an error to Lambda before exiting\. Cal `Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Runtime\.NoSuchHandler ++ Extension\.NoSuchHandler + Extension\.APIKeyNotFound + Extension\.ConfigInvalid + Extension\.UnknownReason diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md old mode 100755 new mode 100644 index a2e180f8..984482eb --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -1,4 +1,4 @@ -# Runtime support for Lambda container images +# Base images for Lambda AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. @@ -35,9 +35,7 @@ AWS provides base images that contain the required Lambda components and the Ama | al2 | provided\.al2 | Amazon Linux 2 | | alami | provided | Amazon Linux | -DockerHub: amazon/aws\-lambda\-provided - -ECR Public: public\.ecr\.aws/lambda/provided +Amazon ECR Public Gallery: [gallery\.ecr\.aws/lambda/provided](https://gallery.ecr.aws/lambda/provided) ## Runtime interface clients diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md old mode 100755 new mode 100644 index 7c8d7571..37a9082c --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -2,7 +2,7 @@ Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. -[Lambda extensions](runtimes-extensions-api.md) can use the Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda [execution environment](runtimes-context.md)\. Lambda streams the logs to the extension, and the extension can then process, filter, and send the logs to any preferred destination\. +[Lambda extensions](runtimes-extensions-api.md) can use the Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda [execution environment](lambda-runtime-environment.md)\. Lambda streams the logs to the extension, and the extension can then process, filter, and send the logs to any preferred destination\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) @@ -28,7 +28,7 @@ Lambda sends all logs to CloudWatch, even when an extension subscribes to one or A Lambda extension can subscribe to receive logs by sending a subscription request to the Logs API\. -To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](runtimes-context.md#runtimes-lifecycle-ib)\. After the initialization phase completes, Lambda does not process subscription requests\. +To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](lambda-runtime-environment.md#runtimes-lifecycle-ib)\. After the initialization phase completes, Lambda does not process subscription requests\. **Note** Logs API subscription is idempotent\. Duplicate subscribe requests do not result in duplicate subscriptions\. diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md old mode 100755 new mode 100644 index a571dd38..46fcb149 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -7,7 +7,7 @@ Lambda provides language\-specific [environment variables](configuration-envvars ## Language\-specific environment variables Lambda supports configuration\-only ways to enable code to be pre\-loaded during function initialization through the following language\-specific environment variables: -+ `JAVA_TOOL_OPTIONS` – On Java 11 and Java 8 \(`java8.al2`\), Lambda supports this environment variable to set additional command\-line variables in Lambda\. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the `agentlib` or `javaagent` options\. ++ `JAVA_TOOL_OPTIONS` – On Java, Lambda supports this environment variable to set additional command\-line variables in Lambda\. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the `agentlib` or `javaagent` options\. + `NODE_OPTIONS` – On Node\.js 10x and above, Lambda supports this environment variable\. + `DOTNET_STARTUP_HOOKS` – On \.NET Core 3\.1 and above, this environment variable specifies a path to an assembly \(dll\) that Lambda can use\. diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md old mode 100755 new mode 100644 index 843fb4fc..e942a02b --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -4,7 +4,7 @@ In this tutorial, you create a Lambda function with a custom runtime\. You start ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md old mode 100755 new mode 100644 diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md old mode 100755 new mode 100644 diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md old mode 100755 new mode 100644 diff --git a/doc_source/security-compliance.md b/doc_source/security-compliance.md old mode 100755 new mode 100644 diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md old mode 100755 new mode 100644 index c995e7a0..3abaed8c --- a/doc_source/security-configuration.md +++ b/doc_source/security-configuration.md @@ -2,6 +2,6 @@ AWS Lambda provides [runtimes](lambda-runtimes.md) that run your function code in an Amazon Linux–based execution environment\. Lambda is responsible for keeping software in the runtime and execution environment up to date, releasing new runtimes for new languages and frameworks, and deprecating runtimes when the underlying software is no longer supported\. -If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](gettingstarted-images.md#gettingstarted-images-package), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. +If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](images-create.md), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. -Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime support policy](runtime-support-policy.md)\. \ No newline at end of file +Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md old mode 100755 new mode 100644 index 28df3a13..f64307f8 --- a/doc_source/security-dataprotection.md +++ b/doc_source/security-dataprotection.md @@ -30,6 +30,6 @@ You can use [environment variables](configuration-envvars.md) to store secrets s On a per\-function basis, you can optionally configure Lambda to use a customer managed key instead of the default AWS managed key to encrypt your environment variables\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. -Lambda always encrypts files that you upload to Lambda, including [deployment packages](gettingstarted-images.md#gettingstarted-images-package) and [layer archives](configuration-layers.md)\. +Lambda always encrypts files that you upload to Lambda, including [deployment packages](images-create.md) and [layer archives](configuration-layers.md)\. Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md old mode 100755 new mode 100644 diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md old mode 100755 new mode 100644 diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md old mode 100755 new mode 100644 diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md old mode 100755 new mode 100644 diff --git a/doc_source/security_iam_service-with-iam.md b/doc_source/security_iam_service-with-iam.md old mode 100755 new mode 100644 diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md old mode 100755 new mode 100644 diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md old mode 100755 new mode 100644 diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md old mode 100755 new mode 100644 diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md old mode 100755 new mode 100644 diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md old mode 100755 new mode 100644 diff --git a/doc_source/services-apigateway-template.md b/doc_source/services-apigateway-template.md old mode 100755 new mode 100644 diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md old mode 100755 new mode 100644 index feb395a0..cba4383f --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -27,7 +27,7 @@ For more information about these API Gateway features, see [Set up a proxy integ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md old mode 100755 new mode 100644 index df218f34..0f68c728 --- a/doc_source/services-apigateway.md +++ b/doc_source/services-apigateway.md @@ -26,13 +26,15 @@ Resources in your API define one or more methods, such as GET or POST\. Methods 1. Choose a function\. -1. Under **Functional overview**, choose **Add trigger**\. +1. Under **Function overview**, choose **Add trigger**\. 1. Select **API Gateway**\. -1. For **API**, choose **Create an API**\. +1. Choose **Create an API** or **Use an existing API**\. -1. For **API type**, choose **HTTP API**\. For more information, see [API types](#services-apigateway-apitypes) + 1. **New API:** For **API type**, choose **HTTP API**\. For more information, see [API types](#services-apigateway-apitypes)\. + + 1. **Existing API:** Select the API from the dropdown menu or enter the API ID \(for example, r3pmxmplak\)\. 1. For **Security**, choose **Open**\. @@ -139,7 +141,7 @@ The Lambda runtime serializes the response object into JSON and sends it to the Amazon API Gateway gets permission to invoke your function from the function's [resource\-based policy](access-control-resource-based.md)\. You can grant invoke permission to an entire API, or grant limited access to a stage, resource, or method\. -When you add an API to your function by using the Lambda console, using the API Gateway console, or in an AWS SAM template, the function's resource\-based policy is updated automatically\. The following example shows a function policy with a statement that was added by an AWS SAM template\. +When you add an API to your function by using the Lambda console, using the API Gateway console, or in an AWS SAM template, the function's resource\-based policy is updated automatically\. The following is an example function policy\. **Example function policy** @@ -169,8 +171,6 @@ When you add an API to your function by using the Lambda console, using the API } ``` -[Confirm the function policy](access-control-resource-based.md) in the **Permissions** tab of the Lambda console\. - You can manage function policy permissions manually with the following API operations: + [AddPermission](API_AddPermission.md) + [RemovePermission](API_RemovePermission.md) diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md old mode 100755 new mode 100644 diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md old mode 100755 new mode 100644 diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md old mode 100755 new mode 100644 index 27d178da..4bbb1202 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ b/doc_source/services-cloudwatchevents-tutorial.md @@ -9,7 +9,7 @@ In this tutorial, you do the following: ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. ## Create a Lambda function diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md old mode 100755 new mode 100644 diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md old mode 100755 new mode 100644 diff --git a/doc_source/services-codecommit.md b/doc_source/services-codecommit.md old mode 100755 new mode 100644 diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md old mode 100755 new mode 100644 diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md old mode 100755 new mode 100644 diff --git a/doc_source/services-config.md b/doc_source/services-config.md old mode 100755 new mode 100644 index e1dfc5ea..3a9e0933 --- a/doc_source/services-config.md +++ b/doc_source/services-config.md @@ -10,11 +10,11 @@ You can use AWS Lambda functions to evaluate whether your AWS resource configura "ruleParameters": "{\"myParameterKey\":\"myParameterValue\"}", "resultToken": "myResultToken", "eventLeftScope": false, - "executionRoleArn": "arn:aws:iam::012345678912:role/config-role", - "configRuleArn": "arn:aws:config:us-east-1:012345678912:config-rule/config-rule-0123456", + "executionRoleArn": "arn:aws:iam::111122223333:role/config-role", + "configRuleArn": "arn:aws:config:us-east-1:111122223333:config-rule/config-rule-0123456", "configRuleName": "change-triggered-config-rule", "configRuleId": "config-rule-0123456", - "accountId": "012345678912", + "accountId": "111122223333", "version": "1.0" } ``` diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md old mode 100755 new mode 100644 diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md old mode 100755 new mode 100644 diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md old mode 100755 new mode 100644 index ee9b970d..21fc692b --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -12,11 +12,11 @@ EventBridge \(CloudWatch Events\) invokes your Lambda function asynchronously wi "id": "b6ba298a-7732-2226-xmpl-976312c1a050", "detail-type": "EC2 Instance State-change Notification", "source": "aws.ec2", - "account": "123456798012", + "account": "111122223333", "time": "2019-10-02T17:59:30Z", "region": "us-east-2", "resources": [ - "arn:aws:ec2:us-east-2:123456798012:instance/i-0c314xmplcd5b8173" + "arn:aws:ec2:us-east-2:111122223333:instance/i-0c314xmplcd5b8173" ], "detail": { "instance-id": "i-0c314xmplcd5b8173", diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md old mode 100755 new mode 100644 diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md old mode 100755 new mode 100644 index 785af70b..c9cfbf05 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -9,7 +9,7 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md old mode 100755 new mode 100644 diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md old mode 100755 new mode 100644 diff --git a/doc_source/services-kinesisfirehose.md b/doc_source/services-kinesisfirehose.md old mode 100755 new mode 100644 diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md old mode 100755 new mode 100644 diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md old mode 100755 new mode 100644 index 33b28b27..2f7239b6 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -9,7 +9,7 @@ For details on using Lambda with Amazon VPC, see [Configuring a Lambda function ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md old mode 100755 new mode 100644 diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md old mode 100755 new mode 100644 diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md old mode 100755 new mode 100644 diff --git a/doc_source/services-ses.md b/doc_source/services-ses.md old mode 100755 new mode 100644 index 43858e5c..9b08ce31 --- a/doc_source/services-ses.md +++ b/doc_source/services-ses.md @@ -88,7 +88,7 @@ When you use Amazon SES to receive messages, you can configure Amazon SES to cal "action": { "type": "Lambda", "invocationType": "Event", - "functionArn": "arn:aws:lambda:us-west-2:012345678912:function:Example" + "functionArn": "arn:aws:lambda:us-west-2:111122223333:function:Example" }, "spfVerdict": { "status": "PASS" diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md old mode 100755 new mode 100644 diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md old mode 100755 new mode 100644 index 71fe5a4a..96377ffb --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -21,13 +21,13 @@ To trace requests that don't have a tracing header, enable active tracing in you 1. Choose **Save**\. **Pricing** -X\-Ray has a perpetual free tier\. Beyond the free tier threshold, X\-Ray charges for trace storage and retrieval\. For details, see [AWS X\-Ray pricing](https://aws.amazon.com/xray/pricing/)\. +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rule is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. -In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](runtimes-context.md)\. +In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](lambda-runtime-environment.md)\. The `Initialization` subsegment represents the init phase of the Lambda execution environment lifecycle\. During this phase, Lambda creates or unfreezes an execution environment with the resources you have configured, downloads the function code and all layers, initializes extensions, initializes the runtime, and runs the function's initialization code\. @@ -48,7 +48,7 @@ See the following topics for a language\-specific introduction to tracing in Lam + [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) + [Instrumenting Python code in AWS Lambda](python-tracing.md) + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) -+ [Instrumenting Java code in AWS Lambda](java-tracing.md) ++ [Instrumenting Java code in Lambda](java-tracing.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) + [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) @@ -85,7 +85,7 @@ To manage tracing configuration with the AWS CLI or AWS SDK, use the following A + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) -The following example AWS CLI command enables active tracing on a function named my\-function\. +The following example AWS CLI command enables active tracing on a function named **my\-function**\. ``` aws lambda update-function-configuration --function-name my-function \ @@ -96,7 +96,7 @@ Tracing mode is part of the version\-specific configuration that is locked when ## Enabling active tracing with AWS CloudFormation -To enable active tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. +To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. **Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md old mode 100755 new mode 100644 diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md old mode 100755 new mode 100644 diff --git a/doc_source/testing-functions.md b/doc_source/testing-functions.md new file mode 100644 index 00000000..fc2a5e51 --- /dev/null +++ b/doc_source/testing-functions.md @@ -0,0 +1,98 @@ +# Testing Lambda functions in the console + +You can test your Lambda function in the console by invoking your function with a test event\. A *test event* is a JSON input to your function\. If your function doesn't require input, the event can be an empty document `({})`\. + +## Private test events + +Private test events are available only to the event creator, and they require no additional permissions to use\. You can create and save up to 10 private test events per function\. + +**To create a private test event** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function that you want to test\. + +1. Choose the **Test** tab\. + +1. Under **Test event**, do the following: + + 1. Choose a **Template**\. + + 1. Enter a **Name** for the test\. + + 1. In the text entry box, enter the JSON test event\. + + 1. Under **Event sharing settings**, choose **Private**\. + +1. Choose **Save changes**\. + +You can also create new test events on the **Code** tab\. From there, choose **Test**, **Configure test event**\. + +## Shareable test events + +Shareable test events are test events that you can share with other AWS Identity and Access Management \(IAM\) users in the same AWS account\. You can edit other users' shareable test events and invoke your function with them\. + +Lambda saves shareable test events as schemas in an [Amazon EventBridge \(CloudWatch Events\) schema registry](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schema-registry.html) named `lambda-testevent-schemas`\. As Lambda utilizes this registry to store and call shareable test events you create, we recommend that you do not edit this registry or create a registry using the `lambda-testevent-schemas` name\. + +To see, share, and edit shareable test events, you must have permissions for all of the following [EventBridge \(CloudWatch Events\) schema registry API operations](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/operations.html): ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#CreateRegistry](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#CreateRegistry) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#CreateSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#CreateSchema) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DeleteSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DeleteSchema) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-version-schemaversion.html#DeleteSchemaVersion](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-version-schemaversion.html#DeleteSchemaVersion) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#DescribeRegistry](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#DescribeRegistry) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DescribeSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DescribeSchema) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discover.html#GetDiscoveredSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discover.html#GetDiscoveredSchema) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-versions.html#ListSchemaVersions](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-versions.html#ListSchemaVersions) ++ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#UpdateSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#UpdateSchema) + +Note that saving edits made to a shareable test event overwrites that event\. + +If you cannot create, edit, or see shareable test events, check that your account has the required permissions for these operations\. If you have the required permissions but still cannot access shareable test events, check for any [resource\-based policies](access-control-resource-based.md) that might limit access to the EventBridge \(CloudWatch Events\) registry\. + +**To create a shareable test event** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function that you want to test\. + +1. Choose the **Test** tab\. + +1. Under **Test event**, do the following: + + 1. Choose a **Template**\. + + 1. Enter a **Name** for the test\. + + 1. In the text entry box, enter the JSON test event\. + + 1. Under **Event sharing settings**, choose **Shareable**\. + +1. Choose **Save changes**\. + +## Invoking functions with test events + +When you run a test event in the console, Lambda synchronously invokes your function with the test event\. The function runtime converts the JSON document into an object and passes it to your code's handler method for processing\. + +**To test a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function that you want to test\. + +1. Choose the **Test** tab\. + +1. Under **Test event**, choose **Saved event**, and then choose the saved event that you want to use\. + +1. Choose **Test**\. + +1. To review the test results, under **Execution result**, expand **Details**\. + +To invoke your function without saving your test event, choose **Test** before saving\. This creates an unsaved test event that Lambda preserves for the duration of the session\. + +You can also access your saved and unsaved test events on the **Code** tab\. From there, choose **Test**, and then choose your test event\. + +## Deleting shareable test event schemas + +When you delete shareable test events, Lambda removes them from the `lambda-testevent-schemas` registry\. If you remove the last shareable test event from the registry, Lambda deletes the registry\. + +If you delete the function, Lambda does not delete any associated shareable test event schemas\. You must clean up these resources manually from the [EventBridge \(CloudWatch Events\) console](https://console.aws.amazon.com/events)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md old mode 100755 new mode 100644 diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md old mode 100755 new mode 100644 diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md old mode 100755 new mode 100644 diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md old mode 100755 new mode 100644 index afdc6aef..3d9f1b2f --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -67,7 +67,7 @@ Lambda uses a simple probabilistic model to distribute the traffic between the t When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](provisioned-concurrency.md), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: + [Check that provisioned concurrency is enabled](provisioned-concurrency.md) on the function version or alias\. **Note** -Provisioned concurrency is not configurable on the [$LATEST version](configuration-images.md#configuration-images-latest)\. +Provisioned concurrency is not configurable on the [$LATEST version](gettingstarted-images.md#configuration-images-latest)\. + Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. + Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. + Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md old mode 100755 new mode 100644 diff --git a/doc_source/typescript-exceptions.md b/doc_source/typescript-exceptions.md new file mode 100644 index 00000000..246b6923 --- /dev/null +++ b/doc_source/typescript-exceptions.md @@ -0,0 +1,90 @@ +# AWS Lambda function errors in TypeScript + +If an exception occurs in TypeScript code that's transpiled into JavaScript, use source map files to determine where the error occurred\. Source map files allow debuggers to map compiled JavaScript files to the TypeScript source code\. + +For example, the following code results in an error: + +``` +export const handler = async (event: unknown): Promise => { + throw new Error('Some exception'); +}; +``` + +AWS Lambda catches the error and generates a JSON document\. However, this JSON document refers to the compiled JavaScript file \(**app\.js**\), not the TypeScript source file\. + +``` +{ + "errorType": "Error", + "errorMessage": "Some exception", + "stack": [ + "Error: Some exception", + " at Runtime.p [as handler] (/var/task/app.js:1:491)", + " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" + ] +} +``` + +**To get an error response that maps to your TypeScript source file** +**Note** +The following steps aren't valid for Lambda@Edge functions because Lambda@Edge doesn't support environment variables\. + +1. Generate a source map file with esbuild or another TypeScript compiler\. Example: + + ``` + esbuild app.ts —sourcemap —outfile=output.js + ``` + +1. Add the source map to your deployment\. + +1. Turn on source maps for the Node\.js runtime by adding `--enable-source-maps` to your `NODE_OPTIONS`\. + +**Example for the AWS Serverless Application Model \(AWS SAM\)** + +``` +Globals: + Function: + Environment: + Variables: + NODE_OPTIONS: '--enable-source-maps' +``` +Make sure that the esbuild properties in your **template\.yaml** file include `Sourcemap: true`\. Example: + +``` +Metadata: # Manage esbuild properties + BuildMethod: esbuild + BuildProperties: + Minify: true + Target: "es2020" + Sourcemap: true + EntryPoints: + - app.ts +``` + +**Example for the AWS Cloud Development Kit \(CDK\)** +To use a source map with an AWS CDK application, add the following code to the file that contains the [NodejsFunction construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html)\. + +``` +const helloFunction = new NodejsFunction(this, 'function',{ + bundling: { + minify: true, + sourceMap: true + }, + environment:{ + NODE_OPTIONS: '--enable-source-maps', + } +}); +``` + +When you use a source map in your code, you get an error response similar to the following\. This response shows that the error happened at line 2, column 11 in the **app\.ts** file\. + +``` +{ + "errorType": "Error", + "errorMessage": "Some exception", + "stack": [ + "Error: Some exception", + " at Runtime.p (/private/var/folders/3c/0d4wz7dn2y75bw_hxdwc0h6w0000gr/T/tmpfmxb4ziy/app.ts:2:11)", + " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" + ] +} +``` \ No newline at end of file diff --git a/doc_source/typescript-handler.md b/doc_source/typescript-handler.md new file mode 100644 index 00000000..b0328acf --- /dev/null +++ b/doc_source/typescript-handler.md @@ -0,0 +1,99 @@ +# AWS Lambda function handler in TypeScript + +The AWS Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. + +The Node\.js runtime passes three arguments to the handler method: ++ The `event` object: Contains information from the invoker\. ++ The [context object](nodejs-context.md): Contains information about the invocation, function, and execution environment\. ++ The third argument, `callback`, is a function that you can call in non\-async handlers to send a response\. For async handlers, you return a response, error, or promise to the runtime instead of using `callback`\. + +## Non\-async handlers + +For non\-async handlers, the runtime passes the event object, the [context object](nodejs-context.md), and the callback function to the handler method\. The response object in the callback function must be compatible with `JSON.stringify`\. + +**Example TypeScript function – synchronous** + +``` +import { Context, APIGatewayProxyCallback, APIGatewayEvent } from 'aws-lambda'; + +export const lambdaHandler = (event: APIGatewayEvent, context: Context, callback: APIGatewayProxyCallback): void => { + console.log(`Event: ${JSON.stringify(event, null, 2)}`); + console.log(`Context: ${JSON.stringify(context, null, 2)}`); + callback(null, { + statusCode: 200, + body: JSON.stringify({ + message: 'hello world', + }), + }); +}; +``` + +## Async handlers + +For async handlers, you can use `return` and `throw` to send a response or error, respectively\. Functions must use the `async` keyword to use these methods to return a response or error\. + +If your code performs an asynchronous task, return a promise to make sure that it finishes running\. When you resolve or reject the promise, Lambda sends the response or error to the invoker\. + +**Example TypeScript function – asynchronous** + +``` +import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; + +export const lambdaHandler = async (event: APIGatewayEvent, context: Context): Promise => { + console.log(`Event: ${JSON.stringify(event, null, 2)}`); + console.log(`Context: ${JSON.stringify(context, null, 2)}`); + return { + statusCode: 200, + body: JSON.stringify({ + message: 'hello world', + }), + }; +}; +``` + +## Using types for the event object + +We recommend that you don’t use the [any](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#any) type for the handler arguments and return type because you lose the ability to check types\. Instead, generate an event using the [sam local generate\-event](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-generate-event.html) AWS Serverless Application Model CLI command, or use an open\-source definition from the [@types/aws\-lambda package](https://www.npmjs.com/package/@types/aws-lambda)\. + +**Generating an event using the sam local generate\-event command** + +1. Generate an Amazon Simple Storage Service \(Amazon S3\) proxy event\. + + ``` + sam local generate-event s3 put >> S3PutEvent.json + ``` + +1. Use the [quicktype utility](https://quicktype.io/typescript) to generate type definitions from the **S3PutEvent\.json** file\. + + ``` + npm install -g quicktype + quicktype S3PutEvent.json -o S3PutEvent.ts + ``` + +1. Use the generated types in your code\. + + ``` + import { S3PutEvent } from './S3PutEvent'; + + export const lambdaHandler = async (event: S3PutEvent): Promise => { + event.Records.map((record) => console.log(record.s3.object.key)); + }; + ``` + +**Generating an event using an open\-source definition from the @types/aws\-lambda package** + +1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) package as a development dependency\. + + ``` + npm install -D @types/aws-lambda + ``` + +1. Use the types in your code\. + + ``` + import { S3Event } from "aws-lambda"; + + export const lambdaHandler = async (event: S3Event): Promise => { + event.Records.map((record) => console.log(record.s3.object.key)); + }; + ``` \ No newline at end of file diff --git a/doc_source/typescript-image.md b/doc_source/typescript-image.md new file mode 100644 index 00000000..6c1309b5 --- /dev/null +++ b/doc_source/typescript-image.md @@ -0,0 +1,109 @@ +# Deploy transpiled TypeScript code in Lambda with container images + +You can deploy your TypeScript code to an AWS Lambda function as a Node\.js [container image](images-create.md)\. AWS provides [base images](nodejs-image.md#nodejs-image-base) for Node\.js to help you build the container image\. These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. + +If you use a community or private enterprise base image, you must [add the Node\.js runtime interface client \(RIC\)](nodejs-image.md#nodejs-image-clients) to the base image to make it compatible with Lambda\. For more information, see [Creating images from alternative base images](images-create.md#images-create-from-alt)\. + +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md)locally\. + +## Using a Node\.js base image to build and package TypeScript function code + +**Prerequisites** + +To complete the steps in this section, you must have the following: ++ [AWS Command Line Interface \(AWS CLI\) version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) ++ Docker + + The following instructions use Docker CLI commands to create the container image\. To install Docker, see [Get Docker](https://docs.docker.com/get-docker) on the Docker website\. ++ Node\.js 14\.x or later + +**To create an image from an AWS base image for Lambda** + +1. On your local machine, create a project directory for your new function\. + +1. Create a new Node\.js project with `npm` or a package manager of your choice\. + + ``` + npm init + ``` + +1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) and [esbuild](https://esbuild.github.io/) packages as development dependencies\. + + ``` + npm install -D @types/aws-lambda esbuild + ``` + +1. Add a [build script](https://esbuild.github.io/getting-started/#build-scripts) to the **package\.json** file\. + + ``` + "scripts": { + "build": "esbuild index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js" + } + ``` + +1. Create a new file called **index\.ts**\. Add the following sample code to the new file\. This is the code for the Lambda function\. The function returns a `hello world` message\. + + ``` + import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; + + export const handler = async (event: APIGatewayEvent, context: Context): Promise => { + console.log(`Event: ${JSON.stringify(event, null, 2)}`); + console.log(`Context: ${JSON.stringify(context, null, 2)}`); + return { + statusCode: 200, + body: JSON.stringify({ + message: 'hello world', + }), + }; + }; + ``` + +1. Create a new Dockerfile with the following configuration: + + Set the `FROM` property to the URI of the base image\. + + Set the `CMD` argument to specify the Lambda function handler\. +**Example Dockerfile** + + The following Dockerfile uses a multi\-stage build\. The first step transpiles the TypeScript code into JavaScript\. The second step produces a container image that contains only JavaScript files and production dependencies\. + + ``` + FROM public.ecr.aws/lambda/nodejs:16 as builder + WORKDIR /usr/app + COPY package.json index.ts ./ + RUN npm install + RUN npm run build + + + FROM public.ecr.aws/lambda/nodejs:16 + WORKDIR ${LAMBDA_TASK_ROOT} + COPY --from=builder /usr/app/dist/* ./ + CMD ["index.handler"] + ``` + +1. Build your image\. + + ``` + docker build -t hello-world . + ``` + +1. Authenticate the Docker CLI to your Amazon Elastic Container Registry \(Amazon ECR\) registry\. + + ``` + aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com + ``` + +1. Create a repository in Amazon ECR using the `create-repository` command\. + + ``` + aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE + ``` + +1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. + + ``` + docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest + ``` + +1. [Create and test](gettingstarted-images.md#configuration-images-create) the Lambda function\. + +To update the function code, you must create a new image version and store the image in the Amazon ECR repository\. For more information, see [Updating function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/typescript-package.md b/doc_source/typescript-package.md new file mode 100644 index 00000000..8171f2b7 --- /dev/null +++ b/doc_source/typescript-package.md @@ -0,0 +1,249 @@ +# Deploy transpiled TypeScript code in Lambda with \.zip file archives + +Before you can deploy TypeScript code to AWS Lambda, you need to transpile it into JavaScript\. This page explains three ways to build and deploy TypeScript code to Lambda: ++ [Using the AWS Serverless Application Model \(AWS SAM\)](#aws-sam-ts) ++ [Using the AWS Cloud Development Kit \(CDK\)](#aws-cdk-ts) ++ [Using the AWS Command Line Interface \(AWS CLI\) and esbuild](#aws-cli-ts) + +The AWS SAM and AWS CDK simplify building and deploying TypeScript functions\. The [AWS SAM template specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) provides a simple and clean syntax to describe the Lambda functions, APIs, permissions, configurations, and events that make up your serverless application\. The [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/home.html) lets you build reliable, scalable, cost\-effective applications in the cloud with the considerable expressive power of a programming language\. The AWS CDK is intended for moderately to highly experienced AWS users\. Both the AWS CDK and the AWS SAM use esbuild to transpile TypeScript code into JavaScript\. + +## Using the AWS SAM to deploy TypeScript code to Lambda + +Follow the steps below to download, build, and deploy a sample Hello World TypeScript application using the AWS SAM\. This application implements a basic API backend\. It consists of an Amazon API Gateway endpoint and a Lambda function\. When you send a GET request to the API Gateway endpoint, the Lambda function is invoked\. The function returns a `hello world` message\. + +**Note** +The AWS SAM uses esbuild to create Node\.js Lambda functions from TypeScript code\. esbuild support is currently in public preview\. During public preview, esbuild support may be subject to backwards incompatible changes\. + +**Prerequisites** + +To complete the steps in this section, you must have the following: ++ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) ++ [AWS SAM CLI version 1\.39 or later](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) ++ Node\.js 14\.x or later + +**Deploy a sample AWS SAM application** + +1. Initialize the application using the Hello World TypeScript template\. + + ``` + sam init --app-template hello-world-typescript --name sam-app --package-type Zip --runtime nodejs16.x + ``` + +1. \(Optional\) The sample application includes configurations for commonly used tools, such as [ESLlint](https://eslint.org/) for code linting and [Jest](https://jestjs.io/) for unit testing\. To run lint and test commands: + + ``` + cd sam-app/hello-world + npm install + npm run lint + npm run test + ``` + +1. Build the app\. The `--beta-features` option is required because esbuild support is in public preview\. + + ``` + cd sam-app + sam build --beta-features + ``` + +1. Deploy the app\. + + ``` + sam deploy --guided + ``` + +1. Follow the on\-screen prompts\. To accept the default options provided in the interactive experience, respond with `Enter`\. + +1. The output shows the endpoint for the REST API\. Open the endpoint in a browser to test the function\. You should see this response: + + ``` + {"message":"hello world"} + ``` + +1. This is a public API endpoint that is accessible over the internet\. We recommend that you delete the endpoint after testing\. + + ``` + sam delete + ``` + +## Using the AWS CDK to deploy TypeScript code to Lambda + +Follow the steps below to build and deploy a sample TypeScript application using the AWS CDK\. This application implements a basic API backend\. It consists of an API Gateway endpoint and a Lambda function\. When you send a GET request to the API Gateway endpoint, the Lambda function is invoked\. The function returns a `hello world` message\. + +**Prerequisites** + +To complete the steps in this section, you must have the following: ++ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) ++ [AWS CDK version 2](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites) ++ Node\.js 14\.x or later + +**Deploy a sample AWS CDK application** + +1. Create a project directory for your new application\. + + ``` + mkdir hello-world + cd hello-world + ``` + +1. Initialize the app\. + + ``` + cdk init app --language typescript + ``` + +1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) package as a development dependency\. + + ``` + npm install -D @types/aws-lambda + ``` + +1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create new two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. + +1. Open **hello\-world\.function\.ts** and add the following code to the file\. This is the code for the Lambda function\. + + ``` + import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; + + export const handler = async (event: APIGatewayEvent, context: Context): Promise => { + console.log(`Event: ${JSON.stringify(event, null, 2)}`); + console.log(`Context: ${JSON.stringify(context, null, 2)}`); + return { + statusCode: 200, + body: JSON.stringify({ + message: 'hello world', + }), + }; + }; + ``` + +1. Open **hello\-world\.ts** and add the following code to the file\. This contains the [NodejsFunction construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html), which creates the Lambda function, and the [LambdaRestApi construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.LambdaRestApi.html), which creates the REST API\. + + ``` + import { Construct } from 'constructs'; + import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; + import { LambdaRestApi } from 'aws-cdk-lib/aws-apigateway'; + + export class HelloWorld extends Construct { + constructor(scope: Construct, id: string) { + super(scope, id); + const helloFunction = new NodejsFunction(this, 'function'); + new LambdaRestApi(this, 'apigw', { + handler: helloFunction, + }); + } + } + ``` + + The `NodejsFunction` construct assumes the following by default: + + Your function handler is called `handler`\. + + The \.ts file that contains the function code \(**hello\-world\.function\.ts**\) is in the same directory as the \.ts file that contains the construct \(**hello\-world\.ts**\)\. The construct uses the construct's ID \("hello\-world"\) and the name of the Lambda handler file \("function"\) to find the function code\. For example, if your function code is in a file called **hello\-world\.my\-function\.ts**, the **hello\-world\.ts** file must reference the function code like this: + + ``` + const helloFunction = new NodejsFunction(this, 'my-function'); + ``` + + You can change this behavior and configure other esbuild parameters\. For more information, see [Configuring esbuild](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html#configuring-esbuild) in the AWS CDK API reference\. + +1. Open **hello\-world\-stack\.ts**\. This is the code that defines your [AWS CDK stack](https://docs.aws.amazon.com/cdk/v2/guide/stacks.html)\. Replace the code with the following: + + ``` + import { Stack, StackProps } from 'aws-cdk-lib'; + import { Construct } from 'constructs'; + import { HelloWorld } from './hello-world'; + + export class HelloWorldStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + new HelloWorld(this, 'hello-world'); + } + } + ``` + +1. Deploy your application\. + + ``` + cdk deploy + ``` + +1. The AWS CDK builds and packages the Lambda function using esbuild, and then deploys the function to the Lambda runtime\. The output shows the endpoint for the REST API\. Open the endpoint in a browser to test the function\. You should see this response: + + ``` + {"message":"hello world"} + ``` + + This is a public API endpoint that is accessible over the internet\. We recommend that you delete the endpoint after testing\. + +## Using the AWS CLI and esbuild to deploy TypeScript code to Lambda + +The following example demonstrates how to transpile and deploy TypeScript code to Lambda using esbuild and the AWS CLI\. esbuild produces one JavaScript file with all dependencies\. This is the only file that you need to add to the \.zip archive\. + +**Prerequisites** + +To complete the steps in this section, you must have the following: ++ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) ++ Node\.js 14\.x or later ++ An [execution role](lambda-intro-execution-role.md) for the Lambda function + +**Deploy a sample function** + +1. On your local machine, create a project directory for your new function\. + +1. Create a new Node\.js project with npm or a package manager of your choice\. + + ``` + npm init + ``` + +1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) and [esbuild](https://esbuild.github.io/) packages as development dependencies\. + + ``` + npm install -D @types/aws-lambda esbuild + ``` + +1. Create a new file called **index\.ts**\. Add the following code to the new file\. This is the code for the Lambda function\. The function returns a `hello world` message\. The function doesn’t create any API Gateway resources\. + + ``` + import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; + + export const handler = async (event: APIGatewayEvent, context: Context): Promise => { + console.log(`Event: ${JSON.stringify(event, null, 2)}`); + console.log(`Context: ${JSON.stringify(context, null, 2)}`); + return { + statusCode: 200, + body: JSON.stringify({ + message: 'hello world', + }), + }; + }; + ``` + +1. Add a build script to the **package\.json** file\. This configures esbuild to automatically create the \.zip deployment package\. For more information, see [Build scripts](https://esbuild.github.io/getting-started/#build-scripts) in the esbuild documentation\. + + ``` + "scripts": { + "prebuild": "rm -rf dist", + "build": "esbuild index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js", + "postbuild": "cd dist && zip -r index.zip index.js*" + }, + ``` + +1. Build the package\. + + ``` + npm run build + ``` + +1. Create a Lambda function using the \.zip deployment package\. Replace the highlighted text with the Amazon Resource Name \(ARN\) of your [execution role](lambda-intro-execution-role.md)\. + + ``` + aws lambda create-function --function-name hello-world --runtime "nodejs16.x" --role arn:aws:iam::123456789012:role/lambda-ex --zip-file "fileb://dist/index.zip" --handler index.handler + ``` + +1. [Run a test event](testing-functions.md) to confirm that the function returns the following response\. If you want to invoke this function using API Gateway, [create and configure a REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html)\. + + ``` + { + "statusCode": 200, + "body": "{\"message\":\"hello world\"}" + } + ``` \ No newline at end of file diff --git a/doc_source/urls-auth.md b/doc_source/urls-auth.md new file mode 100644 index 00000000..132ed002 --- /dev/null +++ b/doc_source/urls-auth.md @@ -0,0 +1,237 @@ +# Security and auth model for Lambda function URLs + +You can control access to your Lambda function URLs using the `AuthType` parameter combined with [resource\-based policies](access-control-resource-based.md) attached to your specific function\. The configuration of these two components determines who can invoke or perform other administrative actions on your function URL\. + +The `AuthType` parameter determines how Lambda authenticates or authorizes requests to your function URL\. When you configure your function URL, you must specify one of the following `AuthType` options: ++ `AWS_IAM` – Lambda uses AWS Identity and Access Management \(IAM\) to authenticate and authorize requests based on the IAM principal's identity policy and the function's resource\-based policy\. Choose this option if you want only authenticated IAM users and roles to invoke your function via the function URL\. ++ `NONE` – Lambda doesn't perform any authentication before invoking your function\. However, your function's resource\-based policy is always in effect and must grant public access before your function URL can receive requests\. Choose this option to allow public, unauthenticated access to your function URL\. + +In addition to `AuthType`, you can also use resource\-based policies to grant permissions to other AWS accounts to invoke your function\. For more information, see [Using resource\-based policies for AWS Lambda](access-control-resource-based.md)\. + +For additional insights into security, you can use AWS Identity and Access Management Access Analyzer to get a comprehensive analysis of external access to your function URL\. IAM Access Analyzer also monitors for new or updated permissions on your Lambda functions to help you identify permissions that grant public and cross\-account access\. IAM Access Analyzer is free to use for any AWS customer\. To get started with IAM Access Analyzer, see [Using AWS IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html)\. + +This page contains examples of resource\-based policies for both auth types, and also how to create these policies using the [AddPermission](API_AddPermission.md) API operation or the Lambda console\. For information on how to invoke your function URL after you've set up permissions, see [Invoking Lambda function URLs](urls-invocation.md)\. + +**Topics** ++ [Using the `AWS_IAM` auth type](#urls-auth-iam) ++ [Using the `NONE` auth type](#urls-auth-none) ++ [Governance and access control](#urls-governance) + +## Using the `AWS_IAM` auth type + +If you choose the `AWS_IAM` auth type, users who need to invoke your Lambda function URL must have the `lambda:InvokeFunctionUrl` permission\. Depending on who makes the invocation request, you may have to grant this permission using a resource\-based policy\. + +If the principal making the request is in the same AWS account as the function URL, then the principal must **either** have `lambda:InvokeFunctionUrl` permissions in their [identity\-based policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html), **or** have permissions granted to them in the function's resource\-based policy\. In other words, a resource\-based policy is optional if the user already has `lambda:InvokeFunctionUrl` permissions in their identity\-based policy\. Policy evaluation follows the rules outlined in [Determining whether a request is allowed or denied within an account](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)\. + +If the principal making the request is in a different account, then the principal must have **both** an identity\-based policy that gives them `lambda:InvokeFunctionUrl` permissions **and** permissions granted to them in a resource\-based policy on the function that they are trying to invoke\. In these cross\-account cases, policy evaluation follows the rules outlined in [Determining whether a cross\-account request is allowed](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic-cross-account.html#policy-eval-cross-account)\. + +For an example cross\-account interaction, the following resource\-based policy allows the `example` role in AWS account `444455556666` to invoke the function URL associated with function `my-function`: + +**Example function URL cross\-account invoke policy** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::444455556666:role/example" + }, + "Action": "lambda:InvokeFunctionUrl", + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:my-function", + "Condition": { + "StringEquals": { + "lambda:FunctionUrlAuthType": "AWS_IAM" + } + } + } + ] +} +``` + +You can create this policy statement through the console by following these steps: + +**To grant URL invocation permissions to another account \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function that you want to grant URL invocation permissions for\. + +1. Choose the **Configuration** tab, and then choose **Permissions**\. + +1. Under **Resource\-based policy**, choose **Add permissions**\. + +1. Choose **Function URL**\. + +1. For **Auth type**, choose **AWS\_IAM**\. + +1. \(Optional\) For **Statement ID**, enter a statement ID for your policy statement\. + +1. For **Principal**, enter the Amazon Resource Name \(ARN\) of the IAM user or role that you want to grant permissions to\. For example: **arn:aws:iam::444455556666:role/example**\. + +1. Choose **Save**\. + +Alternatively, you can create this policy statement using the following [add\-permission](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/add-permission.html) AWS Command Line Interface \(AWS CLI\) command: + +``` +aws lambda add-permission --function-name my-function \ +--statement-id example0-cross-account-statement \ +--action lambda:InvokeFunctionUrl \ +--principal arn:aws:iam::444455556666:role/example \ +--function-url-auth-type AWS_IAM +``` + +In the previous example, the `lambda:FunctionUrlAuthType` condition key value is `AWS_IAM`\. This policy only allows access when your function URL's auth type is also `AWS_IAM`\. + +## Using the `NONE` auth type + +**Important** +When your function URL auth type is `NONE` and you have a resource\-based policy that grants public access, any unauthenticated user with your function URL can invoke your function\. + +In some cases, you may want your function URL to be public\. For example, you might want to serve requests made directly from a web browser\. To allow public access to your function URL, choose the `NONE` auth type\. + +If you choose the `NONE` auth type, Lambda doesn't use IAM to authenticate requests to your function URL\. However, users must still have `lambda:InvokeFunctionUrl` permissions in order to successfully invoke your function URL\. You can grant `lambda:InvokeFunctionUrl` permissions using the following resource\-based policy: + +**Example function URL invoke policy for all unauthenticated principals** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": "*", + "Action": "lambda:InvokeFunctionUrl", + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:my-function", + "Condition": { + "StringEquals": { + "lambda:FunctionUrlAuthType": "NONE" + } + } + } + ] +} +``` + +**Note** +When you create a function URL with auth type `NONE` via the console or AWS Serverless Application Model \(AWS SAM\), Lambda automatically creates the preceding resource\-based policy statement for you\. \(If the policy already exists, or the user or role creating the application doesn't have the appropriate permissions, then Lambda won't create it for you\.\) If you're using the AWS CLI, AWS CloudFormation, or the Lambda API directly, you must add `lambda:InvokeFunctionUrl` permissions yourself\. This makes your function public\. + +In this statement, the `lambda:FunctionUrlAuthType` condition key value is `NONE`\. This policy statement allows access only when your function URL's auth type is also `NONE`\. + +If a function's resource\-based policy doesn't grant `lambda:invokeFunctionUrl` permissions, then users will get a 403 Forbidden error code when they try to invoke your function URL, even if the function URL uses the `NONE` auth type\. + +## Governance and access control + +In addition to function URL invocation permissions, you can also control access on actions used to configure function URLs\. Lambda supports the following IAM policy actions for function URLs: ++ `lambda:InvokeFunctionUrl` – Invoke a Lambda function using the function URL\. ++ `lambda:CreateFunctionUrlConfig` – Create a function URL and set its `AuthType`\. ++ `lambda:UpdateFunctionUrlConfig` – Update a function URL configuration and its `AuthType`\. ++ `lambda:GetFunctionUrlConfig` – View the details of a function URL\. ++ `lambda:ListFunctionUrlConfigs` – List function URL configurations\. ++ `lambda:DeleteFunctionUrlConfig` – Delete a function URL\. + +**Note** +The Lambda console supports adding permissions only for `lambda:InvokeFunctionUrl`\. For all other actions, you must add permissions using the Lambda API or AWS CLI\. + +To allow or deny function URL access to other AWS entities, include these actions in IAM policies\. For example, the following policy grants the `example` role in AWS account `444455556666` permissions to update the function URL for function **my\-function** in account `123456789012`\. + +**Example cross\-account function URL policy** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::444455556666:role/example" + }, + "Action": "lambda:UpdateFunctionUrlConfig", + "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function" + } + ] +} +``` + +### Condition keys + +For fine\-grained access control over your function URLs, use a condition key\. Lambda supports one additional condition key for function URLs: `FunctionUrlAuthType`\. The `FunctionUrlAuthType` key defines an enum value describing the auth type that your function URL uses\. The value can be either `AWS_IAM` or `NONE`\. + +You can use this condition key in policies associated with your function\. For example, you might want to restrict who can make configuration changes to your function URLs\. To deny all `UpdateFunctionUrlConfig` requests to any function with URL auth type `NONE`, you can define the following policy: + +**Example function URL policy with explicit deny** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Deny", + "Principal": "*", + "Action":[ + "lambda:UpdateFunctionUrlConfig" + ], + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:*", + "Condition": { + "StringEquals": { + "lambda:FunctionUrlAuthType": "NONE" + } + } + } + ] +} +``` + +To grant the `example` role in AWS account `444455556666` permissions to make `CreateFunctionUrlConfig` and `UpdateFunctionUrlConfig` requests on functions with URL auth type `AWS_IAM`, you can define the following policy: + +**Example function URL policy with explicit allow** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::444455556666:role/example" + }, + "Action":[ + "lambda:CreateFunctionUrlConfig", + "lambda:UpdateFunctionUrlConfig" + ], + "Resource": "arn:aws:lambda:us-east-1:123456789012:function:*", + "Condition": { + "StringEquals": { + "lambda:FunctionUrlAuthType": "AWS_IAM" + } + } + } + ] +} +``` + +You can also use this condition key in a [service control policy](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) \(SCP\)\. Use SCPs to manage permissions across an entire organization in AWS Organizations\. For example, to deny users from creating or updating function URLs that use anything other than the `AWS_IAM` auth type, use the following service control policy: + +**Example function URL SCP with explicit deny** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Deny", + "Action":[ + "lambda:CreateFunctionUrlConfig", + "lambda:UpdateFunctionUrlConfig" + ], + "Resource": "arn:aws:lambda:*:123456789012:function:*", + "Condition": { + "StringNotEquals": { + "lambda:FunctionUrlAuthType": "AWS_IAM" + } + } + } + ] +} +``` \ No newline at end of file diff --git a/doc_source/urls-configuration.md b/doc_source/urls-configuration.md new file mode 100644 index 00000000..ac829a33 --- /dev/null +++ b/doc_source/urls-configuration.md @@ -0,0 +1,216 @@ +# Creating and managing Lambda function URLs + +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: + +``` +https://.lambda-url..on.aws +``` + +Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. + +**Topics** ++ [Creating a function URL \(console\)](#create-url-console) ++ [Creating a function URL \(AWS CLI\)](#create-url-cli) ++ [Adding a function URL to a CloudFormation template](#urls-cfn) ++ [Cross\-origin resource sharing \(CORS\)](#urls-cors) ++ [Throttling function URLs](#urls-throttling) ++ [Deactivating function URLs](#urls-deactivating) ++ [Deleting function URLs](#w723aac55c19c39) + +## Creating a function URL \(console\) + +Follow these steps to create a function URL using the console\. + +### To create a function URL for an existing function \(console\) + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function that you want to create the function URL for\. + +1. Choose the **Configuration** tab, and then choose **Function URL**\. + +1. Choose **Create function URL**\. + +1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. + +1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**, and then configure the CORS settings for your function URL\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. + +1. Choose **Save**\. + +This creates a function URL for the `$LATEST` unpublished version of your function\. The function URL appears in the **Function overview** section of the console\. + +### To create a function URL for an existing alias \(console\) + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function with the alias that you want to create the function URL for\. + +1. Choose the **Aliases** tab, and then choose the name of the alias that you want to create the function URL for\. + +1. Choose the **Configuration** tab, and then choose **Function URL**\. + +1. Choose **Create function URL**\. + +1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. + +1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**, and then configure the CORS settings for your function URL\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. + +1. Choose **Save**\. + +This creates a function URL for your function alias\. The function URL appears in the console's **Function overview** section for your alias\. + +### To create a new function with a function URL \(console\) + +**To create a new function with a function URL \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose **Create function**\. + +1. Under **Basic information**, do the following: + + 1. For **Function name**, enter a name for your function, such as **my\-function**\. + + 1. For **Runtime**, choose the language runtime that you prefer, such as **Node\.js 14\.x**\. + + 1. For **Architecture**, choose either **x86\_64** or **arm64**\. + + 1. Expand **Permissions**, then choose whether to create a new execution role or use an existing one\. + +1. Expand **Advanced settings**, and then select **Function URL**\. + +1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. + +1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**\. By selecting this option during function creation, your function URL allows requests from all origins by default\. You can edit the CORS settings for your function URL after creating the function\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. + +1. Choose **Create function**\. + +This creates a new function with a function URL for the `$LATEST` unpublished version of the function\. The function URL appears in the **Function overview** section of the console\. + +## Creating a function URL \(AWS CLI\) + +To create a function URL for an existing Lambda function using the AWS Command Line Interface \(AWS CLI\), run the following command: + +``` +aws lambda create-function-url-config \ + --function-name my-function \ + --qualifier prod \ // optional + --auth-type AWS_IAM + --cors-config {AllowOrigins="https://example.com"} // optional +``` + +This adds a function URL to the **prod** qualifier for the function **my\-function**\. For more information about these configuration parameters, see [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) in the API reference\. + +**Note** +To create a function URL via the AWS CLI, the function must already exist\. + +## Adding a function URL to a CloudFormation template + +To add an `AWS::Lambda::Url` resource to your AWS CloudFormation template, use the following syntax: + +### JSON + +``` +{ + "Type" : "AWS::Lambda::Url", + "Properties" : { + "AuthType" : String, + "Cors" : Cors, + "Qualifier" : String, + "TargetFunctionArn" : String + } +} +``` + +### YAML + +``` +Type: AWS::Lambda::Url +Properties: + AuthType: String + Cors: + Cors + Qualifier: String + TargetFunctionArn: String +``` + +### Parameters ++ \(Required\) `AuthType` – Defines the type of authentication for your function URL\. Possible values are either `AWS_IAM` or `NONE`\. To restrict access to authenticated IAM users only, set to `AWS_IAM`\. To bypass IAM authentication and allow any user to make requests to your function, set to `NONE`\. ++ \(Optional\) `Cors` – Defines the [CORS settings](#urls-cors) for your function URL\. To add `Cors` to your `AWS::Lambda::Url` resource in CloudFormation, use the following syntax\. + + +**Example AWS::Lambda::Url\.Cors \(JSON\)** + + ``` + { + "AllowCredentials" : Boolean, + "AllowHeaders" : [ String, ... ], + "AllowMethods" : [ String, ... ], + "AllowOrigins" : [ String, ... ], + "ExposeHeaders" : [ String, ... ], + "MaxAge" : Integer + } + ``` +**Example AWS::Lambda::Url\.Cors \(YAML\)** + + ``` + AllowCredentials: Boolean + AllowHeaders: + - String + AllowMethods: + - String + AllowOrigins: + - String + ExposeHeaders: + - String + MaxAge: Integer + ``` ++ \(Optional\) `Qualifier` – The alias name\. ++ \(Required\) `TargetFunctionArn` – The name or Amazon Resource Name \(ARN\) of the Lambda function\. Valid name formats include the following: + + **Function name** – `my-function` + + **Function ARN** – `arn:aws:lambda:us-west-2:123456789012:function:my-function` + + **Partial ARN** – `123456789012:function:my-function` + +## Cross\-origin resource sharing \(CORS\) + +To define how different origins can access your function URL, use [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)\. We recommend configuring CORS if you intend to call your function URL from a different domain\. Lambda supports the following CORS headers for function URLs\. + + +| CORS header | CORS configuration property | Example values | +| --- | --- | --- | +| [ Access\-Control\-Allow\-Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) | `AllowOrigins` | `*` \(allow all origins\) `https://www.example.com` `http://localhost:60905` | +| [ Access\-Control\-Allow\-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) | `AllowMethods` | `GET`, `POST`, `DELETE`, `*` | +| [ Access\-Control\-Allow\-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers) | `AllowHeaders` | `Date`, `Keep-Alive`, `X-Custom-Header` | +| [ Access\-Control\-Expose\-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers) | `ExposeHeaders` | `Date`, `Keep-Alive`, `X-Custom-Header` | +| [ Access\-Control\-Allow\-Credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials) | `AllowCredentials` | `TRUE` | +| [ Access\-Control\-Max\-Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age) | `MaxAge` | `5` \(default\), `300` | + +When you configure CORS for a function URL using the Lambda console or the AWS CLI, Lambda automatically adds the CORS headers to all responses through the function URL\. Alternatively, you can manually add CORS headers to your function response\. If there are conflicting headers, the configured CORS headers on the function URL take precedence\. + +## Throttling function URLs + +Throttling limits the rate at which your function processes requests\. This is useful in many situations, such as preventing your function from overloading downstream resources, or handling a sudden surge in requests\. + +You can throttle the rate of requests that your Lambda function processes through a function URL by configuring reserved concurrency\. Reserved concurrency limits the number of maximum concurrent invocations for your function\. Your function's maximum request rate per second \(RPS\) is equivalent to 10 times the configured reserved concurrency\. For example, if you configure your function with a reserved concurrency of 100, then the maximum RPS is 1,000\. + +Whenever your function concurrency exceeds the reserved concurrency, your function URL returns an HTTP `429` status code\. If your function receives a request that exceeds the 10x RPS maximum based on your configured reserved concurrency, you also receive an HTTP `429` error\. For more information about reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. + +## Deactivating function URLs + +In an emergency, you might want to reject all traffic to your function URL\. To deactivate your function URL, set the reserved concurrency to zero\. This throttles all requests to your function URL, resulting in HTTP `429` status responses\. To reactivate your function URL, delete the reserved concurrency configuration, or set the configuration to an amount greater than zero\. + +## Deleting function URLs + +When you delete a function URL, you can’t recover it\. Creating a new function URL will result in a different URL address\. + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose the name of the function\. + +1. Choose the **Configuration** tab, and then choose **Function URL**\. + +1. Choose **Delete**\. + +1. Enter the word *delete* into the field to confirm the deletion\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/urls-invocation.md b/doc_source/urls-invocation.md new file mode 100644 index 00000000..3089e34e --- /dev/null +++ b/doc_source/urls-invocation.md @@ -0,0 +1,203 @@ +# Invoking Lambda function URLs + +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: + +``` +https://.lambda-url..on.aws +``` + +Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. + +Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After configuring your function URL, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. To invoke a function URL, you must have `lambda:InvokeFunctionUrl` permissions\. For more information, see [Security and auth model](urls-auth.md)\. + +**Topics** ++ [Function URL invocation basics](#urls-invocation-basics) ++ [Request and response payloads](#urls-payloads) + +## Function URL invocation basics + +If your function URL uses the `AWS_IAM` auth type, you must sign each HTTP request using [AWS Signature Version 4 \(SigV4\)](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)\. Tools such as [awscurl](https://github.com/okigan/awscurl), [Postman](http://www.postman.com/), and [AWS SigV4 Proxy](https://github.com/awslabs/aws-sigv4-proxy) offer built\-in ways to sign your requests with SigV4\. + +If you don't use a tool to sign HTTP requests to your function URL, you must manually sign each request using SigV4\. When your function URL receives a request, Lambda also calculates the SigV4 signature\. Lambda processes the request only if the signatures match\. For instructions on how to manually sign your requests with SigV4, see [Signing AWS requests with Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html) in the *Amazon Web Services General Reference Guide*\. + +If your function URL uses the `NONE` auth type, you don't have to sign your requests using SigV4\. You can invoke your function using a web browser, curl, Postman, or any HTTP client\. + +To test simple `GET` requests to your function, use a web browser\. For example, if your function URL is `https://abcdefg.lambda-url.us-east-1.on.aws`, and it takes in a string parameter `message`, your request URL could look like this: + +``` +https://abcdefg.lambda-url.us-east-1.on.aws/?message=HelloWorld +``` + +To test other HTTP requests, such as a `POST` request, you can use a tool such as curl\. For example, if you want to include some JSON data in a `POST` request to your function URL, you could use the following curl command: + +``` +curl -v -X POST \ + 'https://abcdefg.lambda-url.us-east-1.on.aws/?message=HelloWorld' \ + -H 'content-type: application/json' \ + -d '{ "example": "test" }' +``` + +## Request and response payloads + +When a client calls your function URL, Lambda maps the request to an event object before passing it to your function\. Your function's response is then mapped to an HTTP response that Lambda sends back to the client through the function URL\. + +The request and response event formats follow the same schema as the [Amazon API Gateway payload format version 2\.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)\. + +### Request payload format + +A request payload has the following structure: + +``` +{ + "version": "2.0", + "routeKey": "$default", + "rawPath": "/my/path", + "rawQueryString": "parameter1=value1¶meter1=value2¶meter2=value", + "cookies": [ + "cookie1", + "cookie2" + ], + "headers": { + "header1": "value1", + "header2": "value1,value2" + }, + "queryStringParameters": { + "parameter1": "value1,value2", + "parameter2": "value" + }, + "requestContext": { + "accountId": "123456789012", + "apiId": "", + "authentication": null, + "authorizer": { + "iam": { + "accessKey": "AKIA...", + "accountId": "111122223333", + "callerId": "AIDA...", + "cognitoIdentity": null, + "principalOrgId": null, + "userArn": "arn:aws:iam::111122223333:user/example-user", + "userId": "AIDA..." + } + }, + "domainName": ".lambda-url.us-west-2.on.aws", + "domainPrefix": "", + "http": { + "method": "POST", + "path": "/my/path", + "protocol": "HTTP/1.1", + "sourceIp": "123.123.123.123", + "userAgent": "agent" + }, + "requestId": "id", + "routeKey": "$default", + "stage": "$default", + "time": "12/Mar/2020:19:03:58 +0000", + "timeEpoch": 1583348638390 + }, + "body": "Hello from client!", + "pathParameters": null, + "isBase64Encoded": false, + "stageVariables": null +} +``` + + +| Parameter | Description | Example | +| --- | --- | --- | +| `version` | The payload format version for this event\. Lambda function URLs currently support [payload format version 2\.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)\. | `2.0` | +| `routeKey` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | +| `rawPath` | The request path\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example/test/demo`, then the raw path value is `/example/test/demo`\. | `/example/test/demo` | +| `rawQueryString` | The raw string containing the request's query string parameters\. | `"?parameter1=value1¶meter2=value2"` | +| `cookies` | An array containing all cookies sent as part of the request\. | `["Cookie_1=Value_1", "Cookie_2=Value_2"]` | +| `headers` | The list of request headers, presented as key\-value pairs\. | `{"header1": "value1", "header2": "value2"}` | +| `queryStringParameters` | The query parameters for the request\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example?name=Jane`, then the `queryStringParameters` value is a JSON object with a key of `name` and a value of `Jane`\. | `{"name": "Jane"}` | +| `requestContext` | An object that contains additional information about the request, such as the `requestId`, the time of the request, and the identity of the caller if authorized via AWS Identity and Access Management \(IAM\)\. | | +| `requestContext.accountId` | The AWS account ID of the function owner\. | `"123456789012"` | +| `requestContext.apiId` | The ID of the function URL\. | `"33anwqw8fj"` | +| `requestContext.authentication` | Function URLs don't use this parameter\. Lambda sets this to `null`\. | `null` | +| `requestContext.authorizer` | An object that contains information about the caller identity, if the function URL uses the `AWS_IAM` auth type\. Otherwise, Lambda sets this to `null`\. | | +| `requestContext.authorizer.iam.accessKey` | The access key of the caller identity\. | `"AKIAIOSFODNN7EXAMPLE"` | +| `requestContext.authorizer.iam.accountId` | The AWS account ID of the caller identity\. | `"111122223333"` | +| `requestContext.authorizer.iam.callerId` | The ID \(IAM user ID\) of the caller\. | `"AIDACKCEVSQ6C2EXAMPLE"` | +| `requestContext.authorizer.iam.cognitoIdentity` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | +| `requestContext.authorizer.iam.principalOrgId` | The principal org ID associated with the caller identity\. | `"AIDACKCEVSQORGEXAMPLE"` | +| `requestContext.authorizer.iam.userArn` | The user Amazon Resource Name \(ARN\) of the caller identity\. | `"arn:aws:iam::111122223333:user/example-user"` | +| `requestContext.authorizer.iam.userId` | The user ID of the caller identity\. | `"AIDACOSFODNN7EXAMPLE2"` | +| `requestContext.domainName` | The domain name of the function URL\. | `".lambda-url.us-west-2.on.aws"` | +| `requestContext.domainPrefix` | The domain prefix of the function URL\. | `""` | +| `requestContext.http` | An object that contains details about the HTTP request\. | | +| `requestContext.http.method` | The HTTP method used in this request\. Valid values include `GET`, `POST`, `PUT`, `HEAD`, `OPTIONS`, `PATCH`, and `DELETE`\. | `GET` | +| `requestContext.http.path` | The request path\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example/test/demo`, then the path value is `/example/test/demo`\. | `/example/test/demo` | +| `requestContext.http.protocol` | The protocol of the request\. | `HTTP/1.1` | +| `requestContext.http.sourceIp` | The source IP address of the immediate TCP connection making the request\. | `123.123.123.123` | +| `requestContext.http.userAgent` | The User\-Agent request header value\. | `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Gecko/20100101 Firefox/42.0` | +| `requestContext.requestId` | The ID of the invocation request\. You can use this ID to trace invocation logs related to your function\. | `e1506fd5-9e7b-434f-bd42-4f8fa224b599` | +| `requestContext.routeKey` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | +| `requestContext.stage` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | +| `requestContext.time` | The timestamp of the request\. | `"07/Sep/2021:22:50:22 +0000"` | +| `requestContext.timeEpoch` | The timestamp of the request, in Unix epoch time\. | `"1631055022677"` | +| `body` | The body of the request\. If the content type of the request is binary, the body is base64\-encoded\. | `{"key1": "value1", "key2": "value2"}` | +| `pathParameters` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | +| `isBase64Encoded` | `TRUE` if the body is a binary payload and base64\-encoded\. `FALSE` otherwise\. | `FALSE` | +| `stageVariables` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | + +### Response payload format + +When your function returns a response, Lambda parses the response and converts it into an HTTP response\. Function response payloads have the following format: + +``` +{ + "statusCode": 201, + "headers": { + "Content-Type": "application/json", + "My-Custom-Header": "Custom Value" + }, + "body": "{ \"message\": \"Hello, world!\" }", + "cookies": [ + "Cookie_1=Value1; Expires=21 Oct 2021 07:48 GMT", + "Cookie_2=Value2; Max-Age=78000" + ], + "isBase64Encoded": false +} +``` + +Lambda infers the response format for you\. If your function returns valid JSON and doesn't return a `statusCode`, Lambda assumes the following: ++ `statusCode` is `200`\. ++ `content-type` is `application/json`\. ++ `body` is the function response\. ++ `isBase64Encoded` is `false`\. + +The following examples show how the output of your Lambda function maps to the response payload, and how the response payload maps to the final HTTP response\. When the client invokes your function URL, they see the HTTP response\. + + +**Example output for a string response** + +| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | +| --- | --- | --- | +|

"Hello, world!"
|
{
"statusCode": 200,
"body": "Hello, world!",
"headers": {
"content-type": "application/json"
}
"isBase64Encoded": false,
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 15

"Hello, world!"
| + + +**Example output for a JSON response** + +| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | +| --- | --- | --- | +|
{
"message": "Hello, world!"
}
|
{
"statusCode": 200,
"body": {
"message": "Hello, world!"
},
"headers": {
"content-type": "application/json"
}
"isBase64Encoded": false,
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 34

{
"message": "Hello, world!"
}
| + + +**Example output for a custom response** + +| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | +| --- | --- | --- | +|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"isBase64Encoded": false
}
|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"isBase64Encoded": false
}
|
HTTP/2 201
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 27
my-custom-header: Custom Value

{
"message": "Hello, world!"
}
| + +### Cookies + +To return cookies from your function, don't manually add `set-cookie` headers\. Instead, include the cookies in your response payload object\. Lambda automatically interprets this and adds them as `set-cookie` headers in your HTTP response, as in the following example\. + + +**Example output for a response returning cookies** + +| Lambda function output | HTTP response \(what the client sees\) | +| --- | --- | +|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"cookies": [
"Cookie_1=Value1; Expires=21 Oct 2021 07:48 GMT",
"Cookie_2=Value2; Max-Age=78000"
],
"isBase64Encoded": false
}
|
HTTP/2 201
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 27
my-custom-header: Custom Value
set-cookie: Cookie_1=Value2; Expires=21 Oct 2021 07:48 GMT
set-cookie: Cookie_2=Value2; Max-Age=78000

{
"message": "Hello, world!"
}
| \ No newline at end of file diff --git a/doc_source/urls-monitoring.md b/doc_source/urls-monitoring.md new file mode 100644 index 00000000..70b53761 --- /dev/null +++ b/doc_source/urls-monitoring.md @@ -0,0 +1,37 @@ +# Monitoring Lambda function URLs + +You can use AWS CloudTrail and Amazon CloudWatch to monitor your function URLs\. + +**Topics** ++ [Monitoring function URLs with CloudTrail](#urls-cloudtrail) ++ [CloudWatch metrics for function URLs](#urls-cloudwatch) + +## Monitoring function URLs with CloudTrail + +For function URLs, Lambda automatically supports logging the following API operations as events in CloudTrail log files: ++ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) ++ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) ++ [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) ++ [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) ++ [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) + +Each log entry contains information about the caller identity, when the request was made, and other details\. You can see all events within the last 90 days by viewing your CloudTrail **Event history**\. To retain records past 90 days, you can create a trail\. For more information, see [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md)\. + +By default, CloudTrail doesn't log `InvokeFunctionUrl` requests, which are considered data events\. However, you can turn on data event logging in CloudTrail\. For more information, see [Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide*\. + +## CloudWatch metrics for function URLs + +Lambda sends aggregated metrics about function URL requests to CloudWatch\. With these metrics, you can monitor your function URLs, build dashboards, and configure alarms in the CloudWatch console\. + +Function URLs support the following invocation metrics\. We recommend viewing these metrics with the `Sum` statistic\. ++ `UrlRequestCount` – The number of requests made to this function URL\. ++ `Url4xxError` – The number of requests that returned a 4XX HTTP status code\. 4XX series codes indicate client\-side errors, such as bad requests\. ++ `Url5xxError` – The number of requests that returned a 5XX HTTP status code\. 5XX series codes indicate server\-side errors, such as function errors and timeouts\. + +Function URLs also support the following performance metric\. We recommend viewing this metric with the `Average` or `Max` statistics\. ++ `UrlRequestLatency` – The time between when the function URL receives a request and when the function URL returns a response\. + +Each of these invocation and performance metrics supports the following dimensions: ++ `FunctionName` – View aggregate metrics for function URLs assigned to a function's `$LATEST` unpublished version, or to any of the function's aliases\. For example, `hello-world-function`\. ++ `Resource` – View metrics for a specific function URL\. This is defined by a function name, along with either the function's `$LATEST` unpublished version or one of the function's aliases\. For example, `hello-world-function:$LATEST`\. ++ `ExecutedVersion` – View metrics for a specific function URL based on the executed version\. You can use this dimension primarily to track the function URL assigned to the `$LATEST` unpublished version\. \ No newline at end of file diff --git a/doc_source/urls-tutorial.md b/doc_source/urls-tutorial.md new file mode 100644 index 00000000..f9f2ca9f --- /dev/null +++ b/doc_source/urls-tutorial.md @@ -0,0 +1,181 @@ +# Tutorial: Creating a Lambda function with a function URL + +In this tutorial, you create a Lambda function defined as a \.zip file archive with a function URL endpoint that returns the product of two numbers\. For more information about configuring function URLs, see [Creating and managing function URLs](urls-configuration.md)\. + +## Prerequisites + +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. + +To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: + +``` +aws --version +``` + +You should see the following output: + +``` +aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 +``` + +For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. + +On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. + +## Create an execution role + +Create the [execution role](lambda-intro-execution-role.md) that gives your Lambda function permission to access AWS resources\. + +**To create an execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the AWS Identity and Access Management \(IAM\) console\. + +1. Choose **Create role**\. + +1. Create a role with the following properties\. + + **Trusted entity** – **AWS Lambda**\. + + **Permissions** – **AWSLambdaBasicExecutionRole**\. + + **Role name** – **lambda\-url\-role**\. + +The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to Amazon CloudWatch Logs\. + +## Create a Lambda function with a function URL \(\.zip file archive\) + +Create a Lambda function with a function URL endpoint using a \.zip file archive\. + +**To create the function** + +1. Copy the following code example into a file named `index.js`\. +**Example index\.js** + + ``` + exports.handler = async (event) => { + let body = JSON.parse(event.body) + const product = body.num1 * body.num2; + const response = { + statusCode: 200, + body: "The product of " + body.num1 + " and " + body.num2 + " is " + product, + }; + return response; + }; + ``` + +1. Create a deployment package\. + + ``` + zip function.zip index.js + ``` + +1. Create a Lambda function with the `create-function` command\. + + ``` + aws lambda create-function \ + --function-name my-url-function \ + --runtime nodejs14.x \ + --zip-file fileb://function.zip \ + --handler index.handler \ + --role arn:aws:iam::123456789012:role/lambda-url-role + ``` + +1. Create a URL endpoint for the function with the `create-function-url-config` command\. + + ``` + aws lambda create-function-url-config \ + --function-name my-url-function \ + --auth-type NONE + ``` + +## Test the function URL endpoint + +Invoke your Lambda function by calling your function URL endpoint using an HTTP client such as curl or Postman\. + +``` +curl -X POST \ + 'https://abcdefg.lambda-url.us-east-1.on.aws/' \ + -H 'Content-Type: application/json' \ + -d '{"num1": "10", "num2": "10"}' +``` + +You should see the following output: + +``` +The product of 10 and 10 is 100 +``` + +## Create a Lambda function with a function URL \(CloudFormation\) + +You can also create a Lambda function with a function URL endpoint using the AWS CloudFormation type `AWS::Lambda::Url`\. + +``` +Resources: + MyUrlFunction: + Type: AWS::Lambda::Function + Properties: + Handler: index.handler + Runtime: nodejs14.x + Role: arn:aws:iam::123456789012:role/lambda-url-role + Code: + ZipFile: | + exports.handler = async (event) => { + let body = JSON.parse(event.body) + const product = body.num1 * body.num2; + const response = { + statusCode: 200, + body: "The product of " + body.num1 + " and " + body.num2 + " is " + product, + }; + return response; + }; + Description: Create a function with a URL. + MyUrlFunctionPermissions: + Type: AWS::Lambda::Permission + Properties: + FunctionName: !Ref MyUrlFunction + Action: lambda:InvokeFunctionUrl + Principal: "*" + FunctionUrlAuthType: NONE + MyFunctionUrl: + Type: AWS::Lambda::Url + Properties: + TargetFunctionArn: !Ref MyUrlFunction + AuthType: NONE +``` + +## Create a Lambda function with a function URL \(AWS SAM\) + +You can also create a Lambda function configured with a function URL using AWS Serverless Application Model \(AWS SAM\)\. + +``` +ProductFunction: + Type: AWS::Serverless::Function + Properties: + CodeUri: function/. + Handler: index.handler + Runtime: nodejs14.x + AutoPublishAlias: live + FunctionUrlConfig: + AuthType: NONE +``` + +## Clean up your resources + +You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. + +**To delete the execution role** + +1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. + +1. Select the execution role that you created\. + +1. Choose **Delete role**\. + +1. Choose **Yes, delete**\. + +**To delete the Lambda function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Select the function that you created\. + +1. Choose **Actions**, then choose **Delete**\. + +1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/using-extensions.md old mode 100755 new mode 100644 index a19746ec..c17ff88c --- a/doc_source/using-extensions.md +++ b/doc_source/using-extensions.md @@ -2,29 +2,12 @@ You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. -Lambda supports external and internal extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, you can write them in a different language than the function\. +Lambda supports external and internal extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, you can write them in a different language than the function\. All [Lambda runtimes](lambda-runtimes.md) support extensions\. An internal extension runs as part of the runtime process\. Your function accesses internal extensions by using wrapper scripts or in\-process mechanisms such as `JAVA_TOOL_OPTIONS`\. For more information, see [Modifying the runtime environment](runtimes-modify.md)\. You can add extensions to a function using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. -The following [Lambda runtimes](lambda-runtimes.md) support extensions: -+ \.NET Core 3\.1 \(C\#/PowerShell\) \(`dotnetcore3.1`\) -+ Custom runtime \(`provided`\) -+ Custom runtime on Amazon Linux 2 \(`provided.al2`\) -+ Java 11 \(Corretto\) \(`java11`\) -+ Java 8 \(Corretto\) \(`java8.al2`\) -+ Node\.js 14\.x \(`nodejs14.x`\) -+ Node\.js 12\.x \(`nodejs12.x`\) -+ Node\.js 10\.x \(`nodejs10.x`\) -+ Python 3\.9 \(`python3.9`\) -+ Python 3\.8 \(`python3.8`\) -+ Python 3\.7 \(`python3.7`\) -+ Ruby 2\.7 \(`ruby2.7`\) -+ Ruby 2\.5 \(`ruby2.5`\) - -Note that the Go 1\.x runtime does not support extensions\. To support extensions, you can create Go functions on the `provided.al2` runtime\. For more information, see [ Migrating Lambda functions to Amazon Linux 2](http://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. - You are charged for the execution time that the extension consumes \(in 1 ms increments\)\. For more pricing information for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information for partner extensions, see those partners' websites\. There is no cost to install your own extensions\. **Topics** @@ -37,7 +20,7 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc ## Execution environment -Lambda invokes your function in an [execution environment](runtimes-context.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. +Lambda invokes your function in an [execution environment](lambda-runtime-environment.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. The lifecycle of the execution environment includes the following phases: + `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. @@ -88,7 +71,7 @@ You add the extension to your function using the same method as you would for an ## Using extensions in container images -You can add extensions to your [container image](lambda-images.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. +You can add extensions to your [container image](images-create.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md old mode 100755 new mode 100644 index 2071ad2b..4e77d8df --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -24,7 +24,7 @@ Lambda is a highly available service\. For more information, see the [AWS Lambda ## When should I use Lambda? -Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](runtimes-context.md) and within the resources that Lambda provides\. Lambda is best suited for shorter, event\-driven workloads, since Lambda functions run for up to 15 minutes per invocation\. +Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](lambda-runtime-environment.md) and within the resources that Lambda provides\. When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. @@ -40,7 +40,7 @@ The following key features help you develop Lambda applications that are scalabl [Concurrency and scaling controls](invocation-scaling.md) such as concurrency limits and provisioned concurrency give you fine\-grained control over the scaling and responsiveness of your production applications\. **Functions defined as container images** -Use your preferred [container image](lambda-images.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. +Use your preferred [container image](images-create.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. **Code signing ** [Code signing](configuration-codesigning.md) for Lambda provides trust and integrity controls that let you verify that only unaltered code that approved developers have published is deployed in your Lambda functions\. @@ -96,7 +96,7 @@ You can create, invoke, and manage your Lambda functions using any of the follow + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using Lambda with the AWS CLI](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. + **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. -+ **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [AWS SAM](lambda-settingup.md#lambda-settingup-awssam)\. ++ **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [SAM CLI](lambda-settingup.md#lambda-settingup-samcli)\. diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md old mode 100755 new mode 100644 diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md old mode 100755 new mode 100644 index 205569ac..9b71a9ac --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -6,7 +6,7 @@ The mobile application retrieves AWS credentials from an Amazon Cognito identity ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-cloudtrail-create-package.md b/doc_source/with-cloudtrail-create-package.md old mode 100755 new mode 100644 diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md old mode 100755 new mode 100644 index d1293e28..56ef6580 --- a/doc_source/with-cloudtrail-example.md +++ b/doc_source/with-cloudtrail-example.md @@ -10,7 +10,7 @@ Use the following instructions to create a Lambda function that notifies you whe ## Requirements -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. Before you begin, make sure that you have the following tools: + [Node\.js 12\.x with `npm`](https://nodejs.org/en/download/releases/)\. diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md old mode 100755 new mode 100644 diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md old mode 100755 new mode 100644 diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md old mode 100755 new mode 100644 index 1ddadfdb..31e4fbe5 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -4,7 +4,7 @@ ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md old mode 100755 new mode 100644 index 635f7a30..45371233 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -162,7 +162,7 @@ To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](http The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. ``` -aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --starting-position LATEST \ +aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --maximum-batching-window-in-seconds 5 --starting-position LATEST \ --event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 ``` @@ -172,7 +172,7 @@ You should see the following output: { "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", "BatchSize": 500, - "MaximumBatchingWindowInSeconds": 0, + "MaximumBatchingWindowInSeconds": 5, "ParallelizationFactor": 1, "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", @@ -550,6 +550,8 @@ When a partial batch success response is received and both `BisectBatchOnFunctio import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; +import com.amazonaws.services.lambda.runtime.events.StreamsEventResponse; +import com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord; import java.io.Serializable; import java.util.ArrayList; @@ -558,17 +560,17 @@ import java.util.List; public class ProcessDynamodbRecords implements RequestHandler { @Override - public Serializable handleRequest(DynamodbEvent input, Context context) { + public StreamsEventResponse handleRequest(DynamodbEvent input, Context context) { - List batchItemFailures = new ArrayList<*>(); + List batchItemFailures = new ArrayList<>(); String curRecordSequenceNumber = ""; - for (DynamodbEvent.DynamodbEventRecord dynamodbEventRecord : input.getRecords()) { - try { + for (DynamodbEvent.DynamodbStreamRecord dynamodbStreamRecord : input.getRecords()) { + try { //Process your record - DynamodbEvent.Record dynamodbRecord = dynamodbEventRecord.getDynamodb(); + StreamRecord dynamodbRecord = dynamodbStreamRecord.getDynamodb(); curRecordSequenceNumber = dynamodbRecord.getSequenceNumber(); - + } catch (Exception e) { //Return failed record's sequence number batchItemFailures.add(new StreamsEventResponse.BatchItemFailure(curRecordSequenceNumber)); @@ -576,7 +578,7 @@ public class ProcessDynamodbRecords implements RequestHandler -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md old mode 100755 new mode 100644 index 139150a5..325c0d8f --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -499,17 +499,18 @@ When a partial batch success response is received and both `BisectBatchOnFunctio import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.KinesisEvent; +import com.amazonaws.services.lambda.runtime.events.StreamsEventResponse; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -public class ProcessKinesisRecords implements RequestHandler { +public class ProcessKinesisRecords implements RequestHandler { @Override - public Serializable handleRequest(KinesisEvent input, Context context) { + public StreamsEventResponse handleRequest(KinesisEvent input, Context context) { - List batchItemFailures = new ArrayList<*>(); + List batchItemFailures = new ArrayList<>(); String curRecordSequenceNumber = ""; for (KinesisEvent.KinesisEventRecord kinesisEventRecord : input.getRecords()) { diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md old mode 100755 new mode 100644 index b3fa1075..e3e690bf --- a/doc_source/with-mq.md +++ b/doc_source/with-mq.md @@ -48,7 +48,7 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { "eventSource": "aws:amq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "eventSourceArn": "arn:aws:mq:us-west-2:111122223333:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", "messages": [ { "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", @@ -83,7 +83,7 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ``` { "eventSource": "aws:rmq", - "eventSourceArn": "arn:aws:mq:us-west-2:112556298976:broker:pizzaBroker:b-9bcfa592-423a-4942-879d-eb284b418fc8", + "eventSourceArn": "arn:aws:mq:us-west-2:111122223333:broker:pizzaBroker:b-9bcfa592-423a-4942-879d-eb284b418fc8", "rmqMessagesByQueue": { "pizzaQueue::/": [ { @@ -112,7 +112,7 @@ You can monitor a given function's concurrency usage using the `ConcurrentExecut ] }, "numberInHeader": 10 - } + }, "deliveryMode": 1, "priority": 34, "correlationId": null, diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md old mode 100755 new mode 100644 index e40d9def..c4f4809a --- a/doc_source/with-msk.md +++ b/doc_source/with-msk.md @@ -22,7 +22,7 @@ Lambda sends the batch of messages in the event parameter when it invokes your f "mytopic-0":[ { "topic":"mytopic", - "partition":"0", + "partition":0, "offset":15, "timestamp":1545084650987, "timestampType":"CREATE_TIME", @@ -50,8 +50,6 @@ Lambda sends the batch of messages in the event parameter when it invokes your f } ``` -For an example of how to use Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. - **Topics** + [MSK cluster authentication](#msk-cluster-permissions) + [Managing API access and permissions](#msk-permissions) @@ -197,7 +195,7 @@ In addition to accessing the Amazon MSK cluster, your function needs permissions ### Required Lambda function execution role permissions Your Lambda function's [execution role](lambda-intro-execution-role.md) must have the following permissions to access the MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) ++ [kafka:DescribeClusterV2](https://docs.aws.amazon.com/MSK/2.0/APIReference/v2-clusters-clusterarn.html#v2-clusters-clusterarnget) + [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) + [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) diff --git a/doc_source/with-on-demand-custom-android.md b/doc_source/with-on-demand-custom-android.md old mode 100755 new mode 100644 diff --git a/doc_source/with-s3-example-use-app-spec.md b/doc_source/with-s3-example-use-app-spec.md old mode 100755 new mode 100644 diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md old mode 100755 new mode 100644 index 6eb4fcf1..e8060b21 --- a/doc_source/with-s3-example.md +++ b/doc_source/with-s3-example.md @@ -8,7 +8,7 @@ We recommend that you complete this console\-based tutorial before you try the [ To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. ## Create a bucket and upload a sample object diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md old mode 100755 new mode 100644 diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md old mode 100755 new mode 100644 diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md old mode 100755 new mode 100644 diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md old mode 100755 new mode 100644 diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md old mode 100755 new mode 100644 index e5f82e7b..e65d8177 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -4,7 +4,7 @@ You can use a Lambda function in one AWS account to subscribe to an Amazon SNS t ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md old mode 100755 new mode 100644 diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md old mode 100755 new mode 100644 diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md old mode 100755 new mode 100644 index 758947c6..0f5b2044 --- a/doc_source/with-sqs-cross-account-example.md +++ b/doc_source/with-sqs-cross-account-example.md @@ -4,7 +4,7 @@ In this tutorial, you create a Lambda function that consumes messages from an Am ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-sqs-example-use-app-spec.md b/doc_source/with-sqs-example-use-app-spec.md old mode 100755 new mode 100644 diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md old mode 100755 new mode 100644 index e610dccd..3b22cff6 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -4,7 +4,7 @@ In this tutorial, you create a Lambda function that consumes messages from an [A ## Prerequisites -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Getting started with Lambda](getting-started-create-function.md) to create your first Lambda function\. +This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md old mode 100755 new mode 100644 From 5c0ccbd482dacc2b42513ae37a765129168ecc8b Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Tue, 14 Jun 2022 15:15:52 +0200 Subject: [PATCH 161/243] Remove space before period --- doc_source/lambda-releases.md | 4 ++-- doc_source/provisioned-concurrency.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 8fec4b94..0dc5d739 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -84,7 +84,7 @@ The following table describes the important changes in each release of the *AWS | Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | | Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | | Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. | November 30,2017 | -| Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions ](lambda-rolling-deployments.md)\. | November 28, 2017 | +| Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions](lambda-rolling-deployments.md)\. | November 28, 2017 | | Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | | China \(Beijing\) Region | AWS Lambda is now available in the China \(Beijing\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 9, 2017 | | Introducing SAM Local | AWS Lambda introduces SAM Local \(now known as SAM CLI\), a AWS CLI tool that provides an environment for you to develop, test, and analyze your serverless applications locally before uploading them to the Lambda runtime\. For more information, see [ Testing and debugging serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html)\. | August 11, 2017 | @@ -106,7 +106,7 @@ The following table describes the important changes in each release of the *AWS | VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | | Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | | Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | -| Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) \. | July 14, 2015 | +| Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md)\. | July 14, 2015 | | Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | | The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | | Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md index 9597a647..8aad1c77 100644 --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -119,7 +119,7 @@ Provisioned concurrency does not come online immediately after you configure it\ + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency + ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency -To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency \. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. +To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency\. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. From b8ec50a706051a180cce968c93a3d48574a91edc Mon Sep 17 00:00:00 2001 From: Mark Adamson <3154635+mungojam@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:24:26 +0100 Subject: [PATCH 162/243] Correct C# SQS handler name --- doc_source/with-sqs-create-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index acdd5447..19c9a4fa 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -65,7 +65,7 @@ Build the code with the Lambda library dependencies to create a deployment packa The following is example C\# code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to the console\. - In the code, `handleRequest` is the handler\. The handler uses the predefined `SQSEvent` class that is defined in the `AWS.Lambda.SQSEvents` library\. +In the code, `HandleSQSEvent` is the handler\. The handler uses the predefined `SQSEvent` class that is defined in the `AWS.Lambda.SQSEvents` library\. **Example ProcessingSQSRecords\.cs** @@ -149,4 +149,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 4047c1be1675c928396a1886143691db2585b6fa Mon Sep 17 00:00:00 2001 From: sonuus <32681988+sonuus@users.noreply.github.com> Date: Thu, 30 Jun 2022 09:51:59 -0400 Subject: [PATCH 163/243] Update typescript-package.md --- doc_source/typescript-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/typescript-package.md b/doc_source/typescript-package.md index 8171f2b7..e7b443b4 100644 --- a/doc_source/typescript-package.md +++ b/doc_source/typescript-package.md @@ -97,7 +97,7 @@ To complete the steps in this section, you must have the following: npm install -D @types/aws-lambda ``` -1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create new two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. +1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. 1. Open **hello\-world\.function\.ts** and add the following code to the file\. This is the code for the Lambda function\. @@ -246,4 +246,4 @@ To complete the steps in this section, you must have the following: "statusCode": 200, "body": "{\"message\":\"hello world\"}" } - ``` \ No newline at end of file + ``` From ea8d8a22018d98af31311cf391e8800f0853ddc6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 6 Sep 2022 18:03:44 -0700 Subject: [PATCH 164/243] Upgraded the s3-java sample to use the latest dependency versions, most notably the AWS SDK for Java 2.x. - Refactored the Handler and test code to work with version 2.x of the SDK. - Updated both build.gradle and pom.xml files to use latest dependencies. - Minor edit to 5-invoke.sh script which was complaining about Invalid base64. - Tested the tutorial (scripts 1 through 6) end to end and it still works. --- sample-apps/s3-java/5-invoke.sh | 2 +- sample-apps/s3-java/build.gradle | 15 ++--- sample-apps/s3-java/pom.xml | 53 +++++++++------- .../src/main/java/example/Handler.java | 62 +++++++++++-------- .../src/test/java/example/InvokeTest.java | 18 +++--- 5 files changed, 84 insertions(+), 66 deletions(-) diff --git a/sample-apps/s3-java/5-invoke.sh b/sample-apps/s3-java/5-invoke.sh index d65db099..d2ae6adc 100755 --- a/sample-apps/s3-java/5-invoke.sh +++ b/sample-apps/s3-java/5-invoke.sh @@ -9,7 +9,7 @@ if [ ! -f event.json ]; then fi while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json --cli-binary-format raw-in-base64-out cat out.json echo "" sleep 2 diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 0c8eb35a..7e313201 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -7,18 +7,19 @@ repositories { } dependencies { - implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') + implementation platform('software.amazon.awssdk:bom:2.15.0') + implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.11.0') + implementation 'software.amazon.awssdk:s3' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'com.amazonaws:aws-java-sdk-s3:1.11.578' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' + runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 31a30dcf..3bbab2b5 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -11,26 +11,45 @@ 1.8 1.8 + + + + + software.amazon.awssdk + bom + 2.16.1 + pom + import + + + com.amazonaws + aws-xray-recorder-sdk-bom + 2.11.0 + pom + import + + + + + + software.amazon.awssdk + s3 + com.amazonaws aws-lambda-java-core - 1.2.0 + 1.2.1 com.amazonaws aws-lambda-java-events - 2.2.7 + 3.11.0 com.amazonaws aws-lambda-java-log4j2 - 1.5.0 - - - com.google.code.gson - gson - 2.8.6 + 1.5.1 org.apache.logging.log4j @@ -47,30 +66,22 @@ log4j-slf4j18-impl [2.17.1,) - - com.amazonaws - aws-java-sdk-s3 - 1.11.578 - com.amazonaws aws-xray-recorder-sdk-core - 2.4.0 - - - com.amazonaws - aws-xray-recorder-sdk-aws-sdk-core - 2.4.0 com.amazonaws aws-xray-recorder-sdk-aws-sdk - 2.4.0 com.amazonaws aws-xray-recorder-sdk-aws-sdk-instrumentor - 2.4.0 + + + com.google.code.gson + gson + 2.8.6 org.junit.jupiter diff --git a/sample-apps/s3-java/src/main/java/example/Handler.java b/sample-apps/s3-java/src/main/java/example/Handler.java index 829ceeb4..dc0de24c 100644 --- a/sample-apps/s3-java/src/main/java/example/Handler.java +++ b/sample-apps/s3-java/src/main/java/example/Handler.java @@ -8,21 +8,24 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.imageio.ImageIO; -import com.amazonaws.AmazonServiceException; +import software.amazon.awssdk.awscore.exception.AwsServiceException; +import software.amazon.awssdk.core.sync.RequestBody; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.model.S3Object; +import software.amazon.awssdk.services.s3.S3Client; + import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; -import com.amazonaws.services.s3.model.GetObjectRequest; -import com.amazonaws.services.s3.model.ObjectMetadata; -import com.amazonaws.services.s3.model.S3Object; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -67,19 +70,20 @@ public String handleRequest(S3Event s3event, Context context) { } // Download the image from S3 into a stream - AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); - S3Object s3Object = s3Client.getObject(new GetObjectRequest( - srcBucket, srcKey)); - InputStream objectData = s3Object.getObjectContent(); + S3Client s3Client = S3Client.builder().build(); + GetObjectRequest getObjectRequest = GetObjectRequest.builder() + .bucket(srcBucket) + .key(srcKey) + .build(); + InputStream s3Object = s3Client.getObject(getObjectRequest); // Read the source image - BufferedImage srcImage = ImageIO.read(objectData); + BufferedImage srcImage = ImageIO.read(s3Object); int srcHeight = srcImage.getHeight(); int srcWidth = srcImage.getWidth(); - // Infer the scaling factor to avoid stretching the image - // unnaturally - float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT - / srcHeight); + // Infer scaling factor to avoid stretching image unnaturally + float scalingFactor = Math.min( + MAX_WIDTH / srcWidth, MAX_HEIGHT / srcHeight); int width = (int) (scalingFactor * srcWidth); int height = (int) (scalingFactor * srcHeight); @@ -98,25 +102,29 @@ public String handleRequest(S3Event s3event, Context context) { // Re-encode image to target format ByteArrayOutputStream os = new ByteArrayOutputStream(); ImageIO.write(resizedImage, imageType, os); - InputStream is = new ByteArrayInputStream(os.toByteArray()); - // Set Content-Length and Content-Type - ObjectMetadata meta = new ObjectMetadata(); - meta.setContentLength(os.size()); + // InputStream is = new ByteArrayInputStream(os.toByteArray()); + + Map metadata = new HashMap<>(); + metadata.put("Content-Length", Integer.toString(os.size())); if (JPG_TYPE.equals(imageType)) { - meta.setContentType(JPG_MIME); - } - if (PNG_TYPE.equals(imageType)) { - meta.setContentType(PNG_MIME); + metadata.put("Content-Type", JPG_MIME); + } else if (PNG_TYPE.equals(imageType)) { + metadata.put("Content-Type", PNG_MIME); } + PutObjectRequest putObjectRequest = PutObjectRequest.builder() + .bucket(dstBucket) + .key(dstKey) + .metadata(metadata) + .build(); // Uploading to S3 destination bucket logger.info("Writing to: " + dstBucket + "/" + dstKey); try { - s3Client.putObject(dstBucket, dstKey, is, meta); + s3Client.putObject(putObjectRequest, RequestBody.fromBytes(os.toByteArray())); } - catch(AmazonServiceException e) + catch(AwsServiceException e) { - logger.error(e.getErrorMessage()); + logger.error(e.awsErrorDetails().errorMessage()); System.exit(1); } logger.info("Successfully resized " + srcBucket + "/" diff --git a/sample-apps/s3-java/src/test/java/example/InvokeTest.java b/sample-apps/s3-java/src/test/java/example/InvokeTest.java index 8e090042..4211548b 100644 --- a/sample-apps/s3-java/src/test/java/example/InvokeTest.java +++ b/sample-apps/s3-java/src/test/java/example/InvokeTest.java @@ -8,16 +8,14 @@ import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.event.S3EventNotification; -import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; -import com.amazonaws.services.s3.event.S3EventNotification.RequestParametersEntity; -import com.amazonaws.services.s3.event.S3EventNotification.ResponseElementsEntity; -import com.amazonaws.services.s3.event.S3EventNotification.S3Entity; -import com.amazonaws.services.s3.event.S3EventNotification.UserIdentityEntity; -import com.amazonaws.services.s3.event.S3EventNotification.GlacierEventDataEntity; -import com.amazonaws.services.s3.event.S3EventNotification.S3BucketEntity; -import com.amazonaws.services.s3.event.S3EventNotification.S3ObjectEntity; -import com.amazonaws.services.s3.event.S3EventNotification.UserIdentityEntity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.RequestParametersEntity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.ResponseElementsEntity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3BucketEntity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3Entity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3ObjectEntity; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.UserIdentityEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; From d00fb82ab786868005d250f2b0e9471326a18d48 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Wed, 7 Sep 2022 15:00:43 -0700 Subject: [PATCH 165/243] Refactor the code into logical function blocks for increased readability and abstraction. - Pulled out code from main handler into separate private functions. - Tested the scripts E2E to make sure they're still working. - Added additional comments in function code to explain steps. - Updated README with more explanations on what the function is doing, instead of just listing steps. --- sample-apps/s3-java/README.md | 15 ++- .../src/main/java/example/Handler.java | 120 +++++++++++------- 2 files changed, 86 insertions(+), 49 deletions(-) diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index 431ac34e..c94b7e99 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -4,7 +4,7 @@ The project source includes function code and supporting resources: -- `src/main` - A Java function. +- `src/main` - A Java Lambda function that scales down an image stored in S3. - `src/test` - A unit test and helper classes. - `template.yml` - An AWS CloudFormation template that creates an application. - `build.gradle` - A Gradle build file. @@ -63,10 +63,14 @@ You can also build the application with Maven. To use maven, add `mvn` to the co ... # Test -To upload an image file to the application bucket and trigger the function, run `4-upload.sh`. +This Lambda function takes an image that's currently stored in S3, and scales it down into +a thumbnail-sized image. To upload an image file to the application bucket, run `4-upload.sh`. s3-java$ ./4-upload.sh +In your `s3-java-bucket-` bucket that was created in step 3, you should now see a +key `inbound/sample-s3-java.png` file, which represents the original image. + To invoke the function directly, run `5-invoke.sh`. s3-java$ ./5-invoke.sh @@ -75,7 +79,12 @@ To invoke the function directly, run `5-invoke.sh`. "ExecutedVersion": "$LATEST" } -Let the script invoke the function a few times and then press `CRTL+C` to exit. +Let the script invoke the function a few times and then press `CRTL+C` to exit. Note that you +may see function timeouts in the first few iterations due to cold starts; after a while, they +should begin to succeed. + +If you look at the `s3-java-bucket-` bucket in your account, you should now see a +key `resized-inbound/sample-s3-java.png` file, which represents the new, shrunken image. The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. diff --git a/sample-apps/s3-java/src/main/java/example/Handler.java b/sample-apps/s3-java/src/main/java/example/Handler.java index dc0de24c..23e2cc56 100644 --- a/sample-apps/s3-java/src/main/java/example/Handler.java +++ b/sample-apps/s3-java/src/main/java/example/Handler.java @@ -37,12 +37,12 @@ public class Handler implements RequestHandler { Gson gson = new GsonBuilder().setPrettyPrinting().create(); private static final Logger logger = LoggerFactory.getLogger(Handler.class); - private static final float MAX_WIDTH = 100; - private static final float MAX_HEIGHT = 100; - private final String JPG_TYPE = (String) "jpg"; - private final String JPG_MIME = (String) "image/jpeg"; - private final String PNG_TYPE = (String) "png"; - private final String PNG_MIME = (String) "image/png"; + private static final float MAX_DIMENSION = 100; + private final String REGEX = ".*\\.([^\\.]*)"; + private final String JPG_TYPE = "jpg"; + private final String JPG_MIME = "image/jpeg"; + private final String PNG_TYPE = "png"; + private final String PNG_MIME = "image/png"; @Override public String handleRequest(S3Event s3event, Context context) { try { @@ -58,7 +58,7 @@ public String handleRequest(S3Event s3event, Context context) { String dstKey = "resized-" + srcKey; // Infer the image type. - Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); + Matcher matcher = Pattern.compile(REGEX).matcher(srcKey); if (!matcher.matches()) { logger.info("Unable to infer image type for key " + srcKey); return ""; @@ -71,67 +71,95 @@ public String handleRequest(S3Event s3event, Context context) { // Download the image from S3 into a stream S3Client s3Client = S3Client.builder().build(); - GetObjectRequest getObjectRequest = GetObjectRequest.builder() - .bucket(srcBucket) - .key(srcKey) - .build(); - InputStream s3Object = s3Client.getObject(getObjectRequest); + InputStream s3Object = getObject(s3Client, srcBucket, srcKey); - // Read the source image + // Read the source image and resize it BufferedImage srcImage = ImageIO.read(s3Object); - int srcHeight = srcImage.getHeight(); - int srcWidth = srcImage.getWidth(); - // Infer scaling factor to avoid stretching image unnaturally - float scalingFactor = Math.min( - MAX_WIDTH / srcWidth, MAX_HEIGHT / srcHeight); - int width = (int) (scalingFactor * srcWidth); - int height = (int) (scalingFactor * srcHeight); - - BufferedImage resizedImage = new BufferedImage(width, height, - BufferedImage.TYPE_INT_RGB); - Graphics2D g = resizedImage.createGraphics(); - // Fill with white before applying semi-transparent (alpha) images - g.setPaint(Color.white); - g.fillRect(0, 0, width, height); - // Simple bilinear resize - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - g.drawImage(srcImage, 0, 0, width, height, null); - g.dispose(); + BufferedImage newImage = resizeImage(srcImage); // Re-encode image to target format - ByteArrayOutputStream os = new ByteArrayOutputStream(); - ImageIO.write(resizedImage, imageType, os); - // InputStream is = new ByteArrayInputStream(os.toByteArray()); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + ImageIO.write(newImage, imageType, outputStream); + + // Upload new image to S3 + putObject(s3Client, outputStream, dstBucket, dstKey, imageType); + logger.info("Successfully resized " + srcBucket + "/" + + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); + return "Ok"; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private InputStream getObject(S3Client s3Client, String bucket, String key) { + GetObjectRequest getObjectRequest = GetObjectRequest.builder() + .bucket(bucket) + .key(key) + .build(); + return s3Client.getObject(getObjectRequest); + } + + private void putObject(S3Client s3Client, ByteArrayOutputStream outputStream, + String bucket, String key, String imageType) { Map metadata = new HashMap<>(); - metadata.put("Content-Length", Integer.toString(os.size())); + metadata.put("Content-Length", Integer.toString(outputStream.size())); if (JPG_TYPE.equals(imageType)) { metadata.put("Content-Type", JPG_MIME); } else if (PNG_TYPE.equals(imageType)) { metadata.put("Content-Type", PNG_MIME); } + PutObjectRequest putObjectRequest = PutObjectRequest.builder() - .bucket(dstBucket) - .key(dstKey) + .bucket(bucket) + .key(key) .metadata(metadata) .build(); // Uploading to S3 destination bucket - logger.info("Writing to: " + dstBucket + "/" + dstKey); + logger.info("Writing to: " + bucket + "/" + key); try { - s3Client.putObject(putObjectRequest, RequestBody.fromBytes(os.toByteArray())); + s3Client.putObject(putObjectRequest, + RequestBody.fromBytes(outputStream.toByteArray())); } catch(AwsServiceException e) { logger.error(e.awsErrorDetails().errorMessage()); System.exit(1); } - logger.info("Successfully resized " + srcBucket + "/" - + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); - return "Ok"; - } catch (IOException e) { - throw new RuntimeException(e); - } + } + + /** + * Resizes (shrinks) an image into a small, thumbnail-sized image. + * + * The new image is scaled down proportionally based on the source + * image. The scaling factor is determined based on the value of + * MAX_DIMENSION. The resulting new image has max(height, width) + * = MAX_DIMENSION. + * + * @param srcImage BufferedImage to resize. + * @return New BufferedImage that is scaled down to thumbnail size. + */ + private BufferedImage resizeImage(BufferedImage srcImage) { + int srcHeight = srcImage.getHeight(); + int srcWidth = srcImage.getWidth(); + // Infer scaling factor to avoid stretching image unnaturally + float scalingFactor = Math.min( + MAX_DIMENSION / srcWidth, MAX_DIMENSION / srcHeight); + int width = (int) (scalingFactor * srcWidth); + int height = (int) (scalingFactor * srcHeight); + + BufferedImage resizedImage = new BufferedImage(width, height, + BufferedImage.TYPE_INT_RGB); + Graphics2D graphics = resizedImage.createGraphics(); + // Fill with white before applying semi-transparent (alpha) images + graphics.setPaint(Color.white); + graphics.fillRect(0, 0, width, height); + // Simple bilinear resize + graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BILINEAR); + graphics.drawImage(srcImage, 0, 0, width, height, null); + graphics.dispose(); + return resizedImage; } } \ No newline at end of file From 716117f5c181bf31ae4f5037e9b167e980443677 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Fri, 9 Sep 2022 11:53:32 -0700 Subject: [PATCH 166/243] Address comments from @mwunderl - Revert changes to 5-invoke.sh script after noting config change - Update function timeout from 10s -> 30s in CFN stack templates --- sample-apps/s3-java/5-invoke.sh | 2 +- sample-apps/s3-java/template-mvn.yml | 2 +- sample-apps/s3-java/template.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sample-apps/s3-java/5-invoke.sh b/sample-apps/s3-java/5-invoke.sh index d2ae6adc..d65db099 100755 --- a/sample-apps/s3-java/5-invoke.sh +++ b/sample-apps/s3-java/5-invoke.sh @@ -9,7 +9,7 @@ if [ ! -f event.json ]; then fi while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json --cli-binary-format raw-in-base64-out + aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/s3-java/template-mvn.yml b/sample-apps/s3-java/template-mvn.yml index dff099bc..be8d8527 100644 --- a/sample-apps/s3-java/template-mvn.yml +++ b/sample-apps/s3-java/template-mvn.yml @@ -13,7 +13,7 @@ Resources: Runtime: java8 Description: Java function MemorySize: 512 - Timeout: 10 + Timeout: 30 # Function's execution role Policies: - AWSLambdaBasicExecutionRole diff --git a/sample-apps/s3-java/template.yml b/sample-apps/s3-java/template.yml index a576f664..c82e5ac0 100644 --- a/sample-apps/s3-java/template.yml +++ b/sample-apps/s3-java/template.yml @@ -13,7 +13,7 @@ Resources: Runtime: java8 Description: Java function MemorySize: 512 - Timeout: 10 + Timeout: 30 # Function's execution role Policies: - AWSLambdaBasicExecutionRole From ad15d879fcd82b4045c403473be5aef29b095971 Mon Sep 17 00:00:00 2001 From: Abilesh M <32014897+akiabi@users.noreply.github.com> Date: Wed, 19 Oct 2022 15:29:16 +0530 Subject: [PATCH 167/243] Quote missing in Line number 201 --- doc_source/invocation-layers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index de22876f..641ab74e 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -198,7 +198,7 @@ To list all layers in your account, you can omit the `--compatible-runtime` opti You can also get the latest version of a layer using the list\-layer\-versions command\. ``` -aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn +aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' ``` ## Adding layer permissions @@ -256,4 +256,4 @@ The GitHub repository for this guide provides blank sample applications that dem + **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) + **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file +For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. From 8147af7bc1cbce42083a1553b83cbdde5cc695b0 Mon Sep 17 00:00:00 2001 From: xalves <43173143+xalves@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:41:57 +0000 Subject: [PATCH 168/243] Update runtimes-images.md --- doc_source/runtimes-images.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md index 984482eb..7cd507e9 100644 --- a/doc_source/runtimes-images.md +++ b/doc_source/runtimes-images.md @@ -3,7 +3,7 @@ AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. **Note** -Each base image is compatible with one or more of the instruction set architectures that Lambda supports\. You need to build the function image for only one architcture\. Lambda does not support multi\-architecture images\. +Each base image is compatible with one or more of the instruction set architectures that Lambda supports\. You need to build the function image for only one architecture\. Lambda does not support multi\-architecture images\. **Topics** + [AWS base images for Lambda](#runtimes-images-lp) @@ -53,4 +53,4 @@ For your convenience, Lambda provides an open source runtime interface client fo ## Runtime interface emulator -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. \ No newline at end of file +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. From a83f69bc6467d61a2d5246cd7eb74ff629f6aac8 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 14 Nov 2022 19:16:09 +0000 Subject: [PATCH 169/243] Periodic update - 11/14/2022 --- ...API_AmazonManagedKafkaEventSourceConfig.md | 20 + doc_source/API_CreateCodeSigningConfig.md | 2 +- doc_source/API_CreateEventSourceMapping.md | 61 +- doc_source/API_CreateFunction.md | 2 +- doc_source/API_DeleteEventSourceMapping.md | 22 +- doc_source/API_EnvironmentResponse.md | 2 +- .../API_EventSourceMappingConfiguration.md | 18 +- doc_source/API_FunctionConfiguration.md | 2 +- doc_source/API_GetEventSourceMapping.md | 22 +- doc_source/API_GetFunctionConfiguration.md | 2 +- .../API_GetProvisionedConcurrencyConfig.md | 2 +- doc_source/API_Invoke.md | 2 +- doc_source/API_ListEventSourceMappings.md | 9 +- ...PI_ProvisionedConcurrencyConfigListItem.md | 2 +- doc_source/API_PublishVersion.md | 2 +- .../API_PutProvisionedConcurrencyConfig.md | 2 +- .../API_SelfManagedKafkaEventSourceConfig.md | 20 + doc_source/API_SourceAccessConfiguration.md | 12 +- doc_source/API_Types.md | 2 + doc_source/API_UpdateEventSourceMapping.md | 38 +- doc_source/API_UpdateFunctionCode.md | 2 +- doc_source/API_UpdateFunctionConfiguration.md | 2 +- doc_source/CommonErrors.md | 75 ++ doc_source/CommonParameters.md | 51 + doc_source/access-control-resource-based.md | 4 +- doc_source/applications-tutorial.md | 8 +- doc_source/attribute-based-access-control.md | 169 ++++ doc_source/best-practices.md | 4 +- doc_source/codewhisperer-overview.md | 79 ++ doc_source/codewhisperer-setup.md | 39 + doc_source/codewhisperer.md | 7 + doc_source/configuration-envvars.md | 8 +- doc_source/configuration-filesystem.md | 2 +- doc_source/configuration-function-common.md | 55 +- doc_source/configuration-function-zip.md | 2 +- doc_source/configuration-layers.md | 5 +- doc_source/configuration-tags.md | 105 +- doc_source/configuration-versions.md | 2 +- doc_source/configuration-vpc.md | 11 +- doc_source/csharp-exceptions.md | 2 +- doc_source/csharp-image.md | 10 +- doc_source/csharp-logging.md | 2 +- doc_source/csharp-tracing.md | 48 +- doc_source/deploying-lambda-apps.md | 2 +- doc_source/dotnet-native-aot.md | 108 +++ ...ple_cross_ApiGatewayDataTracker_section.md | 28 + ...e_cross_ApiGatewayWebsocketChat_section.md | 25 + ..._cross_AuroraRestLendingLibrary_section.md | 28 + .../example_cross_LambdaAPIGateway_section.md | 54 ++ .../example_cross_LambdaForBrowser_section.md | 29 + ...ple_cross_LambdaScheduledEvents_section.md | 54 ++ ...ample_cross_ServerlessWorkflows_section.md | 38 + ...le_cross_StepFunctionsMessenger_section.md | 27 + .../example_lambda_CreateFunction_section.md | 148 +++ .../example_lambda_DeleteFunction_section.md | 85 ++ .../example_lambda_GetFunction_section.md | 45 + doc_source/example_lambda_Invoke_section.md | 111 +++ .../example_lambda_ListFunctions_section.md | 44 + ...cenario_GettingStartedFunctions_section.md | 899 ++++++++++++++++++ ...ample_lambda_UpdateFunctionCode_section.md | 46 + ...bda_UpdateFunctionConfiguration_section.md | 44 + doc_source/extensions-api-partners.md | 30 +- doc_source/extensions-configuration.md | 55 ++ doc_source/foundation-arch.md | 4 +- doc_source/foundation-console.md | 2 +- doc_source/foundation-networking.md | 2 +- doc_source/functions-states.md | 2 +- doc_source/gettingstarted-awscli.md | 33 +- doc_source/gettingstarted-concepts.md | 4 +- doc_source/gettingstarted-features.md | 7 +- doc_source/gettingstarted-images.md | 5 +- doc_source/gettingstarted-limits.md | 6 +- doc_source/gettingstarted-package.md | 5 +- doc_source/go-image.md | 6 +- doc_source/golang-exceptions.md | 2 +- doc_source/golang-handler.md | 6 + doc_source/golang-logging.md | 2 +- doc_source/golang-package.md | 99 +- doc_source/golang-tracing.md | 119 ++- doc_source/images-create.md | 11 +- doc_source/index.md | 71 +- doc_source/invocation-async.md | 11 +- doc_source/invocation-eventfiltering.md | 64 +- doc_source/invocation-eventsourcemapping.md | 2 + doc_source/invocation-images.md | 2 +- doc_source/invocation-layers.md | 2 +- doc_source/invocation-sync.md | 2 +- doc_source/java-context.md | 6 +- doc_source/java-exceptions.md | 14 +- doc_source/java-handler.md | 39 +- doc_source/java-image.md | 10 +- doc_source/java-logging.md | 67 +- doc_source/java-package.md | 8 +- doc_source/java-samples.md | 59 +- doc_source/java-tracing.md | 108 ++- doc_source/lambda-api-permissions-ref.md | 52 +- doc_source/lambda-csharp.md | 14 +- ...ing-extensions.md => lambda-extensions.md} | 65 +- doc_source/lambda-foundation.md | 1 + doc_source/lambda-golang.md | 8 +- doc_source/lambda-intro-execution-role.md | 132 ++- doc_source/lambda-invocation.md | 1 - doc_source/lambda-java.md | 12 +- doc_source/lambda-nodejs.md | 14 +- doc_source/lambda-permissions.md | 24 +- doc_source/lambda-powershell.md | 11 +- doc_source/lambda-python.md | 15 +- doc_source/lambda-releases.md | 3 +- doc_source/lambda-ruby.md | 10 +- doc_source/lambda-runtime-environment.md | 12 +- doc_source/lambda-runtimes.md | 148 +-- doc_source/lambda-samples.md | 6 +- doc_source/lambda-typescript.md | 13 +- doc_source/lambda-urls.md | 9 +- doc_source/logging-using-cloudtrail.md | 7 +- doc_source/monitoring-cloudwatchlogs.md | 2 +- doc_source/monitoring-insights.md | 6 +- doc_source/monitoring-metrics.md | 2 +- doc_source/nodejs-exceptions.md | 2 +- doc_source/nodejs-image.md | 10 +- doc_source/nodejs-logging.md | 2 +- doc_source/nodejs-tracing.md | 144 +-- doc_source/powershell-exceptions.md | 2 +- doc_source/powershell-logging.md | 2 +- doc_source/provisioned-concurrency.md | 2 - doc_source/python-context.md | 3 - doc_source/python-exceptions.md | 5 +- doc_source/python-handler.md | 27 +- doc_source/python-image.md | 21 +- doc_source/python-logging.md | 5 +- doc_source/python-package.md | 9 +- doc_source/python-tracing.md | 127 ++- doc_source/ruby-exceptions.md | 2 +- doc_source/ruby-handler.md | 2 +- doc_source/ruby-image.md | 7 +- doc_source/ruby-logging.md | 2 +- doc_source/ruby-tracing.md | 52 +- doc_source/runtimes-extensions-api.md | 20 +- doc_source/runtimes-logs-api.md | 7 +- doc_source/runtimes-modify.md | 4 +- doc_source/runtimes-walkthrough.md | 5 +- doc_source/sdk-general-information-section.md | 23 + doc_source/security-iam.md | 10 +- .../security_iam_id-based-policy-examples.md | 13 +- doc_source/security_iam_service-with-iam.md | 2 +- doc_source/security_iam_troubleshoot.md | 10 +- doc_source/service_code_examples.md | 37 + doc_source/service_code_examples_actions.md | 14 + ...ce_code_examples_cross-service_examples.md | 13 + doc_source/service_code_examples_scenarios.md | 6 + doc_source/services-apigateway-tutorial.md | 75 +- doc_source/services-ec2-tutorial.md | 311 ------ doc_source/services-ec2.md | 2 +- doc_source/services-elasticache-tutorial.md | 5 +- doc_source/services-rds-tutorial.md | 5 +- doc_source/services-s3-object-lambda.md | 2 +- doc_source/services-xray.md | 22 +- doc_source/telemetry-api-reference.md | 126 +++ doc_source/telemetry-api.md | 263 +++++ doc_source/telemetry-otel-spans.md | 98 ++ doc_source/telemetry-schema-reference.md | 556 +++++++++++ doc_source/troubleshooting-deployment.md | 17 +- doc_source/troubleshooting-execution.md | 2 +- doc_source/troubleshooting-images.md | 2 +- doc_source/troubleshooting-invocation.md | 2 +- doc_source/typescript-exceptions.md | 2 +- doc_source/typescript-image.md | 2 +- doc_source/typescript-package.md | 4 +- doc_source/urls-auth.md | 5 +- doc_source/urls-configuration.md | 13 +- doc_source/urls-invocation.md | 8 +- doc_source/urls-tutorial.md | 18 +- doc_source/welcome.md | 4 +- doc_source/with-android-example.md | 7 +- doc_source/with-cloudtrail-example.md | 254 ----- doc_source/with-cloudtrail.md | 1 - doc_source/with-ddb-example.md | 7 +- doc_source/with-ddb.md | 22 +- doc_source/with-kafka.md | 29 +- doc_source/with-kinesis-example.md | 7 +- doc_source/with-kinesis.md | 22 +- doc_source/with-mq.md | 70 +- doc_source/with-msk.md | 55 +- doc_source/with-s3-tutorial.md | 605 +++++------- doc_source/with-sns-example.md | 9 +- doc_source/with-sqs-cross-account-example.md | 7 +- doc_source/with-sqs-example.md | 7 +- doc_source/with-sqs.md | 8 +- 188 files changed, 5301 insertions(+), 2126 deletions(-) create mode 100644 doc_source/API_AmazonManagedKafkaEventSourceConfig.md create mode 100644 doc_source/API_SelfManagedKafkaEventSourceConfig.md create mode 100644 doc_source/CommonErrors.md create mode 100644 doc_source/CommonParameters.md create mode 100644 doc_source/attribute-based-access-control.md create mode 100644 doc_source/codewhisperer-overview.md create mode 100644 doc_source/codewhisperer-setup.md create mode 100644 doc_source/codewhisperer.md create mode 100644 doc_source/dotnet-native-aot.md create mode 100644 doc_source/example_cross_ApiGatewayDataTracker_section.md create mode 100644 doc_source/example_cross_ApiGatewayWebsocketChat_section.md create mode 100644 doc_source/example_cross_AuroraRestLendingLibrary_section.md create mode 100644 doc_source/example_cross_LambdaAPIGateway_section.md create mode 100644 doc_source/example_cross_LambdaForBrowser_section.md create mode 100644 doc_source/example_cross_LambdaScheduledEvents_section.md create mode 100644 doc_source/example_cross_ServerlessWorkflows_section.md create mode 100644 doc_source/example_cross_StepFunctionsMessenger_section.md create mode 100644 doc_source/example_lambda_CreateFunction_section.md create mode 100644 doc_source/example_lambda_DeleteFunction_section.md create mode 100644 doc_source/example_lambda_GetFunction_section.md create mode 100644 doc_source/example_lambda_Invoke_section.md create mode 100644 doc_source/example_lambda_ListFunctions_section.md create mode 100644 doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md create mode 100644 doc_source/example_lambda_UpdateFunctionCode_section.md create mode 100644 doc_source/example_lambda_UpdateFunctionConfiguration_section.md create mode 100644 doc_source/extensions-configuration.md rename doc_source/{using-extensions.md => lambda-extensions.md} (61%) create mode 100644 doc_source/sdk-general-information-section.md create mode 100644 doc_source/service_code_examples.md create mode 100644 doc_source/service_code_examples_actions.md create mode 100644 doc_source/service_code_examples_cross-service_examples.md create mode 100644 doc_source/service_code_examples_scenarios.md delete mode 100644 doc_source/services-ec2-tutorial.md create mode 100644 doc_source/telemetry-api-reference.md create mode 100644 doc_source/telemetry-api.md create mode 100644 doc_source/telemetry-otel-spans.md create mode 100644 doc_source/telemetry-schema-reference.md delete mode 100644 doc_source/with-cloudtrail-example.md diff --git a/doc_source/API_AmazonManagedKafkaEventSourceConfig.md b/doc_source/API_AmazonManagedKafkaEventSourceConfig.md new file mode 100644 index 00000000..fb7a856a --- /dev/null +++ b/doc_source/API_AmazonManagedKafkaEventSourceConfig.md @@ -0,0 +1,20 @@ +# AmazonManagedKafkaEventSourceConfig + +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. + +## Contents + + ** ConsumerGroupId ** +The identifier for the Kafka consumer group to join\. The consumer group ID must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)\. +Type: String +Length Constraints: Minimum length of 1\. Maximum length of 200\. +Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md index 399ed29b..7966e6cb 100644 --- a/doc_source/API_CreateCodeSigningConfig.md +++ b/doc_source/API_CreateCodeSigningConfig.md @@ -1,6 +1,6 @@ # CreateCodeSigningConfig -Creates a code signing configuration\. A [code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html) defines a list of allowed signing profiles and defines the code\-signing validation policy \(action to be taken if deployment validation checks fail\)\. +Creates a code signing configuration\. A [code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) defines a list of allowed signing profiles and defines the code\-signing validation policy \(action to be taken if deployment validation checks fail\)\. ## Request Syntax diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md index 5068cc50..4c68396b 100644 --- a/doc_source/API_CreateEventSourceMapping.md +++ b/doc_source/API_CreateEventSourceMapping.md @@ -1,6 +1,6 @@ # CreateEventSourceMapping -Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and triggers the function\. +Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and invokes the function\. For details about how to configure different event sources, see the following topics\. + [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) @@ -10,7 +10,7 @@ For details about how to configure different event sources, see the following to + [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) + [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) -The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): +The following error handling options are available only for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. + `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 @@ -32,6 +32,9 @@ POST /2015-03-31/event-source-mappings/ HTTP/1.1 Content-type: application/json { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -63,6 +66,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -84,13 +90,18 @@ The request does not use any URI parameters\. The request accepts the following data in JSON format\. + ** [AmazonManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_RequestSyntax) ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object +Required: No + ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. + **Amazon Kinesis** \- Default 100\. Max 10,000\. + **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-managed Apache Kafka** \- Default 100\. Max 10,000\. + **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -118,12 +129,13 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. + **Amazon Simple Queue Service** \- The ARN of the queue\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. ++ **Amazon MQ** \- The ARN of the broker\. Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` Required: No ** [FilterCriteria](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object Required: No @@ -149,9 +161,9 @@ Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -163,7 +175,7 @@ Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No @@ -183,8 +195,13 @@ Pattern: `[\s\S]*` Required: No ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** -The Self\-Managed Apache Kafka cluster to send records\. +The self\-managed Apache Kafka cluster to receive records from\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Required: No + + ** [SelfManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_RequestSyntax) ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object Required: No ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** @@ -194,7 +211,7 @@ Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is only supported for Amazon Kinesis streams\. +The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. Type: String Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` Required: No @@ -213,7 +230,7 @@ Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` Required: No ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second and 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -225,6 +242,9 @@ HTTP/1.1 202 Content-type: application/json { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -257,6 +277,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -279,6 +302,10 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. + ** [AmazonManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object + ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. @@ -300,7 +327,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FilterCriteria](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** @@ -323,9 +350,9 @@ The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -355,6 +382,10 @@ Pattern: `[\s\S]*` The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SelfManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object + ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md index 28bb37fe..3b2597a8 100644 --- a/doc_source/API_CreateFunction.md +++ b/doc_source/API_CreateFunction.md @@ -335,7 +335,7 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_CreateFunction_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [EphemeralStorage](#API_CreateFunction_ResponseSyntax) ** diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md index a1d967bf..589ce1ed 100644 --- a/doc_source/API_DeleteEventSourceMapping.md +++ b/doc_source/API_DeleteEventSourceMapping.md @@ -29,6 +29,9 @@ HTTP/1.1 202 Content-type: application/json { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -61,6 +64,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -83,6 +89,10 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. + ** [AmazonManagedKafkaEventSourceConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object + ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. @@ -104,7 +114,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FilterCriteria](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** @@ -127,9 +137,9 @@ The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -159,6 +169,10 @@ Pattern: `[\s\S]*` The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SelfManagedKafkaEventSourceConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object + ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md index d3e1bb12..6b9599c1 100644 --- a/doc_source/API_EnvironmentResponse.md +++ b/doc_source/API_EnvironmentResponse.md @@ -10,7 +10,7 @@ Type: [EnvironmentError](API_EnvironmentError.md) object Required: No ** Variables ** -Environment variable key\-value pairs\. +Environment variable key\-value pairs\. Omitted from AWS CloudTrail logs\. Type: String to string map Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` Required: No diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md index 09daed13..23d47d32 100644 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ b/doc_source/API_EventSourceMappingConfiguration.md @@ -4,6 +4,11 @@ A mapping between an AWS resource and a Lambda function\. For details, see [Crea ## Contents + ** AmazonManagedKafkaEventSourceConfig ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object +Required: No + ** BatchSize ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. @@ -29,7 +34,7 @@ Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1}) Required: No ** FilterCriteria ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object Required: No @@ -57,9 +62,9 @@ Type: String Required: No ** MaximumBatchingWindowInSeconds ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -93,6 +98,11 @@ Required: No ** SelfManagedEventSource ** The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object +Required: No + + ** SelfManagedKafkaEventSourceConfig ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object Required: No ** SourceAccessConfigurations ** diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md index 33b13c87..fdd4f100 100644 --- a/doc_source/API_FunctionConfiguration.md +++ b/doc_source/API_FunctionConfiguration.md @@ -33,7 +33,7 @@ Length Constraints: Minimum length of 0\. Maximum length of 256\. Required: No ** Environment ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object Required: No diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md index f3497c58..82f1e546 100644 --- a/doc_source/API_GetEventSourceMapping.md +++ b/doc_source/API_GetEventSourceMapping.md @@ -27,6 +27,9 @@ HTTP/1.1 200 Content-type: application/json { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -59,6 +62,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -81,6 +87,10 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. + ** [AmazonManagedKafkaEventSourceConfig](#API_GetEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object + ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. @@ -102,7 +112,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FilterCriteria](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** @@ -125,9 +135,9 @@ The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -157,6 +167,10 @@ Pattern: `[\s\S]*` The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SelfManagedKafkaEventSourceConfig](#API_GetEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object + ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md index c3774fbe..72f016d4 100644 --- a/doc_source/API_GetFunctionConfiguration.md +++ b/doc_source/API_GetFunctionConfiguration.md @@ -148,7 +148,7 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [EphemeralStorage](#API_GetFunctionConfiguration_ResponseSyntax) ** diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md index b8da47c5..4e066681 100644 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ b/doc_source/API_GetProvisionedConcurrencyConfig.md @@ -57,7 +57,7 @@ If the action is successful, the service sends back an HTTP 200 response\. The following data is returned in JSON format by the service\. ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency allocated\. +The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. Type: Integer Valid Range: Minimum value of 0\. diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md index fbbf3396..9a18dea1 100644 --- a/doc_source/API_Invoke.md +++ b/doc_source/API_Invoke.md @@ -12,7 +12,7 @@ The status code in the API response doesn't reflect function errors\. Error code For functions with a long timeout, your client might be disconnected during synchronous invocation while it waits for a response\. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep\-alive settings\. -This operation requires permission for the [lambda:InvokeFunction](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) action\. +This operation requires permission for the [lambda:InvokeFunction](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) action\. For details on how to set up permissions for cross\-account invocations, see [Granting function access to other accounts](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountinvoke)\. ## Request Syntax diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md index 4c9b3cc4..ffb51e45 100644 --- a/doc_source/API_ListEventSourceMappings.md +++ b/doc_source/API_ListEventSourceMappings.md @@ -1,6 +1,6 @@ # ListEventSourceMappings -Lists event source mappings\. Specify an `EventSourceArn` to only show event source mappings for a single event source\. +Lists event source mappings\. Specify an `EventSourceArn` to show only event source mappings for a single event source\. ## Request Syntax @@ -18,6 +18,7 @@ The Amazon Resource Name \(ARN\) of the event source\. + **Amazon DynamoDB Streams** \- The ARN of the stream\. + **Amazon Simple Queue Service** \- The ARN of the queue\. + **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. ++ **Amazon MQ** \- The ARN of the broker\. Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** @@ -52,6 +53,9 @@ Content-type: application/json { "EventSourceMappings": [ { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -84,6 +88,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md index 71a88d0f..a3fa85da 100644 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ b/doc_source/API_ProvisionedConcurrencyConfigListItem.md @@ -5,7 +5,7 @@ Details about the provisioned concurrency configuration for a function alias or ## Contents ** AllocatedProvisionedConcurrentExecutions ** -The amount of provisioned concurrency allocated\. +The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. Type: Integer Valid Range: Minimum value of 0\. Required: No diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md index 667417fc..15c91663 100644 --- a/doc_source/API_PublishVersion.md +++ b/doc_source/API_PublishVersion.md @@ -168,7 +168,7 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_PublishVersion_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [EphemeralStorage](#API_PublishVersion_ResponseSyntax) ** diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md index bcea56b2..af3f197d 100644 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ b/doc_source/API_PutProvisionedConcurrencyConfig.md @@ -68,7 +68,7 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency allocated\. +The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. Type: Integer Valid Range: Minimum value of 0\. diff --git a/doc_source/API_SelfManagedKafkaEventSourceConfig.md b/doc_source/API_SelfManagedKafkaEventSourceConfig.md new file mode 100644 index 00000000..c3e83808 --- /dev/null +++ b/doc_source/API_SelfManagedKafkaEventSourceConfig.md @@ -0,0 +1,20 @@ +# SelfManagedKafkaEventSourceConfig + +Specific configuration settings for a self\-managed Apache Kafka event source\. + +## Contents + + ** ConsumerGroupId ** +The identifier for the Kafka consumer group to join\. The consumer group ID must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)\. +Type: String +Length Constraints: Minimum length of 1\. Maximum length of 200\. +Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` +Required: No + +## See Also + +For more information about using this API in one of the language\-specific AWS SDKs, see the following: ++ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) ++ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) ++ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) ++ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md index 12faeaad..f943784e 100644 --- a/doc_source/API_SourceAccessConfiguration.md +++ b/doc_source/API_SourceAccessConfiguration.md @@ -8,12 +8,12 @@ To secure and define access to your event source, you can specify the authentica The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. + `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. + `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. -+ `VPC_SUBNET` \- The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your self\-managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. -+ `VIRTUAL_HOST` \- \(Amazon MQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. -+ `CLIENT_CERTIFICATE_TLS_AUTH` \- \(Amazon MSK, Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the certificate chain \(X\.509 PEM\), private key \(PKCS\#8 PEM\), and private key password \(optional\) used for mutual TLS authentication of your MSK/Apache Kafka brokers\. ++ `VPC_SUBNET` \- \(Self\-managed Apache Kafka\) The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your self\-managed Apache Kafka cluster\. ++ `VPC_SECURITY_GROUP` \- \(Self\-managed Apache Kafka\) The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_256_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. ++ `SASL_SCRAM_512_AUTH` \- \(Amazon MSK, Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. ++ `VIRTUAL_HOST` \- \(RabbitMQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. ++ `CLIENT_CERTIFICATE_TLS_AUTH` \- \(Amazon MSK, self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the certificate chain \(X\.509 PEM\), private key \(PKCS\#8 PEM\), and private key password \(optional\) used for mutual TLS authentication of your MSK/Apache Kafka brokers\. + `SERVER_ROOT_CA_CERTIFICATE` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the root CA certificate \(X\.509 PEM\) used for TLS encryption of your Apache Kafka brokers\. Type: String Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE` diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md index 416dd819..6c1f567d 100644 --- a/doc_source/API_Types.md +++ b/doc_source/API_Types.md @@ -6,6 +6,7 @@ The following data types are supported: + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) + [AllowedPublishers](API_AllowedPublishers.md) ++ [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) + [CodeSigningConfig](API_CodeSigningConfig.md) + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) @@ -37,6 +38,7 @@ The following data types are supported: + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + [SelfManagedEventSource](API_SelfManagedEventSource.md) ++ [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md index fe810a18..dca009fc 100644 --- a/doc_source/API_UpdateEventSourceMapping.md +++ b/doc_source/API_UpdateEventSourceMapping.md @@ -10,7 +10,7 @@ For details about how to configure different event sources, see the following to + [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) + [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) -The following error handling options are only available for stream sources \(DynamoDB and Kinesis\): +The following error handling options are available only for stream sources \(DynamoDB and Kinesis\): + `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. + `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. + `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 @@ -84,7 +84,7 @@ The maximum number of records in each batch that Lambda pulls from your stream o + **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. + **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. + **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-Managed Apache Kafka** \- Default 100\. Max 10,000\. ++ **Self\-managed Apache Kafka** \- Default 100\. Max 10,000\. + **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. Type: Integer Valid Range: Minimum value of 1\. Maximum value of 10000\. @@ -107,7 +107,7 @@ Type: Boolean Required: No ** [FilterCriteria](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object Required: No @@ -133,9 +133,9 @@ Valid Values:` ReportBatchItemFailures` Required: No ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. Required: No @@ -147,7 +147,7 @@ Valid Range: Minimum value of \-1\. Maximum value of 604800\. Required: No ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is infinite \(\-1\)\. When set to infinite \(\-1\), failed records will be retried until the record expires\. +\(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\. Type: Integer Valid Range: Minimum value of \-1\. Maximum value of 10000\. Required: No @@ -165,7 +165,7 @@ Array Members: Minimum number of 0 items\. Maximum number of 22 items\. Required: No ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second up to 900 seconds\. +\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second and 900 seconds\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 900\. Required: No @@ -177,6 +177,9 @@ HTTP/1.1 202 Content-type: application/json { + "AmazonManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "BatchSize": number, "BisectBatchOnFunctionError": boolean, "DestinationConfig": { @@ -209,6 +212,9 @@ Content-type: application/json "string" : [ "string" ] } }, + "SelfManagedKafkaEventSourceConfig": { + "ConsumerGroupId": "string" + }, "SourceAccessConfigurations": [ { "Type": "string", @@ -231,6 +237,10 @@ If the action is successful, the service sends back an HTTP 202 response\. The following data is returned in JSON format by the service\. + ** [AmazonManagedKafkaEventSourceConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. +Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object + ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. @@ -252,7 +262,7 @@ Type: String Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` ** [FilterCriteria](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. +An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. Type: [FilterCriteria](API_FilterCriteria.md) object ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** @@ -275,9 +285,9 @@ The result of the last Lambda invocation of your function\. Type: String ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS standard queues\) The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. -Default: 0 -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. +The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. +For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. +Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. Type: Integer Valid Range: Minimum value of 0\. Maximum value of 300\. @@ -307,6 +317,10 @@ Pattern: `[\s\S]*` The self\-managed Apache Kafka cluster for your event source\. Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object + ** [SelfManagedKafkaEventSourceConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** +Specific configuration settings for a self\-managed Apache Kafka event source\. +Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object + ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md index b963ced7..439dafb9 100644 --- a/doc_source/API_UpdateFunctionCode.md +++ b/doc_source/API_UpdateFunctionCode.md @@ -216,7 +216,7 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [EphemeralStorage](#API_UpdateFunctionCode_ResponseSyntax) ** diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md index 9fe342d2..7fbcf30b 100644 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ b/doc_source/API_UpdateFunctionConfiguration.md @@ -280,7 +280,7 @@ Type: String Length Constraints: Minimum length of 0\. Maximum length of 256\. ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. +The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. Type: [EnvironmentResponse](API_EnvironmentResponse.md) object ** [EphemeralStorage](#API_UpdateFunctionConfiguration_ResponseSyntax) ** diff --git a/doc_source/CommonErrors.md b/doc_source/CommonErrors.md new file mode 100644 index 00000000..d5311270 --- /dev/null +++ b/doc_source/CommonErrors.md @@ -0,0 +1,75 @@ +# Common Errors + +This section lists the errors common to the API actions of all AWS services\. For errors specific to an API action for this service, see the topic for that API action\. + + **AccessDeniedException** +You do not have sufficient access to perform this action\. +HTTP Status Code: 400 + + **IncompleteSignature** +The request signature does not conform to AWS standards\. +HTTP Status Code: 400 + + **InternalFailure** +The request processing has failed because of an unknown error, exception or failure\. +HTTP Status Code: 500 + + **InvalidAction** +The action or operation requested is invalid\. Verify that the action is typed correctly\. +HTTP Status Code: 400 + + **InvalidClientTokenId** +The X\.509 certificate or AWS access key ID provided does not exist in our records\. +HTTP Status Code: 403 + + **InvalidParameterCombination** +Parameters that must not be used together were used together\. +HTTP Status Code: 400 + + **InvalidParameterValue** +An invalid or out\-of\-range value was supplied for the input parameter\. +HTTP Status Code: 400 + + **InvalidQueryParameter** +The AWS query string is malformed or does not adhere to AWS standards\. +HTTP Status Code: 400 + + **MalformedQueryString** +The query string contains a syntax error\. +HTTP Status Code: 404 + + **MissingAction** +The request is missing an action or a required parameter\. +HTTP Status Code: 400 + + **MissingAuthenticationToken** +The request must contain either a valid \(registered\) AWS access key ID or X\.509 certificate\. +HTTP Status Code: 403 + + **MissingParameter** +A required parameter for the specified action is not supplied\. +HTTP Status Code: 400 + + **NotAuthorized** +You do not have permission to perform this action\. +HTTP Status Code: 400 + + **OptInRequired** +The AWS access key ID needs a subscription for the service\. +HTTP Status Code: 403 + + **RequestExpired** +The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date \(such as for pre\-signed URLs\), or the date stamp on the request is more than 15 minutes in the future\. +HTTP Status Code: 400 + + **ServiceUnavailable** +The request has failed due to a temporary failure of the server\. +HTTP Status Code: 503 + + **ThrottlingException** +The request was denied due to request throttling\. +HTTP Status Code: 400 + + **ValidationError** +The input fails to satisfy the constraints specified by an AWS service\. +HTTP Status Code: 400 \ No newline at end of file diff --git a/doc_source/CommonParameters.md b/doc_source/CommonParameters.md new file mode 100644 index 00000000..3116ae8e --- /dev/null +++ b/doc_source/CommonParameters.md @@ -0,0 +1,51 @@ +# Common Parameters + +The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string\. Any action\-specific parameters are listed in the topic for that action\. For more information about Signature Version 4, see [Signature Version 4 Signing Process](http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *Amazon Web Services General Reference*\. + + **Action** +The action to be performed\. +Type: string + Required: Yes + + **Version** +The API version that the request is written for, expressed in the format YYYY\-MM\-DD\. +Type: string + Required: Yes + + **X\-Amz\-Algorithm** +The hash algorithm that you used to create the request signature\. +Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. +Type: string + Valid Values: `AWS4-HMAC-SHA256` + Required: Conditional + + **X\-Amz\-Credential** +The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string \("aws4\_request"\)\. The value is expressed in the following format: *access\_key*/*YYYYMMDD*/*region*/*service*/aws4\_request\. +For more information, see [Task 2: Create a String to Sign for Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html) in the *Amazon Web Services General Reference*\. +Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. +Type: string + Required: Conditional + + **X\-Amz\-Date** +The date that is used to create the signature\. The format must be ISO 8601 basic format \(YYYYMMDD'T'HHMMSS'Z'\)\. For example, the following date time is a valid X\-Amz\-Date value: `20120325T120000Z`\. +Condition: X\-Amz\-Date is optional for all requests; it can be used to override the date used for signing requests\. If the Date header is specified in the ISO 8601 basic format, X\-Amz\-Date is not required\. When X\-Amz\-Date is used, it always overrides the value of the Date header\. For more information, see [Handling Dates in Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-date-handling.html) in the *Amazon Web Services General Reference*\. +Type: string + Required: Conditional + + **X\-Amz\-Security\-Token** +The temporary security token that was obtained through a call to AWS Security Token Service \(AWS STS\)\. For a list of services that support temporary security credentials from AWS Security Token Service, go to [AWS Services That Work with IAM](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*\. +Condition: If you're using temporary security credentials from the AWS Security Token Service, you must include the security token\. +Type: string + Required: Conditional + + **X\-Amz\-Signature** +Specifies the hex\-encoded signature that was calculated from the string to sign and the derived signing key\. +Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. +Type: string + Required: Conditional + + **X\-Amz\-SignedHeaders** +Specifies all the HTTP headers that were included as part of the canonical request\. For more information about specifying signed headers, see [ Task 1: Create a Canonical Request For Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html) in the * Amazon Web Services General Reference*\. +Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. +Type: string + Required: Conditional \ No newline at end of file diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md index 512d29da..26bb3390 100644 --- a/doc_source/access-control-resource-based.md +++ b/doc_source/access-control-resource-based.md @@ -1,6 +1,6 @@ -# Using resource\-based policies for AWS Lambda +# Using resource\-based policies for Lambda -AWS Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts or organizations on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. +Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts or organizations on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can also use a single resource\-based policy to grant permissions to an entire organization in AWS Organizations\. You can also use resource\-based policies to [grant invoke permission to an AWS service](#permissions-resource-serviceinvoke) that invokes a function in response to activity in your account\. diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md index 95c2aea7..c5b60a90 100644 --- a/doc_source/applications-tutorial.md +++ b/doc_source/applications-tutorial.md @@ -45,7 +45,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. This tutorial uses CodeCommit for source control\. To set up your local machine to access and update application code, see [Setting up](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html) in the *AWS CodeCommit User Guide*\. @@ -267,7 +270,8 @@ Lambda creates additional instances of your function to handle multiple concurre The AWS CloudFormation template that defines your application resources uses the AWS Serverless Application Model transform to simplify the syntax for resource definitions, and automate uploading the deployment package and other artifacts\. AWS SAM also provides a command line interface \(the AWS SAM CLI\), which has the same packaging and deployment functionality as the AWS CLI, with additional features specific to Lambda applications\. Use the AWS SAM CLI to test your application locally in a Docker container that emulates the Lambda execution environment\. + [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) -+ [Testing and debugging serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html) ++ [Testing and debugging serverless applications with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html) ++ [Deploying serverless applications using CI/CD systems with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) AWS Cloud9 provides an online development environment that includes Node\.js, the AWS SAM CLI, and Docker\. With AWS Cloud9, you can start developing quickly and access your development environment from any computer\. For instructions, see [Getting started](https://docs.aws.amazon.com/cloud9/latest/user-guide/get-started.html) in the *AWS Cloud9 User Guide*\. diff --git a/doc_source/attribute-based-access-control.md b/doc_source/attribute-based-access-control.md new file mode 100644 index 00000000..8f7301f0 --- /dev/null +++ b/doc_source/attribute-based-access-control.md @@ -0,0 +1,169 @@ +# Attribute\-based access control for Lambda + +With [attribute\-based access control \(ABAC\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html), you can use tags to control access to your Lambda functions\. You can attach tags to a Lambda function, pass them in certain API requests, or attach them to the AWS Identity and Access Management \(IAM\) principal making the request\. For more information about how AWS grants attribute\-based access, see [Controlling access to AWS resources using tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html) in the *IAM User Guide*\. + +You can use ABAC to [grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) without specifying an Amazon Resource Name \(ARN\) or ARN pattern in the IAM policy\. Instead, you can specify a tag in the [condition element](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) of an IAM policy to control access\. Scaling is easier with ABAC because you don't have to update your IAM policies when you create new functions\. Instead, add tags to the new functions to control access\. + +In Lambda, tags work at the function level\. Tags aren't supported for layers, code signing configurations, or event source mappings\. When you tag a function, those tags apply to all versions and aliases associated with the function\. For information about how to tag functions, see [Using tags on Lambda functions](configuration-tags.md)\. + +You can use the following condition keys to control function actions: ++ [aws:ResourceTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag): Control access based on the tags that are attached to Lambda functions\. ++ [aws:RequestTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag): Require tags to be present in a request, such as when creating a new function\. ++ [aws:PrincipalTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-principaltag): Control what the IAM principal \(the person making the request\) is allowed to do based on the tags that are attached to their IAM [user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags_users.html) or [role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags_roles.html)\. ++ [aws:TagKeys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys): Control whether specific tag keys can be used in a request\. + +For a complete list of Lambda actions that support ABAC, see [Function actions](lambda-api-permissions-ref.md#permissions-resources-function) and check the **Condition** column in the table\. + +The following steps demonstrate one way to set up permissions using ABAC\. In this example scenario, you'll create four IAM permissions policies\. Then, you'll attach these policies to a new IAM role\. Finally, you'll create an IAM user and give that user permission to assume the new role\. + +## Prerequisites + +Make sure that you have a [Lambda execution role](lambda-intro-execution-role.md)\. You'll use this role when you grant IAM permissions and when you create a Lambda function\. + +## Step 1: Require tags on new functions + +When using ABAC with Lambda, it's a best practice to require that all functions have tags\. This helps ensure that your ABAC permissions policies work as expected\. + +[Create an IAM policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) similar to the following example\. This policy uses the [aws:RequestTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag) and [aws:TagKeys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys) condition keys to require that new functions and the IAM principal creating the functions both have the `project` tag\. The `ForAllValues` modifier ensures that `project` is the only allowed tag\. If you don't include the `ForAllValues` modifier, users can add other tags to the function as long as they also pass `project`\. + +**Example – Require tags on new functions** + +``` +{ + "Version": "2012-10-17", + "Statement": { + "Effect": "Allow", + "Action": [ + "lambda:CreateFunction", + "lambda:TagResource" + ], + "Resource": "arn:aws:lambda:*:*:function:*", + "Condition": { + "StringEquals": { + "aws:RequestTag/project": "${aws:PrincipalTag/project}" + }, + "ForAllValues:StringEquals": { + "aws:TagKeys": "project" + } + } + } +} +``` + +## Step 2: Allow actions based on tags attached to a Lambda function and IAM principal + +Create a second IAM policy using the [aws:ResourceTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag) condition key to require the principal's tag to match the tag that's attached to the function\. The following example policy allows principals with the `project` tag to invoke functions with the `project` tag\. If a function has any other tags, the action is denied\. + +**Example – Require matching tags on function and IAM principal** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "lambda:InvokeFunction", + "lambda:GetFunction" + ], + "Resource": "arn:aws:lambda:*:*:function:*", + "Condition": { + "StringEquals": { + "aws:ResourceTag/project": "${aws:PrincipalTag/project}" + } + } + } + ] +} +``` + +## Step 3: Grant list permissions + +Create a policy that allows the principal to list Lambda functions and IAM roles\. This allows the principal to see all Lambda functions and IAM roles on the console and when calling the API actions\. + +**Example – Grant Lambda and IAM list permissions** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AllResourcesLambdaNoTags", + "Effect": "Allow", + "Action": [ + "lambda:GetAccountSettings", + "lambda:ListFunctions", + "iam:ListRoles" + ], + "Resource": "*" + } + ] +} +``` + +## Step 4: Grant IAM permissions + +Create a policy that allows **iam:PassRole**\. This permission is required when you assign an execution role to a function\. In the following example policy, replace the example ARN with the ARN of your Lambda execution role\. + +**Note** +Do not use the `ResourceTag` condition key in a policy with the `iam:PassRole` action\. You cannot use the tag on an IAM role to control access to who can pass that role\. For more information about permissions required to pass a role to a service, see [Granting a user permissions to pass a role to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)\. + +**Example – Grant permission to pass the execution role** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "iam:PassRole" + ], + "Resource": "arn:aws:iam::111122223333:role/lambda-ex" + } + ] +} +``` + +## Step 5: Create the IAM role + +It's a best practice to [use roles to delegate permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#delegate-using-roles)\. [Create an IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html#roles-creatingrole-user-console) called `abac-project-role`: ++ On **Step 1: Select trusted entity**: Choose **AWS account** and then choose **This account**\. ++ On **Step 2: Add permissions**: Attach the four IAM policies that you created in the previous steps\. ++ On **Step 3: Name, review, and create**: Choose **Add tag**\. For **Key**, enter `project`\. Don't enter a **Value**\. + +## Step 6: Create the IAM user + +[Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console) called `abac-test-user`\. In the **Set permissions** section, choose **Attach existing policies directly** and then choose **Create policy**\. Enter the following policy definition\. Replace *111122223333* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingYourAccountIdentifiers)\. This policy allows `abac-test-user` to assume `abac-project-role`\. + +**Example – Allow IAM user to assume ABAC role** + +``` +{ + "Version": "2012-10-17", + "Statement": { + "Effect": "Allow", + "Action": "sts:AssumeRole", + "Resource": "arn:aws:iam::111122223333:role/abac-project-role" + } +} +``` + +## Step 7: Test the permissions + +1. Sign in to the AWS console as `abac-test-user`\. For more information, see [Sign in as an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html#user-sign-in-page)\. + +1. Switch to the `abac-project-role` role\. For more information, see [Switching to a role \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. + +1. [Create a Lambda function](configuration-tags.md#using-tags-with-the-console): + + Under **Permissions**, choose **Change default execution role**, and then for **Execution role**, choose **Use an existing role**\. Choose the same execution role that you used in [Step 4: Grant IAM permissions](#abac-iam-permissions)\. + + Under **Advanced settings**, choose **Enable tags** and then choose **Add new tag**\. For **Key**, enter `project`\. Don't enter a **Value**\. + +1. [Test the function](testing-functions.md)\. + +1. Create a second Lambda function and add a different tag, such as `environment`\. This operation should fail because the ABAC policy that you created in [Step 1: Require tags on new functions](#require-tag-on-create) only allows the principal to create functions with the `project` tag\. + +1. Create a third function without tags\. This operation should fail because the ABAC policy that you created in [Step 1: Require tags on new functions](#require-tag-on-create) doesn't allow the principal to create functions without tags\. + +This authorization strategy allows you to control access without creating new policies for each new user\. To grant access to new users, simply give them permission to assume the role that corresponds to their assigned project\. \ No newline at end of file diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md index 4aae31ac..af5366f1 100644 --- a/doc_source/best-practices.md +++ b/doc_source/best-practices.md @@ -37,6 +37,7 @@ For more information about best practices for Lambda applications, see [Applicat + **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](lambda-runtime-environment.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. + **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. + **Do not use non\-documented, non\-public APIs** in your Lambda function code\. For AWS Lambda managed runtimes, Lambda periodically applies security and functional updates to Lambda's internal APIs\. These internal API updates may be backwards\-incompatible, leading to unintended consequences such as invocation failures if your function has a dependency on these non\-public APIs\. See [the API reference](API_Operations.md) for a list of publicly available APIs\. ++ **Write idempotent code\.** Writing idempotent code for your functions ensures that duplicate events are handled the same way\. Your code should properly validate events and gracefully handle duplicate events\. For more information, see [How do I make my Lambda function idempotent?](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-idempotent/)\. ## Function configuration + **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: @@ -51,7 +52,7 @@ For more information about best practices for Lambda applications, see [Applicat To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. + **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. -+ **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [AWS Lambda permissions](lambda-permissions.md)\. ++ **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [Lambda permissions](lambda-permissions.md)\. + **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. + **Delete Lambda functions that you are no longer using\.** By doing so, the unused functions won't needlessly count against your deployment package size limit\. + **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected invocation time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. @@ -61,6 +62,7 @@ For more information about best practices for Lambda applications, see [Applicat ## Metrics and alarms + **Use [Working with Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. + **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) ++ **Use [AWS Cost Anomaly Detection](https://docs.aws.amazon.com/cost-management/latest/userguide/manage-ad.html)** to detect unusual activity on your account\. Cost Anomaly Detection uses machine learning to continuously monitor your cost and usage while minimizing false positive alerts\. Cost Anomaly Detection uses data from AWS Cost Explorer, which has a delay of up to 24 hours\. As a result, it can take up to 24 hours to detect an anomaly after usage occurs\. To get started with Cost Anomaly Detection, you must first [ sign up for Cost Explorer](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html)\. Then, [access Cost Anomaly Detection](https://docs.aws.amazon.com/cost-management/latest/userguide/settingup-ad.html#access-ad)\. ## Working with streams + **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. diff --git a/doc_source/codewhisperer-overview.md b/doc_source/codewhisperer-overview.md new file mode 100644 index 00000000..e10f0d2f --- /dev/null +++ b/doc_source/codewhisperer-overview.md @@ -0,0 +1,79 @@ +# Overview of Amazon CodeWhisperer for AWS Lambda + +This overview contains a list of Amazon CodeWhisperer user actions and common ways for you to utilize CodeWhisperer in the AWS Lambda code editor\. + +**Note** +In the Lambda console, CodeWhisperer only supports functions using the Python and Node\.js runtimes\. + +**Topics** ++ [User actions](#codewhisperer-actions) ++ [Use cases and examples](#codewhisperer-examples) + +## User actions + +When you're using the Lambda code editor, you can use the following keyboard shortcuts to perform various CodeWhisperer user actions\. + + +**CodeWhisperer user actions and keyboard shortcuts** + +| Action | Keyboard shortcut | +| --- | --- | +| Manually fetch a code suggestion | MacOS: `Option` \+ `C` Windows: `Alt` \+ `C` | +| Accept a suggestion | `Tab` | +| Reject a suggestion | `ESC`, `Backspace`, scroll in any direction, or keep typing and the recommendation automatically disappears\. | + +## Use cases and examples + +Here are some common ways for you to utilize Amazon CodeWhisperer while authoring Lambda functions\. + +### Single\-line code completion + +When you start typing out single lines of code, CodeWhisperer makes suggestions based on your current and previous inputs\. In the image below, a user has begun to define a variable for an Amazon S3 client\. Based on this, CodeWhisperer then suggests a way to complete this line of code\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-single-line-completion-s3-client.png) + +As another example, in the image below, a user has already written some code, and now wants to send a message to an Amazon SQS queue\. CodeWhisperer suggests a way to complete this final line of code\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-single-line-completion-sqs.png) + +### Full function generation + +CodeWhisperer can generate an entire function based on your function signature or code comments\. In the following image, a user has written a function signature for reading a file from Amazon S3\. Amazon CodeWhisperer then suggests a full implementation of the `read_from_s3` method\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-read-from-s3.png) + +**Note** +Sometimes, as in the previous example, CodeWhisperer includes `import` statements as part of its suggestions\. As a best practice, manually move these `import` statements to the top of your file\. + +As another example, in the following image, a user has written a function signature\. CodeWhisperer then suggests a full implementation of the `quicksort` method\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-quicksort.png) + +CodeWhisperer considers past code snippets when making suggestions\. In the following image, the user in the previous example has accepted the suggested implementation for `quicksort` above\. The user then writes another function signature for a generic `sort` method\. CodeWhisperer then suggests an implementation based on what has already been written\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-from-context-sort.png) + +In the following image, a user has written a comment\. Based on this comment, CodeWhisperer then suggests a function signature\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-comment-binary-search.png) + +In the following image, the user in the previous example has accepted the suggested function signature\. CodeWhisperer can then suggest a complete implementation of the `binary_search` function\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-binary-search.png) + +### Line\-by\-line recommendations + +Depending on your use case, CodeWhisperer may not be able to generate an entire function block in one recommendation\. However, CodeWhisperer can still provide line\-by\-line recommendations\. In the following image, the customer has written an initial comment indicating that they want to publish a message to an Amazon CloudWatch Logs group\. Given this context, CodeWhisperer is only able to suggest the client initialization code in its first recommendation, as shown in the following image\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-1.png) + +However, if the user continues to request line\-by\-line recommendations, CodeWhisperer also continues to suggest lines of code based on what's already been written\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-2.png) + +**Note** +In the example above, `VPCFlowLogs` may not be the correct constant value\. As CodeWhisperer makes suggestions, remember to rename any constants as required\. + +CodeWhisperer can eventually complete the entire code block as shown in the following image\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-3.png) \ No newline at end of file diff --git a/doc_source/codewhisperer-setup.md b/doc_source/codewhisperer-setup.md new file mode 100644 index 00000000..227a7c97 --- /dev/null +++ b/doc_source/codewhisperer-setup.md @@ -0,0 +1,39 @@ +# Setting up Amazon CodeWhisperer with Lambda + +This document describes how to request access to and activate Amazon CodeWhisperer for the Lambda console\. Once activated, CodeWhisperer can make code recommendations on\-demand in the Lambda code editor as you develop your function\. + +**Note** +In the Lambda console, CodeWhisperer only supports functions using the Python and Node\.js runtimes\. + +**Topics** ++ [Requesting CodeWhisperer access \(experimental feature\)](#codewhisperer-request-access) ++ [Activating Amazon CodeWhisperer \(experimental feature\)](#codewhisperer-activate) + +## Requesting CodeWhisperer access \(experimental feature\) + +To use Amazon CodeWhisperer in the Lambda console, you must first get allow listed\. Request allow listing by completing these steps\. + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console, and choose the function that you want to edit\. + +1. In the code editor under **Code source**, choose **Tools** in the top menu bar\. + +1. Choose **Request CodeWhisperer access**\. This opens up a link to a [request form](https://pages.awscloud.com/codewhisperer-sign-up-form.html) in a new tab\. + +1. Fill out the form\. For Lambda users, you must fill out the **AWS Account ID** field\. + +You will receive an email when the CodeWhisperer team approves your request\. + +## Activating Amazon CodeWhisperer \(experimental feature\) + +**Note** +You must be allow listed to use CodeWhisperer in the Lambda console\. If you aren't allow listed, see [Requesting CodeWhisperer access \(experimental feature\)](#codewhisperer-request-access)\. + +To activate CodeWhisperer in the Lambda console code editor, complete these steps\. + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console, and choose the function that you want to edit\. + +1. In the code editor under **Code source**, choose **Tools** in the top menu bar\. + +1. Choose **CodeWhisperer code suggestions**\. This immediately activates the CodeWhisperer service, and a check mark appears next to this option\. To deactivate, choose this option again\. + +The first time you activate CodeWhisperer, you'll see a pop\-up containing terms and conditions for using CodeWhisperer\. Read the terms and conditions and choose **Accept** to continue\. \ No newline at end of file diff --git a/doc_source/codewhisperer.md b/doc_source/codewhisperer.md new file mode 100644 index 00000000..1730dd47 --- /dev/null +++ b/doc_source/codewhisperer.md @@ -0,0 +1,7 @@ +# Working with Amazon CodeWhisperer in the Lambda console + +Amazon CodeWhisperer is a general purpose, machine learning\-powered code generator that provides you with code recommendations in realtime\. When activated in the Lambda console, CodeWhisperer automatically generates suggestions based on your existing code and comments\. Your personalized recommendations can vary in size and scope, ranging from a single one\-liner to fully\-formed functions\. + +**Topics** ++ [Setting up Amazon CodeWhisperer with Lambda](codewhisperer-setup.md) ++ [Overview of Amazon CodeWhisperer for AWS Lambda](codewhisperer-overview.md) \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md index 44ce603d..4e2ef460 100644 --- a/doc_source/configuration-envvars.md +++ b/doc_source/configuration-envvars.md @@ -72,7 +72,7 @@ You should see the following output: { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Environment": { "Variables": { @@ -175,7 +175,7 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i **Reserved environment variables** + `_HANDLER` – The handler location configured on the function\. -+ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. ++ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. This environment variable is not defined for custom runtimes \(for example, runtimes that use the `provided` or `provided.al2` identifiers\)\. You can set `_X_AMZN_TRACE_ID` for custom runtimes using the `Lambda-Runtime-Trace-Id` response header from the [Next invocation](runtimes-api.md#runtimes-api-next)\. + `AWS_REGION` – The AWS Region where the Lambda function is executed\. + `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_` \(for example, `AWS_Lambda_java8`\)\. This environment variable is not defined for custom runtimes \(for example, runtimes that use the `provided` or `provided.al2` identifiers\)\. + `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. @@ -188,7 +188,6 @@ Lambda [runtimes](lambda-runtimes.md) set several environment variables during i + `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. + `LAMBDA_TASK_ROOT` – The path to your Lambda function code\. + `LAMBDA_RUNTIME_DIR` – The path to runtime libraries\. -+ `TZ` – The environment's time zone \(`UTC`\)\. The execution environment uses NTP to synchronize the system clock\. The following additional environment variables aren't reserved and can be extended in your function configuration\. @@ -202,6 +201,7 @@ The following additional environment variables aren't reserved and can be extend + `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. + `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. + `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. ++ `TZ` – The environment's time zone \(`UTC`\)\. The execution environment uses NTP to synchronize the system clock\. The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. @@ -304,5 +304,5 @@ For details on managing key permissions, see [Using key policies in AWS KMS](htt Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. **Sample applications** -+ [Blank function](samples-blank.md) – Create a function and an Amazon SNS topic in the same template\. Pass the name of the topic to the function in an environment variable\. Read environment variables in code \(multiple languages\)\. ++ [Blank function](samples-blank.md) – Create a basic function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests, and the AWS SDK\. + [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md index 93ea99d0..ab227774 100644 --- a/doc_source/configuration-filesystem.md +++ b/doc_source/configuration-filesystem.md @@ -32,7 +32,7 @@ Create a file system in Amazon EFS with a mount target in every Availability Zon **Note** When you create a file system, you choose a performance mode that can't be changed later\. **General purpose** mode has lower latency, and **Max I/O** mode supports a higher maximum throughput and IOPS\. For help choosing, see [Amazon EFS performance](https://docs.aws.amazon.com/efs/latest/ug/performance.html) in the *Amazon Elastic File System User Guide*\. -An access point connects each instance of the function to the right mount target for the Availability Zone it connects to\. For best performance, create an access point with a non\-root path, and limit the number of files that you create in each directory\. User and owner IDs are required, but they don't need to have a specific value\. The following example creates a directory named `my-function` on the file system and sets the owner ID to 1001 with standard directory permissions \(755\)\. +An access point connects each instance of the function to the right mount target for the Availability Zone it connects to\. For best performance, create an access point with a non\-root path, and limit the number of files that you create in each directory\. The following example creates a directory named `my-function` on the file system and sets the owner ID to 1001 with standard directory permissions \(755\)\. **Example access point configuration** + **Name** – `files` diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md index da40c4d1..15aa2993 100644 --- a/doc_source/configuration-function-common.md +++ b/doc_source/configuration-function-common.md @@ -12,6 +12,7 @@ For function configuration best practices, see [Function configuration](best-pra + [Configuring functions \(console\)](#configuration-common-summary) + [Configuring functions \(API\)](#configuration-function-api) + [Configuring function memory \(console\)](#configuration-memory-console) ++ [Configuring function timeout \(console\)](#configuration-timeout-console) + [Configuring ephemeral storage \(console\)](#configuration-ephemeral-storage) + [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) + [Configuring triggers \(console\)](#configuration-common-triggers) @@ -32,14 +33,14 @@ The **Function overview** shows a visualization of your function and its upstrea ## Configuring functions \(console\) For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **Configuration** tab provides the following sections: -+ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function timeout and the execution role\. ++ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function [timeout](#configuration-timeout-console) and the execution role\. + **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. + **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. + **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. Tags apply to the entire function, including all versions and aliases\. + **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. -+ **Monitoring and operations tools** – configure CloudWatch and other monitoring tools\. ++ **Monitoring and operations tools** – configure CloudWatch and other [monitoring tools](lambda-monitoring.md)\. + **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. + **Function URL** – Configure a [function URL](lambda-urls.md) to add a unique HTTP\(S\) endpoint to your Lambda function\. You can configure a function URL on the `$LATEST` unpublished function version, or on any function alias\. @@ -95,9 +96,27 @@ You can configure the memory of your function in the Lambda console\. 1. Choose **Save**\. +## Configuring function timeout \(console\) + +Lambda runs your code for a set amount of time before timing out\. *Timeout* is the maximum amount of time in seconds that a Lambda function can run\. The default value for this setting is 3 seconds, but you can adjust this in increments of 1 second up to a maximum value of 15 minutes\. + +You can configure the timeout of your function in the Lambda console\. + +**To change the timeout of a function** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. + +1. For **Timeout**, set a value from 1 second to 15 minutes\. + +1. Choose **Save**\. + ## Configuring ephemeral storage \(console\) - By default, Lambda allocates 512 MB for a function’s /tmp directory\. You can increase or decrease this amount using the **Ephemeral storage \(MB\)** setting\. To configure the size of a function’s /tmp directory, set a whole number value between 512 MB and 10,240 MB\. + By default, Lambda allocates 512 MB for a function’s /tmp directory\. You can increase or decrease this amount using the **Ephemeral storage \(MB\)** setting\. To configure the size of a function’s /tmp directory, set a whole number value between 512 MB and 10,240 MB, in 1\-MB increments\. **Note** Configuring ephemeral storage past the default 512 MB allocated incurs a cost\. For more information, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. @@ -157,34 +176,6 @@ For details about how services trigger Lambda functions, see [Using AWS Lambda w ## Testing functions \(console\) -You can create test events for your function from the **Test** tab\. - -**To create a test event** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -Saved test events are also available from the **Code** tab, under the **Test** menu\. After you create one or more test events, you can invoke your function using one of your tests as an event\. - -**To test the function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **Saved events** and select the event you want to use\. - -1. Choose **Test**\. - -1. Expand the **Execution result** panel to display details about the test\. +You can create test events for your function from the **Test** tab\. For more information, see [Testing Lambda functions in the console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html)\. You can also invoke your function without saving your test event by choosing **Test** before saving\. This creates an unsaved test event that Lambda will preserve for the duration of the session\. You can access your unsaved test events from either the **Test** or **Code** tab\. \ No newline at end of file diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md index ce20435d..6b8c8a2f 100644 --- a/doc_source/configuration-function-zip.md +++ b/doc_source/configuration-function-zip.md @@ -88,7 +88,7 @@ The console creates a Lambda function with a single source file\. For scripting **Note** The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. ## Updating function code diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md index ce8669c5..ce26aa28 100644 --- a/doc_source/configuration-layers.md +++ b/doc_source/configuration-layers.md @@ -8,6 +8,9 @@ You can use layers only with Lambda functions [deployed as a \.zip file archive] You can create layers using the Lambda console, the Lambda API, AWS CloudFormation, or the AWS Serverless Application Model \(AWS SAM\)\. For more information about creating layers with AWS SAM, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. +**Note** +For Node\.js runtimes, Lambda doesn't currently support ES module dependencies in layers\. + **Topics** + [Creating layer content](#configuration-layers-upload) + [Compiling the \.zip file archive for your layer](#configuration-layers-compile) @@ -70,7 +73,7 @@ pillow.zip ``` json.zip -└ ruby/gems/2.5.0/ +└ ruby/gems/2.7.0/ | build_info | cache | doc diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md index 7e67cbb3..bcaa564d 100644 --- a/doc_source/configuration-tags.md +++ b/doc_source/configuration-tags.md @@ -1,17 +1,26 @@ -# Using tags on AWS Lambda functions +# Using tags on Lambda functions -You can tag Lambda functions to organize them by owner, project, or department\. Tags are freeform key\-value pairs that are supported across AWS services for use in filtering resources, and adding detail to billing reports\. +You can tag AWS Lambda functions to activate [attribute\-based access control \(ABAC\)](attribute-based-access-control.md) and to organize them by owner, project, or department\. Tags are free\-form key\-value pairs that are supported across AWS services for use in ABAC, filtering resources, and [adding detail to billing reports\.](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) + +Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that Lambda creates a snapshot of when you publish a version\. **Topics** ++ [Permissions required for working with tags](#permissions-required-for-working-with-tags-cli) + [Using tags with the Lambda console](#using-tags-with-the-console) -+ [Using tags with the AWS Command Line Interface](#configuration-tags-cli) ++ [Using tags with the AWS CLI](#configuration-tags-cli) + [Requirements for tags](#configuration-tags-restrictions) -## Using tags with the Lambda console +## Permissions required for working with tags + +Grant appropriate permissions to the AWS Identity and Access Management \(IAM\) identity \(user, group, or role\) for the person working with the function: ++ **lambda:ListTags **– When a function has tags, grant this permission to anyone who needs to call `GetFunction` or `ListTags` on it\. ++ **lambda:TagResource** – Grant this permission to anyone who needs to call `CreateFunction` or `TagResource`\. + +For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. -You can use the console to create functions that have tags, add tags to existing functions, and filter functions by the tags that you add\. +## Using tags with the Lambda console -### Adding tags to a function +You can use the Lambda console to create functions that have tags, add tags to existing functions, and filter functions by tags that you add\. **To add tags when you create a function** @@ -27,89 +36,57 @@ You can use the console to create functions that have tags, add tags to existing 1. For **Runtime**, choose the language version to use for your function\. - 1. \(Optional\) For **Architecture**, choose the instruction set architecture to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. + 1. \(Optional\) For **Architecture**, choose the [instruction set architecture](foundation-arch.md) to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with the instruction set architecture that you choose\. -1. Expand **Advanced settings** and then select **Enable tags**\. +1. Expand **Advanced settings**, and then select **Enable tags**\. -1. Enter a **Key** and an optional **Value**\. To add more tags, choose **Add new tag**, then repeat this step\. +1. Choose **Add new tag**, and then enter a **Key** and an optional **Value**\. To add more tags, repeat this step\. 1. Choose **Create function**\. **To add tags to an existing function** -1. Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: - + **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to view the function\. - + **lambda:TagResource**—Grant this permission to anyone who needs to add tags to a function\. - - For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. - 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. -1. Choose **Configuration** and then choose **Tags**\. +1. Choose **Configuration**, and then choose **Tags**\. 1. Under **Tags**, choose **Manage tags**\. -1. Enter a key and value\. To add additional tags, choose **Add new tag**\. - - Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. +1. Choose **Add new tag**, and then enter a **Key** and an optional **Value**\. To add more tags, repeat this step\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-add.png) 1. Choose **Save**\. -### Filtering functions by tag - -You can filter functions based on the presence or value of a tag with the Lambda console or with the AWS Resource Groups API\. - -Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that is snapshotted when you publish a version\. - **To filter functions with tags** -1. Make sure that you have the permissions you need: - + lambda:ListTags grants permission to view functions that have tags\. - + lambda:TagResource grants permission to add tags to a function\. - 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Click within the search bar to see a list of function attributes and tag keys\. +1. Choose the search bar to see a list of function attributes and tag keys\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) -1. Choose a tag key to see a list of values that are in\-use in the current region\. +1. Choose a tag key to see a list of values that are in use in the current AWS Region\. 1. Choose a value to see functions with that value, or choose **\(all values\)** to see all functions that have a tag with that key\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-value.png) -The search bar also supports searching for tag keys\. Type `tag` to see just a list of tag keys, or start typing the name of a key to find it in the list\. - -With AWS Billing and Cost Management, you can use tags to customize billing reports and create cost\-allocation reports\. For more information, see [Monthly Cost Allocation Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/configurecostallocreport.html) and [Using Cost Allocation Tags](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) in the *AWS Billing and Cost Management User Guide*\. - -## Using tags with the AWS Command Line Interface - -You can use the AWS CLI to create functions that have tags, add tags to existing functions, and to filter functions by the tags that you add\. - -### Permissions required for working with tags - -Grant appropriate permissions to the IAM identity \(user, group, or role\) for the person working with the function: -+ **lambda:ListTags**—When a function has tags, grant this permission to anyone who needs to call `GetFunction` or `ListTags` on it\. -+ **lambda:TagResource**—Grant this permission to anyone who needs to call `CreateFunction` or `TagResource`\. - -For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. +The search bar also supports searching for tag keys\. Enter `tag` to see only a list of tag keys, or enter the name of a key to find it in the list\. -### Creating tags when you create a function +## Using tags with the AWS CLI -Make sure that any tags you use conform to the [tag requirements](#configuration-tags-restrictions)\. +### Adding and removing tags -When you create a new Lambda function, you can include tags with the `--tags` option\. +To create a new Lambda function with tags, use the create\-function command with the \-\-tags option\. ``` aws lambda create-function --function-name my-function ---handler index.js --runtime nodejs12.x \ +--handler index.js --runtime nodejs16.x \ --role arn:aws:iam::123456789012:role/lambda-role \ --tags Department=Marketing,CostCenter=1234ABCD ``` -To add tags to an existing function, use the `tag-resource` command\. +To add tags to an existing function, use the tag\-resource command\. ``` aws lambda tag-resource \ @@ -117,22 +94,22 @@ aws lambda tag-resource \ --tags Department=Marketing,CostCenter=1234ABCD ``` -To remove tags, use the `untag-resource` command\. +To remove tags, use the untag\-resource command\. ``` -aws lambda untag-resource --resource function arn \ +aws lambda untag-resource --resource arn:aws:lambda:us-east-1:123456789012:function:my-function \ --tag-keys Department ``` ### Viewing tags on a function -If you want to view the tags that are applied to a specific Lambda function, you can use either of the following Lambda API commands: -+ [ListTags](API_ListTags.md) – You supply your Lambda function ARN \(Amazon Resource Name\) to view a list of the tags associated with this function: +If you want to view the tags that are applied to a specific Lambda function, you can use either of the following AWS CLI commands: ++ [ListTags](API_ListTags.md) – To view a list of the tags associated with this function, include your Lambda function ARN \(Amazon Resource Name\): ``` - aws lambda list-tags --resource function arn + aws lambda list-tags --resource arn:aws:lambda:us-east-1:123456789012:function:my-function ``` -+ [GetFunction](API_GetFunction.md) – You supply your Lambda function name to view a list of the tags associated with this function: ++ [GetFunction](API_GetFunction.md) – To view a list of the tags associated with this function, include your Lambda function name: ``` aws lambda get-function --function-name my-function @@ -140,16 +117,16 @@ If you want to view the tags that are applied to a specific Lambda function, you #### Filtering functions by tag -You can use the AWS Resource Groups Tagging API [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) action to filter your resources by tags\. The GetResources API receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide GetResources with a ‘ResourceType’ to filter by specific resource types\. +You can use the AWS Resource Groups Tagging API [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API operation to filter your resources by tags\. The `GetResources` operation receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide `GetResources` with a `ResourceType` to filter by specific resource types\. -For more information about the AWS Resource Groups service, see [What are resource groups?](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) in the *AWS Resource Groups and Tags User Guide*\. +For more information about AWS Resource Groups, see [What are resource groups?](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) in the *AWS Resource Groups and Tags User Guide*\. ## Requirements for tags The following requirements apply to tags: -+ Maximum number of tags per resource—50 -+ Maximum key length—128 Unicode characters in UTF\-8 -+ Maximum value length—256 Unicode characters in UTF\-8 ++ Maximum number of tags per resource: 50 ++ Maximum key length: 128 Unicode characters in UTF\-8 ++ Maximum value length: 256 Unicode characters in UTF\-8 + Tag keys and values are case sensitive\. + Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If your tagging schema will be used across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file ++ If you plan to use your tagging schema across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md index da0fcc7c..fd15b395 100644 --- a/doc_source/configuration-versions.md +++ b/doc_source/configuration-versions.md @@ -54,7 +54,7 @@ You should see the following output: "Version": "1", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "function.handler", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", ... } ``` diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md index 9d42b340..e91acbcc 100644 --- a/doc_source/configuration-vpc.md +++ b/doc_source/configuration-vpc.md @@ -26,7 +26,7 @@ Multiple functions can share a network interface, if the functions share the sam If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. -If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects function invocations to the previous VPC\. After the update is complete, new invocations start using the the new VPC and the Lambda function is no longer connected to the older VPC\. +If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects function invocations to the previous VPC\. After the update is complete, new invocations start using the new VPC and the Lambda function is no longer connected to the older VPC\. For short\-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself\. To ensure connection reuse for short\-lived/infrequently invoked functions, we recommend that you use *TCP keep\-alive* for connections that were created during your function initialization, to avoid creating new connections for subsequent invokes\. For more information on reusing connections using keep\-alive, refer to [Lambda documentation on reusing connections](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)[\.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) @@ -36,14 +36,11 @@ Lambda uses your function's permissions to create and manage network interfaces\ **Execution role permissions** + **ec2:CreateNetworkInterface** -+ **ec2:DescribeNetworkInterfaces** -+ **ec2:DeleteNetworkInterface** ++ **ec2:DescribeNetworkInterfaces** – This action only works if it's allowed on all resources \(`"Resource": "*"`\)\. ++ **ec2:DeleteNetworkInterface** – If you don't specify a resource ID for **DeleteNetworkInterface** in the execution role, your function may not be able to access the VPC\. Either specify a unique resource ID, or include all resource IDs, for example, `"Resource": "arn:aws:ec2:us-west-2:123456789012:*/*"`\. These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. Note that these permissions are required only to create ENIs, not to invoke your VPC function\. In other words, you are still able to invoke your VPC function successfully even if you remove these permissions from your execution role\. To completely disassociate your Lambda function from the VPC, update the function's VPC configuration settings using the console or the [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) API\. -**Note** -If you don't specify a resource ID for **DeleteNetworkInterface** in the execution role, your function may not be able to access the VPC\. Either specify a unique resource ID, or include all resource IDs, for example, `"Resource": "arn:aws:ec2:us-west-2:123456789012:*/*"`\. - When you configure VPC connectivity, Lambda uses your permissions to verify network resources\. To configure a function to connect to a VPC, your AWS Identity and Access Management \(IAM\) user needs the following permissions: **User permissions** @@ -99,7 +96,7 @@ To create a function and connect it to a VPC using the AWS Command Line Interfac ``` aws lambda create-function --function-name my-function \ ---runtime nodejs12.x --handler index.js --zip-file fileb://function.zip \ +--runtime nodejs16.x --handler index.js --zip-file fileb://function.zip \ --role arn:aws:iam::123456789012:role/lambda-role \ --vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb ``` diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md index dc25eefe..3e3c8975 100644 --- a/doc_source/csharp-exceptions.md +++ b/doc_source/csharp-exceptions.md @@ -184,7 +184,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md index 7da8e942..5fc7d93b 100644 --- a/doc_source/csharp-image.md +++ b/doc_source/csharp-image.md @@ -34,11 +34,11 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base images for \.NET: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 6 | \.NET 6\.0 | Amazon Linux 2 | [Dockerfile for \.NET 6\.0 on GitHub](https://github.com/aws/aws-lambda-dotnet/tree/master/LambdaRuntimeDockerfiles/Images/net6) | -| 5\.0 | \.NET 5\.0 | Amazon Linux 2 | [Dockerfile for \.NET 5\.0 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | -| core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET Core 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | Mar 31, 2023 | +| 6 | \.NET 6 | Amazon Linux 2 | [Dockerfile for \.NET 6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet6/Dockerfile.dotnet6) | | +| 5\.0 | \.NET 5 | Amazon Linux 2 | [Dockerfile for \.NET 5 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | Amazon ECR repository: [gallery\.ecr\.aws/lambda/dotnet](https://gallery.ecr.aws/lambda/dotnet) diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md index a7e07e07..99e4ff1a 100644 --- a/doc_source/csharp-logging.md +++ b/doc_source/csharp-logging.md @@ -170,7 +170,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md index c6e20d97..b1a833ad 100644 --- a/doc_source/csharp-tracing.md +++ b/doc_source/csharp-tracing.md @@ -2,37 +2,49 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +To toggle active tracing on your Lambda function with the console, follow these steps: -**To enable active tracing** +**To turn on active tracing** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Configuration** and then choose **Monitoring tools**\. +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. 1. Choose **Edit**\. -1. Under **X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, toggle on **Active tracing**\. 1. Choose **Save**\. **Pricing** You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. **Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** @@ -69,14 +81,18 @@ To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in y } ``` -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for \.NET](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet.html) in the AWS X\-Ray Developer Guide\. @@ -98,7 +114,7 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. ## Enabling active tracing with AWS CloudFormation diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md index a8fcdf26..632f8355 100644 --- a/doc_source/deploying-lambda-apps.md +++ b/doc_source/deploying-lambda-apps.md @@ -6,7 +6,7 @@ The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverle [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](lambda-settingup.md#lambda-settingup-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. -The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates and testing locally\. +The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates, testing locally, and integrating with CI/CD systems\. When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [ What are connections?](https://docs.aws.amazon.com/connect/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. diff --git a/doc_source/dotnet-native-aot.md b/doc_source/dotnet-native-aot.md new file mode 100644 index 00000000..51af0ee6 --- /dev/null +++ b/doc_source/dotnet-native-aot.md @@ -0,0 +1,108 @@ +# \.NET functions with native AOT compilation + +\.NET 7 supports native ahead\-of\-time \(AOT\) compilation\. With *native AOT*, you can compile your Lambda function code to a native runtime format, which removes the need to compile \.NET code at runtime\. Native AOT compilation can reduce the cold start time for Lambda functions that you write in \.NET\. + +**Topics** ++ [Limitations](#dotnet-native-aot-limitations) ++ [Prerequisites](#dotnet-native-aot-prerequisites) ++ [Lambda runtime](#dotnet-native-aot-runtime) ++ [Set up your project](#dotnet-native-aot-runtime-setup) ++ [Edit your Lambda function code](#dotnet-native-aot-runtime-edit) ++ [Deploy your Lambda function](#dotnet-native-aot-deploy) ++ [Add support for complex types](#dotnet-native-aot-complex-types) ++ [Troubleshooting](#dotnet-native-aot-troubleshooting) + +## Limitations + +There are limitations to functionality that you can include in native AOT functions\. For more information, see [Limitations of Native AOT deployment](https://learn.microsoft.com/dotnet/core/deploying/native-aot/#limitations-of-native-aot-deployment) on the Microsoft Learn website\. + +## Prerequisites + +**Docker** +You must compile your function with native AOT on the same operating system that your code will run on\. As a result, on any operating system other than Amazon Linux 2, you need Docker to develop Lambda functions that use native AOT\. + +**\.NET 7 SDK** +Native AOT compilation is a feature of \.NET 7\. You must install the [\.NET 7 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) on your system, not only the runtime\. + +**Amazon\.Lambda\.Tools** +To create your Lambda functions, use the [https://www.nuget.org/packages/Amazon.Lambda.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) [\.NET Core global tool](https://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/)\. The current version of the \.NET Core global tool for Lambda supports using Docker for native AOT\. To install Amazon\.Lambda\.Tools, run the following command: + +``` +dotnet tool install -g Amazon.Lambda.Tools +``` +For more information about the Amazon\.Lambda\.Tools \.NET Core global tool, see the [AWS Extensions for \.NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) repository on GitHub\. + +**Amazon\.Lambda\.Templates** +To generate your Lambda function code, use the [https://www.nuget.org/packages/Amazon.Lambda.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) NuGet package\. To install this template package, run the following command: + +``` +dotnet new install Amazon.Lambda.Templates +``` + +## Lambda runtime + +Use the `provided.al2` custom runtime with the `x86_64` architecture to deploy a Lambda function that you build with native AOT compilation\. When you use a \.NET Lambda runtime, your application is compiled into Intermediate Language \(IL\) code\. At runtime, the just\-in\-time \(JIT\) compiler takes the IL code and compiles it into machine code as needed\. With a Lambda function that is compiled ahead of time with native AOT, the runtime environment doesn't include the \.NET SDK or \.NET runtime\. You compile your code into machine code before it runs\. + +## Set up your project + +Use the \.NET Core global tool for Lambda to create your new environment\. To initialize your project, run the following command: + +``` +dotnet new lambda.NativeAOT +``` + +## Edit your Lambda function code + +The \.NET Core global tool for Lambda generates a basic Lambda function that accepts a `String` and returns a `String`\. Edit the function code as required for your use case\. For how to change the parameters and return types of your function, see [Add support for complex types](#dotnet-native-aot-complex-types)\. + +## Deploy your Lambda function + +If you're using Windows or macOS, make sure that Docker is running\. + +Then, to compile and deploy your Lambda function, run the following command: + +``` +dotnet lambda deploy-function +``` + +The `deploy-function` process automatically downloads a Docker image of Amazon Linux 2 to perform the native AOT compilation for your function\. After this container image has downloaded, the deploy process builds your function and then creates a `.zip` file that gets deployed into your AWS account\. + +## Add support for complex types + +The default Lambda function provides a basic starting point of a `String` parameter and a `String` return type\. To accept or return complex types, update your code to include functionality that generates serialization code at compile time, rather than at runtime\. + +Add more JsonSerializable attributes to your custom serializer object definition as needed\. + +### API Gateway example + +For example, to use Amazon API Gateway events, add a reference to the NuGet package `Amazon.Lambda.ApiGatewayEvents`\. Then, add the following `using` statement to your Lambda function source code: + +``` +using Amazon.Lambda.APIGatewayEvents; +``` + +Add the following attributes to your class definition of your custom serializer: + +``` +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyRequest))] +[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyResponse))] +``` + +Update your function signature to the following: + +``` +public static async Task FunctionHandler(APIGatewayHttpApiV2ProxyRequest input, ILambdaContext context) +``` + +## Troubleshooting + +**Error: Cross\-OS native compilation is not supported\.** +Your version of the Amazon\.Lambda\.Tools \.NET Core global tool is out of date\. Update to the latest version and try again\. + +**Docker: image operating system "linux" cannot be used on this platform\.** +Docker on your system is configured to use Windows containers\. Swap to Linux containers to run the native AOT build environment\. + +**Unhandled Exception: System\.ApplicationException: The serializer NativeAoT\.MyCustomJsonSerializerContext is missing a constructor that takes in JsonSerializerOptions object** +If you encounter this error when you invoke your Lambda function, add an `rd.xml` file to your project, and then redeploy\. + +For more information about common errors, see the [AWS NativeAOT for \.NET](https://github.com/awslabs/dotnet-nativeaot-labs#common-errors) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/example_cross_ApiGatewayDataTracker_section.md b/doc_source/example_cross_ApiGatewayDataTracker_section.md new file mode 100644 index 00000000..eb7d2363 --- /dev/null +++ b/doc_source/example_cross_ApiGatewayDataTracker_section.md @@ -0,0 +1,28 @@ +# Create an API Gateway REST API to track COVID\-19 data + +The following code example shows how to create a REST API that simulates a system to track daily cases of COVID\-19 in the United States, using fictional data\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + Shows how to use AWS Chalice with the AWS SDK for Python \(Boto3\) to create a serverless REST API that uses Amazon API Gateway, AWS Lambda, and Amazon DynamoDB\. The REST API simulates a system that tracks daily cases of COVID\-19 in the United States, using fictional data\. Learn how to: ++ Use AWS Chalice to define routes in Lambda functions that are called to handle REST requests that come through API Gateway\. ++ Use Lambda functions to retrieve and store data in a DynamoDB table to serve REST requests\. ++ Define table structure and security role resources in an AWS CloudFormation template\. ++ Use AWS Chalice and CloudFormation to package and deploy all necessary resources\. ++ Use CloudFormation to clean up all created resources\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/apigateway_covid-19_tracker)\. + +**Services used in this example** ++ API Gateway ++ AWS CloudFormation ++ DynamoDB ++ Lambda + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_ApiGatewayWebsocketChat_section.md b/doc_source/example_cross_ApiGatewayWebsocketChat_section.md new file mode 100644 index 00000000..5c295d93 --- /dev/null +++ b/doc_source/example_cross_ApiGatewayWebsocketChat_section.md @@ -0,0 +1,25 @@ +# Create a websocket chat application with API Gateway + +The following code example shows how to create a chat application that is served by a websocket API built on Amazon API Gateway\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + Shows how to use the AWS SDK for Python \(Boto3\) with Amazon API Gateway V2 to create a websocket API that integrates with AWS Lambda and Amazon DynamoDB\. ++ Create a websocket API served by API Gateway\. ++ Define a Lambda handler that stores connections in DynamoDB and posts messages to other chat participants\. ++ Connect to the websocket chat application and send messages with the Websockets package\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/apigateway_websocket_chat)\. + +**Services used in this example** ++ API Gateway ++ DynamoDB ++ Lambda + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_AuroraRestLendingLibrary_section.md b/doc_source/example_cross_AuroraRestLendingLibrary_section.md new file mode 100644 index 00000000..7af05bbd --- /dev/null +++ b/doc_source/example_cross_AuroraRestLendingLibrary_section.md @@ -0,0 +1,28 @@ +# Create a lending library REST API + +The following code example shows how to create a lending library where patrons can borrow and return books by using a REST API backed by an Amazon Aurora database\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + Shows how to use the AWS SDK for Python \(Boto3\) with the Amazon Relational Database Service \(Amazon RDS\) API and AWS Chalice to create a REST API backed by an Amazon Aurora database\. The web service is fully serverless and represents a simple lending library where patrons can borrow and return books\. Learn how to: ++ Create and manage a serverless Aurora database cluster\. ++ Use AWS Secrets Manager to manage database credentials\. ++ Implement a data storage layer that uses Amazon RDS to move data into and out of the database\. ++ Use AWS Chalice to deploy a serverless REST API to Amazon API Gateway and AWS Lambda\. ++ Use the Requests package to send requests to the web service\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/aurora_rest_lending_library)\. + +**Services used in this example** ++ API Gateway ++ Lambda ++ Amazon RDS ++ Secrets Manager + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaAPIGateway_section.md b/doc_source/example_cross_LambdaAPIGateway_section.md new file mode 100644 index 00000000..0b7d1574 --- /dev/null +++ b/doc_source/example_cross_LambdaAPIGateway_section.md @@ -0,0 +1,54 @@ +# Use API Gateway to invoke a Lambda function + +The following code examples show how to create an AWS Lambda function invoked by Amazon API Gateway\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + Shows how to create an AWS Lambda function by using the Lambda Java runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create a Lambda function invoked by Amazon API Gateway that scans an Amazon DynamoDB table for work anniversaries and uses Amazon Simple Notification Service \(Amazon SNS\) to send a text message to your employees that congratulates them at their one year anniversary date\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_lambda_apigateway)\. + +**Services used in this example** ++ API Gateway ++ DynamoDB ++ Lambda ++ Amazon SNS + +------ +#### [ JavaScript ] + +**SDK for JavaScript V3** + Shows how to create an AWS Lambda function by using the Lambda JavaScript runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create a Lambda function invoked by Amazon API Gateway that scans an Amazon DynamoDB table for work anniversaries and uses Amazon Simple Notification Service \(Amazon SNS\) to send a text message to your employees that congratulates them at their one year anniversary date\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-api-gateway)\. +This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/api-gateway-invoking-lambda-example.html)\. + +**Services used in this example** ++ API Gateway ++ DynamoDB ++ Lambda ++ Amazon SNS + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + This example shows how to create and use an Amazon API Gateway REST API that targets an AWS Lambda function\. The Lambda handler demonstrates how to route based on HTTP methods; how to get data from the query string, header, and body; and how to return a JSON response\. ++ Deploy a Lambda function\. ++ Create an API Gateway REST API\. ++ Create a REST resource that targets the Lambda function\. ++ Grant permission to let API Gateway invoke the Lambda function\. ++ Use the Requests package to send requests to the REST API\. ++ Clean up all resources created during the demo\. + This example is best viewed on GitHub\. For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#readme)\. + +**Services used in this example** ++ API Gateway ++ Lambda + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaForBrowser_section.md b/doc_source/example_cross_LambdaForBrowser_section.md new file mode 100644 index 00000000..e7d76b0b --- /dev/null +++ b/doc_source/example_cross_LambdaForBrowser_section.md @@ -0,0 +1,29 @@ +# Invoke a Lambda function from a browser + +The following code example shows how to invoke an AWS Lambda function from a browser\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ JavaScript ] + +**SDK for JavaScript V2** + You can create a browser\-based application that uses an AWS Lambda function to update an Amazon DynamoDB table with user selections\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascript/example_code/lambda/lambda-for-browser)\. + +**Services used in this example** ++ DynamoDB ++ Lambda + +**SDK for JavaScript V3** + You can create a browser\-based application that uses an AWS Lambda function to update an Amazon DynamoDB table with user selections\. This app uses AWS SDK for JavaScript v3\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-for-browser)\. + +**Services used in this example** ++ DynamoDB ++ Lambda + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaScheduledEvents_section.md b/doc_source/example_cross_LambdaScheduledEvents_section.md new file mode 100644 index 00000000..6f3a62f6 --- /dev/null +++ b/doc_source/example_cross_LambdaScheduledEvents_section.md @@ -0,0 +1,54 @@ +# Use scheduled events to invoke a Lambda function + +The following code examples show how to create an AWS Lambda function invoked by an Amazon EventBridge scheduled event\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + Shows how to create an Amazon EventBridge scheduled event that invokes an AWS Lambda function\. Configure EventBridge to use a cron expression to schedule when the Lambda function is invoked\. In this example, you create a Lambda function by using the Lambda Java runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create an app that sends a mobile text message to your employees that congratulates them at the one year anniversary date\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_scheduled_events)\. + +**Services used in this example** ++ DynamoDB ++ EventBridge ++ Lambda ++ Amazon SNS + +------ +#### [ JavaScript ] + +**SDK for JavaScript V3** + Shows how to create an Amazon EventBridge scheduled event that invokes an AWS Lambda function\. Configure EventBridge to use a cron expression to schedule when the Lambda function is invoked\. In this example, you create a Lambda function by using the Lambda JavaScript runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create an app that sends a mobile text message to your employees that congratulates them at the one year anniversary date\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-scheduled-events)\. +This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/scheduled-events-invoking-lambda-example.html)\. + +**Services used in this example** ++ DynamoDB ++ EventBridge ++ Lambda ++ Amazon SNS + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + This example shows how to register an AWS Lambda function as the target of a scheduled Amazon EventBridge event\. The Lambda handler writes a friendly message and the full event data to Amazon CloudWatch Logs for later retrieval\. ++ Deploys a Lambda function\. ++ Creates an EventBridge scheduled event and makes the Lambda function the target\. ++ Grants permission to let EventBridge invoke the Lambda function\. ++ Prints the latest data from CloudWatch Logs to show the result of the scheduled invocations\. ++ Cleans up all resources created during the demo\. + This example is best viewed on GitHub\. For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#readme)\. + +**Services used in this example** ++ CloudWatch Logs ++ EventBridge ++ Lambda + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_ServerlessWorkflows_section.md b/doc_source/example_cross_ServerlessWorkflows_section.md new file mode 100644 index 00000000..12100c9e --- /dev/null +++ b/doc_source/example_cross_ServerlessWorkflows_section.md @@ -0,0 +1,38 @@ +# Use Step Functions to invoke Lambda functions + +The following code examples show how to create an AWS Step Functions state machine that invokes AWS Lambda functions in sequence\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + Shows how to create an AWS serverless workflow by using AWS Step Functions and the AWS SDK for Java 2\.x\. Each workflow step is implemented using an AWS Lambda function\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_workflows_stepfunctions)\. + +**Services used in this example** ++ DynamoDB ++ Lambda ++ Amazon SES ++ Step Functions + +------ +#### [ JavaScript ] + +**SDK for JavaScript V3** + Shows how to create an AWS serverless workflow by using AWS Step Functions and the AWS SDK for JavaScript\. Each workflow step is implemented using an AWS Lambda function\. +Lambda is a compute service that enables you to run code without provisioning or managing servers\. Step Functions is a serverless orchestration service that lets you combine Lambda functions and other AWS services to build business\-critical applications\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-step-functions)\. +This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/serverless-step-functions-example.html)\. + +**Services used in this example** ++ DynamoDB ++ Lambda ++ Amazon SES ++ Step Functions + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_StepFunctionsMessenger_section.md b/doc_source/example_cross_StepFunctionsMessenger_section.md new file mode 100644 index 00000000..c70018cd --- /dev/null +++ b/doc_source/example_cross_StepFunctionsMessenger_section.md @@ -0,0 +1,27 @@ +# Create a messenger application with Step Functions + +The following code example shows how to create an AWS Step Functions messenger application that retrieves message records from a database table\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + Shows how to use the AWS SDK for Python \(Boto3\) with AWS Step Functions to create a messenger application that retrieves message records from an Amazon DynamoDB table and sends them with Amazon Simple Queue Service \(Amazon SQS\)\. The state machine integrates with an AWS Lambda function to scan the database for unsent messages\. ++ Create a state machine that retrieves and updates message records from an Amazon DynamoDB table\. ++ Update the state machine definition to also send messages to Amazon Simple Queue Service \(Amazon SQS\)\. ++ Start and stop state machine runs\. ++ Connect to Lambda, DynamoDB, and Amazon SQS from a state machine by using service integrations\. + For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/stepfunctions_messenger)\. + +**Services used in this example** ++ DynamoDB ++ Lambda ++ Amazon SQS ++ Step Functions + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_CreateFunction_section.md b/doc_source/example_lambda_CreateFunction_section.md new file mode 100644 index 00000000..da336143 --- /dev/null +++ b/doc_source/example_lambda_CreateFunction_section.md @@ -0,0 +1,148 @@ +# Create a Lambda function using an AWS SDK + +The following code examples show how to create a Lambda function\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. + + +``` + public static void createLambdaFunction(LambdaClient awsLambda, + String functionName, + String filePath, + String role, + String handler) { + + try { + LambdaWaiter waiter = awsLambda.waiter(); + InputStream is = new FileInputStream(filePath); + SdkBytes fileToUpload = SdkBytes.fromInputStream(is); + + FunctionCode code = FunctionCode.builder() + .zipFile(fileToUpload) + .build(); + + CreateFunctionRequest functionRequest = CreateFunctionRequest.builder() + .functionName(functionName) + .description("Created by the Lambda Java API") + .code(code) + .handler(handler) + .runtime(Runtime.JAVA8) + .role(role) + .build(); + + // Create a Lambda function using a waiter. + CreateFunctionResponse functionResponse = awsLambda.createFunction(functionRequest); + GetFunctionRequest getFunctionRequest = GetFunctionRequest.builder() + .functionName(functionName) + .build(); + WaiterResponse waiterResponse = waiter.waitUntilFunctionExists(getFunctionRequest); + waiterResponse.matched().response().ifPresent(System.out::println); + System.out.println("The function ARN is " + functionResponse.functionArn()); + + } catch(LambdaException | FileNotFoundException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } +``` ++ For API details, see [CreateFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) in *AWS SDK for Java 2\.x API Reference*\. + +------ +#### [ Kotlin ] + +**SDK for Kotlin** +This is prerelease documentation for a feature in preview release\. It is subject to change\. + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. + + +``` +suspend fun createNewFunction( + myFunctionName: String, + s3BucketName: String, + myS3Key: String, + myHandler: String, + myRole: String +): String? { + + val functionCode = FunctionCode { + s3Bucket = s3BucketName + s3Key = myS3Key + } + + val request = CreateFunctionRequest { + functionName = myFunctionName + code = functionCode + description = "Created by the Lambda Kotlin API" + handler = myHandler + role = myRole + runtime = Runtime.Java8 + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val functionResponse = awsLambda.createFunction(request) + awsLambda.waitUntilFunctionActive { + functionName = myFunctionName + } + return functionResponse.functionArn + } +} +``` ++ For API details, see [CreateFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def create_function(self, function_name, handler_name, iam_role, deployment_package): + """ + Deploys a Lambda function. + + :param function_name: The name of the Lambda function. + :param handler_name: The fully qualified name of the handler function. This + must include the file name and the function name. + :param iam_role: The IAM role to use for the function. + :param deployment_package: The deployment package that contains the function + code in .zip format. + :return: The Amazon Resource Name (ARN) of the newly created function. + """ + try: + response = self.lambda_client.create_function( + FunctionName=function_name, + Description="AWS Lambda doc example", + Runtime='python3.8', + Role=iam_role.arn, + Handler=handler_name, + Code={'ZipFile': deployment_package}, + Publish=True) + function_arn = response['FunctionArn'] + waiter = self.lambda_client.get_waiter('function_active_v2') + waiter.wait(FunctionName=function_name) + logger.info("Created function '%s' with ARN: '%s'.", + function_name, response['FunctionArn']) + except ClientError: + logger.error("Couldn't create function %s.", function_name) + raise + else: + return function_arn +``` ++ For API details, see [CreateFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_DeleteFunction_section.md b/doc_source/example_lambda_DeleteFunction_section.md new file mode 100644 index 00000000..ef7d69c9 --- /dev/null +++ b/doc_source/example_lambda_DeleteFunction_section.md @@ -0,0 +1,85 @@ +# Delete a Lambda function using an AWS SDK + +The following code examples show how to delete a Lambda function\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. + + +``` + public static void deleteLambdaFunction(LambdaClient awsLambda, String functionName) { + try { + DeleteFunctionRequest request = DeleteFunctionRequest.builder() + .functionName(functionName) + .build(); + + awsLambda.deleteFunction(request); + System.out.println("The "+functionName +" function was deleted"); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } +``` ++ For API details, see [DeleteFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) in *AWS SDK for Java 2\.x API Reference*\. + +------ +#### [ Kotlin ] + +**SDK for Kotlin** +This is prerelease documentation for a feature in preview release\. It is subject to change\. + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. + + +``` +suspend fun delLambdaFunction(myFunctionName: String) { + + val request = DeleteFunctionRequest { + functionName = myFunctionName + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + awsLambda.deleteFunction(request) + println("$myFunctionName was deleted") + } +} +``` ++ For API details, see [DeleteFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def delete_function(self, function_name): + """ + Deletes a Lambda function. + + :param function_name: The name of the function to delete. + """ + try: + self.lambda_client.delete_function(FunctionName=function_name) + except ClientError: + logger.exception("Couldn't delete function %s.", function_name) + raise +``` ++ For API details, see [DeleteFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_GetFunction_section.md b/doc_source/example_lambda_GetFunction_section.md new file mode 100644 index 00000000..e2b119bc --- /dev/null +++ b/doc_source/example_lambda_GetFunction_section.md @@ -0,0 +1,45 @@ +# Get a Lambda function using an AWS SDK + +The following code example shows how to get a Lambda function\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def get_function(self, function_name): + """ + Gets data about a Lambda function. + + :param function_name: The name of the function. + :return: The function data. + """ + response = None + try: + response = self.lambda_client.get_function(FunctionName=function_name) + except ClientError as err: + if err.response['Error']['Code'] == 'ResourceNotFoundException': + logger.info("Function %s does not exist.", function_name) + else: + logger.error( + "Couldn't get function %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + return response +``` ++ For API details, see [GetFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_Invoke_section.md b/doc_source/example_lambda_Invoke_section.md new file mode 100644 index 00000000..065668c2 --- /dev/null +++ b/doc_source/example_lambda_Invoke_section.md @@ -0,0 +1,111 @@ +# Invoke a Lambda function using an AWS SDK + +The following code examples show how to invoke a Lambda function\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. + + +``` + public static void invokeFunction(LambdaClient awsLambda, String functionName) { + + InvokeResponse res = null ; + try { + // Need a SdkBytes instance for the payload. + JSONObject jsonObj = new JSONObject(); + jsonObj.put("inputValue", "2000"); + String json = jsonObj.toString(); + SdkBytes payload = SdkBytes.fromUtf8String(json) ; + + // Setup an InvokeRequest. + InvokeRequest request = InvokeRequest.builder() + .functionName(functionName) + .payload(payload) + .build(); + + res = awsLambda.invoke(request); + String value = res.payload().asUtf8String() ; + System.out.println(value); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } +``` ++ For API details, see [Invoke](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) in *AWS SDK for Java 2\.x API Reference*\. + +------ +#### [ Kotlin ] + +**SDK for Kotlin** +This is prerelease documentation for a feature in preview release\. It is subject to change\. + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. + + +``` +suspend fun invokeFunction(functionNameVal: String) { + + val json = """{"inputValue":"1000"}""" + val byteArray = json.trimIndent().encodeToByteArray() + val request = InvokeRequest { + functionName = functionNameVal + logType = LogType.Tail + payload = byteArray + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val res = awsLambda.invoke(request) + println("${res.payload?.toString(Charsets.UTF_8)}") + println("The log result is ${res.logResult}") + } +} +``` ++ For API details, see [Invoke](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def invoke_function(self, function_name, function_params, get_log=False): + """ + Invokes a Lambda function. + + :param function_name: The name of the function to invoke. + :param function_params: The parameters of the function as a dict. This dict + is serialized to JSON before it is sent to Lambda. + :param get_log: When true, the last 4 KB of the execution log are included in + the response. + :return: The response from the function invocation. + """ + try: + response = self.lambda_client.invoke( + FunctionName=function_name, + Payload=json.dumps(function_params), + LogType='Tail' if get_log else 'None') + logger.info("Invoked function %s.", function_name) + except ClientError: + logger.exception("Couldn't invoke function %s.", function_name) + raise + return response +``` ++ For API details, see [Invoke](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_ListFunctions_section.md b/doc_source/example_lambda_ListFunctions_section.md new file mode 100644 index 00000000..45636763 --- /dev/null +++ b/doc_source/example_lambda_ListFunctions_section.md @@ -0,0 +1,44 @@ +# List Lambda functions using an AWS SDK + +The following code example shows how to list Lambda functions\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def list_functions(self): + """ + Lists the Lambda functions for the current account. + """ + try: + func_paginator = self.lambda_client.get_paginator('list_functions') + for func_page in func_paginator.paginate(): + for func in func_page['Functions']: + print(func['FunctionName']) + desc = func.get('Description') + if desc: + print(f"\t{desc}") + print(f"\t{func['Runtime']}: {func['Handler']}") + except ClientError as err: + logger.error( + "Couldn't list functions. Here's why: %s: %s", + err.response['Error']['Code'], err.response['Error']['Message']) + raise +``` ++ For API details, see [ListFunctions](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md b/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md new file mode 100644 index 00000000..1d38bbf4 --- /dev/null +++ b/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md @@ -0,0 +1,899 @@ +# Get started creating and invoking Lambda functions using an AWS SDK + +The following code examples show how to: ++ Create an AWS Identity and Access Management \(IAM\) role that grants Lambda permission to write to logs\. ++ Create a Lambda function and upload handler code\. ++ Invoke the function with a single parameter and get results\. ++ Update the function code and configure its Lambda environment with an environment variable\. ++ Invoke the function with new parameters and get results\. Display the execution log that's returned from the invocation\. ++ List the functions for your account\. ++ Delete the IAM role and the Lambda function\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +For more information, see [Create a Lambda function with the console](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html)\. + +------ +#### [ Java ] + +**SDK for Java 2\.x** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. + + +``` +public class LambdaScenario { + + public static void main(String[] args) throws InterruptedException { + + final String usage = "\n" + + "Usage:\n" + + " \n\n" + + "Where:\n" + + " functionName - The name of the Lambda function. \n"+ + " filePath - The path to the .zip or .jar where the code is located. \n"+ + " role - The AWS Identity and Access Management (IAM) service role that has Lambda permissions. \n"+ + " handler - The fully qualified method name (for example, example.Handler::handleRequest). \n"+ + " bucketName - The Amazon Simple Storage Service (Amazon S3) bucket name that contains the .zip or .jar used to update the Lambda function's code. \n"+ + " key - The Amazon S3 key name that represents the .zip or .jar (for example, LambdaHello-1.0-SNAPSHOT.jar)." ; + + if (args.length != 6) { + System.out.println(usage); + System.exit(1); + } + + String functionName = args[0]; + String filePath = args[1]; + String role = args[2]; + String handler = args[3]; + String bucketName = args[4]; + String key = args[5]; + Region region = Region.US_WEST_2; + LambdaClient awsLambda = LambdaClient.builder() + .region(region) + .credentialsProvider(ProfileCredentialsProvider.create()) + .build(); + + String funArn = createLambdaFunction(awsLambda, functionName, filePath, role, handler); + System.out.println("The AWS Lambda ARN is "+funArn); + + // Get the Lambda function. + System.out.println("Getting the " +functionName +" AWS Lambda function."); + getFunction(awsLambda, functionName); + + // List the Lambda functions. + System.out.println("Listing all functions."); + LambdaScenario.listFunctions(awsLambda); + + System.out.println("*** Sleep for 1 min to get Lambda function ready."); + Thread.sleep(60000); + + System.out.println("*** Invoke the Lambda function."); + invokeFunction(awsLambda, functionName); + + System.out.println("*** Update the Lambda function code."); + LambdaScenario.updateFunctionCode(awsLambda, functionName, bucketName, key); + + System.out.println("*** Sleep for 1 min to get Lambda function ready."); + Thread.sleep(60000); + System.out.println("*** Invoke the Lambda function again with the updated code."); + invokeFunction(awsLambda, functionName); + + System.out.println("Update a Lambda function's configuration value."); + updateFunctionConfiguration(awsLambda, functionName, handler); + + System.out.println("Delete the AWS Lambda function."); + LambdaScenario.deleteLambdaFunction(awsLambda, functionName); + awsLambda.close(); + } + + public static String createLambdaFunction(LambdaClient awsLambda, + String functionName, + String filePath, + String role, + String handler) { + + try { + LambdaWaiter waiter = awsLambda.waiter(); + InputStream is = new FileInputStream(filePath); + SdkBytes fileToUpload = SdkBytes.fromInputStream(is); + + FunctionCode code = FunctionCode.builder() + .zipFile(fileToUpload) + .build(); + + CreateFunctionRequest functionRequest = CreateFunctionRequest.builder() + .functionName(functionName) + .description("Created by the Lambda Java API") + .code(code) + .handler(handler) + .runtime(Runtime.JAVA8) + .role(role) + .build(); + + // Create a Lambda function using a waiter + CreateFunctionResponse functionResponse = awsLambda.createFunction(functionRequest); + GetFunctionRequest getFunctionRequest = GetFunctionRequest.builder() + .functionName(functionName) + .build(); + WaiterResponse waiterResponse = waiter.waitUntilFunctionExists(getFunctionRequest); + waiterResponse.matched().response().ifPresent(System.out::println); + return functionResponse.functionArn(); + + } catch(LambdaException | FileNotFoundException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + return ""; + } + + public static void getFunction(LambdaClient awsLambda, String functionName) { + try { + GetFunctionRequest functionRequest = GetFunctionRequest.builder() + .functionName(functionName) + .build(); + + GetFunctionResponse response = awsLambda.getFunction(functionRequest); + System.out.println("The runtime of this Lambda function is " +response.configuration().runtime()); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + public static void listFunctions(LambdaClient awsLambda) { + try { + ListFunctionsResponse functionResult = awsLambda.listFunctions(); + List list = functionResult.functions(); + for (FunctionConfiguration config: list) { + System.out.println("The function name is "+config.functionName()); + } + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + public static void invokeFunction(LambdaClient awsLambda, String functionName) { + + InvokeResponse res; + try { + // Need a SdkBytes instance for the payload. + JSONObject jsonObj = new JSONObject(); + jsonObj.put("inputValue", "2000"); + String json = jsonObj.toString(); + SdkBytes payload = SdkBytes.fromUtf8String(json) ; + + InvokeRequest request = InvokeRequest.builder() + .functionName(functionName) + .payload(payload) + .build(); + + res = awsLambda.invoke(request); + String value = res.payload().asUtf8String() ; + System.out.println(value); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + public static void updateFunctionCode(LambdaClient awsLambda, String functionName, String bucketName, String key) { + try { + LambdaWaiter waiter = awsLambda.waiter(); + UpdateFunctionCodeRequest functionCodeRequest = UpdateFunctionCodeRequest.builder() + .functionName(functionName) + .publish(true) + .s3Bucket(bucketName) + .s3Key(key) + .build(); + + UpdateFunctionCodeResponse response = awsLambda.updateFunctionCode(functionCodeRequest) ; + GetFunctionConfigurationRequest getFunctionConfigRequest = GetFunctionConfigurationRequest.builder() + .functionName(functionName) + .build(); + + WaiterResponse waiterResponse = waiter.waitUntilFunctionUpdated(getFunctionConfigRequest); + waiterResponse.matched().response().ifPresent(System.out::println); + System.out.println("The last modified value is " +response.lastModified()); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + public static void updateFunctionConfiguration(LambdaClient awsLambda, String functionName, String handler ){ + try { + UpdateFunctionConfigurationRequest configurationRequest = UpdateFunctionConfigurationRequest.builder() + .functionName(functionName) + .handler(handler) + .runtime(Runtime.JAVA11 ) + .build(); + + awsLambda.updateFunctionConfiguration(configurationRequest); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + public static void deleteLambdaFunction(LambdaClient awsLambda, String functionName ) { + try { + DeleteFunctionRequest request = DeleteFunctionRequest.builder() + .functionName(functionName) + .build(); + + awsLambda.deleteFunction(request); + System.out.println("The "+functionName +" function was deleted"); + + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + } +} +``` ++ For API details, see the following topics in *AWS SDK for Java 2\.x API Reference*\. + + [CreateFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) + + [DeleteFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) + + [GetFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) + + [Invoke](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) + + [ListFunctions](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) + + [UpdateFunctionCode](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) + + [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) + +------ +#### [ Kotlin ] + +**SDK for Kotlin** +This is prerelease documentation for a feature in preview release\. It is subject to change\. + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. + + +``` +suspend fun main(args: Array) { + + val usage = """ + Usage: + + + Where: + functionName - The name of the AWS Lambda function. + role - The AWS Identity and Access Management (IAM) service role that has AWS Lambda permissions. + handler - The fully qualified method name (for example, example.Handler::handleRequest). + bucketName - The Amazon Simple Storage Service (Amazon S3) bucket name that contains the ZIP or JAR used for the Lambda function's code. + updatedBucketName - The Amazon S3 bucket name that contains the .zip or .jar used to update the Lambda function's code. + key - The Amazon S3 key name that represents the .zip or .jar file (for example, LambdaHello-1.0-SNAPSHOT.jar). + """ + + if (args.size != 6) { + println(usage) + exitProcess(1) + } + + val functionName = args[0] + val role = args[1] + val handler = args[2] + val bucketName = args[3] + val updatedBucketName = args[4] + val key = args[5] + + println("Creating a Lambda function named $functionName.") + val funArn = createScFunction(functionName, bucketName, key, handler, role) + println("The AWS Lambda ARN is $funArn") + + // Get a specific Lambda function. + println("Getting the $functionName AWS Lambda function.") + getFunction(functionName) + + // List the Lambda functions. + println("Listing all AWS Lambda functions.") + listFunctionsSc() + + // Invoke the Lambda function. + println("*** Invoke the Lambda function.") + invokeFunctionSc(functionName) + + // Update the AWS Lambda function code. + println("*** Update the Lambda function code.") + updateFunctionCode(functionName, updatedBucketName, key) + + // println("*** Invoke the function again after updating the code.") + invokeFunctionSc(functionName) + + // Update the AWS Lambda function configuration. + println("Update the run time of the function.") + UpdateFunctionConfiguration(functionName, handler) + + // Delete the AWS Lambda function. + println("Delete the AWS Lambda function.") + delFunction(functionName) +} + +suspend fun createScFunction( + myFunctionName: String, + s3BucketName: String, + myS3Key: String, + myHandler: String, + myRole: String +): String { + + val functionCode = FunctionCode { + s3Bucket = s3BucketName + s3Key = myS3Key + } + + val request = CreateFunctionRequest { + functionName = myFunctionName + code = functionCode + description = "Created by the Lambda Kotlin API" + handler = myHandler + role = myRole + runtime = Runtime.Java8 + } + + // Create a Lambda function using a waiter + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val functionResponse = awsLambda.createFunction(request) + awsLambda.waitUntilFunctionActive { + functionName = myFunctionName + } + return functionResponse.functionArn.toString() + } +} + +suspend fun getFunction(functionNameVal: String) { + + val functionRequest = GetFunctionRequest { + functionName = functionNameVal + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val response = awsLambda.getFunction(functionRequest) + println("The runtime of this Lambda function is ${response.configuration?.runtime}") + } +} + +suspend fun listFunctionsSc() { + + val request = ListFunctionsRequest { + maxItems = 10 + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val response = awsLambda.listFunctions(request) + response.functions?.forEach { function -> + println("The function name is ${function.functionName}") + } + } +} + +suspend fun invokeFunctionSc(functionNameVal: String) { + + val json = """{"inputValue":"1000"}""" + val byteArray = json.trimIndent().encodeToByteArray() + val request = InvokeRequest { + functionName = functionNameVal + payload = byteArray + logType = LogType.Tail + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val res = awsLambda.invoke(request) + println("The function payload is ${res.payload?.toString(Charsets.UTF_8)}") + } +} + +suspend fun updateFunctionCode(functionNameVal: String?, bucketName: String?, key: String?) { + + val functionCodeRequest = UpdateFunctionCodeRequest { + functionName = functionNameVal + publish = true + s3Bucket = bucketName + s3Key = key + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + val response = awsLambda.updateFunctionCode(functionCodeRequest) + awsLambda.waitUntilFunctionUpdated { + functionName = functionNameVal + } + println("The last modified value is " + response.lastModified) + } +} + +suspend fun UpdateFunctionConfiguration(functionNameVal: String?, handlerVal: String?) { + + val configurationRequest = UpdateFunctionConfigurationRequest { + functionName = functionNameVal + handler = handlerVal + runtime = Runtime.Java11 + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + awsLambda.updateFunctionConfiguration(configurationRequest) + } +} + +suspend fun delFunction(myFunctionName: String) { + + val request = DeleteFunctionRequest { + functionName = myFunctionName + } + + LambdaClient { region = "us-west-2" }.use { awsLambda -> + awsLambda.deleteFunction(request) + println("$myFunctionName was deleted") + } +} +``` ++ For API details, see the following topics in *AWS SDK for Kotlin API reference*\. + + [CreateFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [DeleteFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [GetFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [Invoke](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [ListFunctions](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [UpdateFunctionCode](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + + [UpdateFunctionConfiguration](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. +Define a Lambda handler that increments a number\. + +``` +import logging + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + + +def lambda_handler(event, context): + """ + Accepts an action and a single number, performs the specified action on the number, + and returns the result. The only allowable action is 'increment'. + + :param event: The event dict that contains the parameters sent when the function + is invoked. + :param context: The context in which the function is called. + :return: The result of the action. + """ + result = None + action = event.get('action') + if action == 'increment': + result = event.get('number', 0) + 1 + logger.info('Calculated result of %s', result) + else: + logger.error("%s is not a valid action.", action) + + response = {'result': result} + return response +``` +Define a second Lambda handler that performs arithmetic operations\. + +``` +import logging +import os + + +logger = logging.getLogger() + +# Define a list of Python lambda functions that are called by this AWS Lambda function. +ACTIONS = { + 'plus': lambda x, y: x + y, + 'minus': lambda x, y: x - y, + 'times': lambda x, y: x * y, + 'divided-by': lambda x, y: x / y} + + +def lambda_handler(event, context): + """ + Accepts an action and two numbers, performs the specified action on the numbers, + and returns the result. + + :param event: The event dict that contains the parameters sent when the function + is invoked. + :param context: The context in which the function is called. + :return: The result of the specified action. + """ + # Set the log level based on a variable configured in the Lambda environment. + logger.setLevel(os.environ.get('LOG_LEVEL', logging.INFO)) + logger.debug('Event: %s', event) + + action = event.get('action') + func = ACTIONS.get(action) + x = event.get('x') + y = event.get('y') + result = None + try: + if func is not None and x is not None and y is not None: + result = func(x, y) + logger.info("%s %s %s is %s", x, action, y, result) + else: + logger.error("I can't calculate %s %s %s.", x, action, y) + except ZeroDivisionError: + logger.warning("I can't divide %s by 0!", x) + + response = {'result': result} + return response +``` +Create functions that wrap Lambda actions\. + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + @staticmethod + def create_deployment_package(source_file, destination_file): + """ + Creates a Lambda deployment package in .zip format in an in-memory buffer. This + buffer can be passed directly to Lambda when creating the function. + + :param source_file: The name of the file that contains the Lambda handler + function. + :param destination_file: The name to give the file when it's deployed to Lambda. + :return: The deployment package. + """ + buffer = io.BytesIO() + with zipfile.ZipFile(buffer, 'w') as zipped: + zipped.write(source_file, destination_file) + buffer.seek(0) + return buffer.read() + + def get_iam_role(self, iam_role_name): + """ + Get an AWS Identity and Access Management (IAM) role. + + :param iam_role_name: The name of the role to retrieve. + :return: The IAM role. + """ + role = None + try: + temp_role = self.iam_resource.Role(iam_role_name) + temp_role.load() + role = temp_role + logger.info("Got IAM role %s", role.name) + except ClientError as err: + if err.response['Error']['Code'] == 'NoSuchEntity': + logger.info("IAM role %s does not exist.", iam_role_name) + else: + logger.error( + "Couldn't get IAM role %s. Here's why: %s: %s", iam_role_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + return role + + def create_iam_role_for_lambda(self, iam_role_name): + """ + Creates an IAM role that grants the Lambda function basic permissions. If a + role with the specified name already exists, it is used for the demo. + + :param iam_role_name: The name of the role to create. + :return: The role and a value that indicates whether the role is newly created. + """ + role = self.get_iam_role(iam_role_name) + if role is not None: + return role, False + + lambda_assume_role_policy = { + 'Version': '2012-10-17', + 'Statement': [ + { + 'Effect': 'Allow', + 'Principal': { + 'Service': 'lambda.amazonaws.com' + }, + 'Action': 'sts:AssumeRole' + } + ] + } + policy_arn = 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole' + + try: + role = self.iam_resource.create_role( + RoleName=iam_role_name, + AssumeRolePolicyDocument=json.dumps(lambda_assume_role_policy)) + logger.info("Created role %s.", role.name) + role.attach_policy(PolicyArn=policy_arn) + logger.info("Attached basic execution policy to role %s.", role.name) + except ClientError as error: + if error.response['Error']['Code'] == 'EntityAlreadyExists': + role = self.iam_resource.Role(iam_role_name) + logger.warning("The role %s already exists. Using it.", iam_role_name) + else: + logger.exception( + "Couldn't create role %s or attach policy %s.", + iam_role_name, policy_arn) + raise + + return role, True + + def get_function(self, function_name): + """ + Gets data about a Lambda function. + + :param function_name: The name of the function. + :return: The function data. + """ + response = None + try: + response = self.lambda_client.get_function(FunctionName=function_name) + except ClientError as err: + if err.response['Error']['Code'] == 'ResourceNotFoundException': + logger.info("Function %s does not exist.", function_name) + else: + logger.error( + "Couldn't get function %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + return response + + def create_function(self, function_name, handler_name, iam_role, deployment_package): + """ + Deploys a Lambda function. + + :param function_name: The name of the Lambda function. + :param handler_name: The fully qualified name of the handler function. This + must include the file name and the function name. + :param iam_role: The IAM role to use for the function. + :param deployment_package: The deployment package that contains the function + code in .zip format. + :return: The Amazon Resource Name (ARN) of the newly created function. + """ + try: + response = self.lambda_client.create_function( + FunctionName=function_name, + Description="AWS Lambda doc example", + Runtime='python3.8', + Role=iam_role.arn, + Handler=handler_name, + Code={'ZipFile': deployment_package}, + Publish=True) + function_arn = response['FunctionArn'] + waiter = self.lambda_client.get_waiter('function_active_v2') + waiter.wait(FunctionName=function_name) + logger.info("Created function '%s' with ARN: '%s'.", + function_name, response['FunctionArn']) + except ClientError: + logger.error("Couldn't create function %s.", function_name) + raise + else: + return function_arn + + def delete_function(self, function_name): + """ + Deletes a Lambda function. + + :param function_name: The name of the function to delete. + """ + try: + self.lambda_client.delete_function(FunctionName=function_name) + except ClientError: + logger.exception("Couldn't delete function %s.", function_name) + raise + + def invoke_function(self, function_name, function_params, get_log=False): + """ + Invokes a Lambda function. + + :param function_name: The name of the function to invoke. + :param function_params: The parameters of the function as a dict. This dict + is serialized to JSON before it is sent to Lambda. + :param get_log: When true, the last 4 KB of the execution log are included in + the response. + :return: The response from the function invocation. + """ + try: + response = self.lambda_client.invoke( + FunctionName=function_name, + Payload=json.dumps(function_params), + LogType='Tail' if get_log else 'None') + logger.info("Invoked function %s.", function_name) + except ClientError: + logger.exception("Couldn't invoke function %s.", function_name) + raise + return response + + def update_function_code(self, function_name, deployment_package): + """ + Updates the code for a Lambda function by submitting a .zip archive that contains + the code for the function. + + :param function_name: The name of the function to update. + :param deployment_package: The function code to update, packaged as bytes in + .zip format. + :return: Data about the update, including the status. + """ + try: + response = self.lambda_client.update_function_code( + FunctionName=function_name, ZipFile=deployment_package) + except ClientError as err: + logger.error( + "Couldn't update function %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + else: + return response + + def update_function_configuration(self, function_name, env_vars): + """ + Updates the environment variables for a Lambda function. + + :param function_name: The name of the function to update. + :param env_vars: A dict of environment variables to update. + :return: Data about the update, including the status. + """ + try: + response = self.lambda_client.update_function_configuration( + FunctionName=function_name, Environment={'Variables': env_vars}) + except ClientError as err: + logger.error( + "Couldn't update function configuration %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + else: + return response + + def list_functions(self): + """ + Lists the Lambda functions for the current account. + """ + try: + func_paginator = self.lambda_client.get_paginator('list_functions') + for func_page in func_paginator.paginate(): + for func in func_page['Functions']: + print(func['FunctionName']) + desc = func.get('Description') + if desc: + print(f"\t{desc}") + print(f"\t{func['Runtime']}: {func['Handler']}") + except ClientError as err: + logger.error( + "Couldn't list functions. Here's why: %s: %s", + err.response['Error']['Code'], err.response['Error']['Message']) + raise +``` +Create a function that runs the scenario\. + +``` +class UpdateFunctionWaiter(CustomWaiter): + """A custom waiter that waits until a function is successfully updated.""" + def __init__(self, client): + super().__init__( + 'UpdateSuccess', 'GetFunction', + 'Configuration.LastUpdateStatus', + {'Successful': WaitState.SUCCESS, 'Failed': WaitState.FAILURE}, + client) + + def wait(self, function_name): + self._wait(FunctionName=function_name) + + +def run_scenario(lambda_client, iam_resource, basic_file, calculator_file, lambda_name): + """ + Runs the scenario. + + :param lambda_client: A Boto3 Lambda client. + :param iam_resource: A Boto3 IAM resource. + :param basic_file: The name of the file that contains the basic Lambda handler. + :param calculator_file: The name of the file that contains the calculator Lambda handler. + :param lambda_name: The name to give resources created for the scenario, such as the + IAM role and the Lambda function. + """ + logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') + + print('-'*88) + print("Welcome to the AWS Lambda getting started with functions demo.") + print('-'*88) + + wrapper = LambdaWrapper(lambda_client, iam_resource) + + print("Checking for IAM role for Lambda...") + iam_role, should_wait = wrapper.create_iam_role_for_lambda(lambda_name) + if should_wait: + logger.info("Giving AWS time to create resources...") + wait(10) + + print(f"Looking for function {lambda_name}...") + function = wrapper.get_function(lambda_name) + if function is None: + print("Zipping the Python script into a deployment package...") + deployment_package = wrapper.create_deployment_package(basic_file, f"{lambda_name}.py") + print(f"...and creating the {lambda_name} Lambda function.") + wrapper.create_function( + lambda_name, f'{lambda_name}.lambda_handler', iam_role, deployment_package) + else: + print(f"Function {lambda_name} already exists.") + print('-'*88) + + print(f"Let's invoke {lambda_name}. This function increments a number.") + action_params = { + 'action': 'increment', + 'number': q.ask("Give me a number to increment: ", q.is_int)} + print(f"Invoking {lambda_name}...") + response = wrapper.invoke_function(lambda_name, action_params) + print(f"Incrementing {action_params['number']} resulted in " + f"{json.load(response['Payload'])}") + print('-'*88) + + print(f"Let's update the function to an arithmetic calculator.") + q.ask("Press Enter when you're ready.") + print("Creating a new deployment package...") + deployment_package = wrapper.create_deployment_package(calculator_file, f"{lambda_name}.py") + print(f"...and updating the {lambda_name} Lambda function.") + update_waiter = UpdateFunctionWaiter(lambda_client) + wrapper.update_function_code(lambda_name, deployment_package) + update_waiter.wait(lambda_name) + print(f"This function uses an environment variable to control logging level.") + print(f"Let's set it to DEBUG to get the most logging.") + wrapper.update_function_configuration( + lambda_name, {'LOG_LEVEL': logging.getLevelName(logging.DEBUG)}) + + actions = ['plus', 'minus', 'times', 'divided-by'] + want_invoke = True + while want_invoke: + print(f"Let's invoke {lambda_name}. You can invoke these actions:") + for index, action in enumerate(actions): + print(f"{index + 1}: {action}") + action_params = {} + action_index = q.ask( + "Enter the number of the action you want to take: ", + q.is_int, q.in_range(1, len(actions))) + action_params['action'] = actions[action_index - 1] + print(f"You've chosen to invoke 'x {action_params['action']} y'.") + action_params['x'] = q.ask("Enter a value for x: ", q.is_int) + action_params['y'] = q.ask("Enter a value for y: ", q.is_int) + print(f"Invoking {lambda_name}...") + response = wrapper.invoke_function(lambda_name, action_params, True) + print(f"Calculating {action_params['x']} {action_params['action']} {action_params['y']} " + f"resulted in {json.load(response['Payload'])}") + q.ask("Press Enter to see the logs from the call.") + print(base64.b64decode(response['LogResult']).decode()) + want_invoke = q.ask("That was fun. Shall we do it again? (y/n) ", q.is_yesno) + print('-'*88) + + if q.ask("Do you want to list all of the functions in your account? (y/n) "): + wrapper.list_functions() + print('-'*88) + + if q.ask("Ready to delete the function and role? (y/n) ", q.is_yesno): + for policy in iam_role.attached_policies.all(): + policy.detach_role(RoleName=iam_role.name) + iam_role.delete() + print(f"Deleted role {lambda_name}.") + wrapper.delete_function(lambda_name) + print(f"Deleted function {lambda_name}.") + + print("\nThanks for watching!") + print('-'*88) + + +if __name__ == '__main__': + try: + run_scenario( + boto3.client('lambda'), boto3.resource('iam'), 'lambda_handler_basic.py', + 'lambda_handler_calculator.py', 'doc_example_lambda_calculator') + except Exception: + logging.exception("Something went wrong with the demo!") +``` ++ For API details, see the following topics in *AWS SDK for Python \(Boto3\) API Reference*\. + + [CreateFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) + + [DeleteFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) + + [GetFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) + + [Invoke](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) + + [ListFunctions](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) + + [UpdateFunctionCode](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) + + [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_UpdateFunctionCode_section.md b/doc_source/example_lambda_UpdateFunctionCode_section.md new file mode 100644 index 00000000..e1f89f93 --- /dev/null +++ b/doc_source/example_lambda_UpdateFunctionCode_section.md @@ -0,0 +1,46 @@ +# Update Lambda function code using an AWS SDK + +The following code example shows how to update Lambda function code\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def update_function_code(self, function_name, deployment_package): + """ + Updates the code for a Lambda function by submitting a .zip archive that contains + the code for the function. + + :param function_name: The name of the function to update. + :param deployment_package: The function code to update, packaged as bytes in + .zip format. + :return: Data about the update, including the status. + """ + try: + response = self.lambda_client.update_function_code( + FunctionName=function_name, ZipFile=deployment_package) + except ClientError as err: + logger.error( + "Couldn't update function %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + else: + return response +``` ++ For API details, see [UpdateFunctionCode](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_UpdateFunctionConfiguration_section.md b/doc_source/example_lambda_UpdateFunctionConfiguration_section.md new file mode 100644 index 00000000..71846e12 --- /dev/null +++ b/doc_source/example_lambda_UpdateFunctionConfiguration_section.md @@ -0,0 +1,44 @@ +# Update Lambda function configuration using an AWS SDK + +The following code example shows how to update Lambda function configuration\. + +**Note** +The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. + +------ +#### [ Python ] + +**SDK for Python \(Boto3\)** + To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. + + +``` +class LambdaWrapper: + def __init__(self, lambda_client, iam_resource): + self.lambda_client = lambda_client + self.iam_resource = iam_resource + + def update_function_configuration(self, function_name, env_vars): + """ + Updates the environment variables for a Lambda function. + + :param function_name: The name of the function to update. + :param env_vars: A dict of environment variables to update. + :return: Data about the update, including the status. + """ + try: + response = self.lambda_client.update_function_configuration( + FunctionName=function_name, Environment={'Variables': env_vars}) + except ClientError as err: + logger.error( + "Couldn't update function configuration %s. Here's why: %s: %s", function_name, + err.response['Error']['Code'], err.response['Error']['Message']) + raise + else: + return response +``` ++ For API details, see [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) in *AWS SDK for Python \(Boto3\) API Reference*\. + +------ + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/extensions-api-partners.md b/doc_source/extensions-api-partners.md index 4afc6572..aee8c7b7 100644 --- a/doc_source/extensions-api-partners.md +++ b/doc_source/extensions-api-partners.md @@ -1,20 +1,21 @@ # AWS Lambda extensions partners AWS Lambda has partnered with several third party entities to provide extensions to integrate with your Lambda functions\. The following list details third party extensions that are ready for you to use at any time\. -+ [AppDynamics](https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime) – Provides automatic instrumentation of Node\.js or Python Lambda functions, providing visibility and alerting on function performance\. -+ [Check Point CloudGuard](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard) – An extension\-based runtime solution that offers full lifecycle security for serverless applications\. -+ [Datadog](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/) – Provides comprehensive, real\-time visibility to your serverless applications through the use of metrics, traces, and logs\. -+ [Dynatrace](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/) – Provides visibility into traces and metrics, and leverages AI for automated error detection and root cause analysis across the entire application stack\. -+ [Epsagon](https://docs.epsagon.com/docs/aws-lambda-layer) – Listens to invocation events, stores traces, and sends them in parallel to Lambda function executions\. -+ [HashiCorp Vault](https://learn.hashicorp.com/tutorials/vault/aws-lambda) – Manages secrets and makes them available for developers to use within function code, without making functions Vault aware\. -+ [Honeycomb](https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/) – Observability tool for debugging your app stack\. -+ [Lumigo](https://docs.lumigo.io/docs/lambda-extensions) – Profiles Lambda function invocations and collects metrics for troubleshooting issues in serverless and microservice environments\. -+ [New Relic](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring) – Runs alongside Lambda functions, automatically collecting, enhancing, and transporting telemetry to New Relic's unified observability platform\. -+ [Sentry](https://docs.sentry.io/product/integrations/aws-lambda/) – Diagnose, fix, and optimize performance of Lambda functions\. -+ [Site24x7](https://www.site24x7.com/help/aws/lambda-execution-logs.html) – Achieve real\-time observability into your Lambda environments -+ [Splunk](https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension) – Collects high\-resolution, low\-latency metrics for efficient and effective monitoring of Lambda functions\. -+ [Sumo Logic](https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension) – Provides visibility into the health and performance of serverless applications\. -+ [Thundra](https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions) – Provides asynchronous telemetry reporting, such as traces, metrics, and logs\. ++ [https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime](https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime) – Provides automatic instrumentation of Node\.js or Python Lambda functions, providing visibility and alerting on function performance\. ++ [https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard) – An extension\-based runtime solution that offers full lifecycle security for serverless applications\. ++ [https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/) – Provides comprehensive, real\-time visibility to your serverless applications through the use of metrics, traces, and logs\. ++ [https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/) – Provides visibility into traces and metrics, and leverages AI for automated error detection and root cause analysis across the entire application stack\. ++ [https://docs.epsagon.com/docs/aws-lambda-layer](https://docs.epsagon.com/docs/aws-lambda-layer) – Listens to invocation events, stores traces, and sends them in parallel to Lambda function executions\. ++ [https://docs.fastly.com/signalsciences/install-guides/paas/aws-lambda/](https://docs.fastly.com/signalsciences/install-guides/paas/aws-lambda/)– Protects your Lambda functions from suspicious activity, such as injection\-style attacks, account takeover via credential stuffing, malicious bots, and API abuse\. ++ [https://learn.hashicorp.com/tutorials/vault/aws-lambda](https://learn.hashicorp.com/tutorials/vault/aws-lambda) – Manages secrets and makes them available for developers to use within function code, without making functions Vault aware\. ++ [https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/](https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/) – Observability tool for debugging your app stack\. ++ [https://docs.lumigo.io/docs/lambda-extensions](https://docs.lumigo.io/docs/lambda-extensions) – Profiles Lambda function invocations and collects metrics for troubleshooting issues in serverless and microservice environments\. ++ [https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring) – Runs alongside Lambda functions, automatically collecting, enhancing, and transporting telemetry to New Relic's unified observability platform\. ++ [https://docs.sentry.io/product/integrations/aws-lambda/](https://docs.sentry.io/product/integrations/aws-lambda/) – Diagnose, fix, and optimize performance of Lambda functions\. ++ [https://www.site24x7.com/help/aws/lambda-execution-logs.html](https://www.site24x7.com/help/aws/lambda-execution-logs.html) – Achieve real\-time observability into your Lambda environments ++ [https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension](https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension) – Collects high\-resolution, low\-latency metrics for efficient and effective monitoring of Lambda functions\. ++ [https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension](https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension) – Provides visibility into the health and performance of serverless applications\. ++ [https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions](https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions) – Provides asynchronous telemetry reporting, such as traces, metrics, and logs\. ## AWS managed extensions @@ -23,5 +24,6 @@ AWS provides its own managed extensions, including: + [Amazon CodeGuru Profiler](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) – Improves application performance and reduces cost by pinpointing an application's most expensive line of code and providing recommendations for improving code\. + [CloudWatch Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights.html) – Monitor, troubleshoot, and optimize the performance of your Lambda functions through automated dashboards\. + [AWS Distro for Open Telemetry](https://aws-otel.github.io/docs/getting-started/lambda) – Enables functions to send trace data to AWS monitoring services such as AWS X\-Ray, and to destinations that support OpenTelemetry such as Honeycomb and Lightstep\. ++ **AWS Parameters and Secrets** – Enables customers to securely retrieve parameters from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html) and secrets from [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_lambda.html)\. For additional extensions samples and demo projects, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions)\. \ No newline at end of file diff --git a/doc_source/extensions-configuration.md b/doc_source/extensions-configuration.md new file mode 100644 index 00000000..c6a225f3 --- /dev/null +++ b/doc_source/extensions-configuration.md @@ -0,0 +1,55 @@ +# Configuring Lambda extensions + +## Configuring extensions \(\.zip file archive\) + +You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. + +You add the extension to your function using the same method as you would for any layer\. For more information, see [Using layers with your Lambda function](invocation-layers.md)\. + +**Add an extension to your function \(console\)** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Choose the **Code** tab if it is not already selected\. + +1. Under **Layers**, choose **Edit**\. + +1. For **Choose a layer**, choose **Specify an ARN**\. + +1. For **Specify an ARN**, enter the Amazon Resource Name \(ARN\) of an extension layer\. + +1. Choose **Add**\. + +## Using extensions in container images + +You can add extensions to your [container image](images-create.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. + +You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. + +### Example: Adding an external extension + +An external extension runs in a separate process from the Lambda function\. Lambda starts a process for each extension in the `/opt/extensions/` directory\. Lambda uses the Extensions API to manage the extension lifecycle\. After the function has run to completion, Lambda sends a `Shutdown` event to each external extension\. + +**Example of adding an external extension to a Python base image** + +``` +FROM public.ecr.aws/lambda/python:3.8 + +# Copy and install the app +COPY /app /app +WORKDIR /app +RUN pip install -r requirements.txt + +# Add an extension from the local directory into /opt +ADD my-extension.zip /opt +CMD python ./my-function.py +``` + +## Next steps + +To learn more about extensions, we recommend the following resources: ++ For a basic working example, see [Building Extensions for AWS Lambda](http://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. ++ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. ++ To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md index 7c28f27b..601d4b76 100644 --- a/doc_source/foundation-arch.md +++ b/doc_source/foundation-arch.md @@ -1,7 +1,7 @@ # Lambda instruction set architectures The *instruction set architecture* of a Lambda function determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: -+ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. ++ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. The arm64 architecture is available in most AWS Regions\. + x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. **Topics** @@ -71,7 +71,7 @@ For more information about how to create a code environment for arm64 architectu You can configure the instruction set architecture for new Lambda functions using the Lambda console, AWS SDKs, AWS Command Line Interface \(AWS CLI\), or AWS CloudFormation\. You can deploy the function code to Lambda with either a \.zip archive file or a container image deployment package\. Lambda provides the following runtimes for the arm64 architecture\. These runtimes all use the Amazon Linux 2 operating system\. -+ Node\.js 12, Node\.js 14 ++ Node\.js 12, Node\.js 14, Node\.js 16 + Python 3\.8, Python 3\.9 + Java 8 \(AL2\), Java 11 + \.NET Core 3\.1 diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md index c05eade3..b3a46334 100644 --- a/doc_source/foundation-console.md +++ b/doc_source/foundation-console.md @@ -29,7 +29,7 @@ Create [layers](configuration-layers.md) to separate your \.zip archive function ## Edit code using the console editor -You can use the code editor in the AWS Lambda console to write, test, and view the execution results of your Lambda function code\. The code editor supports languages that do not require compiling, such as Node\.js and Python\. The code editor suppports only \.zip archive deployment packages, and the size of the deployment package must be less than 3 MB\. +You can use the code editor in the AWS Lambda console to write, test, and view the execution results of your Lambda function code\. The code editor supports languages that do not require compiling, such as Node\.js and Python\. The code editor supports only \.zip archive deployment packages, and the size of the deployment package must be less than 3 MB\. The code editor includes the *menu bar*, *windows*, and the *editor pane*\. diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md index be157636..1a72ab63 100644 --- a/doc_source/foundation-networking.md +++ b/doc_source/foundation-networking.md @@ -30,7 +30,7 @@ For more information about Amazon VPC networking definitions, see [ How Amazon V ## Connecting Lambda functions to your VPC -By default, Lambda runs your functions in a secure VPC\. Lambda owns this VPC, which isn't connected to your account's [default VPC](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. +A Lambda function always runs inside a VPC owned by the Lambda service\. By default, a Lambda function isn't connected to VPCs in your account\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. Lambda accesses resources in your VPC using a Hyperplane ENI\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC using VPC\-to\-VPC NAT \(V2N\)\. V2N provides connectivity from the Lambda VPC to your account VPC, but not in the other direction\. diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md index b4747281..8e38415b 100644 --- a/doc_source/functions-states.md +++ b/doc_source/functions-states.md @@ -43,7 +43,7 @@ The following is the result of `get-function-configuration` on a function underg { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "VpcConfig": { "SubnetIds": [ "subnet-071f712345678e7c8", diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md index 2491b2e6..70397360 100644 --- a/doc_source/gettingstarted-awscli.md +++ b/doc_source/gettingstarted-awscli.md @@ -22,7 +22,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service API operations\. To install the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the AWS Command Line Interface User Guide\. @@ -36,7 +39,7 @@ In the following example, you specify the trust policy inline\. Requirements for aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` -You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. +You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#delegation) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service \(AWS STS\) `AssumeRole` action\. **Example trust\-policy\.json** @@ -85,7 +88,7 @@ You should see the following output: } ``` -To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. +To add permissions to the role, use the attach\-policy\-to\-role command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole @@ -121,7 +124,7 @@ exports.handler = async function(event, context) { ``` aws lambda create-function --function-name my-function \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ + --zip-file fileb://function.zip --handler index.handler --runtime nodejs16.x \ --role arn:aws:iam::123456789012:role/lambda-ex ``` @@ -131,7 +134,7 @@ exports.handler = async function(event, context) { { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-ex", "Handler": "index.handler", "CodeSha256": "FpFMvUhayLkOoVBpNuNiIVML/tuGv2iJQ7t0yWVTU8c=", @@ -237,6 +240,20 @@ You should see the following output: } ``` +## Update the function + +After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. + +Use the [update\-function\-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-function-configuration.html) command to configure functions\. The following example sets the function memory to 256 MB\. + +**Example update\-function\-configuration command** + +``` +aws lambda update-function-configuration \ +--function-name my-function \ +--memory-size 256 +``` + ## List the Lambda functions in your account Run the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. @@ -253,7 +270,7 @@ You should see the following output: { "FunctionName": "cli", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-ex", "Handler": "index.handler", ... @@ -261,7 +278,7 @@ You should see the following output: { "FunctionName": "random-error", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:random-error", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "index.handler", ... @@ -293,7 +310,7 @@ You should see the following output: "Configuration": { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-ex", "CodeSha256": "FpFMvUhayLkOoVBpNuNiIVML/tuGv2iJQ7t0yWVTU8c=", "Version": "$LATEST", diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md index 0d12a4b1..656c777a 100644 --- a/doc_source/gettingstarted-concepts.md +++ b/doc_source/gettingstarted-concepts.md @@ -63,7 +63,7 @@ For more information about events from AWS services, see [Using AWS Lambda with An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. -For more information, see [AWS Lambda execution environment](lambda-runtime-environment.md)\. +For more information, see [Lambda execution environment](lambda-runtime-environment.md)\. ## Instruction set architecture @@ -107,7 +107,7 @@ Lambda *extensions* enable you to augment your functions\. For example, you can An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. -For more information, see [Using Lambda extensions](using-extensions.md)\. +For more information, see [Lambda extensions](lambda-extensions.md)\. ## Concurrency diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md index 29fcc73f..9518d0a7 100644 --- a/doc_source/gettingstarted-features.md +++ b/doc_source/gettingstarted-features.md @@ -77,9 +77,12 @@ Blueprints are provided for use under the [Amazon Software License](http://aws.a ## Testing and deployment tools -Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use a rich tools ecosystem for authoring, building, and deploying your Lambda functions using AWS and popular community tools like the Docker command line interface \(CLI\)\. +Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use AWS services and popular community tools like the Docker command line interface \(CLI\) to author, build, and deploy your Lambda functions\. To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. -To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. +The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates, testing locally, and integrating with CI/CD systems\. ++ [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) ++ [Testing and debugging serverless applications with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html) ++ [Deploying serverless applications using CI/CD systems with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) ## Application templates diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index 7afb727f..ad4ecedd 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -35,7 +35,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. Before you create the function, you must [create a container image and upload it to Amazon ECR](images-create.md)\. diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md index caf5bc95..fb7c64d0 100644 --- a/doc_source/gettingstarted-limits.md +++ b/doc_source/gettingstarted-limits.md @@ -27,17 +27,17 @@ The Lambda documentation, log messages, and console use the abbreviation MB \(ra | Resource | Quota | | --- | --- | -| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. | +| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. **Note:** Lambda allocates CPU power in proportion to the amount of memory configured\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. At 1,769 MB, a function has the equivalent of one vCPU\. | | Function timeout | 900 seconds \(15 minutes\) | | Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | | Function [resource\-based policy](access-control-resource-based.md) | 20 KB | | Function [layers](configuration-layers.md) | five layers | | Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | -| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB \(synchronous\) 256 KB \(asynchronous\) | +| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB each for request and response \(synchronous\) 256 KB \(asynchronous\) | | [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped\) This quota applies to all the files you upload, including layers and custom runtimes\. 3 MB \(console editor\) | | [Container image](images-create.md) code package size | 10 GB | | Test events \(console editor\) | 10 | -| `/tmp` directory storage | 512 MB to 10,240 MB, in 1\-MB increments\. | +| `/tmp` directory storage | Between 512 MB and 10,240 MB, in 1\-MB increments | | File descriptors | 1,024 | | Execution processes/threads | 1,024 | diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md index f2d19702..4cf6f175 100644 --- a/doc_source/gettingstarted-package.md +++ b/doc_source/gettingstarted-package.md @@ -18,6 +18,9 @@ You upload your container images to Amazon Elastic Container Registry \(Amazon E For more information about Lambda container images, see [Creating Lambda container images](images-create.md)\. +**Note** +Container images aren't supported for Lambda functions in the Middle East \(UAE\) Region\. + ## \.zip file archives A \.zip file archive includes your application code and its dependencies\. When you author functions using the Lambda console or a toolkit, Lambda automatically creates a \.zip file archive of your code\. @@ -107,7 +110,7 @@ For more information, see [sam build](https://docs.aws.amazon.com/serverless-app ### Deployment packages over 50 MB -If your deployment package is larger than 50 MB, we recommend uploading your function code and dependencies to an Amazon S3 bucket\. +If your deployment package is larger than 50 MB, upload your function code and dependencies to an Amazon S3 bucket\. You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS CLI\. diff --git a/doc_source/go-image.md b/doc_source/go-image.md index 2299c69a..d599bfbf 100644 --- a/doc_source/go-image.md +++ b/doc_source/go-image.md @@ -32,9 +32,9 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base image for Go: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 1 | Go 1\.x | Amazon Linux 2018\.03 | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| 1 | Go 1\.x | Amazon Linux | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | | Amazon ECR repository: [gallery\.ecr\.aws/lambda/go](https://gallery.ecr.aws/lambda/go) diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md index 1c8300a9..d3794b86 100644 --- a/doc_source/golang-exceptions.md +++ b/doc_source/golang-exceptions.md @@ -102,7 +102,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md index bf6475de..a797e03f 100644 --- a/doc_source/golang-handler.md +++ b/doc_source/golang-handler.md @@ -41,6 +41,12 @@ Note the following: By adding `lambda.Start(HandleRequest)` between `func main(){}` code brackets, your Lambda function will be executed\. Per Go language standards, the opening bracket, `{` must be placed directly at end the of the `main` function signature\. +## Naming + +When you configure a function in Go, the value of the handler setting is the executable file name\. For example, if you set the value of the handler to `Handler`, Lambda will call the `main()` function in the `Handler` executable file\. + +To change the function handler name in the Lambda console, on the **Runtime** settings pane, choose **edit**\. + ## Lambda function handler using structured types In the example above, the input type was a simple string\. But you can also pass in structured events to your function handler: diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md index c97c8d57..e25a956a 100644 --- a/doc_source/golang-logging.md +++ b/doc_source/golang-logging.md @@ -136,7 +136,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md index 08e32f12..5433a3d0 100644 --- a/doc_source/golang-package.md +++ b/doc_source/golang-package.md @@ -10,6 +10,7 @@ This page describes how to create a \.zip file as your deployment package for th + [Sample applications](#golang-package-sample) + [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) + [Creating a \.zip file on Windows](#golang-package-windows) ++ [Creating a Lambda function using a \.zip archive](#golang-package-create-function) + [Build Go with the provided\.al2 runtime](#golang-package-al2) ## Prerequisites @@ -51,7 +52,7 @@ The following steps demonstrate how to download the [lambda](https://github.com/ 1. Compile your executable\. ``` - GOOS=linux go build main.go + GOOS=linux GOARCH=amd64 go build -o main main.go ``` Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. @@ -59,13 +60,13 @@ The following steps demonstrate how to download the [lambda](https://github.com/ 1. \(Optional\) If your `main` package consists of multiple files, use the following [go build](https://golang.org/cmd/go/) command to compile the package: ``` - GOOS=linux go build main + GOOS=linux GOARCH=amd64 go build main ``` 1. \(Optional\) You may need to compile packages with `CGO_ENABLED=0` set on Linux: ``` - GOOS=linux CGO_ENABLED=0 go build main.go + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go ``` This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. @@ -75,20 +76,26 @@ The following steps demonstrate how to download the [lambda](https://github.com/ 1. Create a deployment package by packaging the executable in a \.zip file\. ``` - zip function.zip main + zip main.zip main ``` ## Creating a \.zip file on Windows -The following steps demonstrate how to download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip) tool for Windows from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. +The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) library from GitHub with `go get`, download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go install`, and compile your executable with [go build](https://golang.org/cmd/go/)\. **Note** If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. -1. Download the **build\-lambda\-zip** tool from GitHub: +1. Download the **lambda** library from GitHub\. ``` - go.exe get -u github.com/aws/aws-lambda-go/cmd/build-lambda-zip + go get github.com/aws/aws-lambda-go/lambda + ``` + +1. Download the **build\-lambda\-zip** tool from GitHub\. + + ``` + go.exe install github.com/aws/aws-lambda-go/cmd/build-lambda-zip@latest ``` 1. Use the tool from your `GOPATH` to create a \.zip file\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: @@ -100,8 +107,10 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ``` set GOOS=linux + set GOARCH=amd64 + set CGO_ENABLED=0 go build -o main main.go - %USERPROFILE%\Go\bin\build-lambda-zip.exe -output main.zip main + %USERPROFILE%\Go\bin\build-lambda-zip.exe -o main.zip main ``` ------ @@ -111,14 +120,84 @@ If you have not already done so, you must install [git](https://git-scm.com/) an ``` $env:GOOS = "linux" - $env:CGO_ENABLED = "0" $env:GOARCH = "amd64" + $env:CGO_ENABLED = "0" go build -o main main.go - ~\Go\Bin\build-lambda-zip.exe -output main.zip main + ~\Go\Bin\build-lambda-zip.exe -o main.zip main ``` ------ +## Creating a Lambda function using a \.zip archive + + In addition to the `main.zip` deployment package you have created, to create a Lambda function you also need an execution role\. The execution role grants the function permission to use AWS services such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. You can create an execution role for your function in the IAM console or using the AWS Command Line Interface \(AWS CLI\)\. + + The following steps demonstrate how to create the execution role using the AWS CLI and then create a Lambda function using your \.zip deployment package\. + +1. Create a trust policy giving the Lambda service permission to assume the execution role\. Copy the following JSON and create a file named `trust-policy.json` in the current directory\. + + ``` + { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + } + ``` + +1. Create the execution role\. + + ``` + aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json + ``` + + You should see the following output\. Make a note of your role's ARN\. You will need this to create your function\. + + ``` + { + "Role": { + "Path": "/", + "RoleName": "lambda-ex", + "RoleId": "AROAQFOXMPL6TZ6ITKWND", + "Arn": "arn:aws:iam::123456789012:role/lambda-ex", + "CreateDate": "2020-01-17T23:19:12Z", + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + }, + "Action": "sts:AssumeRole" + } + ] + } + } + } + ``` + +1. Add permissions to the role using the `attach-role-policy` command\. In the example below, you add the `AWSLambdaBasicExecutionRole` managed policy, which allows your Lambda function to upload logs to CloudWatch\. If your Lambda function interacts with other AWS services, such as Amazon S3 or DynamoDB, you will need to add policies allowing your Lambda function to access these services\. See [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features) for more information\. + + ``` + aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + ``` + +1. Create the function\. + + ``` + aws lambda create-function --function-name my-function --runtime go1.x --role arn:aws:iam::123456789012:role/lambda-ex --handler main --zip-file fileb://main.zip + ``` + +**Note** +When you create a Go Lambda function using the AWS CLI, the value of the handler setting you define is the executable file name\. For more information, see [AWS Lambda function handler in Go](golang-handler.md)\. + ## Build Go with the provided\.al2 runtime Go is implemented differently than other native runtimes\. Lambda treats Go as a custom runtime, so you can create a Go function on the provided\.al2 runtime\. You can use the AWS SAM build command to build the \.zip file package\. diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md index f0e476b1..04bd5548 100644 --- a/doc_source/golang-tracing.md +++ b/doc_source/golang-tracing.md @@ -1,74 +1,70 @@ # Instrumenting Go code in AWS Lambda -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. +Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +To send tracing data to X\-Ray, you can use one of two SDK libraries: ++ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. ++ [AWS X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) – An SDK for generating and sending trace data to X\-Ray\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) +Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +**Important** +**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. -**To enable active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, enable **Active tracing**\. - -1. Choose **Save**\. +**Topics** ++ [Using ADOT to instrument your Go functions](#golang-adot) ++ [Using the X\-Ray SDK to instrument your Go functions](#golang-xray-sdk) ++ [Activating tracing with the Lambda console](#golang-tracing-console) ++ [Activating tracing with the Lambda API](#golang-tracing-api) ++ [Activating tracing with AWS CloudFormation](#golang-tracing-cloudformation) ++ [Interpreting an X\-Ray trace](#golang-tracing-interpretation) -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. +## Using ADOT to instrument your Go functions -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +For Go runtimes, you can add the **AWS managed Lambda layer for ADOT Go** to automatically instrument your functions\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for Go](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go) in the ADOT documentation\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. +## Using the X\-Ray SDK to instrument your Go functions -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Go\. Download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: +To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Go\. To get the SDK, download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: ``` go get github.com/aws/aws-xray-sdk-go ``` -To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. +To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. You can then trace calls by using the `WithContext` version of the method\. ``` - xray.AWS(s3.Client) +svc := s3.New(session.New()) +xray.AWS(svc.Client) +... +svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) ``` -Then you can trace your calls by using the `WithContext` version of the method\. +After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. -``` - svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) -``` +## Activating tracing with the Lambda console -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +To toggle active tracing on your Lambda function with the console, follow these steps: -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +**To turn on active tracing** -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) in the AWS X\-Ray Developer Guide\. +1. Choose a function\. -**Topics** -+ [Enabling active tracing with the Lambda API](#golang-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#golang-tracing-cloudformation) +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. + +1. Choose **Edit**\. + +1. Under **X\-Ray**, toggle on **Active tracing**\. -## Enabling active tracing with the Lambda API +1. Choose **Save**\. -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +## Activating tracing with the Lambda API + +Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -80,9 +76,9 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. -## Enabling active tracing with AWS CloudFormation +## Activating tracing with AWS CloudFormation To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. @@ -109,4 +105,35 @@ Resources: Properties: Tracing: Active ... -``` \ No newline at end of file +``` + +## Interpreting an X\-Ray trace + +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. + +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the *AWS X\-Ray Developer Guide*\. + +**Pricing** +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md index 69aac407..4fe2b934 100644 --- a/doc_source/images-create.md +++ b/doc_source/images-create.md @@ -4,6 +4,9 @@ AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-ima For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. +**Note** +Container images aren't supported for Lambda functions in the Middle East \(UAE\) Region\. + **Topics** + [Base images for Lambda](runtimes-images.md) + [Testing Lambda container images locally](images-test.md) @@ -20,7 +23,7 @@ For example applications, including a Node\.js example and a Python example, see To deploy a container image to Lambda, you need the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [Docker CLI](https://docs.docker.com/get-docker)\. Additionally, note the following requirements: + The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. -+ The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with 512 MB of storage\. ++ The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with between 512 MB and 10,240 MB, in 1\-MB increments, of storage\. + The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. + Lambda supports only Linux\-based container images\. + Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. @@ -112,15 +115,15 @@ AWS periodically provides updates to the AWS base images for Lambda\. If your Do ``` FROM public.ecr.aws/lambda/python:3.8 - # Copy function code - COPY app.py ${LAMBDA_TASK_ROOT} - # Install the function's dependencies using file requirements.txt # from your project folder. COPY requirements.txt . RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "app.handler" ] ``` diff --git a/doc_source/index.md b/doc_source/index.md index f6781c95..67a9b736 100644 --- a/doc_source/index.md +++ b/doc_source/index.md @@ -4,13 +4,13 @@ *****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** ----- -Amazon's trademarks and trade dress may not be used in - connection with any product or service that is not Amazon's, - in any manner that is likely to cause confusion among customers, - or in any manner that disparages or discredits Amazon. All other - trademarks not owned by Amazon are the property of their respective - owners, who may or may not be affiliated with, connected to, or - sponsored by Amazon. +Amazon's trademarks and trade dress may not be used in +connection with any product or service that is not Amazon's, +in any manner that is likely to cause confusion among customers, +or in any manner that disparages or discredits Amazon. All other +trademarks not owned by Amazon are the property of their respective +owners, who may or may not be affiliated with, connected to, or +sponsored by Amazon. ----- ## Contents @@ -22,27 +22,34 @@ Amazon's trademarks and trade dress may not be used in + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) + + [Lambda execution environment](lambda-runtime-environment.md) + [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) + [Lambda console](foundation-console.md) + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) -+ [AWS Lambda permissions](lambda-permissions.md) - + [AWS Lambda execution role](lambda-intro-execution-role.md) - + [Using resource-based policies for AWS Lambda](access-control-resource-based.md) ++ [Lambda permissions](lambda-permissions.md) + + [Lambda execution role](lambda-intro-execution-role.md) + [Identity-based IAM policies for Lambda](access-control-identity-based.md) + + [Attribute-based access control for Lambda](attribute-based-access-control.md) + + [Using resource-based policies for Lambda](access-control-resource-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) + [Lambda runtimes](lambda-runtimes.md) + [Modifying the runtime environment](runtimes-modify.md) + [Custom AWS Lambda runtimes](runtimes-custom.md) + + [AWS Lambda runtime API](runtimes-api.md) + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) -+ [AWS Lambda execution environment](lambda-runtime-environment.md) - + [Lambda Extensions API](runtimes-extensions-api.md) - + [AWS Lambda runtime API](runtimes-api.md) - + [Lambda Logs API](runtimes-logs-api.md) ++ [Lambda extensions](lambda-extensions.md) + + [Configuring Lambda extensions](extensions-configuration.md) + [AWS Lambda extensions partners](extensions-api-partners.md) + + [Lambda Extensions API](runtimes-extensions-api.md) + + [Lambda Telemetry API](telemetry-api.md) + + [Lambda Telemetry API reference](telemetry-api-reference.md) + + [Lambda Telemetry API Event schema reference](telemetry-schema-reference.md) + + [Converting Lambda Telemetry API Event objects to OpenTelemetry Spans](telemetry-otel-spans.md) + + [Lambda Logs API](runtimes-logs-api.md) + [Deploying Lambda functions](lambda-deploy-functions.md) + [Deploying Lambda functions as .zip file archives](configuration-function-zip.md) + [Deploying Lambda functions as container images](gettingstarted-images.md) @@ -63,7 +70,7 @@ Amazon's trademarks and trade dress may not be used in + [Configuring database access for a Lambda function](configuration-database.md) + [Configuring file system access for Lambda functions](configuration-filesystem.md) + [Configuring code signing for AWS Lambda](configuration-codesigning.md) - + [Using tags on AWS Lambda functions](configuration-tags.md) + + [Using tags on Lambda functions](configuration-tags.md) + [Using layers with your Lambda function](invocation-layers.md) + [Invoking Lambda functions](lambda-invocation.md) + [Synchronous invocation](invocation-sync.md) @@ -73,7 +80,6 @@ Amazon's trademarks and trade dress may not be used in + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Testing Lambda functions in the console](testing-functions.md) - + [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) + [Lambda function URLs](lambda-urls.md) + [Creating and managing Lambda function URLs](urls-configuration.md) @@ -117,7 +123,7 @@ Amazon's trademarks and trade dress may not be used in + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) - + [Instrumenting Java code in Lambda](java-tracing.md) + + [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Java sample applications for AWS Lambda](java-samples.md) + [Building Lambda functions with Go](lambda-golang.md) @@ -139,6 +145,7 @@ Amazon's trademarks and trade dress may not be used in + [Lambda function logging in C#](csharp-logging.md) + [AWS Lambda function errors in C#](csharp-exceptions.md) + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) + + [.NET functions with native AOT compilation](dotnet-native-aot.md) + [Building Lambda functions with PowerShell](lambda-powershell.md) + [Setting Up a PowerShell Development Environment](powershell-devenv.md) + [Deploy PowerShell Lambda functions with .zip file archives](powershell-package.md) @@ -156,7 +163,6 @@ Amazon's trademarks and trade dress may not be used in + [AWS SAM template for an API Gateway application](services-apigateway-template.md) + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) + [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) - + [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) @@ -166,6 +172,9 @@ Amazon's trademarks and trade dress may not be used in + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) + + [Working with Amazon CodeWhisperer in the Lambda console](codewhisperer.md) + + [Setting up Amazon CodeWhisperer with Lambda](codewhisperer-setup.md) + + [Overview of Amazon CodeWhisperer for AWS Lambda](codewhisperer-overview.md) + [Using AWS Lambda with Amazon Cognito](services-cognito.md) + [Using AWS Lambda with AWS Config](services-config.md) + [Using Lambda with Amazon Connect](services-connect.md) @@ -174,7 +183,6 @@ Amazon's trademarks and trade dress may not be used in + [Sample function code](with-ddb-create-package.md) + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) + [Using AWS Lambda with Amazon EC2](services-ec2.md) - + [Tutorial: Using AWS SDK for .NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md) + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) + [Using AWS Lambda with an Application Load Balancer](services-alb.md) + [Using Amazon EFS with Lambda](services-efs.md) @@ -244,10 +252,31 @@ Amazon's trademarks and trade dress may not be used in + [Orchestration examples with Step Functions](services-stepfunctions.md) + [Best practices for working with AWS Lambda functions](best-practices.md) + [Lambda quotas](gettingstarted-limits.md) ++ [Using Lambda with an AWS SDK](sdk-general-information-section.md) + [Lambda sample applications](lambda-samples.md) + [Blank function sample application for AWS Lambda](samples-blank.md) + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) + [List manager sample application for AWS Lambda](samples-listmanager.md) ++ [Code examples for Lambda using AWS SDKs](service_code_examples.md) + + [Actions for Lambda using AWS SDKs](service_code_examples_actions.md) + + [Create a Lambda function using an AWS SDK](example_lambda_CreateFunction_section.md) + + [Delete a Lambda function using an AWS SDK](example_lambda_DeleteFunction_section.md) + + [Get a Lambda function using an AWS SDK](example_lambda_GetFunction_section.md) + + [Invoke a Lambda function using an AWS SDK](example_lambda_Invoke_section.md) + + [List Lambda functions using an AWS SDK](example_lambda_ListFunctions_section.md) + + [Update Lambda function code using an AWS SDK](example_lambda_UpdateFunctionCode_section.md) + + [Update Lambda function configuration using an AWS SDK](example_lambda_UpdateFunctionConfiguration_section.md) + + [Scenarios for Lambda using AWS SDKs](service_code_examples_scenarios.md) + + [Get started creating and invoking Lambda functions using an AWS SDK](example_lambda_Scenario_GettingStartedFunctions_section.md) + + [Cross-service examples for Lambda using AWS SDKs](service_code_examples_cross-service_examples.md) + + [Create an API Gateway REST API to track COVID-19 data](example_cross_ApiGatewayDataTracker_section.md) + + [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) + + [Create a messenger application with Step Functions](example_cross_StepFunctionsMessenger_section.md) + + [Create a websocket chat application with API Gateway](example_cross_ApiGatewayWebsocketChat_section.md) + + [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) + + [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) + + [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) + + [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) + [AWS Lambda releases](lambda-releases.md) + [API reference](API_Reference.md) + [Actions](API_Operations.md) @@ -320,6 +349,7 @@ Amazon's trademarks and trade dress may not be used in + [AliasConfiguration](API_AliasConfiguration.md) + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) + [AllowedPublishers](API_AllowedPublishers.md) + + [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) + [CodeSigningConfig](API_CodeSigningConfig.md) + [CodeSigningPolicies](API_CodeSigningPolicies.md) + [Concurrency](API_Concurrency.md) @@ -351,9 +381,12 @@ Amazon's trademarks and trade dress may not be used in + [OnSuccess](API_OnSuccess.md) + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) + [SelfManagedEventSource](API_SelfManagedEventSource.md) + + [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) + [TracingConfig](API_TracingConfig.md) + [TracingConfigResponse](API_TracingConfigResponse.md) + [VpcConfig](API_VpcConfig.md) + [VpcConfigResponse](API_VpcConfigResponse.md) + + [Common Errors](CommonErrors.md) + + [Common Parameters](CommonParameters.md) + [AWS glossary](glossary.md) \ No newline at end of file diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md index 6ded61d8..0aa5b64b 100644 --- a/doc_source/invocation-async.md +++ b/doc_source/invocation-async.md @@ -25,7 +25,7 @@ aws lambda invoke \ --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` { @@ -112,7 +112,14 @@ Add destinations to your function in the Lambda console's function visualization 1. Choose **Save**\. -When an invocation matches the condition, Lambda sends a JSON document with details about the invocation to the destination\. The following example shows an invocation record for an event that failed three processing attempts due to a function error\. +When an invocation matches the condition, Lambda sends a JSON document with details about the invocation to the destination\. + +**Destination\-specific JSON format** ++ For Amazon SQS and Amazon SNS \(`SnsDestination` and `SqsDestination`\), the invocation record is passed as the `Message` to the destination\. ++ For Lambda \(`LambdaDestination`\), the invocation record is passed as the payload to the function\. ++ For EventBridge \(`EventBridgeDestination`\), the invocation record is passed as the `detail` in the [PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) call\. The value for the `source` event field is `lambda`\. The value for the `detail-type` event field is either *Lambda Function Invocation Result – Success* or *Lambda Function Invocation Result – Failure*\. The `resource` event field contains the function and destination Amazon Resource Names \(ARNs\)\. For other event fields, see [Amazon EventBridge events](https://docs.aws.amazon.com/eventbridge/latest/userguide/aws-events.html)\. + +The following example shows an invocation record for an event that failed three processing attempts due to a function error\. **Example invocation record** diff --git a/doc_source/invocation-eventfiltering.md b/doc_source/invocation-eventfiltering.md index cf9d458f..ee60a90c 100644 --- a/doc_source/invocation-eventfiltering.md +++ b/doc_source/invocation-eventfiltering.md @@ -1,6 +1,6 @@ # Lambda event filtering -For Amazon Kinesis, Amazon DynamoDB, and Amazon Simple Queue Service \(Amazon SQS\) event sources, you can use event filtering to control which events Lambda sends to your function for processing\. For example, you can define filter criteria so that you process only the records from a Kinesis stream that have the status code `ERROR`\. +You can use event filtering to control which events Lambda sends to your function for processing\. For example, you can define filter criteria so that you process only the records from a Kinesis stream that have the status code `ERROR`\. You can define up to five different filters for a single event source\. If an event satisfies any one of these five filters, Lambda sends the event to your function\. Otherwise, Lambda discards the event\. An event either satisfies the filter criteria or it doesn't\. If you're using batching windows, Lambda applies your filter criteria to each new event to determine whether to add it to the current batch\. @@ -12,6 +12,7 @@ You can define up to five different filters for a single event source\. If an ev + [Attaching filter criteria to an event source mapping \(AWS CLI\)](#filtering-cli) + [Properly filtering Amazon SQS messages](#filtering-sqs) + [Properly filtering Kinesis and DynamoDB messages](#filtering-streams) ++ [Properly filtering Amazon Managed Streaming for Apache Kafka, self\-managed Apache Kafka, and Amazon MQ messages](#filtering-poller) ## Event filtering basics @@ -57,10 +58,37 @@ There are three main parts to a `FilterCriteria` object: metadata properties, da + **Data properties** are the fields of the event body\. In the example `FilterCriteria`, `Data1` refers to a data property\. In the Kinesis event example, `Data1` could refer to fields such as `City` and `Temperature`\. **Note** To filter on data properties, make sure to contain them in `FilterCriteria` within the proper key\. This key depends on the event source\. For Kinesis event sources, the data key is `data`\. For Amazon SQS event sources, the data key is `body`\. For DynamoDB event sources, the data key is `dynamodb`\. -+ **Filter rules** define the filter that you want to apply to a specific property\. In the example `FilterCriteria`, `rule1` applies to `Metadata1`, and `rule2` applies to `Data1`\. The syntax of your filter rule depends on the comparison operator that you use\. For more information, see [Filter rule syntaxFiltering examples](#filtering-syntax)\. ++ **Filter rules** define the filter that you want to apply to a specific property\. In the example `FilterCriteria`, `rule1` applies to `Metadata1`, and `rule2` applies to `Data1`\. The syntax of your filter rule depends on the comparison operator that you use\. For more information, see [Filter rule syntax](#filtering-syntax)\. When you create a `FilterCriteria` object, specify only the metadata properties and data properties that you want the filter to match on\. For Lambda to consider the event a match, the event must contain all the field names included in a filter\. Lambda ignores the fields that aren't included in a filter\. +### Duplicate keys + +If a pattern contains duplicate keys with different values, Lambda uses only the last value for that key\. For example, here's a JSON filter pattern that contains multiple values for `"duplicateKey"`: + +``` +{ + "Metadata1": [ "pattern1" ], + "data": { + "duplicateKey" : ["hello"], + "uniqueKey" : ["test123"], + "duplicateKey" : ["world"] + } +} +``` + +In this scenario, Lambda interprets the filter rule as follows: + +``` +{ + "Metadata1": [ "pattern1" ], + "data": { + "uniqueKey" : ["test123"], + "duplicateKey" : ["world"] + } +} +``` + ## Filter rule syntax For filter rules, Lambda supports the same set of syntax and rules as Amazon EventBridge\. For more information, see [Amazon EventBridge event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the *Amazon EventBridge User Guide*\. @@ -201,11 +229,11 @@ Follow these steps to create a new event source mapping with filter criteria usi 1. Under **Function overview**, choose **Add trigger**\. -1. For **Trigger configuration**, choose a trigger type that supports event filtering\. These include **SQS**, **DynamoDB**, and **Kinesis**\. +1. For **Trigger configuration**, choose a trigger type that supports event filtering\. These include **SQS**, **DynamoDB**, **Kinesis**, **MSK**, and **MQ**\. 1. Expand **Additional settings**\. -1. Under **Filter criteria**, define and enter your filters\. For example, you can enter the following: +1. Under **Filter criteria**, choose **Add**, and then define and enter your filters\. For example, you can enter the following: ``` { "a" : [ 1, 2 ] } @@ -279,7 +307,7 @@ aws lambda update-event-source-mapping \ If an Amazon SQS message doesn't satisfy your filter criteria, Lambda automatically removes the message from the queue\. You don't have to manually delete these messages in Amazon SQS\. -For Amazon SQS, the message `body` can be any string\. However, this can be problematic if your `FilterCriteria` expects `body` to be in a valid JSON format\. The reverse scenario is also true—if the incoming message `body` is in a valid JSON format, this can lead to unintended behavior if your filter criteria expects `body` to be a plain string\. +For Amazon SQS, the message `body` can be any string\. However, this can be problematic if your `FilterCriteria` expect `body` to be in a valid JSON format\. The reverse scenario is also true—if the incoming message `body` is in JSON format but your filter criteria expects `body` to be a plain string, this can lead to unintended behavior\. To avoid this issue, ensure that the format of `body` in your `FilterCriteria` matches the expected format of `body` in messages that you receive from your queue\. Before filtering your messages, Lambda automatically evaluates the format of the incoming message `body` and of your filter pattern for `body`\. If there is a mismatch, Lambda drops the message\. The following table summarizes this evaluation: @@ -299,7 +327,7 @@ If you don't include `body` as part of your `FilterCriteria`, Lambda skips this Once your filter criteria processes an Kinesis or DynamoDB record, the streams iterator advances past this record\. If the record doesn't satisfy your filter criteria, you don't have to manually delete the record from your event source\. After the retention period, Kinesis and DynamoDB automatically delete these old records\. If you want records to be deleted sooner, see [Changing the Data Retention Period](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-extended-retention.html)\. -To properly filter events from stream event sources, both the data field and your filter criteria for the data field must be in valid JSON format\. \(For Kinesis, the data field is `data`\. For DynamoDB, the data field is `dynamodb`\.\) If either field isn't in a valid JSON format, Lambda drops the message or throws an exception\. The following table summarizes the specific behavior: +To properly filter events from Kinesis and DynamoDB sources, both the data field and your filter criteria for the data field must be in valid JSON format\. \(For Kinesis, the data field is `data`\. For DynamoDB, the data field is `dynamodb`\.\) If either field isn't in a valid JSON format, Lambda drops the message or throws an exception\. The following table summarizes the specific behavior: | Incoming data format \(`data` or `dynamodb`\) | Filter pattern format for data properties | Resulting action | @@ -309,4 +337,26 @@ To properly filter events from stream event sources, both the data field and you | Valid JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | | Non\-JSON | Valid JSON | Lambda drops the record\. | | Non\-JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Non\-JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | \ No newline at end of file +| Non\-JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | + +## Properly filtering Amazon Managed Streaming for Apache Kafka, self\-managed Apache Kafka, and Amazon MQ messages + +**Note** +After you attach filter criteria to a Kafka or Amazon MQ event source mapping, it can take up to 15 minutes to apply your filtering rules to events\. + +For [Amazon MQ sources](with-mq.md), the message field is `data`\. For Kafka sources \([Amazon MSK](with-msk.md) and [self\-managed Apache Kafka](with-kafka.md)\), there are two message fields: `key` and `value`\. + +Lambda drops messages that don't match all fields included in the filter\. For Kafka, Lambda commits offsets for matched and unmatched messages after successfully invoking the function\. For Amazon MQ, Lambda acknowledges matched messages after successfully invoking the function and acknowledges unmatched messages when filtering them\. + +Kafka and Amazon MQ messages must be UTF\-8 encoded strings, either plain strings or in JSON format\. That's because Lambda decodes Kafka and Amazon MQ byte arrays into UTF\-8 before applying filter criteria\. If your messages use another encoding, such as UTF\-16 or ASCII, or if the message format doesn't match the `FilterCriteria` format, Lambda processes metadata filters only\. The following table summarizes the specific behavior: + + +| Incoming message format \(`data` or `key` and `value`\) | Filter pattern format for message properties | Resulting action | +| --- | --- | --- | +| Plain string | Plain string | Lambda filters based on your filter criteria\. | +| Plain string | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Plain string | Valid JSON | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Plain string | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | +| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | +| Non\-UTF\-8 encoded string | JSON, plain string, or no pattern | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | \ No newline at end of file diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md index 28436d2a..e4127f5d 100644 --- a/doc_source/invocation-eventsourcemapping.md +++ b/doc_source/invocation-eventsourcemapping.md @@ -47,6 +47,8 @@ You should see the following output: } ``` +Lambda event source mappings process events at least once due to the distributed nature of its pollers\. As a result, your Lambda function may receive duplicate events in rare situations\. Follow [Best practices for working with AWS Lambda functions](best-practices.md) and build idempotent functions to avoid issues related to duplicate events\. + ## Batching behavior Event source mappings read items from a target event source\. By default, an event source mapping batches records together into a single payload that Lambda sends to your function\. To fine\-tune batching behavior, you can configure a batching window \(`MaximumBatchingWindowInSeconds`\) and a batch size \(`BatchSize`\)\. A batching window is the maximum amount of time to gather records into a single payload\. A batch size is the maximum number of records in a single batch\. Lambda invokes your function when one of the following three criteria is met: diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md index e8f2e3ac..15f0e0c9 100644 --- a/doc_source/invocation-images.md +++ b/doc_source/invocation-images.md @@ -19,7 +19,7 @@ You can use the Lambda API to get information about a function's state\. For mor ## Invoking the function -When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda initializes any [extensions](using-extensions.md#invocation-extensions-images) and then runs the function’s initialization code \(the code outside the main handler\)\. Note that function initialization duration is included in billed execution time\. +When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda initializes any [extensions](extensions-configuration.md#invocation-extensions-images) and then runs the function’s initialization code \(the code outside the main handler\)\. Note that function initialization duration is included in billed execution time\. Lambda then runs the function by calling the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md index de22876f..159aa434 100644 --- a/doc_source/invocation-layers.md +++ b/doc_source/invocation-layers.md @@ -97,7 +97,7 @@ You should see output similar to the following: { "FunctionName": "test-layers", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", "Layers": [ { diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md index b7d56c45..2163926d 100644 --- a/doc_source/invocation-sync.md +++ b/doc_source/invocation-sync.md @@ -6,7 +6,7 @@ When you invoke a function synchronously, Lambda runs the function and waits for aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the following output: diff --git a/doc_source/java-context.md b/doc_source/java-context.md index 653ab0d4..f5e46aff 100644 --- a/doc_source/java-context.md +++ b/doc_source/java-context.md @@ -99,9 +99,9 @@ For more information on logging, see [AWS Lambda function logging in Java](java- The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md index a8335733..e4963ecc 100644 --- a/doc_source/java-exceptions.md +++ b/doc_source/java-exceptions.md @@ -85,7 +85,7 @@ import java.util.List; // process event if ( event.size() != 2 ) { - throw new InputLengthException("Input must be an array that contains 2 numbers."); + throw new InputLengthException("Input must be a list that contains 2 numbers."); } int numerator = event.get(0); int denominator = event.get(1); @@ -102,7 +102,7 @@ When the function throws `InputLengthException`, the Java runtime serializes it ``` { - "errorMessage":"Input must contain 2 numbers.", + "errorMessage":"Input must be a list that contains 2 numbers.", "errorType":"java.lang.InputLengthException", "stackTrace": [ "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", @@ -164,7 +164,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: @@ -200,17 +200,17 @@ We recommend using AWS X\-Ray to determine the source of an error and its cause\ ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) -For more information, see [Instrumenting Java code in Lambda](java-tracing.md)\. +For more information, see [Instrumenting Java code in AWS Lambda](java-tracing.md)\. ## Sample applications The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 6f41740c..0d1249d4 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -38,30 +38,21 @@ The [Lambda runtime](lambda-runtimes.md) receives an event as a JSON\-formatted + `package.Class::method` – Full format\. For example: `example.Handler::handleRequest`\. + `package.Class` – Abbreviated format for functions that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. -You can add [initialization code](foundation-progmodel.md) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. +You can add [initialization code](https://docs.aws.amazon.com/lambda/latest/operatorguide/static-initialization.html) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. -In the following example, the logger, serializer, and AWS SDK client are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. +In the following example, the logger and the serializer are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Initialization code** +**Example [HandlerS3\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerS3.java) – Initialization code** ``` -// Handler value: example.Handler -public class Handler implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(Handler.class); - private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - private static final LambdaAsyncClient lambdaClient = LambdaAsyncClient.create(); - ... - @Override - public String handleRequest(SQSEvent event, Context context) - { - String response = new String(); - // call Lambda API - logger.info("Getting account settings"); - CompletableFuture accountSettings = - lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); - // log execution details - logger.info("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - ... +public class HandlerS3 implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(S3Event event, Context context) + { + ... + } ``` The GitHub repo for this guide provides easy\-to\-deploy sample applications that demonstrate a variety of handler types\. For details, see the [end of this topic](#java-handler-samples)\. @@ -170,12 +161,12 @@ public class HandlerStream implements RequestStreamHandler { The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. -The `blank-java` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: +The `java-events` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: + [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. + [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. + [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. diff --git a/doc_source/java-image.md b/doc_source/java-image.md index 96b496c6..afe36a1e 100644 --- a/doc_source/java-image.md +++ b/doc_source/java-image.md @@ -30,11 +30,11 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base images for Java: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 11 | Java 11 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | -| 8\.al2 | Java 8 \(Corretto\) | Amazon Linux 2 | [Dockerfile for Java 8\.al2 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | -| 8 | Java 8 \(OpenJDK\) | Amazon Linux 2018\.03 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| 11 | Java 11 | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | | +| 8\.al2 | Java 8 | Amazon Linux 2 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | | +| 8 | Java 8 | Amazon Linux | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | | Amazon ECR repository: [gallery\.ecr\.aws/lambda/java](https://gallery.ecr.aws/lambda/java) diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md index 67eee3ae..4a43b225 100644 --- a/doc_source/java-logging.md +++ b/doc_source/java-logging.md @@ -150,7 +150,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash @@ -228,7 +228,7 @@ To customize log output, support logging during unit tests, and log AWS SDK call To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/resources/log4j2.xml) – Appender configuration** +**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java/src/main/resources/log4j2.xml) – Appender configuration** ``` @@ -275,52 +275,39 @@ SLF4J is a facade library for logging in Java code\. In your function code, you In the following example, the handler class uses SLF4J to retrieve a logger\. -**Example [src/main/java/example/Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/src/main/java/example/Handler.java) – Logging with SLF4J** +**Example [src/main/java/example/HandlerS3\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerS3.java) – Logging with SLF4J** ``` import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.Handler -public class Handler implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(Handler.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - LambdaAsyncClient lambdaClient = LambdaAsyncClient.create(); - @Override - public String handleRequest(SQSEvent event, Context context) - { - String response = new String(); - // call Lambda API - logger.info("Getting account settings"); - CompletableFuture accountSettings = - lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); - // log execution details - logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv())); -... +public class HandlerS3 implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(S3Event event, Context context) + { + ... + logger.info("RECORD: " + record); + logger.info("SOURCE BUCKET: " + srcBucket); + logger.info("SOURCE KEY: " + srcKey); + ... + } +} ``` The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Logging dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/build.gradle) – Logging dependencies** ``` dependencies { - implementation platform('software.amazon.awssdk:bom:2.10.73') - implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') - implementation 'software.amazon.awssdk:lambda' - implementation 'com.amazonaws:aws-xray-recorder-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' - implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.1' - implementation 'org.apache.logging.log4j:log4j-core:2.17.1' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' + ... + implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' + implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' + ... } ``` @@ -331,11 +318,9 @@ When you run your code locally for tests, the context object with the Lambda log The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. -The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. - -The `blank-java` sample application builds on the basic configuration with AWS SDK logging and the Lambda Log4j 2 appender\. It uses Log4j 2 in Lambda with custom appender that adds the invocation request ID to each line\. \ No newline at end of file +The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. \ No newline at end of file diff --git a/doc_source/java-package.md b/doc_source/java-package.md index 87002652..ac307121 100644 --- a/doc_source/java-package.md +++ b/doc_source/java-package.md @@ -330,7 +330,7 @@ aws cloudformation deploy --template-file out.yml --stack-name java-basic --capa For a complete working example, see the following sample applications: **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](#java-package) library\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. \ No newline at end of file ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](#java-package) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. ++ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md index 74378b5b..2c6eb8b8 100644 --- a/doc_source/java-samples.md +++ b/doc_source/java-samples.md @@ -3,60 +3,9 @@ The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. -Use the `blank-java` sample app to learn the basics, or as a starting point for your own application\. It shows the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. It uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times when you are iterating on your function code\. The project requires minimal setup and can be deployed from the command line in less than a minute\. - -[https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) - -The other sample applications show other build configurations, handler interfaces, and use cases for services that integrate with Lambda\. The `java-basic` sample shows a function with minimal dependencies\. You can use this sample for cases where you don't need additional libraries like the AWS SDK, and can represent your function's input and output with standard Java types\. To try a different handler type, you can simply change the handler setting on the function\. - -**Example [java\-basic/src/main/java/example/HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Stream handler** - -``` -// Handler value: example.HandlerStream -public class HandlerStream implements RequestStreamHandler { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException - { - LambdaLogger logger = context.getLogger(); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("US-ASCII"))); - PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("US-ASCII")))); - try - { - HashMap event = gson.fromJson(reader, HashMap.class); - logger.log("STREAM TYPE: " + inputStream.getClass().toString()); - logger.log("EVENT TYPE: " + event.getClass().toString()); - writer.write(gson.toJson(event)); - ... -``` - -The `java-events` samples show the use of the event types provided by the `aws-lambda-java-events` library\. These types represent the event documents that [AWS services](lambda-services.md) send to your function\. `java-events` includes handlers for types that don't require additional dependencies\. - -**Example [java\-events/src/main/java/example/HandlerDynamoDB\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java) – DynamoDB records** - -``` -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; -... -// Handler value: example.HandlerDynamoDB -public class HandlerDynamoDB implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(DynamodbEvent event, Context context) - { - String response = new String("200 OK"); - for (DynamodbStreamRecord record : event.getRecords()){ - logger.info(record.getEventID()); - logger.info(record.getEventName()); - logger.info(record.getDynamodb().toString()); - } - ... -``` - -For more highlights, see the other topics in this chapter\. \ No newline at end of file +If you're new to Lambda functions in Java, start with the `java-basic` examples\. To get started with Lambda event sources, see the `java-events` examples\. Both of these example sets show the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. Each example uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times\. These examples require minimal setup and you can deploy them from the command line in less than a minute\. \ No newline at end of file diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md index 54c41f2a..c57399e3 100644 --- a/doc_source/java-tracing.md +++ b/doc_source/java-tracing.md @@ -1,21 +1,23 @@ -# Instrumenting Java code in Lambda +# Instrumenting Java code in AWS Lambda Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. To send tracing data to X\-Ray, you can use one of two SDK libraries: + [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. -+ [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) – A collection of libraries for generating and sending trace data to X\-Ray\. ++ [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) – An SDK for generating and sending trace data to X\-Ray\. Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. **Important** -**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. +**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. **Topics** + [Using ADOT to instrument your Java functions](#java-adot) + [Using the X\-Ray SDK to instrument your Java functions](#java-xray-sdk) ++ [Activating tracing with the Lambda console](#java-tracing-console) + [Activating tracing with the Lambda API](#java-tracing-api) + [Activating tracing with AWS CloudFormation](#java-tracing-cloudformation) ++ [Interpreting an X\-Ray trace](#java-tracing-interpretation) + [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#java-tracing-layers) + [X\-Ray tracing in sample applications \(X\-Ray SDK\)](#java-tracing-samples) @@ -31,22 +33,25 @@ For Java runtimes, you can choose between two layers to consume: To record data about calls that your function makes to other resources and services in your application, you can add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that activate automatic instrumentation of AWS SDK for Java 2\.x clients\. -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/build.gradle) – Tracing dependencies** +**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java/build.gradle) – Tracing dependencies** ``` dependencies { - implementation platform('software.amazon.awssdk:bom:2.10.73') - implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') - implementation 'software.amazon.awssdk:lambda' + implementation platform('software.amazon.awssdk:bom:2.15.0') + implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.11.0') + ... implementation 'com.amazonaws:aws-xray-recorder-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' + implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' + implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' ... } ``` -After you add the correct dependencies, activate tracing in your function's configuration: +After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. + +## Activating tracing with the Lambda console + +To toggle active tracing on your Lambda function with the console, follow these steps: **To turn on active tracing** @@ -54,43 +59,17 @@ After you add the correct dependencies, activate tracing in your function's conf 1. Choose a function\. -1. Choose **Configuration**, and then choose **Monitoring and operations tools**\. +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. 1. Choose **Edit**\. -1. Under **AWS X\-Ray**, turn on **Active tracing**\. +1. Under **X\-Ray**, toggle on **Active tracing**\. 1. Choose **Save**\. -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -Your function needs permissions to upload trace data to X\-Ray\. When you turn on active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. You can also manually add the AWS Identity and Access Management \(IAM\) policy [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) to your execution role\. - -After you've configured active tracing, you can observe specific requests through your application\. The [X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor sample application](samples-errorprocessor.md) shows an application with two Lambda functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first function's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -X\-Ray may not trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The default sample rule is one request per second and five percent of additional requests\. You cannot configure this sampling rate for your functions\. - -For each trace, Lambda records two segments, which creates two nodes on the service graph\. The following image highlights the primary function from the error processor example\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node on the right records the work of your function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment appears only for the first event that each instance of your function processes\. -+ **Invocation** – Represents the work that your handler code does\. -+ **Overhead** – Represents the work that the Lambda runtime does to prepare to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the *AWS X\-Ray Developer Guide*\. - ## Activating tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -102,7 +81,7 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. ## Activating tracing with AWS CloudFormation @@ -133,9 +112,40 @@ Resources: ... ``` +## Interpreting an X\-Ray trace + +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. + +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the *AWS X\-Ray Developer Guide*\. + +**Pricing** +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. + ## Storing runtime dependencies in a layer \(X\-Ray SDK\) -If you use the X\-Ray SDK to instrument AWS SDK clients in your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time that you update your function code, package them in a Lambda layer\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS SDK for Java and X\-Ray SDK for Java\. @@ -161,7 +171,7 @@ Resources: - java8 ``` -With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application on GitHub\. @@ -170,13 +180,9 @@ Creating a layer for dependencies requires build configuration changes to genera The GitHub repository for this guide includes sample applications that demonstrate the use of X\-Ray tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. -All of the sample applications have active tracing enabled for Lambda functions\. The `blank-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/blank-java-servicemap.png) - -This example from the `blank-java` sample application shows nodes for the Lambda service, a function, and the Lambda API\. The function calls the Lambda API to monitor storage usage in Lambda\. \ No newline at end of file +All of the sample applications have active tracing enabled for Lambda functions\. For example, the `s3-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. \ No newline at end of file diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md index 8df8a3bc..2090f07b 100644 --- a/doc_source/lambda-api-permissions-ref.md +++ b/doc_source/lambda-api-permissions-ref.md @@ -1,8 +1,8 @@ # Resources and conditions for Lambda actions -You can restrict the scope of a user's permissions by specifying resources and conditions in an IAM policy\. Each API action supports a combination of resource and condition types that varies depending on the behavior of the action\. +You can restrict the scope of a user's permissions by specifying resources and conditions in an AWS Identity and Access Management \(IAM\) policy\. Each action in a policy supports a combination of resource and condition types that varies depending on the behavior of the action\. -Every IAM policy statement grants permission to an action that's performed on a resource\. When the action doesn't act on a named resource, or when you grant permission to perform the action on all resources, the value of the resource in the policy is a wildcard \(`*`\)\. For many API actions, you can restrict the resources that a user can modify by specifying the Amazon Resource Name \(ARN\) of a resource, or an ARN pattern that matches multiple resources\. +Every IAM policy statement grants permission to an action that's performed on a resource\. When the action doesn't act on a named resource, or when you grant permission to perform the action on all resources, the value of the resource in the policy is a wildcard \(`*`\)\. For many actions, you can restrict the resources that a user can modify by specifying the Amazon Resource Name \(ARN\) of a resource, or an ARN pattern that matches multiple resources\. To restrict permissions by resource, specify the resource by ARN\. @@ -14,7 +14,7 @@ To restrict permissions by resource, specify the resource by ARN\. + Layer – `arn:aws:lambda:us-west-2:123456789012:layer:my-layer` + Layer version – `arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1` -For example, the following policy allows a user in account `123456789012` to invoke a function named `my-function` in the US West \(Oregon\) Region\. +For example, the following policy allows a user in AWS account `123456789012` to invoke a function named `my-function` in the US West \(Oregon\) AWS Region\. **Example invoke function policy** @@ -45,9 +45,9 @@ This is a special case where the action identifier \(`lambda:InvokeFunction`\) d ## Policy conditions -Conditions are an optional policy element that applies additional logic to determine if an action is allowed\. In addition to [common conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) supported by all actions, Lambda defines condition types that you can use to restrict the values of additional parameters on some actions\. +Conditions are an optional policy element that applies additional logic to determine if an action is allowed\. In addition to common [conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) that all actions support, Lambda defines condition types that you can use to restrict the values of additional parameters on some actions\. -For example, the `lambda:Principal` condition lets you restrict the service or account that a user can grant invocation access to on a function's resource\-based policy\. The following policy lets a user grant permission to SNS topics to invoke a function named `test`\. +For example, the `lambda:Principal` condition lets you restrict the service or account that a user can grant invocation access to on a function's [resource\-based policy](access-control-resource-based.md)\. The following policy lets a user grant permission to Amazon Simple Notification Service \(Amazon SNS\) topics to invoke a function named `test`\. **Example manage function policy permissions** @@ -75,20 +75,20 @@ For example, the `lambda:Principal` condition lets you restrict the service or a The condition requires that the principal is Amazon SNS and not another service or account\. The resource pattern requires that the function name is `test` and includes a version number or alias\. For example, `test:v1`\. -For more information on resources and conditions for Lambda and other AWS services, see [Actions, resources, and condition keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_actions-resources-contextkeys.html) in the *IAM User Guide*\. +For more information on resources and conditions for Lambda and other AWS services, see [Actions, resources, and condition keys for AWS services](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html) in the *Service Authorization Reference*\. ## Function resource names You reference a Lambda function in a policy statement using an Amazon Resource Name \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function \(unqualified\) or a function [version](configuration-versions.md) or [alias](configuration-aliases.md) \(qualified\)\. -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with both the `FunctionName` and `Qualifier` passed in API calls\. If there is a misamtch, Lambda denies the request\. +When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with both the `FunctionName` and `Qualifier` passed in API calls\. If there is a mismatch, Lambda denies the request\. Whether you are allowing or denying an action on your function, you must use the correct function ARN types in your policy statement to achieve the results that you expect\. For example, if your policy references the unqualified ARN, Lambda accepts requests that reference the unqualified ARN but denies requests that reference a qualified ARN\. **Note** -You can't use a wildcard character to match the Account ID\. For more information on accepted syntax, see [IAM JSON policy reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)\. +You can't use a wildcard character \(\*\) to match the account ID\. For more information on accepted syntax, see [IAM JSON policy reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in the *IAM User Guide*\. -**Example allowing invocation of an unqualified arn** +**Example allowing invocation of an unqualified ARN** ``` { @@ -105,7 +105,7 @@ You can't use a wildcard character to match the Account ID\. For more informatio If your policy references a specific qualified ARN, Lambda accepts requests that reference that ARN but denies requests that reference the unqualified ARN or a different qualified ARN, for example, `myFunction:2`\. -**Example allowing invocation of a specific qualified arn** +**Example allowing invocation of a specific qualified ARN** ``` { @@ -122,7 +122,7 @@ If your policy references a specific qualified ARN, Lambda accepts requests that If your policy references any qualified ARN using `:*`, Lambda accepts any qualified ARN but denies requests that reference the unqualified ARN\. -**Example allowing invocation of any qualified arn** +**Example allowing invocation of any qualified ARN** ``` { @@ -139,7 +139,7 @@ If your policy references any qualified ARN using `:*`, Lambda accepts any quali If your policy references any ARN using `*`, Lambda accepts any qualified or unqualified ARN\. -**Example allowing invocation of any qualified or unqualified arn** +**Example allowing invocation of any qualified or unqualified ARN** ``` { @@ -156,27 +156,33 @@ If your policy references any ARN using `*`, Lambda accepts any qualified or unq ## Function actions -Actions that operate on a function can be restricted to a specific function by function, version, or alias ARN, as described in the following table\. Actions that don't support resource restrictions can only be granted for all resources \(`*`\)\. +Actions that operate on a function can be restricted to a specific function by function, version, or alias ARN, as described in the following table\. Actions that don't support resource restrictions are granted for all resources \(`*`\)\. -**Functions** +**Function actions** | Action | Resource | Condition | | --- | --- | --- | -| [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` | -| [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | None | -| [CreateFunction](API_CreateFunction.md) [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` | -| [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListAliases](API_ListAliases.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | None | -| [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) [ListTags](API_ListTags.md) [TagResource](API_TagResource.md) [UntagResource](API_UntagResource.md) | `*` | None | +| [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` `aws:ResourceTag/${TagKey}` `lambda:FunctionUrlAuthType` | +| [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | `aws:ResourceTag/${TagKey}` | +| [CreateFunction](API_CreateFunction.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` `aws:ResourceTag/${TagKey}` `aws:RequestTag/${TagKey}` `aws:TagKeys` | +| [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` `aws:ResourceTag/${TagKey}` | +| [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) [GetFunctionConcurrency](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConcurrency.html) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) [ListAliases](API_ListAliases.md) [ListTags](API_ListTags.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | `aws:ResourceTag/${TagKey}` | +| [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) | Function Function alias | `lambda:FunctionUrlAuthType` `lambda:FunctionArn` | +| [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) | Function | `lambda:FunctionUrlAuthType` | +| [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) | Function alias Function version | `aws:ResourceTag/${TagKey}` | +| [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) | `*` | None | +| [TagResource](API_TagResource.md) | Function | `aws:ResourceTag/${TagKey}` `aws:RequestTag/${TagKey}` `aws:TagKeys` | +| [UntagResource](API_UntagResource.md) | Function | `aws:ResourceTag/${TagKey}` `aws:TagKeys` | ## Event source mapping actions -For event source mappings, delete and update permissions can be restricted to a specific event source\. The `lambda:FunctionArn` condition lets you restrict which functions a user can configure an event source to invoke\. +For [event source mappings](invocation-eventsourcemapping.md), you can restrict delete and update permissions to a specific event source\. The `lambda:FunctionArn` condition lets you restrict which functions a user can configure an event source to invoke\. For these actions, the resource is the event source mapping, so Lambda provides a condition that lets you restrict permission based on the function that the event source mapping invokes\. -**Event source mappings** +**Event source mapping actions** | Action | Resource | Condition | | --- | --- | --- | @@ -189,10 +195,10 @@ For these actions, the resource is the event source mapping, so Lambda provides Layer actions let you restrict the layers that a user can manage or use with a function\. Actions related to layer use and permissions act on a version of a layer, while `PublishLayerVersion` acts on a layer name\. You can use either with wildcards to restrict the layers that a user can work with by name\. **Note** -Note: the [GetLayerVersion](API_GetLayerVersion.md) action also covers [GetLayerVersionByArn](API_GetLayerVersionByArn.md)\. Lambda does not support `GetLayerVersionByArn` as an IAM action\. +The [GetLayerVersion](API_GetLayerVersion.md) action also covers [GetLayerVersionByArn](API_GetLayerVersionByArn.md)\. Lambda does not support `GetLayerVersionByArn` as an IAM action\. -**Layers** +**Layer actions** | Action | Resource | Condition | | --- | --- | --- | diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md index b87a382c..87364c8d 100644 --- a/doc_source/lambda-csharp.md +++ b/doc_source/lambda-csharp.md @@ -19,12 +19,13 @@ AWS Lambda provides the following libraries for C\# functions: These packages are available at [Nuget packages](https://www.nuget.org/packages/)\. -**\.NET runtimes** +**\.NET** -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| Name | Identifier | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | +| \.NET 5 | `dotnet5.0` | Amazon Linux 2 | x86\_64 | | **Note** For end of support information about \.NET Core 2\.1, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. @@ -42,4 +43,5 @@ To get started with application development in your local environment, deploy on + [AWS Lambda context object in C\#](csharp-context.md) + [Lambda function logging in C\#](csharp-logging.md) + [AWS Lambda function errors in C\#](csharp-exceptions.md) -+ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) \ No newline at end of file ++ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) ++ [\.NET functions with native AOT compilation](dotnet-native-aot.md) \ No newline at end of file diff --git a/doc_source/using-extensions.md b/doc_source/lambda-extensions.md similarity index 61% rename from doc_source/using-extensions.md rename to doc_source/lambda-extensions.md index c17ff88c..9015fe2f 100644 --- a/doc_source/using-extensions.md +++ b/doc_source/lambda-extensions.md @@ -1,4 +1,4 @@ -# Using Lambda extensions +# Lambda extensions You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. @@ -14,9 +14,10 @@ You are charged for the execution time that the extension consumes \(in 1 ms inc + [Execution environment](#using-extensions-env) + [Impact on performance and resources](#using-extensions-reg) + [Permissions](#using-extensions-permissions) -+ [Configuring extensions \(\.zip file archive\)](#using-extensions-config) -+ [Using extensions in container images](#invocation-extensions-images) -+ [Next steps](#using-extensions-next) ++ [Configuring Lambda extensions](extensions-configuration.md) ++ [AWS Lambda extensions partners](extensions-api-partners.md) ++ [Lambda Extensions API](runtimes-extensions-api.md) ++ [Lambda Telemetry API](telemetry-api.md) ## Execution environment @@ -45,58 +46,4 @@ To measure the extra time that the extension takes after the function execution, Extensions have access to the same resources as functions\. Because extensions are executed within the same environment as the function, permissions are shared between the function and the extension\. -For a \.zip file archive, you can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. - -## Configuring extensions \(\.zip file archive\) - -You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. - -You add the extension to your function using the same method as you would for any layer\. For more information, see [Using layers with your Lambda function](invocation-layers.md)\. - -**Add an extension to your function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose the **Code** tab if it is not already selected\. - -1. Under **Layers**, choose **Edit**\. - -1. For **Choose a layer**, choose **Specify an ARN**\. - -1. For **Specify an ARN**, enter the Amazon Resource Name \(ARN\) of an extension layer\. - -1. Choose **Add**\. - -## Using extensions in container images - -You can add extensions to your [container image](images-create.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. - -You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. - -### Example: Adding an external extension - -An external extension runs in a separate process from the Lambda function\. Lambda starts a process for each extension in the `/opt/extensions/` directory\. Lambda uses the Extensions API to manage the extension lifecycle\. After the function has run to completion, Lambda sends a `Shutdown` event to each external extension\. - -**Example of adding an external extension to a Python base image** - -``` -FROM public.ecr.aws/lambda/python:3.8 - -# Copy and install the app -COPY /app /app -WORKDIR /app -RUN pip install -r requirements.txt - -# Add an extension from the local directory into /opt -ADD my-extension.zip /opt -CMD python ./my-function.py -``` - -## Next steps - -To learn more about extensions, we recommend the following resources: -+ For a basic working example, see [Building Extensions for AWS Lambda](http://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. -+ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. -+ To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file +For a \.zip file archive, you can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. \ No newline at end of file diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md index 44c8728c..86e5892a 100644 --- a/doc_source/lambda-foundation.md +++ b/doc_source/lambda-foundation.md @@ -7,6 +7,7 @@ The Lambda function is the foundational principle of Lambda\. You can configure + [Lambda features](gettingstarted-features.md) + [Lambda programming model](foundation-progmodel.md) + [Lambda instruction set architectures](foundation-arch.md) ++ [Lambda execution environment](lambda-runtime-environment.md) + [VPC networking for Lambda](foundation-networking.md) + [Lambda function scaling](invocation-scaling.md) + [Lambda deployment packages](gettingstarted-package.md) diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md index a30f8d0d..0f4db7f5 100644 --- a/doc_source/lambda-golang.md +++ b/doc_source/lambda-golang.md @@ -3,11 +3,11 @@ The following sections explain how common programming patterns and core concepts apply when authoring Lambda function code in [Go](https://golang.org/)\. -**Go runtimes** +**Go** -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | +| Name | Identifier | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | +| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | | **Note** Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md index f271de16..ece2e4fd 100644 --- a/doc_source/lambda-intro-execution-role.md +++ b/doc_source/lambda-intro-execution-role.md @@ -1,28 +1,32 @@ -# AWS Lambda execution role +# Lambda execution role -A Lambda function's execution role is an AWS Identity and Access Management \(IAM\) role that grants the function permission to access AWS services and resources\. You provide this role when you create a function, and Lambda assumes the role when your function is invoked\. You can create an execution role for development that has permission to send logs to Amazon CloudWatch and to upload trace data to AWS X\-Ray\. +A Lambda function's execution role is an AWS Identity and Access Management \(IAM\) role that grants the function permission to access AWS services and resources\. For example, you might create an execution role that has permission to send logs to Amazon CloudWatch and upload trace data to AWS X\-Ray\. + +You provide an execution role when you create a function\. **When you invoke your function, Lambda automatically provides your function with temporary credentials by assuming this role\.** You don't have to call `sts:AssumeRole` in your function code\. **To view a function's execution role** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. -1. Choose a function\. +1. Choose the name of a function\. -1. Choose **Configuration** and then choose **Permissions**\. +1. Choose **Configuration**, and then choose **Permissions**\. -1. Under **Resource summary**, view the services and resources that the function can access\. +1. Under **Resource summary**, review the services and resources that the function can access\. 1. Choose a service from the dropdown list to see permissions related to that service\. You can add or remove permissions from a function's execution role at any time, or configure your function to use a different role\. Add permissions for any services that your function calls with the AWS SDK, and for services that Lambda uses to enable optional features\. -When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +When you add permissions to your function, update its code or configuration as well\. This forces running instances of your function, which have outdated credentials, to stop and be replaced\. **Topics** + [Creating an execution role in the IAM console](#permissions-executionrole-console) + [Grant least privilege access to your Lambda execution role](#permissions-executionrole-least-privilege) + [Managing roles with the IAM API](#permissions-executionrole-api) ++ [Session duration for temporary security credentials](#permissions-executionrole-session) + [AWS managed policies for Lambda features](#permissions-executionrole-features) ++ [Working with Lambda execution environment credentials](#permissions-executionrole-source-function-arn) ## Creating an execution role in the IAM console @@ -34,41 +38,35 @@ By default, Lambda creates an execution role with minimal permissions when you [ 1. Choose **Create role**\. -1. Under **Common use cases**, choose **Lambda**\. - -1. Choose **Next: Permissions**\. +1. Under **Use case**, choose **Lambda**\. -1. Under **Attach permissions policies**, choose the AWS managed policies **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess**\. +1. Choose **Next**\. -1. Choose **Next: Tags**\. +1. Select the AWS managed policies **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess**\. -1. Choose **Next: Review**\. +1. Choose **Next**\. -1. For **Role name**, enter **lambda\-role**\. - -1. Choose **Create role**\. +1. Enter a **Role name** and then choose **Create role**\. For detailed instructions, see [Creating a role for an AWS service \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the *IAM User Guide*\. ## Grant least privilege access to your Lambda execution role -When you first create an IAM role for your Lambda function during the development phase, you might sometimes grant permissions beyond what is required\. Before publishing your function in the production environment, best practice is to adjust the policy to include only the required permissions\. For more information, see [granting least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege)\. +When you first create an IAM role for your Lambda function during the development phase, you might sometimes grant permissions beyond what is required\. Before publishing your function in the production environment, as a best practice, adjust the policy to include only the required permissions\. For more information, see [Apply least\-privilege permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) in the *IAM User Guide*\. -Use IAM Access Analyzer to help identify the required permissions for the IAM execution role policy\. IAM Access Analyzer reviews your AWS CloudTrail logs over the date range that you specify and generates a policy template with only the permissions that the function used during that time\. You can use the template to create a managed policy with fine\-grained permissions, and then attach it to the IAM role\. That way, you grant only the permissions that the role needs to interact with AWS resources for your specific use case\. +Use IAM Access Analyzer to help identify the required permissions for the IAM execution role policy\. IAM Access Analyzer reviews your AWS CloudTrail logs over the date range that you specify and generates a policy template with only the permissions that the function used during that time\. You can use the template to create a managed policy with fine\-grained permissions, and then attach it to the IAM role\. That way, you grant only the permissions that the role needs to interact with AWS resources for your specific use case\. -To learn more, see [Generate policies based on access activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html) in the *IAM User Guide*\. +For more information, see [Generate policies based on access activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html) in the *IAM User Guide*\. ## Managing roles with the IAM API -To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the `create-role` command\. - -In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. +To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the create\-role command\. When using this command, you can specify the [ trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#delegation) inline\. A role's trust policy gives the specified principals permission to assume the role\. In the following example, you grant the Lambda service principal permission to assume your role\. Note that requirements for escaping quotes in the JSON string may vary depending on your shell\. ``` aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' ``` -You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service `AssumeRole` action\. +You can also define the trust policy for the role using a separate JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. **Example trust\-policy\.json** @@ -117,12 +115,19 @@ You should see the following output: } ``` -To add permissions to the role, use the `attach-policy-to-role` command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. +**Note** +Lambda automatically assumes your execution role when you invoke your function\. You should avoid calling `sts:AssumeRole` manually in your function code\. If your use case requires that the role assumes itself, you must include the role itself as a trusted principal in your role's trust policy\. For more information on how to modify a role trust policy, see [ Modifying a role trust policy \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-managingrole-editing-console.html#roles-managingrole_edit-trust-policy) in the IAM User Guide\. + +To add permissions to the role, use the attach\-policy\-to\-role command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. ``` aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` +## Session duration for temporary security credentials + +Lambda assumes the execution role associated with your function to fetch temporary security credentials which are then available as environment variables during a function's invocation\. If you use these temporary credentials outside of Lambda, such as to create a presigned Amazon S3 URL, you can't control the session duration\. The IAM maximum session duration setting doesn't apply to sessions that are assumed by AWS services such as Lambda\. Use the [sts:AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) action if you need control over session duration\. + ## AWS managed policies for Lambda features The following AWS managed policies provide permissions that are required to use Lambda features\. @@ -130,6 +135,7 @@ The following AWS managed policies provide permissions that are required to use | Change | Description | Date | | --- | --- | --- | +| **[ AWSLambdaMSKExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole)** – Lambda added the [kafka:DescribeClusterV2](https://docs.aws.amazon.com/MSK/2.0/APIReference/v2-clusters-clusterarn.html#v2-clusters-clusterarnget) permission to this policy\. | `AWSLambdaMSKExecutionRole` grants permissions to read and access records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster, manage elastic network interfaces \(ENIs\), and write to CloudWatch Logs\. | June 17, 2022 | | **[ AWSLambdaBasicExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaBasicExecutionRole` grants permissions to upload logs to CloudWatch\. | February 14, 2022 | | **[ AWSLambdaDynamoDBExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaDynamoDBExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaDynamoDBExecutionRole` grants permissions to read records from an Amazon DynamoDB stream and write to CloudWatch Logs\. | February 14, 2022 | | **[ AWSLambdaKinesisExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaKinesisExecutionRole` grants permissions to read events from an Amazon Kinesis data stream and write to CloudWatch Logs\. | February 14, 2022 | @@ -138,7 +144,7 @@ The following AWS managed policies provide permissions that are required to use | **[ AWSLambdaVPCAccessExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaVPCAccessExecutionRole` grants permissions to manage ENIs within an Amazon VPC and write to CloudWatch Logs\. | February 14, 2022 | | **[ AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess)** – Lambda started tracking changes to this policy\. | `AWSXRayDaemonWriteAccess` grants permissions to upload trace data to X\-Ray\. | February 14, 2022 | | **[ CloudWatchLambdaInsightsExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `CloudWatchLambdaInsightsExecutionRolePolicy` grants permissions to write runtime metrics to CloudWatch Lambda Insights\. | February 14, 2022 | -| **[ AmazonS3ObjectLambdaExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AmazonS3ObjectLambdaExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `AmazonS3ObjectLambdaExecutionRolePolicy` grants permissions to interact with Amazon S3 Object Lambda and write to CloudWatch Logs\. | February 14, 2022 | +| **[ AmazonS3ObjectLambdaExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AmazonS3ObjectLambdaExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `AmazonS3ObjectLambdaExecutionRolePolicy` grants permissions to interact with Amazon Simple Storage Service \(Amazon S3\) object Lambda and to write to CloudWatch Logs\. | February 14, 2022 | For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. @@ -152,4 +158,80 @@ When you use an [event source mapping](invocation-eventsourcemapping.md) to invo + [Self\-managed Apache Kafka](with-kafka.md) + [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. \ No newline at end of file +In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. + +## Working with Lambda execution environment credentials + +It's common for your Lambda function code to make API requests to other AWS services\. To make these requests, Lambda generates an ephemeral set of credentials by assuming your function's execution role\. Lambda also automatically injects the source function Amazon Resource Name \(ARN\) into the credentials context used to make the API request from your function code\. + +Lambda injects the source function ARN into the credentials context only if the request is an AWS API request that comes from within your execution environment\. AWS API calls that Lambda makes outside of your execution environment on your behalf using the same execution role don't contain the source function ARN\. Examples of such API calls outside the execution environment include: ++ Calls to AWS Key Management Service \(AWS KMS\) to automatically encrypt and decrypt your environment variables\. ++ Calls to CloudWatch for logging\. + +With the source function ARN in the credentials context, you can verify whether a call to your resource came from a specific Lambda function's code\. To verify this, use the `lambda:SourceFunctionArn` condition key in an IAM identity\-based policy or service control policy \(SCP\)\. + +**Note** +You cannot use the `lambda:SourceFunctionArn` condition key in resource\-based policies\. + +With this condition key in your identity\-based policies or SCPs, you can implement security controls for the API actions that your function code makes to other AWS services\. This has a few key security applications, such as helping you identify the source of a credential leak\. + +**Note** +The `lambda:SourceFunctionArn` condition key is different from the `lambda:FunctionArn` and `aws:SourceArn` condition keys\. The `lambda:FunctionArn` condition key applies only to [event source mappings](invocation-eventsourcemapping.md) and helps define which functions your event source can invoke\. The `aws:SourceArn` condition key applies only to policies where your Lambda function is the target resource, and helps define which other AWS services and resources can invoke that function\. The `lambda:SourceFunctionArn` condition key can apply to any identity\-based policy or SCP to define the specific Lambda functions that have permissions to make specific AWS API calls to other resources\. + +To use `lambda:SourceFunctionArn` in your policy, include it as a condition with any of the [ARN condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN)\. The value of the key must be a valid ARN\. + +For example, suppose your Lambda function code makes an `s3:PutObject` call that targets a specific Amazon S3 bucket\. You might want to allow only one specific Lambda function to have `s3:PutObject` access that bucket\. In this case, your function's execution role should have a policy attached that looks like this: + +**Example policy granting a specific Lambda function access to an Amazon S3 resource** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "ExampleSourceFunctionArn", + "Effect": "Allow", + "Action": "s3:PutObject", + "Resource": "arn:aws:s3:::lambda_bucket/*", + "Condition": { + "ArnEquals": { + "lambda:SourceFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:source_lambda" + } + } + } + ] +} +``` + +This policy allows only `s3:PutObject` access if the source is the Lambda function with ARN `arn:aws:lambda:us-east-1:123456789012:function:source_lambda`\. This policy doesn't allow `s3:PutObject` access to any other calling identity\. This is true even if a different function or entity makes an `s3:PutObject` call with the same execution role\. + +You can also use `lambda:SourceFunctionArn` in [service control policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html)\. For example, suppose you want to restrict access to your bucket to either a single Lambda function's code or to calls from a specific Amazon Virtual Private Cloud \(VPC\)\. The following SCP illustrates this\. + +**Example policy denying access to Amazon S3 under specific conditions** + +``` +{ + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "s3:*" + ], + "Resource": "arn:aws:s3:::lambda_bucket/*", + "Effect": "Deny", + "Condition": { + "StringNotEqualsIfExists": { + "aws:SourceVpc": [ + "vpc-12345678" + ] + }, + "ArnNotEqualsIfExists": { + "lambda:SourceFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:source_lambda" + } + } + } + ] +} +``` + +This policy denies all S3 actions unless they come from a specific Lambda function with ARN `arn:aws:lambda:*:123456789012:function:source_lambda`, or unless they come from the specified VPC\. The `StringNotEqualsIfExists` operator tells IAM to process this condition only if the `aws:SourceVpc` key is present in the request\. Similarly, IAM considers the `ArnNotEqualsIfExists` operator only if the `lambda:SourceFunctionArn` exists\. \ No newline at end of file diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md index b2b7b7d0..146972ef 100644 --- a/doc_source/lambda-invocation.md +++ b/doc_source/lambda-invocation.md @@ -20,5 +20,4 @@ Depending on who invokes your function and how it's invoked, scaling behavior an + [Lambda function states](functions-states.md) + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) + [Testing Lambda functions in the console](testing-functions.md) -+ [Using Lambda extensions](using-extensions.md) + [Invoking functions defined as container images](invocation-images.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md index 1ad435a2..3e34e0f7 100644 --- a/doc_source/lambda-java.md +++ b/doc_source/lambda-java.md @@ -5,13 +5,13 @@ You can run Java code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes Lambda supports the following Java runtimes\. -**Java runtimes** +**Java** -| Name | Identifier | JDK | Operating system | Architectures | +| Name | Identifier | Operating system | Architectures | Deprecation | | --- | --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | +| Java 11 | `java11` | Amazon Linux 2 | x86\_64, arm64 | | +| Java 8 | `java8.al2` | Amazon Linux 2 | x86\_64, arm64 | | +| Java 8 | `java8` | Amazon Linux | x86\_64 | | Lambda provides the following libraries for Java functions: + [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. @@ -78,6 +78,6 @@ Your Lambda function comes with a CloudWatch Logs log group\. The function runti + [AWS Lambda context object in Java](java-context.md) + [AWS Lambda function logging in Java](java-logging.md) + [AWS Lambda function errors in Java](java-exceptions.md) -+ [Instrumenting Java code in Lambda](java-tracing.md) ++ [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Creating a deployment package using Eclipse](java-package-eclipse.md) + [Java sample applications for AWS Lambda](java-samples.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md index c5b5f3b9..b9ec227f 100644 --- a/doc_source/lambda-nodejs.md +++ b/doc_source/lambda-nodejs.md @@ -5,13 +5,13 @@ You can run JavaScript code with Node\.js in AWS Lambda\. Lambda provides [runti Lambda supports the following Node\.js runtimes\. -**Node\.js runtimes** +**Node\.js** -| Name | Identifier | SDK for JavaScript | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Node\.js 16 | `nodejs16.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | +| Name | Identifier | SDK | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | --- | +| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. @@ -59,7 +59,7 @@ The Lambda console uses AWS Cloud9 to provide an integrated development environm The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md index 3c4cbbbf..3a72c391 100644 --- a/doc_source/lambda-permissions.md +++ b/doc_source/lambda-permissions.md @@ -1,25 +1,23 @@ -# AWS Lambda permissions +# Lambda permissions -You can use AWS Identity and Access Management \(IAM\) to manage access to the Lambda API and resources like functions and layers\. For users and applications in your account that use Lambda, you manage permissions in a permissions policy that you can apply to IAM users, groups, or roles\. To grant permissions to other accounts or AWS services that use your Lambda resources, you use a policy that applies to the resource itself\. +You can use AWS Identity and Access Management \(IAM\) to manage access to the Lambda API and resources such as functions and layers\. For users and applications in your account that use Lambda, you can create IAM policies that apply to IAM users, groups, or roles\. -A Lambda function also has a policy, called an [execution role](lambda-intro-execution-role.md), that grants it permission to access AWS services and resources\. At a minimum, your function needs access to Amazon CloudWatch Logs for log streaming\. If you [use AWS X\-Ray to trace your function](services-xray.md), or your function accesses services with the AWS SDK, you grant it permission to call them in the execution role\. Lambda also uses the execution role to get permission to read from event sources when you use an [event source mapping](invocation-eventsourcemapping.md) to trigger your function\. +Every Lambda function has an IAM role called an [execution role](lambda-intro-execution-role.md)\. In this role, you can attach a policy that defines the permissions that your function needs to access other AWS services and resources\. At a minimum, your function needs access to Amazon CloudWatch Logs for log streaming\. If your function calls other service APIs with the AWS SDK, you must include the necessary permissions in the execution role's policy\. Lambda also uses the execution role to get permission to read from event sources when you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function\. -**Note** -If your function needs network access to a resource like a relational database that isn't accessible through AWS APIs or the internet, [configure it to connect to your VPC](configuration-vpc.md)\. +To give other accounts and AWS services permission to use your Lambda resources, use a [resource\-based policy](access-control-resource-based.md)\. Lambda resources include functions, versions, aliases, and layer versions\. When a user tries to access a Lambda resource, Lambda considers both the user's [identity\-based policies](access-control-identity-based.md) and the resource's resource\-based policy\. When an AWS service such as Amazon Simple Storage Service \(Amazon S3\) calls your Lambda function, Lambda considers only the resource\-based policy\. -Use [resource\-based policies](access-control-resource-based.md) to give other accounts and AWS services permission to use your Lambda resources\. Lambda resources include functions, versions, aliases, and layer versions\. Each of these resources has a permissions policy that applies when the resource is accessed, in addition to any policies that apply to the user\. When an AWS service like Amazon S3 calls your Lambda function, the resource\-based policy gives it access\. +To manage permissions for users and applications in your account, we recommend using an [AWS managed policy](access-control-identity-based.md)\. You can use these managed policies as\-is, or as a starting point for writing your own more restrictive policies\. Policies can restrict user permissions by the resource that an action affects, and by additional optional conditions\. For more information, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. -To manage permissions for users and applications in your accounts, [use the managed policies that Lambda provides](access-control-identity-based.md), or write your own\. The Lambda console uses multiple services to get information about your function's configuration and triggers\. You can use the managed policies as\-is, or as a starting point for more restrictive policies\. +If your Lambda functions contain calls to other AWS resources, you might also want to restrict which functions can access those resources\. To do this, include the `lambda:SourceFunctionArn` condition key in a resource\-based policy for the target resource\. For more information, see [Working with Lambda execution environment credentials](lambda-intro-execution-role.md#permissions-executionrole-source-function-arn)\. -You can restrict user permissions by the resource an action affects and, in some cases, by additional conditions\. For example, you can specify a pattern for the Amazon Resource Name \(ARN\) of a function that requires a user to include their user name in the name of functions that they create\. Additionally, you can add a condition that requires that the user configure functions to use a specific layer to, for example, pull in logging software\. For the resources and conditions that are supported by each action, see [Resources and Conditions](lambda-api-permissions-ref.md)\. +For more information about IAM, see the *[IAM User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)*\. -For more information about IAM, see [What is IAM?](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) in the *IAM User Guide*\. - -For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. +For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *AWS Lambda Operator Guide*\. **Topics** -+ [AWS Lambda execution role](lambda-intro-execution-role.md) -+ [Using resource\-based policies for AWS Lambda](access-control-resource-based.md) ++ [Lambda execution role](lambda-intro-execution-role.md) + [Identity\-based IAM policies for Lambda](access-control-identity-based.md) ++ [Attribute\-based access control for Lambda](attribute-based-access-control.md) ++ [Using resource\-based policies for Lambda](access-control-resource-based.md) + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) \ No newline at end of file diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md index daafd65d..9dd46192 100644 --- a/doc_source/lambda-powershell.md +++ b/doc_source/lambda-powershell.md @@ -3,12 +3,13 @@ The following sections explain how common programming patterns and core concepts apply when you author Lambda function code in PowerShell\. -**\.NET runtimes** +**\.NET** -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | +| Name | Identifier | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | +| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | +| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | +| \.NET 5 | `dotnet5.0` | Amazon Linux 2 | x86\_64 | | Lambda provides the following sample applications for the PowerShell runtime: + [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md index e74a48f3..be0003b1 100644 --- a/doc_source/lambda-python.md +++ b/doc_source/lambda-python.md @@ -5,14 +5,13 @@ You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtim Lambda supports the following Python runtimes\. -**Python runtimes** - -| Name | Identifier | AWS SDK for Python | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | +**Python** + +| Name | Identifier | SDK | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | --- | +| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | +| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | +| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | | The runtime information in this table undergoes continuous updates\. For more information on using AWS SDKs in Lambda, see [Managing AWS SDKs in Lambda functions](https://docs.aws.amazon.com/lambda/latest/operatorguide/sdks-functions.html)\. diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md index 8fec4b94..18de9054 100644 --- a/doc_source/lambda-releases.md +++ b/doc_source/lambda-releases.md @@ -4,6 +4,7 @@ The following table describes the important changes to the *AWS Lambda Developer | Change | Description | Date | | --- |--- |--- | +| [lambda:SourceFunctionArn condition key](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | For an AWS resource, the `lambda:SourceFunctionArn` condition key filters access to the resource by the ARN of a Lambda function\. For details, see [ Working with Lambda execution environment credentials](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html?icmpid=docs_lambda_rss#permissions-executionrole-source-function-arn)\. | July 1, 2022 | | [Node\.js 16 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 16\. Node\.js 16 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 11, 2022 | | [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss) | Lambda now supports function URLs, which are dedicated HTTP\(S\) endpoints for Lambda functions\. For details, see [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss)\. | April 6, 2022 | | [Shared test events in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss) | Lambda now supports sharing test events with other IAM users in the same AWS account\. For details, see [Testing Lambda functions in the console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss)\. | March 16, 2022 | @@ -30,7 +31,7 @@ The following table describes the important changes to the *AWS Lambda Developer | [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | | [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | | [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | +| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | | [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | | [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | | [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md index a5be3ac4..114e8f80 100644 --- a/doc_source/lambda-ruby.md +++ b/doc_source/lambda-ruby.md @@ -5,11 +5,11 @@ You can run Ruby code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes Lambda supports the following Ruby runtimes\. -**Ruby runtimes** +**Ruby** -| Name | Identifier | SDK for Ruby | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | +| Name | Identifier | SDK | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | --- | +| Ruby 2\.7 | `ruby2.7` | 3\.1\.0 | Amazon Linux 2 | x86\_64, arm64 | | **Note** For end of support information about Ruby 2\.5, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. @@ -60,7 +60,7 @@ The Lambda console uses AWS Cloud9 to provide an integrated development environm The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an SDE\) you need to [create a deployment package](ruby-package.md) to upload your code to the Lambda function\. +When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](ruby-package.md) to upload your code to the Lambda function\. **Note** To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. diff --git a/doc_source/lambda-runtime-environment.md b/doc_source/lambda-runtime-environment.md index 569bb00c..ef7860e0 100644 --- a/doc_source/lambda-runtime-environment.md +++ b/doc_source/lambda-runtime-environment.md @@ -1,8 +1,8 @@ -# AWS Lambda execution environment +# Lambda execution environment - Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](using-extensions.md) associated with your function\. + Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](lambda-extensions.md) associated with your function\. -The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages from the function by subscribing to logs using the [Logs API](runtimes-logs-api.md)\. +The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages and other telemetry from the function by using the [Telemetry API](telemetry-api.md)\. @@ -13,10 +13,6 @@ When you create your Lambda function, you specify configuration information, suc The function's runtime and each external extension are processes that run within the execution environment\. Permissions, resources, credentials, and environment variables are shared between the function and the extensions\. **Topics** -+ [Lambda Extensions API](runtimes-extensions-api.md) -+ [AWS Lambda runtime API](runtimes-api.md) -+ [Lambda Logs API](runtimes-logs-api.md) -+ [AWS Lambda extensions partners](extensions-api-partners.md) + [Lambda execution environment lifecycle](#runtimes-lifecycle) ## Lambda execution environment lifecycle @@ -69,7 +65,7 @@ When Lambda is about to shut down the runtime, it sends a `Shutdown` event to ea After the function and all extensions have completed, Lambda maintains the execution environment for some time in anticipation of another function invocation\. In effect, Lambda freezes the execution environment\. When the function is invoked again, Lambda thaws the environment for reuse\. Reusing the execution environment has the following implications: + Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We recommend adding logic in your code to check if a connection exists before creating a new one\. -+ Each execution environment provides 512 MB to 10,240 MB, in 1\-MB increments\. of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. ++ Each execution environment provides between 512 MB and 10,240 MB, in 1\-MB increments, of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. + Background processes or callbacks that were initiated by your Lambda function and did not complete when the function ended resume if Lambda reuses the execution environment\. Make sure that any background processes or callbacks in your code are complete before the code exits\. When you write your function code, do not assume that Lambda automatically reuses the execution environment for subsequent function invocations\. Other factors may dictate a need for Lambda to create a new execution environment, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md index f0c76900..2cfa24e0 100644 --- a/doc_source/lambda-runtimes.md +++ b/doc_source/lambda-runtimes.md @@ -2,98 +2,46 @@ Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](gettingstarted-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. -When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change or upgrade the runtime, you can [update your function's configuration](configuration-function-zip.md#configuration-function-runtime)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. - -**Amazon Linux** -+ Image – [amzn\-ami\-hvm\-2018\.03\.0\.20181129\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2) -+ Linux kernel – 4\.14 +When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-function-zip.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. **Amazon Linux 2** + Image – Custom + Linux kernel – 4\.14 +**Amazon Linux** ++ Image – [amzn\-ami\-hvm\-2018\.03\.0\.20220802\.0\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20220802.0-x86_64-gp2) ++ Linux kernel – 4\.14 + Lambda invokes your function in an [execution environment](lambda-runtime-environment.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](#runtime-support-policy) when the version reaches end of life\. - -**Node\.js runtimes** - -| Name | Identifier | SDK for JavaScript | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Node\.js 16 | `nodejs16.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | -| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | - -**Note** -For end of support information about Node\.js 10, see [Runtime deprecation policy](#runtime-support-policy)\. - - -**Python runtimes** - -| Name | Identifier | AWS SDK for Python | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | -| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | -| Python 3\.6 | `python3.6` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | - - -**Ruby runtimes** - -| Name | Identifier | SDK for Ruby | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.0\.1 | Amazon Linux 2 | x86\_64, arm64 | - -**Note** -For end of support information about Ruby 2\.5, see [Runtime deprecation policy](#runtime-support-policy)\. - - -**Java runtimes** - -| Name | Identifier | JDK | Operating system | Architectures | -| --- | --- | --- | --- | --- | -| Java 11 | `java11` | amazon\-corretto\-11 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8.al2` | amazon\-corretto\-8 | Amazon Linux 2 | x86\_64, arm64 | -| Java 8 | `java8` | amazon\-corretto\-8 | Amazon Linux | x86\_64 | - - -**Go runtimes** - -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | - -**Note** -Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. - - -**\.NET runtimes** - -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | - -**Note** -For end of support information about \.NET Core 2\.1, see [Runtime deprecation policy](#runtime-support-policy)\. - To use other languages in Lambda, you can implement a [custom runtime](runtimes-custom.md)\. The Lambda execution environment provides a [runtime interface](runtimes-api.md) for getting invocation events and sending responses\. You can deploy a custom runtime alongside your function code, or in a [layer](configuration-layers.md)\. - -**Custom runtime** - -| Name | Identifier | Operating system | Architectures | -| --- | --- | --- | --- | -| Custom Runtime | `provided.al2` | Amazon Linux 2 | x86\_64, arm64 | -| Custom Runtime | `provided` | Amazon Linux | x86\_64 | - -**Topics** -+ [Modifying the runtime environment](runtimes-modify.md) -+ [Custom AWS Lambda runtimes](runtimes-custom.md) -+ [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) -+ [Runtime deprecation policy](#runtime-support-policy) +**Note** +For new regions, Lambda will not support runtimes that are set to be deprecated within the next six months\. + + +**Supported Runtimes** + +| Name | Identifier | SDK | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | --- | +| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | +| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | +| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | +| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | | +| Java 11 | `java11` | | Amazon Linux 2 | x86\_64, arm64 | | +| Java 8 | `java8.al2` | | Amazon Linux 2 | x86\_64, arm64 | | +| Java 8 | `java8` | | Amazon Linux | x86\_64 | | +| \.NET Core 3\.1 | `dotnetcore3.1` | | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | +| \.NET 6 | `dotnet6` | | Amazon Linux 2 | x86\_64, arm64 | | +| \.NET 5 | `dotnet5.0` | | Amazon Linux 2 | x86\_64 | | +| Go 1\.x | `go1.x` | | Amazon Linux | x86\_64 | | +| Ruby 2\.7 | `ruby2.7` | 3\.1\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Custom Runtime | `provided.al2` | | Amazon Linux 2 | x86\_64, arm64 | | +| Custom Runtime | `provided` | | Amazon Linux | x86\_64 | | ## Runtime deprecation policy @@ -107,25 +55,25 @@ Phase 2 \- you can no longer **create or update** functions that use the runtime Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. -In the table below, each phase starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached or are scheduled for end of support: +In the table below, each phase starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached end of support: -**Runtime end of support dates** +**Deprecated runtimes** | Name | Identifier | Operating system | Deprecation Phase 1 | Deprecation Phase 2 | | --- | --- | --- | --- | --- | -| \.NET Core 2\.1 | `dotnetcore2.1` | Amazon Linux | Jan 5, 2022 | Apr 13, 2022 | -| Python 3\.6 | `python3.6` | Amazon Linux | July 18, 2022 | Aug 17, 2022 | -| Python 2\.7 | `python2.7` | Amazon Linux | July 15, 2021 | Feb 14, 2022 | -| Ruby 2\.5 | `ruby2.5` | Amazon Linux | July 30, 2021 | March 31, 2022 | -| Node\.js 10\.x | `nodejs10.x` | Amazon Linux 2 | July 30, 2021 | Feb 14, 2022 | -| Node\.js 8\.10 | `nodejs8.10` | Amazon Linux | | March 6, 2020 | -| Node\.js 6\.10 | `nodejs6.10` | Amazon Linux | | August 12, 2019 | -| Node\.js 4\.3 edge | `nodejs4.3-edge` | Amazon Linux | | April 30, 2019 | -| Node\.js 4\.3 | `nodejs4.3` | Amazon Linux | | March 6, 2020 | -| Node\.js 0\.10 | `nodejs` | Amazon Linux | | October 31, 2016 | -| \.NET Core 2\.0 | `dotnetcore2.0` | Amazon Linux | | May 30, 2019 | -| \.NET Core 1\.0 | `dotnetcore1.0` | Amazon Linux | | July 30, 2019 | +| Python 3\.6 | python3\.6 | Amazon Linux | Jul 18, 2022 | Aug 29, 2022 | +| Python 2\.7 | python2\.7 | Amazon Linux | Jul 15, 2021 | May 30, 2022 | +| \.NET Core 2\.1 | dotnetcore2\.1 | Amazon Linux | Jan 5, 2022 | Apr 13, 2022 | +| Ruby 2\.5 | ruby2\.5 | Amazon Linux | Jul 30, 2021 | Mar 31, 2022 | +| Node\.js 10 | nodejs10\.x | Amazon Linux 2 | Jul 30, 2021 | Feb 14, 2022 | +| Node\.js 8\.10 | nodejs8\.10 | Amazon Linux | | Mar 6, 2020 | +| Node\.js 4\.3 | nodejs4\.3 | Amazon Linux | | Mar 5, 2020 | +| Node\.js 6\.10 | nodejs6\.10 | Amazon Linux | | Aug 12, 2019 | +| \.NET Core 1\.0 | dotnetcore1\.0 | Amazon Linux | | Jul 30, 2019 | +| \.NET Core 2\.0 | dotnetcore2\.0 | Amazon Linux | | May 30, 2019 | +| Node\.js 4\.3 edge | nodejs4\.3\-edge | Amazon Linux | | Apr 30, 2019 | +| Node\.js 0\.10 | nodejs | Amazon Linux | | Oct 31, 2016 | In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. @@ -135,4 +83,12 @@ In almost all cases, the end\-of\-life date of a language version or operating s + **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) + **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) + **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) \ No newline at end of file ++ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) + +**Topics** ++ [Runtime deprecation policy](#runtime-support-policy) ++ [Modifying the runtime environment](runtimes-modify.md) ++ [Custom AWS Lambda runtimes](runtimes-custom.md) ++ [AWS Lambda runtime API](runtimes-api.md) ++ [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) ++ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md index 0909c007..700c9879 100644 --- a/doc_source/lambda-samples.md +++ b/doc_source/lambda-samples.md @@ -30,10 +30,10 @@ The GitHub repository for this guide includes sample applications that demonstra #### [ Java ] **Sample Lambda applications in Java** -+ [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) – A Java function that shows the use of Lambda's Java libraries, logging, environment variables, layers, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A minimal Java function with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A minimal Java function that uses the latest version \(3\.0\.0 and newer\) of the [aws\-lambda\-java\-events](java-package.md) library\. These examples do not require the AWS SDK as a dependency\. ++ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. ++ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. + [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. ++ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. ------ #### [ Go ] diff --git a/doc_source/lambda-typescript.md b/doc_source/lambda-typescript.md index 4351befa..6b47c5c8 100644 --- a/doc_source/lambda-typescript.md +++ b/doc_source/lambda-typescript.md @@ -2,11 +2,22 @@ You can use the Node\.js runtime to run TypeScript code in AWS Lambda\. Because Node\.js doesn't run TypeScript code natively, you must first transpile your TypeScript code into JavaScript\. Then, use the JavaScript files to deploy your function code to Lambda\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. +Lambda supports the following Node\.js runtimes\. + + +**Node\.js** + +| Name | Identifier | SDK | Operating system | Architectures | Deprecation | +| --- | --- | --- | --- | --- | --- | +| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | +| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | + ## Setting up a TypeScript development environment Use a local integrated development environment \(IDE\), text editor, or [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-typescript.html) to write your TypeScript function code\. You can’t create TypeScript code on the Lambda console\. -To transpile your TypeScript code, set up a compiler such as [esbuild](https://esbuild.github.io/) or Microsoft's TypeScript compiler \(`tsc`\) , which is bundled with the [TypeScript distribution](https://www.typescriptlang.org/download)\. You can use the [AWS Serverless Application Model \(AWS SAM\)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html) or the [AWS Cloud Development Kit \(CDK\)](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) to simplify building and deploying TypeScript code\. Both tools use esbuild to transpile TypeScript code into JavaScript\. +To transpile your TypeScript code, set up a compiler such as [esbuild](https://esbuild.github.io/) or Microsoft's TypeScript compiler \(`tsc`\) , which is bundled with the [TypeScript distribution](https://www.typescriptlang.org/download)\. You can use the [AWS Serverless Application Model \(AWS SAM\)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html) or the [AWS Cloud Development Kit \(AWS CDK\)](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) to simplify building and deploying TypeScript code\. Both tools use esbuild to transpile TypeScript code into JavaScript\. When using esbuild, consider the following: + There are several [TypeScript caveats](https://esbuild.github.io/content-types/#typescript-caveats)\. diff --git a/doc_source/lambda-urls.md b/doc_source/lambda-urls.md index 8dce6e3f..8b485ad7 100644 --- a/doc_source/lambda-urls.md +++ b/doc_source/lambda-urls.md @@ -1,14 +1,17 @@ # Lambda function URLs -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: ``` https://.lambda-url..on.aws ``` -Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. +Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After you configure a function URL for your function, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. -Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After you configure a function URL for your function, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. Lambda function URLs use [resource\-based policies](access-control-resource-based.md) for security and access control\. Function URLs also support cross\-origin resource sharing \(CORS\) configuration options\. +**Note** +You can access your function URL through the public Internet only\. While Lambda functions do support AWS PrivateLink, function URLs do not\. + +Lambda function URLs use [resource\-based policies](access-control-resource-based.md) for security and access control\. Function URLs also support cross\-origin resource sharing \(CORS\) configuration options\. You can apply function URLs to any function alias, or to the `$LATEST` unpublished function version\. You can't add a function URL to any other function version\. diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md index 3bf9f78a..f45fd6a2 100644 --- a/doc_source/logging-using-cloudtrail.md +++ b/doc_source/logging-using-cloudtrail.md @@ -35,7 +35,7 @@ In the CloudTrail log file, the `eventName` might include date and version infor + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) + [CreateFunction](API_CreateFunction.md) - \(The `ZipFile` parameter is omitted from the CloudTrail logs for `CreateFunction`\.\) + \(The `Environment` and `ZipFile` parameters are omitted from the CloudTrail logs for `CreateFunction`\.\) + [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) + [DeleteFunction](API_DeleteFunction.md) @@ -49,12 +49,17 @@ In the CloudTrail log file, the `eventName` might include date and version infor + [ListEventSourceMappings](API_ListEventSourceMappings.md) + [ListFunctions](API_ListFunctions.md) + [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) ++ [PublishLayerVersion](API_PublishLayerVersion.md) + + \(The `ZipFile` parameter is omitted from the CloudTrail logs for `PublishLayerVersion`\.\) + [RemovePermission](API_RemovePermission.md) + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) + [UpdateFunctionCode](API_UpdateFunctionCode.md) \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + + \(The `Environment` parameter is omitted from the CloudTrail logs for `UpdateFunctionConfiguration`\.\) + [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) ## Understanding Lambda log file entries diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md index df53ca0f..605fd9d1 100644 --- a/doc_source/monitoring-cloudwatchlogs.md +++ b/doc_source/monitoring-cloudwatchlogs.md @@ -24,7 +24,7 @@ Your [execution role](lambda-intro-execution-role.md) needs permission to upload aws iam attach-role-policy --role-name your-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole ``` -For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md)\. +For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. ## Pricing diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md index ee06278c..824848b8 100644 --- a/doc_source/monitoring-insights.md +++ b/doc_source/monitoring-insights.md @@ -17,7 +17,7 @@ Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtim CloudWatch Lambda Insights is a monitoring and troubleshooting solution for serverless applications running on AWS Lambda\. The solution collects, aggregates, and summarizes system\-level metrics including CPU time, memory, disk and network usage\. It also collects, aggregates, and summarizes diagnostic information such as cold starts and Lambda worker shutdowns to help you isolate issues with your Lambda functions and resolve them quickly\. -Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function for a supported runtime, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html)\. +Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function for a supported runtime, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html)\. The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for the `/aws/lambda-insights/` log group\. @@ -31,7 +31,7 @@ You can use Lambda Insights with any of the runtimes that support [Lambda extens ## Enabling Lambda Insights in the Lambda console -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/using-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. **To enable Lambda Insights in the Lambda console** @@ -49,7 +49,7 @@ You can enable Lambda Insights enhanced monitoring on new and existing Lambda fu ## Enabling Lambda Insights programmatically -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. +You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md index e89b82c7..26641f70 100644 --- a/doc_source/monitoring-metrics.md +++ b/doc_source/monitoring-metrics.md @@ -60,7 +60,7 @@ Performance metrics provide performance details about a single invocation\. For + `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. + `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. + `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when a stream receives the record and when the event source mapping sends the event to the function\. -+ `OffsetLag` – For self\-managed Apache Kafka and Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event sources, the difference in offset between the last record written to a topic and the last record that your Lambda function processed\. Though a Kafka topic can have multiple partitions, this metric measures the offset lag at the topic level\. ++ `OffsetLag` – For self\-managed Apache Kafka and Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event sources, the difference in offset between the last record written to a topic and the last record that your Lambda function's consumer group processed\. Though a Kafka topic can have multiple partitions, this metric measures the offset lag at the topic level\. `Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the p95 statistic shows the maximum duration of 95 percent of invocations, excluding the slowest 5 percent\. diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md index e1545e48..80e0f49e 100644 --- a/doc_source/nodejs-exceptions.md +++ b/doc_source/nodejs-exceptions.md @@ -97,7 +97,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md index 261b1771..cc7bb781 100644 --- a/doc_source/nodejs-image.md +++ b/doc_source/nodejs-image.md @@ -30,11 +30,11 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base images for Node\.js: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 16 | NodeJS 16\.x | Amazon Linux 2 | [Dockerfile for Node\.js 16\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs16.x/Dockerfile.nodejs16.x) | -| 14 | NodeJS 14\.x | Amazon Linux 2 | [Dockerfile for Node\.js 14\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | -| 12 | NodeJS 12\.x | Amazon Linux 2 | [Dockerfile for Node\.js 12\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| 16 | Node\.js 16 | Amazon Linux 2 | [Dockerfile for Node\.js 16 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs16.x/Dockerfile.nodejs16.x) | | +| 14 | Node\.js 14 | Amazon Linux 2 | [Dockerfile for Node\.js 14 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | +| 12 | Node\.js 12 | Amazon Linux 2 | [Dockerfile for Node\.js 12 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | Mar 31, 2023 | Amazon ECR repository: [gallery\.ecr\.aws/lambda/nodejs](https://gallery.ecr.aws/lambda/nodejs) diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md index 9027855e..288813ad 100644 --- a/doc_source/nodejs-logging.md +++ b/doc_source/nodejs-logging.md @@ -129,7 +129,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md index 8aee76f8..60fae7f4 100644 --- a/doc_source/nodejs-tracing.md +++ b/doc_source/nodejs-tracing.md @@ -1,52 +1,34 @@ # Instrumenting Node\.js code in AWS Lambda -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. +Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +To send tracing data to X\-Ray, you can use one of two SDK libraries: ++ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. ++ [AWS X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) – An SDK for generating and sending trace data to X\-Ray\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) +Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +**Important** +**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. -**To enable active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, enable **Active tracing**\. - -1. Choose **Save**\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. - -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -**Configuration** +**Topics** ++ [Using ADOT to instrument your Node\.js functions](#nodejs-adot) ++ [Using the X\-Ray SDK to instrument your Node\.js functions](#nodejs-xray-sdk) ++ [Activating tracing with the Lambda console](#nodejs-tracing-console) ++ [Activating tracing with the Lambda API](#nodejs-tracing-api) ++ [Activating tracing with AWS CloudFormation](#nodejs-tracing-cloudformation) ++ [Interpreting an X\-Ray trace](#nodejs-tracing-interpretation) ++ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#nodejs-tracing-layers) - The Lambda runtime sets some environment variables to configure the X\-Ray SDK, including `AWS_XRAY_CONTEXT_MISSING`\. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically\. For more information, see [Runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. +## Using ADOT to instrument your Node\.js functions -**Example initialization code** +ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. -``` -const AWSXRay = require('aws-xray-sdk-core'); +For Node\.js runtimes, you can add the **AWS managed Lambda layer for ADOT Javascript** to automatically instrument your functions\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for JavaScript](https://aws-otel.github.io/docs/getting-started/lambda/lambda-js) in the ADOT documentation\. -// Configure the context missing strategy to do nothing -AWSXRay.setContextMissingStrategy(() => {}); -``` +## Using the X\-Ray SDK to instrument your Node\.js functions -You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. +To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. **Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/package.json)** @@ -85,25 +67,42 @@ exports.handler = async function(event, context) { ... ``` -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +The Lambda runtime sets some environment variables to configure the X\-Ray SDK\. For example, Lambda sets `AWS_XRAY_CONTEXT_MISSING` to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +**Example initialization code** -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +``` +const AWSXRay = require('aws-xray-sdk-core'); -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) in the AWS X\-Ray Developer Guide\. +// Configure the context missing strategy to do nothing +AWSXRay.setContextMissingStrategy(() => {}); +``` -**Topics** -+ [Enabling active tracing with the Lambda API](#nodejs-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#nodejs-tracing-cloudformation) -+ [Storing runtime dependencies in a layer](#nodejs-tracing-layers) +For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. + +After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. + +## Activating tracing with the Lambda console + +To toggle active tracing on your Lambda function with the console, follow these steps: + +**To turn on active tracing** + +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. + +1. Choose **Edit**\. -## Enabling active tracing with the Lambda API +1. Under **X\-Ray**, toggle on **Active tracing**\. -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +1. Choose **Save**\. + +## Activating tracing with the Lambda API + +Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -115,9 +114,9 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. -## Enabling active tracing with AWS CloudFormation +## Activating tracing with AWS CloudFormation To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. @@ -146,11 +145,42 @@ Resources: ... ``` -## Storing runtime dependencies in a layer +## Interpreting an X\-Ray trace + +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. + +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) in the *AWS X\-Ray Developer Guide*\. + +**Pricing** +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. + +## Storing runtime dependencies in a layer \(X\-Ray SDK\) -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. -The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Node\.js\. +The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS X\-Ray SDK for Node\.js\. **Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** @@ -174,6 +204,6 @@ Resources: - nodejs12.x ``` -With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md index 00fb56d4..5c45022e 100644 --- a/doc_source/powershell-exceptions.md +++ b/doc_source/powershell-exceptions.md @@ -121,7 +121,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md index 5a322009..1d1ccb74 100644 --- a/doc_source/powershell-logging.md +++ b/doc_source/powershell-logging.md @@ -139,7 +139,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md index 9597a647..5739b5c8 100644 --- a/doc_source/provisioned-concurrency.md +++ b/doc_source/provisioned-concurrency.md @@ -188,8 +188,6 @@ In the following example, a function scales between a minimum and maximum amount Both of these alarms use the *average* statistic by default\. Functions that have traffic patterns of quick bursts may not trigger your provisioned concurrency to scale up\. For example, if your Lambda function executes quickly \(20–100 ms\) and your traffic pattern comes in quick bursts, this may cause incoming requests to exceed your allocated provisioned concurrency during the burst, but if the burst doesn’t last 3 minutes, auto scaling will not trigger\. Additionally, if CloudWatch doesn’t get three data points that hit the target average, the auto scaling policy will not trigger\. - If your scaling policy does not trigger and your provisioned concurrency does not scale, check that the alarms were triggered\. If not, deploy your function with a custom CloudWatch alarm set to use the *max* statistic\. - For more information on target tracking scaling policies, see [Target tracking scaling policies for Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. ### Scheduled scaling diff --git a/doc_source/python-context.md b/doc_source/python-context.md index 59f1d264..db7e05fd 100644 --- a/doc_source/python-context.md +++ b/doc_source/python-context.md @@ -1,8 +1,5 @@ # AWS Lambda context object in Python -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. **Context methods** diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md index fd9b07ee..eff25240 100644 --- a/doc_source/python-exceptions.md +++ b/doc_source/python-exceptions.md @@ -1,8 +1,5 @@ # AWS Lambda function errors in Python -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. @@ -76,7 +73,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md index e19cc90e..9e791118 100644 --- a/doc_source/python-handler.md +++ b/doc_source/python-handler.md @@ -1,8 +1,5 @@ # Lambda function handler in Python -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. You can use the following general syntax when creating a function handler in Python: @@ -39,7 +36,7 @@ Optionally, a handler can return a value\. What happens to the returned value de + If you use the `RequestResponse` invocation type, such as [Synchronous invocation](invocation-sync.md), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function on the console, the console will display the returned value\. + If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. + If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. -+ If you use an `Event` an [Asynchronous invocation](invocation-async.md) invocation type, the value is discarded\. ++ If you use the `Event` invocation type \(an [asynchronous invocation](invocation-async.md)\), the value is discarded\. **Note** In Python 3\.9 and later releases, Lambda includes the requestId of the invocation in the error response\. @@ -114,7 +111,27 @@ The function in this example depends on a successful response \(in `200`\) from ### Returning a calculation -The following example [Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. +The following example [ Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. + +``` +import logging + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +def lambda_handler(event, context): + ... + result = None + action = event.get('action') + if action == 'increment': + result = event.get('number', 0) + 1 + logger.info('Calculated result of %s', result) + else: + logger.error("%s is not a valid action.", action) + + response = {'result': result} + return response +``` You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): diff --git a/doc_source/python-image.md b/doc_source/python-image.md index 9d80c4e5..eee3c4f4 100644 --- a/doc_source/python-image.md +++ b/doc_source/python-image.md @@ -1,8 +1,5 @@ # Deploy Python Lambda functions with container images -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: + AWS base images for Lambda @@ -34,13 +31,11 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base images for Python: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 3, 3\.9 | Python 3\.9 | Amazon Linux 2 | [Dockerfile for Python 3\.9 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9) | -| 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | -| 3\.7 | Python 3\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | -| 3\.6 | Python 3\.6 | Amazon Linux 2018\.03 | [Dockerfile for Python 3\.6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.6/Dockerfile.python3.6) | -| 2, 2\.7 | Python 2\.7 | Amazon Linux 2018\.03 | [Dockerfile for Python 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python2.7/Dockerfile.python2.7) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| 3\.9 | Python 3\.9 | Amazon Linux 2 | [Dockerfile for Python 3\.9 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9) | | +| 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | | +| 3\.7 | Python 3\.7 | Amazon Linux | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | Amazon ECR repository: [gallery\.ecr\.aws/lambda/python](https://gallery.ecr.aws/lambda/python) @@ -69,15 +64,15 @@ If your function has dependencies, your local Python environment must match the ``` FROM public.ecr.aws/lambda/python:3.8 - # Copy function code - COPY app.py ${LAMBDA_TASK_ROOT} - # Install the function's dependencies using file requirements.txt # from your project folder. COPY requirements.txt . RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" + # Copy function code + COPY app.py ${LAMBDA_TASK_ROOT} + # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) CMD [ "app.handler" ] ``` diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md index cd833a4d..cfb9045d 100644 --- a/doc_source/python-logging.md +++ b/doc_source/python-logging.md @@ -1,8 +1,5 @@ # AWS Lambda function logging in Python -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. @@ -121,7 +118,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/python-package.md b/doc_source/python-package.md index 0f757e90..53275a61 100644 --- a/doc_source/python-package.md +++ b/doc_source/python-package.md @@ -1,8 +1,5 @@ # Deploy Python Lambda functions with \.zip file archives -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: @@ -102,7 +99,7 @@ Create the \.zip file for your deployment package\. ``` import requests def lambda_handler(event, context): - response = requests.get("https://www.test.com/") + response = requests.get("https://www.example.com/") print(response.text) return response.text ``` @@ -139,7 +136,7 @@ Create the \.zip file for your deployment package\. ``` cd .. - zip -g my-deployment-package.zip lambda_function.py + zip my-deployment-package.zip lambda_function.py ``` ## Using a virtual environment @@ -206,7 +203,7 @@ The following example uploads a file named my\-deployment\-package\.zip\. Use th { "FunctionName": "mylambdafunction", "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.8", + "Runtime": "python3.9", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Handler": "lambda_function.lambda_handler", "CodeSize": 5912988, diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md index 40775db9..99d9b228 100644 --- a/doc_source/python-tracing.md +++ b/doc_source/python-tracing.md @@ -1,53 +1,45 @@ # Instrumenting Python code in AWS Lambda -**Note** -End of support for the Python 2\.7 runtime started on July 15, 2021\. For more information, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. - -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. - -**To enable active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring tools**\. +Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. -1. Choose **Edit**\. +To send tracing data to X\-Ray, you can use one of two SDK libraries: ++ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. ++ [AWS X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) – An SDK for generating and sending trace data to X\-Ray\. -1. Under **X\-Ray**, enable **Active tracing**\. +Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. -1. Choose **Save**\. +**Important** +**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. +**Topics** ++ [Using ADOT to instrument your Python functions](#python-adot) ++ [Using the X\-Ray SDK to instrument your Python functions](#python-xray-sdk) ++ [Activating tracing with the Lambda console](#python-tracing-console) ++ [Activating tracing with the Lambda API](#python-tracing-api) ++ [Activating tracing with AWS CloudFormation](#python-tracing-cloudformation) ++ [Interpreting an X\-Ray trace](#python-tracing-interpretation) ++ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#python-tracing-layers) -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +## Using ADOT to instrument your Python functions -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. +For Python runtimes, you can add the **AWS managed Lambda layer for ADOT Python** to automatically instrument your functions\. This layer works for both arm64 and x86\_64 architectures\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for Python](https://aws-otel.github.io/docs/getting-started/lambda/lambda-python) in the ADOT documentation\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) +## Using the X\-Ray SDK to instrument your Python functions -You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. +To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. -**Example [blank\-python/function/requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/requirements.txt)** +**Example [requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/requirements.txt)** ``` jsonpickle==1.3 aws-xray-sdk==2.4.3 ``` -To instrument AWS SDK clients, patch the `boto3` library with the `aws_xray_sdk.core` module\. +In your function code, you can instrument AWS SDK clients by patching the `boto3` library with the `aws_xray_sdk.core` module\. -**Example [blank\-python/function/lambda\_function\.py](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py) – Tracing an AWS SDK client** +**Example [function – Tracing an AWS SDK client](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py)** ``` import boto3 @@ -66,25 +58,29 @@ def lambda_handler(event, context): ... ``` -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +## Activating tracing with the Lambda console -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +To toggle active tracing on your Lambda function with the console, follow these steps: -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the AWS X\-Ray Developer Guide\. +**To turn on active tracing** -**Topics** -+ [Enabling active tracing with the Lambda API](#python-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#python-tracing-cloudformation) -+ [Storing runtime dependencies in a layer](#python-tracing-layers) +1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. + +1. Choose a function\. + +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. -## Enabling active tracing with the Lambda API +1. Choose **Edit**\. + +1. Under **X\-Ray**, toggle on **Active tracing**\. + +1. Choose **Save**\. + +## Activating tracing with the Lambda API -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: +Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) + [CreateFunction](API_CreateFunction.md) @@ -96,9 +92,9 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. -## Enabling active tracing with AWS CloudFormation +## Activating tracing with AWS CloudFormation To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. @@ -127,11 +123,42 @@ Resources: ... ``` -## Storing runtime dependencies in a layer +## Interpreting an X\-Ray trace + +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. + +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) + +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. + +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + +You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the *AWS X\-Ray Developer Guide*\. + +**Pricing** +You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. + +## Storing runtime dependencies in a layer \(X\-Ray SDK\) -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. -The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Python\. +The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS X\-Ray SDK for Python\. **Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/template.yml) – Dependencies layer** @@ -155,6 +182,6 @@ Resources: - python3.8 ``` -With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md index 345344ea..f2b16ff5 100644 --- a/doc_source/ruby-exceptions.md +++ b/doc_source/ruby-exceptions.md @@ -98,7 +98,7 @@ aws lambda invoke \ --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. You should see the AWS CLI response in your command prompt: diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md index bba1956f..bf0fdb00 100644 --- a/doc_source/ruby-handler.md +++ b/doc_source/ruby-handler.md @@ -36,4 +36,4 @@ The two objects that the handler accepts are the invocation event and context\. The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [AWS Lambda execution environment](lambda-runtime-environment.md)\. \ No newline at end of file +Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [Lambda execution environment](lambda-runtime-environment.md)\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md index b8602556..802fb8eb 100644 --- a/doc_source/ruby-image.md +++ b/doc_source/ruby-image.md @@ -31,10 +31,9 @@ The workflow for a function defined as a container image includes these steps: AWS provides the following base images for Ruby: -| Tags | Runtime | Operating system | Dockerfile | -| --- | --- | --- | --- | -| 2, 2\.7 | Ruby 2\.7 | Amazon Linux 2 | [Dockerfile for Ruby 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.7/Dockerfile.ruby2.7) | -| 2\.5 | Ruby 2\.5 | Amazon Linux 2018\.03 | [Dockerfile for Ruby 2\.5 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.5/Dockerfile.ruby2.5) | +| Tags | Runtime | Operating system | Dockerfile | Deprecation | +| --- | --- | --- | --- | --- | +| 2\.7 | Ruby 2\.7 | Amazon Linux 2 | [Dockerfile for Ruby 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.7/Dockerfile.ruby2.7) | | Amazon ECR repository: [gallery\.ecr\.aws/lambda/ruby](https://gallery.ecr.aws/lambda/ruby) diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md index 9376cf77..4a0ecdfa 100644 --- a/doc_source/ruby-logging.md +++ b/doc_source/ruby-logging.md @@ -151,7 +151,7 @@ The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https **Example get\-logs\.sh script** In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ``` #!/bin/bash diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md index f40b734a..cde7383d 100644 --- a/doc_source/ruby-tracing.md +++ b/doc_source/ruby-tracing.md @@ -2,37 +2,49 @@ Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. -The X\-Ray *service map* shows the flow of requests through your application\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon S3 and Amazon CloudWatch Logs\. +After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +To toggle active tracing on your Lambda function with the console, follow these steps: -**To enable active tracing** +**To turn on active tracing** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Configuration** and then choose **Monitoring tools**\. +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. 1. Choose **Edit**\. -1. Under **X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, toggle on **Active tracing**\. 1. Choose **Save**\. **Pricing** You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. -When active tracing is enabled, Lambda records a trace for a subset of invocations\. Lambda records two *segments*, which creates two nodes on the service map\. The first node represents the Lambda service that receives the invocation request\. The second node is recorded by the function's [runtime](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. + +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. ![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) + +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. + You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. **Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/Gemfile)** @@ -65,14 +77,18 @@ def lambda_handler(event:, context:) ... ``` -The following example shows a trace with 2 segments\. Both are named **my\-function**, but one is type `AWS::Lambda` and the other is `AWS::Lambda::Function`\. The function segment is expanded to show its subsegments\. +When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) + +The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) -The first segment represents the invocation request processed by the Lambda service\. The second segment records the work done by your function\. The function segment has 3 subsegments\. -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event processed by each instance of your function\. -+ **Invocation** – Represents the work done by your handler code\. By instrumenting your code, you can extend this subsegment with additional subsegments\. -+ **Overhead** – Represents the work done by the Lambda runtime to prepare to handle the next event\. +This example expands the function segment to show its three subsegments: ++ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. ++ **Invocation** – Represents the time spent running your handler code\. ++ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Ruby](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-ruby.html) in the AWS X\-Ray Developer Guide\. @@ -95,7 +111,7 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. ## Enabling active tracing with AWS CloudFormation @@ -128,7 +144,7 @@ Resources: ## Storing runtime dependencies in a layer -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your functions code, package them in a [Lambda layer](configuration-layers.md)\. +If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. @@ -154,6 +170,6 @@ Resources: - ruby2.5 ``` -With this configuration, you update the library layer only if you change your runtime dependencies\. The function deployment package contains only your code\. When you update your function code, upload time is much faster than if you include dependencies in the deployment package\. +With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md index 484cd1a6..c09138da 100644 --- a/doc_source/runtimes-extensions-api.md +++ b/doc_source/runtimes-extensions-api.md @@ -2,7 +2,7 @@ Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, [AWS Partners](extensions-api-partners.md), and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/aws/getting-started-with-using-your-favorite-operational-tools-on-aws-lambda-extensions-are-now-generally-available/) on the AWS Compute Blog\. -![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-concept-diagram.png) As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](lambda-runtime-environment.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. @@ -10,7 +10,7 @@ An extension runs as an independent process in the execution environment and can Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. -You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](using-extensions.md#invocation-extensions-images) to your container image\. +You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](extensions-configuration.md#invocation-extensions-images) to your container image\. **Note** For example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. @@ -193,8 +193,9 @@ Internal extensions are started and stopped by the runtime process, so they are **Method** – **POST** **Headers** - -`Lambda-Extension-Name` – The full file name of the extension\. Required: yes\. Type: string\. ++ `Lambda-Extension-Name` – The full file name of the extension\. Required: yes\. Type: string\. ++ `Lambda-Extension-Accept-Feature` – Use this to specify optional Extensions features during registration\. Required: no\. Type: comma separated string\. Features available to specify using this setting: + + `accountId` – If specified, the Extension registration response will contain the account ID associated with the Lambda function that you're registering the Extension for\. **Body parameters ** @@ -227,6 +228,17 @@ Internal extensions are started and stopped by the runtime process, so they are } ``` +**Example response body with optional accountId feature** + +``` +{ + "functionName": "helloWorld", + "functionVersion": "$LATEST", + "handler": "lambda_function.lambda_handler", + "accountId": "123456789012" +} +``` + ### Next Extensions send a `Next` API request to receive the next event, which can be an `Invoke` event or a `Shutdown` event\. The response body contains the payload, which is a JSON document that contains event data\. diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md index 37a9082c..02953e21 100644 --- a/doc_source/runtimes-logs-api.md +++ b/doc_source/runtimes-logs-api.md @@ -1,5 +1,8 @@ # Lambda Logs API +**Important** +The Lambda Telemetry API supersedes the Lambda Logs API\. **While the Logs API remains fully functional, we recommend using only the Telemetry API going forward\.** You can subscribe your extension to a telemetry stream using either the Telemetry API or the Logs API\. After subscribing using one of these APIs, any attempt to subscribe using the other API returns an error\. + Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. [Lambda extensions](runtimes-extensions-api.md) can use the Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda [execution environment](lambda-runtime-environment.md)\. Lambda streams the logs to the extension, and the extension can then process, filter, and send the logs to any preferred destination\. @@ -78,7 +81,7 @@ During buffering configuration, note the following points: The following example shows a request to subscribe to the platform and function logs\. ``` -PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ HTTP/1.1 +PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs HTTP/1.1 { "schemaVersion": "2020-08-15", "types": [ "platform", @@ -114,7 +117,7 @@ For Python and Go code examples showing how to develop a basic Lambda extension You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: ``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs/ +http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs ``` The OpenAPI specification for the Logs API version **2020\-08\-15** is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md index 46fcb149..cd2f7d25 100644 --- a/doc_source/runtimes-modify.md +++ b/doc_source/runtimes-modify.md @@ -1,6 +1,6 @@ # Modifying the runtime environment -You can use [internal extensions](using-extensions.md) to modify the runtime process\. Internal extensions are not separate processes—they run as part of the runtime process\. +You can use [internal extensions](lambda-extensions.md) to modify the runtime process\. Internal extensions are not separate processes—they run as part of the runtime process\. Lambda provides language\-specific [environment variables](configuration-envvars.md) that you can set to add options and tools to the runtime\. Lambda also provides [wrapper scripts](#runtime-wrapper), which allow Lambda to delegate the runtime startup to your script\. You can create a wrapper script to customize the runtime startup behavior\. @@ -151,6 +151,8 @@ The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: + Ruby 2\.7 + Java 11 + Java 8 \(`java8.al2`\) ++ \.NET 6 ++ \.NET 5 + \.NET Core 3\.1 When you use a wrapper script for your function, Lambda starts the runtime using your script\. Lambda sends to your script the path to the interpreter and all of the original arguments for the standard runtime startup\. Your script can extend or transform the startup behavior of the program\. For example, the script can inject and alter arguments, set environment variables, or capture metrics, errors, and other diagnostic information\. diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md index e942a02b..7b10e1fc 100644 --- a/doc_source/runtimes-walkthrough.md +++ b/doc_source/runtimes-walkthrough.md @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. You need an IAM role to create a Lambda function\. The role needs permission to send logs to CloudWatch Logs and access the AWS services that your function uses\. If you don't have a role for function development, create one now\. diff --git a/doc_source/sdk-general-information-section.md b/doc_source/sdk-general-information-section.md new file mode 100644 index 00000000..40d3ebcc --- /dev/null +++ b/doc_source/sdk-general-information-section.md @@ -0,0 +1,23 @@ +# Using Lambda with an AWS SDK + +AWS software development kits \(SDKs\) are available for many popular programming languages\. Each SDK provides an API, code examples, and documentation that make it easier for developers to build applications in their preferred language\. + + +| SDK documentation | Code examples | +| --- | --- | +| [AWS SDK for C\+\+](https://docs.aws.amazon.com/sdk-for-cpp) | [AWS SDK for C\+\+ code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp) | +| [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go) | [AWS SDK for Go code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2) | +| [AWS SDK for Java](https://docs.aws.amazon.com/sdk-for-java) | [AWS SDK for Java code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2) | +| [AWS SDK for JavaScript](https://docs.aws.amazon.com/sdk-for-javascript) | [AWS SDK for JavaScript code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3) | +| [AWS SDK for Kotlin](https://docs.aws.amazon.com/sdk-for-kotlin) | [AWS SDK for Kotlin code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin) | +| [AWS SDK for \.NET](https://docs.aws.amazon.com/sdk-for-net) | [AWS SDK for \.NET code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3) | +| [AWS SDK for PHP](https://docs.aws.amazon.com/sdk-for-php) | [AWS SDK for PHP code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/php) | +| [AWS SDK for Python \(Boto3\)](https://docs.aws.amazon.com/pythonsdk) | [AWS SDK for Python \(Boto3\) code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python) | +| [AWS SDK for Ruby](https://docs.aws.amazon.com/sdk-for-ruby) | [AWS SDK for Ruby code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/ruby) | +| [AWS SDK for Rust](https://docs.aws.amazon.com/sdk-for-rust) | [AWS SDK for Rust code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rust_dev_preview) | +| [AWS SDK for Swift](https://docs.aws.amazon.com/sdk-for-swift) | [AWS SDK for Swift code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/swift) | + +For examples specific to Lambda, see [Code examples for Lambda using AWS SDKs](service_code_examples.md)\. + +**Example availability** +Can't find what you need? Request a code example by using the **Provide feedback** link at the bottom of this page\. \ No newline at end of file diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md index 95765510..bddfe611 100644 --- a/doc_source/security-iam.md +++ b/doc_source/security-iam.md @@ -16,7 +16,7 @@ How you use AWS Identity and Access Management \(IAM\) differs, depending on the **Service user** – If you use the Lambda service to do your job, then your administrator provides you with the credentials and permissions that you need\. As you use more Lambda features to do your work, you might need additional permissions\. Understanding how access is managed can help you request the right permissions from your administrator\. If you cannot access a feature in Lambda, see [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md)\. -**Service administrator** – If you're in charge of Lambda resources at your company, you probably have full access to Lambda\. It's your job to determine which Lambda features and resources your employees should access\. You must then submit requests to your IAM administrator to change the permissions of your service users\. Review the information on this page to understand the basic concepts of IAM\. To learn more about how your company can use IAM with Lambda, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. +**Service administrator** – If you're in charge of Lambda resources at your company, you probably have full access to Lambda\. It's your job to determine which Lambda features and resources your service users should access\. You must then submit requests to your IAM administrator to change the permissions of your service users\. Review the information on this page to understand the basic concepts of IAM\. To learn more about how your company can use IAM with Lambda, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. **IAM administrator** – If you're an IAM administrator, you might want to learn details about how you can write policies to manage access to Lambda\. To view example Lambda identity\-based policies that you can use in IAM, see [AWS Lambda identity\-based policy examples](security_iam_id-based-policy-examples.md)\. @@ -32,7 +32,7 @@ Regardless of the authentication method that you use, you might also be required ### AWS account root user - When you first create an AWS account, you begin with a single sign\-in identity that has complete access to all AWS services and resources in the account\. This identity is called the AWS account *root user* and is accessed by signing in with the email address and password that you used to create the account\. We strongly recommend that you do not use the root user for your everyday tasks, even the administrative ones\. Instead, adhere to the [best practice of using the root user only to create your first IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)\. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks\. + When you create an AWS account, you begin with one sign\-in identity that has complete access to all AWS services and resources in the account\. This identity is called the AWS account *root user* and is accessed by signing in with the email address and password that you used to create the account\. We strongly recommend that you do not use the root user for your everyday tasks\. Safeguard your root user credentials and use them to perform the tasks that only the root user can perform\. For the complete list of tasks that require you to sign in as the root user, see [Tasks that require root user credentials](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root) in the *AWS General Reference*\. ### IAM users and groups @@ -48,7 +48,7 @@ An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* IAM roles with temporary credentials are useful in the following situations: + **Temporary IAM user permissions** – An IAM user can assume an IAM role to temporarily take on different permissions for a specific task\. -+ **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, or a web identity provider\. These are known as *federated users*\. AWS assigns a role to a federated user when access is requested through an [identity provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)\. For more information about federated users, see [Federated users and roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_access-management.html#intro-access-roles) in the *IAM User Guide*\. ++ **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, a web identity provider, or the IAM Identity Center identity store\. These identities are known as *federated identities*\. To assign permissions to federated identities, you can create a role and define permissions for the role\. When an external identity authenticates, the identity is associated with the role and is granted the permissions that are defined by it\. If you use IAM Identity Center, you configure a permission set\. IAM Identity Center correlates the permission set to a role in IAM to control what your identities can access after they authenticate\. For more information about identity federation, see [ Creating a role for a third\-party Identity Provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp.html) in the *IAM User Guide*\. For more information about IAM Identity Center, see [ What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *AWS IAM Identity Center \(successor to AWS Single Sign\-On\) User Guide*\. + **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. + **Cross\-service access** – Some AWS services use features in other AWS services\. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3\. A service might do this using the calling principal's permissions, using a service role, or using a service\-linked role\. + **Principal permissions** – When you use an IAM user or role to perform actions in AWS, you are considered a principal\. Policies grant permissions to a principal\. When you use some services, you might perform an action that then triggers another action in a different service\. In this case, you must have permissions to perform both actions\. To see whether an action requires additional dependent actions in a policy, see [Actions, Resources, and Condition Keys for AWS Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) in the *Service Authorization Reference*\. @@ -60,11 +60,11 @@ To learn whether to use IAM roles or IAM users, see [When to create an IAM role ## Managing access using policies -You control access in AWS by creating policies and attaching them to IAM identities or AWS resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. You can sign in as the root user or an IAM user, or you can assume an IAM role\. When you then make a request, AWS evaluates the related identity\-based or resource\-based policies\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. +You control access in AWS by creating policies and attaching them to AWS identities or resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. AWS evaluates these policies when a principal \(user, root user, or role session\) makes a request\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. Administrators can use AWS JSON policies to specify who has access to what\. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**\. -Every IAM entity \(user or role\) starts with no permissions\. In other words, by default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. +Every IAM entity \(user or role\) starts with no permissions\. By default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. IAM policies define permissions for an action regardless of the method that you use to perform the operation\. For example, suppose that you have a policy that allows the `iam:GetRole` action\. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API\. diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md index 413ea770..c64bbf4b 100644 --- a/doc_source/security_iam_id-based-policy-examples.md +++ b/doc_source/security_iam_id-based-policy-examples.md @@ -11,11 +11,14 @@ To learn how to create an IAM identity\-based policy using these example JSON po ## Policy best practices -Identity\-based policies are very powerful\. They determine whether someone can create, access, or delete Lambda resources in your account\. These actions can incur costs for your AWS account\. When you create or edit identity\-based policies, follow these guidelines and recommendations: -+ **Get started using AWS managed policies** – To start using Lambda quickly, use AWS managed policies to give your employees the permissions they need\. These policies are already available in your account and are maintained and updated by AWS\. For more information, see [Get started using permissions with AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-use-aws-defined-policies) in the *IAM User Guide*\. -+ **Grant least privilege** – When you create custom policies, grant only the permissions required to perform a task\. Start with a minimum set of permissions and grant additional permissions as necessary\. Doing so is more secure than starting with permissions that are too lenient and then trying to tighten them later\. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) in the *IAM User Guide*\. -+ **Enable MFA for sensitive operations** – For extra security, require IAM users to use multi\-factor authentication \(MFA\) to access sensitive resources or API operations\. For more information, see [Using multi\-factor authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. -+ **Use policy conditions for extra security** – To the extent that it's practical, define the conditions under which your identity\-based policies allow access to a resource\. For example, you can write conditions to specify a range of allowable IP addresses that a request must come from\. You can also write conditions to allow requests only within a specified date or time range, or to require the use of SSL or MFA\. For more information, see [IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. +Identity\-based policies determine whether someone can create, access, or delete Lambda resources in your account\. These actions can incur costs for your AWS account\. When you create or edit identity\-based policies, follow these guidelines and recommendations: ++ **Get started with AWS managed policies and move toward least\-privilege permissions** – To get started granting permissions to your users and workloads, use the *AWS managed policies* that grant permissions for many common use cases\. They are available in your AWS account\. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases\. For more information, see [AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies) or [AWS managed policies for job functions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html) in the *IAM User Guide*\. ++ **Apply least\-privilege permissions** – When you set permissions with IAM policies, grant only the permissions required to perform a task\. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as *least\-privilege permissions*\. For more information about using IAM to apply permissions, see [ Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*\. ++ **Use conditions in IAM policies to further restrict access** – You can add a condition to your policies to limit access to actions and resources\. For example, you can write a policy condition to specify that all requests must be sent using SSL\. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation\. For more information, see [ IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. ++ **Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions** – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language \(JSON\) and IAM best practices\. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies\. For more information, see [IAM Access Analyzer policy validation](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html) in the *IAM User Guide*\. ++ **Require multi\-factor authentication \(MFA\)** – If you have a scenario that requires IAM users or root users in your account, turn on MFA for additional security\. To require MFA when API operations are called, add MFA conditions to your policies\. For more information, see [ Configuring MFA\-protected API access](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html) in the *IAM User Guide*\. + +For more information about best practices in IAM, see [Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM User Guide*\. ## Using the Lambda console diff --git a/doc_source/security_iam_service-with-iam.md b/doc_source/security_iam_service-with-iam.md index 661aec29..842650e0 100644 --- a/doc_source/security_iam_service-with-iam.md +++ b/doc_source/security_iam_service-with-iam.md @@ -2,4 +2,4 @@ Before you use IAM to manage access to Lambda, you should understand what IAM features are available to use with Lambda\. To get a high\-level view of how Lambda and other AWS services work with IAM, see [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*\. -For an overview of permissions, policies, and roles as they are used by Lambda, see [AWS Lambda permissions](lambda-permissions.md)\. \ No newline at end of file +For an overview of permissions, policies, and roles as they are used by Lambda, see [Lambda permissions](lambda-permissions.md)\. \ No newline at end of file diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md index a4ca44a0..89e509bf 100644 --- a/doc_source/security_iam_troubleshoot.md +++ b/doc_source/security_iam_troubleshoot.md @@ -24,17 +24,19 @@ In this case, Mateo asks his administrator to update his policies to allow him t ## I am not authorized to perform iam:PassRole -If you receive an error that you're not authorized to perform the `iam:PassRole` action, then you must contact your administrator for assistance\. Your administrator is the person that provided you with your user name and password\. Ask that person to update your policies to allow you to pass a role to Lambda\. +If you receive an error that you're not authorized to perform the `iam:PassRole` action, your policies must be updated to allow you to pass a role to Lambda\. -Some AWS services allow you to pass an existing role to that service, instead of creating a new service role or service\-linked role\. To do this, you must have permissions to pass the role to the service\. +Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service\-linked role\. To do this, you must have permissions to pass the role to the service\. -The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Lambda\. However, the action requires the service to have permissions granted by a service role\. Mary does not have permissions to pass the role to the service\. +The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Lambda\. However, the action requires the service to have permissions that are granted by a service role\. Mary does not have permissions to pass the role to the service\. ``` User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole ``` -In this case, Mary asks her administrator to update her policies to allow her to perform the `iam:PassRole` action\. +In this case, Mary's policies must be updated to allow her to perform the `iam:PassRole` action\. + +If you need help, contact your AWS administrator\. Your administrator is the person who provided you with your sign\-in credentials\. ## I want to view my access keys diff --git a/doc_source/service_code_examples.md b/doc_source/service_code_examples.md new file mode 100644 index 00000000..2a10d86c --- /dev/null +++ b/doc_source/service_code_examples.md @@ -0,0 +1,37 @@ +# Code examples for Lambda using AWS SDKs + +The following code examples show how to use Lambda with an AWS software development kit \(SDK\)\. + +The examples are divided into the following categories: + +**Actions** +Code excerpts that show you how to call individual service functions\. + +**Scenarios** +Code examples that show you how to accomplish a specific task by calling multiple functions within the same service\. + +**Cross\-service examples** +Sample applications that work across multiple AWS services\. + +For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. + +**Contents** ++ [Actions](service_code_examples_actions.md) + + [Create a function](example_lambda_CreateFunction_section.md) + + [Delete a function](example_lambda_DeleteFunction_section.md) + + [Get a function](example_lambda_GetFunction_section.md) + + [Invoke a function](example_lambda_Invoke_section.md) + + [List functions](example_lambda_ListFunctions_section.md) + + [Update function code](example_lambda_UpdateFunctionCode_section.md) + + [Update function configuration](example_lambda_UpdateFunctionConfiguration_section.md) ++ [Scenarios](service_code_examples_scenarios.md) + + [Get started with functions](example_lambda_Scenario_GettingStartedFunctions_section.md) ++ [Cross\-service examples](service_code_examples_cross-service_examples.md) + + [Create a REST API to track COVID\-19 data](example_cross_ApiGatewayDataTracker_section.md) + + [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) + + [Create a messenger application](example_cross_StepFunctionsMessenger_section.md) + + [Create a websocket chat application](example_cross_ApiGatewayWebsocketChat_section.md) + + [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) + + [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) + + [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) + + [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_actions.md b/doc_source/service_code_examples_actions.md new file mode 100644 index 00000000..2e76c5e5 --- /dev/null +++ b/doc_source/service_code_examples_actions.md @@ -0,0 +1,14 @@ +# Actions for Lambda using AWS SDKs + +The following code examples demonstrate how to perform individual Lambda actions with AWS SDKs\. These excerpts call the Lambda API and are not intended to be run in isolation\. Each example includes a link to GitHub, where you can find instructions on how to set up and run the code in context\. + + The following examples include only the most commonly used actions\. For a complete list, see the [AWS Lambda API Reference](https://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html)\. + +**Topics** ++ [Create a function](example_lambda_CreateFunction_section.md) ++ [Delete a function](example_lambda_DeleteFunction_section.md) ++ [Get a function](example_lambda_GetFunction_section.md) ++ [Invoke a function](example_lambda_Invoke_section.md) ++ [List functions](example_lambda_ListFunctions_section.md) ++ [Update function code](example_lambda_UpdateFunctionCode_section.md) ++ [Update function configuration](example_lambda_UpdateFunctionConfiguration_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_cross-service_examples.md b/doc_source/service_code_examples_cross-service_examples.md new file mode 100644 index 00000000..c604cd2a --- /dev/null +++ b/doc_source/service_code_examples_cross-service_examples.md @@ -0,0 +1,13 @@ +# Cross\-service examples for Lambda using AWS SDKs + +The following sample applications use AWS SDKs to combine Lambda with other AWS services\. Each example includes a link to GitHub, where you can find instructions on how to set up and run the application\. + +**Topics** ++ [Create a REST API to track COVID\-19 data](example_cross_ApiGatewayDataTracker_section.md) ++ [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) ++ [Create a messenger application](example_cross_StepFunctionsMessenger_section.md) ++ [Create a websocket chat application](example_cross_ApiGatewayWebsocketChat_section.md) ++ [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) ++ [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) ++ [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) ++ [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_scenarios.md b/doc_source/service_code_examples_scenarios.md new file mode 100644 index 00000000..d95ea6b0 --- /dev/null +++ b/doc_source/service_code_examples_scenarios.md @@ -0,0 +1,6 @@ +# Scenarios for Lambda using AWS SDKs + +The following code examples show you how to implement common scenarios in Lambda with AWS SDKs\. These scenarios show you how to accomplish specific tasks by calling multiple functions within Lambda\. Each scenario includes a link to GitHub, where you can find instructions on how to set up and run the code\. + +**Topics** ++ [Get started with functions](example_lambda_Scenario_GettingStartedFunctions_section.md) \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md index cba4383f..6f64ed33 100644 --- a/doc_source/services-apigateway-tutorial.md +++ b/doc_source/services-apigateway-tutorial.md @@ -43,7 +43,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create an execution role @@ -108,15 +111,13 @@ Create an [execution role](lambda-intro-execution-role.md)\. This AWS Identity a 1. For the use case, choose **Lambda**\. -1. Choose **Next: Permissions**\. +1. Choose **Next**\. 1. In the policy search box, enter **lambda\-apigateway\-policy**\. -1. In the search results, select the policy that you created \(`lambda-apigateway-policy`\), and then choose **Next: Tags**\. - -1. Choose **Next: Review**\. +1. In the search results, select the policy that you created \(`lambda-apigateway-policy`\), and then choose **Next**\. -1. Under **Review**, for the **Role name**, enter **lambda\-apigateway\-role**\. +1. Under **Role details**, for the **Role name**, enter **lambda\-apigateway\-role**\. 1. Choose **Create role**\. @@ -265,62 +266,6 @@ def handler(event, context): --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role ``` ------- -#### [ Go ] - -**Example LambdaFunctionOverHttps\.go** - -``` -package main - -import ( - "context" - "fmt" - "github.com/aws/aws-lambda-go/events" - runtime "github.com/aws/aws-lambda-go/lambda" -) - -func main() { - runtime.Start(handleRequest) -} - -func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) - fmt.Printf("Body size = %d.\n", len(request.Body)) - - fmt.Println("Headers:") - for key, value := range request.Headers { - fmt.Printf(" %s: %s\n", key, value) - } - - return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil -} -``` - -**To create the function** - -1. Save the code example as a file named `LambdaFunctionOverHttps.go`\. - -1. Compile your executable\. - - ``` - GOOS=linux go build LambdaFunctionOverHttps.go - ``` - -1. Create a deployment package\. - - ``` - zip function.zip LambdaFunctionOverHttps - ``` - -1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. - - ``` - aws lambda create-function --function-name LambdaFunctionOverHttps \ - --zip-file fileb://function.zip --handler LambdaFunctionOverHttps --runtime go1.x \ - --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role - ``` - ------ ## Test the function @@ -341,14 +286,14 @@ Test the Lambda function manually using the following sample event data\. You ca } ``` -1. Run the following `invoke` AWS CLI command: +1. Run the following `invoke` AWS CLI command\. ``` aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload file://input.txt outputfile.txt + --payload file://input.txt outputfile.txt --cli-binary-format raw-in-base64-out ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/services-ec2-tutorial.md b/doc_source/services-ec2-tutorial.md deleted file mode 100644 index d19a6f3f..00000000 --- a/doc_source/services-ec2-tutorial.md +++ /dev/null @@ -1,311 +0,0 @@ -# Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances - -You can use the AWS SDK for \.NET to manage Amazon EC2 spot instances with C\# code\. The SDK enables you to use the Amazon EC2 API to create spot instance requests, determine when the request is fulfilled, delete requests, and identify the instances created\. - -This tutorial provides code that performs these tasks and a sample application that you can run locally or on AWS\. It includes a sample project that you can deploy to AWS Lambda's \.NET Core 2\.1 runtime\. - -For more information about spot instances usage and best practices, see [Spot Instances](https://docs.aws.amazon.com/AWSEC2/latest/DeveloperGuide/using-spot-instances.html) in the Amazon EC2 user guide\. - - - -## Prerequisites - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. - -This tutorial uses code from the developer guide's GitHub repository\. The repository also contains helper scripts and configuration files that are needed to follow its procedures\. Clone the repository at [github\.com/awsdocs/aws\-lambda\-developer\-guide](https://github.com/awsdocs/aws-lambda-developer-guide)\. - -To use the sample code you need the following tools: -+ **AWS CLI** – To deploy the sample application to AWS, install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. The AWS CLI also provides credentials to the sample code when you run it locally\. -+ **\.NET Core CLI** – To run and test the code locally, install the [\.NET Core SDK 2\.1](https://dotnet.microsoft.com/download/dotnet-core/2.1)\. -+ **Lambda \.NET Core Global Tool** – To build the deployment package for Lambda, install the [\.NET Core global tool](https://dotnet.microsoft.com/download/dotnet-core/2.1) with the \.NET Core CLI\. - - ``` - dotnet tool install -g [Amazon\.Lambda\.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) - ``` - -The code in this tutorial manages spot requests that launch Amazon EC2 instances\. To run the code locally, you need SDK credentials with permission to use the following APIs\. -+ `ec2:RequestSpotInstance` -+ `ec2:GetSpotRequestState` -+ `ec2:CancelSpotRequest` -+ `ec2:TerminateInstances` - -To run the sample application in AWS, you need [permission to use Lambda](lambda-permissions.md) and the following services\. -+ [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) \([pricing](https://aws.amazon.com/cloudformation/pricing/)\) -+ [Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policies-for-amazon-ec2.html) \([pricing](https://aws.amazon.com/ec2/pricing/)\) - -Standard charges apply for each service\. - -## Review the code - -Locate the sample project in the guide repository under [sample\-apps/ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/sample-apps/ec2-spot)\. This directory contains Lambda function code, tests, project files, scripts, and a AWS CloudFormation template\. - -The `Function` class includes a `FunctionHandler` method that calls other methods to create spot requests, check their status, and clean up\. It creates an Amazon EC2 client with the AWS SDK for \.NET in a static constructor to allow it to be used throughout the class\. - -**Example [Function\.cs – FunctionHandler](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L17)** - -``` -using Amazon.EC2; -... - public class Function - { - private static AmazonEC2Client ec2Client; - - static Function() { - AWSSDKHandler.RegisterXRayForAllServices(); - ec2Client = new AmazonEC2Client(); - } - - public async Task FunctionHandler(Dictionary input, ILambdaContext context) - { - // More AMI IDs: [amazon\-linux\-2/release\-notes/](http://aws.amazon.com/amazon-linux-2/release-notes/) - // us-east-2 HVM EBS-Backed 64-bit Amazon Linux 2 - string ami = "ami-09d9edae5eb90d556"; - string sg = "default"; - [InstanceType](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/TInstanceType.html) type = InstanceType.T3aNano; - string price = "0.003"; - int count = 1; - var requestSpotInstances = await RequestSpotInstance(ami, sg, type, price, count); - var spotRequestId = requestSpotInstances.SpotInstanceRequests[0].SpotInstanceRequestId; -``` - -The `RequestSpotInstance` method creates a spot instance request\. - -**Example [Function\.cs – RequestSpotInstance](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/sample-apps/ec2-spot/src/ec2spot/Function.cs#L59)** - -``` -using Amazon; -using Amazon.Util; -using Amazon.EC2; -using Amazon.EC2.Model; -... - public async Task RequestSpotInstance( - string amiId, - string securityGroupName, - InstanceType instanceType, - string spotPrice, - int instanceCount) - { - var request = new RequestSpotInstancesRequest(); - - var launchSpecification = new [LaunchSpecification](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotLaunchSpecification.html)(); - launchSpecification.ImageId = amiId; - launchSpecification.InstanceType = instanceType; - launchSpecification.SecurityGroups.Add(securityGroupName); - - request.SpotPrice = spotPrice; - request.InstanceCount = instanceCount; - request.LaunchSpecification = launchSpecification; - - RequestSpotInstancesResponse response = await ec2Client.RequestSpotInstancesAsync(request); - - return response; - } -... -``` - -Next, you need to wait until the spot request reaches the `Active` state before proceeding to the last step\. To determine the state of your spot request, use the [DescribeSpotInstanceRequests](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/TDescribeSpotInstanceRequestsRequest.html) method to obtain the state of the spot request ID to monitor\. - -``` -public async Task GetSpotRequest(string spotRequestId) -{ - var request = new DescribeSpotInstanceRequestsRequest(); - request.SpotInstanceRequestIds.Add(spotRequestId); - - var describeResponse = await ec2Client.DescribeSpotInstanceRequestsAsync(request); - - return describeResponse.SpotInstanceRequests[0]; -} -``` - -The final step is to clean up your requests and instances\. It is important to both cancel any outstanding requests and terminate any instances\. Just canceling your requests will not terminate your instances, which means that you will continue to be charged for them\. If you terminate your instances, your Spot requests may be canceled, but there are some scenarios, such as if you use persistent requests, where terminating your instances is not sufficient to stop your request from being re\-fulfilled\. Therefore, it is a best practice to both cancel any active requests and terminate any running instances\. - -You use the [CancelSpotInstanceRequests](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/MEC2CancelSpotInstanceRequestsCancelSpotInstanceRequestsRequest.html) method to cancel a Spot request\. The following example demonstrates how to cancel a Spot request\. - -``` -public async Task CancelSpotRequest(string spotRequestId) -{ - Console.WriteLine("Canceling request " + spotRequestId); - var cancelRequest = new CancelSpotInstanceRequestsRequest(); - cancelRequest.SpotInstanceRequestIds.Add(spotRequestId); - - await ec2Client.CancelSpotInstanceRequestsAsync(cancelRequest); -} -``` - -You use the [TerminateInstances](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/EC2/MEC2TerminateInstancesTerminateInstancesRequest.html) method to terminate an instance\. - -``` -public async Task TerminateSpotInstance(string instanceId) -{ - Console.WriteLine("Terminating instance " + instanceId); - var terminateRequest = new TerminateInstancesRequest(); - terminateRequest.InstanceIds = new List() { instanceId }; - try - { - var terminateResponse = await ec2Client.TerminateInstancesAsync(terminateRequest); - } - catch (AmazonEC2Exception ex) - { - // Check the ErrorCode to see if the instance does not exist. - if ("InvalidInstanceID.NotFound" == ex.ErrorCode) - { - Console.WriteLine("Instance {0} does not exist.", instanceId); - } - else - { - // The exception was thrown for another reason, so re-throw the exception. - throw; - } - } -} -``` - -## Run the code locally - -Run the code on your local machine to create a spot instance request\. After the request is fulfilled, the code deletes the request and terminates the instance\. - -**To run the application code** - -1. Navigate to the `ec2Spot.Tests` directory\. - - ``` - cd test/ec2Spot.Tests - ``` - -1. Use the \.NET CLI to run the project's unit tests\. - - ``` - dotnet test - ``` - - You should see the following output: - - ``` - Starting test execution, please wait... - sir-x5tgs5ij - open - open - open - open - open - active - Canceling request sir-x5tgs5ij - Terminating instance i-0b3fdff0e12e0897e - Complete - - Test Run Successful. - Total tests: 1 - Passed: 1 - Total time: 7.6060 Seconds - ``` - -The unit test invokes the FunctionHandler method to create a spot instance request, monitor it, and clean up\. It is implemented in the [xUnit\.net](https://xunit.net/) testing framework\. - -## Deploy the application - -Run the code in Lambda as a starting point for creating a serverless application\. - -**To deploy and test the application** - -1. Set your region to `us-east-2`\. - - ``` - export AWS_DEFAULT_REGION=us-east-2 - ``` - -1. Create a bucket for deployment artifacts\. - - ``` - ./create-bucket.sh - ``` - - You should see the following output: - - ``` - make_bucket: lambda-artifacts-63d5cbbf18fa5ecc - ``` - -1. Create a deployment package and deploy the application\. - - ``` - ./deploy.sh - ``` - - You should see the following output: - - ``` - Amazon Lambda Tools for .NET Core applications (3.3.0) - Project Home: https://github.com/aws/aws-extensions-for-dotnet-cli, https://github.com/aws/aws-lambda-dotnet - - Executing publish command - ... - Created publish archive (ec2spot.zip) - Lambda project successfully packaged: ec2spot.zip - Uploading to ebd38e401cedd7d676d05d22b76f0209 1305107 / 1305107.0 (100.00%) - Successfully packaged artifacts and wrote output template to file out.yaml. - Run the following command to deploy the packaged template - aws cloudformation deploy --template-file out.yaml --stack-name - - Waiting for changeset to be created.. - Waiting for stack create/update to complete - Successfully created/updated stack - ec2-spot - ``` - -1. Open the [Applications page](https://us-east-2.console.aws.amazon.com/lambda/home?region=us-east-2#/applications/ec2-spot) of the Lambda console\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-ec2spot-application.png) - -1. Under **Resources**, choose **function**\. - -1. Choose **Test** and create a test event from the default template\. - -1. Choose **Test** again to invoke the function\. - -View the logs and trace information to see the spot request ID and sequence of calls to Amazon EC2\. - -To view the service map, open the [Service map page](https://console.aws.amazon.com/xray/home#/service-map) in the X\-Ray console\. - -Choose a node in the service map and then choose **View traces** to see a list of traces\. Choose a trace from the list to see the timeline of calls that the function made to Amazon EC2\. - -## Clean up - -The code provided in this tutorial is designed to create and delete spot instance requests, and to terminate the instances that they launch\. However, if an error occurs, the requests and instances might not be cleaned up automatically\. View the spot requests and instances in the Amazon EC2 console\. - -**To confirm that Amazon EC2 resources are cleaned up** - -1. Open the [Spot Requests page](https://console.aws.amazon.com/ec2sp/v1/spot/home) in the Amazon EC2 console\. - -1. Verify that the state of the requests is **Cancelled**\. - -1. Choose the instance ID in the **Capacity** column to view the instance\. - -1. Verify that the state of the instances is **Terminated** or **Shutting down**\. - -To clean up the sample function and support resources, delete its AWS CloudFormation stack and the artifacts bucket that you created\. - -``` -./cleanup.sh -``` - -You should see the following output: - -``` -Delete deployment artifacts and bucket (lambda-artifacts-63d5cbbf18fa5ecc)?y -delete: s3://lambda-artifacts-63d5cbbf18fa5ecc/ebd38e401cedd7d676d05d22b76f0209 -remove_bucket: lambda-artifacts-63d5cbbf18fa5ecc -``` - -The function's log group is not deleted automatically\. You can delete it in the [CloudWatch Logs console](https://console.aws.amazon.com/cloudwatch/home#logs:)\. Traces in X\-Ray expire after a few weeks and are deleted automatically\. \ No newline at end of file diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md index 21fc692b..fe6edcfc 100644 --- a/doc_source/services-ec2.md +++ b/doc_source/services-ec2.md @@ -27,7 +27,7 @@ EventBridge \(CloudWatch Events\) invokes your Lambda function asynchronously wi For details on configuring events in EventBridge \(CloudWatch Events\), see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon EventBridge \(CloudWatch Events\) for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. -You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. For a tutorial with a sample application in C\#, see [Tutorial: Using AWS SDK for \.NET to manage Amazon EC2 Spot Instances](services-ec2-tutorial.md)\. +You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. ## Permissions diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md index c9cfbf05..3c163558 100644 --- a/doc_source/services-elasticache-tutorial.md +++ b/doc_source/services-elasticache-tutorial.md @@ -25,7 +25,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md index 2f7239b6..ac8f2379 100644 --- a/doc_source/services-rds-tutorial.md +++ b/doc_source/services-rds-tutorial.md @@ -25,7 +25,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md index 00b5768b..05e5e156 100644 --- a/doc_source/services-s3-object-lambda.md +++ b/doc_source/services-s3-object-lambda.md @@ -1,6 +1,6 @@ # Transforming S3 Objects with S3 Object Lambda -With S3 Object Lambda you can add your own code to Amazon S3 GET requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. +With S3 Object Lambda you can add your own code to Amazon S3 GET, HEAD, and LIST requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET, HEAD, or LIST requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md index 96377ffb..418050a1 100644 --- a/doc_source/services-xray.md +++ b/doc_source/services-xray.md @@ -4,28 +4,34 @@ You can use AWS X\-Ray to visualize the components of your application, identify If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. -To trace requests that don't have a tracing header, enable active tracing in your function's configuration\. +**Note** +X\-Ray tracing is currently not supported for Lambda functions with Amazon Managed Streaming for Apache Kafka \(Amazon MSK\), self\-managed Apache Kafka, or Amazon MQ with ActiveMQ and RabbitMQ event source mappings\. + +To toggle active tracing on your Lambda function with the console, follow these steps: -**To enable active tracing** +**To turn on active tracing** 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. 1. Choose a function\. -1. Choose **Configuration** and then choose **Monitoring tools**\. +1. Choose **Configuration** and then choose **Monitoring and operations tools**\. 1. Choose **Edit**\. -1. Under **X\-Ray**, enable **Active tracing**\. +1. Under **X\-Ray**, toggle on **Active tracing**\. 1. Choose **Save**\. **Pricing** You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. -Your function needs permission to upload trace data to X\-Ray\. When you enable active tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. +Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. -X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of the requests that your application serves\. The default sampling rate is 1 request per second and 5 percent of additional requests\. This sampling rate cannot be configured for Lambda functions\. +X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. + +**Note** +You cannot configure the X\-Ray sampling rate for your functions\. In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](lambda-runtime-environment.md)\. @@ -48,7 +54,7 @@ See the following topics for a language\-specific introduction to tracing in Lam + [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) + [Instrumenting Python code in AWS Lambda](python-tracing.md) + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) -+ [Instrumenting Java code in Lambda](java-tracing.md) ++ [Instrumenting Java code in AWS Lambda](java-tracing.md) + [Instrumenting Go code in AWS Lambda](golang-tracing.md) + [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) @@ -92,7 +98,7 @@ aws lambda update-function-configuration --function-name my-function \ --tracing-config Mode=Active ``` -Tracing mode is part of the version\-specific configuration that is locked when you publish a version of your function\. You can't change the tracing mode on a published version\. +Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. ## Enabling active tracing with AWS CloudFormation diff --git a/doc_source/telemetry-api-reference.md b/doc_source/telemetry-api-reference.md new file mode 100644 index 00000000..08b50056 --- /dev/null +++ b/doc_source/telemetry-api-reference.md @@ -0,0 +1,126 @@ +# Lambda Telemetry API reference + +Use the Lambda Telemetry API endpoint to subscribe extensions to telemetry streams\. You can retrieve the Telemetry API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, append the API version \(`2022-07-01/`\) and `telemetry/`\. For example: + +``` +http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry/ +``` + +**Note** +We will update this section with the OpenAPI Specification \(OAS\) definition of the latest version of the Telemetry API for HTTP and TCP protocols in the coming weeks\. + +**Topics** ++ [Subscribe](#telemetry-subscribe-api) + +## Subscribe + +To subscribe to a telemetry stream, a Lambda extension can send a Subscribe API request\. ++ **Path** – `/telemetry` ++ **Method** – `PUT` ++ **Headers** + + `Content-Type`: `application/json` ++ **Request body parameters** + + **schemaVersion** + + Required: Yes + + Type: String + + Valid values: `"2022-07-01"` + + **destination** – The configuration settings that define the telemetry event destination and the protocol for event delivery\. + + Required: Yes + + Type: Object + + ``` + { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080" + } + ``` + + **protocol** – The protocol that Lambda uses to send telemetry data\. + + Required: Yes + + Type: String + + Valid values: `"HTTP"`\|`"TCP"` + + **URI** – The URI to send telemetry data to\. + + Required: Yes + + Type: String + + For more information, see [Specifying a destination protocol](telemetry-api.md#telemetry-api-destination)\. + + **types** – The types of telemetry that you want the extension to subscribe to\. + + Required: Yes + + Type: Array of strings + + Valid values: `"platform"`\|`"function"`\|`"extension"` + + **buffering** – The configuration settings for event buffering\. + + Required: No + + Type: Object + + ``` + { + "buffering": { + "maxItems": 1000, + "maxBytes": 256*1024, + "timeoutMs": 100 + } + } + ``` + + **maxItems** – The maximum number of events to buffer in memory\. + + Required: No + + Type: Integer + + Default: 1,000 + + Minimum: 25 + + Maximum: 30,000 + + **maxBytes** – The maximum volume of telemetry \(in bytes\) to buffer in memory\. + + Required: No + + Type: Integer + + Default: 262,144 + + Minimum: 262,144 + + Maximum: 1,048,576 + + **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. + + Required: No + + Type: Integer + + Default: 10,000 + + Minimum: 1,000 + + Maximum: 10,000 + + For more information, see [Configuring memory usage and buffering](telemetry-api.md#telemetry-api-buffering)\. + +### Example Subscribe API request + +``` +PUT http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry HTTP/1.1 +{ + "schemaVersion": "2022-07-01", + "types": [ + "platform", + "function", + "extension" + ], + "buffering": { + "maxItems": 1000, + "maxBytes": 256*1024, + "timeoutMs": 100 + }, + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080" + } +} +``` + +If the Subscribe request succeeds, the extension receives an HTTP 200 success response: + +``` +HTTP/1.1 200 OK +"OK" +``` + +If the Subscribe request fails, the extension receives an error response\. For example: + +``` +HTTP/1.1 400 OK +{ + "errorType": "ValidationError", + "errorMessage": "URI port is not provided; types should not be empty" +} +``` + +Here are some additional response codes that the extension can receive: ++ 200 – Request completed successfully ++ 202 – Request accepted\. Subscription request response in local testing environment ++ 400 – Bad request ++ 500 – Service error \ No newline at end of file diff --git a/doc_source/telemetry-api.md b/doc_source/telemetry-api.md new file mode 100644 index 00000000..b45d5092 --- /dev/null +++ b/doc_source/telemetry-api.md @@ -0,0 +1,263 @@ +# Lambda Telemetry API + +Using the Lambda Telemetry API, your extensions can directly receive telemetry data from Lambda\. During function initialization and invocation, Lambda automatically captures telemetry, such as logs, platform metrics, and platform traces\. With Telemetry API, extensions can get this telemetry data directly from Lambda in near real time\. + +You can subscribe your Lambda extensions to telemetry streams directly from within the Lambda execution environment\. After subscribing, Lambda automatically streams all telemetry data to your extensions\. You can then process, filter, and deliver that data to your preferred destination, such as an Amazon Simple Storage Service \(Amazon S3\) bucket or a third\-party observability tools provider\. + +The following diagram shows how the Extensions API and Telemetry API connect extensions to Lambda from within the execution environment\. The Runtime API also connects your runtime and function to Lambda\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-concept-diagram.png) + +**Important** +The Lambda Telemetry API supersedes the Lambda Logs API\. **While the Logs API remains fully functional, we recommend using only the Telemetry API going forward\.** You can subscribe your extension to a telemetry stream using either the Telemetry API or the Logs API\. After subscribing using one of these APIs, any attempt to subscribe using the other API returns an error\. + +Extensions can use the Telemetry API to subscribe to three different telemetry streams: ++ **Platform telemetry** – Logs, metrics, and traces, which describe events and errors related to the execution environment runtime lifecycle, extension lifecycle, and function invocations\. ++ **Function logs** – Custom logs that the Lambda function code generates\. ++ **Extension logs** – Custom logs that the Lambda extension code generates\. + +**Note** +Lambda sends logs and metrics to CloudWatch, and traces to X\-Ray \(if you've activated tracing\), even if an extension subscribes to telemetry streams\. + +**Topics** ++ [Creating extensions using the Telemetry API](#telemetry-api-creating-extensions) ++ [Registering your extension](#telemetry-api-registration) ++ [Creating a telemetry listener](#telemetry-api-listener) ++ [Specifying a destination protocol](#telemetry-api-destination) ++ [Configuring memory usage and buffering](#telemetry-api-buffering) ++ [Sending a subscription request to the Telemetry API](#telemetry-api-subscription) ++ [Inbound Telemetry API messages](#telemetry-api-messages) ++ [Lambda Telemetry API reference](telemetry-api-reference.md) ++ [Lambda Telemetry API `Event` schema reference](telemetry-schema-reference.md) ++ [Converting Lambda Telemetry API `Event` objects to OpenTelemetry Spans](telemetry-otel-spans.md) ++ [Lambda Logs API](runtimes-logs-api.md) + +## Creating extensions using the Telemetry API + +Lambda extensions run as independent processes in the execution environment, and can continue to run after the function invocation completes\. Because extensions are separate processes, you can write them in a language different from the function code\. We recommend implementing extensions using a compiled language such as Golang or Rust\. This way, the extension is a self\-contained binary that can be compatible with any supported runtime\. + +The following diagram illustrates a four\-step process to create an extension that receives and processes telemetry data using the Telemetry API\. + +![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-creation-steps.png) + +Here is each step in more detail: + +1. Register your extension using the [Lambda Extensions API](runtimes-extensions-api.md)\. This provides you with a `Lambda-Extension-Identifier`, which you'll need in the following steps\. For more information about how to register your extension, see [Registering your extension](#telemetry-api-registration)\. + +1. Create a telemetry listener\. This can be a basic HTTP or TCP server\. Lambda uses the URI of the telemetry listener to send telemetry data to your extension\. For more information, see [Creating a telemetry listener](#telemetry-api-listener)\. + +1. Using the Subscribe API in the Telemetry API, subscribe your extension to your desired telemetry streams\. You'll need the URI of your telemetry listener for this step\. For more information, see [Sending a subscription request to the Telemetry API](#telemetry-api-subscription)\. + +1. Get telemetry data from Lambda via the telemetry listener\. You can do any custom processing of this data, such as dispatching the data to Amazon S3 or to an external observability service\. + +**Note** +A Lambda function's execution environment can start and stop multiple times as part of its [lifecycle](runtimes-extensions-api.md#runtimes-extensions-api-lifecycle)\. In general, your extension code runs during function invocations, and also up to 2 seconds during the shutdown phase\. We recommend batching the telemetry as it arrives to your listener, and using the `Invoke` and `Shutdown` lifecycle events to dispatch each batch to their desired destinations\. + +## Registering your extension + +Before you can subscribe to receive telemetry data, you must register your Lambda extension\. Registration occurs during the [extension initialization phase](runtimes-extensions-api.md#runtimes-extensions-api-reg)\. The following example shows an HTTP request to register an extension\. + +``` +POST http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register + Lambda-Extension-Name: lambda_extension_name +{ + 'events': [ 'INVOKE', 'SHUTDOWN'] +} +``` + +If the request succeeds, the subscriber receives an HTTP 200 success response\. The response header contains the `Lambda-Extension-Identifier`\. The response body contains other properties of the function\. + +``` +HTTP/1.1 200 OK +Lambda-Extension-Identifier: a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 +{ + "functionName": "lambda_function", + "functionVersion": "$LATEST", + "handler": "lambda_handler", + "accountId": "123456789012" +} +``` + +For more information, see the [Extensions API reference](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. + +## Creating a telemetry listener + +Your Lambda extension must have a listener that handles incoming requests from the Telemetry API\. The following code shows an example telemetry listener implementation in Golang: + +``` +// Starts the server in a goroutine where the log events will be sent +func (s *TelemetryApiListener) Start() (string, error) { + address := listenOnAddress() + l.Info("[listener:Start] Starting on address", address) + s.httpServer = &http.Server{Addr: address} + http.HandleFunc("/", s.http_handler) + go func() { + err := s.httpServer.ListenAndServe() + if err != http.ErrServerClosed { + l.Error("[listener:goroutine] Unexpected stop on Http Server:", err) + s.Shutdown() + } else { + l.Info("[listener:goroutine] Http Server closed:", err) + } + }() + return fmt.Sprintf("http://%s/", address), nil +} + +// http_handler handles the requests coming from the Telemetry API. +// Everytime Telemetry API sends log events, this function will read them from the response body +// and put into a synchronous queue to be dispatched later. +// Logging or printing besides the error cases below is not recommended if you have subscribed to +// receive extension logs. Otherwise, logging here will cause Telemetry API to send new logs for +// the printed lines which may create an infinite loop. +func (s *TelemetryApiListener) http_handler(w http.ResponseWriter, r *http.Request) { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + l.Error("[listener:http_handler] Error reading body:", err) + return + } + + // Parse and put the log messages into the queue + var slice []interface{} + _ = json.Unmarshal(body, &slice) + + for _, el := range slice { + s.LogEventsQueue.Put(el) + } + + l.Info("[listener:http_handler] logEvents received:", len(slice), " LogEventsQueue length:", s.LogEventsQueue.Len()) + slice = nil +} +``` + +## Specifying a destination protocol + +When you subscribe to receive telemetry using the Telemetry API, you can specify a destination protocol in addition to the destination URI: + +``` +{ + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080" + } +} +``` + +Lambda accepts two protocols for receiving telemetry: ++ **HTTP \(recommended\)** – Lambda delivers telemetry to a local HTTP endpoint \(`http://sandbox.localdomain:${PORT}/${PATH}`\) as an array of records in JSON format\. The `$PATH` parameter is optional\. Lambda supports only HTTP, not HTTPS\. Lambda delivers telemetry through POST requests\. ++ **TCP** – Lambda delivers telemetry to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. + +**Note** +We strongly recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge when it delivers telemetry to the application layer\. Therefore, if your extension crashes, you might lose telemetry\. HTTP does not have this limitation\. + +Before subscribing to receive telemetry, set up the local HTTP listener or TCP port\. During setup, note the following: ++ Lambda sends telemetry only to destinations that are inside the execution environment\. ++ Lambda retries the attempt to send telemetry \(with backoff\) if there is no listener, or if the POST request results in an error\. If the telemetry listener crashes, then it continues to receive telemetry after Lambda restarts the execution environment\. ++ Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. + +## Configuring memory usage and buffering + +An execution environment's memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store telemetry data\. Buffer memory usage counts towards overall memory consumption in the execution environment\. + +When you subscribe to receive telemetry using the Telemetry API, you can buffer telemetry data and deliver it to subscribers in batches\. To help optimize memory usage, you can specify a buffering configuration: + +``` +{ + "buffering": { + "maxBytes": 256*1024, + "maxItems": 1000, + "timeoutMs": 100 + } +} +``` + + +**Buffering configuration settings** + +| Parameter | Description | Defaults and limits | +| --- | --- | --- | +| `maxBytes` | The maximum volume of telemetry \(in bytes\) to buffer in memory\. | Default: 262,144 Minimum: 262,144 Maximum: 1,048,576 | +| `maxItems` | The maximum number of events to buffer in memory\. | Default: 10,000 Minimum: 1,000 Maximum: 10,000 | +| `timeoutMs` | The maximum time \(in milliseconds\) to buffer a batch\. | Default: 1,000 Minimum: 25 Maximum: 30,000 | + +When configuring buffering, note the following points: ++ If any of the input streams are closed, then Lambda flushes the logs\. This can happen if, for example, the runtime crashes\. ++ Each subscriber can specify a different buffering configuration in their subscription request\. ++ Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2 * maxBytes + metadataBytes`, where `maxBytes` is part of your buffering configuration\. To get an idea of how much `metadataBytes` you should account for, review the following metadata\. Lambda adds metadata similar to this to each record: + + ``` + { + "time": "2022-08-20T12:31:32.123Z", + "type": "function", + "record": "Hello World" + } + ``` ++ If the subscriber cannot process incoming telemetry fast enough, Lambda might drop records to keep memory utilization bounded\. When this occurs, Lambda sends a `platform.logsDropped` event\. + +## Sending a subscription request to the Telemetry API + +Lambda extensions can subscribe to receive telemetry data by sending a subscription request to the Telemetry API\. The subscription request should contain information about the types of events that you want the extension to subscribe to\. In addition, the request can contain [delivery destination information](#telemetry-api-destination) and a [buffering configuration](#telemetry-api-buffering)\. + +Before sending a subscription request, you must have an extension ID \(`Lambda-Extension-Identifier`\)\. When you [register your extension with the Extensions API](#telemetry-api-registration), you obtain an extension ID from the API response\. + +Subscription occurs during the [extension initialization phase](runtimes-extensions-api.md#runtimes-extensions-api-reg)\. The following example shows an HTTP request to subscribe to all three telemetry streams: platform telemetry, function logs, and extension logs\. + +``` +PUT http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry HTTP/1.1 +{ + "schemaVersion": "2022-07-01", + "types": [ + "platform", + "function", + "extension" + ], + "buffering": { + "maxItems": 1000, + "maxBytes": 256*1024, + "timeoutMs": 100 + }, + "destination": { + "protocol": "HTTP", + "URI": "http://sandbox.localdomain:8080" + } +} +``` + +If the request succeeds, then the subscriber receives an HTTP 200 success response\. + +``` +HTTP/1.1 200 OK +"OK" +``` + +## Inbound Telemetry API messages + +After subscribing using the Telemetry API, an extension automatically starts to receive telemetry from Lambda via POST requests to the telemetry listener\. Each POST request body contains an array of `Event` objects\. `Event` is a JSON object with the following schema: + +``` +{ + time: String, + type: String, + record: Object +} +``` ++ The `time` property defines when the Lambda platform generated the event\. This isn't the same as when the event actually occurred\. The string value of `time` is a timestamp in ISO 8601 format\. ++ The `type` property defines the event type\. The following table describes all possible values\. ++ The `record` property defines a JSON object that contains the telemetry data\. The schema of this JSON object depends on the `type`\. + +The following table summarizes all types of `Event` objects, and links to the [Telemetry API `Event` schema reference](telemetry-schema-reference.md) for each event type\. + + +**Telemetry API message types** + +| Category | Event type | Description | Event record schema | +| --- | --- | --- | --- | +| Platform event | `platform.initStart` | Function initialization started\. | [`platform.initStart`](telemetry-schema-reference.md#platform-initStart) schema | +| Platform event | `platform.initRuntimeDone` | Function initialization completed\. | [`platform.initRuntimeDone`](telemetry-schema-reference.md#platform-initRuntimeDone) schema | +| Platform event | `platform.initReport` | A report of function initialization\. | [`platform.initReport`](telemetry-schema-reference.md#platform-initReport) schema | +| Platform event | `platform.start` | Function invocation started\. | [`platform.start`](telemetry-schema-reference.md#platform-start) schema | +| Platform event | `platform.runtimeDone` | The runtime finished processing an event with either success or failure\. | [`platform.runtimeDone`](telemetry-schema-reference.md#platform-runtimeDone) schema | +| Platform event | `platform.report` | A report of function invocation\. | [`platform.report`](telemetry-schema-reference.md#platform-report) schema | +| Platform event | `platform.telemetrySubscription` | The extension subscribed to the Telemetry API\. | [`platform.telemetrySubscription`](telemetry-schema-reference.md#platform-telemetrySubscription) schema | +| Platform event | `platform.logsDropped` | Lambda dropped log entries\. | [`platform.logsDropped`](telemetry-schema-reference.md#platform-logsDropped) schema | +| Function logs | `function` | A log line from function code\. | [`function`](telemetry-schema-reference.md#telemetry-api-function) schema | +| Extension logs | `extension` | A log line from extension code\. | [`extension`](telemetry-schema-reference.md#telemetry-api-extension) schema | \ No newline at end of file diff --git a/doc_source/telemetry-otel-spans.md b/doc_source/telemetry-otel-spans.md new file mode 100644 index 00000000..02478bb6 --- /dev/null +++ b/doc_source/telemetry-otel-spans.md @@ -0,0 +1,98 @@ +# Converting Lambda Telemetry API `Event` objects to OpenTelemetry Spans + +The AWS Lambda Telemetry API schema is semantically compatible with OpenTelemetry \(OTel\)\. This means that you can convert your AWS Lambda Telemetry API `Event` objects to OpenTelemetry \(OTel\) Spans\. When converting, you shouldn't map a single `Event` object to a single OTel Span\. Instead, you should present all three events related to a lifecycle phase in a single OTel Span\. For example, the `start`, `runtimeDone`, and `runtimeReport` events represent a single function invocation\. Present all three of these events as a single OTel Span\. + +You can convert your events using Span Events or Child \(nested\) Spans\. The tables on this page describe the mappings between Telemetry API schema properties and OTel Span properties for both approaches\. For more information about OTel Spans, see [Span](https://opentelemetry.io/docs/reference/specification/trace/api/#span) on the **Tracing API** page of the OpenTelemetry Docs website\. + +**Topics** ++ [Map to OTel Spans with Span Events](#telemetry-otel-span-events) ++ [Map to OTel Spans with Child Spans](#telemetry-otel-child-spans) + +## Map to OTel Spans with Span Events + +In the following tables, `e` represents the event coming from the telemetry source\. + + +**Mapping the `*Start` events** + +| OpenTelemetry | Lambda Telemetry API schema | +| --- | --- | +| `Span.Name` | Your extension generates this value based on the `type` field\. | +| `Span.StartTime` | Use `e.time`\. | +| `Span.EndTime` | N/A, because the event hasn't completed yet\. | +| `Span.Kind` | Set to `Server`\. | +| `Span.Status` | Set to `Unset`\. | +| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | +| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | +| `Span.SpanId` | Use `e.tracing.spanId` if available\. Otherwise, generate a new `SpanId`\. | +| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | +| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | +| `Span.Attributes` | Your extension can add any custom values here\. | + + +**Mapping the `*RuntimeDone` events** + +| OpenTelemetry | Lambda Telemetry API schema | +| --- | --- | +| `Span.Name` | Your extension generates the value based on the `type` field\. | +| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | +| `Span.EndTime` | N/A, because the event hasn't completed yet\. | +| `Span.Kind` | Set to `Server`\. | +| `Span.Status` | If `e.status` doesn't equal `success`, then set to `Error`\. Otherwise, set to `Ok`\. | +| `Span.Events[]` | Use `e.spans[]`\. | +| `Span.Events[i].Name` | Use `e.spans[i].name`\. | +| `Span.Events[i].Time` | Use `e.spans[i].start`\. | +| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | +| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | +| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | +| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | +| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | +| `Span.Attributes` | Your extension can add any custom values here\. | + + +**Mapping the `*Report` events** + +| OpenTelemetry | Lambda Telemetry API schema | +| --- | --- | +| `Span.Name` | Your extension generates the value based on the `type` field\. | +| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | +| `Span.EndTime` | Use `e.time`\. | +| `Span.Kind` | Set to `Server`\. | +| `Span.Status` | Use the same value as the `*RuntimeDone` event\. | +| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | +| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | +| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | +| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | +| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | +| `Span.Attributes` | Your extension can add any custom values here\. | + +## Map to OTel Spans with Child Spans + +The following table describes how to convert Lambda Telemetry API events into OTel Spans with Child \(nested\) Spans for `*RuntimeDone` Spans\. For `*Start` and `*Report` mappings, refer to the tables in [Map to OTel Spans with Span Events](#telemetry-otel-span-events), as they're the same for Child Spans\. In this table, `e` represents the event coming from the telemetry source\. + + +**Mapping the `*RuntimeDone` events** + +| OpenTelemetry | Lambda Telemetry API schema | +| --- | --- | +| `Span.Name` | Your extension generates the value based on the `type` field\. | +| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | +| `Span.EndTime` | N/A, because the event hasn't completed yet\. | +| `Span.Kind` | Set to `Server`\. | +| `Span.Status` | If `e.status` doesn't equal `success`, then set to `Error`\. Otherwise, set to `Ok`\. | +| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | +| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | +| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | +| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | +| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | +| `Span.Attributes` | Your extension can add any custom values here\. | +| `ChildSpan[i].Name` | Use `e.spans[i].name`\. | +| `ChildSpan[i].StartTime` | Use `e.spans[i].start`\. | +| `ChildSpan[i].EndTime` | Use `e.spans[i].start + e.spans[i].durations`\. | +| `ChildSpan[i].Kind` | Same as parent `Span.Kind`\. | +| `ChildSpan[i].Status` | Same as parent `Span.Status`\. | +| `ChildSpan[i].TraceId` | Same as parent `Span.TraceId`\. | +| `ChildSpan[i].ParentId` | Use parent `Span.SpanId`\. | +| `ChildSpan[i].SpanId` | Generate a new `SpanId`\. | +| `ChildSpan[i].SpanContext.TraceState` | N/A for an X\-Ray trace context\. | +| `ChildSpan[i].SpanContext.TraceFlags` | Same as parent `Span.SpanContext.TraceFlags`\. | \ No newline at end of file diff --git a/doc_source/telemetry-schema-reference.md b/doc_source/telemetry-schema-reference.md new file mode 100644 index 00000000..57b38cda --- /dev/null +++ b/doc_source/telemetry-schema-reference.md @@ -0,0 +1,556 @@ +# Lambda Telemetry API `Event` schema reference + +Use the Lambda Telemetry API endpoint to subscribe extensions to telemetry streams\. You can retrieve the Telemetry API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, append the API version \(`2022-07-01/`\) and `telemetry/`\. For example: + +``` +http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry/ +``` + +**Note** +We will update this section with the OpenAPI Specification \(OAS\) definition of the latest version of the Telemetry API for HTTP and TCP protocols in the coming weeks\. + +The following table is a summary of all the types of `Event` objects that the Telemetry API supports\. + + +**Telemetry API message types** + +| Category | Event type | Description | Event record schema | +| --- | --- | --- | --- | +| Platform event | `platform.initStart` | Function initialization started\. | [`platform.initStart`](#platform-initStart) schema | +| Platform event | `platform.initRuntimeDone` | Function initialization completed\. | [`platform.initRuntimeDone`](#platform-initRuntimeDone) schema | +| Platform event | `platform.initReport` | A report of function initialization\. | [`platform.initReport`](#platform-initReport) schema | +| Platform event | `platform.start` | Function invocation started\. | [`platform.start`](#platform-start) schema | +| Platform event | `platform.runtimeDone` | The runtime finished processing an event with either success or failure\. | [`platform.runtimeDone`](#platform-runtimeDone) schema | +| Platform event | `platform.report` | A report of function invocation\. | [`platform.report`](#platform-report) schema | +| Platform event | `platform.telemetrySubscription` | The extension subscribed to the Telemetry API\. | [`platform.telemetrySubscription`](#platform-telemetrySubscription) schema | +| Platform event | `platform.logsDropped` | Lambda dropped log entries\. | [`platform.logsDropped`](#platform-logsDropped) schema | +| Function logs | `function` | A log line from function code\. | [`function`](#telemetry-api-function) schema | +| Extension logs | `extension` | A log line from extension code\. | [`extension`](#telemetry-api-extension) schema | + +**Contents** ++ [Telemetry API `Event` object types](#telemetry-api-events) + + [`platform.initStart`](#platform-initStart) + + [`platform.initRuntimeDone`](#platform-initRuntimeDone) + + [`platform.initReport`](#platform-initReport) + + [`platform.start`](#platform-start) + + [`platform.runtimeDone`](#platform-runtimeDone) + + [`platform.report`](#platform-report) + + [`platform.extension`](#platform-extension) + + [`platform.telemetrySubscription`](#platform-telemetrySubscription) + + [`platform.logsDropped`](#platform-logsDropped) + + [`function`](#telemetry-api-function) + + [`extension`](#telemetry-api-extension) ++ [Shared object types](#telemetry-api-objects) + + [`InitPhase`](#InitPhase) + + [`InitReportMetrics`](#InitReportMetrics) + + [`InitType`](#InitType) + + [`ReportMetrics`](#ReportMetrics) + + [`RuntimeDoneMetrics`](#RuntimeDoneMetrics) + + [Span](#Span) + + [`Status`](#Status) + + [`TraceContext`](#TraceContext) + + [`TracingType`](#TracingType) + +## Telemetry API `Event` object types + +This section details the types of `Event` objects that the Lambda Telemetry API supports\. In the event descriptions, a question mark \(`?`\) indicates that the attribute may not be present in the object\. + +### `platform.initStart` + +A `platform.initStart` event indicates that the function initialization phase has started\. A `platform.initStart` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.initStart +- record: PlatformInitStart +``` + +The `PlatformInitStart` object has the following attributes: ++ **initializationType** – ``InitType`` object ++ **phase** – ``InitPhase`` object ++ **runtimeArn?** – `String` ++ **runtimeVersion?** – `String` + +The following is an example `Event` of type `platform.initStart`: + +``` +{ + "time": "2022-10-12T00:00:15.064Z", + "type": "platform.initStart", + "record": { + "initializationType": "on-demand", + "phase": "init", + "runtimeVersion": "nodejs-14.v3", + "runtimeVersionArn": "arn" + } +} +``` + +### `platform.initRuntimeDone` + +A `platform.initRuntimeDone` event indicates that the function initialization phase has completed\. A `platform.initRuntimeDone` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.initRuntimeDone +- record: PlatformInitRuntimeDone +``` + +The `PlatformInitRuntimeDone` object has the following attributes: ++ **initializationType** – ``InitType`` object ++ **phase** – ``InitPhase`` object ++ **status** – ``Status`` object ++ **spans?** – List of [Span](#Span) objects + +The following is an example `Event` of type `platform.initRuntimeDone`: + +``` +{ + "time": "2022-10-12T00:01:15.000Z", + "type": "platform.initRuntimeDone", + "record": { + "initializationType": "on-demand" + "status": "success", + "spans": [ + { + "name": "someTimeSpan", + "start": "2022-06-02T12:02:33.913Z", + "durationMs": 70.5 + } + ] + } +} +``` + +### `platform.initReport` + +A `platform.initReport` event contains an overall report of the function initialization phase\. A `platform.initReport` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.initReport +- record: PlatformInitReport +``` + +The `PlatformInitReport` object has the following attributes: ++ **initializationType** – ``InitType`` object ++ **phase** – ``InitPhase`` object ++ **metrics** – ``InitReportMetrics`` object ++ **spans?** – List of [Span](#Span) objects + +The following is an example `Event` of type `platform.initReport`: + +``` +{ + "time": "2022-10-12T00:01:15.000Z", + "type": "platform.initReport", + "record": { + "initializationType": "on-demand", + "phase": "init", + "metrics": { + "durationMs": 125.33 + }, + "spans": [ + { + "name": "someTimeSpan", + "start": "2022-06-02T12:02:33.913Z", + "durationMs": 90.1 + } + ] + } +} +``` + +### `platform.start` + +A `platform.start` event indicates that the function invocation phase has started\. A `platform.start` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.start +- record: PlatformStart +``` + +The `PlatformStart` object has the following attributes: ++ **requestId** – `String` ++ **version?** – `String` ++ **tracing?** – ``TraceContext`` + +The following is an example `Event` of type `platform.start`: + +``` +{ + "time": "2022-10-12T00:00:15.064Z", + "type": "platform.initStart", + "record": { + "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", + "version": "$LATEST", + "tracing": { + "spanId": "54565fb41ac79632", + "type": "X-Amzn-Trace-Id", + "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" + } + } +} +``` + +### `platform.runtimeDone` + +A `platform.runtimeDone` event indicates that the function invocation phase has completed\. A `platform.runtimeDone` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.runtimeDone +- record: PlatformRuntimeDone +``` + +The `PlatformRuntimeDone` object has the following attributes: ++ **metrics?** – ``RuntimeDoneMetrics`` object ++ **requestId** – `String` ++ **status** – ``Status`` object ++ **spans?** – List of [Span](#Span) objects ++ **tracing?** – ``TraceContext`` object + +The following is an example `Event` of type `platform.runtimeDone`: + +``` +{ + "time": "2022-10-12T00:01:15.000Z", + "type": "platform.runtimeDone", + "record": { + "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", + "status": "success", + "tracing": { + "spanId": "54565fb41ac79632", + "type": "X-Amzn-Trace-Id", + "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" + }, + "spans": [ + { + "name": "someTimeSpan", + "start": "2022-08-02T12:01:23:521Z", + "durationMs": 80.0 + } + ], + "metrics": { + "durationMs": 140.0, + "producedBytes": 16 + } + } +} +``` + +### `platform.report` + +A `platform.report` event contains an overall report of the function initialization phase\. A `platform.report` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.report +- record: PlatformReport +``` + +The `PlatformReport` object has the following attributes: ++ **metrics** – ``ReportMetrics`` object ++ **requestId** – `String` ++ **spans?** – List of [Span](#Span) objects ++ **status** – ``Status`` object ++ **tracing?** – ``TraceContext`` object + +The following is an example `Event` of type `platform.report`: + +``` +{ + "time": "2022-10-12T00:01:15.000Z", + "type": "platform.report", + "record": { + "metrics": { + "billedDurationMs": 694, + "durationMs": 693.92, + "initDurationMs": 397.68, + "maxMemoryUsedMB": 84, + "memorySizeMB": 128 + }, + "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", + } +} +``` + +### `platform.extension` + +An `extension` event contains logs from the extension code\. An `extension` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = extension +- record: {} +``` + +The `PlatformExtension` object has the following attributes: ++ **events** – List of `String` ++ **name** – `String` ++ **state** – `String` + +The following is an example `Event` of type `platform.extension`: + +``` +{ + "time": "2022-10-12T00:02:15.000Z", + "type": "platform.extension", + "record": { + "events": [ "INVOKE", "SHUTDOWN" ], + "name": "my-telemetry-extension", + "state": "Ready" + } +} +``` + +### `platform.telemetrySubscription` + +A `platform.telemetrySubscription` event contains information about an extension subscription\. A `platform.telemetrySubscription` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.telemetrySubscription +- record: PlatformTelemetrySubscription +``` + +The `PlatformTelemetrySubscription` object has the following attributes: ++ **name** – `String` ++ **state** – `String` ++ **types** – List of `String` + +The following is an example `Event` of type `platform.telemetrySubscription`: + +``` +{ + "time": "2022-10-12T00:02:35.000Z", + "type": "platform.telemetrySubscription", + "record": { + "name": "my-telemetry-extension", + "state": "Subscribed", + "types": [ "platform", "function" ] + } +} +``` + +### `platform.logsDropped` + +A `platform.logsDropped` event contains information about dropped events\. Lambda emits the `platform.logsDropped` event when an extension can't process one or more events\. A `platform.logsDropped` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = platform.logsDropped +- record: PlatformLogsDropped +``` + +The `PlatformLogsDropped` object has the following attributes: ++ **droppedBytes** – `Integer` ++ **droppedRecords** – `Integer` ++ **reason** – `String` + +The following is an example `Event` of type `platform.logsDropped`: + +``` +{ + "time": "2022-10-12T00:02:35.000Z", + "type": "platform.logsDropped", + "record": { + "droppedBytes": 12345, + "droppedRecords": 123, + "reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs." + } +} +``` + +### `function` + +A `function` event contains logs from the function code\. A `function` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = function +- record: {} +``` + +The following is an example `Event` of type `function`: + +``` +{ + "time": "2022-10-12T00:03:50.000Z", + "type": "function", + "record": "[INFO] Hello world, I am a function!" +} +``` + +### `extension` + +A `extension` event contains logs from the extension code\. A `extension` `Event` object has the following shape: + +``` +Event: Object +- time: String +- type: String = extension +- record: {} +``` + +The following is an example `Event` of type `extension`: + +``` +{ + "time": "2022-10-12T00:03:50.000Z", + "type": "extension", + "record": "[INFO] Hello world, I am an extension!" +} +``` + +## Shared object types + +This section details the types of shared objects that the Lambda Telemetry API supports\. + +### `InitPhase` + +A string enum that describes the phase when the initialization step occurs\. In most cases, Lambda runs the function initialization code during the `init` phase\. However, in some error cases, Lambda may re\-run the function initialization code during the `invoke` phase\. \(This is called a *suppressed init*\.\) ++ **Type** – `String` ++ **Valid values** – `init`\|`invoke` + +### `InitReportMetrics` + +An object that contains metrics about an initialization phase\. ++ **Type** – `Object` + +An `InitReportMetrics` object has the following shape: + +``` +InitReportMetrics: Object +- durationMs: Double +``` + +The following is an example `InitReportMetrics` object: + +``` +{ + "durationMs": 247.88 +} +``` + +### `InitType` + +A string enum that describes how Lambda initialized the environment\. ++ **Type** – `String` ++ **Valid values** – `on-demand`\|`provisioned-concurrency` + +### `ReportMetrics` + +An object that contains metrics about a completed phase\. ++ **Type** – `Object` + +A `ReportMetrics` object has the following shape: + +``` +ReportMetrics: Object +- billedDurationMs: Integer +- durationMs: Double +- initDurationMs?: Double +- maxMemoryUsedMB: Integer +- memorySizeMB: Integer +- restoreDurationMs?: Double +``` + +The following is an example `ReportMetrics` object: + +``` +{ + "billedDurationMs": 694, + "durationMs": 693.92, + "initDurationMs": 397.68, + "maxMemoryUsedMB": 84, + "memorySizeMB": 128 +} +``` + +### `RuntimeDoneMetrics` + +An object that contains metrics about an invocation phase\. ++ **Type** – `Object` + +A `RuntimeDoneMetrics` object has the following shape: + +``` +RuntimeDoneMetrics: Object +- durationMs: Double +- producedBytes?: Integer +``` + +The following is an example `RuntimeDoneMetrics` object: + +``` +{ + "durationMs": 200.0, + "producedBytes": 15 +} +``` + +### Span + +An object that contains details about a span\. A span represents a unit of work or operation in a trace\. For more information about spans, see [Span](https://opentelemetry.io/docs/reference/specification/trace/api/#span) on the **Tracing API** page of the OpenTelemetry Docs website\. + +Lambda supports the following two spans for the `platform.RuntimeDone` event: ++ The `responseLatency` span describes how long it took your Lambda function to start sending the response\. ++ The `responseDuration` span describes how long it took your Lambda function to finish sending the entire response\. + +The following is an example `responseLatency` span object: + +``` +{ + "name": "responseLatency", + "start": "2022-08-02T12:01:23.521Z", + "durationMs": 23.02 + } +``` + +### `Status` + +An object that describes the status of an initialization or invocation phase\. If the status is either `failure` or `error`, then the `Status` object also contains an `errorType` field describing the error\. ++ **Type** – `Object` ++ **Valid status values** – `success`\|`failure`\|`error` + +### `TraceContext` + +An object that describes the properties of a trace\. ++ **Type** – `Object` + +A `TraceContext` object has the following shape: + +``` +TraceContext: Object +- spanId?: String +- type: TracingType enum +- value: String +``` + +The following is an example `TraceContext` object: + +``` +{ + "spanId": "073a49012f3c312e", + "type": "X-Amzn-Trace-Id", + "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" +} +``` + +### `TracingType` + +A string enum that describes the type of tracing in a ``TraceContext`` object\. ++ **Type** – `String` ++ **Valid values** – `X-Amzn-Trace-Id` \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md index e7b4e4fd..6d52c04f 100644 --- a/doc_source/troubleshooting-deployment.md +++ b/doc_source/troubleshooting-deployment.md @@ -15,8 +15,7 @@ When you deploy updates to your function directly with the Lambda API or with a The Lambda runtime needs permission to read the files in your deployment package\. You can use the `chmod` command to change the file mode\. The following example commands make all files and folders in the current directory readable by any user\. ``` -chmod 644 $(find . -type f) -chmod 755 $(find . -type d) +chmod -R o+rX . ``` ## General: Error occurs when calling the UpdateFunctionCode @@ -85,7 +84,7 @@ The maximum size of the variables object that is stored in the function's config { "FunctionName": "my-function", "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", + "Runtime": "nodejs16.x", "Role": "arn:aws:iam::123456789012:role/lambda-role", "Environment": { "Variables": { @@ -103,4 +102,14 @@ In this example, the object is 39 characters and takes up 39 bytes when it's sto **Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* -Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file +Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. + +## Lambda: Concurrency and memory quotas + +**Error:*** Specified ConcurrentExecutions for function decreases account's UnreservedConcurrentExecution below its minimum value* + +**Error:*** 'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008* + +These errors occur when you exceed the concurrency or memory [quotas](gettingstarted-limits.md) for your account\. New AWS accounts have reduced concurrency and memory quotas\. AWS raises these quotas automatically based on your usage\. To resolve these errors, you can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)\. ++ **Concurrency:** You might get an error if you try to create a function using reserved or provisioned concurrency, or if your per\-function concurrency request \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\) exceeds your account's concurrency quota\. ++ **Memory:** Errors occur if the amount of memory allocated to the function exceeds your account's memory quota\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md index 34538767..95910dcb 100644 --- a/doc_source/troubleshooting-execution.md +++ b/doc_source/troubleshooting-execution.md @@ -22,7 +22,7 @@ Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [ + **AWSLambdaBasicExecutionRole** + **AWSXRayDaemonWriteAccess** -When you add permissions to your function, make an update to its code or configuration as well\. This forces running instances of your function, which have out\-of\-date credentials, to stop and be replaced\. +When you add permissions to your function, update its code or configuration as well\. This forces running instances of your function, which have outdated credentials, to stop and be replaced\. **Note** It may take 5 to 10 minutes for logs to show up after a function invocation\. diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md index 670f8e91..6aa11bd3 100644 --- a/doc_source/troubleshooting-images.md +++ b/doc_source/troubleshooting-images.md @@ -4,7 +4,7 @@ **Issue:** *CodeArtifactUserPendingException error message* -The CodeArtifact is pending optimization\. The function transitions to active state when Lambda completes the optimization\. HTTP response code 500\. +The CodeArtifact is pending optimization\. The function transitions to active state when Lambda completes the optimization\. HTTP response code 409\. **Issue:** *CodeArtifactUserDeletedException error message* diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md index 3d9f1b2f..94a8dc72 100644 --- a/doc_source/troubleshooting-invocation.md +++ b/doc_source/troubleshooting-invocation.md @@ -15,7 +15,7 @@ Your AWS Identity and Access Management \(IAM\) user, or the role that you assum **Note** Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeFunction`\) doesn't match the name of the API operation \(`Invoke`\) for invoking a function\. -For more information, see [AWS Lambda permissions](lambda-permissions.md)\. +For more information, see [Lambda permissions](lambda-permissions.md)\. ## Lambda: Operation cannot be performed ResourceConflictException diff --git a/doc_source/typescript-exceptions.md b/doc_source/typescript-exceptions.md index 246b6923..4ec551de 100644 --- a/doc_source/typescript-exceptions.md +++ b/doc_source/typescript-exceptions.md @@ -60,7 +60,7 @@ Metadata: # Manage esbuild properties - app.ts ``` -**Example for the AWS Cloud Development Kit \(CDK\)** +**Example for the AWS Cloud Development Kit \(AWS CDK\)** To use a source map with an AWS CDK application, add the following code to the file that contains the [NodejsFunction construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html)\. ``` diff --git a/doc_source/typescript-image.md b/doc_source/typescript-image.md index 6c1309b5..58f40877 100644 --- a/doc_source/typescript-image.md +++ b/doc_source/typescript-image.md @@ -4,7 +4,7 @@ You can deploy your TypeScript code to an AWS Lambda function as a Node\.js [con If you use a community or private enterprise base image, you must [add the Node\.js runtime interface client \(RIC\)](nodejs-image.md#nodejs-image-clients) to the base image to make it compatible with Lambda\. For more information, see [Creating images from alternative base images](images-create.md#images-create-from-alt)\. -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md)locally\. +Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image locally](images-test.md)\. ## Using a Node\.js base image to build and package TypeScript function code diff --git a/doc_source/typescript-package.md b/doc_source/typescript-package.md index 8171f2b7..ef90fa70 100644 --- a/doc_source/typescript-package.md +++ b/doc_source/typescript-package.md @@ -2,7 +2,7 @@ Before you can deploy TypeScript code to AWS Lambda, you need to transpile it into JavaScript\. This page explains three ways to build and deploy TypeScript code to Lambda: + [Using the AWS Serverless Application Model \(AWS SAM\)](#aws-sam-ts) -+ [Using the AWS Cloud Development Kit \(CDK\)](#aws-cdk-ts) ++ [Using the AWS Cloud Development Kit \(AWS CDK\)](#aws-cdk-ts) + [Using the AWS Command Line Interface \(AWS CLI\) and esbuild](#aws-cli-ts) The AWS SAM and AWS CDK simplify building and deploying TypeScript functions\. The [AWS SAM template specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) provides a simple and clean syntax to describe the Lambda functions, APIs, permissions, configurations, and events that make up your serverless application\. The [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/home.html) lets you build reliable, scalable, cost\-effective applications in the cloud with the considerable expressive power of a programming language\. The AWS CDK is intended for moderately to highly experienced AWS users\. Both the AWS CDK and the AWS SAM use esbuild to transpile TypeScript code into JavaScript\. @@ -97,7 +97,7 @@ To complete the steps in this section, you must have the following: npm install -D @types/aws-lambda ``` -1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create new two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. +1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. 1. Open **hello\-world\.function\.ts** and add the following code to the file\. This is the code for the Lambda function\. diff --git a/doc_source/urls-auth.md b/doc_source/urls-auth.md index 132ed002..c2b1e4f1 100644 --- a/doc_source/urls-auth.md +++ b/doc_source/urls-auth.md @@ -6,7 +6,7 @@ The `AuthType` parameter determines how Lambda authenticates or authorizes reque + `AWS_IAM` – Lambda uses AWS Identity and Access Management \(IAM\) to authenticate and authorize requests based on the IAM principal's identity policy and the function's resource\-based policy\. Choose this option if you want only authenticated IAM users and roles to invoke your function via the function URL\. + `NONE` – Lambda doesn't perform any authentication before invoking your function\. However, your function's resource\-based policy is always in effect and must grant public access before your function URL can receive requests\. Choose this option to allow public, unauthenticated access to your function URL\. -In addition to `AuthType`, you can also use resource\-based policies to grant permissions to other AWS accounts to invoke your function\. For more information, see [Using resource\-based policies for AWS Lambda](access-control-resource-based.md)\. +In addition to `AuthType`, you can also use resource\-based policies to grant permissions to other AWS accounts to invoke your function\. For more information, see [Using resource\-based policies for Lambda](access-control-resource-based.md)\. For additional insights into security, you can use AWS Identity and Access Management Access Analyzer to get a comprehensive analysis of external access to your function URL\. IAM Access Analyzer also monitors for new or updated permissions on your Lambda functions to help you identify permissions that grant public and cross\-account access\. IAM Access Analyzer is free to use for any AWS customer\. To get started with IAM Access Analyzer, see [Using AWS IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html)\. @@ -115,7 +115,8 @@ If you choose the `NONE` auth type, Lambda doesn't use IAM to authenticate reque ``` **Note** -When you create a function URL with auth type `NONE` via the console or AWS Serverless Application Model \(AWS SAM\), Lambda automatically creates the preceding resource\-based policy statement for you\. \(If the policy already exists, or the user or role creating the application doesn't have the appropriate permissions, then Lambda won't create it for you\.\) If you're using the AWS CLI, AWS CloudFormation, or the Lambda API directly, you must add `lambda:InvokeFunctionUrl` permissions yourself\. This makes your function public\. +When you create a function URL with auth type `NONE` via the console or AWS Serverless Application Model \(AWS SAM\), Lambda automatically creates the preceding resource\-based policy statement for you\. If the policy already exists, or the user or role creating the application doesn't have the appropriate permissions, then Lambda won't create it for you\. If you're using the AWS CLI, AWS CloudFormation, or the Lambda API directly, you must add `lambda:InvokeFunctionUrl` permissions yourself\. This makes your function public\. +In addition, if you delete your function URL with auth type `NONE`, Lambda doesn't automatically delete the associated resource\-based policy\. If you want to delete this policy, you must manually do so\. In this statement, the `lambda:FunctionUrlAuthType` condition key value is `NONE`\. This policy statement allows access only when your function URL's auth type is also `NONE`\. diff --git a/doc_source/urls-configuration.md b/doc_source/urls-configuration.md index ac829a33..c73629bd 100644 --- a/doc_source/urls-configuration.md +++ b/doc_source/urls-configuration.md @@ -1,13 +1,11 @@ # Creating and managing Lambda function URLs -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: ``` https://.lambda-url..on.aws ``` -Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. - **Topics** + [Creating a function URL \(console\)](#create-url-console) + [Creating a function URL \(AWS CLI\)](#create-url-cli) @@ -15,7 +13,7 @@ Lambda generates the `` portion of the endpoint based on a number of fac + [Cross\-origin resource sharing \(CORS\)](#urls-cors) + [Throttling function URLs](#urls-throttling) + [Deactivating function URLs](#urls-deactivating) -+ [Deleting function URLs](#w723aac55c19c39) ++ [Deleting function URLs](#w831aac55c21c37) ## Creating a function URL \(console\) @@ -199,7 +197,7 @@ Whenever your function concurrency exceeds the reserved concurrency, your functi In an emergency, you might want to reject all traffic to your function URL\. To deactivate your function URL, set the reserved concurrency to zero\. This throttles all requests to your function URL, resulting in HTTP `429` status responses\. To reactivate your function URL, delete the reserved concurrency configuration, or set the configuration to an amount greater than zero\. -## Deleting function URLs +## Deleting function URLs When you delete a function URL, you can’t recover it\. Creating a new function URL will result in a different URL address\. @@ -213,4 +211,7 @@ When you delete a function URL, you can’t recover it\. Creating a new function 1. Enter the word *delete* into the field to confirm the deletion\. -1. Choose **Delete**\. \ No newline at end of file +1. Choose **Delete**\. + +**Note** +If you delete a function URL with auth type `NONE`, Lambda doesn't automatically delete the associated resource\-based policy\. If you want to delete this policy, you must manually do so\. \ No newline at end of file diff --git a/doc_source/urls-invocation.md b/doc_source/urls-invocation.md index 3089e34e..eb5c756a 100644 --- a/doc_source/urls-invocation.md +++ b/doc_source/urls-invocation.md @@ -1,13 +1,11 @@ # Invoking Lambda function URLs -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Function URL endpoints have the following format: +A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: ``` https://.lambda-url..on.aws ``` -Lambda generates the `` portion of the endpoint based on a number of factors, including your AWS account ID\. Because this process is deterministic, it may be possible for anyone to retrieve your account ID from the ``\. - Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After configuring your function URL, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. To invoke a function URL, you must have `lambda:InvokeFunctionUrl` permissions\. For more information, see [Security and auth model](urls-auth.md)\. **Topics** @@ -175,14 +173,14 @@ The following examples show how the output of your Lambda function maps to the r | Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | | --- | --- | --- | -|
"Hello, world!"
|
{
"statusCode": 200,
"body": "Hello, world!",
"headers": {
"content-type": "application/json"
}
"isBase64Encoded": false,
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 15

"Hello, world!"
| +|
"Hello, world!"
|
{
"statusCode": 200,
"body": "Hello, world!",
"headers": {
"content-type": "application/json"
},
"isBase64Encoded": false
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 15

"Hello, world!"
| **Example output for a JSON response** | Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | | --- | --- | --- | -|
{
"message": "Hello, world!"
}
|
{
"statusCode": 200,
"body": {
"message": "Hello, world!"
},
"headers": {
"content-type": "application/json"
}
"isBase64Encoded": false,
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 34

{
"message": "Hello, world!"
}
| +|
{
"message": "Hello, world!"
}
|
{
"statusCode": 200,
"body": {
"message": "Hello, world!"
},
"headers": {
"content-type": "application/json"
},
"isBase64Encoded": false
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 34

{
"message": "Hello, world!"
}
| **Example output for a custom response** diff --git a/doc_source/urls-tutorial.md b/doc_source/urls-tutorial.md index f9f2ca9f..22beae56 100644 --- a/doc_source/urls-tutorial.md +++ b/doc_source/urls-tutorial.md @@ -1,6 +1,6 @@ # Tutorial: Creating a Lambda function with a function URL -In this tutorial, you create a Lambda function defined as a \.zip file archive with a function URL endpoint that returns the product of two numbers\. For more information about configuring function URLs, see [Creating and managing function URLs](urls-configuration.md)\. +In this tutorial, you create a Lambda function defined as a \.zip file archive with a **public** function URL endpoint that returns the product of two numbers\. For more information about configuring function URLs, see [Creating and managing function URLs](urls-configuration.md)\. ## Prerequisites @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create an execution role @@ -77,6 +80,17 @@ Create a Lambda function with a function URL endpoint using a \.zip file archive --role arn:aws:iam::123456789012:role/lambda-url-role ``` +1. Add a resource\-based policy to your function granting permissions to allow public access to your function URL\. + + ``` + aws lambda add-permission + --function-name my-url-function \ + --action lambda:InvokeFunctionUrl \ + --principal "*" \ + --function-url-auth-type "NONE" \ + --statement-id url + ``` + 1. Create a URL endpoint for the function with the `create-function-url-config` command\. ``` diff --git a/doc_source/welcome.md b/doc_source/welcome.md index 4e77d8df..28a9f0a4 100644 --- a/doc_source/welcome.md +++ b/doc_source/welcome.md @@ -1,6 +1,6 @@ # What is AWS Lambda? -Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, code monitoring and logging\. With Lambda, you can run code for virtually any type of application or backend service\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. +Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, and logging\. With Lambda, you can run code for virtually any type of application or backend service\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. **Note** In the AWS Lambda Developer Guide, we assume that you have experience with coding, compiling, and deploying programs using one of the supported languages\. @@ -95,7 +95,7 @@ You can create, invoke, and manage your Lambda functions using any of the follow + **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Lambda console](foundation-console.md)\. + **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using Lambda with the AWS CLI](gettingstarted-awscli.md)\. + **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. -+ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(CDK\)](http://aws.amazon.com/cdk)\. ++ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. + **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [SAM CLI](lambda-settingup.md#lambda-settingup-samcli)\. diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md index 9b71a9ac..ba13575d 100644 --- a/doc_source/with-android-example.md +++ b/doc_source/with-android-example.md @@ -22,7 +22,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role @@ -97,7 +100,7 @@ Invoke the function manually using the sample event data\. --payload file://file-path/input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. ## Create an Amazon Cognito identity pool diff --git a/doc_source/with-cloudtrail-example.md b/doc_source/with-cloudtrail-example.md deleted file mode 100644 index 56ef6580..00000000 --- a/doc_source/with-cloudtrail-example.md +++ /dev/null @@ -1,254 +0,0 @@ -# Tutorial: Triggering a Lambda function with AWS CloudTrail events - -You can configure Amazon S3 to publish events to AWS Lambda when AWS CloudTrail stores API call logs\. Your Lambda function can read the log object and process the access records logged by CloudTrail\. - -Use the following instructions to create a Lambda function that notifies you when a specific API call is made in your account\. The function processes notification events from Amazon S3, reads logs from a bucket, and publishes alerts through an Amazon SNS topic\. For this tutorial, you create: -+ A CloudTrail trail and an S3 bucket to save logs to\. -+ An Amazon SNS topic to publish alert notifications\. -+ An IAM user role with permissions to read items from an S3 bucket and write logs to Amazon CloudWatch\. -+ A Lambda function that processes CloudTrail logs and sends a notification whenever an Amazon SNS topic is created\. - -## Requirements - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -Before you begin, make sure that you have the following tools: -+ [Node\.js 12\.x with `npm`](https://nodejs.org/en/download/releases/)\. -+ The Bash shell\. For Linux and macOS, this is included by default\. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -+ [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -## Step 1: Creating a trail in CloudTrail - -When you create a trail, CloudTrail records the API calls in log files and stores them in Amazon S3\. A CloudTrail log is an unordered array of events in JSON format\. For each call to a supported API action, CloudTrail records information about the request and the entity that made it\. Log events include the action name, parameters, response values, and details about the requester\. - -**To create a trail** - -1. Open the [**Trails** page of the CloudTrail console](https://console.aws.amazon.com/cloudtrail/home#/configuration)\. - -1. Choose **Create trail**\. - -1. For **Trail name**, enter a name\. - -1. For **S3 bucket**, enter a name\. - -1. Choose **Create**\. - -1. Save the bucket Amazon Resource Name \(ARN\) to add it to the IAM execution role, which you create later\. - -## Step 2: Creating an Amazon SNS topic - - Create an Amazon SNS topic to send out a notification when new object events have occurred\. - -**To create a topic** - -1. Open the [**Topics** page of the Amazon SNS console](https://console.aws.amazon.com/sns/home#/topics)\. - -1. Choose **Create topic**\. - -1. For **Topic name**, enter a name\. - -1. Choose **Create topic**\. - -1. Record the topic ARN\. You will need it when you create the IAM execution role and Lambda function\. - -## Step 3: Creating an IAM execution role - -An [execution role](lambda-intro-execution-role.md) gives your function permission to access AWS resources\. Create an execution role that grants the function permission to access CloudWatch Logs, Amazon S3, and Amazon SNS\. - -**To create an execution role** - -1. Open the [**Roles** page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties: - + For **Trusted entity**, choose **Lambda**\. - + For **Role name**, enter **lambda\-cloudtrail\-role**\. - + For **Permissions**, create a custom policy with the following statements\. Replace the highlighted values with the names of your bucket and topic\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "logs:*" - ], - "Resource": "arn:aws:logs:*:*:*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::my-bucket/*" - }, - { - "Effect": "Allow", - "Action": [ - "sns:Publish" - ], - "Resource": "arn:aws:sns:us-west-2:123456789012:my-topic" - } - ] - } - ``` - -1. Record the role ARN\. You will need it when you create the Lambda function\. - -## Step 4: Creating the Lambda function - -The following Lambda function processes CloudTrail logs, and sends a notification through Amazon SNS when a new Amazon SNS topic is created\. - -**To create the function** - -1. Create a folder and give it a name that indicates that it's your Lambda function \(for example, *lambda\-cloudtrail*\)\. - -1. In the folder, create a file named `index.js`\. - -1. Paste the following code into `index.js`\. Replace the Amazon SNS topic ARN with the ARN that Amazon S3 created when you created the Amazon SNS topic\. - - ``` - var aws = require('aws-sdk'); - var zlib = require('zlib'); - var async = require('async'); - - var EVENT_SOURCE_TO_TRACK = /sns.amazonaws.com/; - var EVENT_NAME_TO_TRACK = /CreateTopic/; - var DEFAULT_SNS_REGION = 'us-east-2'; - var SNS_TOPIC_ARN = 'arn:aws:sns:us-west-2:123456789012:my-topic'; - - var s3 = new aws.S3(); - var sns = new aws.SNS({ - apiVersion: '2010-03-31', - region: DEFAULT_SNS_REGION - }); - - exports.handler = function(event, context, callback) { - var srcBucket = event.Records[0].s3.bucket.name; - var srcKey = event.Records[0].s3.object.key; - - async.waterfall([ - function fetchLogFromS3(next){ - console.log('Fetching compressed log from S3...'); - s3.getObject({ - Bucket: srcBucket, - Key: srcKey - }, - next); - }, - function uncompressLog(response, next){ - console.log("Uncompressing log..."); - zlib.gunzip(response.Body, next); - }, - function publishNotifications(jsonBuffer, next) { - console.log('Filtering log...'); - var json = jsonBuffer.toString(); - console.log('CloudTrail JSON from S3:', json); - var records; - try { - records = JSON.parse(json); - } catch (err) { - next('Unable to parse CloudTrail JSON: ' + err); - return; - } - var matchingRecords = records - .Records - .filter(function(record) { - return record.eventSource.match(EVENT_SOURCE_TO_TRACK) - && record.eventName.match(EVENT_NAME_TO_TRACK); - }); - - console.log('Publishing ' + matchingRecords.length + ' notification(s) in parallel...'); - async.each( - matchingRecords, - function(record, publishComplete) { - console.log('Publishing notification: ', record); - sns.publish({ - Message: - 'Alert... SNS topic created: \n TopicARN=' + record.responseElements.topicArn + '\n\n' + - JSON.stringify(record), - TopicArn: SNS_TOPIC_ARN - }, publishComplete); - }, - next - ); - } - ], function (err) { - if (err) { - console.error('Failed to publish notifications: ', err); - } else { - console.log('Successfully published all notifications.'); - } - callback(null,"message"); - }); - }; - ``` - -1. In the *lambda\-cloudtrail* folder, run the following script\. It creates a `package-lock.json` file and a `node_modules` folder, which handle all dependencies\. - - ``` - npm install async - ``` - -1. Run the following script to create a deployment package\. - - ``` - zip -r function.zip . - ``` - -1. Create a Lambda function named CloudTrailEventProcessing with the `create-function` command by running the following script\. Make the indicated replacements\. - - ``` - aws lambda create-function --function-name CloudTrailEventProcessing \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-cloudtrail-role - ``` - -## Step 5: Adding permissions to the Lambda function policy - -The Lambda function's resource policy needs permissions to allow Amazon S3 to invoke the function\. - -**To give Amazon S3 permissions to invoke the function** - -1. Run the following `add-permission` command\. Replace the ARN and account ID with your own\. - - ``` - aws lambda add-permission --function-name CloudTrailEventProcessing \ - --statement-id Id-1 --action "lambda:InvokeFunction" --principal s3.amazonaws.com \ - --source-arn arn:aws:s3:::my-bucket \ - --source-account 123456789012 - ``` - - This command grants the Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Invoke permissions are granted to Amazon S3 only if the following conditions are met: - + CloudTrail stores a log object in the specified bucket\. - + The bucket is owned by the specified AWS account\. If the bucket owner deletes a bucket, another AWS account can create a bucket with the same name\. This condition ensures that only the specified AWS account can invoke your Lambda function\. - -1. To view the Lambda function's access policy, run the following `get-policy` command, and replace the function name\. - - ``` - aws lambda get-policy --function-name function-name - ``` - -## Step 6: Configuring notifications on an Amazon S3 bucket - -To request that Amazon S3 publishes object\-created events to Lambda, add a notification configuration to the S3 bucket\. In the configuration, you specify the following: -+ Event type – Any event types that create objects\. -+ Lambda function – The Lambda function that you want Amazon S3 to invoke\. - -**To configure notifications** - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Choose the source bucket\. - -1. Choose **Properties**\. - -1. Under **Events**, configure a notification with the following settings: - + **Name** – **lambda\-trigger** - + **Events** – **All object create events** - + **Send to** – **Lambda function** - + **Lambda** – **CloudTrailEventProcessing** - -When CloudTrail stores logs in the bucket, Amazon S3 sends an event to the function\. The event provides information, including the bucket name and key name of the log object that CloudTrail created\. \ No newline at end of file diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md index 9f23f3e6..c65c5529 100644 --- a/doc_source/with-cloudtrail.md +++ b/doc_source/with-cloudtrail.md @@ -81,5 +81,4 @@ For detailed information about how to configure Amazon S3 as the event source, s **Topics** + [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) -+ [Tutorial: Triggering a Lambda function with AWS CloudTrail events](with-cloudtrail-example.md) + [Sample function code](with-cloudtrail-create-package.md) \ No newline at end of file diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md index 31e4fbe5..43ede930 100644 --- a/doc_source/with-ddb-example.md +++ b/doc_source/with-ddb-example.md @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role @@ -185,7 +188,7 @@ Run the following `invoke` command\. aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt ``` -The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. The function returns the string `message` in the response body\. diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md index 45371233..2dd35ee6 100644 --- a/doc_source/with-ddb.md +++ b/doc_source/with-ddb.md @@ -32,7 +32,7 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "INSERT", - "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", + "eventSourceARN": "arn:aws:dynamodb:us-west-2:111122223333:table/TestTable/stream/2015-05-11T21:21:33.291", "eventSource": "aws:dynamodb" }, { @@ -66,7 +66,7 @@ Lambda reads records from the stream and invokes your function [synchronously](i }, "awsRegion": "us-west-2", "eventName": "MODIFY", - "eventSourceARN": "arn:aws:dynamodb:us-east-1:111122223333:table/EventSourceTable", + "eventSourceARN": "arn:aws:dynamodb:us-west-2:111122223333:table/TestTable/stream/2015-05-11T21:21:33.291", "eventSource": "aws:dynamodb" } ]} @@ -78,7 +78,7 @@ By default, Lambda invokes your function as soon as records are available\. If t If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. -You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the shard level\. Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. @@ -103,7 +103,7 @@ Lambda needs the following permissions to manage resources related to your Dynam + [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) + [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) -The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. +The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [Lambda execution role](lambda-intro-execution-role.md)\. To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) @@ -141,7 +141,7 @@ Lambda supports the following options for DynamoDB event sources\. + **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. -+ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. ++ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. Your original batch size setting remains unchanged\. + **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. @@ -327,7 +327,7 @@ Lambda functions can run continuous stream processing applications\. A stream re Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. -Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. +Each record in a stream belongs to a specific window\. Lambda will process each record at least once, but doesn't guarantee that each record will be processed only once\. In rare cases, such as error handling, some records might be processed more than once\. Records are always processed in order the first time\. If records are processed more than once, they might be processed out of order\. ### Aggregation and processing @@ -520,6 +520,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl } ``` +**Note** +If the `batchItemFailures` array contains multiple items, Lambda uses the record with the lowest sequence number as the checkpoint\. Lambda then retries all records starting from that checkpoint\. + ### Success and failure conditions Lambda treats a batch as a complete success if you return any of the following: @@ -572,9 +575,10 @@ public class ProcessDynamodbRecords implements RequestHandler + +When setting up Kafka as an event source, you can specify a consumer group ID\. This consumer group ID is an existing identifier for the Kafka consumer group that you want your Lambda function to join\. You can use this feature to seamlessly migrate any ongoing Kafka record processing setups from other consumers to Lambda\. + +If you specify a consumer group ID and there are other active pollers within that consumer group, Kafka distributes messages across all consumers\. In other words, Lambda doesn't receive all message for the Kafka topic\. If you want Lambda to handle all messages in the topic, turn off any other pollers in that consumer group\. + +Additionally, if you specify a consumer group ID, and Kafka finds a valid existing consumer group with the same ID, Lambda ignores the `StartingPosition` parameter for your event source mapping\. Instead, Lambda begins processing records according to the committed offset of the consumer group\. If you specify a consumer group ID, and Kafka cannot find an existing consumer group, then Lambda configures your event source with the specified `StartingPosition`\. + +The consumer group ID that you specify must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. + ### Adding a self\-managed Kafka cluster \(console\) Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. @@ -321,6 +332,10 @@ Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka to 1. \(Optional\) For **Batch size**, enter the maximum number of records to receive in a single batch\. + 1. For **Batch window**, enter the maximum amount of seconds that Lambda spends gathering records before invoking the function\. + + 1. \(Optional\) For **Consumer group ID**, enter the ID of a Kafka consumer group to join\. + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. 1. \(Optional\) For **VPC**, choose the Amazon VPC for your Kafka cluster\. Then, choose the **VPC subnets** and **VPC security groups**\. @@ -401,7 +416,8 @@ Lambda processes records from one or more Kafka topic partitions that you specif If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. -Lambda can run your function for up to 14 minutes\. Configure your function timeout to be 14 minutes or less \(the default timeout value is 3 seconds\)\. Lambda may retry invocations that exceed 14 minutes\. +**Note** +While Lambda functions typically have a maximum timeout limit of 15 minutes, event source mappings for Amazon MSK, self\-managed Apache Kafka, and Amazon MQ for ActiveMQ and RabbitMQ only support functions with maximum timeout limits of 14 minutes\. This constraint ensures that the event source mapping can properly handle function errors and retries\. ## Auto scaling of the Kafka event source @@ -447,9 +463,9 @@ If your Lambda event records exceed the allowed size limit of 6 MB, they can go ## Amazon CloudWatch metrics -Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic and the last record that your function's consumer group processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your consumer group processes it\. -An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in `OffsetLag` can indicate issues with pollers in your function's consumer group\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Self\-managed Apache Kafka configuration parameters @@ -463,7 +479,10 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | BatchSize | N | 100 | Maximum: 10,000 | | Enabled | N | Enabled | | | FunctionName | Y | | | -| SelfManagedEventSource | Y | | List of Kafka Brokers\. Can set only on Create | +| FilterCriteria | N | | [Lambda event filtering](invocation-eventfiltering.md) | +| MaximumBatchingWindowInSeconds | N | 500 ms | [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching) | +| SelfManagedEventSource | Y | | List of Kafka Brokers\. Can set only on Create | +| SelfManagedKafkaEventSourceConfig | N | Contains the ConsumerGroupId field which defaults to a unique value\. | Can set only on Create | | SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | | StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | | Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md index d538c576..5b849b21 100644 --- a/doc_source/with-kinesis-example.md +++ b/doc_source/with-kinesis-example.md @@ -26,7 +26,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role @@ -122,7 +125,7 @@ Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command a aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. The response is saved to `out.txt`\. diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md index 325c0d8f..d0d9270e 100644 --- a/doc_source/with-kinesis.md +++ b/doc_source/with-kinesis.md @@ -57,7 +57,7 @@ By default, Lambda invokes your function as soon as records are available\. If t If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. -You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the partition\-key level\. +You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the shard level\. Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. @@ -116,7 +116,7 @@ Lambda needs the following permissions to manage resources that are related to y + [kinesis:ListStreams](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreams.html) + [kinesis:SubscribeToShard](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_SubscribeToShard.html) -The `AWSLambdaKinesisExecutionRole` managed policy includes these permissions\. For more information, see [AWS Lambda execution role](lambda-intro-execution-role.md)\. +The `AWSLambdaKinesisExecutionRole` managed policy includes these permissions\. For more information, see [Lambda execution role](lambda-intro-execution-role.md)\. To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: + **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) @@ -156,7 +156,7 @@ Lambda supports the following options for Kinesis event sources\. + **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. + **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. + **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. -+ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. ++ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. Your original batch size setting remains unchanged\. + **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. + **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. @@ -345,7 +345,7 @@ Lambda functions can run continuous stream processing applications\. A stream re Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. -Each record of a stream belongs to a specific window\. A record is processed only once, when Lambda processes the window that the record belongs to\. In each window, you can perform calculations, such as a sum or average, at the [partition key](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) level within a shard\. +Each record in a stream belongs to a specific window\. Lambda will process each record at least once, but doesn't guarantee that each record will be processed only once\. In rare cases, such as error handling, some records might be processed more than once\. Records are always processed in order the first time\. If records are processed more than once, they might be processed out of order\. ### Aggregation and processing @@ -469,6 +469,9 @@ When configuring reporting on batch item failures, the `StreamsEventResponse` cl } ``` +**Note** +If the `batchItemFailures` array contains multiple items, Lambda uses the record with the lowest sequence number as the checkpoint\. Lambda then retries all records starting from that checkpoint\. + ### Success and failure conditions Lambda treats a batch as a complete success if you return any of the following: @@ -520,9 +523,10 @@ public class ProcessKinesisRecords implements RequestHandler @@ -85,7 +89,7 @@ Amazon MSK doesn't support SASL/PLAIN authentication\. ### IAM role\-based authentication -You can use IAM to authenticate the identity of clients that connect to the MSK cluster\. To create and deploy IAM user or role\-based policies, use the IAM console or API\. For more information, see [IAM access control](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. +You can use IAM to authenticate the identity of clients that connect to the MSK cluster\. If IAM auth is active on your MSK cluster, and you don't provide a secret for auth, Lambda automatically defaults to using IAM auth\. To create and deploy IAM user or role\-based policies, use the IAM console or API\. For more information, see [IAM access control](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. To allow Lambda to connect to the MSK cluster, read records, and perform other required actions, add the following permissions to your function's [execution role](lambda-intro-execution-role.md)\. @@ -106,14 +110,14 @@ To allow Lambda to connect to the MSK cluster, read records, and perform other r "Resource": [ "arn:aws:kafka:region:account-id:cluster/cluster-name/cluster-uuid", "arn:aws:kafka:region:account-id:topic/cluster-name/cluster-uuid/topic-name", - "arn:aws:kafka:region:account-id:group/cluster-name/cluster-uuid/group-name" + "arn:aws:kafka:region:account-id:group/cluster-name/cluster-uuid/consumer-group-id" ] } ] } ``` -You can scope these permissions to a specific cluster, topic, and group\. For more information, see the [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. The group name that IAM uses is equivalent to the event source mapping's UUID\. +You can scope these permissions to a specific cluster, topic, and group\. For more information, see the [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. ### Mutual TLS authentication @@ -188,6 +192,18 @@ zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== } ``` +### How Lambda chooses a bootstrap broker + +Lambda chooses a [ bootstrap broker](https://docs.aws.amazon.com/msk/latest/developerguide/msk-get-bootstrap-brokers.html) based on the authentication methods available on your cluster, and whether you provide a secret for authentication\. If you provide a secret for mTLS or SASL/SCRAM, Lambda automatically chooses that auth method\. If you don't provide a secret, Lambda selects the strongest auth method that's active on your cluster\. The following is the order of priority in which Lambda selects a broker, from strongest to weakest auth: ++ mTLS \(secret provided for mTLS\) ++ SASL/SCRAM \(secret provided for SASL/SCRAM\) ++ SASL IAM \(no secret provided, and IAM auth active\) ++ Unauthenticated TLS \(no secret provided, and IAM auth not active\) ++ Plaintext \(no secret provided, and both IAM auth and unauthenticated TLS are not active\) + +**Note** +If Lambda can't connect to the most secure broker type, Lambda doesn't attempt to connect to a different \(weaker\) broker type\. If you want Lambda to choose a weaker broker type, deactivate all stronger auth methods on your cluster\. + ## Managing API access and permissions In addition to accessing the Amazon MSK cluster, your function needs permissions to perform various Amazon MSK API actions\. You add these permissions to the function's execution role\. If your users need access to any of the Amazon MSK API actions, add the required permissions to the identity policy for the IAM user or role\. @@ -195,6 +211,7 @@ In addition to accessing the Amazon MSK cluster, your function needs permissions ### Required Lambda function execution role permissions Your Lambda function's [execution role](lambda-intro-execution-role.md) must have the following permissions to access the MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: ++ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) + [kafka:DescribeClusterV2](https://docs.aws.amazon.com/MSK/2.0/APIReference/v2-clusters-clusterarn.html#v2-clusters-clusterarnget) + [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) + [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) @@ -207,6 +224,9 @@ Your Lambda function's [execution role](lambda-intro-execution-role.md) must hav + [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) + [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) +**Note** +Lambda eventually plans to remove the `kafka:DescribeCluster` permission from this policy\. You should migrate any applications using `kafka:DescribeCluster` to use `kafka:DescribeClusterV2` instead\. + ### Adding permissions to your execution role Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. @@ -277,7 +297,7 @@ This error indicates that the Amazon MSK consumer couldn't use the provided cert ## Network configuration -Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If authentication is required, also deploy a VPC endpoint for Secrets Manager\. +Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy [AWS PrivateLink VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html) for Lambda and AWS Security Token Service \(AWS STS\)\. The poller needs access to AWS STS to assume the execution role associated with the Lambda function\. Lambda must have access to the Lambda VPC endpoint to invoke the function\. If you configured a secret in Secrets Manager to authenticate Lambda with the brokers, also [deploy a VPC endpoint for Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/vpc-endpoint-overview.html)\. Alternatively, ensure that the VPC associated with your MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. @@ -293,7 +313,7 @@ For more information about configuring the network, see [Setting up AWS Lambda w ## Adding Amazon MSK as an event source -To create an [event source mapping](invocation-eventsourcemapping.md), add Amazon MSK as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. +To create an [event source mapping](invocation-eventsourcemapping.md), add Amazon MSK as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. Note that when you add Amazon MSK as a trigger, Lambda assumes the VPC settings of the Amazon MSK cluster, not the Lambda function's VPC settings\. This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. @@ -301,6 +321,16 @@ This section describes how to create an event source mapping using the Lambda co + An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. + An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. +### Customizable consumer group ID + +When setting up Kafka as an event source, you can specify a consumer group ID\. This consumer group ID is an existing identifier for the Kafka consumer group that you want your Lambda function to join\. You can use this feature to seamlessly migrate any ongoing Kafka record processing setups from other consumers to Lambda\. + +If you specify a consumer group ID and there are other active pollers within that consumer group, Kafka distributes messages across all consumers\. In other words, Lambda doesn't receive all message for the Kafka topic\. If you want Lambda to handle all messages in the topic, turn off any other pollers in that consumer group\. + +Additionally, if you specify a consumer group ID, and Kafka finds a valid existing consumer group with the same ID, Lambda ignores the `StartingPosition` parameter for your event source mapping\. Instead, Lambda begins processing records according to the committed offset of the consumer group\. If you specify a consumer group ID, and Kafka cannot find an existing consumer group, then Lambda configures your event source with the specified `StartingPosition`\. + +The consumer group ID that you specify must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. + ### Adding an Amazon MSK trigger \(console\) Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. @@ -321,8 +351,12 @@ Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger 1. For **Batch size**, enter the maximum number of messages to receive in a single batch\. + 1. For **Batch window**, enter the maximum amount of seconds that Lambda spends gathering records before invoking the function\. + 1. For **Topic name**, enter the name of a Kafka topic\. + 1. \(Optional\) For **Consumer group ID**, enter the ID of a Kafka consumer group to join\. + 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. 1. \(Optional\) For **Authentication**, choose the secret key for authenticating with the brokers in your MSK cluster\. @@ -372,9 +406,9 @@ To check how many function invocations occur in parallel, you can also monitor t ## Amazon CloudWatch metrics -Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic, and the last record that Lambda processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your function processes it\. +Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic and the last record that your function's consumer group processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your consumer group processes it\. -An increasing trend in `OffsetLag` can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. +An increasing trend in `OffsetLag` can indicate issues with pollers in your function's consumer group\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. ## Amazon MSK configuration parameters @@ -385,10 +419,13 @@ All Lambda event source types share the same [CreateEventSourceMapping](API_Crea | Parameter | Required | Default | Notes | | --- | --- | --- | --- | +| AmazonManagedKafkaEventSourceConfig | N | Contains the ConsumerGroupId field, which defaults to a unique value\. | Can set only on Create | | BatchSize | N | 100 | Maximum: 10,000 | | Enabled | N | Enabled | | | EventSourceArn | Y | | Can set only on Create | | FunctionName | Y | | | -| SourceAccessConfigurations | N | No credentials | VPC information or SASL/SCRAM authentication credentials for your event source | +| FilterCriteria | N | | [Lambda event filtering](invocation-eventfiltering.md) | +| MaximumBatchingWindowInSeconds | N | 500 ms | [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching) | +| SourceAccessConfigurations | N | No credentials | SASL/SCRAM or CLIENT\_CERTIFICATE\_TLS\_AUTH \(MutualTLS\) authentication credentials for your event source | | StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | | Topics | Y | | Kafka topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md index 42c9c8bc..13bbe139 100644 --- a/doc_source/with-s3-tutorial.md +++ b/doc_source/with-s3-tutorial.md @@ -3,12 +3,12 @@ In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. **Note** -This tutorial requires a moderate level of AWS and Lambda domain knowledge, Docker operations, and [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. +This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: **Lambda resources** -+ A Lambda function\. You can choose Node\.js, Python, or Java for the function code\. ++ A Lambda function\. You can choose Node\.js or Python for the function code\. + A \.zip file archive deployment package for the function\. + An access policy that grants Amazon S3 permission to invoke the function\. @@ -24,41 +24,16 @@ This tutorial requires a moderate level of AWS and Lambda domain knowledge, Dock + [Step 1\. Create S3 buckets and upload a sample object](#with-s3-tutorial-prepare-create-buckets) + [Step 2\. Create the IAM policy](#with-s3-tutorial-create-policy) + [Step 3\. Create the execution role](#with-s3-tutorial-create-execution-role) -+ [Step 4\. Create the function code](#with-s3-tutorial-create-function-code) -+ [Step 5\. Create the deployment package](#with-s3-tutorial-create-function-package) -+ [Step 6\. Create the Lambda function](#with-s3-tutorial-create-function-createfunction) -+ [Step 7\. Test the Lambda function](#s3-tutorial-events-adminuser-create-test-function-upload-zip-test-manual-invoke) -+ [Step 8\. Configure Amazon S3 to publish events](#with-s3-tutorial-configure-event-source) -+ [Step 9\. Test using the S3 trigger](#with-s3-tutorial-configure-event-source-test-end-to-end) -+ [Step 10\. Clean up your resources](#s3-tutorial-cleanup) ++ [Step 4\. Create the deployment package](#with-s3-tutorial-create-function-package) ++ [Step 5\. Create the Lambda function](#with-s3-tutorial-create-function-createfunction) ++ [Step 6\. Test the Lambda function](#s3-tutorial-events-adminuser-create-test-function-upload-zip-test-manual-invoke) ++ [Step 7\. Configure Amazon S3 to publish events](#with-s3-tutorial-configure-event-source) ++ [Step 8\. Test using the Amazon S3 trigger](#with-s3-tutorial-configure-event-source-test-end-to-end) ++ [Step 9\. Clean up your resources](#s3-tutorial-cleanup) ## Prerequisites -+ AWS account - - To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) -+ Command line - - To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - - ``` - aws --version - ``` - - You should see the following output: - - ``` - aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 - ``` - - For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - - On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. -+ AWS CLI - - In this tutorial, you use AWS CLI commands to create and invoke the Lambda function\. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. -+ Language tools - - Install the language support tools and a package manager for the language that you want to use: Node\.js, Python, or Java\. For suggested tools, see [Code authoring tools](lambda-settingup.md#lambda-settingup-author)\. ++ [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. ++ Install the language support tools and a package manager for the language that you want to use \(Node\.js or Python\)\. For suggested tools, see [Code authoring tools](lambda-settingup.md#lambda-settingup-author)\. ## Step 1\. Create S3 buckets and upload a sample object @@ -66,11 +41,13 @@ Follow these steps to create S3 buckets and upload an object\. 1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. -1. [Create two S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)\. The target bucket must be named ***source*\-resized**, where *source* is the name of the source bucket\. For example, a source bucket named `mybucket` and a target bucket named `mybucket-resized`\. +1. [Create two S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)\. The target bucket must be named ***source*\-resized**, where *source* is the name of the source bucket\. For example, a source bucket named `sourcebucket` and a target bucket named `sourcebucket-resized`\. +**Note** +Make sure that you create the buckets in the same AWS Region that you plan to use for the Lambda function\. -1. In the source bucket, [upload](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) a \.jpg object, for example, `HappyFace.jpg`\. +1. In the source bucket, [upload](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) a \.jpg or \.png object, for example, `HappyFace.jpg`\. - You must create this sample object before you test your Lambda function\. When you test the function manually using the Lambda invoke command, you pass sample event data to the function that specifies the source bucket name and `HappyFace.jpg` as the newly created object\. + You must create this sample object before you test your Lambda function\. When you test the function manually in step 6, you pass sample event data to the function that specifies the source bucket name and image file name\. ## Step 2\. Create the IAM policy @@ -85,7 +62,7 @@ Create an IAM policy that defines the permissions for the Lambda function\. The 1. Choose **Create policy**\. -1. Choose the **JSON** tab, and then paste the following policy\. Be sure to replace *mybucket* with the name of the source bucket that you created previously\. +1. Choose the **JSON** tab, and then paste the following policy\. Be sure to replace *sourcebucket* with the name of the source bucket that you created previously\. ``` { @@ -105,14 +82,14 @@ Create an IAM policy that defines the permissions for the Lambda function\. The "Action": [ "s3:GetObject" ], - "Resource": "arn:aws:s3:::mybucket/*" + "Resource": "arn:aws:s3:::sourcebucket/*" }, { "Effect": "Allow", "Action": [ "s3:PutObject" ], - "Resource": "arn:aws:s3:::mybucket-resized/*" + "Resource": "arn:aws:s3:::sourcebucket-resized/*" } ] } @@ -141,400 +118,276 @@ Create the [execution role](lambda-intro-execution-role.md) that gives your Lamb + **Permissions policy** – **AWSLambdaS3Policy** + **Role name** – **lambda\-s3\-role** -## Step 4\. Create the function code - -In the following code examples, the Amazon S3 event contains the source S3 bucket name and the object key name\. If the object is a \.jpg or a \.png image file, it reads the image from the source bucket, generates a thumbnail image, and then saves the thumbnail to the target S3 bucket\. +## Step 4\. Create the deployment package -Note the following: -+ The code assumes that the target bucket exists and that its name is a concatenation of the source bucket name and `-resized`\. -+ For each thumbnail file created, the Lambda function code derives the object key name as a concatenation of `resized-` and the source object key name\. For example, if the source object key name is `sample.jpg`, the code creates a thumbnail object that has the key `resized-sample.jpg`\. +The deployment package is a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip) containing your Lambda function code and its dependencies\. ------ #### [ Node\.js ] -Copy the following code example into a file named `index.js`\. - -**Example index\.js** +1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. -``` -// dependencies -const AWS = require('aws-sdk'); -const util = require('util'); -const sharp = require('sharp'); - -// get reference to S3 client -const s3 = new AWS.S3(); - -exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); -}; -``` +1. Create a a directory named `lambda-s3`\. ------- -#### [ Python ] + ``` + mkdir lambda-s3 + ``` -Copy the following code example into a file named `lambda_function.py`\. +1. Save the function code as `index.js`\. -**Example lambda\_function\.py** + ``` + // dependencies + const AWS = require('aws-sdk'); + const util = require('util'); + const sharp = require('sharp'); + + // get reference to S3 client + const s3 = new AWS.S3(); + + exports.handler = async (event, context, callback) => { + + // Read options from the event parameter. + console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); + const srcBucket = event.Records[0].s3.bucket.name; + // Object key may have spaces or unicode non-ASCII characters. + const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); + const dstBucket = srcBucket + "-resized"; + const dstKey = "resized-" + srcKey; + + // Infer the image type from the file suffix. + const typeMatch = srcKey.match(/\.([^.]*)$/); + if (!typeMatch) { + console.log("Could not determine the image type."); + return; + } + + // Check that the image type is supported + const imageType = typeMatch[1].toLowerCase(); + if (imageType != "jpg" && imageType != "png") { + console.log(`Unsupported image type: ${imageType}`); + return; + } + + // Download the image from the S3 source bucket. + + try { + const params = { + Bucket: srcBucket, + Key: srcKey + }; + var origimage = await s3.getObject(params).promise(); + + } catch (error) { + console.log(error); + return; + } + + // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. + const width = 200; + + // Use the sharp module to resize the image and save in a buffer. + try { + var buffer = await sharp(origimage.Body).resize(width).toBuffer(); + + } catch (error) { + console.log(error); + return; + } + + // Upload the thumbnail image to the destination bucket + try { + const destparams = { + Bucket: dstBucket, + Key: dstKey, + Body: buffer, + ContentType: "image" + }; + + const putResult = await s3.putObject(destparams).promise(); + + } catch (error) { + console.log(error); + return; + } + + console.log('Successfully resized ' + srcBucket + '/' + srcKey + + ' and uploaded to ' + dstBucket + '/' + dstKey); + }; + ``` -``` -import boto3 -import os -import sys -import uuid -from urllib.parse import unquote_plus -from PIL import Image -import PIL.Image - -s3_client = boto3.client('s3') - -def resize_image(image_path, resized_path): - with Image.open(image_path) as image: - image.thumbnail(tuple(x / 2 for x in image.size)) - image.save(resized_path) - -def lambda_handler(event, context): - for record in event['Records']: - bucket = record['s3']['bucket']['name'] - key = unquote_plus(record['s3']['object']['key']) - tmpkey = key.replace('/', '') - download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) - upload_path = '/tmp/resized-{}'.format(tmpkey) - s3_client.download_file(bucket, key, download_path) - resize_image(download_path, upload_path) - s3_client.upload_file(upload_path, '{}-resized'.format(bucket), key) -``` +1. In the `lambda-s3` directory, create a `node_modules` directory\. ------- -#### [ Java ] + ``` + mkdir node_modules + cd node_modules + ``` -The Java code implements the `RequestHandler` interface provided in the `aws-lambda-java-core` library\. When you create a Lambda function, you specify the class as the handler \(in this code example, `example.handler`\)\. For more information about using interfaces to provide a handler, see [Handler interfaces](java-handler.md#java-handler-interfaces)\. +1. In the `node_modules` directory, install the sharp library with npm\. -The handler uses `S3Event` as the input type, which provides convenient methods for your function code to read information from the incoming Amazon S3 event\. Amazon S3 invokes your Lambda function asynchronously\. Because you are implementing an interface that requires you to specify a return type, the handler uses `String` as the return type\. + ``` + npm install sharp + ``` -Copy the following code example into a file named `Handler.java`\. + After this step, you have the following directory structure: -**Example Handler\.java** + ``` + lambda-s3 + |- index.js + |- /node_modules/... + └ /node_modules/sharp + ``` -``` -package example; -import java.awt.Color; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.imageio.ImageIO; - -import com.amazonaws.AmazonServiceException; -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; -import com.amazonaws.services.s3.model.GetObjectRequest; -import com.amazonaws.services.s3.model.ObjectMetadata; -import com.amazonaws.services.s3.model.S3Object; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; - -public class Handler implements - RequestHandler { - private static final float MAX_WIDTH = 100; - private static final float MAX_HEIGHT = 100; - private final String JPG_TYPE = (String) "jpg"; - private final String JPG_MIME = (String) "image/jpeg"; - private final String PNG_TYPE = (String) "png"; - private final String PNG_MIME = (String) "image/png"; - - public String handleRequest(S3Event s3event, Context context) { - try { - S3EventNotificationRecord record = s3event.getRecords().get(0); - - String srcBucket = record.getS3().getBucket().getName(); - - // Object key may have spaces or unicode non-ASCII characters. - String srcKey = record.getS3().getObject().getUrlDecodedKey(); - - String dstBucket = srcBucket + "-resized"; - String dstKey = "resized-" + srcKey; - - // Sanity check: validate that source and destination are different - // buckets. - if (srcBucket.equals(dstBucket)) { - System.out - .println("Destination bucket must not match source bucket."); - return ""; - } - - // Infer the image type. - Matcher matcher = Pattern.compile(".*\\.([^\\.]*)").matcher(srcKey); - if (!matcher.matches()) { - System.out.println("Unable to infer image type for key " - + srcKey); - return ""; - } - String imageType = matcher.group(1); - if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { - System.out.println("Skipping non-image " + srcKey); - return ""; - } - - // Download the image from S3 into a stream - AmazonS3 s3Client = AmazonS3ClientBuilder.defaultClient(); - S3Object s3Object = s3Client.getObject(new GetObjectRequest( - srcBucket, srcKey)); - InputStream objectData = s3Object.getObjectContent(); - - // Read the source image - BufferedImage srcImage = ImageIO.read(objectData); - int srcHeight = srcImage.getHeight(); - int srcWidth = srcImage.getWidth(); - // Infer the scaling factor to avoid stretching the image - // unnaturally - float scalingFactor = Math.min(MAX_WIDTH / srcWidth, MAX_HEIGHT - / srcHeight); - int width = (int) (scalingFactor * srcWidth); - int height = (int) (scalingFactor * srcHeight); - - BufferedImage resizedImage = new BufferedImage(width, height, - BufferedImage.TYPE_INT_RGB); - Graphics2D g = resizedImage.createGraphics(); - // Fill with white before applying semi-transparent (alpha) images - g.setPaint(Color.white); - g.fillRect(0, 0, width, height); - // Simple bilinear resize - g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, - RenderingHints.VALUE_INTERPOLATION_BILINEAR); - g.drawImage(srcImage, 0, 0, width, height, null); - g.dispose(); - - // Re-encode image to target format - ByteArrayOutputStream os = new ByteArrayOutputStream(); - ImageIO.write(resizedImage, imageType, os); - InputStream is = new ByteArrayInputStream(os.toByteArray()); - // Set Content-Length and Content-Type - ObjectMetadata meta = new ObjectMetadata(); - meta.setContentLength(os.size()); - if (JPG_TYPE.equals(imageType)) { - meta.setContentType(JPG_MIME); - } - if (PNG_TYPE.equals(imageType)) { - meta.setContentType(PNG_MIME); - } - - // Uploading to S3 destination bucket - System.out.println("Writing to: " + dstBucket + "/" + dstKey); - try { - s3Client.putObject(dstBucket, dstKey, is, meta); - } - catch(AmazonServiceException e) - { - System.err.println(e.getErrorMessage()); - System.exit(1); - } - System.out.println("Successfully resized " + srcBucket + "/" - + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); - return "Ok"; - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} -``` +1. Return to the `lambda-s3` directory\. ------- + ``` + cd lambda-s3 + ``` -## Step 5\. Create the deployment package +1. Create a deployment package with the function code and its dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. -The deployment package is a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip) containing your Lambda function code and its dependencies\. + ``` + zip -r function.zip . + ``` ------ -#### [ Node\.js ] +#### [ Python ] -The sample function must include the sharp module in the deployment package\. +The Python deployment package for this tutorial uses the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. You can't use the AWS CLI to upload a deployment package that contains a C or C\+\+ library, such as Pillow\. Instead, use the AWS Serverless Application Model \(AWS SAM\) CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create your deployment package\. Using the AWS SAM CLI with this option creates a Docker container with a Lambda\-like environment that is compatible with Lambda\. -**To create a deployment package** +**Prerequisites** ++ [AWS SAM CLI version 1\.39 or later](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) -1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. +**To create a deployment package using the AWS SAM** -1. Save the function code as `index.js` in a directory named `lambda-s3`\. +1. Open a command prompt and create a `lambda-s3` project directory\. -1. Install the sharp library with npm\. For Linux, use the following command: + ``` + mkdir lambda-s3 + ``` + +1. Navigate to the `lambda-s3` project directory\. ``` - npm install sharp + cd lambda-s3 ``` - After this step, you have the following directory structure: +1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: ``` - lambda-s3 - |- index.js - |- /node_modules/sharp - └ /node_modules/... + import boto3 + import os + import sys + import uuid + from urllib.parse import unquote_plus + from PIL import Image + import PIL.Image + + s3_client = boto3.client('s3') + + def resize_image(image_path, resized_path): + with Image.open(image_path) as image: + image.thumbnail(tuple(x / 2 for x in image.size)) + image.save(resized_path) + + def lambda_handler(event, context): + for record in event['Records']: + bucket = record['s3']['bucket']['name'] + key = unquote_plus(record['s3']['object']['key']) + tmpkey = key.replace('/', '') + download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) + upload_path = '/tmp/resized-{}'.format(tmpkey) + s3_client.download_file(bucket, key, download_path) + resize_image(download_path, upload_path) + s3_client.upload_file(upload_path, '{}-resized'.format(bucket), 'resized-{}'.format(key)) ``` -1. Create a deployment package with the function code and its dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. +1. Install the Pillow library to a new `package` directory\. ``` - zip -r function.zip . + pip install --target ./package pillow ``` ------- -#### [ Python ] +1. In the `lambda-s3` directory, create a new file called `template.yaml`\. This is [the AWS SAM template\.](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy.html) -**Dependencies** -+ [Pillow](https://pypi.org/project/Pillow/) + ``` + AWSTemplateFormatVersion: '2010-09-09' + Transform: AWS::Serverless-2016-10-31 + Resources: + CreateThumbnail: + Type: AWS::Serverless::Function + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.9 + Timeout: 10 + Policies: AWSLambdaExecute + Events: + CreateThumbnailEvent: + Type: S3 + Properties: + Bucket: !Ref SrcBucket + Events: s3:ObjectCreated:* + + SrcBucket: + Type: AWS::S3::Bucket + ``` -**To create a deployment package** -+ We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create deployment packages that contain libraries written in C or C\+\+, such as the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. +1. Create a file called `requirements.txt` and add the following content\. This is the manifest file that specifies your dependencies\. If you installed a different version of Pillow, change the version number\. ------- -#### [ Java ] + ``` + Pillow == 9.2.0 + ``` -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` -+ `aws-java-sdk` +1. Build the deployment package\. The `--use-container` flag is required\. This flag locally compiles your functions in a Docker container that behaves like a Lambda environment, so they're in the right format when you deploy them\. -**To create a deployment package** -+ Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. + ``` + sam build --use-container + ``` ------ -## Step 6\. Create the Lambda function - -**To create the function** -+ Create a Lambda function with the create\-function command\. +## Step 5\. Create the Lambda function ------ #### [ Node\.js ] - ``` - aws lambda create-function --function-name CreateThumbnail \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-s3-role - ``` +``` +aws lambda create-function --function-name CreateThumbnail \ +--zip-file fileb://function.zip --handler index.handler --runtime nodejs16.x \ +--timeout 10 --memory-size 1024 \ +--role arn:aws:iam::123456789012:role/lambda-s3-role +``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +For the `role` parameter, replace *123456789012* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html)\. - The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs12.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. +The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs16.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. ------ #### [ Python ] - ``` - aws lambda create-function --function-name CreateThumbnail \ - --zip-file fileb://function.zip --handler lambda_function.lambda_handler --runtime python3.8 \ - --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-s3-role - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. - - The create\-function command specifies the function handler as `lambda_function.lambda_handler`\. This handler name reflects the function name as `lambda_handler`, and the name of the file where the handler code is stored as `lambda_function.py`\. For more information, see [Lambda function handler in Python](python-handler.md)\. The command specifies a runtime of `python3.8`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. - ------- -#### [ Java ] - - ``` - aws lambda create-function --function-name CreateThumbnail \ - --zip-file fileb://function.zip --handler example.handler --runtime java11 \ - --timeout 10 --memory-size 1024 \ - --role arn:aws:iam::123456789012:role/lambda-s3-role - ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. +Run the following AWS SAM CLI command to deploy the package and create the Lambda function\. Follow the on\-screen prompts\. To accept the default options provided in the interactive experience, respond with `Enter`\. - The create\-function command specifies the function handler as `example.handler`\. The function can use the abbreviated handler format of `package.Class` because the function implements a handler interface\. For more information, see [AWS Lambda function handler in Java](java-handler.md)\. The command specifies a runtime of `java11`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. +``` +sam deploy --guided +``` ------ -For the role parameter, replace *123456789012* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html)\. The preceding example command specifies a 10\-second timeout value as the function configuration\. Depending on the size of objects that you upload, you might need to increase the timeout value using the following AWS CLI command: +The function configuration includes a 10\-second timeout value\. Depending on the size of objects that you upload, you might need to increase the timeout value using the following AWS CLI command: ``` aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 ``` -## Step 7\. Test the Lambda function +## Step 6\. Test the Lambda function Invoke the Lambda function manually using sample Amazon S3 event data\. **To test the Lambda function** -1. Save the following Amazon S3 sample event data in a file named `inputFile.txt`\. Be sure to replace *sourcebucket* and *HappyFace\.jpg* with your source S3 bucket name and a \.jpg object key, respectively\. +1. In the project directory that you created earlier, save the following Amazon S3 sample event data in a file named `inputFile.txt`\. Be sure to replace the following values: + + *us\-west\-2* – The AWS Region where you created the Amazon S3 bucket and the Lambda function\. + + *sourcebucket* – The Amazon S3 source bucket that you created in step 1\. + + *HappyFace\.jpg* – The object key of the \.jpg or \.png image that you uploaded to the source bucket\. ``` { @@ -580,17 +433,17 @@ Invoke the Lambda function manually using sample Amazon S3 event data\. 1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. ``` - aws lambda invoke - --function-name CreateThumbnail \ - --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt + aws lambda invoke --function-name CreateThumbnail \ + --cli-binary-format raw-in-base64-out \ + --invocation-type Event \ + --payload file://inputFile.txt outputfile.txt ``` - - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. + + If you get the error "Error parsing parameter '\-\-payload': Unable to load paramfile file://inputFile\.txt", make sure that you're in the directory where the `inputFile.txt` is saved\. 1. Verify that the thumbnail is created in the target S3 bucket\. -## Step 8\. Configure Amazon S3 to publish events +## Step 7\. Configure Amazon S3 to publish events Complete the configuration so that Amazon S3 can publish object\-created events to Lambda and invoke your Lambda function\. In this step, you do the following: + Add permissions to the function access policy to allow Amazon S3 to invoke the function\. @@ -620,7 +473,7 @@ Complete the configuration so that Amazon S3 can publish object\-created events To have Amazon S3 publish object\-created events to Lambda, add a notification configuration on the source S3 bucket\. **Important** -This procedure configures the S3 bucket to invoke your function every time that an object is created in the bucket\. Be sure to configure this option only on the source bucket\. Do not have your function create objects in the source bucket, or your function could cause itself to be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. +This procedure configures the S3 bucket to invoke your function every time that an object is created in the bucket\. Be sure to configure this option only on the source bucket\. Do not have your function create objects in the source bucket, or your function could be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. **To configure notifications** @@ -634,11 +487,11 @@ This procedure configures the S3 bucket to invoke your function every time that + **Event name** – **lambda\-trigger** + **Event types** – **All object create events** + **Destination** – **Lambda function** - + **Lambda function** – **CreateThumbnail** + + **Lambda function** – **CreateThumbnail**\. For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service User Guide*\. -## Step 9\. Test using the S3 trigger +## Step 8\. Test using the Amazon S3 trigger Test the setup as follows: @@ -648,7 +501,7 @@ Test the setup as follows: 1. View logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. -## Step 10\. Clean up your resources +## Step 9\. Clean up your resources You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md index e65d8177..ba5bbb4a 100644 --- a/doc_source/with-sns-example.md +++ b/doc_source/with-sns-example.md @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by using two [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html), each configured for use with a different account\. If you use profiles with different names, or the default profile and one named profile, modify the commands as needed\. @@ -87,7 +90,7 @@ exports.handler = function(event, context, callback) { ``` aws lambda create-function --function-name Function-With-SNS \ --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam:::role/service-role/lambda-sns-execution-role \ + --role arn:aws:iam:::role/lambda-sns-role \ --timeout 60 --profile accountB ``` @@ -128,7 +131,7 @@ You should see the following output: Do not use the `--source-account` parameter to add a source account to the Lambda policy when adding the policy\. Source account is not supported for Amazon SNS event sources and will result in access being denied\. **Note** -If the account with the SNS topic is hosted in an opt\-in region, you need to specify the region in the principal\. For an example, see [Invoking Lambda functions using Amazon SNS notifications](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda.html) in the *Amazon Simple Notification Service Developer Guide*\. +If the account with the SNS topic is hosted in an [opt\-in region](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable), you need to specify the region in the principal\. For example, if you're working with an SNS topic in the Asia Pacific \(Hong Kong\) region, you need to specify `sns.ap-east-1.amazonaws.com` instead of `sns.amazonaws.com` for the principal\. ## Create a subscription \(account B\) diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md index 0f5b2044..ea45f03e 100644 --- a/doc_source/with-sqs-cross-account-example.md +++ b/doc_source/with-sqs-cross-account-example.md @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role \(Account A\) @@ -118,7 +121,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md index 3b22cff6..15473f22 100644 --- a/doc_source/with-sqs-example.md +++ b/doc_source/with-sqs-example.md @@ -20,7 +20,10 @@ aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. -On Linux and macOS, use your preferred shell and package manager\. On Windows 10, you can [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows\-integrated version of Ubuntu and Bash\. +On Linux and macOS, use your preferred shell and package manager\. + +**Note** +On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. ## Create the execution role @@ -118,7 +121,7 @@ If the handler returns normally without exceptions, Lambda considers the message --payload file://input.txt outputfile.txt ``` - The cli\-binary\-format option is required if you are using AWS CLI version 2\. You can also configure this option in your [AWS CLI config file](https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam)\. + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. 1. Verify the output in the file `outputfile.txt`\. diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md index 31304416..31c29e21 100644 --- a/doc_source/with-sqs.md +++ b/doc_source/with-sqs.md @@ -80,14 +80,14 @@ For FIFO queues, records contain additional attributes that are related to dedup } ``` -When Lambda reads a batch, the messages stay in the queue but are hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. By default, if your function encounters an error while processing a batch, all messages in that batch become visible in the queue again\. For this reason, your function code must be able to process the same message multiple times without unintended side effects\. You can modify this reprocessing behavior by including batch item failures in your function response\. +When Lambda reads a batch, the messages stay in the queue but are hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. By default, if your function encounters an error while processing a batch, all messages in that batch become visible in the queue again\. For this reason, your function code must be able to process the same message multiple times without unintended side effects\. You can modify this reprocessing behavior by configuring your event source mapping to include [batch item failures](#services-sqs-batchfailurereporting) in your function response\. **Topics** + [Scaling and processing](#events-sqs-scaling) + [Configuring a queue to use with Lambda](#events-sqs-queueconfig) + [Execution role permissions](#events-sqs-permissions) + [Configuring a queue as an event source](#events-sqs-eventsource) -+ [Event source mapping APIs](#services-dynamodb-api) ++ [Event source mapping APIs](#events-sqs-api) + [Reporting batch item failures](#services-sqs-batchfailurereporting) + [Amazon SQS configuration parameters](#services-sqs-params) + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) @@ -154,7 +154,7 @@ Lambda supports the following options for Amazon SQS event sources\. **Note** If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, then your effective queue visibility timeout is `(batch window) + (function timeout) + 30s`\. - Lambda processes up to five batches at a time\. This means that there are a maximum of five workers available to batch and process messages in parallel at any one time\. Each worker shows a distinct Lambda invocation for its current batch of messages\. + Lambda processes up to five batches at a time\. This means that there are a maximum of five workers available to batch and process messages in parallel at any one time\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that an event source mapping can process simultaneously is 1,000\. For more information, see [Scaling and processing](#events-sqs-scaling)\. + **Enabled** – The status of the event source mapping\. Set to true to enable the event source mapping\. Set to false to stop processing records\. **Note** @@ -164,7 +164,7 @@ To manage the event source configuration later, in the Lambda console, choose th Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of five concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the reserved concurrency value to 1,000, which is the maximum number of concurrent executions for an Amazon SQS event source\. -## Event source mapping APIs +## Event source mapping APIs To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) From 56569afec9a50c8db3eef81979346e8aa47a7775 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 14 Nov 2022 11:59:50 -0800 Subject: [PATCH 170/243] Update vulnerable dependencies in code examples --- sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj | 2 +- sample-apps/blank-java/build.gradle | 2 +- sample-apps/blank-java/pom.xml | 2 +- sample-apps/java-basic/build.gradle | 2 +- sample-apps/java-basic/pom.xml | 2 +- sample-apps/java-events-v1sdk/build.gradle | 4 ++-- sample-apps/java-events-v1sdk/pom.xml | 4 ++-- sample-apps/java-events/build.gradle | 2 +- sample-apps/java-events/pom.xml | 2 +- sample-apps/s3-java/build.gradle | 2 +- sample-apps/s3-java/pom.xml | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj b/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj index edd8b786..4cbb52cc 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj +++ b/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj @@ -5,7 +5,7 @@ Lambda - + diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 0c2e47ef..df91d18b 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -16,7 +16,7 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 85cc2f58..9368b7ba 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -30,7 +30,7 @@ com.google.code.gson gson - 2.8.6 + 2.8.9 org.apache.logging.log4j diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 2e9e324b..45c1a7c5 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -8,7 +8,7 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.9' testImplementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' testImplementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 9aa99c47..76a89e80 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -20,7 +20,7 @@ com.google.code.gson gson - 2.8.6 + 2.8.9 org.apache.logging.log4j diff --git a/sample-apps/java-events-v1sdk/build.gradle b/sample-apps/java-events-v1sdk/build.gradle index 0a7d3bdc..abf8b34c 100644 --- a/sample-apps/java-events-v1sdk/build.gradle +++ b/sample-apps/java-events-v1sdk/build.gradle @@ -10,13 +10,13 @@ dependencies { implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'com.amazonaws:aws-java-sdk-s3:1.11.578' + implementation 'com.amazonaws:aws-java-sdk-s3:1.12.261' implementation 'com.amazonaws:aws-java-sdk-kinesis:1.11.578' implementation 'com.amazonaws:aws-java-sdk-dynamodb:1.11.578' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/java-events-v1sdk/pom.xml b/sample-apps/java-events-v1sdk/pom.xml index bb3fe158..14683a39 100644 --- a/sample-apps/java-events-v1sdk/pom.xml +++ b/sample-apps/java-events-v1sdk/pom.xml @@ -30,7 +30,7 @@ com.google.code.gson gson - 2.8.6 + 2.8.9 org.apache.logging.log4j @@ -50,7 +50,7 @@ com.amazonaws aws-java-sdk-s3 - 1.11.578 + 1.12.261 com.amazonaws diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index f98131dc..c4d57cf1 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -9,7 +9,7 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.9' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 771e1af6..1f05df94 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -25,7 +25,7 @@ com.google.code.gson gson - 2.8.6 + 2.8.9 org.apache.logging.log4j diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 7e313201..1f0aba03 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.google.code.gson:gson:2.8.9' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3bbab2b5..d9b8bfc7 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -81,7 +81,7 @@ com.google.code.gson gson - 2.8.6 + 2.8.9 org.junit.jupiter From 83f900cda908d2743a30e9b49aec13cf2a2433dc Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 30 Jan 2023 00:45:45 -0800 Subject: [PATCH 171/243] Add SQS to the list of java-events examples. - The blank-java example is just a Lambda function that handles SQSEvent objects. - Moved this example to inside the java-events folder. - Tested this change using the sqs path, as well as ensured current examples still work. --- sample-apps/.gitignore | 2 +- sample-apps/java-events/3-invoke.sh | 3 ++ sample-apps/java-events/README.md | 2 ++ sample-apps/java-events/build.gradle | 2 +- .../java-events/events/sqs-record.json | 20 +++++++++++ sample-apps/java-events/pom.xml | 2 +- .../src/main/java/example/HandlerSQS.java | 34 +++++++++++++++++++ sample-apps/java-events/template.yml | 2 +- 8 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 sample-apps/java-events/events/sqs-record.json create mode 100644 sample-apps/java-events/src/main/java/example/HandlerSQS.java diff --git a/sample-apps/.gitignore b/sample-apps/.gitignore index 6599623c..61f810ce 100644 --- a/sample-apps/.gitignore +++ b/sample-apps/.gitignore @@ -11,8 +11,8 @@ build *.zip bin obj -main Gemfile.lock lib __pycache__ *.pyc +.DS_Store diff --git a/sample-apps/java-events/3-invoke.sh b/sample-apps/java-events/3-invoke.sh index 0504ea1e..5df2a8ef 100755 --- a/sample-apps/java-events/3-invoke.sh +++ b/sample-apps/java-events/3-invoke.sh @@ -40,6 +40,9 @@ then s3) PAYLOAD='file://events/s3-notification.json' ;; + sqs) + PAYLOAD='file://events/sqs-record.json' + ;; *) echo -n "Unknown event type" ;; diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index d99fa3b1..d04ccf4f 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -98,6 +98,7 @@ By default, the function uses a handler class named `Handler` that takes an API - `HandlerLex.java` - Takes `LexEvent` as input. - `HandlerS3.java` - Takes `S3Event` as input. - `HandlerSNS.java` - Takes `SNSEvent` as input. +- `HandlerSQS.java` - Takes `SQSEvent` as input. To use a different handler, change the value of the Handler setting in the application template (`template.yml` or `template-mvn.yaml`). For example, to use the Amazon Lex handler: @@ -128,6 +129,7 @@ The following event type keys are supported: - `lex` - Lex dialog (`events/lex-flowers.json`) - `ddb` - DynamoDB record (`events/dynamodb-record.json`) - `s3` - S3Event record (`events/s3-notification.json`) +- `sqs` - SQSEvent record (`events/sqs-record.json`) # Cleanup To delete the application, run `4-cleanup.sh`. diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index f98131dc..a4e58ea4 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -8,7 +8,7 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.9.0' + implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' diff --git a/sample-apps/java-events/events/sqs-record.json b/sample-apps/java-events/events/sqs-record.json new file mode 100644 index 00000000..d1c7c265 --- /dev/null +++ b/sample-apps/java-events/events/sqs-record.json @@ -0,0 +1,20 @@ +{ + "Records": [ + { + "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", + "receiptHandle": "MessageReceiptHandle", + "body": "Hello from SQS!", + "attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1523232000000", + "SenderId": "123456789012", + "ApproximateFirstReceiveTimestamp": "1523232000001" + }, + "messageAttributes": {}, + "md5OfBody": "7b270e59b47ff90a553787216d55d91d", + "eventSource": "aws:sqs", + "eventSourceARN": "arn:aws:sqs:us-west-2:123456789012:MyQueue", + "awsRegion": "us-west-2" + } + ] +} diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 771e1af6..0a7c881d 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -20,7 +20,7 @@ com.amazonaws aws-lambda-java-events - 3.9.0 + 3.11.0 com.google.code.gson diff --git a/sample-apps/java-events/src/main/java/example/HandlerSQS.java b/sample-apps/java-events/src/main/java/example/HandlerSQS.java new file mode 100644 index 00000000..d9ee820e --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerSQS.java @@ -0,0 +1,34 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandlerSQS +public class HandlerSQS implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerSQS.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override + public String handleRequest(SQSEvent event, Context context) + { + String response = new String("200 OK"); + // log execution details + logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv())); + logger.info("CONTEXT: {}", gson.toJson(context)); + logger.info("EVENT: {}", gson.toJson(event)); + // process event + for(SQSMessage msg : event.getRecords()){ + logger.info(msg.getBody()); + } + // log execution details + Util.logEnvironment(event, context, gson); + return response; + } +} diff --git a/sample-apps/java-events/template.yml b/sample-apps/java-events/template.yml index 4b1ee18a..2e818928 100644 --- a/sample-apps/java-events/template.yml +++ b/sample-apps/java-events/template.yml @@ -6,7 +6,7 @@ Resources: Type: AWS::Serverless::Function Properties: CodeUri: build/distributions/java-events.zip - Handler: example.Handler + Handler: example.HandlerSQS Runtime: java8 Description: Java function MemorySize: 512 From 0cf1ca7ed87fd40530fc6ad82541ab4fcfb4f21e Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 30 Jan 2023 19:26:38 -0800 Subject: [PATCH 172/243] Change blank-java example to GetAccountSettings sample call. - This new blank-java example initializes a Lambda client and calls GetAccountSettings - The example prints out (logs) total code size in your account and returns 200 status - Tested the scripts and ensured they still work - Verified that logs show up in CloudWatch as expected --- sample-apps/blank-java/build.gradle | 2 +- sample-apps/blank-java/event.json | 21 +---- sample-apps/blank-java/pom.xml | 6 +- .../src/main/java/example/Handler.java | 85 +++++++------------ .../src/test/java/example/InvokeTest.java | 59 ++++++------- .../java/example/SQSEventDeserializer.java | 42 --------- 6 files changed, 67 insertions(+), 148 deletions(-) delete mode 100644 sample-apps/blank-java/src/test/java/example/SQSEventDeserializer.java diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 0c2e47ef..0a230903 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -16,7 +16,7 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.fasterxml.jackson.core:jackson-databind:[2.14.0,)' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/blank-java/event.json b/sample-apps/blank-java/event.json index 568467d1..a5fb7093 100644 --- a/sample-apps/blank-java/event.json +++ b/sample-apps/blank-java/event.json @@ -1,20 +1,5 @@ { - "Records": [ - { - "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "receiptHandle": "MessageReceiptHandle", - "body": "Hello from SQS!", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1523232000000", - "SenderId": "123456789012", - "ApproximateFirstReceiveTimestamp": "1523232000001" - }, - "messageAttributes": {}, - "md5OfBody": "7b270e59b47ff90a553787216d55d91d", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-west-2:123456789012:MyQueue", - "awsRegion": "us-west-2" - } - ] + "key1": "value1", + "key2": "value2", + "key3": "value3" } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 85cc2f58..56014d49 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -28,9 +28,9 @@ 1.5.0 - com.google.code.gson - gson - 2.8.6 + com.fasterxml.jackson.core + jackson-databind + [2.14.0,) org.apache.logging.log4j diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index b0962713..5337ecb9 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -1,65 +1,44 @@ package example; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; -import software.amazon.awssdk.services.lambda.model.GetAccountSettingsRequest; -import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse; -import software.amazon.awssdk.services.lambda.model.ServiceException; -import software.amazon.awssdk.services.lambda.LambdaAsyncClient; -import software.amazon.awssdk.services.lambda.model.AccountUsage; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.StringBuilder; -import java.util.Map; -import java.util.List; -import java.util.concurrent.CompletableFuture; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.lambda.LambdaClient; +import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse; +import software.amazon.awssdk.services.lambda.model.LambdaException; // Handler value: example.Handler -public class Handler implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(Handler.class); - private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - private static final LambdaAsyncClient lambdaClient = LambdaAsyncClient.create(); - public Handler(){ - CompletableFuture accountSettings = lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); - try { - GetAccountSettingsResponse settings = accountSettings.get(); - } catch(Exception e) { - e.getStackTrace(); - } - } - @Override - public String handleRequest(SQSEvent event, Context context) - { - String response = new String(); - // call Lambda API - logger.info("Getting account settings"); - CompletableFuture accountSettings = - lambdaClient.getAccountSettings(GetAccountSettingsRequest.builder().build()); - // log execution details - logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv())); - logger.info("CONTEXT: {}", gson.toJson(context)); - logger.info("EVENT: {}", gson.toJson(event)); - // process event - for(SQSMessage msg : event.getRecords()){ - logger.info(msg.getBody()); - } - // process Lambda API response - try { - GetAccountSettingsResponse settings = accountSettings.get(); - response = gson.toJson(settings.accountUsage()); - logger.info("Account usage: {}", response); - } catch(Exception e) { - e.getStackTrace(); +public class Handler implements RequestHandler, String> { + + private static final Logger logger = LoggerFactory.getLogger(Handler.class); + private static final Region region = Region.US_EAST_1; + private static final LambdaClient awsLambda = LambdaClient.builder() + .region(region) + .build(); + + @Override + public String handleRequest(Map event, Context context) { + + // log execution details + logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); + logger.info("EVENT: " + event); + logger.info("CONTEXT: " + context); + + // process event + GetAccountSettingsResponse response; + try { + response = awsLambda.getAccountSettings(); + System.out.println("Total code size for your account is " + response.accountLimit().totalCodeSize() + " bytes"); + } catch(LambdaException e) { + System.err.println(e.getMessage()); + System.exit(1); + } + return "200 OK"; } - return response; - } -} \ No newline at end of file +} diff --git a/sample-apps/blank-java/src/test/java/example/InvokeTest.java b/sample-apps/blank-java/src/test/java/example/InvokeTest.java index c65b9371..86661e2b 100644 --- a/sample-apps/blank-java/src/test/java/example/InvokeTest.java +++ b/sample-apps/blank-java/src/test/java/example/InvokeTest.java @@ -1,23 +1,16 @@ package example; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -29,30 +22,34 @@ import com.amazonaws.xray.strategy.sampling.NoSamplingStrategy; class InvokeTest { - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); - Gson gson = new GsonBuilder() - .registerTypeAdapter(SQSEvent.class, new SQSEventDeserializer()) - .setPrettyPrinting() - .create(); public InvokeTest() { - AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard(); - builder.withSamplingStrategy(new NoSamplingStrategy()); - AWSXRay.setGlobalRecorder(builder.build()); + AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard(); + builder.withSamplingStrategy(new NoSamplingStrategy()); + AWSXRay.setGlobalRecorder(builder.build()); } @Test void invokeTest() { - AWSXRay.beginSegment("blank-java-test"); - String path = "src/test/resources/event.json"; - String eventString = loadJsonFile(path); - SQSEvent event = gson.fromJson(eventString, SQSEvent.class); - Context context = new TestContext(); - String requestId = context.getAwsRequestId(); - Handler handler = new Handler(); - String result = handler.handleRequest(event, context); - assertTrue(result.contains("totalCodeSize")); - AWSXRay.endSegment(); + AWSXRay.beginSegment("blank-java-test"); + String path = "src/test/resources/event.json"; + String eventString = loadJsonFile(path); + + ObjectMapper mapper = new ObjectMapper(); + TypeReference> typeRef = new TypeReference>() {}; + Map event = new HashMap<>(); + try { + event = mapper.readValue(eventString, typeRef); + } catch (JsonMappingException e) { + e.printStackTrace(); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + Context context = new TestContext(); + Handler handler = new Handler(); + String result = handler.handleRequest(event, context); + assertTrue(result.contains("200 OK")); + AWSXRay.endSegment(); } private static String loadJsonFile(String path) diff --git a/sample-apps/blank-java/src/test/java/example/SQSEventDeserializer.java b/sample-apps/blank-java/src/test/java/example/SQSEventDeserializer.java deleted file mode 100644 index c2576307..00000000 --- a/sample-apps/blank-java/src/test/java/example/SQSEventDeserializer.java +++ /dev/null @@ -1,42 +0,0 @@ -package example; - -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonParseException; -import com.google.gson.JsonDeserializer; -import com.google.gson.reflect.TypeToken; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; -import java.util.ArrayList; -import java.lang.reflect.Type; - -public class SQSEventDeserializer implements JsonDeserializer { - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - Type sqsMessageArray = new TypeToken>(){}.getType(); - - @Override - public SQSEvent deserialize(JsonElement eventJson, Type typeOfT, JsonDeserializationContext context) - throws JsonParseException { - SQSEvent event = new SQSEvent(); - logger.info("DESERIALIZING TEST EVENT"); - logger.info("EVENT JSON: " + eventJson.toString()); - // Records key is capitalized in test event, but lowercase in type - JsonArray recordsArray = eventJson.getAsJsonObject().get("Records").getAsJsonArray(); - ArrayList records = gson.fromJson(recordsArray, sqsMessageArray); - event.setRecords(records); - return event; - } -} \ No newline at end of file From 1568e1906256b65da5a5f205f01b3827b12dbd9c Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 31 Jan 2023 03:37:02 -0800 Subject: [PATCH 173/243] Remove GSON dependencies from blank-java, java-basic examples - This commit removes GSON dependencies from blank-java and java-basic examples. - Removed logging the context as this isn't a common operation. - Refactored the java-basic Stream example, and manually tested with an input string. - Tested and verified that all samples still work. --- sample-apps/blank-java/build.gradle | 1 - sample-apps/blank-java/pom.xml | 5 -- .../src/main/java/example/Handler.java | 1 - sample-apps/java-basic/build.gradle | 1 - sample-apps/java-basic/pom.xml | 5 -- .../src/main/java/example/Handler.java | 11 ++--- .../src/main/java/example/HandlerDivide.java | 7 +-- .../src/main/java/example/HandlerInteger.java | 7 +-- .../src/main/java/example/HandlerList.java | 7 +-- .../src/main/java/example/HandlerStream.java | 47 +++++-------------- .../src/main/java/example/HandlerString.java | 9 ++-- .../main/java/example/HandlerWeatherData.java | 13 ++--- .../src/test/java/example/InvokeTest.java | 4 -- 13 files changed, 30 insertions(+), 88 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 0a230903..cdfbead0 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -16,7 +16,6 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'com.fasterxml.jackson.core:jackson-databind:[2.14.0,)' implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 56014d49..9b5ec56a 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -27,11 +27,6 @@ aws-lambda-java-log4j2 1.5.0 - - com.fasterxml.jackson.core - jackson-databind - [2.14.0,) - org.apache.logging.log4j log4j-api diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index 5337ecb9..5ba65083 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -28,7 +28,6 @@ public String handleRequest(Map event, Context context) { // log execution details logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); logger.info("EVENT: " + event); - logger.info("CONTEXT: " + context); // process event GetAccountSettingsResponse response; diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 2e9e324b..f2688f40 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -8,7 +8,6 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.google.code.gson:gson:2.8.6' testImplementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' testImplementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 9aa99c47..4e280a67 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -17,11 +17,6 @@ aws-lambda-java-core 1.2.1 - - com.google.code.gson - gson - 2.8.6 - org.apache.logging.log4j log4j-api diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index 94834f20..0248c8a6 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -4,24 +4,21 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import java.util.Map; // Handler value: example.Handler public class Handler implements RequestHandler, String>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public String handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); String response = "200 OK"; // log execution details - logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - logger.log("CONTEXT: " + gson.toJson(context)); + logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); + // process event - logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass()); return response; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java index c6c6c840..26f3e871 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java @@ -4,14 +4,11 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import java.util.List; // Handler value: example.HandlerDivide public class HandlerDivide implements RequestHandler, Integer>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public Integer handleRequest(List event, Context context) { @@ -23,7 +20,7 @@ public Integer handleRequest(List event, Context context) } int numerator = event.get(0); int denominator = event.get(1); - logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return numerator/denominator; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index 89d2a33b..12cc59eb 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -4,18 +4,15 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - // Handler value: example.HandlerInteger public class HandlerInteger implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public Integer handleRequest(Integer event, Context context) { LambdaLogger logger = context.getLogger(); // process event - logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); // return amount of time remaining before timeout return context.getRemainingTimeInMillis(); diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index e286272d..c8245f23 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -4,20 +4,17 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import java.util.List; // Handler value: example.HandlerList public class HandlerList implements RequestHandler, Integer>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public Integer handleRequest(List event, Context context) { LambdaLogger logger = context.getLogger(); // process event - logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return context.getRemainingTimeInMillis() ; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerStream.java b/sample-apps/java-basic/src/main/java/example/HandlerStream.java index 4b100168..c106dabe 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerStream.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerStream.java @@ -1,53 +1,30 @@ package example; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestStreamHandler; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonSyntaxException; - -import java.util.HashMap; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.BufferedWriter; -import java.nio.charset.Charset; -import java.lang.IllegalStateException; // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException { - LambdaLogger logger = context.getLogger(); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("US-ASCII"))); - PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("US-ASCII")))); - try - { - HashMap event = gson.fromJson(reader, HashMap.class); - logger.log("STREAM TYPE: " + inputStream.getClass().toString()); - logger.log("EVENT TYPE: " + event.getClass().toString()); - writer.write(gson.toJson(event)); - if (writer.checkError()) - { - logger.log("WARNING: Writer encountered an error."); + int nextChar; + try { + while ((nextChar = inputStream.read()) != -1) { + outputStream.write(nextChar); } - } - catch (IllegalStateException | JsonSyntaxException exception) - { - logger.log(exception.toString()); - } - finally - { - reader.close(); - writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + inputStream.close(); + String finalString = outputStream.toString(); + System.out.println(finalString); + outputStream.close(); } } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index eb2aafc9..66b1904c 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -4,19 +4,16 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - // Handler value: example.HandlerString public class HandlerString implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public Integer handleRequest(String event, Context context) { LambdaLogger logger = context.getLogger(); // process event - logger.log("EVENT: " + gson.toJson(event)); + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); - return context.getRemainingTimeInMillis() ; + return context.getRemainingTimeInMillis(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index d3ebbc4d..b51d0b20 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -4,21 +4,18 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import java.util.Map; - // Handler value: example.HandlerWeatherData public class HandlerWeatherData implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public WeatherData handleRequest(WeatherData event, Context context) { LambdaLogger logger = context.getLogger(); - // process event - logger.log("EVENT: " + gson.toJson(event)); + // log execution details + logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); + + // // process event return event; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/test/java/example/InvokeTest.java b/sample-apps/java-basic/src/test/java/example/InvokeTest.java index c274aa6c..fccbf910 100644 --- a/sample-apps/java-basic/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-basic/src/test/java/example/InvokeTest.java @@ -1,17 +1,13 @@ package example; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; -import java.util.ArrayList; import java.util.HashMap; class InvokeTest { From 3988067cc5efbffa9fe06923263a74fa1c6d6f3f Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 3 Feb 2023 09:53:00 -0600 Subject: [PATCH 174/243] Fix small javascript typo --- doc_source/urls-tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc_source/urls-tutorial.md b/doc_source/urls-tutorial.md index 22beae56..078bccb3 100644 --- a/doc_source/urls-tutorial.md +++ b/doc_source/urls-tutorial.md @@ -53,7 +53,7 @@ Create a Lambda function with a function URL endpoint using a \.zip file archive ``` exports.handler = async (event) => { - let body = JSON.parse(event.body) + let body = JSON.parse(event.body); const product = body.num1 * body.num2; const response = { statusCode: 200, @@ -131,7 +131,7 @@ Resources: Code: ZipFile: | exports.handler = async (event) => { - let body = JSON.parse(event.body) + let body = JSON.parse(event.body); const product = body.num1 * body.num2; const response = { statusCode: 200, @@ -192,4 +192,4 @@ You can now delete the resources that you created for this tutorial, unless you 1. Choose **Actions**, then choose **Delete**\. -1. Choose **Delete**\. \ No newline at end of file +1. Choose **Delete**\. From 57c29ea6e391973aa967f0183d2b4a2d1a09a313 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 7 Feb 2023 09:44:58 -0800 Subject: [PATCH 175/243] Remove unnecessary lines in java-events file - Remove unnecessary imports and logger objects - java-events needs further updating; out of scope for this commit --- sample-apps/java-events/src/main/java/example/Handler.java | 1 - .../src/main/java/example/HandlerApiGateway.java | 1 - .../java-events/src/main/java/example/HandlerCWEvents.java | 2 -- .../java-events/src/main/java/example/HandlerCWLogs.java | 3 --- .../src/main/java/example/HandlerCloudFront.java | 2 -- .../src/main/java/example/HandlerCodeCommit.java | 2 -- .../java-events/src/main/java/example/HandlerCognito.java | 2 -- .../java-events/src/main/java/example/HandlerConfig.java | 2 -- .../java-events/src/main/java/example/HandlerDynamoDB.java | 1 - .../java-events/src/main/java/example/HandlerFirehose.java | 2 -- .../java-events/src/main/java/example/HandlerKinesis.java | 1 - .../java-events/src/main/java/example/HandlerLex.java | 2 -- .../java-events/src/main/java/example/HandlerS3.java | 1 - .../java-events/src/main/java/example/HandlerSNS.java | 2 -- .../java-events/src/test/java/example/InvokeTest.java | 6 ------ 15 files changed, 30 deletions(-) diff --git a/sample-apps/java-events/src/main/java/example/Handler.java b/sample-apps/java-events/src/main/java/example/Handler.java index bdc7064e..d46bb14e 100644 --- a/sample-apps/java-events/src/main/java/example/Handler.java +++ b/sample-apps/java-events/src/main/java/example/Handler.java @@ -9,7 +9,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import java.util.Map; import java.util.HashMap; // Handler value: example.Handler diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java index 76df1e1e..c7513c2b 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java @@ -8,7 +8,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import java.util.Map; import java.util.HashMap; // Handler value: example.HandlerApiGateway diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java index 606af881..3678e982 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; import com.google.gson.Gson; @@ -14,7 +13,6 @@ public class HandlerCWEvents implements RequestHandler{ @Override public String handleRequest(ScheduledEvent event, Context context) { - LambdaLogger logger = context.getLogger(); String response = new String("200 OK"); // log execution details Util.logEnvironment(event, context, gson); diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java index e02a500b..df134e3e 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java @@ -4,15 +4,12 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; -import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent.AWSLogs; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.Base64; import java.util.Base64.Decoder; -import java.util.zip.Inflater; - import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java index ea465206..a239f989 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; import com.google.gson.Gson; @@ -14,7 +13,6 @@ public class HandlerCloudFront implements RequestHandler{ @Override public String handleRequest(CognitoEvent event, Context context) { - LambdaLogger logger = context.getLogger(); String response = new String("200 OK"); // log execution details Util.logEnvironment(event, context, gson); diff --git a/sample-apps/java-events/src/main/java/example/HandlerConfig.java b/sample-apps/java-events/src/main/java/example/HandlerConfig.java index 651a7bf0..709ced7b 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerConfig.java +++ b/sample-apps/java-events/src/main/java/example/HandlerConfig.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.ConfigEvent; import com.google.gson.Gson; @@ -14,7 +13,6 @@ public class HandlerConfig implements RequestHandler{ @Override public String handleRequest(ConfigEvent event, Context context) { - LambdaLogger logger = context.getLogger(); String response = new String("200 OK"); // log execution details Util.logEnvironment(event, context, gson); diff --git a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java index 7bdb3bba..da0c0281 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java +++ b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; diff --git a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java index 59504e44..53ee9f25 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java +++ b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; import com.google.gson.Gson; @@ -14,7 +13,6 @@ public class HandlerFirehose implements RequestHandler{ @Override public String handleRequest(LexEvent event, Context context) { - LambdaLogger logger = context.getLogger(); String response = new String("200 OK"); // log execution details Util.logEnvironment(event, context, gson); diff --git a/sample-apps/java-events/src/main/java/example/HandlerS3.java b/sample-apps/java-events/src/main/java/example/HandlerS3.java index a6f470be..cda08ceb 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerS3.java +++ b/sample-apps/java-events/src/main/java/example/HandlerS3.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.S3Event; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; diff --git a/sample-apps/java-events/src/main/java/example/HandlerSNS.java b/sample-apps/java-events/src/main/java/example/HandlerSNS.java index 977ae82a..bcbda156 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSNS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSNS.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.SNSEvent; import com.google.gson.Gson; @@ -14,7 +13,6 @@ public class HandlerSNS implements RequestHandler{ @Override public String handleRequest(SNSEvent event, Context context) { - LambdaLogger logger = context.getLogger(); String response = new String("200 OK"); // log execution details Util.logEnvironment(event, context, gson); diff --git a/sample-apps/java-events/src/test/java/example/InvokeTest.java b/sample-apps/java-events/src/test/java/example/InvokeTest.java index fdd010f8..c86f9821 100644 --- a/sample-apps/java-events/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-events/src/test/java/example/InvokeTest.java @@ -1,21 +1,15 @@ package example; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyResponseEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; -import java.util.ArrayList; -import java.util.HashMap; - class InvokeTest { private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); From 0bc6c12954b858e7c7fc463c97519ce66912d117 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 7 Feb 2023 09:51:46 -0800 Subject: [PATCH 176/243] Remove unnecessary lines from java-events-v1sdk - Remove unnecessary imports and logger objects - java-events-v1sdk needs further updating; out of scope for this commit --- .../java-events-v1sdk/src/main/java/example/Handler.java | 1 - .../src/main/java/example/HandlerDynamoDB.java | 3 --- .../src/main/java/example/HandlerKinesis.java | 3 --- .../java-events-v1sdk/src/main/java/example/Util.java | 1 - .../src/test/java/example/InvokeTest.java | 9 --------- 5 files changed, 17 deletions(-) diff --git a/sample-apps/java-events-v1sdk/src/main/java/example/Handler.java b/sample-apps/java-events-v1sdk/src/main/java/example/Handler.java index 7323c91b..6ec8c54d 100644 --- a/sample-apps/java-events-v1sdk/src/main/java/example/Handler.java +++ b/sample-apps/java-events-v1sdk/src/main/java/example/Handler.java @@ -2,7 +2,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.S3Event; import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; diff --git a/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java index 9cf234c1..da0c0281 100644 --- a/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java +++ b/sample-apps/java-events-v1sdk/src/main/java/example/HandlerDynamoDB.java @@ -2,12 +2,9 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; -import com.amazonaws.services.dynamodbv2.model.Record; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/sample-apps/java-events-v1sdk/src/main/java/example/HandlerKinesis.java b/sample-apps/java-events-v1sdk/src/main/java/example/HandlerKinesis.java index c5406b13..e46720df 100644 --- a/sample-apps/java-events-v1sdk/src/main/java/example/HandlerKinesis.java +++ b/sample-apps/java-events-v1sdk/src/main/java/example/HandlerKinesis.java @@ -2,12 +2,9 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.KinesisEvent; import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; -import com.amazonaws.services.kinesis.model.Record; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/sample-apps/java-events-v1sdk/src/main/java/example/Util.java b/sample-apps/java-events-v1sdk/src/main/java/example/Util.java index 2e11f51e..feb7475b 100644 --- a/sample-apps/java-events-v1sdk/src/main/java/example/Util.java +++ b/sample-apps/java-events-v1sdk/src/main/java/example/Util.java @@ -1,7 +1,6 @@ package example; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.google.gson.Gson; diff --git a/sample-apps/java-events-v1sdk/src/test/java/example/InvokeTest.java b/sample-apps/java-events-v1sdk/src/test/java/example/InvokeTest.java index 0faa1846..60ed4a8e 100644 --- a/sample-apps/java-events-v1sdk/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-events-v1sdk/src/test/java/example/InvokeTest.java @@ -1,28 +1,21 @@ package example; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.s3.event.S3EventNotification; import com.amazonaws.services.s3.event.S3EventNotification.S3EventNotificationRecord; import com.amazonaws.services.s3.event.S3EventNotification.RequestParametersEntity; import com.amazonaws.services.s3.event.S3EventNotification.ResponseElementsEntity; import com.amazonaws.services.s3.event.S3EventNotification.S3Entity; import com.amazonaws.services.s3.event.S3EventNotification.UserIdentityEntity; -import com.amazonaws.services.s3.event.S3EventNotification.GlacierEventDataEntity; import com.amazonaws.services.s3.event.S3EventNotification.S3BucketEntity; import com.amazonaws.services.s3.event.S3EventNotification.S3ObjectEntity; -import com.amazonaws.services.s3.event.S3EventNotification.UserIdentityEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; import java.util.ArrayList; import java.lang.Long; import java.nio.file.Files; @@ -34,7 +27,6 @@ import com.amazonaws.xray.strategy.sampling.NoSamplingStrategy; class InvokeTest { - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); public InvokeTest() { AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard(); @@ -69,7 +61,6 @@ void invokeTest() throws IOException { S3Event event = new S3Event(records); Context context = new TestContext(); - String requestId = context.getAwsRequestId(); Handler handler = new Handler(); String result = handler.handleRequest(event, context); assertTrue(result.contains("200 OK")); From d2719fdd6178c9c548f61c8d18d3444d8451adf5 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 7 Feb 2023 09:53:55 -0800 Subject: [PATCH 177/243] Clean up s3-java code example - Remove unnecessary imports and lines - Remove gson dependency; example still works as before --- sample-apps/s3-java/README.md | 4 +--- sample-apps/s3-java/build.gradle | 1 - sample-apps/s3-java/pom.xml | 5 ----- sample-apps/s3-java/src/main/java/example/Handler.java | 7 ------- .../s3-java/src/test/java/example/InvokeTest.java | 10 ---------- 5 files changed, 1 insertion(+), 26 deletions(-) diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index c94b7e99..7adfc9f1 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -79,9 +79,7 @@ To invoke the function directly, run `5-invoke.sh`. "ExecutedVersion": "$LATEST" } -Let the script invoke the function a few times and then press `CRTL+C` to exit. Note that you -may see function timeouts in the first few iterations due to cold starts; after a while, they -should begin to succeed. +Let the script invoke the function a few times and then press `CRTL+C` to exit. If you look at the `s3-java-bucket-` bucket in your account, you should now see a key `resized-inbound/sample-s3-java.png` file, which represents the new, shrunken image. diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 7e313201..899688b4 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -19,7 +19,6 @@ dependencies { implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' - implementation 'com.google.code.gson:gson:2.8.6' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 3bbab2b5..53cb112d 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -78,11 +78,6 @@ com.amazonaws aws-xray-recorder-sdk-aws-sdk-instrumentor - - com.google.code.gson - gson - 2.8.6 - org.junit.jupiter junit-jupiter-api diff --git a/sample-apps/s3-java/src/main/java/example/Handler.java b/sample-apps/s3-java/src/main/java/example/Handler.java index 23e2cc56..67d463e5 100644 --- a/sample-apps/s3-java/src/main/java/example/Handler.java +++ b/sample-apps/s3-java/src/main/java/example/Handler.java @@ -4,7 +4,6 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -19,7 +18,6 @@ import software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.PutObjectRequest; -import software.amazon.awssdk.services.s3.model.S3Object; import software.amazon.awssdk.services.s3.S3Client; import com.amazonaws.services.lambda.runtime.Context; @@ -27,15 +25,11 @@ import com.amazonaws.services.lambda.runtime.events.S3Event; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.Handler public class Handler implements RequestHandler { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); private static final Logger logger = LoggerFactory.getLogger(Handler.class); private static final float MAX_DIMENSION = 100; private final String REGEX = ".*\\.([^\\.]*)"; @@ -46,7 +40,6 @@ public class Handler implements RequestHandler { @Override public String handleRequest(S3Event s3event, Context context) { try { - logger.info("EVENT: " + gson.toJson(s3event)); S3EventNotificationRecord record = s3event.getRecords().get(0); String srcBucket = record.getS3().getBucket().getName(); diff --git a/sample-apps/s3-java/src/test/java/example/InvokeTest.java b/sample-apps/s3-java/src/test/java/example/InvokeTest.java index 4211548b..3578296e 100644 --- a/sample-apps/s3-java/src/test/java/example/InvokeTest.java +++ b/sample-apps/s3-java/src/test/java/example/InvokeTest.java @@ -1,14 +1,10 @@ package example; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.RequestParametersEntity; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.ResponseElementsEntity; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3BucketEntity; @@ -17,10 +13,6 @@ import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3ObjectEntity; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.UserIdentityEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; import java.util.ArrayList; import java.lang.Long; import java.nio.file.Files; @@ -32,7 +24,6 @@ import com.amazonaws.xray.strategy.sampling.NoSamplingStrategy; class InvokeTest { - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); public InvokeTest() { AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard(); @@ -67,7 +58,6 @@ void invokeTest() throws IOException { S3Event event = new S3Event(records); Context context = new TestContext(); - String requestId = context.getAwsRequestId(); Handler handler = new Handler(); String result = handler.handleRequest(event, context); assertTrue(result.contains("Ok")); From 89c31dd72e8d3e10d269f1ca84b7d082bf43365b Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 9 Feb 2023 15:14:36 -0800 Subject: [PATCH 178/243] Address @msailes comments --- sample-apps/blank-java/build.gradle | 1 + sample-apps/blank-java/pom.xml | 7 ++- .../src/main/java/example/Handler.java | 14 +++--- .../src/test/java/example/InvokeTest.java | 47 +++---------------- .../src/main/java/example/HandlerSQS.java | 17 ++----- 5 files changed, 22 insertions(+), 64 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index cdfbead0..f5c3aa9e 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' + testImplementation 'com.amazonaws:aws-lambda-java-tests:1.1.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 9b5ec56a..3b8bb0f7 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -79,7 +79,12 @@ 5.6.0 test - + + com.amazonaws + aws-lambda-java-tests + 1.1.1 + test +
diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index 5ba65083..fb5bb24d 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -8,6 +8,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import software.amazon.awssdk.core.SdkSystemSetting; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.lambda.LambdaClient; import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse; @@ -17,9 +18,8 @@ public class Handler implements RequestHandler, String> { private static final Logger logger = LoggerFactory.getLogger(Handler.class); - private static final Region region = Region.US_EAST_1; - private static final LambdaClient awsLambda = LambdaClient.builder() - .region(region) + private static final LambdaClient lambdaClient = LambdaClient.builder() + .region(Region.of(System.getenv(SdkSystemSetting.AWS_REGION.environmentVariable()))) .build(); @Override @@ -30,14 +30,12 @@ public String handleRequest(Map event, Context context) { logger.info("EVENT: " + event); // process event - GetAccountSettingsResponse response; + GetAccountSettingsResponse response = null; try { - response = awsLambda.getAccountSettings(); - System.out.println("Total code size for your account is " + response.accountLimit().totalCodeSize() + " bytes"); + response = lambdaClient.getAccountSettings(); } catch(LambdaException e) { System.err.println(e.getMessage()); - System.exit(1); } - return "200 OK"; + return response != null ? "Total code size for your account is " + response.accountLimit().totalCodeSize() + " bytes" : "Error"; } } diff --git a/sample-apps/blank-java/src/test/java/example/InvokeTest.java b/sample-apps/blank-java/src/test/java/example/InvokeTest.java index 86661e2b..ecf44a15 100644 --- a/sample-apps/blank-java/src/test/java/example/InvokeTest.java +++ b/sample-apps/blank-java/src/test/java/example/InvokeTest.java @@ -1,21 +1,12 @@ package example; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; import com.amazonaws.services.lambda.runtime.Context; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; +import com.amazonaws.services.lambda.runtime.tests.annotations.Event; -import java.util.HashMap; import java.util.Map; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.stream.Stream; import com.amazonaws.xray.AWSXRay; import com.amazonaws.xray.AWSXRayRecorderBuilder; @@ -29,40 +20,14 @@ public InvokeTest() { AWSXRay.setGlobalRecorder(builder.build()); } - @Test - void invokeTest() { + @ParameterizedTest + @Event(value = "event.json", type = Map.class) + void invokeTest(Map event) { AWSXRay.beginSegment("blank-java-test"); - String path = "src/test/resources/event.json"; - String eventString = loadJsonFile(path); - - ObjectMapper mapper = new ObjectMapper(); - TypeReference> typeRef = new TypeReference>() {}; - Map event = new HashMap<>(); - try { - event = mapper.readValue(eventString, typeRef); - } catch (JsonMappingException e) { - e.printStackTrace(); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } Context context = new TestContext(); Handler handler = new Handler(); String result = handler.handleRequest(event, context); - assertTrue(result.contains("200 OK")); + assertTrue(result.contains("Total code size for your account")); AWSXRay.endSegment(); } - - private static String loadJsonFile(String path) - { - StringBuilder stringBuilder = new StringBuilder(); - try (Stream stream = Files.lines( Paths.get(path), StandardCharsets.UTF_8)) - { - stream.forEach(s -> stringBuilder.append(s)); - } - catch (IOException e) - { - e.printStackTrace(); - } - return stringBuilder.toString(); - } } diff --git a/sample-apps/java-events/src/main/java/example/HandlerSQS.java b/sample-apps/java-events/src/main/java/example/HandlerSQS.java index d9ee820e..d4504b13 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSQS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSQS.java @@ -5,30 +5,19 @@ import com.amazonaws.services.lambda.runtime.events.SQSEvent; import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.HandlerSQS -public class HandlerSQS implements RequestHandler{ +public class HandlerSQS implements RequestHandler{ private static final Logger logger = LoggerFactory.getLogger(HandlerSQS.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); @Override - public String handleRequest(SQSEvent event, Context context) + public Void handleRequest(SQSEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - logger.info("ENVIRONMENT VARIABLES: {}", gson.toJson(System.getenv())); - logger.info("CONTEXT: {}", gson.toJson(context)); - logger.info("EVENT: {}", gson.toJson(event)); // process event for(SQSMessage msg : event.getRecords()){ logger.info(msg.getBody()); } - // log execution details - Util.logEnvironment(event, context, gson); - return response; + return null; } } From 67cf19245ed0cd37f13654a46d5f7c937ceafb84 Mon Sep 17 00:00:00 2001 From: oliverjfletcher Date: Tue, 14 Feb 2023 09:27:59 +1100 Subject: [PATCH 179/243] making the examples consistent --- doc_source/gettingstarted-images.md | 34 ++++++++++++++++------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md index ad4ecedd..933f983b 100644 --- a/doc_source/gettingstarted-images.md +++ b/doc_source/gettingstarted-images.md @@ -10,14 +10,18 @@ You cannot convert an existing container image function to use a \.zip file arch When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. **Topics** -+ [Prerequisites](#gettingstarted-images-prereq) -+ [Permissions](#gettingstarted-images-permissions) -+ [Creating the function](#configuration-images-create) -+ [Testing the function](#get-started-invoke-function) -+ [Overriding container settings](#configuration-images-settings) -+ [Updating function code](#configuration-images-update) -+ [Using the Lambda API](#configuration-images-api) -+ [AWS CloudFormation](#configuration-images-cloudformation) +- [Deploying Lambda functions as container images](#deploying-lambda-functions-as-container-images) + - [Prerequisites](#prerequisites) + - [Permissions](#permissions) + - [Amazon ECR permissions](#amazon-ecr-permissions) + - [Amazon ECR cross-account permissions](#amazon-ecr-cross-account-permissions) + - [Creating the function](#creating-the-function) + - [Testing the function](#testing-the-function) + - [Overriding container settings](#overriding-container-settings) + - [Updating function code](#updating-function-code) + - [Function version $LATEST](#function-version-latest) + - [Using the Lambda API](#using-the-lambda-api) + - [AWS CloudFormation](#aws-cloudformation) ## Prerequisites @@ -56,7 +60,7 @@ For example, use the IAM console to create a role with the following policy: "Sid": "VisualEditor0", "Effect": "Allow", "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], - "Resource": "arn:aws:ecr:::repository//" + "Resource": "arn:aws:ecr:::repository//" } ] } @@ -105,7 +109,7 @@ A different account in the same region can create a function that uses a contain "ecr:GetDownloadUrlForLayer" ], "Principal": { - "AWS": "arn:aws:iam::123456789012:root" + "AWS": "arn:aws:iam:::root" } }, { @@ -121,7 +125,7 @@ A different account in the same region can create a function that uses a contain "Condition": { "StringLike": { "aws:sourceARN": - "arn:aws:lambda:us-east-1:123456789012:function:*" + "arn:aws:lambda:::function:*" } } } @@ -129,7 +133,7 @@ A different account in the same region can create a function that uses a contain } ``` -To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. +To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. @@ -282,10 +286,10 @@ When you create the function, you can specify the instruction set architecture\. You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. ``` -aws lambda create-function --region sa-east-1 --function-name my-function \ +aws lambda create-function --region --function-name my-function \ --package-type Image \ --code ImageUri= \ - --role arn:aws:iam::123456789012:role/lambda-ex + --role arn:aws:iam:::role/lambda-ex ``` To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\. @@ -294,7 +298,7 @@ To update the function code, use the `update-function-code` command\. Specify th You cannot change the `package-type` of a function\. ``` -aws lambda update-function-code --region sa-east-1 --function-name my-function \ +aws lambda update-function-code --region --function-name my-function \ --image-uri \ ``` From 8ac6ab4d68793551e26e9d24d169973428d336b1 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 20 Feb 2023 13:57:51 -0800 Subject: [PATCH 180/243] Address @msailes, @mwunderl comments --- sample-apps/blank-java/README.md | 1 + .../blank-java/src/main/java/example/Handler.java | 10 ++-------- .../java-basic/src/main/java/example/Handler.java | 10 +++------- .../src/main/java/example/HandlerDivide.java | 5 ++--- .../src/main/java/example/HandlerInteger.java | 2 -- .../java-basic/src/main/java/example/HandlerList.java | 1 - .../src/main/java/example/HandlerString.java | 1 - .../src/main/java/example/HandlerWeatherData.java | 3 --- .../java-events/src/main/java/example/HandlerSQS.java | 1 - 9 files changed, 8 insertions(+), 26 deletions(-) diff --git a/sample-apps/blank-java/README.md b/sample-apps/blank-java/README.md index c5d8130d..d63a88c2 100644 --- a/sample-apps/blank-java/README.md +++ b/sample-apps/blank-java/README.md @@ -14,6 +14,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements +- An AWS account. - [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index fb5bb24d..e7afe6d1 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -8,8 +8,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import software.amazon.awssdk.core.SdkSystemSetting; -import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.lambda.LambdaClient; import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse; import software.amazon.awssdk.services.lambda.model.LambdaException; @@ -18,18 +16,14 @@ public class Handler implements RequestHandler, String> { private static final Logger logger = LoggerFactory.getLogger(Handler.class); - private static final LambdaClient lambdaClient = LambdaClient.builder() - .region(Region.of(System.getenv(SdkSystemSetting.AWS_REGION.environmentVariable()))) - .build(); + private static final LambdaClient lambdaClient = LambdaClient.builder().build(); @Override public String handleRequest(Map event, Context context) { - - // log execution details + logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); logger.info("EVENT: " + event); - // process event GetAccountSettingsResponse response = null; try { response = lambdaClient.getAccountSettings(); diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index 0248c8a6..f8b3ea81 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -7,19 +7,15 @@ import java.util.Map; // Handler value: example.Handler -public class Handler implements RequestHandler, String>{ +public class Handler implements RequestHandler, Void>{ @Override - public String handleRequest(Map event, Context context) + public Void handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); - String response = "200 OK"; - // log execution details logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); - - // process event logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass()); - return response; + return null; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java index 26f3e871..e70f2b90 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java @@ -13,15 +13,14 @@ public class HandlerDivide implements RequestHandler, Integer>{ public Integer handleRequest(List event, Context context) { LambdaLogger logger = context.getLogger(); - // process event if ( event.size() != 2 ) { throw new InputLengthException("Input must be an array that contains 2 numbers."); } int numerator = event.get(0); int denominator = event.get(1); - logger.log("EVENT: " + event); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.log("EVENT: Numerator is " + event.get(0).toString() + + "; Denominator is " + event.get(1).toString()); return numerator/denominator; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index 12cc59eb..1bff73d5 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -11,10 +11,8 @@ public class HandlerInteger implements RequestHandler{ public Integer handleRequest(Integer event, Context context) { LambdaLogger logger = context.getLogger(); - // process event logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); - // return amount of time remaining before timeout return context.getRemainingTimeInMillis(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index c8245f23..8721cfbf 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -13,7 +13,6 @@ public class HandlerList implements RequestHandler, Integer>{ public Integer handleRequest(List event, Context context) { LambdaLogger logger = context.getLogger(); - // process event logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return context.getRemainingTimeInMillis() ; diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index 66b1904c..ae329af6 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -11,7 +11,6 @@ public class HandlerString implements RequestHandler{ public Integer handleRequest(String event, Context context) { LambdaLogger logger = context.getLogger(); - // process event logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return context.getRemainingTimeInMillis(); diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index b51d0b20..fb250b36 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -11,11 +11,8 @@ public class HandlerWeatherData implements RequestHandler{ @Override public Void handleRequest(SQSEvent event, Context context) { - // process event for(SQSMessage msg : event.getRecords()){ logger.info(msg.getBody()); } From 7ba155d9ddaea3550690b440cb70cee18ce86262 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 21 Feb 2023 14:00:43 -0800 Subject: [PATCH 181/243] Use Java 11 runtime for blank-java example - Upgrade runtime from java8 to java11 - Increase code memory size from 512MB -> 2048MB - Tested all steps and function still runs properly --- sample-apps/blank-java/build.gradle | 4 ++-- sample-apps/blank-java/pom.xml | 4 ++-- sample-apps/blank-java/template-mvn.yml | 4 ++-- sample-apps/blank-java/template.yml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index f5c3aa9e..8f15b122 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -53,8 +53,8 @@ task packageSkinny(type: Zip) { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } build.dependsOn packageSkinny diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 3b8bb0f7..9f86c7fc 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -8,8 +8,8 @@ blank-java-function UTF-8 - 1.8 - 1.8 + 11 + 11 diff --git a/sample-apps/blank-java/template-mvn.yml b/sample-apps/blank-java/template-mvn.yml index a2c3d5d6..105751cd 100644 --- a/sample-apps/blank-java/template-mvn.yml +++ b/sample-apps/blank-java/template-mvn.yml @@ -7,9 +7,9 @@ Resources: Properties: CodeUri: target/blank-java-1.0-SNAPSHOT.jar Handler: example.Handler::handleRequest - Runtime: java8 + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: diff --git a/sample-apps/blank-java/template.yml b/sample-apps/blank-java/template.yml index 748d3b7e..5a5d9f93 100644 --- a/sample-apps/blank-java/template.yml +++ b/sample-apps/blank-java/template.yml @@ -7,9 +7,9 @@ Resources: Properties: CodeUri: build/distributions/blank-java.zip Handler: example.Handler::handleRequest - Runtime: java8 + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: From 101eea3353a5212fd3f477d5777569f6970b9b20 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 21 Feb 2023 19:19:53 -0800 Subject: [PATCH 182/243] Update all of java-basic to use Java 11. - Added a bit more functionality to each handler - Added proper unit testing for each handler; all tests pass - Maven hack to exclude META-INF from shaded jar, avoiding a warning - Tested handlers to ensure they work as advertised --- sample-apps/java-basic/build.gradle | 4 +- sample-apps/java-basic/pom.xml | 16 +++- .../src/main/java/example/HandlerDivide.java | 3 + .../src/main/java/example/HandlerInteger.java | 5 +- .../src/main/java/example/HandlerList.java | 5 +- .../src/main/java/example/HandlerStream.java | 4 + .../src/main/java/example/HandlerString.java | 9 +- .../main/java/example/HandlerWeatherData.java | 10 +++ .../java/example/InputLengthException.java | 2 +- .../src/test/java/example/InvokeTest.java | 84 +++++++++++++++++-- sample-apps/java-basic/template-mvn.yml | 4 +- sample-apps/java-basic/template.yml | 4 +- 12 files changed, 128 insertions(+), 22 deletions(-) diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index f2688f40..343fb398 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -28,8 +28,8 @@ task buildZip(type: Zip) { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } build.dependsOn buildZip diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 4e280a67..26b3baa7 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -8,8 +8,8 @@ java-basic-function UTF-8 - 1.8 - 1.8 + 11 + 11 @@ -61,6 +61,14 @@ 3.2.2 false + + + com.example:* + + META-INF/MANIFEST.MF + + + @@ -76,8 +84,8 @@ maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 11 + 11 diff --git a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java index e70f2b90..b523d6c7 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java @@ -9,6 +9,9 @@ // Handler value: example.HandlerDivide public class HandlerDivide implements RequestHandler, Integer>{ + /* + * Takes a list of two integers and divides them. + */ @Override public Integer handleRequest(List event, Context context) { diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index 1bff73d5..b5063238 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -8,11 +8,14 @@ public class HandlerInteger implements RequestHandler{ @Override + /* + * Takes an Integer as input, adds 1, and returns it. + */ public Integer handleRequest(Integer event, Context context) { LambdaLogger logger = context.getLogger(); logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); - return context.getRemainingTimeInMillis(); + return event + 1; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index 8721cfbf..015de794 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -10,11 +10,14 @@ public class HandlerList implements RequestHandler, Integer>{ @Override + /* + * Takes a list of Integers and returns its sum. + */ public Integer handleRequest(List event, Context context) { LambdaLogger logger = context.getLogger(); logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); - return context.getRemainingTimeInMillis() ; + return event.stream().mapToInt(Integer::intValue).sum(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerStream.java b/sample-apps/java-basic/src/main/java/example/HandlerStream.java index c106dabe..30034635 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerStream.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerStream.java @@ -11,6 +11,10 @@ public class HandlerStream implements RequestStreamHandler { @Override + /* + * Takes an InputStream and an OutputStream. Reads from the InputStream, + * and copies all characters to the OutputStream. + */ public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException { int nextChar; diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index ae329af6..f43bd3cb 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -5,14 +5,17 @@ import com.amazonaws.services.lambda.runtime.LambdaLogger; // Handler value: example.HandlerString -public class HandlerString implements RequestHandler{ +public class HandlerString implements RequestHandler{ @Override - public Integer handleRequest(String event, Context context) + /* + * Takes a String as input, and converts all characters to lowercase. + */ + public String handleRequest(String event, Context context) { LambdaLogger logger = context.getLogger(); logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); - return context.getRemainingTimeInMillis(); + return event.toLowerCase(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index fb250b36..353cc3b8 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -8,11 +8,21 @@ public class HandlerWeatherData implements RequestHandler{ @Override + /* + * Takes in a WeatherData event object and updates its attributes with dummy values. + * Returns the updated WeatherData object. + */ public WeatherData handleRequest(WeatherData event, Context context) { LambdaLogger logger = context.getLogger(); logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); + + event.setHumidityPct(50.5); + event.setPressureHPa(1005); + event.setWindKmh(28); + // Assumes temperature of event is already set + event.setTemperatureK(event.getTemperatureK() + 2); return event; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/InputLengthException.java b/sample-apps/java-basic/src/main/java/example/InputLengthException.java index 6dea47c2..ee62bb9c 100644 --- a/sample-apps/java-basic/src/main/java/example/InputLengthException.java +++ b/sample-apps/java-basic/src/main/java/example/InputLengthException.java @@ -6,4 +6,4 @@ public class InputLengthException extends RuntimeException { public InputLengthException(String errorMessage) { super(errorMessage); } -} \ No newline at end of file +} diff --git a/sample-apps/java-basic/src/test/java/example/InvokeTest.java b/sample-apps/java-basic/src/test/java/example/InvokeTest.java index fccbf910..23d079df 100644 --- a/sample-apps/java-basic/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-basic/src/test/java/example/InvokeTest.java @@ -1,6 +1,9 @@ package example; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.Test; import com.amazonaws.services.lambda.runtime.Context; @@ -8,19 +11,88 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.HashMap; +import java.util.List; class InvokeTest { private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); @Test - void invokeTest() { - logger.info("Invoke TEST"); - HashMap event = new HashMap(); + void testHandler() { + logger.info("Invoke TEST - Handler"); + var event = new HashMap(); Context context = new TestContext(); Handler handler = new Handler(); - String result = handler.handleRequest(event, context); - assertTrue(result.contains("200 OK")); + assertNull(handler.handleRequest(event, context)); } + @Test + void testHandlerDivide() { + logger.info("Invoke TEST - HandlerDivide"); + var event = List.of(20, 5); + Context context = new TestContext(); + HandlerDivide handler = new HandlerDivide(); + assertEquals(4, handler.handleRequest(event, context)); + } + + @Test + void testHandlerInteger() { + logger.info("Invoke TEST - HandlerInteger"); + Integer event = 1; + Context context = new TestContext(); + HandlerInteger handler = new HandlerInteger(); + assertEquals(2, handler.handleRequest(event, context)); + } + + @Test + void testHandlerList() { + logger.info("Invoke TEST - HandlerList"); + var event = List.of(1, 2, 3, 4); + Context context = new TestContext(); + HandlerList handler = new HandlerList(); + assertEquals(10, handler.handleRequest(event, context)); + } + + @Test + void testHandlerStream() throws IOException { + logger.info("Invoke TEST - HandlerStream"); + String inputStr = "Hello world"; + byte[] inputBytes = inputStr.getBytes(); + ByteArrayInputStream inputStream = new ByteArrayInputStream(inputBytes); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + Context context = new TestContext(); + HandlerStream handler = new HandlerStream(); + handler.handleRequest(inputStream, outputStream, context); + byte[] outputBytes = outputStream.toByteArray(); + assertArrayEquals(inputBytes, outputBytes); + String outputStr = new String(outputBytes, StandardCharsets.UTF_8); + assertEquals(inputStr, outputStr); + } + + @Test + void testHandlerString() { + logger.info("Invoke TEST - HandlerString"); + String event = "HeLlO wOrLd"; + Context context = new TestContext(); + HandlerString handler = new HandlerString(); + assertEquals("hello world", handler.handleRequest(event, context)); + } + + @Test + void testHandlerWeatherData() { + logger.info("Invoke TEST - HandlerWeatherData"); + WeatherData inputData = new WeatherData(); + inputData.setTemperatureK(298); + Context context = new TestContext(); + HandlerWeatherData handler = new HandlerWeatherData(); + WeatherData outputData = handler.handleRequest(inputData, context); + assertNotNull(outputData.getHumidityPct()); + assertNotNull(outputData.getPressureHPa()); + assertNotNull(outputData.getWindKmh()); + assertEquals(300, outputData.getTemperatureK()); + } } diff --git a/sample-apps/java-basic/template-mvn.yml b/sample-apps/java-basic/template-mvn.yml index 0fdaaf91..b083f3f6 100644 --- a/sample-apps/java-basic/template-mvn.yml +++ b/sample-apps/java-basic/template-mvn.yml @@ -7,9 +7,9 @@ Resources: Properties: CodeUri: target/java-basic-1.0-SNAPSHOT.jar Handler: example.Handler - Runtime: java8 + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: diff --git a/sample-apps/java-basic/template.yml b/sample-apps/java-basic/template.yml index 5cec6e28..b82fa0aa 100644 --- a/sample-apps/java-basic/template.yml +++ b/sample-apps/java-basic/template.yml @@ -7,9 +7,9 @@ Resources: Properties: CodeUri: build/distributions/java-basic.zip Handler: example.Handler - Runtime: java8 + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: From 2675a77e74de7ff23a31d3ad098c93155fb29285 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 23 Feb 2023 00:17:40 -0800 Subject: [PATCH 183/243] Update java-events examples to use Java 11. - Add better functionality to each handler event. - Write one unit test per handler, using aws-lambda-java-tests library. - Tested each handler to ensure each still works. - Cleanup of blank-java and java-basic code. --- sample-apps/blank-java/build.gradle | 4 +- sample-apps/blank-java/pom.xml | 21 +- sample-apps/java-basic/build.gradle | 4 +- sample-apps/java-basic/pom.xml | 9 +- .../src/main/java/example/Handler.java | 13 +- .../src/main/java/example/HandlerDivide.java | 8 +- .../src/main/java/example/HandlerInteger.java | 11 +- .../src/main/java/example/HandlerList.java | 11 +- .../src/main/java/example/HandlerStream.java | 7 +- .../src/main/java/example/HandlerString.java | 11 +- .../main/java/example/HandlerWeatherData.java | 11 +- sample-apps/java-events/build.gradle | 7 +- .../java-events/events/apigateway-v1.json | 2 +- .../java-events/events/apigateway-v2.json | 1 + .../java-events/events/cloudfront.json | 40 ++++ .../java-events/events/sns-notification.json | 2 +- sample-apps/java-events/pom.xml | 38 ++-- .../src/main/java/example/Handler.java | 34 --- ...iGateway.java => HandlerApiGatewayV1.java} | 22 +- .../java/example/HandlerApiGatewayV2.java | 34 +++ .../main/java/example/HandlerCWEvents.java | 25 ++- .../src/main/java/example/HandlerCWLogs.java | 22 +- .../main/java/example/HandlerCloudFront.java | 28 ++- .../main/java/example/HandlerCodeCommit.java | 31 ++- .../src/main/java/example/HandlerCognito.java | 26 ++- .../src/main/java/example/HandlerConfig.java | 14 +- .../main/java/example/HandlerDynamoDB.java | 25 +-- .../main/java/example/HandlerFirehose.java | 26 ++- .../src/main/java/example/HandlerKinesis.java | 18 +- .../src/main/java/example/HandlerLex.java | 14 +- .../src/main/java/example/HandlerS3.java | 11 +- .../src/main/java/example/HandlerSNS.java | 28 ++- .../src/main/java/example/HandlerSQS.java | 15 +- .../src/main/java/example/Util.java | 20 -- .../src/test/java/example/InvokeTest.java | 200 +++++++++++++++++- 35 files changed, 531 insertions(+), 262 deletions(-) create mode 100644 sample-apps/java-events/events/cloudfront.json delete mode 100644 sample-apps/java-events/src/main/java/example/Handler.java rename sample-apps/java-events/src/main/java/example/{HandlerApiGateway.java => HandlerApiGatewayV1.java} (61%) create mode 100644 sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java delete mode 100644 sample-apps/java-events/src/main/java/example/Util.java diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 8f15b122..8058374b 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -21,8 +21,8 @@ dependencies { runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'com.amazonaws:aws-lambda-java-tests:1.1.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' } test { diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 9f86c7fc..bd642a4f 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -70,13 +70,13 @@ org.junit.jupiter junit-jupiter-api - 5.6.0 + 5.8.2 test org.junit.jupiter junit-jupiter-engine - 5.6.0 + 5.8.2 test @@ -106,29 +106,16 @@ shade - - - - - - - - - com.github.edwgiz - maven-shade-plugin.log4j2-cachefile-transformer - [2.17.1,) - - org.apache.maven.plugins maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 11 + 11 diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 343fb398..95a82dea 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -8,9 +8,7 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - testImplementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - testImplementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - testImplementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' + runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 26b3baa7..2489b1ec 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -33,20 +33,19 @@ org.apache.logging.log4j log4j-slf4j18-impl [2.17.1,) - test - + org.junit.jupiter junit-jupiter-api 5.6.0 test - - + + org.junit.jupiter junit-jupiter-engine 5.6.0 test - + diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index f8b3ea81..d2526c3d 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -2,20 +2,23 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Map; // Handler value: example.Handler public class Handler implements RequestHandler, Void>{ + private static final Logger logger = LoggerFactory.getLogger(Handler.class); + @Override public Void handleRequest(Map event, Context context) { - LambdaLogger logger = context.getLogger(); - logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); - logger.log("EVENT: " + event); - logger.log("EVENT TYPE: " + event.getClass()); + logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); + logger.info("EVENT: " + event); + logger.info("EVENT TYPE: " + event.getClass()); return null; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java index b523d6c7..c78b577e 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java @@ -2,27 +2,29 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + // Handler value: example.HandlerDivide public class HandlerDivide implements RequestHandler, Integer>{ + private static final Logger logger = LoggerFactory.getLogger(HandlerDivide.class); /* * Takes a list of two integers and divides them. */ @Override public Integer handleRequest(List event, Context context) { - LambdaLogger logger = context.getLogger(); if ( event.size() != 2 ) { throw new InputLengthException("Input must be an array that contains 2 numbers."); } int numerator = event.get(0); int denominator = event.get(1); - logger.log("EVENT: Numerator is " + event.get(0).toString() + + logger.info("EVENT: Numerator is " + event.get(0).toString() + "; Denominator is " + event.get(1).toString()); return numerator/denominator; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index b5063238..00d737a1 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -2,20 +2,23 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerInteger public class HandlerInteger implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerInteger.class); + @Override /* * Takes an Integer as input, adds 1, and returns it. */ public Integer handleRequest(Integer event, Context context) { - LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.info("EVENT: " + event); + logger.info("EVENT TYPE: " + event.getClass().toString()); return event + 1; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index 015de794..84034674 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -2,22 +2,25 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.List; // Handler value: example.HandlerList public class HandlerList implements RequestHandler, Integer>{ + private static final Logger logger = LoggerFactory.getLogger(HandlerList.class); + @Override /* * Takes a list of Integers and returns its sum. */ public Integer handleRequest(List event, Context context) { - LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.info("EVENT: " + event); + logger.info("EVENT TYPE: " + event.getClass().toString()); return event.stream().mapToInt(Integer::intValue).sum(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerStream.java b/sample-apps/java-basic/src/main/java/example/HandlerStream.java index 30034635..1d3066d0 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerStream.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerStream.java @@ -7,9 +7,14 @@ import java.io.IOException; import java.io.OutputStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { + private static final Logger logger = LoggerFactory.getLogger(HandlerStream.class); + @Override /* * Takes an InputStream and an OutputStream. Reads from the InputStream, @@ -27,7 +32,7 @@ public void handleRequest(InputStream inputStream, OutputStream outputStream, Co } finally { inputStream.close(); String finalString = outputStream.toString(); - System.out.println(finalString); + logger.info("Final string result: " + finalString); outputStream.close(); } } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index f43bd3cb..5598143c 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -2,20 +2,23 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerString public class HandlerString implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerString.class); + @Override /* * Takes a String as input, and converts all characters to lowercase. */ public String handleRequest(String event, Context context) { - LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); - logger.log("EVENT TYPE: " + event.getClass().toString()); + logger.info("EVENT: " + event); + logger.info("EVENT TYPE: " + event.getClass().toString()); return event.toLowerCase(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index 353cc3b8..6a839d03 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -2,11 +2,15 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerWeatherData public class HandlerWeatherData implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(WeatherData.class); + @Override /* * Takes in a WeatherData event object and updates its attributes with dummy values. @@ -14,9 +18,8 @@ public class HandlerWeatherData implements RequestHandlerjava-events-function UTF-8 - 1.8 - 1.8 + 11 + 11 @@ -27,16 +27,6 @@ gson 2.8.9 - - org.apache.logging.log4j - log4j-api - [2.17.1,) - - - org.apache.logging.log4j - log4j-core - [2.17.1,) - org.apache.logging.log4j log4j-slf4j18-impl @@ -45,13 +35,19 @@ org.junit.jupiter junit-jupiter-api - 5.6.0 + 5.8.2 test org.junit.jupiter junit-jupiter-engine - 5.6.0 + 5.8.2 + test + + + com.amazonaws + aws-lambda-java-tests + 1.1.1 test @@ -68,6 +64,16 @@ 3.2.2 false + + + *:* + + module-info.class + META-INF/* + META-INF/versions/** + + + @@ -83,8 +89,8 @@ maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 11 + 11 diff --git a/sample-apps/java-events/src/main/java/example/Handler.java b/sample-apps/java-events/src/main/java/example/Handler.java deleted file mode 100644 index d46bb14e..00000000 --- a/sample-apps/java-events/src/main/java/example/Handler.java +++ /dev/null @@ -1,34 +0,0 @@ -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyRequestEvent; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyResponseEvent; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import java.util.HashMap; - -// Handler value: example.Handler -public class Handler implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public APIGatewayV2ProxyResponseEvent handleRequest(APIGatewayV2ProxyRequestEvent event, Context context) - { - LambdaLogger logger = context.getLogger(); - APIGatewayV2ProxyResponseEvent response = new APIGatewayV2ProxyResponseEvent(); - response.setIsBase64Encoded(false); - response.setStatusCode(200); - HashMap headers = new HashMap(); - headers.put("Content-Type", "text/html"); - response.setHeaders(headers); - response.setBody("AWS Lambda sample"+ - "

Welcome

Page generated by a Lambda function.

" + - ""); - // log execution details - Util.logEnvironment(event, context, gson); - return response; - } -} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java similarity index 61% rename from sample-apps/java-events/src/main/java/example/HandlerApiGateway.java rename to sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java index c7513c2b..03e5fdc2 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGateway.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java @@ -5,28 +5,30 @@ import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import java.util.HashMap; -// Handler value: example.HandlerApiGateway -public class HandlerApiGateway implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.Handler +public class HandlerApiGatewayV1 implements RequestHandler{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerApiGatewayV1.class); + @Override public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent event, Context context) { + logger.info("EVENT TYPE: " + event.getClass().toString()); APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent(); response.setIsBase64Encoded(false); response.setStatusCode(200); HashMap headers = new HashMap(); headers.put("Content-Type", "text/html"); response.setHeaders(headers); - response.setBody("AWS Lambda sample"+ + String body = event.getBody() != null ? event.getBody() : "Empty body"; + response.setBody("" + body + "" + "

Welcome

Page generated by a Lambda function.

" + ""); - // log execution details - Util.logEnvironment(event, context, gson); return response; } -} +} \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java new file mode 100644 index 00000000..67925375 --- /dev/null +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java @@ -0,0 +1,34 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestHandler; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse; + +import java.util.HashMap; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Handler value: example.HandlerApiGateway +public class HandlerApiGatewayV2 implements RequestHandler{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerApiGatewayV2.class); + + @Override + public APIGatewayV2HTTPResponse handleRequest(APIGatewayV2HTTPEvent event, Context context) + { + logger.info("EVENT TYPE: " + event.getClass().toString()); + APIGatewayV2HTTPResponse response = new APIGatewayV2HTTPResponse(); + response.setIsBase64Encoded(false); + response.setStatusCode(200); + HashMap headers = new HashMap(); + headers.put("Content-Type", "text/html"); + response.setHeaders(headers); + String body = event.getBody() != null ? event.getBody() : "Empty body"; + response.setBody("" + body + "" + + "

Welcome

Page generated by a Lambda function.

" + + ""); + return response; + } +} diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java index 3678e982..8f8d8c55 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java @@ -4,18 +4,25 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerCWEvents -public class HandlerCWEvents implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerCWEvents implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerCWEvents.class); + @Override - public String handleRequest(ScheduledEvent event, Context context) + public List handleRequest(ScheduledEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var resourcesFound = new ArrayList(); + for (String resource : event.getResources()) { + resourcesFound.add(resource); + } + return resourcesFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java index df134e3e..6a753f8d 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java @@ -2,11 +2,8 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import java.util.Base64; import java.util.Base64.Decoder; @@ -17,14 +14,18 @@ import java.nio.charset.StandardCharsets; import java.util.zip.GZIPInputStream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + // Handler value: example.HandlerCWLogs public class HandlerCWLogs implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + private static final Logger logger = LoggerFactory.getLogger(HandlerCWLogs.class); + @Override public String handleRequest(CloudWatchLogsEvent event, Context context) { - LambdaLogger logger = context.getLogger(); - String response = new String("200 OK"); + logger.info("EVENT TYPE: " + event.getClass().toString()); Decoder decoder = Base64.getDecoder(); byte[] decodedEvent = decoder.decode(event.getAwsLogs().getData()); StringBuilder output = new StringBuilder(); @@ -33,15 +34,12 @@ public String handleRequest(CloudWatchLogsEvent event, Context context) InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); bufferedReader.lines().forEach( line -> { - logger.log(line); output.append(line); }); - logger.log(output.toString()); + // logger.info(output.toString()); } catch(IOException e) { - logger.log("ERROR: " + e.toString()); + logger.error("ERROR: " + e.toString()); } - // log execution details - Util.logEnvironment(event, context, gson); - return response; + return output.toString(); } } diff --git a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java index a239f989..277765b5 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java @@ -3,19 +3,29 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; +import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent.CF; +import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent.Record; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerCloudFront -public class HandlerCloudFront implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerCloudFront implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerCloudFront.class); + @Override - public String handleRequest(CloudFrontEvent event, Context context) + public List handleRequest(CloudFrontEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var urisFound = new ArrayList(); + for (Record record : event.getRecords()) { + CF cfBody = record.getCf(); + urisFound.add(cfBody.getRequest().getUri()); + } + return urisFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java b/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java index 6da28fcc..e4dee175 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java @@ -3,19 +3,32 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent; +import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent.CodeCommit; +import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent.Record; +import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent.Reference; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerCodeCommit -public class HandlerCodeCommit implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerCodeCommit implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerCodeCommit.class); + @Override - public String handleRequest(CodeCommitEvent event, Context context) + public List handleRequest(CodeCommitEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var commitsFound = new ArrayList(); + for (Record record : event.getRecords()) { + CodeCommit commit = record.getCodeCommit(); + for (Reference reference : commit.getReferences()) { + commitsFound.add(reference.getCommit()); + } + } + return commitsFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerCognito.java b/sample-apps/java-events/src/main/java/example/HandlerCognito.java index 402ef416..99e1e50f 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCognito.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCognito.java @@ -3,19 +3,27 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CognitoEvent; +import com.amazonaws.services.lambda.runtime.events.CognitoEvent.DatasetRecord; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerCognito -public class HandlerCognito implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerCognito implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerCognito.class); + @Override - public String handleRequest(CognitoEvent event, Context context) + public List handleRequest(CognitoEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var operationsFound = new ArrayList(); + for (DatasetRecord record : event.getDatasetRecords().values()) { + operationsFound.add(record.getOp()); + } + return operationsFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerConfig.java b/sample-apps/java-events/src/main/java/example/HandlerConfig.java index 709ced7b..b27e01be 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerConfig.java +++ b/sample-apps/java-events/src/main/java/example/HandlerConfig.java @@ -4,18 +4,18 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.ConfigEvent; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerConfig public class HandlerConfig implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + private static final Logger logger = LoggerFactory.getLogger(HandlerConfig.class); + @Override public String handleRequest(ConfigEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + return event.getConfigRuleArn(); } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java index da0c0281..07fd5018 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java +++ b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java @@ -5,28 +5,25 @@ import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.HandlerDynamoDB -public class HandlerDynamoDB implements RequestHandler{ +public class HandlerDynamoDB implements RequestHandler>{ + private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override - public String handleRequest(DynamodbEvent event, Context context) + public List handleRequest(DynamodbEvent event, Context context) { - String response = new String("200 OK"); - for (DynamodbStreamRecord record : event.getRecords()){ - logger.info(record.getEventID()); - logger.info(record.getEventName()); - logger.info(record.getDynamodb().toString()); + logger.info("EVENT TYPE: " + event.getClass().toString()); + var operationsFound = new ArrayList(); + for (DynamodbStreamRecord record : event.getRecords()) { + operationsFound.add(record.getEventName()); } - logger.info("Successfully processed " + event.getRecords().size() + " records."); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + return operationsFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java index 53ee9f25..9c930380 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java +++ b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java @@ -3,19 +3,27 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent.Record; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerFirehose -public class HandlerFirehose implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerFirehose implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerFirehose.class); + @Override - public String handleRequest(KinesisFirehoseEvent event, Context context) + public List handleRequest(KinesisFirehoseEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var recordIds = new ArrayList(); + for (Record record : event.getRecords()) { + recordIds.add(record.getRecordId()); + } + return recordIds; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java index e46720df..c23ee76d 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java +++ b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java @@ -8,22 +8,26 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.HandleKinesis -public class HandlerKinesis implements RequestHandler{ +public class HandlerKinesis implements RequestHandler>{ + private static final Logger logger = LoggerFactory.getLogger(HandlerKinesis.class); Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override - public String handleRequest(KinesisEvent event, Context context) + public List handleRequest(KinesisEvent event, Context context) { - String response = new String("200 OK"); + logger.info("EVENT TYPE: " + event.getClass().toString()); + var dataRecords = new ArrayList(); for(KinesisEventRecord record : event.getRecords()) { - logger.info(gson.toJson(record.getKinesis().getData())); + dataRecords.add(gson.toJson(record.getKinesis().getData())); } - // log execution details - Util.logEnvironment(event, context, gson); - return response; + return dataRecords; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerLex.java b/sample-apps/java-events/src/main/java/example/HandlerLex.java index b0d9294d..b1790d22 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerLex.java +++ b/sample-apps/java-events/src/main/java/example/HandlerLex.java @@ -4,18 +4,18 @@ import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.LexEvent; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerLex public class HandlerLex implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + private static final Logger logger = LoggerFactory.getLogger(HandlerLex.class); + @Override public String handleRequest(LexEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + return event.getCurrentIntent().getName(); } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerS3.java b/sample-apps/java-events/src/main/java/example/HandlerS3.java index cda08ceb..81ae0614 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerS3.java +++ b/sample-apps/java-events/src/main/java/example/HandlerS3.java @@ -3,23 +3,19 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; - import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.Handler public class HandlerS3 implements RequestHandler{ + private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); + @Override public String handleRequest(S3Event event, Context context) { - String response = new String("200 OK"); S3EventNotificationRecord record = event.getRecords().get(0); String srcBucket = record.getS3().getBucket().getName(); // Object key may have spaces or unicode non-ASCII characters. @@ -28,7 +24,6 @@ public String handleRequest(S3Event event, Context context) logger.info("SOURCE BUCKET: " + srcBucket); logger.info("SOURCE KEY: " + srcKey); // log execution details - Util.logEnvironment(event, context, gson); - return response; + return srcBucket + "/" + srcKey; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerSNS.java b/sample-apps/java-events/src/main/java/example/HandlerSNS.java index bcbda156..503264cb 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSNS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSNS.java @@ -3,19 +3,29 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.SNSEvent; +import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNS; +import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // Handler value: example.HandlerSNS -public class HandlerSNS implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); +public class HandlerSNS implements RequestHandler>{ + + private static final Logger logger = LoggerFactory.getLogger(HandlerSNS.class); + @Override - public String handleRequest(SNSEvent event, Context context) + public List handleRequest(SNSEvent event, Context context) { - String response = new String("200 OK"); - // log execution details - Util.logEnvironment(event, context, gson); - return response; + logger.info("EVENT TYPE: " + event.getClass().toString()); + var messagesFound = new ArrayList(); + for (SNSRecord record : event.getRecords()) { + SNS message = record.getSNS(); + messagesFound.add(message.getMessage()); + } + return messagesFound; } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerSQS.java b/sample-apps/java-events/src/main/java/example/HandlerSQS.java index 024c9ff1..0bc5d42e 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSQS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSQS.java @@ -5,18 +5,25 @@ import com.amazonaws.services.lambda.runtime.events.SQSEvent; import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; +import java.util.ArrayList; +import java.util.List; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; // Handler value: example.HandlerSQS -public class HandlerSQS implements RequestHandler{ +public class HandlerSQS implements RequestHandler>{ + private static final Logger logger = LoggerFactory.getLogger(HandlerSQS.class); + @Override - public Void handleRequest(SQSEvent event, Context context) + public List handleRequest(SQSEvent event, Context context) { + logger.info("EVENT TYPE: " + event.getClass().toString()); + var messagesFound = new ArrayList(); for(SQSMessage msg : event.getRecords()){ - logger.info(msg.getBody()); + messagesFound.add(msg.getBody()); } - return null; + return messagesFound; } } diff --git a/sample-apps/java-events/src/main/java/example/Util.java b/sample-apps/java-events/src/main/java/example/Util.java deleted file mode 100644 index b5e87294..00000000 --- a/sample-apps/java-events/src/main/java/example/Util.java +++ /dev/null @@ -1,20 +0,0 @@ -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; - -import com.google.gson.Gson; - -public class Util { - - public static void logEnvironment(Object event, Context context, Gson gson) - { - LambdaLogger logger = context.getLogger(); - // log execution details - logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - logger.log("CONTEXT: " + gson.toJson(context)); - // log event details - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - } -} \ No newline at end of file diff --git a/sample-apps/java-events/src/test/java/example/InvokeTest.java b/sample-apps/java-events/src/test/java/example/InvokeTest.java index c86f9821..881519cc 100644 --- a/sample-apps/java-events/src/test/java/example/InvokeTest.java +++ b/sample-apps/java-events/src/test/java/example/InvokeTest.java @@ -1,27 +1,205 @@ package example; import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyRequestEvent; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2ProxyResponseEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse; +import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; +import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; +import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent; +import com.amazonaws.services.lambda.runtime.events.CognitoEvent; +import com.amazonaws.services.lambda.runtime.events.ConfigEvent; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; +import com.amazonaws.services.lambda.runtime.events.LexEvent; +import com.amazonaws.services.lambda.runtime.events.S3Event; +import com.amazonaws.services.lambda.runtime.events.SNSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; +import com.amazonaws.services.lambda.runtime.tests.annotations.Event; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import java.util.List; + +import org.junit.jupiter.params.ParameterizedTest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; class InvokeTest { + private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + @ParameterizedTest + @Event(value = "events/apigateway-v1.json", type = APIGatewayProxyRequestEvent.class) + void testApiGatewayV1(APIGatewayProxyRequestEvent event) { + logger.info("Invoke TEST - ApiGatewayV1"); + Context context = new TestContext(); + HandlerApiGatewayV1 handler = new HandlerApiGatewayV1(); + APIGatewayProxyResponseEvent response = handler.handleRequest(event, context); + String expected = "" + "Hello world!" + "" + + "

Welcome

Page generated by a Lambda function.

" + + ""; + assertEquals(expected, response.getBody()); + } + + @ParameterizedTest + @Event(value = "events/apigateway-v2.json", type = APIGatewayV2HTTPEvent.class) + void testApiGatewayV2(APIGatewayV2HTTPEvent event) { + logger.info("Invoke TEST - ApiGatewayV1"); + Context context = new TestContext(); + HandlerApiGatewayV2 handler = new HandlerApiGatewayV2(); + APIGatewayV2HTTPResponse response = handler.handleRequest(event, context); + String expected = "" + "Hello world!" + "" + + "

Welcome

Page generated by a Lambda function.

" + + ""; + assertEquals(expected, response.getBody()); + } + + @ParameterizedTest + @Event(value = "events/cloudfront.json", type = CloudFrontEvent.class) + void testCloudFront(CloudFrontEvent event) { + logger.info("Invoke TEST - CloudFront"); + Context context = new TestContext(); + HandlerCloudFront handler = new HandlerCloudFront(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("/picture.jpg", response.get(0)); + } + + @ParameterizedTest + @Event(value = "events/codecommit-push.json", type = CodeCommitEvent.class) + void testCodeCommit(CodeCommitEvent event) { + logger.info("Invoke TEST - CodeCommit"); + Context context = new TestContext(); + HandlerCodeCommit handler = new HandlerCodeCommit(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("5c4ef1049f1d27deadbeeff313e0730018be182b", response.get(0)); + } + + @ParameterizedTest + @Event(value = "events/cognito-sync.json", type = CognitoEvent.class) + void testCognito(CognitoEvent event) { + logger.info("Invoke TEST - Cognito"); + Context context = new TestContext(); + HandlerCognito handler = new HandlerCognito(); + List response = handler.handleRequest(event, context); + assertEquals(2, response.size()); + assertEquals("replace", response.get(0)); + assertEquals("replace", response.get(1)); + } + + @ParameterizedTest + @Event(value = "events/config-rule.json", type = ConfigEvent.class) + void testConfig(ConfigEvent event) { + logger.info("Invoke TEST - Config"); + Context context = new TestContext(); + HandlerConfig handler = new HandlerConfig(); + String response = handler.handleRequest(event, context); + assertEquals("arn:aws:config:ca-central-1:123456789012:config-rule/config-rule-0123456", response); + } + + @ParameterizedTest + @Event(value = "events/cloudwatch-scheduled.json", type = ScheduledEvent.class) + void testCWEvents(ScheduledEvent event) { + logger.info("Invoke TEST - CWEvents"); + Context context = new TestContext(); + HandlerCWEvents handler = new HandlerCWEvents(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("arn:aws:events:us-east-2:123456789012:rule/my-rule", response.get(0)); + } + + @ParameterizedTest + @Event(value = "events/cloudwatch-logs.json", type = CloudWatchLogsEvent.class) + void testCWLogs(CloudWatchLogsEvent event) { + logger.info("Invoke TEST - CWLogs"); + Context context = new TestContext(); + HandlerCWLogs handler = new HandlerCWLogs(); + String response = handler.handleRequest(event, context); + assertNotNull(response); + } + + @ParameterizedTest + @Event(value = "events/dynamodb-record.json", type = DynamodbEvent.class) + void testDynamoDB(DynamodbEvent event) { + logger.info("Invoke TEST - DynamoDB"); + Context context = new TestContext(); + HandlerDynamoDB handler = new HandlerDynamoDB(); + List response = handler.handleRequest(event, context); + assertEquals(2, response.size()); + assertEquals("INSERT", response.get(0)); + assertEquals("MODIFY", response.get(1)); + } + + @ParameterizedTest + @Event(value = "events/firehose-record.json", type = KinesisFirehoseEvent.class) + void testFirehose(KinesisFirehoseEvent event) { + logger.info("Invoke TEST - Firehose"); + Context context = new TestContext(); + HandlerFirehose handler = new HandlerFirehose(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("49546986683135544286507457936321625675700192471156785154", response.get(0)); + } - @Test - void invokeTest() { - logger.info("Invoke TEST"); - APIGatewayV2ProxyRequestEvent event = new APIGatewayV2ProxyRequestEvent(); + @ParameterizedTest + @Event(value = "events/kinesis-record.json", type = KinesisEvent.class) + void testKinesis(KinesisEvent event) { + logger.info("Invoke TEST - Kinesis"); Context context = new TestContext(); - String requestId = context.getAwsRequestId(); - Handler handler = new Handler(); - APIGatewayV2ProxyResponseEvent result = handler.handleRequest(event, context); - assertEquals(200, result.getStatusCode()); + HandlerKinesis handler = new HandlerKinesis(); + List response = handler.handleRequest(event, context); + assertEquals(2, response.size()); } + @ParameterizedTest + @Event(value = "events/lex-flowers.json", type = LexEvent.class) + void testLex(LexEvent event) { + logger.info("Invoke TEST - Lex"); + Context context = new TestContext(); + HandlerLex handler = new HandlerLex(); + String response = handler.handleRequest(event, context); + assertEquals("OrderFlowers", response); + } + + @ParameterizedTest + @Event(value = "events/s3-notification.json", type = S3Event.class) + void testS3(S3Event event) { + logger.info("Invoke TEST - S3"); + Context context = new TestContext(); + HandlerS3 handler = new HandlerS3(); + String response = handler.handleRequest(event, context); + assertEquals("BUCKET_NAME/inbound/sample-java-s3.png", response); + } + + @ParameterizedTest + @Event(value = "events/sns-notification.json", type = SNSEvent.class) + void testSNS(SNSEvent event) { + logger.info("Invoke TEST - SNS"); + Context context = new TestContext(); + HandlerSNS handler = new HandlerSNS(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs.", response.get(0)); + } + + @ParameterizedTest + @Event(value = "events/sqs-record.json", type = SQSEvent.class) + void testSQS(SQSEvent event) { + logger.info("Invoke TEST - SQS"); + Context context = new TestContext(); + HandlerSQS handler = new HandlerSQS(); + List response = handler.handleRequest(event, context); + assertEquals(1, response.size()); + assertEquals("Hello from SQS!", response.get(0)); + } } From c8f10d2f7ec2b3cee3395f2ddf05421d35dde456 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 23 Feb 2023 15:38:36 -0800 Subject: [PATCH 184/243] Cleanup dependencies for blank-java --- sample-apps/blank-java/build.gradle | 6 ----- sample-apps/blank-java/pom.xml | 41 ++++++++--------------------- 2 files changed, 11 insertions(+), 36 deletions(-) diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 8058374b..9122538b 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -11,15 +11,9 @@ dependencies { implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.0' testImplementation 'com.amazonaws:aws-lambda-java-tests:1.1.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index bd642a4f..84017916 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -22,21 +22,6 @@ aws-lambda-java-events 2.2.9
- - com.amazonaws - aws-lambda-java-log4j2 - 1.5.0 - - - org.apache.logging.log4j - log4j-api - [2.17.1,) - - - org.apache.logging.log4j - log4j-core - [2.17.1,) - org.apache.logging.log4j log4j-slf4j18-impl @@ -52,21 +37,6 @@ aws-xray-recorder-sdk-core 2.4.0 - - com.amazonaws - aws-xray-recorder-sdk-aws-sdk-core - 2.4.0 - - - com.amazonaws - aws-xray-recorder-sdk-aws-sdk-v2 - 2.4.0 - - - com.amazonaws - aws-xray-recorder-sdk-aws-sdk-v2-instrumentor - 2.4.0 - org.junit.jupiter junit-jupiter-api @@ -99,6 +69,17 @@ 3.2.2 false + + + *:* + + module-info.class + META-INF/* + META-INF/versions/** + META-INF/services/** + + + From 2494e62991008b3c79a74250833cd190ccc061f4 Mon Sep 17 00:00:00 2001 From: William Davies <36384318+william-davies@users.noreply.github.com> Date: Mon, 27 Feb 2023 19:46:41 +0000 Subject: [PATCH 185/243] Fix typo I don't think the "to" was intended. Or at least it didn't read naturally for me! --- doc_source/with-sqs-create-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md index acdd5447..182d4fca 100644 --- a/doc_source/with-sqs-create-package.md +++ b/doc_source/with-sqs-create-package.md @@ -135,7 +135,7 @@ Build the executable with `go build` and create a deployment package\. For instr ## Python -The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. +The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. **Example ProcessSQSRecords\.py** @@ -149,4 +149,4 @@ def lambda_handler(event, context): print(str(payload)) ``` -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file +Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. From 6161f7e0a060990ccd0cb02fee93f666d4a1c92d Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 2 Mar 2023 13:06:34 -0800 Subject: [PATCH 186/243] Update logging mechanism in blank-java - Instead of SLF4J logger, use Context's logger (removes SLF4J dependency) - However, during unit testing, still requires SLF4J. Tests still show this logging option. - Verified that Maven/Gradle builds don't generate SLF4J warnings. --- sample-apps/blank-java/build.gradle | 4 ++-- sample-apps/blank-java/pom.xml | 8 ++++---- .../src/main/java/example/Handler.java | 10 ++++------ .../blank-java/src/main/resources/log4j2.xml | 16 ---------------- sample-apps/blank-java/template-mvn.yml | 10 ++++++++++ sample-apps/blank-java/template.yml | 2 +- 6 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 sample-apps/blank-java/src/main/resources/log4j2.xml diff --git a/sample-apps/blank-java/build.gradle b/sample-apps/blank-java/build.gradle index 9122538b..77ecd978 100644 --- a/sample-apps/blank-java/build.gradle +++ b/sample-apps/blank-java/build.gradle @@ -7,13 +7,13 @@ repositories { } dependencies { - implementation platform('software.amazon.awssdk:bom:2.10.73') + implementation platform('software.amazon.awssdk:bom:2.10.72') implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:2.2.9' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' + implementation 'org.slf4j:slf4j-nop:2.0.6' testImplementation 'com.amazonaws:aws-lambda-java-tests:1.1.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index 84017916..dfdd6e67 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -23,10 +23,10 @@ 2.2.9 - org.apache.logging.log4j - log4j-slf4j18-impl - [2.17.1,) - + org.slf4j + slf4j-nop + 2.0.6 + software.amazon.awssdk lambda diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index e7afe6d1..ef0067f8 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -1,13 +1,11 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import software.amazon.awssdk.services.lambda.LambdaClient; import software.amazon.awssdk.services.lambda.model.GetAccountSettingsResponse; import software.amazon.awssdk.services.lambda.model.LambdaException; @@ -15,14 +13,14 @@ // Handler value: example.Handler public class Handler implements RequestHandler, String> { - private static final Logger logger = LoggerFactory.getLogger(Handler.class); private static final LambdaClient lambdaClient = LambdaClient.builder().build(); @Override public String handleRequest(Map event, Context context) { - logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); - logger.info("EVENT: " + event); + LambdaLogger logger = context.getLogger(); + logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); + logger.log("EVENT: " + event); GetAccountSettingsResponse response = null; try { diff --git a/sample-apps/blank-java/src/main/resources/log4j2.xml b/sample-apps/blank-java/src/main/resources/log4j2.xml deleted file mode 100644 index b9a6c317..00000000 --- a/sample-apps/blank-java/src/main/resources/log4j2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - %d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n - - - - - - - - - - - \ No newline at end of file diff --git a/sample-apps/blank-java/template-mvn.yml b/sample-apps/blank-java/template-mvn.yml index 105751cd..3e058e55 100644 --- a/sample-apps/blank-java/template-mvn.yml +++ b/sample-apps/blank-java/template-mvn.yml @@ -18,3 +18,13 @@ Resources: - AWSXrayWriteOnlyAccess - AWSLambdaVPCAccessExecutionRole Tracing: Active + Layers: + - !Ref libs + libs: + Type: AWS::Serverless::LayerVersion + Properties: + LayerName: blank-java-lib + Description: Dependencies for the blank-java sample app. + ContentUri: build/blank-java-lib.zip + CompatibleRuntimes: + - java11 \ No newline at end of file diff --git a/sample-apps/blank-java/template.yml b/sample-apps/blank-java/template.yml index 5a5d9f93..6e43d190 100644 --- a/sample-apps/blank-java/template.yml +++ b/sample-apps/blank-java/template.yml @@ -27,4 +27,4 @@ Resources: Description: Dependencies for the blank-java sample app. ContentUri: build/blank-java-lib.zip CompatibleRuntimes: - - java8 \ No newline at end of file + - java11 \ No newline at end of file From 234f0e44c9f4de52593bd6febeaa7a1b50e94001 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 2 Mar 2023 14:07:12 -0800 Subject: [PATCH 187/243] Update logging in java-basic examples - Use Context logger for all handlers, removing SLF4J dependency - Unit testing still requires SLF4J dependency to show this logging option - Tested all handlers manually, minor updates to README --- sample-apps/blank-java/pom.xml | 4 +-- sample-apps/java-basic/README.md | 2 +- sample-apps/java-basic/build.gradle | 6 ++-- sample-apps/java-basic/pom.xml | 33 +++++++------------ .../src/main/java/example/Handler.java | 13 +++----- .../src/main/java/example/HandlerDivide.java | 9 ++--- .../src/main/java/example/HandlerInteger.java | 11 +++---- .../src/main/java/example/HandlerList.java | 11 +++---- .../src/main/java/example/HandlerStream.java | 9 ++--- .../src/main/java/example/HandlerString.java | 11 +++---- .../main/java/example/HandlerWeatherData.java | 11 +++---- 11 files changed, 45 insertions(+), 75 deletions(-) diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index dfdd6e67..fee37587 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -26,7 +26,7 @@ org.slf4j slf4j-nop 2.0.6 - + software.amazon.awssdk lambda @@ -79,7 +79,7 @@ META-INF/services/** - + diff --git a/sample-apps/java-basic/README.md b/sample-apps/java-basic/README.md index 2eac0425..7013c37d 100644 --- a/sample-apps/java-basic/README.md +++ b/sample-apps/java-basic/README.md @@ -95,7 +95,7 @@ To use a different handler, change the value of the Handler setting in the appli CodeUri: build/distributions/java-basic.zip Handler: example.HandlerList -Deploy the change, and then use the invoke script to test the new configuration. For handlers, that don't take a JSON object as input, pass the type (`string`, `int` or `list`) as an argument to the invoke script. +Deploy the change, and then use the invoke script to test the new configuration. For handlers, that don't take a JSON object as input, pass the type (`string`, `int`, `list`, or `divide`) as an argument to the invoke script. ./3-invoke.sh list { diff --git a/sample-apps/java-basic/build.gradle b/sample-apps/java-basic/build.gradle index 95a82dea..d0cbba47 100644 --- a/sample-apps/java-basic/build.gradle +++ b/sample-apps/java-basic/build.gradle @@ -8,9 +8,9 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' + implementation 'org.slf4j:slf4j-nop:2.0.6' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' } test { diff --git a/sample-apps/java-basic/pom.xml b/sample-apps/java-basic/pom.xml index 2489b1ec..a762955f 100644 --- a/sample-apps/java-basic/pom.xml +++ b/sample-apps/java-basic/pom.xml @@ -18,32 +18,20 @@ 1.2.1 - org.apache.logging.log4j - log4j-api - [2.17.1,) - test - - - org.apache.logging.log4j - log4j-core - [2.17.1,) - test - - - org.apache.logging.log4j - log4j-slf4j18-impl - [2.17.1,) + org.slf4j + slf4j-nop + 2.0.6 org.junit.jupiter junit-jupiter-api - 5.6.0 + 5.8.2 test org.junit.jupiter junit-jupiter-engine - 5.6.0 + 5.8.2 test
@@ -62,10 +50,13 @@ false - com.example:* - - META-INF/MANIFEST.MF - + *:* + + module-info.class + META-INF/* + META-INF/versions/** + META-INF/services/** + diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index d2526c3d..7c71b6f5 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.util.Map; // Handler value: example.Handler public class Handler implements RequestHandler, Void>{ - private static final Logger logger = LoggerFactory.getLogger(Handler.class); - @Override public Void handleRequest(Map event, Context context) { - logger.info("ENVIRONMENT VARIABLES: " + System.getenv()); - logger.info("EVENT: " + event); - logger.info("EVENT TYPE: " + event.getClass()); + LambdaLogger logger = context.getLogger(); + logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); + logger.log("EVENT: " + event); + logger.log("EVENT TYPE: " + event.getClass()); return null; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java index c78b577e..1498b612 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerDivide.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerDivide.java @@ -1,30 +1,27 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerDivide public class HandlerDivide implements RequestHandler, Integer>{ - - private static final Logger logger = LoggerFactory.getLogger(HandlerDivide.class); /* * Takes a list of two integers and divides them. */ @Override public Integer handleRequest(List event, Context context) { + LambdaLogger logger = context.getLogger(); if ( event.size() != 2 ) { throw new InputLengthException("Input must be an array that contains 2 numbers."); } int numerator = event.get(0); int denominator = event.get(1); - logger.info("EVENT: Numerator is " + event.get(0).toString() + + logger.log("EVENT: Numerator is " + event.get(0).toString() + "; Denominator is " + event.get(1).toString()); return numerator/denominator; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index 00d737a1..67171fbd 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerInteger public class HandlerInteger implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerInteger.class); - @Override /* * Takes an Integer as input, adds 1, and returns it. */ public Integer handleRequest(Integer event, Context context) { - logger.info("EVENT: " + event); - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT: " + event); + logger.log("EVENT TYPE: " + event.getClass().toString()); return event + 1; } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index 84034674..f963d4cd 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -1,26 +1,23 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.util.List; // Handler value: example.HandlerList public class HandlerList implements RequestHandler, Integer>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerList.class); - @Override /* * Takes a list of Integers and returns its sum. */ public Integer handleRequest(List event, Context context) { - logger.info("EVENT: " + event); - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT: " + event); + logger.log("EVENT TYPE: " + event.getClass().toString()); return event.stream().mapToInt(Integer::intValue).sum(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerStream.java b/sample-apps/java-basic/src/main/java/example/HandlerStream.java index 1d3066d0..e8006c8b 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerStream.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerStream.java @@ -1,20 +1,16 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestStreamHandler; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { - private static final Logger logger = LoggerFactory.getLogger(HandlerStream.class); - @Override /* * Takes an InputStream and an OutputStream. Reads from the InputStream, @@ -22,6 +18,7 @@ public class HandlerStream implements RequestStreamHandler { */ public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException { + LambdaLogger logger = context.getLogger(); int nextChar; try { while ((nextChar = inputStream.read()) != -1) { @@ -32,7 +29,7 @@ public void handleRequest(InputStream inputStream, OutputStream outputStream, Co } finally { inputStream.close(); String finalString = outputStream.toString(); - logger.info("Final string result: " + finalString); + logger.log("Final string result: " + finalString); outputStream.close(); } } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index 5598143c..e29922b4 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerString public class HandlerString implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerString.class); - @Override /* * Takes a String as input, and converts all characters to lowercase. */ public String handleRequest(String event, Context context) { - logger.info("EVENT: " + event); - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT: " + event); + logger.log("EVENT TYPE: " + event.getClass().toString()); return event.toLowerCase(); } } \ No newline at end of file diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index 6a839d03..2a6777ec 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -1,16 +1,12 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerWeatherData public class HandlerWeatherData implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(WeatherData.class); - @Override /* * Takes in a WeatherData event object and updates its attributes with dummy values. @@ -18,8 +14,9 @@ public class HandlerWeatherData implements RequestHandler Date: Thu, 2 Mar 2023 15:03:33 -0800 Subject: [PATCH 188/243] Update blank-csharp README.md to require .NET core SDK 6.0 --- sample-apps/blank-csharp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/blank-csharp/README.md b/sample-apps/blank-csharp/README.md index 230e901d..6a4687cc 100644 --- a/sample-apps/blank-csharp/README.md +++ b/sample-apps/blank-csharp/README.md @@ -11,7 +11,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [Managing Spot Instance Requests](https://docs.aws.amazon.com/lambda/latest/dg/services-ec2-tutorial.html) in the developer guide. # Requirements -- [.NET Core SDK 3.1](https://dotnet.microsoft.com/download/dotnet-core/3.1) +- [.NET Core SDK 6.0](https://dotnet.microsoft.com/download/dotnet-core/6.0) - [AWS extensions for .NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. From 17efd29c9e904b09c53d74d61a35dbd04216ffcd Mon Sep 17 00:00:00 2001 From: Tim Trevor Date: Thu, 2 Mar 2023 15:05:48 -0800 Subject: [PATCH 189/243] Update blank-csharp aws-lambda-tools-defaults.json to use net6.0 framework and dotnet6 runtime --- .../src/blank-csharp/aws-lambda-tools-defaults.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json index 9e276d0c..c815dcf9 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json +++ b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json @@ -11,8 +11,8 @@ "profile":"default", "region" : "us-east-2", "configuration" : "Release", - "framework" : "netcoreapp3.1", - "function-runtime":"dotnetcore3.1", + "framework" : "net6.0", + "function-runtime":"dotnet6", "function-memory-size" : 512, "function-timeout" : 30, "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler" From 74ec19d2159be673ecb2d61530c2d12b08f4e16f Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 2 Mar 2023 15:07:16 -0800 Subject: [PATCH 190/243] Update logging for java-events examples - Use Context logger in all handlers, removing SLF4J dependency - Unit testing still requires SLF4J logging - Included missing CloudFront option in 3-invoke.sh script - Manually deployed and tested all handlers; all work as normal --- sample-apps/java-events/3-invoke.sh | 3 +++ sample-apps/java-events/build.gradle | 8 ++++---- sample-apps/java-events/pom.xml | 6 +++--- .../main/java/example/HandlerApiGatewayV1.java | 9 +++------ .../main/java/example/HandlerApiGatewayV2.java | 9 +++------ .../src/main/java/example/HandlerCWEvents.java | 9 +++------ .../src/main/java/example/HandlerCWLogs.java | 11 ++++------- .../src/main/java/example/HandlerCloudFront.java | 9 +++------ .../src/main/java/example/HandlerCodeCommit.java | 9 +++------ .../src/main/java/example/HandlerCognito.java | 9 +++------ .../src/main/java/example/HandlerConfig.java | 9 +++------ .../src/main/java/example/HandlerDynamoDB.java | 9 +++------ .../src/main/java/example/HandlerFirehose.java | 9 +++------ .../src/main/java/example/HandlerKinesis.java | 8 +++----- .../src/main/java/example/HandlerLex.java | 9 +++------ .../src/main/java/example/HandlerS3.java | 13 +++++-------- .../src/main/java/example/HandlerSNS.java | 9 +++------ .../src/main/java/example/HandlerSQS.java | 9 +++------ .../java-events/src/main/resources/log4j2.xml | 16 ---------------- sample-apps/java-events/template-mvn.yml | 6 +++--- sample-apps/java-events/template.yml | 4 ++-- 21 files changed, 63 insertions(+), 120 deletions(-) delete mode 100644 sample-apps/java-events/src/main/resources/log4j2.xml diff --git a/sample-apps/java-events/3-invoke.sh b/sample-apps/java-events/3-invoke.sh index 5df2a8ef..c4bf8c43 100755 --- a/sample-apps/java-events/3-invoke.sh +++ b/sample-apps/java-events/3-invoke.sh @@ -16,6 +16,9 @@ then sns) PAYLOAD='file://events/sns-notification.json' ;; + cdn) + PAYLOAD='file://events/cloudfront.json' + ;; cfg) PAYLOAD='file://events/config-rule.json' ;; diff --git a/sample-apps/java-events/build.gradle b/sample-apps/java-events/build.gradle index 92e2f191..acec6a6d 100644 --- a/sample-apps/java-events/build.gradle +++ b/sample-apps/java-events/build.gradle @@ -9,11 +9,11 @@ repositories { dependencies { implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' + implementation 'com.google.code.gson:gson:2.8.9' + implementation 'org.slf4j:slf4j-nop:2.0.6' testImplementation 'com.amazonaws:aws-lambda-java-tests:1.1.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' } test { diff --git a/sample-apps/java-events/pom.xml b/sample-apps/java-events/pom.xml index 869fab92..025d54b5 100644 --- a/sample-apps/java-events/pom.xml +++ b/sample-apps/java-events/pom.xml @@ -28,9 +28,9 @@ 2.8.9 - org.apache.logging.log4j - log4j-slf4j18-impl - [2.17.1,) + org.slf4j + slf4j-nop + 2.0.6 org.junit.jupiter diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java index 03e5fdc2..c1fb1d5d 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV1.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; import java.util.HashMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.Handler public class HandlerApiGatewayV1 implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerApiGatewayV1.class); - @Override public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent(); response.setIsBase64Encoded(false); response.setStatusCode(200); diff --git a/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java index 67925375..b8fefa86 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java +++ b/sample-apps/java-events/src/main/java/example/HandlerApiGatewayV2.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse; import java.util.HashMap; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerApiGateway public class HandlerApiGatewayV2 implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerApiGatewayV2.class); - @Override public APIGatewayV2HTTPResponse handleRequest(APIGatewayV2HTTPEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); APIGatewayV2HTTPResponse response = new APIGatewayV2HTTPResponse(); response.setIsBase64Encoded(false); response.setStatusCode(200); diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java index 8f8d8c55..c052ef24 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWEvents.java @@ -1,24 +1,21 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerCWEvents public class HandlerCWEvents implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerCWEvents.class); - @Override public List handleRequest(ScheduledEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var resourcesFound = new ArrayList(); for (String resource : event.getResources()) { resourcesFound.add(resource); diff --git a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java index 6a753f8d..6ce35ab5 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCWLogs.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; @@ -14,18 +15,14 @@ import java.nio.charset.StandardCharsets; import java.util.zip.GZIPInputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerCWLogs public class HandlerCWLogs implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerCWLogs.class); - @Override public String handleRequest(CloudWatchLogsEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); Decoder decoder = Base64.getDecoder(); byte[] decodedEvent = decoder.decode(event.getAwsLogs().getData()); StringBuilder output = new StringBuilder(); @@ -38,7 +35,7 @@ public String handleRequest(CloudWatchLogsEvent event, Context context) }); // logger.info(output.toString()); } catch(IOException e) { - logger.error("ERROR: " + e.toString()); + logger.log("ERROR: " + e.toString()); } return output.toString(); } diff --git a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java index 277765b5..b48a9fd5 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCloudFront.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent.CF; @@ -9,18 +10,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerCloudFront public class HandlerCloudFront implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerCloudFront.class); - @Override public List handleRequest(CloudFrontEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var urisFound = new ArrayList(); for (Record record : event.getRecords()) { CF cfBody = record.getCf(); diff --git a/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java b/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java index e4dee175..5b5a2a5a 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCodeCommit.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent; import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent.CodeCommit; @@ -10,18 +11,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerCodeCommit public class HandlerCodeCommit implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerCodeCommit.class); - @Override public List handleRequest(CodeCommitEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var commitsFound = new ArrayList(); for (Record record : event.getRecords()) { CodeCommit commit = record.getCodeCommit(); diff --git a/sample-apps/java-events/src/main/java/example/HandlerCognito.java b/sample-apps/java-events/src/main/java/example/HandlerCognito.java index 99e1e50f..c8443c27 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerCognito.java +++ b/sample-apps/java-events/src/main/java/example/HandlerCognito.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.CognitoEvent; import com.amazonaws.services.lambda.runtime.events.CognitoEvent.DatasetRecord; @@ -8,18 +9,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerCognito public class HandlerCognito implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerCognito.class); - @Override public List handleRequest(CognitoEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var operationsFound = new ArrayList(); for (DatasetRecord record : event.getDatasetRecords().values()) { operationsFound.add(record.getOp()); diff --git a/sample-apps/java-events/src/main/java/example/HandlerConfig.java b/sample-apps/java-events/src/main/java/example/HandlerConfig.java index b27e01be..9d875333 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerConfig.java +++ b/sample-apps/java-events/src/main/java/example/HandlerConfig.java @@ -1,21 +1,18 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.ConfigEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerConfig public class HandlerConfig implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerConfig.class); - @Override public String handleRequest(ConfigEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); return event.getConfigRuleArn(); } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java index 07fd5018..21b6f222 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java +++ b/sample-apps/java-events/src/main/java/example/HandlerDynamoDB.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; @@ -8,18 +9,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerDynamoDB public class HandlerDynamoDB implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerDynamoDB.class); - @Override public List handleRequest(DynamodbEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var operationsFound = new ArrayList(); for (DynamodbStreamRecord record : event.getRecords()) { operationsFound.add(record.getEventName()); diff --git a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java index 9c930380..988b4f6d 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerFirehose.java +++ b/sample-apps/java-events/src/main/java/example/HandlerFirehose.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent.Record; @@ -8,18 +9,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerFirehose public class HandlerFirehose implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerFirehose.class); - @Override public List handleRequest(KinesisFirehoseEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var recordIds = new ArrayList(); for (Record record : event.getRecords()) { recordIds.add(record.getRecordId()); diff --git a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java index c23ee76d..cefa78fe 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerKinesis.java +++ b/sample-apps/java-events/src/main/java/example/HandlerKinesis.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.KinesisEvent; import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; @@ -11,19 +12,16 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandleKinesis public class HandlerKinesis implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerKinesis.class); Gson gson = new GsonBuilder().setPrettyPrinting().create(); @Override public List handleRequest(KinesisEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var dataRecords = new ArrayList(); for(KinesisEventRecord record : event.getRecords()) { dataRecords.add(gson.toJson(record.getKinesis().getData())); diff --git a/sample-apps/java-events/src/main/java/example/HandlerLex.java b/sample-apps/java-events/src/main/java/example/HandlerLex.java index b1790d22..efb5f71c 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerLex.java +++ b/sample-apps/java-events/src/main/java/example/HandlerLex.java @@ -1,21 +1,18 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.LexEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerLex public class HandlerLex implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerLex.class); - @Override public String handleRequest(LexEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); return event.getCurrentIntent().getName(); } } \ No newline at end of file diff --git a/sample-apps/java-events/src/main/java/example/HandlerS3.java b/sample-apps/java-events/src/main/java/example/HandlerS3.java index 81ae0614..adc96dff 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerS3.java +++ b/sample-apps/java-events/src/main/java/example/HandlerS3.java @@ -1,28 +1,25 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.Handler public class HandlerS3 implements RequestHandler{ - - private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); @Override public String handleRequest(S3Event event, Context context) { + LambdaLogger logger = context.getLogger(); S3EventNotificationRecord record = event.getRecords().get(0); String srcBucket = record.getS3().getBucket().getName(); // Object key may have spaces or unicode non-ASCII characters. String srcKey = record.getS3().getObject().getUrlDecodedKey(); - logger.info("RECORD: " + record); - logger.info("SOURCE BUCKET: " + srcBucket); - logger.info("SOURCE KEY: " + srcKey); + logger.log("RECORD: " + record); + logger.log("SOURCE BUCKET: " + srcBucket); + logger.log("SOURCE KEY: " + srcKey); // log execution details return srcBucket + "/" + srcKey; } diff --git a/sample-apps/java-events/src/main/java/example/HandlerSNS.java b/sample-apps/java-events/src/main/java/example/HandlerSNS.java index 503264cb..6b0aa666 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSNS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSNS.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.SNSEvent; import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNS; @@ -9,18 +10,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerSNS public class HandlerSNS implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerSNS.class); - @Override public List handleRequest(SNSEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var messagesFound = new ArrayList(); for (SNSRecord record : event.getRecords()) { SNS message = record.getSNS(); diff --git a/sample-apps/java-events/src/main/java/example/HandlerSQS.java b/sample-apps/java-events/src/main/java/example/HandlerSQS.java index 0bc5d42e..dabb49a2 100644 --- a/sample-apps/java-events/src/main/java/example/HandlerSQS.java +++ b/sample-apps/java-events/src/main/java/example/HandlerSQS.java @@ -1,6 +1,7 @@ package example; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.SQSEvent; import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; @@ -8,18 +9,14 @@ import java.util.ArrayList; import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.HandlerSQS public class HandlerSQS implements RequestHandler>{ - private static final Logger logger = LoggerFactory.getLogger(HandlerSQS.class); - @Override public List handleRequest(SQSEvent event, Context context) { - logger.info("EVENT TYPE: " + event.getClass().toString()); + LambdaLogger logger = context.getLogger(); + logger.log("EVENT TYPE: " + event.getClass().toString()); var messagesFound = new ArrayList(); for(SQSMessage msg : event.getRecords()){ messagesFound.add(msg.getBody()); diff --git a/sample-apps/java-events/src/main/resources/log4j2.xml b/sample-apps/java-events/src/main/resources/log4j2.xml deleted file mode 100644 index b9a6c317..00000000 --- a/sample-apps/java-events/src/main/resources/log4j2.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - %d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n - - - - - - - - - - - \ No newline at end of file diff --git a/sample-apps/java-events/template-mvn.yml b/sample-apps/java-events/template-mvn.yml index 62078b99..1e17bcbd 100644 --- a/sample-apps/java-events/template-mvn.yml +++ b/sample-apps/java-events/template-mvn.yml @@ -6,10 +6,10 @@ Resources: Type: AWS::Serverless::Function Properties: CodeUri: target/java-events-1.0-SNAPSHOT.jar - Handler: example.Handler - Runtime: java8 + Handler: example.HandlerSQS + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: diff --git a/sample-apps/java-events/template.yml b/sample-apps/java-events/template.yml index 2e818928..4b8bb3d8 100644 --- a/sample-apps/java-events/template.yml +++ b/sample-apps/java-events/template.yml @@ -7,9 +7,9 @@ Resources: Properties: CodeUri: build/distributions/java-events.zip Handler: example.HandlerSQS - Runtime: java8 + Runtime: java11 Description: Java function - MemorySize: 512 + MemorySize: 2048 Timeout: 10 # Function's execution role Policies: From 0506af67d4470d1f5ac0f8a634d1956536ea1cae Mon Sep 17 00:00:00 2001 From: Tim Trevor Date: Thu, 2 Mar 2023 15:07:26 -0800 Subject: [PATCH 191/243] Update blank-csharp Function.cs to remove static constructor --- .../blank-csharp/src/blank-csharp/Function.cs | 89 +++++++++++-------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/sample-apps/blank-csharp/src/blank-csharp/Function.cs b/sample-apps/blank-csharp/src/blank-csharp/Function.cs index a97a3199..e3a8db5d 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/Function.cs +++ b/sample-apps/blank-csharp/src/blank-csharp/Function.cs @@ -10,8 +10,7 @@ using Amazon.Lambda.SQSEvents; using Amazon.XRay.Recorder.Core; using Amazon.XRay.Recorder.Handlers.AwsSdk; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; +using System.IO; [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] @@ -19,41 +18,55 @@ namespace blankCsharp { public class Function { - private static AmazonLambdaClient lambdaClient; - - static Function() { - initialize(); - } - - static async void initialize() { - AWSSDKHandler.RegisterXRayForAllServices(); - lambdaClient = new AmazonLambdaClient(); - await callLambda(); - } - - public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) - { - GetAccountSettingsResponse accountSettings; - try - { - accountSettings = await callLambda(); - } - catch (AmazonLambdaException ex) - { - throw ex; - } - AccountUsage accountUsage = accountSettings.AccountUsage; - LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); - LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); - LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); - return accountUsage; - } - - public static async Task callLambda() - { - var request = new GetAccountSettingsRequest(); - var response = await lambdaClient.GetAccountSettingsAsync(request); - return response; - } + private AmazonLambdaClient lambdaClient; + + public Function() + { + initialize(); + } + + async void initialize() + { + AWSSDKHandler.RegisterXRayForAllServices(); + lambdaClient = new AmazonLambdaClient(); + await callLambda(); + } + + public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) + { + GetAccountSettingsResponse accountSettings; + try + { + accountSettings = await callLambda(); + } + catch (AmazonLambdaException ex) + { + throw ex; + } + + AccountUsage accountUsage = accountSettings.AccountUsage; + MemoryStream logData = new MemoryStream(); + StreamReader logDataReader = new StreamReader(logData); + + Amazon.Lambda.Serialization.Json.JsonSerializer serializer = new Amazon.Lambda.Serialization.Json.JsonSerializer(); + + serializer.Serialize(System.Environment.GetEnvironmentVariables(), logData); + LambdaLogger.Log("ENVIRONMENT VARIABLES: " + logDataReader.ReadLine()); + logData.Position = 0; + serializer.Serialize(context, logData); + LambdaLogger.Log("CONTEXT: " + logDataReader.ReadLine()); + logData.Position = 0; + serializer.Serialize(invocationEvent, logData); + LambdaLogger.Log("EVENT: " + logDataReader.ReadLine()); + + return accountUsage; + } + + public async Task callLambda() + { + var request = new GetAccountSettingsRequest(); + var response = await lambdaClient.GetAccountSettingsAsync(request); + return response; + } } } From 5efd96da596e29d31851a9765d7cbf893124abb6 Mon Sep 17 00:00:00 2001 From: Tim Trevor Date: Thu, 2 Mar 2023 15:10:05 -0800 Subject: [PATCH 192/243] Update blank-csharp.csproj to include latest library versions and target net6.0 framework --- .../src/blank-csharp/blank-csharp.csproj | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj b/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj index 4cbb52cc..aa648b33 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj +++ b/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj @@ -1,17 +1,16 @@ - netcoreapp3.1 + net6.0 true Lambda - - - - - - - - + + + + + + + \ No newline at end of file From 95ff514edd456aba343f3e528f6aa39fcaa85532 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Wed, 8 Mar 2023 17:49:36 -0800 Subject: [PATCH 193/243] Remove unnecessary logging of env vars and events --- sample-apps/blank-java/src/main/java/example/Handler.java | 5 ++--- sample-apps/java-basic/src/main/java/example/Handler.java | 2 -- .../java-basic/src/main/java/example/HandlerInteger.java | 1 - .../java-basic/src/main/java/example/HandlerList.java | 1 - .../java-basic/src/main/java/example/HandlerString.java | 1 - .../java-basic/src/main/java/example/HandlerWeatherData.java | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sample-apps/blank-java/src/main/java/example/Handler.java b/sample-apps/blank-java/src/main/java/example/Handler.java index ef0067f8..296b5eff 100644 --- a/sample-apps/blank-java/src/main/java/example/Handler.java +++ b/sample-apps/blank-java/src/main/java/example/Handler.java @@ -19,14 +19,13 @@ public class Handler implements RequestHandler, String> { public String handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); - logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); - logger.log("EVENT: " + event); + logger.log("Handler invoked"); GetAccountSettingsResponse response = null; try { response = lambdaClient.getAccountSettings(); } catch(LambdaException e) { - System.err.println(e.getMessage()); + logger.log(e.getMessage()); } return response != null ? "Total code size for your account is " + response.accountLimit().totalCodeSize() + " bytes" : "Error"; } diff --git a/sample-apps/java-basic/src/main/java/example/Handler.java b/sample-apps/java-basic/src/main/java/example/Handler.java index 7c71b6f5..5bb2090e 100644 --- a/sample-apps/java-basic/src/main/java/example/Handler.java +++ b/sample-apps/java-basic/src/main/java/example/Handler.java @@ -13,8 +13,6 @@ public class Handler implements RequestHandler, Void>{ public Void handleRequest(Map event, Context context) { LambdaLogger logger = context.getLogger(); - logger.log("ENVIRONMENT VARIABLES: " + System.getenv()); - logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass()); return null; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java index 67171fbd..8cac870f 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerInteger.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerInteger.java @@ -14,7 +14,6 @@ public class HandlerInteger implements RequestHandler{ public Integer handleRequest(Integer event, Context context) { LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return event + 1; } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerList.java b/sample-apps/java-basic/src/main/java/example/HandlerList.java index f963d4cd..d5b05884 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerList.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerList.java @@ -16,7 +16,6 @@ public class HandlerList implements RequestHandler, Integer>{ public Integer handleRequest(List event, Context context) { LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return event.stream().mapToInt(Integer::intValue).sum(); } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerString.java b/sample-apps/java-basic/src/main/java/example/HandlerString.java index e29922b4..029bbc9c 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerString.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerString.java @@ -14,7 +14,6 @@ public class HandlerString implements RequestHandler{ public String handleRequest(String event, Context context) { LambdaLogger logger = context.getLogger(); - logger.log("EVENT: " + event); logger.log("EVENT TYPE: " + event.getClass().toString()); return event.toLowerCase(); } diff --git a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java index 2a6777ec..06f1ca7a 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java @@ -15,7 +15,6 @@ public class HandlerWeatherData implements RequestHandler Date: Tue, 21 Mar 2023 16:45:23 -0700 Subject: [PATCH 194/243] For blank-java, support Maven in 2-build-layer.sh script --- sample-apps/blank-java/2-build-layer.sh | 13 +++++++-- sample-apps/blank-java/README.md | 6 +++- sample-apps/blank-java/pom.xml | 38 +++++++++++++++++++++++++ sample-apps/blank-java/template-mvn.yml | 2 +- sample-apps/blank-java/zip.xml | 19 +++++++++++++ 5 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 sample-apps/blank-java/zip.xml diff --git a/sample-apps/blank-java/2-build-layer.sh b/sample-apps/blank-java/2-build-layer.sh index 9a1dd8cd..144dd65b 100755 --- a/sample-apps/blank-java/2-build-layer.sh +++ b/sample-apps/blank-java/2-build-layer.sh @@ -1,4 +1,13 @@ #!/bin/bash set -eo pipefail -gradle -q packageLibs -mv build/distributions/blank-java.zip build/blank-java-lib.zip \ No newline at end of file + +if [ $1 ] +then + if [ $1 = mvn ] + then + mvn prepare-package + fi +else + gradle -q packageLibs + mv build/distributions/blank-java.zip build/blank-java-lib.zip +fi \ No newline at end of file diff --git a/sample-apps/blank-java/README.md b/sample-apps/blank-java/README.md index d63a88c2..bf802927 100644 --- a/sample-apps/blank-java/README.md +++ b/sample-apps/blank-java/README.md @@ -43,6 +43,10 @@ To build a Lambda layer that contains the function's runtime dependencies, run ` blank-java$ ./2-build-layer.sh +You can also run this commnand with Maven. To use Maven, add `mvn` to the command. + + blank-java$ ./2-build-layer.sh mvn + # Deploy To deploy the application, run `3-deploy.sh`. @@ -55,7 +59,7 @@ To deploy the application, run `3-deploy.sh`. This script uses AWS CloudFormation to deploy the Lambda functions and an IAM role. If the AWS CloudFormation stack that contains the resources already exists, the script updates it with any changes to the template or function code. -You can also build the application with Maven. To use maven, add `mvn` to the command. +You can also build the application with Maven. To use Maven, add `mvn` to the command. java-basic$ ./3-deploy.sh mvn [INFO] Scanning for projects... diff --git a/sample-apps/blank-java/pom.xml b/sample-apps/blank-java/pom.xml index fee37587..851541ae 100644 --- a/sample-apps/blank-java/pom.xml +++ b/sample-apps/blank-java/pom.xml @@ -90,6 +90,44 @@ + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + prepare-package + + copy-dependencies + + + + ${project.build.directory}/classes/java/lib + + runtime + test + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + prepare-package + + single + + + false + + zip.xml + + + + + org.apache.maven.plugins maven-compiler-plugin diff --git a/sample-apps/blank-java/template-mvn.yml b/sample-apps/blank-java/template-mvn.yml index 3e058e55..1b443cb7 100644 --- a/sample-apps/blank-java/template-mvn.yml +++ b/sample-apps/blank-java/template-mvn.yml @@ -25,6 +25,6 @@ Resources: Properties: LayerName: blank-java-lib Description: Dependencies for the blank-java sample app. - ContentUri: build/blank-java-lib.zip + ContentUri: target/blank-java-1.0-SNAPSHOT.zip CompatibleRuntimes: - java11 \ No newline at end of file diff --git a/sample-apps/blank-java/zip.xml b/sample-apps/blank-java/zip.xml new file mode 100644 index 00000000..14779c15 --- /dev/null +++ b/sample-apps/blank-java/zip.xml @@ -0,0 +1,19 @@ + + zip + false + + + zip + + + + ${project.build.directory}/classes/java + java/ + + example/ + + + + \ No newline at end of file From 8ecd4ec94017a53c3075152335feb40c91440ffc Mon Sep 17 00:00:00 2001 From: Federico Bergero Date: Tue, 18 Apr 2023 15:36:42 -0400 Subject: [PATCH 195/243] Update services-alb.md Fixing typo on JSON response --- doc_source/services-alb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md index 5bd0b328..aff96143 100644 --- a/doc_source/services-alb.md +++ b/doc_source/services-alb.md @@ -45,7 +45,7 @@ Your function processes the event and returns a response document to the load ba { "statusCode": 200, "statusDescription": "200 OK", - "isBase64Encoded": False, + "isBase64Encoded": false, "headers": { "Content-Type": "text/html" }, @@ -71,4 +71,4 @@ You should see the following output: } ``` -For instructions on configuring the Application Load Balancer listener and target group, see [Lambda functions as a target](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html) in the *User Guide for Application Load Balancers*\. \ No newline at end of file +For instructions on configuring the Application Load Balancer listener and target group, see [Lambda functions as a target](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html) in the *User Guide for Application Load Balancers*\. From c5ea10ace7c18f8cf6a03a629a566f70df2a8e51 Mon Sep 17 00:00:00 2001 From: Nico Rosner <95888173+awsgaucho@users.noreply.github.com> Date: Mon, 15 May 2023 09:30:05 -0400 Subject: [PATCH 196/243] Replace word for clarity in abbreviated Java lambda handler docs I think this better reflects the meaning. --- doc_source/java-handler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md index 0d1249d4..8a6a2324 100644 --- a/doc_source/java-handler.md +++ b/doc_source/java-handler.md @@ -36,7 +36,7 @@ The [Lambda runtime](lambda-runtimes.md) receives an event as a JSON\-formatted **Handler formats** + `package.Class::method` – Full format\. For example: `example.Handler::handleRequest`\. -+ `package.Class` – Abbreviated format for functions that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. ++ `package.Class` – Abbreviated format for classes that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. You can add [initialization code](https://docs.aws.amazon.com/lambda/latest/operatorguide/static-initialization.html) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. @@ -174,4 +174,4 @@ The `java-events` and `s3-java` applications take an AWS service event as input + [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. + [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. -To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. \ No newline at end of file +To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. From 192b0ef779222ef644898014d2c316924fe13dc6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Fri, 19 May 2023 11:03:31 -0700 Subject: [PATCH 197/243] Update build.gradle task --- sample-apps/s3-java/2-build-layer.sh | 2 +- sample-apps/s3-java/build.gradle | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/sample-apps/s3-java/2-build-layer.sh b/sample-apps/s3-java/2-build-layer.sh index 6483568e..621eb256 100755 --- a/sample-apps/s3-java/2-build-layer.sh +++ b/sample-apps/s3-java/2-build-layer.sh @@ -1,4 +1,4 @@ #!/bin/bash set -eo pipefail -gradle -q packageLibs +gradle -q packageJar mv build/distributions/s3-java.zip build/s3-java-lib.zip \ No newline at end of file diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 899688b4..06cf433f 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -27,28 +27,16 @@ test { useJUnitPlatform() } -task packageBig(type: Zip) { - from compileJava - from processResources +task packageJar(type: Zip) { into('lib') { - from configurations.runtimeClasspath + from(jar) + from(configurations.runtimeClasspath) } } -task packageLibs(type: Zip) { - into('java/lib') { - from configurations.runtimeClasspath - } -} - -task packageSmall(type: Zip) { - from compileJava - from processResources -} - java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } -build.dependsOn packageSmall +build.dependsOn packageJar From 2377f27e23e5a611759f9a274197b629ee88d339 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 27 Jun 2023 13:26:47 -0700 Subject: [PATCH 198/243] Add simple java17 example demonstrating use of Java record --- .../java17-examples/1-create-bucket.sh | 5 + sample-apps/java17-examples/2-deploy.sh | 16 +++ sample-apps/java17-examples/3-invoke.sh | 38 ++++++ sample-apps/java17-examples/4-cleanup.sh | 38 ++++++ sample-apps/java17-examples/README.md | 110 ++++++++++++++++++ sample-apps/java17-examples/build.gradle | 33 ++++++ sample-apps/java17-examples/event.json | 5 + sample-apps/java17-examples/pom.xml | 83 +++++++++++++ .../java/example/HandlerIntegerJava17.java | 21 ++++ .../src/main/java/example/IntegerRecord.java | 5 + sample-apps/java17-examples/template-mvn.yml | 20 ++++ sample-apps/java17-examples/template.yml | 20 ++++ .../test/java/example/InvokeTest.java | 47 ++++++++ .../test/java/example/TestContext.java | 45 +++++++ .../test/java/example/TestLogger.java | 14 +++ .../java17-examples/test/resources/log4j2.xml | 12 ++ 16 files changed, 512 insertions(+) create mode 100755 sample-apps/java17-examples/1-create-bucket.sh create mode 100755 sample-apps/java17-examples/2-deploy.sh create mode 100755 sample-apps/java17-examples/3-invoke.sh create mode 100755 sample-apps/java17-examples/4-cleanup.sh create mode 100644 sample-apps/java17-examples/README.md create mode 100644 sample-apps/java17-examples/build.gradle create mode 100644 sample-apps/java17-examples/event.json create mode 100644 sample-apps/java17-examples/pom.xml create mode 100644 sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java create mode 100644 sample-apps/java17-examples/src/main/java/example/IntegerRecord.java create mode 100644 sample-apps/java17-examples/template-mvn.yml create mode 100644 sample-apps/java17-examples/template.yml create mode 100644 sample-apps/java17-examples/test/java/example/InvokeTest.java create mode 100644 sample-apps/java17-examples/test/java/example/TestContext.java create mode 100644 sample-apps/java17-examples/test/java/example/TestLogger.java create mode 100644 sample-apps/java17-examples/test/resources/log4j2.xml diff --git a/sample-apps/java17-examples/1-create-bucket.sh b/sample-apps/java17-examples/1-create-bucket.sh new file mode 100755 index 00000000..64a5f749 --- /dev/null +++ b/sample-apps/java17-examples/1-create-bucket.sh @@ -0,0 +1,5 @@ +#!/bin/bash +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME diff --git a/sample-apps/java17-examples/2-deploy.sh b/sample-apps/java17-examples/2-deploy.sh new file mode 100755 index 00000000..73723ab9 --- /dev/null +++ b/sample-apps/java17-examples/2-deploy.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -eo pipefail +ARTIFACT_BUCKET=$(cat bucket-name.txt) +TEMPLATE=template.yml +if [ $1 ] +then + if [ $1 = mvn ] + then + TEMPLATE=template-mvn.yml + mvn package + fi +else + gradle build -i +fi +aws cloudformation package --template-file $TEMPLATE --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml +aws cloudformation deploy --template-file out.yml --stack-name java17-examples --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/java17-examples/3-invoke.sh b/sample-apps/java17-examples/3-invoke.sh new file mode 100755 index 00000000..4e4cfd5b --- /dev/null +++ b/sample-apps/java17-examples/3-invoke.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -eo pipefail +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name java17-examples --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) +if [ $1 ] +then + case $1 in + string) + PAYLOAD='"MYSTRING"' + ;; + + int | integer) + PAYLOAD=12345 + ;; + + list) + PAYLOAD='[24,25,26]' + ;; + + divide) + PAYLOAD='[235241,17]' + ;; + + *) + echo -n "Unknown event type" + ;; + esac +fi +while true; do + if [ $PAYLOAD ] + then + aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json + else + aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + fi + cat out.json + echo "" + sleep 2 +done diff --git a/sample-apps/java17-examples/4-cleanup.sh b/sample-apps/java17-examples/4-cleanup.sh new file mode 100755 index 00000000..45bb0df8 --- /dev/null +++ b/sample-apps/java17-examples/4-cleanup.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -eo pipefail +STACK=java17-examples +if [[ $# -eq 1 ]] ; then + STACK=$1 + echo "Deleting stack $STACK" +fi +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) +aws cloudformation delete-stack --stack-name $STACK +echo "Deleted $STACK stack." + +if [ -f bucket-name.txt ]; then + ARTIFACT_BUCKET=$(cat bucket-name.txt) + if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then + echo "Bucket was not created by this application. Skipping." + else + while true; do + read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response + case $response in + [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; rm bucket-name.txt; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac + done + fi +fi + +while true; do + read -p "Delete function log group (/aws/lambda/$FUNCTION)? (y/n)" response + case $response in + [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac +done + +rm -f out.yml out.json +rm -rf build .gradle target diff --git a/sample-apps/java17-examples/README.md b/sample-apps/java17-examples/README.md new file mode 100644 index 00000000..7013c37d --- /dev/null +++ b/sample-apps/java17-examples/README.md @@ -0,0 +1,110 @@ +# Basic function with minimal dependencies (Java) + +![Architecture](/sample-apps/java-basic/images/sample-java-basic.png) + +The project source includes function code and supporting resources: +- `src/main` - A Java function. +- `src/test` - A unit test and helper classes. +- `template.yml` - An AWS CloudFormation template that creates an application. +- `build.gradle` - A Gradle build file. +- `pom.xml` - A Maven build file. +- `1-create-bucket.sh`, `2-deploy.sh`, etc. - Shell scripts that use the AWS CLI to deploy and manage the application. + +Use the following instructions to deploy the sample application. + +# Requirements +- [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) +- [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) +- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. + +# Setup +Download or clone this repository. + + $ git clone https://github.com/awsdocs/aws-lambda-developer-guide.git + $ cd aws-lambda-developer-guide/sample-apps/java-basic + +To create a new bucket for deployment artifacts, run `1-create-bucket.sh`. + + java-basic$ ./1-create-bucket.sh + make_bucket: lambda-artifacts-a5e4xmplb5b22e0d + +# Deploy +To deploy the application, run `2-deploy.sh`. + + java-basic$ ./2-deploy.sh + BUILD SUCCESSFUL in 1s + Successfully packaged artifacts and wrote output template to file out.yml. + Waiting for changeset to be created.. + Successfully created/updated stack - java-basic + +This script uses AWS CloudFormation to deploy the Lambda functions and an IAM role. If the AWS CloudFormation stack that contains the resources already exists, the script updates it with any changes to the template or function code. + +You can also build the application with Maven. To use maven, add `mvn` to the command. + + java-basic$ ./2-deploy.sh mvn + [INFO] Scanning for projects... + [INFO] -----------------------< com.example:java-basic >----------------------- + [INFO] Building java-basic-function 1.0-SNAPSHOT + [INFO] --------------------------------[ jar ]--------------------------------- + ... + +# Test +To invoke the function, run `3-invoke.sh`. + + java-basic$ ./3-invoke.sh + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + "200 OK" + +Let the script invoke the function a few times and then press `CRTL+C` to exit. + +The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. + +![Service Map](/sample-apps/java-basic/images/java-basic-servicemap.png) + +Choose a node in the main function graph. Then choose **View traces** to see a list of traces. Choose any trace to view a timeline that breaks down the work done by the function. + +![Trace](/sample-apps/java-basic/images/java-basic-trace.png) + +# Configure Handler Class + +By default, the function uses a handler class named `Handler` that takes a map as input and returns a string. The project also includes handlers that use other input and output types. These are defined in the following files under src/main/java/example: + +- `Handler.java` – Takes a `Map` as input. +- `HandlerInteger.java` – Takes an `Integer` as input. +- `HandlerList.java` – Takes a `List` as input. +- `HandlerDivide.java` – Takes a `List` with two integers as input. +- `HandlerStream.java` – Takes an `InputStream` and `OutputStream` as input. +- `HandlerString.java` – Takes a `String` as input. +- `HandlerWeatherData.java` – Takes a custom type as input. + +To use a different handler, change the value of the Handler setting in the application template (`template.yml` or `template-mvn.yaml`). For example, to use the list handler: + + Properties: + CodeUri: build/distributions/java-basic.zip + Handler: example.HandlerList + +Deploy the change, and then use the invoke script to test the new configuration. For handlers, that don't take a JSON object as input, pass the type (`string`, `int`, `list`, or `divide`) as an argument to the invoke script. + + ./3-invoke.sh list + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + 9979 + +# Cleanup +To delete the application, run `4-cleanup.sh`. + + java-basic$ ./4-cleanup.sh diff --git a/sample-apps/java17-examples/build.gradle b/sample-apps/java17-examples/build.gradle new file mode 100644 index 00000000..6f4b7f25 --- /dev/null +++ b/sample-apps/java17-examples/build.gradle @@ -0,0 +1,33 @@ +plugins { + id 'java' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' + implementation 'org.slf4j:slf4j-nop:2.0.6' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' +} + +test { + useJUnitPlatform() +} + +task buildZip(type: Zip) { + from compileJava + from processResources + into('lib') { + from configurations.runtimeClasspath + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +build.dependsOn buildZip diff --git a/sample-apps/java17-examples/event.json b/sample-apps/java17-examples/event.json new file mode 100644 index 00000000..8d9c02d0 --- /dev/null +++ b/sample-apps/java17-examples/event.json @@ -0,0 +1,5 @@ +{ + "x": 1, + "y": 20, + "message": "Hello World!" +} diff --git a/sample-apps/java17-examples/pom.xml b/sample-apps/java17-examples/pom.xml new file mode 100644 index 00000000..02eae0ea --- /dev/null +++ b/sample-apps/java17-examples/pom.xml @@ -0,0 +1,83 @@ + + 4.0.0 + com.example + java17-examples + jar + 1.0-SNAPSHOT + java-basic-function + + UTF-8 + 17 + 17 + + + + com.amazonaws + aws-lambda-java-core + 1.2.1 + + + org.slf4j + slf4j-nop + 2.0.6 + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + + + + + maven-surefire-plugin + 2.22.2 + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.2 + + false + + + *:* + + module-info.class + META-INF/* + META-INF/versions/** + META-INF/services/** + + + + + + + package + + shade + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java b/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java new file mode 100644 index 00000000..ef9c0609 --- /dev/null +++ b/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java @@ -0,0 +1,21 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import com.amazonaws.services.lambda.runtime.RequestHandler; + +// Handler value: example.HandlerInteger +public class HandlerIntegerJava17 implements RequestHandler{ + + @Override + /* + * Takes in an InputRecord, which contains two integers and a String. + * Logs the String, then returns the sum of the two Integers. + */ + public Integer handleRequest(IntegerRecord event, Context context) + { + LambdaLogger logger = context.getLogger(); + logger.log("String found: " + event.message()); + return event.x() + event.y(); + } +} diff --git a/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java b/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java new file mode 100644 index 00000000..115c6be3 --- /dev/null +++ b/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java @@ -0,0 +1,5 @@ +package example; + +public record IntegerRecord(int x, int y, String message) { + +} diff --git a/sample-apps/java17-examples/template-mvn.yml b/sample-apps/java17-examples/template-mvn.yml new file mode 100644 index 00000000..392f1031 --- /dev/null +++ b/sample-apps/java17-examples/template-mvn.yml @@ -0,0 +1,20 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: target/java17-examples-1.0-SNAPSHOT.jar + Handler: example.HandlerIntegerJava17 + Runtime: java17 + Description: Java function + MemorySize: 2048 + Timeout: 10 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambda_ReadOnlyAccess + - AWSXrayWriteOnlyAccess + - AWSLambdaVPCAccessExecutionRole + Tracing: Active diff --git a/sample-apps/java17-examples/template.yml b/sample-apps/java17-examples/template.yml new file mode 100644 index 00000000..42fc6085 --- /dev/null +++ b/sample-apps/java17-examples/template.yml @@ -0,0 +1,20 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: AWS::Serverless::Function + Properties: + CodeUri: build/distributions/java17-examples.zip + Handler: example.HandlerIntegerJava17 + Runtime: java17 + Description: Java function + MemorySize: 2048 + Timeout: 10 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambda_ReadOnlyAccess + - AWSXrayWriteOnlyAccess + - AWSLambdaVPCAccessExecutionRole + Tracing: Active diff --git a/sample-apps/java17-examples/test/java/example/InvokeTest.java b/sample-apps/java17-examples/test/java/example/InvokeTest.java new file mode 100644 index 00000000..bf4b6427 --- /dev/null +++ b/sample-apps/java17-examples/test/java/example/InvokeTest.java @@ -0,0 +1,47 @@ +package example; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent; +import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse; +import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; +import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; +import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent; +import com.amazonaws.services.lambda.runtime.events.CognitoEvent; +import com.amazonaws.services.lambda.runtime.events.ConfigEvent; +import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisEvent; +import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; +import com.amazonaws.services.lambda.runtime.events.LexEvent; +import com.amazonaws.services.lambda.runtime.events.S3Event; +import com.amazonaws.services.lambda.runtime.events.SNSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; +import com.amazonaws.services.lambda.runtime.tests.annotations.Event; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import java.util.List; + +import org.junit.jupiter.params.ParameterizedTest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class InvokeTest { + + private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + @Test + void testHandlerIntegerJava17() { + logger.info("Invoke TEST - HandlerIntegerJava17"); + InputRecord input = new InputRecord(2, 4, "Hello World!"); + HandlerIntegerJava17 handler = new HandlerIntegerJava17(); + assertEquals(6, handler.handleRequest(input, context)); + } +} diff --git a/sample-apps/java17-examples/test/java/example/TestContext.java b/sample-apps/java17-examples/test/java/example/TestContext.java new file mode 100644 index 00000000..69e0af00 --- /dev/null +++ b/sample-apps/java17-examples/test/java/example/TestContext.java @@ -0,0 +1,45 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.CognitoIdentity; +import com.amazonaws.services.lambda.runtime.ClientContext; +import com.amazonaws.services.lambda.runtime.LambdaLogger; + +public class TestContext implements Context{ + + public TestContext() {} + public String getAwsRequestId(){ + return new String("495b12a8-xmpl-4eca-8168-160484189f99"); + } + public String getLogGroupName(){ + return new String("/aws/lambda/my-function"); + } + public String getLogStreamName(){ + return new String("2020/02/26/[$LATEST]704f8dxmpla04097b9134246b8438f1a"); + } + public String getFunctionName(){ + return new String("my-function"); + } + public String getFunctionVersion(){ + return new String("$LATEST"); + } + public String getInvokedFunctionArn(){ + return new String("arn:aws:lambda:us-east-2:123456789012:function:my-function"); + } + public CognitoIdentity getIdentity(){ + return null; + } + public ClientContext getClientContext(){ + return null; + } + public int getRemainingTimeInMillis(){ + return 300000; + } + public int getMemoryLimitInMB(){ + return 512; + } + public LambdaLogger getLogger(){ + return new TestLogger(); + } + +} \ No newline at end of file diff --git a/sample-apps/java17-examples/test/java/example/TestLogger.java b/sample-apps/java17-examples/test/java/example/TestLogger.java new file mode 100644 index 00000000..1d3c8efc --- /dev/null +++ b/sample-apps/java17-examples/test/java/example/TestLogger.java @@ -0,0 +1,14 @@ +package example; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.amazonaws.services.lambda.runtime.LambdaLogger; + +public class TestLogger implements LambdaLogger { + private static final Logger logger = LoggerFactory.getLogger(TestLogger.class); + public void log(String message){ + logger.info(message); + } + public void log(byte[] message){ + logger.info(new String(message)); + } +} diff --git a/sample-apps/java17-examples/test/resources/log4j2.xml b/sample-apps/java17-examples/test/resources/log4j2.xml new file mode 100644 index 00000000..f553f6f5 --- /dev/null +++ b/sample-apps/java17-examples/test/resources/log4j2.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file From 0da33a5ef1456c92ea7b9ff30aa51bcd9b8d466f Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Wed, 28 Jun 2023 13:57:30 -0700 Subject: [PATCH 199/243] Consolidate IntegerRecord record into main handler class --- .../src/main/java/example/HandlerIntegerJava17.java | 3 +++ .../java17-examples/src/main/java/example/IntegerRecord.java | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 sample-apps/java17-examples/src/main/java/example/IntegerRecord.java diff --git a/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java b/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java index ef9c0609..c64d4097 100644 --- a/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java +++ b/sample-apps/java17-examples/src/main/java/example/HandlerIntegerJava17.java @@ -19,3 +19,6 @@ public Integer handleRequest(IntegerRecord event, Context context) return event.x() + event.y(); } } + +record IntegerRecord(int x, int y, String message) { +} diff --git a/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java b/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java deleted file mode 100644 index 115c6be3..00000000 --- a/sample-apps/java17-examples/src/main/java/example/IntegerRecord.java +++ /dev/null @@ -1,5 +0,0 @@ -package example; - -public record IntegerRecord(int x, int y, String message) { - -} From a782c0fa8d36e39352a968052c407c5ea6a84d92 Mon Sep 17 00:00:00 2001 From: Tim Trevor Date: Thu, 29 Jun 2023 17:31:04 +0000 Subject: [PATCH 200/243] Replace node.js 12 references in template.yml files with node.js 16 --- sample-apps/blank-nodejs/template.yml | 4 ++-- sample-apps/error-processor/template.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample-apps/blank-nodejs/template.yml b/sample-apps/blank-nodejs/template.yml index fbef2c5c..b376e3a3 100644 --- a/sample-apps/blank-nodejs/template.yml +++ b/sample-apps/blank-nodejs/template.yml @@ -6,7 +6,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: index.handler - Runtime: nodejs12.x + Runtime: nodejs16.x CodeUri: function/. Description: Call the AWS Lambda API Timeout: 10 @@ -25,4 +25,4 @@ Resources: Description: Dependencies for the blank sample app. ContentUri: lib/. CompatibleRuntimes: - - nodejs12.x + - nodejs16.x diff --git a/sample-apps/error-processor/template.yml b/sample-apps/error-processor/template.yml index 7705f567..6382da46 100644 --- a/sample-apps/error-processor/template.yml +++ b/sample-apps/error-processor/template.yml @@ -3,7 +3,7 @@ Transform: 'AWS::Serverless-2016-10-31' Description: An AWS Lambda application that uses Amazon CloudWatch Logs, AWS X-Ray, and AWS CloudFormation custom resources. Globals: Function: - Runtime: nodejs12.x + Runtime: nodejs16.x Handler: index.handler Tracing: Active Layers: @@ -49,7 +49,7 @@ Resources: Description: Dependencies for the error-processor sample app. ContentUri: lib/. CompatibleRuntimes: - - nodejs12.x + - nodejs16.x randomerror: Type: AWS::Serverless::Function Properties: From 8bf32b7bc774dada2a960f8380f62929da88f51a Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 6 Jul 2023 11:28:17 -0700 Subject: [PATCH 201/243] Remove unnecessary imports --- .../test/java/example/InvokeTest.java | 47 ------------------- .../test/java/example/TestContext.java | 45 ------------------ .../test/java/example/TestLogger.java | 14 ------ .../java17-examples/test/resources/log4j2.xml | 12 ----- 4 files changed, 118 deletions(-) delete mode 100644 sample-apps/java17-examples/test/java/example/InvokeTest.java delete mode 100644 sample-apps/java17-examples/test/java/example/TestContext.java delete mode 100644 sample-apps/java17-examples/test/java/example/TestLogger.java delete mode 100644 sample-apps/java17-examples/test/resources/log4j2.xml diff --git a/sample-apps/java17-examples/test/java/example/InvokeTest.java b/sample-apps/java17-examples/test/java/example/InvokeTest.java deleted file mode 100644 index bf4b6427..00000000 --- a/sample-apps/java17-examples/test/java/example/InvokeTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package example; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; -import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent; -import com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPResponse; -import com.amazonaws.services.lambda.runtime.events.CloudFrontEvent; -import com.amazonaws.services.lambda.runtime.events.CloudWatchLogsEvent; -import com.amazonaws.services.lambda.runtime.events.CodeCommitEvent; -import com.amazonaws.services.lambda.runtime.events.CognitoEvent; -import com.amazonaws.services.lambda.runtime.events.ConfigEvent; -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; -import com.amazonaws.services.lambda.runtime.events.KinesisEvent; -import com.amazonaws.services.lambda.runtime.events.KinesisFirehoseEvent; -import com.amazonaws.services.lambda.runtime.events.LexEvent; -import com.amazonaws.services.lambda.runtime.events.S3Event; -import com.amazonaws.services.lambda.runtime.events.SNSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.ScheduledEvent; -import com.amazonaws.services.lambda.runtime.tests.annotations.Event; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -import java.util.List; - -import org.junit.jupiter.params.ParameterizedTest; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class InvokeTest { - - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - void testHandlerIntegerJava17() { - logger.info("Invoke TEST - HandlerIntegerJava17"); - InputRecord input = new InputRecord(2, 4, "Hello World!"); - HandlerIntegerJava17 handler = new HandlerIntegerJava17(); - assertEquals(6, handler.handleRequest(input, context)); - } -} diff --git a/sample-apps/java17-examples/test/java/example/TestContext.java b/sample-apps/java17-examples/test/java/example/TestContext.java deleted file mode 100644 index 69e0af00..00000000 --- a/sample-apps/java17-examples/test/java/example/TestContext.java +++ /dev/null @@ -1,45 +0,0 @@ -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.CognitoIdentity; -import com.amazonaws.services.lambda.runtime.ClientContext; -import com.amazonaws.services.lambda.runtime.LambdaLogger; - -public class TestContext implements Context{ - - public TestContext() {} - public String getAwsRequestId(){ - return new String("495b12a8-xmpl-4eca-8168-160484189f99"); - } - public String getLogGroupName(){ - return new String("/aws/lambda/my-function"); - } - public String getLogStreamName(){ - return new String("2020/02/26/[$LATEST]704f8dxmpla04097b9134246b8438f1a"); - } - public String getFunctionName(){ - return new String("my-function"); - } - public String getFunctionVersion(){ - return new String("$LATEST"); - } - public String getInvokedFunctionArn(){ - return new String("arn:aws:lambda:us-east-2:123456789012:function:my-function"); - } - public CognitoIdentity getIdentity(){ - return null; - } - public ClientContext getClientContext(){ - return null; - } - public int getRemainingTimeInMillis(){ - return 300000; - } - public int getMemoryLimitInMB(){ - return 512; - } - public LambdaLogger getLogger(){ - return new TestLogger(); - } - -} \ No newline at end of file diff --git a/sample-apps/java17-examples/test/java/example/TestLogger.java b/sample-apps/java17-examples/test/java/example/TestLogger.java deleted file mode 100644 index 1d3c8efc..00000000 --- a/sample-apps/java17-examples/test/java/example/TestLogger.java +++ /dev/null @@ -1,14 +0,0 @@ -package example; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.amazonaws.services.lambda.runtime.LambdaLogger; - -public class TestLogger implements LambdaLogger { - private static final Logger logger = LoggerFactory.getLogger(TestLogger.class); - public void log(String message){ - logger.info(message); - } - public void log(byte[] message){ - logger.info(new String(message)); - } -} diff --git a/sample-apps/java17-examples/test/resources/log4j2.xml b/sample-apps/java17-examples/test/resources/log4j2.xml deleted file mode 100644 index f553f6f5..00000000 --- a/sample-apps/java17-examples/test/resources/log4j2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From dc80e0d42396099604a950b0537917a4f5a15258 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 6 Jul 2023 11:43:11 -0700 Subject: [PATCH 202/243] Fix java17-examples README --- sample-apps/java17-examples/README.md | 39 ++------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/sample-apps/java17-examples/README.md b/sample-apps/java17-examples/README.md index 7013c37d..939aed76 100644 --- a/sample-apps/java17-examples/README.md +++ b/sample-apps/java17-examples/README.md @@ -13,7 +13,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements -- [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) +- [Java 17 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. @@ -65,45 +65,10 @@ To invoke the function, run `3-invoke.sh`. "StatusCode": 200, "ExecutedVersion": "$LATEST" } - "200 OK" + 21 Let the script invoke the function a few times and then press `CRTL+C` to exit. -The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. - -![Service Map](/sample-apps/java-basic/images/java-basic-servicemap.png) - -Choose a node in the main function graph. Then choose **View traces** to see a list of traces. Choose any trace to view a timeline that breaks down the work done by the function. - -![Trace](/sample-apps/java-basic/images/java-basic-trace.png) - -# Configure Handler Class - -By default, the function uses a handler class named `Handler` that takes a map as input and returns a string. The project also includes handlers that use other input and output types. These are defined in the following files under src/main/java/example: - -- `Handler.java` – Takes a `Map` as input. -- `HandlerInteger.java` – Takes an `Integer` as input. -- `HandlerList.java` – Takes a `List` as input. -- `HandlerDivide.java` – Takes a `List` with two integers as input. -- `HandlerStream.java` – Takes an `InputStream` and `OutputStream` as input. -- `HandlerString.java` – Takes a `String` as input. -- `HandlerWeatherData.java` – Takes a custom type as input. - -To use a different handler, change the value of the Handler setting in the application template (`template.yml` or `template-mvn.yaml`). For example, to use the list handler: - - Properties: - CodeUri: build/distributions/java-basic.zip - Handler: example.HandlerList - -Deploy the change, and then use the invoke script to test the new configuration. For handlers, that don't take a JSON object as input, pass the type (`string`, `int`, `list`, or `divide`) as an argument to the invoke script. - - ./3-invoke.sh list - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - 9979 - # Cleanup To delete the application, run `4-cleanup.sh`. From d5a1009b03e1799284210a7b56df0be962d74e8a Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 10 Aug 2023 14:21:27 -0700 Subject: [PATCH 203/243] Update Log4j2 configuration to include correct package --- sample-apps/java-events-v1sdk/src/main/resources/log4j2.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java-events-v1sdk/src/main/resources/log4j2.xml b/sample-apps/java-events-v1sdk/src/main/resources/log4j2.xml index b9a6c317..6c830a00 100644 --- a/sample-apps/java-events-v1sdk/src/main/resources/log4j2.xml +++ b/sample-apps/java-events-v1sdk/src/main/resources/log4j2.xml @@ -1,4 +1,4 @@ - + From 3cbdcb494c8863e452ee40c2a616baf7c7bddd6d Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 15 Aug 2023 17:55:04 -0400 Subject: [PATCH 204/243] Update README.md, fixe typo on the folder name --- sample-apps/java17-examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample-apps/java17-examples/README.md b/sample-apps/java17-examples/README.md index 939aed76..75e511a8 100644 --- a/sample-apps/java17-examples/README.md +++ b/sample-apps/java17-examples/README.md @@ -30,7 +30,7 @@ This setting enables the AWS CLI v2 to load JSON events from a file, matching th Download or clone this repository. $ git clone https://github.com/awsdocs/aws-lambda-developer-guide.git - $ cd aws-lambda-developer-guide/sample-apps/java-basic + $ cd aws-lambda-developer-guide/sample-apps/java17-examples To create a new bucket for deployment artifacts, run `1-create-bucket.sh`. From c726a2b10ee62a18300590110cf1a13cc0c8ed7e Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 21 Aug 2023 15:26:42 -0700 Subject: [PATCH 205/243] Update .NET blank-csharp example to demonstrate using dotnet lambda CLI for layers --- .DS_Store | Bin 0 -> 6148 bytes sample-apps/.vscode/settings.json | 4 ++ .../blank-csharp/1-create-bucket-and-role.sh | 12 +++++ sample-apps/blank-csharp/1-create-bucket.sh | 5 -- sample-apps/blank-csharp/2-build-layer.sh | 6 +++ sample-apps/blank-csharp/2-deploy.sh | 8 --- sample-apps/blank-csharp/3-deploy.sh | 7 +++ sample-apps/blank-csharp/3-invoke.sh | 10 ---- sample-apps/blank-csharp/4-cleanup.sh | 38 ------------- sample-apps/blank-csharp/4-invoke.sh | 9 ++++ sample-apps/blank-csharp/5-cleanup.sh | 50 ++++++++++++++++++ sample-apps/blank-csharp/assume-policy.json | 16 ++++++ .../aws-lambda-tools-defaults.json | 5 +- sample-apps/blank-csharp/template.yml | 19 ------- .../example/HandlerIntegerJava17Test.java | 23 ++++++++ .../src/test/java/example/TestContext.java | 45 ++++++++++++++++ .../src/test/java/example/TestLogger.java | 15 ++++++ sample-apps/s3-java/event.json-e | 39 ++++++++++++++ 18 files changed, 229 insertions(+), 82 deletions(-) create mode 100644 .DS_Store create mode 100644 sample-apps/.vscode/settings.json create mode 100755 sample-apps/blank-csharp/1-create-bucket-and-role.sh delete mode 100755 sample-apps/blank-csharp/1-create-bucket.sh create mode 100755 sample-apps/blank-csharp/2-build-layer.sh delete mode 100755 sample-apps/blank-csharp/2-deploy.sh create mode 100755 sample-apps/blank-csharp/3-deploy.sh delete mode 100755 sample-apps/blank-csharp/3-invoke.sh delete mode 100755 sample-apps/blank-csharp/4-cleanup.sh create mode 100755 sample-apps/blank-csharp/4-invoke.sh create mode 100755 sample-apps/blank-csharp/5-cleanup.sh create mode 100644 sample-apps/blank-csharp/assume-policy.json delete mode 100644 sample-apps/blank-csharp/template.yml create mode 100644 sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java create mode 100644 sample-apps/java17-examples/src/test/java/example/TestContext.java create mode 100644 sample-apps/java17-examples/src/test/java/example/TestLogger.java create mode 100644 sample-apps/s3-java/event.json-e diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f987c2eea530c8d25c46ca2323e1469c4fea23de GIT binary patch literal 6148 zcmeHKJ8Hu~5S?*U7}U5-xfgJe8!W~?fiGY~f*VH(5pk``=gQIY=0k`O#%j`pH)7`P zj^?eNDr(aq=clgLU$mT*J4T9}&MH=o!dGYW*`jI+GRT8{FLYn~aml^&c|aDMaq z%l@M~zjdcLeco}bq5@Qa3Qz$mKn3n7V7(W%Yy%mo02QDDKML6Qp}-Am;t=Sc4g?IfeoY(#osPWIf&3XTU1(I`uNC+P5pflj literal 0 HcmV?d00001 diff --git a/sample-apps/.vscode/settings.json b/sample-apps/.vscode/settings.json new file mode 100644 index 00000000..a6b86d56 --- /dev/null +++ b/sample-apps/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "java.configuration.updateBuildConfiguration": "automatic", + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable" +} \ No newline at end of file diff --git a/sample-apps/blank-csharp/1-create-bucket-and-role.sh b/sample-apps/blank-csharp/1-create-bucket-and-role.sh new file mode 100755 index 00000000..c7277596 --- /dev/null +++ b/sample-apps/blank-csharp/1-create-bucket-and-role.sh @@ -0,0 +1,12 @@ +#!/bin/bash +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +LAYER_BUCKET_NAME=$BUCKET_NAME-dotnet-layer +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME +aws s3 mb s3://$LAYER_BUCKET_NAME + +aws iam create-role --role-name blank-csharp-role --assume-role-policy-document file://assume-policy.json +aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess +aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess diff --git a/sample-apps/blank-csharp/1-create-bucket.sh b/sample-apps/blank-csharp/1-create-bucket.sh deleted file mode 100755 index 64a5f749..00000000 --- a/sample-apps/blank-csharp/1-create-bucket.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -BUCKET_NAME=lambda-artifacts-$BUCKET_ID -echo $BUCKET_NAME > bucket-name.txt -aws s3 mb s3://$BUCKET_NAME diff --git a/sample-apps/blank-csharp/2-build-layer.sh b/sample-apps/blank-csharp/2-build-layer.sh new file mode 100755 index 00000000..67d491d8 --- /dev/null +++ b/sample-apps/blank-csharp/2-build-layer.sh @@ -0,0 +1,6 @@ +#!/bin/bash +LAYER_BUCKET_NAME=$(cat bucket-name.txt)-dotnet-layer +cd src/blank-csharp +LAYER_ARN=$(dotnet lambda publish-layer blank-csharp-layer --layer-type runtime-package-store --s3-bucket "$LAYER_BUCKET_NAME" | tail -1 | cut -c 23-) +cd ../.. +echo $LAYER_ARN > layer-arn.txt diff --git a/sample-apps/blank-csharp/2-deploy.sh b/sample-apps/blank-csharp/2-deploy.sh deleted file mode 100755 index 70ef7625..00000000 --- a/sample-apps/blank-csharp/2-deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -eo pipefail -ARTIFACT_BUCKET=$(cat bucket-name.txt) -cd src/blank-csharp -dotnet lambda package -cd ../../ -aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml -aws cloudformation deploy --template-file out.yml --stack-name blank-csharp --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/blank-csharp/3-deploy.sh b/sample-apps/blank-csharp/3-deploy.sh new file mode 100755 index 00000000..1aa3bc45 --- /dev/null +++ b/sample-apps/blank-csharp/3-deploy.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -eo pipefail +ARTIFACT_BUCKET=$(cat bucket-name.txt) +LAYER_ARN=$(cat layer-arn.txt) +cd src/blank-csharp +dotnet lambda deploy-function blank-csharp --function-layers $LAYER_ARN +cd ../../ diff --git a/sample-apps/blank-csharp/3-invoke.sh b/sample-apps/blank-csharp/3-invoke.sh deleted file mode 100755 index 85ab68d9..00000000 --- a/sample-apps/blank-csharp/3-invoke.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -eo pipefail -FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-csharp --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) -if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi; -while true; do - aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD_PROTOCOL://event.json out.json - cat out.json - echo "" - sleep 2 -done diff --git a/sample-apps/blank-csharp/4-cleanup.sh b/sample-apps/blank-csharp/4-cleanup.sh deleted file mode 100755 index 507dc4f5..00000000 --- a/sample-apps/blank-csharp/4-cleanup.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -set -eo pipefail -STACK=blank-csharp -if [[ $# -eq 1 ]] ; then - STACK=$1 - echo "Deleting stack $STACK" -fi -FUNCTION=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) -aws cloudformation delete-stack --stack-name $STACK -echo "Deleted $STACK stack." - -if [ -f bucket-name.txt ]; then - ARTIFACT_BUCKET=$(cat bucket-name.txt) - if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then - echo "Bucket was not created by this application. Skipping." - else - while true; do - read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response - case $response in - [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; rm bucket-name.txt; break;; - [Nn]* ) break;; - * ) echo "Response must start with y or n.";; - esac - done - fi -fi - -while true; do - read -p "Delete function log group (/aws/lambda/$FUNCTION)? (y/n)" response - case $response in - [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION; break;; - [Nn]* ) break;; - * ) echo "Response must start with y or n.";; - esac -done - -rm -f out.yml out.json -rm -rf src/blank-csharp/bin src/blank-csharp/obj \ No newline at end of file diff --git a/sample-apps/blank-csharp/4-invoke.sh b/sample-apps/blank-csharp/4-invoke.sh new file mode 100755 index 00000000..877992ac --- /dev/null +++ b/sample-apps/blank-csharp/4-invoke.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -eo pipefail +if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi; +while true; do + aws lambda invoke --function-name blank-csharp --payload $PAYLOAD_PROTOCOL://event.json out.json + cat out.json + echo "" + sleep 2 +done diff --git a/sample-apps/blank-csharp/5-cleanup.sh b/sample-apps/blank-csharp/5-cleanup.sh new file mode 100755 index 00000000..f76e1068 --- /dev/null +++ b/sample-apps/blank-csharp/5-cleanup.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -eo pipefail +echo "Deleting function blank-csharp" +aws iam detach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole +aws iam detach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess +aws iam detach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess +aws iam delete-role --role-name blank-csharp-role +aws lambda delete-function --function-name blank-csharp + +if [ -f bucket-name.txt ]; then + ARTIFACT_BUCKET=$(cat bucket-name.txt) + if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then + echo "Bucket was not created by this application. Skipping." + else + while true; do + read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response + case $response in + [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac + done + fi + LAYER_BUCKET=$(cat bucket-name.txt)-dotnet-layer + if [[ ! $LAYER_BUCKET =~ lambda-artifacts-[a-z0-9]{16}-dotnet-layer ]] ; then + echo "Layer bucket was not created by this application. Skipping." + else + while true; do + read -p "Delete deployment artifacts and bucket ($LAYER_BUCKET)? (y/n)" response + case $response in + [Yy]* ) aws s3 rb --force s3://$LAYER_BUCKET; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac + done + fi +fi +rm bucket-name.txt + +while true; do + read -p "Delete function log group (/aws/lambda/blank-csharp)? (y/n)" response + case $response in + [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/blank-csharp; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac +done + +rm -f out.yml out.json layer-arn.txt +rm -rf src/blank-csharp/bin src/blank-csharp/obj \ No newline at end of file diff --git a/sample-apps/blank-csharp/assume-policy.json b/sample-apps/blank-csharp/assume-policy.json new file mode 100644 index 00000000..70e75eca --- /dev/null +++ b/sample-apps/blank-csharp/assume-policy.json @@ -0,0 +1,16 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "sts:AssumeRole" + ], + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] +} \ No newline at end of file diff --git a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json index c815dcf9..9a237927 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json +++ b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json @@ -9,11 +9,12 @@ ], "profile":"default", - "region" : "us-east-2", + "region" : "us-east-1", "configuration" : "Release", "framework" : "net6.0", "function-runtime":"dotnet6", "function-memory-size" : 512, "function-timeout" : 30, - "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler" + "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler", + "function-role" : "blank-csharp-role" } diff --git a/sample-apps/blank-csharp/template.yml b/sample-apps/blank-csharp/template.yml deleted file mode 100644 index 17836497..00000000 --- a/sample-apps/blank-csharp/template.yml +++ /dev/null @@ -1,19 +0,0 @@ -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. -Resources: - function: - Type: AWS::Serverless::Function - Properties: - Handler: blank-csharp::blankCsharp.Function::FunctionHandler - Runtime: dotnetcore3.1 - CodeUri: src/blank-csharp/bin/Release/netcoreapp3.1/blank-csharp.zip - Description: Call the AWS Lambda API - MemorySize: 256 - Timeout: 9 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - Tracing: Active diff --git a/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java b/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java new file mode 100644 index 00000000..198422dc --- /dev/null +++ b/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java @@ -0,0 +1,23 @@ +package example; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; + +import com.amazonaws.services.lambda.runtime.Context; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class InvokeTest { + + private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); + + @Test + public void testHandlerIntegerJava17() { + logger.info("Invoke TEST - HandlerIntegerJava17"); + IntegerRecord input = new IntegerRecord(2, 4, "Hello World!"); + Context context = new TestContext(); + HandlerIntegerJava17 handler = new HandlerIntegerJava17(); + assertEquals(6, handler.handleRequest(input, context)); + } +} diff --git a/sample-apps/java17-examples/src/test/java/example/TestContext.java b/sample-apps/java17-examples/src/test/java/example/TestContext.java new file mode 100644 index 00000000..69e0af00 --- /dev/null +++ b/sample-apps/java17-examples/src/test/java/example/TestContext.java @@ -0,0 +1,45 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.CognitoIdentity; +import com.amazonaws.services.lambda.runtime.ClientContext; +import com.amazonaws.services.lambda.runtime.LambdaLogger; + +public class TestContext implements Context{ + + public TestContext() {} + public String getAwsRequestId(){ + return new String("495b12a8-xmpl-4eca-8168-160484189f99"); + } + public String getLogGroupName(){ + return new String("/aws/lambda/my-function"); + } + public String getLogStreamName(){ + return new String("2020/02/26/[$LATEST]704f8dxmpla04097b9134246b8438f1a"); + } + public String getFunctionName(){ + return new String("my-function"); + } + public String getFunctionVersion(){ + return new String("$LATEST"); + } + public String getInvokedFunctionArn(){ + return new String("arn:aws:lambda:us-east-2:123456789012:function:my-function"); + } + public CognitoIdentity getIdentity(){ + return null; + } + public ClientContext getClientContext(){ + return null; + } + public int getRemainingTimeInMillis(){ + return 300000; + } + public int getMemoryLimitInMB(){ + return 512; + } + public LambdaLogger getLogger(){ + return new TestLogger(); + } + +} \ No newline at end of file diff --git a/sample-apps/java17-examples/src/test/java/example/TestLogger.java b/sample-apps/java17-examples/src/test/java/example/TestLogger.java new file mode 100644 index 00000000..a81a274e --- /dev/null +++ b/sample-apps/java17-examples/src/test/java/example/TestLogger.java @@ -0,0 +1,15 @@ +package example; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.amazonaws.services.lambda.runtime.LambdaLogger; + +public class TestLogger implements LambdaLogger { + private static final Logger logger = LoggerFactory.getLogger(TestLogger.class); + public TestLogger(){} + public void log(String message){ + logger.info(message); + } + public void log(byte[] message){ + logger.info(new String(message)); + } +} diff --git a/sample-apps/s3-java/event.json-e b/sample-apps/s3-java/event.json-e new file mode 100644 index 00000000..375e90ab --- /dev/null +++ b/sample-apps/s3-java/event.json-e @@ -0,0 +1,39 @@ +{ + "Records": [ + { + "awsRegion": "us-east-2", + "eventName": "ObjectCreated:Put", + "eventSource": "aws:s3", + "eventTime": "2020-03-08T00:30:12.456Z", + "eventVersion": "2.1", + "requestParameters": { + "sourceIPAddress": "174.255.255.156" + }, + "responseElements": { + "xAmzId2": "nBbLJPAHhdvxmplPvtCgTrWCqf/KtonyV93l9rcoMLeIWJxpS9x9P8u01+Tj0OdbAoGs+VGvEvWl/Sg1NW5uEsVO25Laq7L", + "xAmzRequestId": "AF2D7AB6002E898D" + }, + "s3": { + "configurationId": "682bbb7a-xmpl-48ca-94b1-7f77c4d6dbf0", + "bucket": { + "name": "BUCKET_NAME", + "ownerIdentity": { + "principalId": "A3XMPLFAF2AI3E" + }, + "arn": "arn:aws:s3:::BUCKET_NAME" + }, + "object": { + "key": "inbound/sample-s3-java.png", + "size": 21476, + "eTag": "d132690b6c65b6d1629721dcfb49b883", + "versionId": "", + "sequencer": "005E64A65DF093B26D" + }, + "s3SchemaVersion": "1.0" + }, + "userIdentity": { + "principalId": "AWS:AIDAINPONIXMPLT3IKHL2" + } + } + ] +} \ No newline at end of file From e99caccbd7efd448e9ea61774ee1d16c6ac84035 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 22 Aug 2023 12:45:24 -0700 Subject: [PATCH 206/243] Add back original blank-csharp example, differentiate it from blank-csharp-with-layer, update README for new example with layer --- .DS_Store | Bin 6148 -> 6148 bytes .../1-create-bucket-and-role.sh | 0 .../2-build-layer.sh | 0 .../3-deploy.sh | 0 .../4-invoke.sh | 0 .../5-cleanup.sh | 0 sample-apps/blank-csharp-with-layer/README.md | 101 ++++++++++++++++++ .../assume-policy.json | 0 .../blank-csharp-with-layer/event.json | 20 ++++ .../images/blank-csharp-servicemap.png | Bin 0 -> 20561 bytes .../images/blank-csharp-trace.png | Bin 0 -> 69147 bytes .../images/sample-blank-csharp.png | Bin 0 -> 49708 bytes .../src/blank-csharp/Function.cs | 72 +++++++++++++ .../aws-lambda-tools-defaults.json | 20 ++++ .../src/blank-csharp/blank-csharp.csproj | 16 +++ .../test/blank-csharp.Tests/FunctionTest.cs | 57 ++++++++++ .../blank-csharp.Tests.csproj | 15 +++ sample-apps/blank-csharp/1-create-bucket.sh | 5 + sample-apps/blank-csharp/2-deploy.sh | 8 ++ sample-apps/blank-csharp/3-invoke.sh | 10 ++ sample-apps/blank-csharp/4-cleanup.sh | 38 +++++++ .../aws-lambda-tools-defaults.json | 5 +- sample-apps/blank-csharp/template.yml | 19 ++++ 23 files changed, 383 insertions(+), 3 deletions(-) rename sample-apps/{blank-csharp => blank-csharp-with-layer}/1-create-bucket-and-role.sh (100%) rename sample-apps/{blank-csharp => blank-csharp-with-layer}/2-build-layer.sh (100%) rename sample-apps/{blank-csharp => blank-csharp-with-layer}/3-deploy.sh (100%) rename sample-apps/{blank-csharp => blank-csharp-with-layer}/4-invoke.sh (100%) rename sample-apps/{blank-csharp => blank-csharp-with-layer}/5-cleanup.sh (100%) create mode 100644 sample-apps/blank-csharp-with-layer/README.md rename sample-apps/{blank-csharp => blank-csharp-with-layer}/assume-policy.json (100%) create mode 100644 sample-apps/blank-csharp-with-layer/event.json create mode 100644 sample-apps/blank-csharp-with-layer/images/blank-csharp-servicemap.png create mode 100644 sample-apps/blank-csharp-with-layer/images/blank-csharp-trace.png create mode 100644 sample-apps/blank-csharp-with-layer/images/sample-blank-csharp.png create mode 100644 sample-apps/blank-csharp-with-layer/src/blank-csharp/Function.cs create mode 100644 sample-apps/blank-csharp-with-layer/src/blank-csharp/aws-lambda-tools-defaults.json create mode 100644 sample-apps/blank-csharp-with-layer/src/blank-csharp/blank-csharp.csproj create mode 100644 sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/FunctionTest.cs create mode 100644 sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/blank-csharp.Tests.csproj create mode 100755 sample-apps/blank-csharp/1-create-bucket.sh create mode 100755 sample-apps/blank-csharp/2-deploy.sh create mode 100755 sample-apps/blank-csharp/3-invoke.sh create mode 100755 sample-apps/blank-csharp/4-cleanup.sh create mode 100644 sample-apps/blank-csharp/template.yml diff --git a/.DS_Store b/.DS_Store index f987c2eea530c8d25c46ca2323e1469c4fea23de..dbb5ca59b71eb7c921814c252ce63b8d2eb92da1 100644 GIT binary patch delta 278 zcmZoMXfc=|#>B)qu~2NHo+2aD!~pA!7aABR8;Gz>>=&<3DlaZb%E?b+U|`shRFIQd zTw-8wjgg6&g_Vt+gPnt$BQ`iAzdX1kv81%vDX}OT#0$yK&q;!@6O+O+Q_JH8M4a>U zN)j{kQj5SEGE-84N@Bt@^HTE5o$^cbQi{QPgCPZ7nBfYER%etAJgP#NF&y5Ga cGf(Ch(G>y7f^;-MXt3tZAtD=?CpNGE07yMZMgRZ+ delta 72 zcmZoMXfc=|#>CJzu~2NHo+2aT!~knX#>qTPQkz+rnOQe0Fvl@%X6NAN04mum$o!po aGQWr}CnEy`!vP>>m~6u%y*Wl?2{Qm^ix2St diff --git a/sample-apps/blank-csharp/1-create-bucket-and-role.sh b/sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh similarity index 100% rename from sample-apps/blank-csharp/1-create-bucket-and-role.sh rename to sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh diff --git a/sample-apps/blank-csharp/2-build-layer.sh b/sample-apps/blank-csharp-with-layer/2-build-layer.sh similarity index 100% rename from sample-apps/blank-csharp/2-build-layer.sh rename to sample-apps/blank-csharp-with-layer/2-build-layer.sh diff --git a/sample-apps/blank-csharp/3-deploy.sh b/sample-apps/blank-csharp-with-layer/3-deploy.sh similarity index 100% rename from sample-apps/blank-csharp/3-deploy.sh rename to sample-apps/blank-csharp-with-layer/3-deploy.sh diff --git a/sample-apps/blank-csharp/4-invoke.sh b/sample-apps/blank-csharp-with-layer/4-invoke.sh similarity index 100% rename from sample-apps/blank-csharp/4-invoke.sh rename to sample-apps/blank-csharp-with-layer/4-invoke.sh diff --git a/sample-apps/blank-csharp/5-cleanup.sh b/sample-apps/blank-csharp-with-layer/5-cleanup.sh similarity index 100% rename from sample-apps/blank-csharp/5-cleanup.sh rename to sample-apps/blank-csharp-with-layer/5-cleanup.sh diff --git a/sample-apps/blank-csharp-with-layer/README.md b/sample-apps/blank-csharp-with-layer/README.md new file mode 100644 index 00000000..4e8c5bf0 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/README.md @@ -0,0 +1,101 @@ +# Blank function with layer (C#) + +![Architecture](/sample-apps/blank-csharp/images/sample-blank-csharp.png) + +The project source includes function code and supporting resources: + +- `src/blank-csharp` - A C# .NET Core function. +- `1-create-bucket.sh`, `2-deploy.sh`, etc. - Shell scripts that use the AWS CLI to deploy and manage the application. + +Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [Managing Spot Instance Requests](https://docs.aws.amazon.com/lambda/latest/dg/services-ec2-tutorial.html) in the developer guide. + +# Requirements +- [.NET Core SDK 6.0](https://dotnet.microsoft.com/download/dotnet-core/6.0) +- [AWS extensions for .NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli). Specifically, ensure that you have [Amazon.Lambda.Tools](https://github.com/aws/aws-extensions-for-dotnet-cli#aws-lambda-amazonlambdatools) installed. +- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. +- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. + +If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): + +``` +cli_binary_format=raw-in-base64-out +``` + +This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. + +# Setup +Download or clone this repository. + + $ git clone https://github.com/awsdocs/aws-lambda-developer-guide.git + $ cd aws-lambda-developer-guide/sample-apps/blank-csharp + +To create a new bucket for deployment artifacts, run `1-create-bucket-and-role.sh`. + + blank-csharp$ ./1-create-bucket.sh + make_bucket: lambda-artifacts-d7aec9f2022ef2b4 + make_bucket: lambda-artifacts-d7aec9f2022ef2b4-dotnet-layer + { + "Role": { + "Path": "/", + "RoleName": "blank-csharp-role", + "RoleId": "AROA6HOIFXAKKWARP5RSC", + "Arn": "arn:aws:iam::978061735956:role/blank-csharp-role", + "CreateDate": "2023-08-22T18:12:29+00:00", + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "sts:AssumeRole" + ], + "Principal": { + "Service": [ + "lambda.amazonaws.com" + ] + } + } + ] + } + } + } + +To build a Lambda layer that contains the function's runtime dependencies, run `2-build-layer.sh`. This also uploads the layer to an S3 bucket created by the first script. + + blank-csharp$ ./2-build-layer.sh + +# Deploy +To deploy the application, run `3-deploy.sh`. + + blank-csharp$ ./3-deploy.sh + Amazon Lambda Tools for .NET Core applications (5.8.0) + ... + Created publish archive ... + Creating new Lambda function blank-csharp + New Lambda function created + +This script uses the .NET Amazon Lambda Tools to deploy the Lambda function. It uses the default settings from the `src/aws-lambda-tools-defaults.json` file. + +To invoke the function, run `4-invoke.sh`. + + blank-csharp$ ./4-invoke.sh + { + "StatusCode": 200, + "ExecutedVersion": "$LATEST" + } + {"FunctionCount":13,"TotalCodeSize":598094248} + +Let the script invoke the function a few times and then press `CRTL+C` to exit. + +The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. The following service map shows the function managing spot instances in Amazon EC2. + +![Service Map](/sample-apps/blank-csharp-with-layer/images/blank-csharp-servicemap.png) + +Choose a node in the main function graph. Then choose **View traces** to see a list of traces. Choose any trace to view a timeline that breaks down the work done by the function. + +![Trace](/sample-apps/blank-csharp-with-layer/images/blank-csharp-trace.png) + +# Cleanup +To delete the application, run the cleanup script. + + blank-csharp$ ./5-cleanup.sh diff --git a/sample-apps/blank-csharp/assume-policy.json b/sample-apps/blank-csharp-with-layer/assume-policy.json similarity index 100% rename from sample-apps/blank-csharp/assume-policy.json rename to sample-apps/blank-csharp-with-layer/assume-policy.json diff --git a/sample-apps/blank-csharp-with-layer/event.json b/sample-apps/blank-csharp-with-layer/event.json new file mode 100644 index 00000000..568467d1 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/event.json @@ -0,0 +1,20 @@ +{ + "Records": [ + { + "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", + "receiptHandle": "MessageReceiptHandle", + "body": "Hello from SQS!", + "attributes": { + "ApproximateReceiveCount": "1", + "SentTimestamp": "1523232000000", + "SenderId": "123456789012", + "ApproximateFirstReceiveTimestamp": "1523232000001" + }, + "messageAttributes": {}, + "md5OfBody": "7b270e59b47ff90a553787216d55d91d", + "eventSource": "aws:sqs", + "eventSourceARN": "arn:aws:sqs:us-west-2:123456789012:MyQueue", + "awsRegion": "us-west-2" + } + ] +} diff --git a/sample-apps/blank-csharp-with-layer/images/blank-csharp-servicemap.png b/sample-apps/blank-csharp-with-layer/images/blank-csharp-servicemap.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc3364a430b7110d6acb08047643d71ff130d9f GIT binary patch literal 20561 zcmbTeRahO-wy3#+yGw8j7Tkje2@*WGI|L`V6M_eK2=4Cg?(XjH&cf+p?{n^b?63O) zn^m=H>d=1>EH5jLjDU{-0)dbvB}9LKKoEYw?-_6~!1p+8Pch&Jysd<~JqUzD`Tq4m z^2etOpb^$VQsx`%4kQ5%A;{Z!dG|j}-_#t0936hz*ntYmMkIhHBnO~L)Y#t8&dk=q z%*Gmo2~S1=v?IK?i`dw@+L@XDbO4p0j_?4jDF11-GuD5z+nwA2S~wFA|6)Ir7@`BY>FBLA_Yl`3MsjyoTNHy zDXY#^q)Uk(x}Ymzp%eT;_zT^s1JY#2pQfHooILon-7;-pLNz!7Zo{Ky!;el(`#B&KssRr_f(bYvQPUk|Mz()h?i}U8fXtAc!%twqV`w@ z@&CNgVgr;&aeXcg3Kk`IoxsnR|Kj&Q&uBx!Dy0ZLRPt;HN$FytWd5gD5JK}EK6zt$ zrK048WyQtCGdI1A+h_tsg?SlSeqDbJN=E2^)l_w_P4!I}z(ai%d8y&7?&=&;Impjg zzS>aW_Q%e}QjXpDX&jhcOT<4?g2WJ?5i%`vQUMv3B9wve@+nG!7?`Wsq9=oVJ2(=) z&(s1>pAY?=X^Lp#S{JS`5a_6~0bftAuEEIqZYs_LE`3jgKl@$q0{9^_1l_A_FpOM0t1+BjU-nARVg5=(i& z3mAd5U0ZG;cleys7mdYjnsQ7}%N(eNu&+zglfXj

VvRzR#wRrf3DxZ{7uGA<=VV z0xVdE-<%}}+P)jyaYSEF)vA=mB|&dL-fyhCe-U8R`J%aOQEDj!7E*nrJ>49*7Z3<_ zA{q+P(NRlM|5!4YSfo+3u*l^SvRHj3So~C;1V}SPnnf5A$;i zp}XCYdj^+?fr)(>f7Hp3spUr{QI?likQQ=ff!?J=_8O;Y6F=+jf-%-eR^K}3A=JfX z>I2{Qc223J*VCaDasG~((c3Hp6TXSbFldVYb0pwjjI$J`Boue zQm*VZ&cw9m<^{7mi#(m?26ixr4H?maZG1Ysc7hfY6+g9gb^Mn6>^Ei**c>Y2Ldg{d zS;&&o=3d!(=~dT?w`M{5TGoBxOcd^4=o(lSqpLHL`$VfX&^YG*G*4StlI~$>V$i2m zPP&Jh7Fu2F8}I{a71{BTdm@vGBFFdR@m^`1k{@p_x7Ju=XKo4>h=1nGD8FBqIO zLCobDDD#j$85Ae&zy7`y<~O`$e07y3k7CZ6C-u;7`FMO(8aH-(`>d%o*4o+oMEhws zkMrI#@%pPUtc-!3_Zy0?_yqSv0@2(K^~Y+Wvm2Dn(X3|CoL<|VJ@ws6$rmxUmiez@ z60n>4>*A*Kz#-cHF^0^zzedXP!~<+6kZqll-rC0C$TdRONRDEz211Rr{UhFv0RFj- z@5e*d#I`y{o@OWIQHp50>4xZpK4|P0LcMdbL{+qESlOAyTIfG}L2aoWuQQ4{SSv6c zokQ`ztOZ=8_%Dz7v3QB74slgtqhphY;#Szl)>@?%jA=n$W!;I#*gYRrZBn&0_0*8e z0%srK`+f%UmWsH%2?@adFbt9i%gif-`K{;d-PQ8v=*`t(#q%pT2j7Zrt87IczvXCDj3}IJr0&ON6vHxAW?<2g z$z&nF7ZYPd;g9;v{QO>QglYGz6j*(L6X>EyIH?n(oBd6bWSBFFZ(+9kP|Y7k%||~W zkg6KN%2LM`PLAM8(UR=c=~7Wm|1I5=Tcm0!LYv}ZNd1)xs}wS2Mr;7hoQ z%%Bni9HC&jF`MiY1#bS4QZ;T9Jf9aaJPmpwI&`N7LkEPw3u`kJZyt16Nn<=J3`{S< zOX$Aa%gO%ST47+vy*fIDuzL3avcsABZK>l2e9br2>2b-kY<1pOS4b(!gAzhn!ES2! z=jC-`{rvh0+I`3snJg$zJ1<^-qeo5gEKhZm0zK2WG#s?UAl5s z5Exf7-;!Q<2}@6q=;Jad9F$)O4<-^&O<(6a zFyMIz-gugm5=Rh0e24sj#%uOS^a@V}rNz5U`JA)~MMIXwP{dBr ztfd47A_ieUeB9kgNH2C6?Ul#X--i-|U2H-BbP_#qLNwt|YJ;cF zL-f8Yv~zF*QWasB_qbN^^AotA^P-^ca4iL5JCFCk)YuWbo%>l1QtHzIQVafN*%aQh z;f9oU7ao+0{YrJog)YQEmi)T*lBr%WR1qAnCEvjaSxdZk4D!AgNbm7CNaxHThMAA> z@nSp6E#mDIlY~GXUr6&%_R+QYONb0SFA{xJN8-b9q1>Rm8dQf(zupR;rQ40 zRRuZa6Yk%vN(Ep`fPfFTJm?{#FQM67JsAJ6c>h4~LGEyi6{de`=8yNN3*ztCKbn>? zU^}Qj8RwaC-^0owNYTK_)79LE&Szun4srGk4QtjeW0@$lugB6Uhx$oqGC|U z3(nhE3TEvf<|eRw{1d;mUa-Tk;u=|~V~mvzxc*?gLGz!XUT_mr7YYH1hBKTXU$cKr z7cX$gytpn^ml)S*l2+E!jjz)7#rM6H?&_fX#GU8m(DBe|g2vm1=5d`NtN7L5FrNSU zP)?y*K&15zE~ORy6ZgPqPi1{z#DsVuJE{1!q+j}936z=y*D=I0{PB!WKDn2GL(VOb zSyEu;N_`9EYB&TL=sAn9pz-5_ZXaAfi$;?&_S;Rw8V_4Od1G61>sQHSCYZ`UY0o8JpN)=7>2yAHOw81>#~G;1bco1ru&AqikY5)vNFi3l92!QNns}T@ zzKCx1(pf#GH8ygWKOaf1xE*_c*zy<2v)enPEZa3ji^3Pt)2(bxEt~WwYKwDCC|!0| zRG8%C<@@!lW+H>wrL>?=sqqWW24_{-tqG8?OEgu}tlfr$)HeP0-1{)-g)G_vlFe)x zbT6S&4Lw}zHsa(_HHYq|W4d}%_bh6fnr1TbbL2OQwlpv7(7U}iH5GFjo&^O3M%So< z_S_F{$wwmE+C)jt)%PCVf;Hsgn()^MTN++4s&>;~?5^qAV8gkB2vK+l0V)4_n$`ge|)|z@~Ah4HbA_lw9#dv#m#Q-xV zZ|Ee7^8%TYQU=g>V5XeaGRlM(NRul0UFp&g!Q}*M|IR`x4^2@m==S_aGHOaf)18RE z_G<*S*XA3z@(7^!)JERoU%hTp8wCjQ9NJP>`}8U%yO-wu4#V zvY`kA13g?SN8HuW_t$2_@``Rdo*gtQBi-#94<{ApaU#pm@?pJQq|b)Qk~7*9fnIeS zHqh_eTV)CxbmG`2(+EEer8ittAXj< z#8W)DufliAy8@XIFPRhLgJ-W|x#=n@D$kpxy7nBDaeg6^FfoR8`=VbDOr6OTh-_F&@kh+*A%_X5XulFz-fYDSnR8}-MCp}+~>;F(tBSb~tWu?=rAOG-=bPYKHH zC|+=WT?Q<3_avU!1`>8jaaZB;1NLbt+_XZ`P?cn>ZMeN@bfdPG@y}l$w`S5`oyulr zX7Rs$X=u)zkQ1EO=b>$<$VPh2_DK9k&k6v`pB$Lc(3-}2flc)jmv;o>@| zwa2L5ZE9MD{CRm`O$5}CNa2?HD5@+dKDh2vdD)ZI_(``}=!Pj^`E98=!7>4qnXa9T z$XylCCw`QBo79W^)0En*=YlNs^4j>VGkc}UDp9M8<#VGI{Ng+kxrl0a;xm*ZU#*b< zZQ)@`kbogGUT7~${W4h#J@}EI@Nq&e0Y;3%_>=b~&-jZg?BJ*x7WSH)4t&OKt*ls zQZ_semX-u+(wpjH`^Ph5(6b{J1FU)u6XT{qwWI#j31v>sn$nZD6e6OImlqy);{%}p zx?$ueZ)yv7u_h##jjW(V3+R`7ct_x%7SwjXt=uPxdE)ciL3IZpZ85#wJJ;8DpXvlM zGfLHwztG@zf77i3za*_&$$h)tu*EK1_U=#5)verQQRSCZiD*BzJz=n-DWl)+dN~fA z>$DBaphb8g1U#8)i_qKa-9~C$#mNy_%0n(2%wGo|ulJ<;?e*SF+RsmR23jKVp0{;L z><`q~^{ev_rBxhhvdD9lQT@D}6j-Is=(5?HzNc5z)omr^A_kL8ja2Aq69M9R}{U5(X_RK+~+3pq^Y zp{AWlc+8n7qDI`!l^m^U3xll`_1w$VGx9(oG{+NPj3;(WJXE-R*<-4Wja)`7KP#ur z@f+j|>w1wOSYmcp?XC_^YQFg<+nc6%j0QpfPcU%2ZSnigCZ=>6J4$jIzayn}^}Bz4 zIFWFZ)hsO7Ok;XJnB@xu30xMylY<{U?`0yfEBehMLe8Xx1a8hv;)fiv_1RzK(4s%gNu`2 z=%2h8^`&$+TyD&2QOG)4Ch$C-cTLDqh)m5dL{Cm{nm@%<53%FE58Z|n0xQDl!y(HAwW?4!-K8-mWgMv(5WTKyzasX(*V(Pl!w|LQ=mrf|%4fciLQ7 zqEueM$?tx#tXyvQs09H``hh~1o7iAj#Kd@+q=N}LsZ=^M6h^S$U`*fS@L&{jx|fWj zOxTh=|0CEC5UQ5`H$QkrFV(XI9H0y@FtyyJTrJlK>&}FK^coM=tjD=o(A9JmgOIPjgC*6aQ*~RH*Qo?s`rAl z7J8CDF#VmZkN*|=TG&MXhen^b^U0*kS_)pw;rx7Y))HebzL2~(VWuN6~baAwQvN+T=oJ#dFuo-QBBz& zmV0>6wTS7(g+6z(_e$Yq%OV@q_GCNB`U}{UUvdu3u%i3a4ld;L_YbyJbKc>Be~PZ^ z#Gi_0oTVMZV>}E*^!@eg=#FJ+ZmRRYq52N7OqqV6@C>*-RMi|DW>RubtF6UG>@u;t zIG~L#U!BPIV@)X~ifu=HIngL+lbZ#X*htGryWINc1D4CqMwB9c3^*TJE~mYjfEO$l zrJM2QxR_FM`hlj1e)g%h8KZB58iYi0&apM1%y-dnhWs6?STjTp`0F_^SB{|0R8VPe9Uw_gz&qY~Tgh=#7Ij^aKp zx&}o=uo2A6$%z$wJ%!}-x??a#HPR&0P)oc{5G*63ec-{3 znPK9wHXz@e#ZAkpIzm?vmp$^-78Y6FFfVewC?Evw69*tcH&<;qmv64(r%!Yx zbG=r8Udn~lBDw~G2utf?qNBUK-=5Z0@IEQOoS0>{!|7XD5fN~CO3BDDBso_t;JS)F zBqij-#z6L8Pv+UMqlhdlFJ3K$$YHwPL%F&hxmPxQoeaT!G<)vp@4xOw6|5OzDY1#Y zwE)Cx@q^tpr`z2@XO!WjRttTygn@~P*uqJnn!3i-th1o`$$cmxORPd$w>tP$u+TCW zvIH4WfXs0N|HLMRit<~X)Y83#f$pSx-15)Pa;ywDjkgVC4~_G|G_ZNvktVl2>SPnu zRoCv$m-7uz#>AtYw8+B@GCV^m^U6-k%EU-O4AjoYB0W4ImL8 zzbgMq>ZFRNxq?La7E!%g(??o(lwa!qI(H)lnCusqKl5N@^uABH%z585+666ib){4+ zPB)~v#fbE0am2F;I>1n2z^~gZ=b~1|eHjd^n;0JxQdU+jCKTy?a+tE;=RZ22{V~m| z*7&UY?(i;oeqDr%xVtskYG5Jc#U8doUY@zNb27NQ(ZgV(ydFNhe#9UuIPVDI>&mN{ zMLC|98)!%!+}xgol0(wln<3@2d<^KyG60Q8%OsKT#N32RlcT0jsEq;owX%ZQ^w?>X zPV^_i`{0?Rwbc|#p0&?K`iu)jy)MzyNhI@15aDi6<;9M4#Yx}chFRn zmGuqCL$Ygf=KtN~H`;%~2wpn>?6tSIS9kmrR=$k$FuN*Zaaz&lP+nFRuGpSJK~0^0 z;oT-Bt0N#T+f#9y&;R_mYs$jHqA&cLB#rpYDl(r^jmYA3JwhQMximM1}QD zi({v6;O+^qYgZ!8kcdtOf4_R-?QR3!S-u(?4s|z&3uT2qdXmawo1XkP}+OWH3$2%K$ju4SQ0ix zNd@-jSu=z7`pk^dw(BTSg2X3=p~aP7GLE9tmwRRTXHQ|36%`%x^9h+E$!FFXF6n>4 z#i-$Fp}W>9oaN8vc;P5_^xl_d_ zyxdoSk#%vXx*ikl7Na20eQSq`{oQ@l_U7>M_81GBLmNSSwb|lXakIgUM_d~Z#K_2q zKR%gDI68^XTf!um35eq6yKgL}dqx4Mw+0!3yj~RIfQ1YdvNx7zL!wG}a_ZuCDE#`^ z{CAm>dfT*#FJ=MES??F==?Y3cb}A? zMDCB2)KtycNVp^9$Wp6oO~k?@Q}tPq)-QgrD8$rHUc@A?hD4;AdmE>3>b;obH=O%TT6{y5GwK%yV>@Pp7ZU3jft-s ziduXTLraPTar+?nqtmJ2z*PTU5yN#MCE`MpCl_E>9gdRG(1D6;8zt~&6Y10( z&Lcj%9$Se1h)vNOJRo)wn2;Yhb}p1kG>2>D!~1$ZOS~7TAqco47VLT5r3QTmY^@Jk1i9rZ1ISI>VFCJNV_I|R^+JXtVoyt%L1e;5hs5cBLOxZkibo5-wQw{-swES z>$F^LOU6fbZ#NI=`kq9F0T?7L7hQ-9Jbw_d&J{1c97p?gElnmmK1ly#uIs$i7iobb z6bumQm;FVdTo)QzDkFz8mio<0i0mmloKrO=nzj?u)}dm5oy7ZFX@FZcveGh#2-BXG zG`((H%ER^kbiQ1=N@}^Bpg#Cj1Pcp`#d++8>S0li{@?IvGkC%KBJpa$4yNHW%xX3V!ka6CnYITqkBFQ{(?_nkAJ)W zBVSczzu3t1o%*Vn{HEF>Yg~*Q*eLm4-2E%u(-nt{w!#UGjd*lA9s$qK!YIW2->gbY z(9_rqSs|am6h{M+Vaqefw^yHRS3UwB_UuEQK@mEGIOKWNWYT0pdSrsGL{BE>jq`c; z$zdnZo!#TGaxn92r9evHE-UZJf!;W<3_WRK`zNlWn|Zk*d(kn;<9FKsa24la0_wU` zNrhdK37S?KHoLHYII6Wki0s2SP-8tlWPGnj?_&EEywce;k;1^g3dx|?dL%tryoByks(!_V-z*!|5WR?;{Li%emG)+O@YiV2}wrqWgt|`Rx8=8LWOwjSX=P z`RN)sk&u4zQnwmG|U^;|+Zr_v2m+B+vSy&X(wX97{0%jJ20k_{617>EYVLsqm@5b%No26Ll8(Rg}#$kW^cH3lW zZqSwGTHWaK@R{1%tf?pVGoW)~tEvJ|!X{RU`<=g^L6U2%DF87oVBb<-ZeatOA%7Aj zIXQWH80gL40H^!i{q&BNkx*c+*>z0&W+VZVabRibV5rv`15%?5!g86O+$ zbqZZMOer3=_LWAsj*qG@^hpz|3J3d*?vg+p_oNf@72GZN@sJH^9le`9jUd4`YQY{} zI*Fawz4`IGwVBzV{V-1DQ-{#megRh^6%|#>i=fQ_c%!AL)?J=bKr=oYSY!)~oio^u z#pVRZAFnSfd|4>z8-VxMv!rp|H33mx$`-qd!T)_WP)HsP-HP0grEU zXQzPA+DyMQWSr61dxoXzy!f0s>0jc-yx?m<@w}p@wAD|h|Hg?>91cQi0#7n^n#z}< z*6$>LYR!MKSLJl=(Ea$aHDhADCGZ=N4xe&+=$A{S;&{Qa-yi81RPdZ~Ri35rT4;l% zqm$YT9POE@$;^^LP7A87{Q1&lE^B#?Mg|R>+v`X9!bOq(zG%29nWb^QD?V7nYYQY&@vwc9Jok4MH;5^ ziNQJp$;QGVGTBL?qmNB@n1JGHNc-3KT#3it9N6{2k`l>O1fmRs;Y@03cBhx5 zfb4vNozVllp;oJ-Gno)1)+1he?ke695H6^C+hB2PzA+G5kPhoMR4vPmw7o=N5~!|O zWH@NygGKu?mhKrPE+N@mSVxFxZ%>@eo7^Kc=n|He^?Xjkm$02L>wMs4jkQ8`o@wcn z55xe2(~p_yrAKMY%RZ55HY@B|a7``LzL6^ap_-VNdAZZ6t*!N_c7(;y8w;hC!7&D` zXL@z4fS7E4AZ#G7Q0P@P+rW~2NwV7ws7Y&il0AC2@T;o{Pcy|GGFRL|Kh^kBIX6WosKRf6{L7*52k3Aj%gcqr=Hqdpn1drB_22 z_D+pupimLeI@vvtJx^AV`hsBB_w4|EG;O+j>EC+G zE5^G{1+t{G@y6EHeY&p~$&XDJ-rk!@)Wj60dsgNa|IRd5aTr$;xEZtExmIE1C!8F1 zsdJ21sP3fs+C8_GYoE~RzBth11CFN7%WTZ3m$kY1P)x))kkd^Ei`@GUrVRzn+Lv)`>7SHss8zBbi4Nu zfuTcl(&e{@YIGQ}cAA@Ol}r9oWPb6!0&-`$2j_p;NO>EhPI!eY^U zrM?IZi=YElzib+nrU+wZYbwJum7LL8%3;-8b$;!WfKuZ>rsQ3EKn86yk-X0ARa};i zG>i84RWe)Rh`^#wxtt~0!y6f`8Q=cJt*BCJPu+>lfWJB29-`LuET8l_IA03{0w}S! z`ZYHF*`I;TE&vBW20dmlIBZe_;N|5gSa1^1E^PTQW_;kyZo4|m<=(9a`-*BsL3`(* z1nLl6KU>y4dgrsk^geS_i|!gdY+k;6i^WZ+^DkD$CO$y+#H-QXXSk8;M5JqIUniGn@Uo z1{TxRi(!!X)h4}Ce0Mi?@1f+}{j`IMl+xb!EMuPHeUr$s2K3(?q&$JIKyi`i?NxqESyypw zF=IkLU*IoPQ7rY(`m0a>S-6=655?Wwb^;nrX?_mw`siPiT<@}()UQcDKhxs}tpCAc_rLNwOT{zDGK+UKZ9IBcHQWww ziUCYJhrM)zSp)>v*Q1=l=YKZ8TAlyPWz>L1!br!tZ z$ULj(SJsnuY7jx$yl-ohaQ_mm;}94$^U-Q>h7w3KC<(+ALiW|!)_ukOsVF#3t+O{3 zSL`>I_SapP3z*QExhlacnmA=;zFLROzLw9>d3kw$BPqh)l(E-eE~>-r?TmpjdeOwE zbK6~)u#!&_9~~Xt+g(S@%*`>I_F;wXt0*a5fxW##*9Xu`&0~e)cit9S7JGChrW*7r zIN!0m)&mszw-l%)p=77~uH9m-1_ys&5GNwfgsOzVsgD@AYhOJ z_EuhAT|5v2JCA=KSf+0-gTAkk;XS$;%TR9uG%KWi^QUBhzUpdW-{%Gxytpj&xt-K8>zscpp}%<26-A zgr%^!sKyh)9TbIm0=(_LnnUxh zB?FLGj2ovISd}XgEHJJy4z#d1{^D_h^=`AQbVXVV389OJ_rE)(6rSwm*u{T=-1M`U z+x2yt#M#QIc|wX+=K`=(RW}f?5e$B}5-b|Kisl@(T{*!3pbj@F7jtG>%z;^%z_?I` zW=&>#Z>}-n7ne}nbnU-2345EBG3_b4)^nb(rlS^C_)bTY-T&rwJpPR|tBclGXo`pf zz<_5Gzb!eb<_jrf@hRKI@zGHbk6m=jGenxZU1gttLC9aJ1zblgGXOrLUI!oT_QXix zTuh(ArJ@pu=ZM8Htjiddp|cNZqgyR(2JY^j2-qf?CNOk;TawytoXp>DaNH*bT;4_* zr-h}ZzX|Ey(I+W<;i-RT&0;4$p4v83$I-mwiz9SFa@*cpU(MMSA0s+v#jb~sjsTPp zzprogBO*VV&gU918j)`oNp9R}-d!6X-H;H#GZ_|UW<=(7k zR_HY*qzZ5rPH;jhQQ@X3`v7VH;8HGTGlokvb&ApIcDhNJXnWY7qGQ5-haZ^&xtLgf zmyYz;JE4$$9$s!%CL_0EJJ@7HAp3gxm~3+meAT;@0X{h)(ad@56rr#nG(gRM0tU>u z(mocfxxXCStfcj0sMQ_Zn4a7}T<(D_@+lK0Ra zX@8=+utP*j|D8Z^__AG6W%4pvRG@e?`gzOd=t2JTl`)(0#JLL!ay>ZL^V?m!ISHMPmm1ygY+6?24Lq|Sn}D*|#J za{vr@p9Ic(#z&m4SgZE}$2*dU$jH`PZbem;)=PKyo9LU)fDXbz^7k zz9eVCY{I*;DM?xM&iHcf%>mZ`mab|2&+4Dq`vBUtdASTyV>Utn@F#pVav?)Mub~_J z&B#K)f#)_{ZHaT061Ps<4Wx?#c*SfH~FAh6_skA1uXJ{F8rv;bO3KgO* zfHZbll&hQW0@MyS)J;r{-a zvuel=;18`ERpW=-$E;zD(Es%ZNOP2YUBv`nOE(jAV z25xb6;Rmg?@`bSqPp6_eE!ek^r>>igzAJ^s#-np(V28YA+co;kHXT<55QT;!F<&LgatD@2<%Bl@|1C||>2 z2E%(Nw{%Tx!2$1Bm`DQ z0a#EdtK8;;{i4d@3x|`m;ji!-{c2n`I(Q7j$KPoidjE-#$Sck_wN{(zL4^)fiu+DSKU zQ+#dp>eEDGy%K9|CO@fgij??70`mX&T73O`F$Z%%iS~yY?*e0GTCoj`(4_E zJe}&fr&}ERzr3_aJ^_F*a~}MCeAt&PXPz5f2HdYUO9I<<3}7 z-Hym}A|dqentTe9F}08||4ncRc7gc9X81HMq44j58#Mu`g%2H{z>_WPc4V@1kJ<+{ zttWC}d&P)Vr!kiFZWUA;W|Ip}EKPsCnr>{jPBT=0)gM~{15Si-cHL^MctM`!mddlD@zBeQ+DNIbo#V*B;ad0=5pYi zw0I#pfS38X$aZySM)>6Z7ze66-i;u}V+0U@V!F)QR07z04Yq#ZvK&x0^Z}^FdHCeT z3rr8_!VymzKvuIgYI)mR5`$_!0*WnGgqkePr)7_64)5g1LFFao7`r6pBTyI=0-(*7 z(c+dP(j#zqSQ0^|q=1KtM6b@zgth0_h_hq!*xSId2|h0VLkLqg$5!GW2Nrndfkd8hP;OjEg`LG(Y={tg<+J8oFf3}_-*TEb0WtMkas5DXPha!=*8uR9QRuO4DRsOF*7|=-URE{?WDx+K;KO20l&enX z$Sp!&Usj+>Iqg9Tdwx1_gv2EHFQeR8=0=m#_LfpRUHIQ{fcT2mpw#x%3)XIvt*2$K zpPQ@!PzZq$ELuE|1*g#s)Oaj-Z^u?CK&f{hFx(mefIdK@THLw;Sw)E$aQ z60{Aa&m%w`gZwxt)g30q7i}Vu1${@aKb1?HjGJhm z0NJqxO547-Wf)7vs_LpGHxj-)fMgu-^zR1qv$efmjDKDcX z(c%G5Yedp)g6s$Lj4P-bMwb0(5C&p3gN}CvU$ArG)HcBm4ts~6ehZ)gtNJdz5CC)g zAAfmZBlg(b-52%6?U`<3YC7H_66GIi3c^CJ@cwa>Sh2VOqc(j4UOjbV>l-CV*UcVFbF3=AO5pzHs%vTGhtv;* zCh{&6XUsr(K+3s|w-r>ycKxT?kS6xc+SnvGJC5Nlz7D7i+|n}+$&O3C0^$Vy5JK)h zQ@xfpjjRFzUn=}+lU@Ab970Gnt0F5l>u)rSUj|8I>a6!Kw^$j>Y$vj3_1gz5|af2;re|5Pmc|NCayd|Nnsa9Kxp zx5%CMF0q}l_+s^x?}g}Zs4jk$3hLrf%4*Z>EIuLefz@W=S4JfXB-7rtI{sCYVKchZ z2J2%9(iR_-y7U$LMjYoIFU;=Cg+zI#)xLl#O3NEkJ{F$~u`4Rel5)BtN2!MqjPAJp z*s8&FGr%H8E|Z)iR&ntImMdb&?PxR8PKVK5B_NyJjQ7~WH1qOhD5CB`o6FPrG+K$;bdH1%+>_ z$UNG_4)jCyXG2WH)g={&vo*((#xf2`XzkPz>FBj3$-aKXD5sp19^1LzL9aN*g`Ust zPVw8g152oeamcDv7V1);D%G#r%L6ygiW-APLLZxI&3v#VNS~#gw^&&R1{UCTIW04C z5jiVk#^aD}y5yq#(scX|Z(k72NYBiic)&ZM>Jn50zeEmUC@y?yMM*_ z&7hI9#jEz$S6Hwyx|Q7yKU30DX#542YJ?9x;4SZ*Hz%dF6(JEAyJZG>`P(3=dZV6~ zlO1*U-tG?(z#8|+P*&xAmg*9lHEcY2u;W)KhJ=$-Iz23!Ts9dh?k55_N*bAbP_Hy{ zqc>b692kKa_!J`#!NH^5Xr!Y%ZZNx_6bCQDroO-F6WDLyl4}Ne+Rh$305+bC@1?hi zF-)lVMbxrNgx~&2K(|n`o}g7V>|7(SdGs4A{t?ctLUUhK^MROKsasmnY3%agg{V3f zy+`&xcT%5=ZwUM<-=nZ zvFm<8Hj%UsQY{aW?EUwL${zl(CFqR}o?FhR7YXCbTSplJgip(n%?ZT+$zNH+P#tyRU1>_i%$8 z2;=mt*sP()*tKV_Tk8-H+(suVILV!l>EQfUbMHVCB}n;Ig+5Bene$*4QdHY{zcmzT zi<1gHxj-o37|l%soyhkVswe`crPU|0-s$tWReZfs6-{|^ZQywMFa>n;#&v7OMO>|) zWvB%jV30L@bfP7<`0Tda&;m1%MV_=6Nq`G~_9N#^psGN^fc{wXZ&0Mo*$|>#QLGyTvd_ZS~`etE3d)&Y;An^P90q+esQz5S&5<# z-j7L`*vh)VH*DDAcY4#9Ya>%Q!{s)hS`9z2!m^q> zf{2MflyHM2ldk4DRaGv5$>oVu1Z`|HT2uhP-;QfLL2d1{J_TFsU?XL??(4k-9v{ES zAKvfynF2$GD~0Mzw`H}f5pyk{N;*#oUb)s zjWzylQvXMAd~;K=gT(H9v~x-hA}8%}ezUklwrNJ;X(YxM>YPJ16%@R4BL)lgG7T_l z2^pJOYYgpASaZiFuN=`y#+i2AIJf+XuoG!{ZYo~IzwDa&?zq`g!j80|D`c@8;R?m| z97wxG9Ady)i6+5LNtbKfT5b}WWBX&qBqz;G*ir{nhl6)oD{2|ytDO?Qqpn(!CGVWu z%}P6a#B$r;c1yh$@AB7c3*2&xhMDCeg`Eqj*DcZ5Au3p^I?Ia+&Qj4x{UXs=H%n*mQdy9n_Fk@%$>RacINCkd-naY^Umy<2a@(vGqoFUd7@b3?pxCtl`|8^ zH($#4&SD`KHcu)^pc2akw6@S0XUYO{&???6p&9#UwFiDwIgfL0ro$#_WR>hAqy3HY z=SIiElc}q-F9temlX*F` z^g?A2kd{<%yF?Cdci4nJ)|#-0m=m#kL~AiNI?D#m)F#wDL3S0EemF+CqigdgaQ8VF zks>@e*sbXpVs0T;_$ztgx^8Fn+Wt1HHPo|PSL((iexjT{5|qlBugm9a%jTbGJoC`L znm*iBz&a``cR)n(RtnESe0^je;j*(@&T|tWg?+Be+B$|6VEsMRtt)_PmS3v{D1`ay zl`>Msm86$&Nq8B2iFfW7YL^!Q&0^{&Yo^Xs?A-b#Q|plC%|Z_W(FFMe-W#gelW*zW z@95m8V6`-HLo1KI;S?i#FQ4;}1n$RmvThN&JQSbJf$v1!bJDqlchm3%TmC@P;@V4@ zLtC=GQJnFL;ge-=i6(Kjs;*}s%s)4C?8@MkyUAg~gWAc}!q1i!OxNGoJU_M1P`WF8 zzr-QNrtx}xN4Q3?uiFHEy0+Xy?U87C4Q150;LR0~vB6hK{R?@sV=lQE8~V>aaLuvu zB9yyQXO3Ad!u%D3*q9%GG3rt#C90T0q4f5fiwL$Oc)raK%WkT4k1Sv$GxE|u2kh3t zZTQ4RXktA2h(LkuPz3IN{+iXlY_GAU#Xr|HKHkv(KPV|a2LDEy{0H*nzg#R|Q2e$^ z&XY^j>I!O+zIue?-CwL>&-C{OpwJB{cyj;3IJYH~+t_1K?kp%x8s!WiU0g6Iooog@ zX{R}Krd^NHM=Gy^UD@}S}+si*)}r{F~7@~L+t)2bkAn^+<+iI zxoUI6r`5RQC~A<`20BSFH{_fN&-| z75mDL2@Kg;w}H)qI@PH!SZ$g@@2Ls42FJfb!9+#SW@2q2+oJyhvcaVV!TX)#GmG%Q zYeMXdh+8=#y|~XnYhHX=NfBNm7&oTAqC@V5fAuteT8Gm~ah`zPV+k4xYTUp*(#IF} zDF$_D*S%Ylru-&Wx$IXI9gBb6DrCt6y6`6xR$xi3j?-A2PP{X4S?NQSN{mL6p4{G8 zv)F@AJ2U*}t}Gfoyq1)bwzrNSW9PJ!xblWh^nCKzy#=E`Z*v`o-8$lx>p7d5sk)~r z>49Tj2Ybd_Y~gdD&W;!Xb-#SRmlVF3J@Ml=hf%LY!R^AsvJh!T@BF;IO z0*-!bc>!SeQQiBHg8P{EvK$B7xJzDJV^Ji zsU)9ajK166LALFeDaLkl?I$Tm`4Iu1bO?sRMD-7d^N=|R7;BO28-CL4u8?(-KNT+9qQG?NY^;1I67NU1vp^k<&qqJFu83Tt${-HTjzq z)(eu_T-X4TPhYxg4r59;ad374J;uE5sHB~Y(zD?~{OlJvHU5N|nl(($O2EC6GNUgL zh0q@=@CB0?eg;9=LhW$^Ek=B5bw9=5rdiL!fG-|R)GI}!#T&?$_v~ST6)hgOxauI? zX2MFqrAP(F$f>i#!vW8n+u>h>MmcVx@qk-A&1;yb0`s0yw>GB8Q0}j< z3s?u*OT&b%>Mx`WK9(5d6ppBb2KM5i{1i;RU#S066Zz{_O+S8_N}OJh%WMNHN=TL& zT1#Q~9Y~pRN6-WQ^@s4Q4ZbUeDNW4R)DR3Jur};eY8^zm8 zN`v~4{{v7WNc1_-I^J3?Zt%Ph@f0}|cyLp!yd>GqTw6}~bi(sUgh-yoxhfTDYZXZc zrbX%nUF5E3Sk@>G|V?kuH5Bz*9xXoa-y+ znBZK~LuN;h)mj#CjzCnMh#B6-&uCbPsy=&{|4#ndM!$`&z`PjuS1`OHEB-4bf{%R^ zM$zHE3Y)MC;_KWRU-lwOqt#F9py%zq#6;I5$4vk^D-Y3cOnl55zZc@zQmkUTyBY2?W9yL?zbym0!00yLeM#r_|J(7tpn-;p-!-ZjtuwnZKFD_vR`+kQQv<+7Tx@xvnj?rQ zt2QyeH8-2+W_)ZXqNu({f263tw#H4#&QR>lS~9MxO{r;HVnik(tbUCEVGa z+5DC4PYlb7&I)HJcdCtdgFHghZTxFCxMzg}vc{$bhClBCM4zjf5f53K z`I@a2&Fs|D_h)*4yMCCZY3~2r@pyKrS>u3Zo~cl*qjW`mwkCjh!rq_NRb;6})Nc31 zbLIjP>eW-b`D0kU>rvFmU^0B|yJW1@;<2mOJxpZPkR^7WbXdRLJZBv`RICyV`uTDD zV60kjzvABP8(8QXI;&h;iwIPYCH3jhGpskVkc*?k6Aj2Vl87A zdm0cBYxU~Z@S|uw*_zf9{ZFs^Ic`mCHZmp{P9*3OaMi7y1VtL35GaHqFSp2uC?ZMX zy$BT~DJ?+A97!sU)&ZU)K^1c%ZAnnoX+Sh@^S+zM)1b(6hW}4Wh=j;57ocEsN0Txl zEMJ~icz9KW07#2eZnC?!|C3N&oQL%A=ha2ibW>r|M27Gh&Fa&>WSn|B6ge2q&B{eM zfrau9&CzJfLMNL>r zO^EdNf@X*duW2^QE31yfRecSKoql{4%mRzt_`D((713eI3%)Fb*))8pIMaSW55TJt z%S&CmExoO-#f#lOkk03%xpgn4*g@x1bX)qJy{B#WMMbp#J&&`Obh8Hl8WGI~B*DRg z&4;Fn>a0o7GCdRJ%}}zz?-@2&xMex^^y>w-6i>&c9bY_wpe-!+myX6q8gRM)Q+4Kh YuJ|`VMT_YUkDSMcv_x4@%&$HC8!gILhyVZp literal 0 HcmV?d00001 diff --git a/sample-apps/blank-csharp-with-layer/images/blank-csharp-trace.png b/sample-apps/blank-csharp-with-layer/images/blank-csharp-trace.png new file mode 100644 index 0000000000000000000000000000000000000000..c7a6cbc885583ce8a2fd0690950cdd66ff5b5135 GIT binary patch literal 69147 zcmagEWl$tb7cB|{gUbx=Gq}4ugS)%Cd*kjd0}SpmxVwAf?$EfqyFSi2-;H=b-i`O8 zqqA1+s>q!?EB9V2GhAL)3=s|o4h#$oQ9@i;5ey8%01OPA5C-ZKxgRa|`22&l7uNuQ zfnkvT^8=SqB)R+qp`9dTM4)#ea53;;96FU2|Aj=>?aKK53FY3Xlr3>2G)(c zANq+w|M$GJqmc>N-ACZb|1lG?v#~L;bppE|OX~W>p#Cvaws5jG0V_VAAqNBd2__-@ zOW7^sbj{sOd48??>Y}60lqq%0SWo;XEFqx*`RPj~(RPGZg-RQ!(;M_~_I^L#sZ&wm zQde0)5s^a_7T`zonE*KYyHR>PY^5SwE>9=i*_QCXM9U#vsaaD~3=P)^aOkN{)I@R=VKx z;^NNOA)J7c66)RE9SI4Ee%&$y!VZzy?Y5#yqB@Nz3l1qax7HWNe_e6VkVhl^9+p!0 zR09zJXbfU)sQ)$?-gd!(=F0ThhbocT{;1%v27;p8Tz}c30EVs&IYUDt+a_Ev5rt-L zu_s@<4OA2qa~m7r#e>xUoTbAY_R~@LQ*Dtp9eXnXfHJVLA#7jdiJ)&v8Lg$?#wHpc zmOo~mTUtCm9g$BqF~RJ8PvBGnL+$-?+Ce~FsmWhL=*%C4)rnv zpE6{$Bl7fbocA4(yTPnGWsBJckGh<7y2>G{ZWs|Dbh@-(D&hVO$ms9n`vnH%O(>K^ zUx(_j8>BIVW5#ZW&iQ0SrPoD)aqj30 zoe+6A zrC(N%Q`qXkL?Vp<&Gsv_e&Gc0vly%nEhzGLF#gpcYkR#GDlpK2{WV)IoQ#Hqy;n*b zWfpnrXCx%e4olKVm2PR!*&IW2A1%po!NbL+_@OFar48f0eeVn5_DU(*P!}_dEo*5I zBcfHXCneJdmlh&Nu_QJfQu6=r>&ggynCmk8sxNRlNA1+fu3P<+hO#N@J8ES?&&JUH zyq0|uvca~WbVRE&ao^5h`Z3XhV^p-2OWdFA@#(%qila4b{(`7yM0gFrlw{X*ALWE? zY_X+FmC@Ql-|wW!&A7f{2P)w=#JRb2VU{7;6G3p>RTuM>rU;t`oK9hSF(kbH#I;a` z{D>L|VJkPQY3?~7i{nd_k-Ec3@XDUAtOA3f%^W-1_A%3+9uZw-gk$7#v-|P`N}5+} zV!&4S0;x5}R8St*5DmdlSS8tLvNc)!LV9?|EJv#Ysi&p1M+~-PrN-zrE2w7gHa~AD zG#8iR9&&Dzab34D1WF8tvWMY41fw_PD>Pwag+_mj(XVQ<>4wE`P`i-sSE*v|+vE8N zKhmW|Ca@HX&6eAv=M3V1XNYd}R`kEHMF@N~@kssLf$BKF^i~2Zi&||H) zKtSU${&H?UV&Ajv(J@S8ZWS2net z%z40wk)zduu*>_BGKM9cB1B?+sjcOrl_sgZ4pVDrazzbe%GKPAM=N`eezKhWuwEZ$ zSo%qmYNNdZI;jy0CG>y8yQO{U&nf6H?+Js2^yOP*z-VUFY++up3mz;+t*CEsm$dl) z6Li;PuZ)h{quPi5Ye4AJcx$FId(`$}d@9~3)<~5P3oPKnkigTH4p;P^w9kTfjd$YM zen-~HK%v{z^_$$#R;k^404{UW)!B!4_!-EuWu!LsD=relId_+t)34v`@2_Zerd0;r z$OA4*&9M={2pQzM+sTjN{UbV*45X-(;UI&A!_*5w#^Eft6DH2*4V6y#SE2E@VArTc|Zo)%AN=nA#VH|~MUM6-K`8_bVDN?xw%g}p8} zV{2Y9! zRiDImE|;$7Z4pi5AtX-UE~kr8G(R}n_1Uk#mnQGMYg2zI+dvc*0`@jSIY^}l9vWj_*HXVti*$@f5 zc@~(3A6vy0f6_x^^E{ihGtkk|Dwg~!sjzY}knpMs?=HWWo_xvikUynkQi|_R6R@;J zS{H^VzgGj))}#@OAG$@%wtwrc;XoiXxWl8awvfa7eBNNBdJV zw<$XaU~qU?8W@555ttq2z;J^60o*V1I^=2m6?fk2H?t2K^nY1_-5V|h1 z$lAUJrF5=6mZ!EK&%DXj$uidqFE?%=HZ<1)DxCg91*d0)`!bAlAA9U-mk>r zVUFB@0WC{BwsPRp3z7Kde*M6oZ#QG0>&X}pA;E(o#{QY`ManjMvwiNt&T-$9^?a>3 zwpc++dAJm3`A6{ob0>E2K7F+BIl{yGc}fLNY{yp08E&+lL#NVO3@L%-g0co{}zx!{ciPxY~zXb z-ufAPlJ}is?b;^{m={0SoJ{WXtfH%Y93EO8BxE4%%7;#>o2BEJ!pDv|)u8r8LPjOy zQYN>Z0Xh_$+&IlVO;9r#JPMyH`N+2`8zQncoSmQmh$pT+J1t-R!zW$O>%oddIMyJ1 z_j^RY0!sWP%h`5|-Ur^OU|sX~S(zykYT91x|vSF6JUA%}O+W(Sc&{`Yn+LAs$jnMj;Z?l&H1Tq z3JIO&{VY$|6|-9MB+=L{p%M<$O_{qm-*NVq?MG^5PDd=?J46KS23S(OeqFwJdYPrZ z5i01c)n8s)F%^y=;*l=a4!!R6AAL@)Y4OLX$@%H+ zkfbTiK-7@Nboq25|f%#uE z42k6boA_k9>La=H9eNj9e3sD23c00JrKOVCnRyf=N6G(N12UnhpGFp9uxZah zCmTb@SXye>1mg61WQfT776~jaD@*u!iV%^PbHWv3aM|r24o#zTVb zl~qtlTwT=`%>4$2jg5^J;t&ULK60-jm7cBl%~Jo*vC)+Ioh$8A9_{OLRcb}q|J(?J z{{^-GKhpMp_2d6V;KTzM{#&Ag4h2wx{#S+zL)T{6i2wl1apI673S3P5$#{{#00S&0 z#vAg>^`HesmxKHDRZFIejBjQMH7-!DnY5#YoKDJ2>l`0vzI_c#Di|6h@bwoj+|F8Hof8DwU;sD32V z%(6^7zZshCFb^{z99cemchX5dR~5_%%y9i=wO;GP-FW{E6U?;#|9`l>qpl8Q5Ol=Y zrO`w_6V()7V2VG+BBMgJI&JX}&Z-oDTMBh$RNBfw%O1<8Acq`_91ExjV1UTkQp=dM zkk}&P1digb8vQy+=@+?FsINq~XFwxd^Lp%#NP;yA3Du>O)0)XxiChnZgb@{A_{B_3MpJie~ zhz?u*bAk4**h4A_{Qf)Z3cZ6?=|lB_J#pczkbwn# zEloqYuMrY_WBn9$)-TccU;&08>ecS|5gV4d6Q^@cQQcNlFyfj1^D|G2=(6V7o5N|^ zrZ=Rb5`fbpSqwD#Dy6~~+Fyb-F+W80BAcd_fAp$NM^0ox3KV&K*s6B6M#<`R#>w7e ziMd>C3j=VQ0f%b3VSRAs;7Avs!SDsF;&8M?XYx^_LA|R`Qipt^M8XoK?bqd!T>n+-x*Z{YWM)8Z~Ckgv4;nVe4al>Iw?<{(%XJ8nTNR53@4 zwGlW8MX-*z%ygtFO94ewH4k)`SCXE>?|)l5zp^&@owt+}dxYhCE-(R-26$cdL?oNj z-d?nZj}{ZGJ^$pt+)tUG2yRpkv*0Zc=0XJuH$?lT$v)t*vyzvZ!(kUo5{bNxUSU_1 zd!Lyk+40F{SfIKzj=zYuF9u3TID8+L zg;_W^JMi~FXp3y$*4=&D4N&&tGrwZfOnd8hLe)W@RmSX|ugmzNM)aO*zho4o4@K--(U;lO`eEWLTF1S;~HS4If!t zj%-j$r300|I>$Ru_{OR(9jJ4nx^uD;3t1KT%$x4!EJaN&+o-^Bh|_7mLoqW4wVuYF zZjw$Fo}zkM$pWS036b#ZN_u%tq?^(dwNf1Yr(Bw4KHx0D#q5=xA|jxaY#MNy7&Yby zQSGjaSaoJuAQFkP@kU19)gD78Bh=(x0=qhK*H>5U;rgBVz^>O$U0xc#Ww3HHs|3P= zt3D?A0I&Z{1?DS6e|d?r-iJ!%N%q9mUDeH4fDB78i?SzC=8G;6vq&vLABEwVID^Hb42)t6Z0GV zD!#Ux{vjLJ1Ab3KVA~ga9?~gr(Iz(^nx!AaF`RDe-SULclyN#(1*sM zKT}$AV=Q`5YGF7lVFCemG@flqkz-qMm;rIs++bWLj=2JookzOS0#Rj`)la$)Rb6lI zubvTh+aWc)kE3}wqB0$E209R9S&M=+MnBnCIsP0DV2|;6{ej}=C{w#$m{5h%{$LgT zQ&8i3#60E+pe4m-ysumq=P|?5>u_N??~8PMjW)uxsMUg3P0vo8{b3L|9Jb>+ zaJVGVt5e76UY&ItF)e)xLQf`+iyC9$XijV3#yw=aSA|0RRAAsW>TFSizvdquBK?W@ z@>zP}Rf8{QawY673j%DIOF=QzjNs{|etFyC;v_u=U(sk(xnX7Lg$maO!ieZ2fW1T0 zMw||(44}md(~Cw3EaEEDv1ai0>wSWes;*3htb{SpN%vVTYH^9-eELQF(t}4QV`a*7 zM_J0vKzjL+j$rD1_*%(~d%sT9_;sDzMBOQuTfmh!)8Qe<28>GWUbV#Vl8?5=LU+$# zlD)AW>s#nP%2G#KQ`5_l=bBCwrJV8j&E!@+XSJbXhdUy4zJ_$?4jEH@$C$SXgchw)WanfBwT{#3fvkxTuSlD zqNCq`SSEhq%HVLsvl7J|@kokKgWMy2uJJgKwTx9!#0MzMOYJ-b+9$4LTjnRu%ka`SItT&SWyeGG;!MgJ8l~xJ$8CQK?7wmqw9{ayEiO zmZ|>I=eOM8_o^K{ks59tgS(W8jgZa}KMz8_yk;&Fr^4!YRvO&4jL5TN}c zgRm)YRSX|c6^PrnLRpkOIpYkm#vreJa^zep@)g2KCQyk|W>!FEtWeB?fFM-X$Qhk= z9FYZ&U&2a#&=P!pzk5fbKj3QiM0uYz;EW!zCLB$FIBlX4mNkDIKjJDeJ7mYrqv}uW&CMCbx_Y@$0BH#vsd` z;Gb;{I-MUEiz6(I%J8sHYvMZ0*$}@d2%Hd?k986H1XR#6*ifx3zxP4kbz4CTv0v^M z<}C&>GB6_Kduv5}DfCA&FCwB8@h=}!-Ui_mmmyElQicx%ikUZXiC-7S7YG+uRP

?xBo@5BOP?kO280`w z7PKjQS@5<{bp@UOZR4o+WiHdp`X%_xySsu{+|!3=jUfNqI)6(YajSo#pm0B~)b{VO z8#8f)5^NK}fiQ0YQgxSvKs#C>TJk- zoVY^O_uDame~H10l6aeVhYOktC+knC3}P`Pd0czuN-ek%2Z+8fl*lw;LmB181_K#x zF(u_qhDfuIz|wl$r(sNTLmS@yZPc@^w8A5-!r_TMe7qY?Iul5B)_)d-jU8E)8MBK?Nx7Ei{?z?bDVZ)(|j0g0oL zT@-eLWC*R|kiYc&LO1=k!rM?WZk|$sB|sQ485UHYy}-jp7q(GTzFyPVNPTZ!jkl_T zYAs(B~B6!D&Z{D(&Xe!#MjC{hvYcN#h071CFOh%VXYG&P*5B zvIY)(i5CRMCktE*XkH@dw^Fu7AEoRX?F|^70T8rHe!%2krK2$s5h}1X4)3$4Dn@gQ z3kkf>maWEnOx24xx*jJY@6CPD7`8-*XTU$(PN!l*L4wn>;N=+6-)0FhxF+%zF%*{3 z2Dj>`jzj@0vv zE?>Q8Q7o+Pw;Wk&UysC=x8{nGkKCLxACC1n3#^Py|nPn;P$SJ8~bvu|fs?EuK*W-mLmLgK;GJEz)u-fv1`V?4ZArZD~ zVB*vVn}WU~+Zx@xTh4gsjmi*n8GXs!&uo8<{cFAMni8Lzf7s;!b#lNfvIo-rvw&49 z^{b}X>3AJ+vNIEJsV32~3|!(Viu!as7#pA%7FqVzjw`}0Bi$#!p0>XTb@2^D$g-^0+&atQ8`+JnF9| zBqiw&eB7~(7?B)4QIt-bmy^)}lc`BqY>3JVK2qn={UiTP#`$;FMmPyjRx|kvT%8ib zN}7eLmlHKrcY228uLEU4L_}d}?iSuqz}bADM2)({nX(`6szAB{X}%|NtDD!Z6DH~O_LzLhv`A{w)|iy5#-r|vGk1O?fcY;j1XNN^{oD*zRKRv2 z$Zvi3shy;)qMmJT24%ViG=pWohkiSHGwo#zuNA{_q?-{C;a>%^CyPCe95f+r1Mp3# zGt1a;osTh9wwl7}Fyje>(k!A$6<0e_>V@HZ_C@FBDsO3ygBH>E`{P7efFzV%m^%Y8 zM3X1PU6G*+M&uT=G8qyYw|Fb4RpZwsh#&$O$WO-JtX(-fD$OfxWrf#94c;~$BGT|% zgDtHj0eYu_io_$qzLcxy=Po*$!YVDQt0Sf)wNcKBDGn#%_QqWXQlG`j^Z3$MYIdP#{R#25wsVYfP2>rG>Q$i%0Mzv3p>w3HUczhEMncQq zIp9IfriD%QPGx9BI9ozW>ZtL1(?rS_jr}QAsq*gzKOZyQg=wW!Ky>^2;#Ef$Sq$U> za3ZR?zXXHcn|w{OX>0oat135L(VNnVBGrHU$vm*Vbl@223Bn+LIdVv_h-l#^WvqYH zqp(S;qZo>Rje@@6|6e4f_@C1M>Q*p>T)!a={{Li{RPxh=nO>GTR@5f)_@tz&&Wv6iEy%XP|QOUWUbXk15Wp0p74h0m;gwt_6;8z5-f0YTMq54r^ z#nNebGu{E65-p05^U6k5Yz^BnjwT^txRc%tXRH?QoVbn^Uiz$5+Qr){@J)uLQKZIw zMndNG5YF0MVSC9z-T5^-I%u2h^YlQ?O3ljI=hs@-DaK1c8iQVR_VzYq^xdhPLNusw z;irDje!YQkzIjOa+8OY`rSU?DN8H;84F78pJAT#dmlWXuMm##`5mFz|i72rtTG{f0 zu_D>@u5bZyXr-R4!=4ifjt6`(UP&bYwZiykr9{I9jZ}sh%KiPtee`EYS4*n=9HbIq z&kiu*kfY2Ns|F?w=C(`(O&^uP~`4j#c^Al-8#T_8m_B2DP9$tUTha`;P50a zXUji$cm=~aD;TimqN@9)VjQv$r?fOj{fwhR^)%czL-i{!PEIbP-?k*#TDn{5DuQ4| z^dm8wm&GuLY+@#M>^HU3B{`L5_3H3_eFW6%rPYFhR?Y`(APGUVAq5-WJ#x_$kq=H9 zXi~$1QljXjcws@jgFj|1Q_wR0P3Qtu(2GyoG`SH|lt+Gi#?18kz6WPT+twp0W8f^o z4yLD|u?W1Q0 zm-qF7z9`OpA&nwbwPP%S-fmEO&i){FI}1dfaK`yCxq1*OyLSGU=cQkZh095>6Q$E- zvEq+O>x8(`jMpP=mYWx2^fU}*@SZkcR>o=ay3-eY!6oA$%O_wL_5omY)a8?szJ-&- z-v)W|yX01CV{ojCe~_>Xnp;ErF58unXD}MO)MTBXz|7eh_g)^ZuhRunX@m(zx$5Al zt6j7Kqi{KMaJ*?_ILz>eM^3yNLFRB$8kynnvUKPBXw-4yvwx&vW~)r3yVtuT&KnyO z95i5%cky>JmdT_Rz}>w^^wkCTtGDg;#0jI{taP0BzclOZCgz0>MMWO-oW)P^4ZJ!Vqu+mQDnL=Pqg*Vnfhc6xp8Aq_|MKU z1W}ncBB4>o2`<~W!HqrOL6(6pfGEk0Yp2s2c?Uk;g0DWFoWLU*qbR(sn0;~G34hN* z;(!Lw*Okuy_D)(``GnDQKda7r!niPJzGTBjME+1S%IK%}b_%+c^tLNPbfHO~NZ&W_ z^fehiI6vA9t%%9-!|scT_e$F|tb7)k{< zM@LXLIi6is7SZ?KC0txy=2t0toOo;N92XpITAFrTZodppyIz>Oxr8kecwwEe@*7!Z z->m&{%bu5i#js|r|o`L`{<2wT@iQ1`K{Q^+O#etG7-#Mbe!wW^AVYf=KGKwwMqMaxyWAa zjMJ@>-&*?sR9l`uE+S=&q-6JrgYBr57aDXwvXiT+;qo&8Oj}Hmbh4OmWDODOKEBkI z^JDa$j2Z6g=ott)p!gHxy1!q@)$peYI%;yF+I7YdK82rZy_%VR4ZZPgLg1~NQg1r^ zy1wdxk~|xJ&fnYFs@!?ANsoQV(?2GbZDuC)Z9ZY-a9D3^1RUF31=sC54imNjX=~q3 zTgsspu^0MjP{>yZ|IPaxCn*?%XDHIwEehWOT2+X&VOIS7b>B^KQiBLwmG2Erj7w%e zt4wM_6SZPvBq6q=yAvZ*xF|3y|6=#~YAsBy()juIfD=WIoU@2s$u?DRquf_lEa+P{ zFG`TNwF29udr~lK=2KT_S8SC7Dl%_NnDbwq!;RWM?po649+wYJ(YAY4zG2`k&OHccW)owsC65bL z&AFk8K;K8ZeY->8;(#kBapJ&xgI%rV&9CyzR%V}V4z3okUTZzZ?0HX3iDBA^oX_y--qN1q{=@7v((gP#)>=4<%T4f|yReeA%Uu1}xJ zSQg(8lkTr`L@AbI+Z5GvJ#Fw5-PzpzuXL*+jl}}TUE+m( zwQ7;$frN)_s^CRNzY^|3$!cSGzQv~;N;9vtuT!EX60sj&o;2}0XSqq>5J{_<^tu}>YE&))hP(11;f$Odqn)D z2HV$~iSGxrbiLk>a39NVK^40w1D)h!@1Ch;nWdY2d-%Arj6Ytu*@Xwxcy&hs45hiVr@f(uf#!}xoWJvXP$v2LpAp$$9-l9VZ z(tZt8o&WU`bX6VG9!tujpKh9cTEU}_H;1rFqSv1|i8O~Tn7zmdXF)o(`&qZ)+Wasu zgIob>+E+=kvFlIJ9V<8)_?@NQySDKz@p3%mko64gV?o4qrUHwseY;y+a;wLv8x^q4 zU;(Ql?T_Jgc$Rs>Mh(d({!);*cY|5`ZqEyhK#W2ibKf1Vi^)I8(h!~efhdO9$8@(JR`kHo6WcifXc#2{Hu~7N;0cU- zS|tOvzHwuY?TTNMyg#lH&Q*A17444|T|88poo!_2v}~U6xT*OXCXPOhO4SW@JrI-! znHR5*;C?LiF?vOH+ET4~l}NYmfu!62cHkxRUxUT<65ftC)|@P>Ey?lwJWVwmYMEXS zr2{A=@qyPzb<69!hS$;FM;X=-MAjO$DNQbT217&lAW_;uBzYY-YUI_c9-O5y&<#dS z5uKly_(s=YmnH>< z7M2C6V4jWmf4$`GQ2YwEeVpn}4R!twRC8bKO;E4Udnqw9hkXTIva8me1<4-NW-a;6 z@u4q4+@10r^IJ8gBb^cjg?9dx5Fqj%ov~Q$@)wn2boGAG4KeFC=Ti_{-R?Pf7Qn5| zQ)GK0=)4Q=Q3o?~!6})x#L?W4L*Z|YSGyNZx&B*X?7MkZL7vWtpPAw{=*DD2MdpXG zDLg0pRJ}z4VJQlpwD1%3uwWn~-h1GXr*CvQ{xQz0)_76JP7L9h6F0E0dAt@Jg}dJ2 z?f#2$z@Hb-e6G4B{)&t=Ckw7P-G$BwK#`t{&Ux7CuG(3;*fHSILH@8h^&zCgfIc4} z!uvuOU|6GHli?uAE>KfUvF|CCGCVC)###Qb7jxn{yB;U?*J*_J^^khUUJFc)GJhsr zy}Be`Dq3|znjw$rG0Ecgj?5tKKoXshfU`fo$qcYDdA_qXc;G;Tlv8K5EJd?~{poI6iz*Inm282rD%^XdSQnB6j*?-vZ(DPywe(QJ$n< zV0tXm$;bIlr`|`B`$ZOH`O+OKjh88%ie`!pAj@>^{Tot8+*jWZQhGZpVq)63yE>n7 z~~Ui?6|0l1LHCn)~RN*9~5l@rHKX}r{(sz9DgQVU*bs3 zf+&$Hxd=98Q8Kyd{x)*RM9bYIf5MK|!cNm4rUE%)?ieWkSE21OqtyoVF}+JnAHKm~ zi@JR&ib)Qt@#=jNnt7@-k}pgiV~}{72ptyGqx%=6Z%H7E3Fqm;jLoNc!1C0_;FU-^ zW%@mJ;k`ouW6}!Q&CDrMTFS4g^`iG5JpH49CPw?-j)DyLj?9JV9!hxko4?65h;+R? zEl3|Vg?02J(OBQb$T|jPj8=alXU-?^v>DO&SV@JGx(!p{j?SxLX5CFsFL2?+x?v^e zgXy+*E-K@enO&Vo)kHtRxeG59@5Lo}9J|vqr~Y|`A~d!m?_1BlW(N*fY)ysY5j(Wms=EMHV0*PM^LI=H0vZ_*+04XLqZlzGPH*uK#;p3bb; z!Ku$4f#wI{BeRW4xPq)ZB1+c=DY4+P+EJhy^^|7+%6a~bTJN24uR_K3qSkSY#QO6D z1#dPMOz7Tksj7f#@e_qj;(R8(^TOMHm*FI7aTc)6Fa`vKWn!yfvC?FBC9f~Ohpi%; zJ?Q}~J@=2!L^<7A{Pw9y_sWA{(eA0Z-_%r#h>j2J^7qpSjP(SYj%ZSYrCTepR@iP1 zlG*e#Zs6u}D&`C74Ox_+_Uw)4sd=8~%2qu+>DS$DaI>iG3Y*J9!|D=c;LYmpF9pcZ zHFKQlBb(TjeD0Em>ism{=x*5Y^UV7zb}`A~w|Itc57cUk9#r~!k)C5yhf-{1*}C3Q zeBIYKU-Ym7JFdW_9&m0682#P=_qiuf#kvvCUXL6jqywNvgX9( zBJ}ca)rkUXDEYXl{&EOU*dS3sN6hEg=J0T#*)W%e%ScSs>b4D5b(z3|_R8A@NzN(t zp5GDI56sq38Z4faN10V*{J>!{E5AaW8+Yq1jC(OAY=^T020mhTBJ_VtzTv{O)2$CLJn(>M_15tCkpQxZ-fUmU_W+*%mB^diH!yB^7&3;y*zRZS`~}N*raW^8OmsEv zaeOtTAa!u$*GZlQ6W77QHqQ3luj}jWu)dO93AS$-`H~S7N9bnLQJ4y$&cq&0yjm-# zf0S+Y-$6J=K98g!g-Ge_2HsA7skbNEoU9vaCH`>rAn+b(m9Mj6O+-|k zxf#V`Y-K<2+1|Rb`iL)j8qEV^|5!{O0;J-F9h)~Ul{AoDxkXXv<3PnNy?yVS7Bc z#Mtf>F)n?e)DgT=IuCn4UXQEIj?N3ne5Q8i$YO;amTf1hAA(5=lh5W{fpxMfuJbac znqud73%?!JZ|t>Jnt^W4jK^pyDCn zHQu{gV&J+^ANm1uzQ-SXn?)2EWFY*@49dE zVIl|&a%;|PIPQ0ozJ@KTJ;>w_{Wu%Z1mUQQEZyKCq6i7%AjX9Wot`au1lJ;6w0r|B z9L*P2VohzKNCywUu<~DvSF;h+>Mz?nV=2kKm}1=nGM*NQZ4?9?QNR8!Qv@wtzV@{@ z5BBM7;0}7me#5Cyv97vOVriKSJ;w37o7;rkI>cUkL8Im+U;71kBu%1G7gmq}Z-IE( z;#>SlE(#&_{;Z|S_OOfla0|2ymT>j<@4jtmud#;)LW~|IZ4(YV3_KV?y1Slf-Wm`e zDWwfei0Hd^X1AH|d9441*Q0*OBp%dHfhsl=6EB_dspR}f6#-hRDL^o?a7+q(*&G=u z1Q=6C$9L2=uE}gXO3#wHu1pv=O(?Ik zkd?#ZJ|AFPf|}({i2(ygK`DmMjXAbaTIVP6@AfMZY@9rBzh&6g9e-P6226~lIznyB zc@obj5+WiBZew2}`G~=G=h+@`w|ib<4H-zcZ;_eu-d~L2Jg1)yaawztVslGEnByMq zFU6ocoh4S&2BtVLi^Jk)m|2-%>zL921`u83)&@0?&dLow7SQq5c-0F_cHm*6hj%Bc zyms6Q%egI|CQe?8EwT|nO$jP2u_ensRMPewqUAOhC1T^|F~%sfLQs0K;zYpd!MF%2 zHfLM+3zzw`o_bD`B9I&~i}!HnoY33cKvD=oO#LmZ2b?2hA!KTd(`zRb5F!=KnPBN| zHBNV)#Spp7E_V>D(e?8{&6kK9()_`nI7(pr%X4*u@-+(7h1>O)QaGQkU*^IzxmSUR zCB!@gYMU;a+%F1f*rQ;vgQ1fj-KjI$s0A*tm$@qY|#uQaCW1F&$9&k)Y)EG zb+)V@cZ--XaaCffq+UMozk8UjJfRu>f<>IWXC(Q)Cy+{|!%Wf{yU2c{TZ0lI@%$e8af19ufz1iv^|__%``wxypsz0*_%?Ra zURR!#5+!XrcGfq$Cg`h9;?QRU5Fjz~MkRykec`TRHi#!7lwgV{@n?B`*_;%MOkR`v z0G_1V5WMxUrz90aKoK@d9&CwPJN~|$VwsAG2k=f;lr1l~p^1Y%AKD)OWc|or4q`jg z{bbh-bF9jY_O}e7W%^sS(tM1rU;3J0?${P*_eV(RRm4Qhj{hL&`s7B?$vX9(=AhYn z@20OlcYjZs^o>!|bNf1ZmLM)GZg$V!DYG>+tGy0!_>L5F2PV|ypkB!8R=*a>2$9Sug+1rPqD!rtqmcA_GF)#`T!Mi zN84NSo>!Q@Z+wX8?2db#)B&LByMV#e&CzLv1QZBg+cFnc7-sC?zxqPJzhB|KWHLWZ zFWM5Rf*WIkpLye1a6-BJPr3gY5D1UDlrLC7Jrfhikxnj(ivbTq4r(m)`BEU<9@=zm z_;;kkRYp_|A{-gMzoRWqH(suue@I*v8Tb7TdZF>})%*pY@IV-`piSt=(KV2noPW1H zDbOa=@hmfYYlRzJkM!duJy{}*`zeYhiwuMJ4dLZas@D#*>o@ND_2o*Z^SABGYxmF# zyJMsEA%zK#WA!>0#L)75JnglO3j#wb;;Rs?bA=h$hJ&^UA=V&}{qmxd1p6KESU{-nFCQ1e=kX?(ePHv?9SRmhdk-5{&&T7vt)7bd5qgeXu&; z>PQm=CnNXFASlj5u05{lp3ZB9r1uj&YX{7mAN;MEXyo=|f)eSnTaQ;9DnFUCja{Z^ zOn#Pq?lL|ISYo;8QLDzrKEixWr?B-p1+BtNb*AdQQKjTz!5UTdOlKJhWgiw6_5CEW zt^UrTSd&iNgX+d%QCxIGU7^0`)?W^sNO9n>W)1qf;8G$+K2E^nKgz&{ z8#&$HBKtJXOG#A)P;&&`QeH)6X9ScAdg(G&s?aNJSj(p*j8*78@-=-?J%jVPv!-a$ zMx9K$Ydhj}2qrBw$sIB}RBreQb8xoGZJ zg-&_fqmMIZbF3C5%Da_!Zeio*~R86$71#w@D44ao7nUwUWh-Wf6olaY@; zGpyaIlHlE5j{&<3xz6&)bk~9EWTaKReG5r3|HScNJ1a( zx-sxqs#VqSUyHZ@hqJegimTbWg_95<1W9oBMuWRH!D%$OLvVNZ;BJk3a1HJr2--jg zNpN><+~w=%yyu+vyZ7fE>@gUlckS9WSJ|$rIoI;l$qDsk{PfC0lb94p7g@&$dA{c~ zsF2_MWXLqAYB*xV{jIf#ZPefq85yC}MZNo1yQbzx&2xeg3>1%9<+uzMV=>O#8H;XF zxt73fpqSybGW{4GQ0sL^Y!|KpRSC_e(6N83gzO3*l}63R50BuHShZT8%K0g4RnMDN z%$s=aTO=U@YJsIXY=^aq`clv553DY$cGxHhen-0939;PDzGo*t$A5lyp>B$!ry81T zCF!??^m4L&GkP;zq}UxgGa}BKIez5hC789?pJ-9?rNtisAuuW3fG@DObG!2?Ee)m9 zgi2-hbu-MB^I{TtWTvCcx{P)&Q;D=kLR+CLN*hzx>xmq7a%abgWO*oa@ZCucspQ4q zrcQI|vpOdhcVctzU&Eb$DxDu1lG$b36;k_{C&o z)J{nRM^kAk8QzUqywuZ>KzdRu&pDlTEV?~9tg}3q?0p9#&Gv1|);@cn&C=%Vu*KSK zkP`IrHcnSB=GX=tB2x8{QG_z`q`I>mqs}+l`)63p3fxXX10AA>pT9}PMU$SoC*nsu6g82nV@&N^@MnN&6BWLGzX)d3&zwERDiiCC7T zH3j&A@!dnuZfD;oW>%JQAb?~>z5^Jtn;beNHpa2pvYJ&k-)*d;V57`@^0ay~mKCR) z?s6mc!<hXm>4$q*7}@S(=J>m(HkarMLGRa`e|7-@8)z1K3Xo zw}$$&SCsR2MPZ>Tf7AzqX3>IRO!*Ek0@r2JcTxp|uWO`ajWEo`38CHf$z6Z6(^Jv@ zDr?j%_Ws%A7T{qmm`wbs>ChRN`E22J5vsn#!yFjb^{Fmf5{I_zNb6F!`GMBOPn7L& zx2BKLKYeM5s~ThoS!kKv$Rv^OKQSXg>qrgA5>#HAV|_>dbrf4k=cZ*K$dfz(`YK&rU1b%rpL-)Yxhgo*hsy{yHZ~$Y zD4(@Xwfak8U>I^{t>^@cl&9a$Neo&bH@HnMc6M}-H0)_~d)`P~VhR?CCQ@>#*_#Yh zpeMV(b>3Y5z`?*CGPA@baKmamGRSezZdS7DB{IJ*P&a?)=!uD{2`g!a3|!qzP*Y2E z6j=260?F-LvTAFwNu3*xKQ3Z$o9NnGLp&NxGzrn|UgIb#7TAwdRV=Za0wl4?E0x>5 zXl(w%dQ$=r^4cGCf}}OnAxa*3S?QO?Q`B6(Ps{1mTIc6jXKpR)vh)B}mc1gOdgI?; z+Cu-HmdBu48x6%FF%3wIZyUIuEQuE1=^i|h0 zBH2c#ikltLFDs}wi4Jc0aty`xYxiUg$Z05(^TqkVdXfOM3^X+%D(R%M1F0?A-PK{g zMtEIrVl(&4e+B=Cd7__ z@B78!k(49K%M1FXEjr$;sZ$MqlJ5_dx0ENaQ`hyhxkGAyGwper7%qd}$lq>(eTX6I zA15)tBYq1ArVhWUbJ=CV;J!)FV+(a63_Q~BN_NwgReo>3Stls>E@6EyH^sKRWq4ST zl8Y-deNM|5+a%!;YhSh6Tn~OKW zo|sy2VsGP`MU~R><{tG5!t=Q4I)<~^P&AJ*QfpR*bN$Rbr_Il{Sy!cDB5um2K?OJOyctk7@mKlfToY?CN^588A- zCG!s-IE0khpRsMnh117OCi)7yHa`p#7>cRvIr8(5Fv_p*RbN%j*T+8PtdF&ABh@E? zGgNSfelkaEw>`hAUdj-1+~o?wiCr6(F*e?ekc)XMvSlb7%_U8}*zzY&E#6vCf#ZGD zyPJ`au$y}0E1d-dx{G-wDD}B~79vF2qec|IEzW=$ERBuS9yf*i5jxYy^+s`7Uf008 z{Skl@N5`T?1t^c`j4*&x%6NNC$rglm`W%iAo4!m4l|_gcu3^=jJDUM zIgit|DZ%!k%S3*@d3?P;93&?vt}e1*;-RLgiH(o%p&~8D$E%>Az(;~nPyozKGw9A+ zSuqe05Rj3R>zGmw(<0G%p_RixJ};Nvb@a!Fp^(2H!Z;n$ym8*_x=Fxx+Qz_%boYok zwFnwR?~zQBxZ-z)S3b@ zYzIO|y4oN;0~BrYK+dZ^$po&TAaSR)fR~&1@C-_?CV}HL@A^OhX{HA9Hu5}X7MHs{ zrvzaboSS9)vnLC6ij&K@<8!b; z*X6M-)|cHnAht;ONU>?dY%x%>>?zKX?sUavjKBhsM*WY`^%7hJu+1Ncye>3f29*3? z-gEnv2E#(GfpbOsy932UowO;>UV!ifnN`I(VdyW^*I)8fJ3f3+lCN{OY_-fN>6p#f<|ikh0UckDBU zf2n~B-n>3_|D*EfcQ7?a%F(ais?Js+A#_*=-1AKxnen@&&U;^wN6H6WLy+!ANPhQ4h#0|XbX)X;*^#7q*ei2zGoTK@nFPVzgv_+`Q9-wCEC znS#N!wG?HmgD1h^`&RQ%k>~cvBHe&t=<`F*-IRC(3TKDbT}w~HvPf3m<0+jGM|Fzk zbN#pGq}@0(kSRXy=H+ay^ES)9Ofj1v2@3XfLV_OQk|&f2tdLdx{8Y8{H!LI;T04^Y zM6mj@|6&s4z#HIYf;@PK6ZYRWjmS6DogBOFwn-Ny*!?Kn{X9Y_k-ft-m+`ED5>GS6 z5V$O@`iD$|c~SDSHQ7FB-LhWN!v(iV7HL1y=-cRR{IdK=E1P$mmg}tTnuW+CCaMh@ zmKd6VQ0c@n6-Q;nukQB-e%lIT$+lB{LA`HAt|wK_SUxo$NsW^znY+@rqw#z{R0c?v zeSS;mw125avXSmLvHjn^=qNf-j%}Vn3;q-**nKJde7sWWm~*wv(`=Xb*kSb*()(Gs zGHtxn;(S?%&4aP}*&hu=2M|c%GbB~83l^^0ssC|QvrkDeMa$=gWcad={kYg4@AyE< zo9I6JL$|~#AK5}Bd3)2*jCfL8I|P|gi{7y+n>Q`BuNArV;o8>JP{iNV6x8QHvguff zyjNP@^;%QsJ>^sze)fOO7s}TX$WOwsbkk3cDdI#D2)i&?Zx61+1ry8zu7!zB?8Qqc)?W4G_$g)XcO^aMfAre=MJTT{ z*SgeXnR1HkmP9jlkA6NiaQ681xTLi^nYYB-0mS*Yvz_8Si?O8XV=*8Up^o#K#{$KI z?w0u4K%fvfh?aQ9)}U9_210*Td|uum+v>Z?_s_KPuL}))l%%Aq&!wbEtuFlpuqeXZ zNpSSwQkg!YW1x%usNZ*FSL_?WzpO)Fw@yicoS2Fi9F^7I(V{ZVf}NG9q%4K=sw=jG z;m3j42L+3%qQ)cvS*ZX)?r_0(&{4qH$=27T@WwHm%MMR|_;DU@@ry2>LqKWi?~ zIwP1f^Y^vK?Fe+$d~~-*u6{<`bm#5+q>0m4T>qJBLR4kImvY|^ZAB~&Z1m3+=a7Ha z*#+#{yxbA-3b%bz!pnZzkp17p`to!~B;jQ*j!v|S8`a_2Mbc4Oz5gB7^~py#js64t z9sZ{AL`cr8%m2=6A<@(V|9k)cobnR)LQwwm=>OYfp#r@W^YIZhsKI{)0!uL`Q1~Xy zHOKxlgT>k{np9NBY}=+ypL(PKP$2b#GdEHh^mkJ3U2yTpnpKR>^$!uxUW_*8LeJ019E`&lSaX{!V0?$wh0jakhne6W(b zdZz&^JnP@Tzo7LKxNLjymzZfwDdWIjvA(`O)N`XXvU~Fo@9{BkI(1#E4BN!*F3Oi` zRcjb<9_edhrnA*if5$RNC}{L5)yzm6uUS|?Fx7%X121Nn?mWkSq4^l1qRGOOXO%hB zKp5uq81q|e#Dl*yJPrO00rR1?ZM;CYAfCAL-@X&AA*afNKNRT;|94|F?!i8>fYM<1 za0@+!Q5y+l-OL)#b22TeQdf%&x~X#nV08&F+Y91P zcZ28WxOWmjI9lvGiSD{&m{?8|wmXm<=x;VYE20a(E5*55p2wMbp5w6T zMl%X?-V(f8>4ZNpqeopjB-Z_*@Bhds6($xzd4RZ1rDuzX!@^qU`#)6}tq8|r%IfS% zw`1&GQrb?^W%!Swr|wu9t0R2V{O@w_IW^AphiNd#Q|~GN2O}>Y2OR6__G8S2(_c=b z=BJgMbU4DYN+=r z1e0|OVS@LzI1>*J_fsOwmosjFqeJBm_zrRdhqQVVeGWIof9&zWy<4>lwihwiT&IXaBc+6S2b8^&nz;G(A~zfrBjilh9BLG6(9QYG0ve7Aa`h#{ zOSLjyOlyBM1!#-)0fDedt$$hnr`!)ECSnLzT#I304$O6$eDFVD|EX8<9bf!|n4DTw z3tK{z}2T3UF4&9Ci%?__#olG}km zoZhuB*-;@@vClW8BRuFr2xLM)@-QRnattwQu}M4Z9wQSM%#4IDIJitAC1z_^w~1<` z`YF=K4;b!^icD#VutWeMiij|&@a-2A42++}!O+?-rihZwXT&f+|Jl>Vsxq18P_I;` z-TFYjt0tGbZXT?Pib9+BVbEYG!Pz4x{JWX&3jiT+DBcTm+oO9LcGF%Z;Ar_Ci`Jm# z11e&vs&xIMr=PzqNEDuq2D@g+r_)yY)2f$(97kq}afUzI#jnGtonQGQ>He(1o}a^# zf;egf0JTxNe*)P-ugc0J2xfbkcL+W zZV&BVa4r?agtcxtj|Sv}+M_-*v-rdbxFjs3^CZ@)d}rW_j^8-F9H*X7nznwx>BiWQlEdL< z_JZStumv2H{@s3yY{M*PhKn34f1dAU0u`olWm$9!KDO9B(C{$f;*nu_F>)zv z=!b70N>V95r)T5VV+JQ%a#sB>_=8|~Zw%W6$qS*;!tWtBF>ScG11IJe#5J{+KGgL* zpFQ@ty6@WrhfzE>uC6BkFk|8sm}tY8D3~Fk@BmxUo zGrZXG*m{i58igeU*faIwgpRc)8n>+9VzH)f+N7DO?;A#3l7%hIU z;8|7(FRQTmiJ2m6@BSugHJqkgrrW-vvcmEpDB{+YBdI@O43!mjG43&FMGR2*xo1^e zP=LfK5FK>sXxrbLs>apHrG8Yk&s^nt}-|F{MnOch)c9$bv;icF)LOd1{( zX%=j(>pBA~X)j0Sr%zludaK7_QsVcTP$Af4yy+5KOkRymi#DoaD!`R>(WVPvx(g;) z@8cR{uTwHxP?|F+(zK z&#vn0c$VD!%69(OK3A}%=|B{2x>ZAZDrs;9<6e7QiB;MA^svwa=ln{J`l=1bJ$i6R z6~CiEaG7;=C zW@4Tfz*-)12Kp%z6(&AA$%Q+@!>&NAJ?+#^Vp$PZA{!igBDnet<|v{O#yjr z1}8bcK@?oE>4^5nOZ^Qfzrz=?hGkLW>x3JiW62W@8N{y*kVGn=7r+P)tFWSTU&qZhe9B)4#TzNgV*{3i-RII{p`F$H~6W9lpmVRx?~J zm>+W_?PZW1#tdaL1Oo}%)(NiH=84p&f8(OaO|i9OoK0Lnr^$5X-EHYJcRtslKjQIa zzvjas?pYOc;!{eFelr-cO%K8K1Is4IvP|6{Lm!GYpN zUsf;rXJ=r{urss*;lT#V0Hll=WUgs&><3~TRZ;Mj3d85LDP zUpBfnk039STD0LTfP9F~voqWfn3lvfmuNN5pZ9Wq@xF293L!+|} z!7@IrXu>RUMca=R{ejh1!&+LYZpwDMpT~Uh1s*KSaY@{5Kq> z^cah?BOR>WeI=QSMKhINdw*>rQ3*PQEKi50+HQQqJ(^b>bjFm%U@8+1w>Lk@ds9Da z{B}jgD8&x1#!O3(+Bu!}Y(&;qDshKEnDkoWSr}pu9lBy|qWkz%?pYu!^P|cTT7Wr+ z2aqqAez7kEb=1STIv;XwORNi@1##7prjhFgG+mzDY&?HlvYk|#czMjDat)2GKif>r zcO2!}9zb_~5)Udr{}m}aK<%^flIb~cf8XWfW#Pv#^oX%>QNrn`(EhF>Nkmfd%N5a@gW)6 zqn6e2E_W0OusC??efB`C-Qk4IN!}3*3%Jwie8%H>yr9|XX(VH|`L?v@15*9uxt+sd zIwAqd7%#0+FqtL}*qJv&2HpI^=J3Ee_R%oGU4fF`5kYoE#O+T12yr-&#Ac<|`ic|g zgoznHyDj+-y?x_12!fo=#8?=1b5z)>sA@|E3ntb0!jLqcZf}l$h0I$o&Bx~9JwZ=ChkK{xzoZ5>9cNUh2?m+-+Or}`6gnH6KMDUF8EZY`DFJkx z-i_aoly~mk=a;d48R!lk+H(u}nDJ3uV(k^ozS?3ZEtkT6xkkIg4*O3Rw}jq>!xDZ= z&Wmny*3>s53vB@VPTQJZsGS?GC__!=@r z_NszuTDK)yQ-i$M?oQc^(3V*H?_TvvpS=?M>Vp(JT!Z+nenDen`A6r~29dxUgmmv| zzvQA&V{Ih1_T!YQgY+NBo^}Id3rk(573XWk5#XSWA7%k&g8D0+H!BqX;R0x#7xu}3 z;)WJgMu}N#3RapK+OHL>8DvH4e9?GF3ul2QcW32wV}4sU$$<37ea)Wys*0R_{ zSss<0W4@<{AtwQ`9xFdK7M5Ij9<5%R3HzDKXF<@Xqa4=<>RFY#IVbvgPUk4~+=e!B z%xLN!p)c`M^+-E$@uDr>p-qEjnoOq?3sNcXV2u+3%B1Zgk|>&r=Tvgu;HwYil-HX~SP(CExjMP_io#ygg)|d^4+tt7AR4JSS>s%B5<& z5fSZbL}k*FdS?G)f;m1Q<(Zqc!A}~UW(2e9elttW+jncCHC8*Re)2eJF?rp~Fvf*| z6tfp;IvP{2w`yMU^2jqs0oSig5m9^ctcBcssF^Vc+#vJr=B>Q%?8(cJ_i zm~Nb=+>W%Ss|~5il8o@ltn+G0mn*~Hee6ZB2By|}wJr#EHZ{<*vJ$wcp}Yn0P+hv4 zxN)7P#_xu&;k&{C!8OtS+h#|fYD^ECbLb~bt87BwJ=%aX*SzP!3nzhnw*N^y`)dFR2M}WzK}p; z$+SAQAlw9BZCSf_j+{r4MVT-4-Tr22c324~N|KZ{75S7K5UYUBh>Z%4h*DZVV8D({ z(9!B~BrJC8B3Zr?c=2@k#4rupn5azBz8EFOxNEWHx`s+PXPnKCG0XVXPKt|&gi#!oy zOG6Sbs7aVq3%b%U@b7$7zoiT)x@6WvR|UT)|9>H=tT)f$VOKvhR$0`02os zzcw^Ah2$2}~}hPlZdsEPvMOkTbn3!m)FFe`ra!XUW!JAhdV)g1QZ$ zHX^}8I@~O=nE#_{=}YJ*{@~l;k2nuqH#+*Gz80CykHD=6v}%UY65mOfSCg!Xtdl?# zwAb0ERxd-o=MW?6&7$YiA9OBKW{dIBWdh|9z<^Y~%Xybbn!swtUlGWuNtrtR-=ug1j1|QjhXP{@X0WOC2ugk$%rskrsfY84Hh(SJ60F`| z+7~jGt0Ozre6+E0QuXNYwa_JUBF}^UNjllc{T*ap)3Co;{gCengNlYamSUV}WrXzV z317S3>WA=W3ne0&X^u%d6iK4aqCXY{@HH^O_j!y{QWIEv%8`9DXmkQF#y|I(biPFI zz}JEb#Q1c)J@Y42m80+@K1T(Ir{mB8=ex0vTpt)qzRMy~svXPjX|6)2?uxjrB9F4@ z{a4-LJ=lxUBAO=?Sk``HlXu6_@kvGF$V$|$;?~c<=oJbs>ipkC=A@mcEUl*E#NRPY z#{F*+>^5Vz{n%G-_>KBs7Meq?Dr52_=A(i-;PF3A7_M7p2xMn4@|4vCAaV?PNWA1&4tFOYw@hHw=~m0@4TGhMKy(?^-!sHU=Bx9)cOpo34WcNG2pAVjk;vQs%x;pRnd^ ztZyX+-`5-w(O15|w~TxBCYuQSHVRKv${jc$+4d_`I*FSG!NUR}HkS03?NsOWFDaw~ z!x>rj=J4T-z}e>biWyBasy~01hM#V&j*n zt}dPBVxqDRoO3_<7p<9|+&%`J|B!Z|o2=g1H+=fwU~5go!Hto|`Rz1BVq}LGyR?-onm;DG2<;dVX(h%RE+ARjLZlH zD_zE3EyYxQv`nPR{sr{Y2N%hCxsEfR>{ z>DzS?WQOKztz8!|U~tL(JVaDIH?DZ!UVxbg7Bz5xUx)d#$ZRK(2tTI74ysG8Zn1Y2J)zAkFX-o0+R zAb;FWj*XY!I1nizp%{_|i@EA=?!}ZY1XyyVMQ*%GO8M$=a$c2& z34dMZq(K`ArdgEOomi`0ly&5RS*!~lmhGPx4o@MPwU-@-SFJTJ+xk2xJ(@*l=>o6Z z?3v&7Cv(-(1eqkY?X=sZCnUw($S`-eMlQKQnT(MSwA)<~eTW{AS&zH*?k3n+LCX0( z8CNzMl=!RT+383I`t_)vC=x!W#hC{UQ5%f_(dOgvatAtnfKqXVS?G||+WZ0pw=z<~ zKgTry>W7E9I(zoCr-*OI$0-EH?c`B(o* zlblw2!)s87(DCYg2@U9VVe}7&uCa+~p18lH#qArfr0?b5yvgBHM>MPnrO~|wuv!|) z=lT#gT=bW%)PqBbF*ee+HU&@9I-UgCne#0Tt~;OJXXz4KRomn@R|GBm1(F1^pvh5J z)~4H-E7I}*E@^7YYRqVHK8%5rxa`-OQabk7;|yJ$?iPD6&8UqwXubuVVYk`um=>6d z*d0GvzJC2yfcwZFwFl9^Q>$KH?93K^AWGI?j_<&<{3{WNEy?e<+(`fvlz4LdiJ(dPUUIV=`-)(y>v`W^OZC3>aGGX|MhcVg!mK+_MSAm@=JDDh zI{oSN=C;pI6{R=aNEYUW^Xo1(&~9-^y5r3kHT3a)i9?6t{4QK@304V1aIo<3`-%bz z^p{XO6KcwN9v&q9CS9-lk+g{CvG_Y@Bh(+Oo~RI>vj=o0xxsqm_$l=ITBd{qI3@g* zHn^8aNRSP#f2C%kEFA97<8>y(@Ag%Cv^Vj7sM7;2-OmNEndsn&+?|N2?qIjV}MVWZ~K`lD#TRQgLq*XdA z9cuMO!`*=ALsGKG`wyO9HITrwK2w;z)699(O1ifSvA>SaitK%YS6@1#5|RmpQrFD? zJf_ug&~aLwW@nrDzkE56A$n>9tf1! zePEt-G0dB=B0|x=hI_k}tI{d{mOGg3YnY`1Qpe4W;=`80xE6W3?5~kSC zoSToz2I1^n71>rF+;h=;A~&Y?PON|K@`o9f4fB0bKfD!iZd=5J5b5+aueR<}o02E7cZ_AEq_i6mxmQ0>_X$#C*CuSP@iso8~u&i717`I*sU+s)_khToeT za(`N3qW1Phx*|3(zmp}_jyBm5mK;9Doms?7g$7g0i-XOWAgxu48>;g>Wf-y7Q|g_M zJG7l6vtR1$XV19O0DPW$_z`;2I zZ{=sjtf7Tn<9qD}1`Jhxm03k(o+zs|SH8Hk8ybg~iRK!%R$PEtAM>2PLUQT@kW#4Q&A4#$JX7wejjw?6%mr_Bw=%du+rOM1JUr(Q^o zKE89`_FXowZ`qFX_XA)1dZW$nqa5)QC{F&lOJ+4tjLjT%t9ajh*IoD4NFI#D3M1G% zEN)mF{{_yvyIj(LghwYiQyFx~$Vme^>j|TTVh{7_jAkPEZ7CgZEF;S8LE7UEPrCD{ z{{-~y^04{HdYuR0WAX1!`?{NBAsB2HY|f`fw)AABmIxdiFbmxLFqx%H(Ke(9Fv(MM zab?3bawL2oW%Q3JI|DV1Og3-O*3O71w9~_o9hCT#%~^|yXB$?h#p_l907ksZU5cw% zX_?5=O}87)HI$O?fV6E^2lMg2M&EzU(FFtpHjw8@qDmj_yYzVw=k*KuY~I~u-)yK0ytxIm8`U)JGK{oMgcBJ zFg}q&uNlNn>}#EIBq^Ugjr>i&(3!ZkQ~GtlFI(w>R3gN3>FhIAH5-b#h+-5`r~)$K z{J^hb^c_h>qMN{HcDz2nrcW~_<0O@BrNd~EcMurES5RrFlcAqAq$Z~5;yIe*|S94bmk z!3yc2&I}Slwb7%Dgmd++|AOLY2uOKKpuu3il$s|taW46jKN)1CN3fCT z;EBFIE5Z?yuocB!R(Yr0W;NXHKE+ud83FmKA;vi3Bmm3{NOt*fvYO$I!@G1xzn{W= z8-zVP9$nh=SBYpH05CiKZ22y>>m{%2Ar4j{@CfHF-T1o$seNDxAK!!sn+Z7KHpR6! zxwlrhYxOiWJuK=kJ_|Jd@c)60h;Q#ycVj^L`VHaR`dN#Wy9esGfmm-%L#~C$Kaec} zcy}+lId7JHPWXXQkf?+o6xwYFwRa6DMW*1qP4QU21@1>Hh#jG2D}moLbCId~q>+;G zS8bq%3%aDDU>hQJD>Y5lvK^5&jTu0YGSfh&4J@lik?|Ph8iSyJmN&76L<<~c?M!## z$th1N!FHqBh;}J?FhTVF)Njl!9K6k> zSWZX9{c?}ihKcpRf}CY5vy#RJ?EDNIZUX~zo7f|rkFt*lHxxs=>=cmLmDFF~!B~wO zqNZCPD3#(B+@r$LsW_Q4JbSP~>Lc`m;ZA0EeAxdLtG+17|5Y=UZvLej!%?H!?Pmil7-58EVF?%W`qSf$F5ngN2PGE9lhXwX(*Qd zNa?0UPo|B1brchn6M2qkN?}BxQ#9SGeS?+5sGB-rGO{Cug{-(US_!3LXipnYi3Q-G zl`u_5o2L(DE2Wyj!?Q#cknE8vgK1*4lE2!Zj@!AZ*=j)ty^|s}SI5i>Ie*j8osrRz z3i2pV7bPaAN&8w;_9GWz+BpoS2q%L(xxkMoo{#!f`W>O)6Gy&Jz2$I5QdY@~G-wKD z_UQmYKtp((AVwCmqq#cM#Z2u+M+RMYZqALV#SDHPa_TvGxp(Ktv9znD4K2(Pvd>>e z>)&Xlj#zZL`W9KeQkaIvgGqxly(rd%hQ_c`;_B`yrq*adc1Hb*@;H-hSV=;bFF(@3 z@~x*8i-Oo=MqO2!%xUaaD<1ysc5H9cVtf+CkR!FCneAw;u;tCmKK@<-a0@`wf9Ow7ta=$jeINl|Vj6%xD7_8d!{99Y5n;r}V?SDB*2CbeS;2fhU&bX~hv?&$N;R*SHUFS7L8OjxA z6ORWFgn@#Y;oEpj{wT{7NBsz7obu;k@5~=n@Pp$E4>?|{Jyl0n(e@5FaSKs>C?i3v zel@U)PiB-JAUqI0KBLS`3@Xpq+T8||zy>(fjRQ}d#=rr?Te0CWwE11ig#P3eumv3( z8AMp#`umJ_Hz6@c(l{GiKh`K(j*6Eztty5~uik47H=5Ha$AV~0QJ#{HH_J0VsCooo zUW7?!Gv{YjWU-sD=km3TsP)a()>cAJO5`jh`IX-7USWK$BP;^^XUIT9TRU=SQ&c%Q z7gcT`Zo2&PlEwU+ZNsMP9Q&Vl?BZ~jj}&qm&^a`42;AF#L!lN@U3%D&<7R>n3lNZn z8a_^i7kh;^v+wxLj8YCSteTV{q|t-YhqVf5bFal4Mz56Y!2z*xa2SH!kn?H41MFsz zmWqo-U!!TzGq~$13Z_;USkp!=2T}zBZaRf(Dv;`z zq|WQSAEkqEkdl(ZdHF(Q(7@}HdSkeca_VE)jt1B}Q)gdC>86gS1G__i@HaYOKFruk zLXEUzI@Y%0mm0b$vAeXA<^`ULk^ys={U~3KJDV$4e_wOJnv!};?L6t6sdwfUAyIp^ z$*6la25||IB)3_%A~HB1Yx#xiNTN9$aOFB)Q^6Sc`TOn%HwVIc^p54Qr3bBw7L;Nd zBNx6p2wtW=#mMNhd7|((p$^)g@1=`QW4RrFcmy%bUPiPv5)@*~tiSV-%$Zufz;yN= zkgJZyOAiI~_4NU?v{Q$s$58i6O|4N?oY0dK`@c1Y&>~P0 zhHb+$xTfaZRC|yOEtN%obgs_CNgyYE=S<%;yZqRwVP31#lfAgO7#;yR|IoWGb>y3Cb)tT?y}eylu~2h<#ckKJIN#;-kLV$Wm={A` z{XxCEd$eKRwz0Xn-foeHRv|N_`tXU-&~Un*2|Ic~tIe4Pn@&+8b=yA$W@#n^{ zO$hYm1Ll3$B(UGO3_pg4bknXkMY+4XGc`9auv&0RNz2K3BL4nl`BJs=L1@h4I&Kca z;YPKdTdhiiBCk(_g^^E$2X9=KA(mWHOhhzTvG52CI$W~y$6lz=FVqqyjCfdZ2j4{M zKJDII=rdZ$T1>J4BEhm*22nmaQa+$DGLl&{TC62NOzlry?e8YItEgm4uCNM1;o}as zSS>DDCOm4q=&KkmhkdwjW@EZKt5~xGiGCxhNrH-sYg4{5P*{GY1hul7x@4?mM450v zXCpjDhWRDhsC`BmTp`Va7mXPy@!J)f$>hb^I=w`c32Qz;bwEtDP{M@WxQ?D(VdzL( zS%MmqD+ysYF{!QUrTbKPH*4>CX)?XJCqoN*E?L0tsxM-iD+8$S(d5VGCZfbrom7B# zXUxd!s!}a3G1nJ&E-tqho*1m?azBhQKSuf}F?d{RNE$1wt<5bp!7Sq|+i-zoG{&Qo zpl*7}NM9(bk3Czim$jDe$ zR@S@kn!C?8G-ltTs;N12@TU@5u~g4A{rB%6y#ADNw&jQT&A|Xncm=mQt_KneSfGNy zT8);N`Cs;`1WGSg=B%u(1&$v^+1Fm`hl0z+`;Vj0C;n@eb zfH9BL*(dhZk(KT)4~!26JI`R)*YKAk)9oZP_@Txh&acOq%{~Fk-CzKzC2(Q(d4c>! z1XAzVrWZaon|DrX_jHB95zx3~!LgcHqVNy3satP>8dvVqDEI%#eXtH&&1zaAg zvC5>6a-MOK4G``bu7|tA2NqR5C&MhKr3LV>!+rCbp5gpfN~O$u-R{C1)i_rcpxvR5==cEpU@EjyEIUeb3S2uHBT(N)9nqVr9uue3`$G<4{|vM1n_f7>%|oYU{|I#(6LUd*ea z#i6FqeQff<6GPFjhUNwD2qz%-AHHstZ%$6mt#7xI;LaW$yf7sV4cOuRfpGgeO4q_o zp*{_snPv|!vATVF7SC0=4EJrX#zsSmjE_f-^Q97*geCw`6s9Aj3gLN(kHVmfnqUB0 zKLyVF^^3cE{ch;}QFS$oFL0G|T>D-R%MJ9Yo$WYE5a+*7(- zWc$ztsGW)u-mjG^si#MhYWB|vrXZ&R6_m{^f#;?OI)Ns^tH4d4js#=#<{=P!RY_42 zUKhHlk{%ws{yja0JAw(ItDF-rTEp_wVjI+$pMiAs;&2#c{2UjLkm0{0!)XUS9M4KmPm=7XbDWzI(!Y2dwOb3gGAN!!1uP#3T#v-i`U_I1sE@z}sXy9Hi!U9AU-M1e+-&pShr5Ze<4^y?dH#n6{KUK($!9%8 z0v`ml(pSE8tqLw&{$$M~>*T=5ds&0>FI?75{FB^*DzAT?Z)7d&&p;qI__@|;{#13hN_zw@VA-JP_c8Dm3hZ*QNdcs=`eT|S{GH%;Jy8g#H< zMoEH^w@+WH4nyIi=eVvqM|>w?^M21yb}v> zKV9bkmj>Zk@Jbuy!c(Y}GyK1bkO0KVzhC|K;w&* zp!u)pY@JKs;OjWuXpGzR0$E>9derQhm9SF0>*PZ9h8(ERL?kzGLO$rnj}WJ%>@8sw z?x7@o14Ht{sg*C%s&i6O{uus4BTq%$e=nR;#cG>UBKBz+2BKp?j;p|STzn8HlFu~h z>msl~RtPTkXJf?9%l;<*hI&C#H9Sg$A(F2{qOl{ROW|0;1j$|L&AiusD=~ zX-1I^M~s)r)(ORQyJ$0&V&RXx#h6szv#*u_Df2^w02T<Heui-kRsp9FB4KyprN_d#xETQZJmi$((pY_QbIIFfN##P3hz_>T}Br z`zXY)O&SS02JhaTc#!Xur{RCW=TcH>WAq^s{2h2Q?&7)k$>UUKU|0JS5+wH?6Rx5{ zC_v5#u)ce*8DX!MZ-7D{@H|_?x%X6ig0663f@}BmNUI& zu}>7jSzDUq>zS#(pC?z$%eftCMoU8M2b_wR$WXs)OQA?RA-_wb*2}KFBIGl&cv|J2 zTw$+R$-Ppel_me})=>XWWM+Y}E&m6>t2%Cx(qDLFjWPWGH-zNKf0ouZ%lXgDX2D)4 zFijqN_A%$dvTxtqxy}JxSNxyL{d{dJIWtJBs>SCVT4Hm+<+zymer-+-$J_8TyM05l z++IhUp)r1M8@hxQ0e$EF0rOHD9kKbQ0-ygZni9%?P6B)es<@>lexv-OyNt6UZeZ@Qw5so zN}v6wIMeWg<@S>-hRs@GL5bd(0fCl=KxES9RN|~q#^P|&h{;CR_mCN6TFYW%S!+1S zfB;L)eJi+4V8i1JnS&kt@xwXZ@>O>=LncdzK-x_8+RbitkBX2Fb~!qCbv36%d7pTL z7yDBaYC-g9*I(C*{3rYEOC>D^|I2rNw@GsZH~VvqJNz2pYe~h6`DG8FuwQWWX370# zWB&X*lQpy1lOhVLF7fBb;AuVf1OXafHWS8DP5tjO2l()LycWw%Ab4{oig0Bmh&$Nf zKnOmXL{=eS;PxghmOb2&+urnK)E6I=F?@Lu$si}e+q}LnG+VY7To2&r3A@FbKgGSl zv9@$XG4xPcU-MsV&QNoO50p&6bQeG``|$5yR?wJ>&B!NPQtaAPjjT+`!kzA&A1u=! z=@50VYbDP~{DQyI^PEuE4((m$?#+&8@9Cn;8S#mf}?B3qZ(4BszO=qeX{9zZH@fT=0nn`je?GU;4db~a+o(kIgv zv&Ox=+gr;opcT=TV4d?lp-*U9@;qB;t88A4UYzNeXMX-!((CEaXaiS*d$}jcHNJSV zz0ABeVk(Mdv2u?V(^f?&KT`!naGE0FR>s#J%JRD-l?Wk9Voy83Lj#PY<5^teVAvK@ z6ALFV*|jB3b}MR#?bSUrw_2fl>F~coHCQ!3br;tN8Ou(u8U%zoy%m0qKjYljMqFOu z{VwL&*e-!#$C`cmuRN`{Woch)#I>Go*F60ugs^KPIy9C?9u61YcD;i+0(2G zLyDFwNj=XSu`T7BFSgq>)oWucKBrwVK@w#psV15qO-X%C&_$7nr)^flInOaqp@Thn z#HzHzL|kZN>F!0P)>Qe$prFnJ-J+QvYK`#|di;OydYtv738VS2q(Q=Zd%&PCL-PRS z>KtI1eA)c!1O1v#G0V;_87oCw=1uK)HhA8@Yg6AB8a1X=48pc9iOvik(Ea$T|guTSK7FH_NFv)JR&@P=zALw@%uM{P`4-@7lCE zzDo-jzjDO?)|}~%bgG@)gChpec>XRc|C$~bue3yeU!XwUS_RCHz+IPb41!%~uW58x zKFv?QzWQcIkpeI-BJh zTyN$l+t^!cO=e2K^w1&;GH+ioBwYD+bN*>~Y7Yn3eag_X!`fWbY!Z@4iuw5pLR-gYPxQ39;~b+KB7qAdR4tW?P2fa+jeW@% z_-w1M%J2pr>wX0^_2-)=_T$CD^G(j^mVpxNF5i$KYgs+~^ln(wfi}+of}EPLWtS~e z>?O#2(=LS@M8e@r&mGuuC;x^z=nF!(O53F;?h~h|cHD{DZ7QM0Br7+$c|38k_*Rn` zUW;>lG+8-qHtXL2EWfW>KA%CJhg?$#X)cKjZPMId9hap))!IAn4aaem>&x)Ce%>0T zrOLOVn;RvLEUZmUluepiUKza9@;8~~Vy^c;^IrDXN3wt2<@NzXkOk{vIL|7&gzk;) z8Vk~A>|44v2StgDyx5Rwr{w}5Twr4j_C^zC)7~N%E)APPa51PR2>TNAJ7@Ir{V1D! zO>+Dsvu=m)ns0K6>>q)ryFN|5g~kji35hRpeCleYl4Sm9`Hn5lVhb#HmYH6K(F0qd@f+|TS)QR+ z1C>2egnsYvP-OR41~lv4KJ=c4$)&jwY!N@rH&|`Gn1xFk|7fdDGun&pSOBLjGQ~$u zvTa7$5q80Q>kvnh>WG+Mk=}A~8AXgy@DIsLakBEMK}8FkugWx(HiJVlbQWgjg9%sq zX3HR9^XUzGOveaTVz^fB?@NTV+5>vB&JWY;7YGomYzNYsIgU72y^rK~n{V09nC^oX z#)QT?ZRI_njzMmWMyvc4YBg_v`?=IHMrp_B-47C>frEoqU%0rze@)19Jl^Nwpnl;4D|Cpe_Lk1ikPNwB9#tbQm~2=Y0WAB1@f>Z`-#$a>@os zqu{Ft5n+uepYJBHex;2H2oTEy`MPLxVX`6pwpkgB2BE#lg{H}d()01ow1k>6BF*TK zFGlWWYz=v_-NVMzC?tcKJ46=0No$Nr^r55(K#J%f4|Fuh`=q6XE9~!8Tert;Ke?!g zc?q^r=*X!mVu?R5SEZ@Zmvs1}VIfee@I0fnK4nxWr|n(&kwRbI}F#T(svKv_RWp+?UKfY=uo7h*4R#-1G(z;C&kX71!R z`rd5BE&>jRk5wdD=evCn=>bytOe|wH(lD49Gs zI+dA^)FcC>ojQJk!Vha_D$8|0+nT}fKY!ea;Fgu-K=MI~LMe*o_Rpgn-v*5DD*=al zBWAZvW|yJZSbK0&u+qRPmqcGky^5Mza0yg`wE2~O8$#}tw-`$wIuM9}(dLa~U9X|s zCOGIBKX@SpgFAC3+@wSIYVCG*``*f=rj}Z{Hc5ngdHY;>>{6neNr% zlkW5|6e6xv=RUltW?Pc8R=x=LBs(gbhOZ1{L+i_8x|ssK(L_NSbLb^dEh$pwu3m*) z7A10G8#DXrU*&G&I|PF>Nm((4e}fZ%h`KBszd*fw0U)?vY<3M7d@_lAAf}ht2OPSs ziq^1*P*dY6QL$2(oh?ZfVEoUS1sP`@6*6S{|K#e4OSXWRsmMu7PD zP7yUKuuNNf{*IE6$B`Zr(Vb~P$?o}m+7V(Nh}AX#FGi25_|%_5DgtBDmZw_s>g4qq z**%r9`FctCq6=O9BDAk9w2$0K9L41uH^VU#*E<9F zero(q@!fvVbmovDCvFF6lE_lX-TgyzPj{(HdBZc|4;v}aTg3w)MKdI*3sDSJ70rum zWYM6m+(ZTw2toA{iL1-JHUt3|G9_1A-p_~K{$@som^{!<{_IY zf}Uwi^j$OJUkkqL)@(pL3WuH~@Oun=n6%wyI+BHvF)Nn68P|foa1^GYA{A$Bd*`g( zZw|J-D*qo!E;wyX`ew6RikF@J8_S%m1mfUI$}p(W4%{9TgmeaI<@g+kB;5yYpH{^- zKuYqzVJe^`YaRPVx#U1{84Vg9AIQC6^bh7Xb643)8^#H&erKWm3g6~`ZTaUt(~f!D z3tH}!mzPPY&Liw=^2(sv>lOX>Ow7f$Nj1Sk1at1O{zy~ZSH?4FMi!I$e$mlq)s{qC zPQC5K$JY~li^aOc6MpweA#d~?koK^}Cl%QUDVcDSv)&moXX^MjD)*SaqO%GA%SJq_ zYDDv8*mjbr!& zDZK)*|DB-ko1@zzymSPpOfMuede}Jl_}wmEn(t_f?TtDzKTov^!TaBn@GU{YwAq+q zNQ9$GANSRSG{*B;cE8B-r)}>G+rmC!O*E;8teb@syRl$OSHA?`~`gHtpU& zM8ce6taK64BY_ijL`ma{ONeszJUB5*aA(>c8T4pi-&ndr@FbRT@sBKP7`Awz0`h z26*rJiNbbwV-H}dAhDG8u*GIdLJftvQP8TrxVr%x{l~c{-5&X*dd-Q9{}lH6-En zTdj11JLWYo0%18cM`Hh@C7e_Ez$CxrSEd3M_V%VaHxVV0soxVT3*RLX96YGx(5Jxe z2t#;f*#mZebljA$;FWa+GRYr>AN&ba`<6#+4VqBK`afFR`Gxf9GZ#4AKpNnqx2*4$B~nL34okm1Y`CX94@eZC zr%z8Y`Z1S<-RRuLaz2VsCsKZ~z8UtmMz!V(9|(7@{F9S7Nqb-zL9tL!UAqG4g&~Vt z653eVDT^e~h@LZ{p`u8mBy*`f7Ip5$aww^(*{6K?hU~7aQJYenjkR#lH9ITfESUiO zWN8tHv0;IdL`Y#%tXUw&fGNR=;=(B*$IeoQFAtfk^7KVcbR}HC>Wy!9WIV#N$*(fO zBZ(8pbD+N|Q-ViBF%+XHs=}u>{`vj?j>Do47cu_Ot$4j6Q$n8RMie>D`I@p{@Ag)D z8CAloQs_W5iI-s%_*?*d^%Ewy+F*PxPreW0ya~8FTO8yj;~4NeG=_(K7oLIm%AnxV zwC+7r!|ih?Cm+%PRy@((1Rx<<%o<*3*Ma%@ZzBtDF0j><9p+FW+f`>3U=KUKl(Q0W zK)q;_GTeM{6glL889_ja17fS;ct0@iNWH`2b;ye{*q`&)iJjb>&ZHokhMPI-PmKq5 zTFfts&{&eQ?&IZ=fS9>>6?Fyc6*Op9`T8wAHRhSq20GkFI3FGxq=NFTk*{WA(xfkW zE|Z&Gs%OQ0nR=rQ%_1@qptysi30vs|bY_YvnjC8;q(KCBkA3_QQ`%CUM$lt+)PTln zdoqeJqBLpgsn=}?Wl$C-SdVZY{JXiWC_Z2zI@(ck)=t9;0rA)uHF|_fPc5v_nWQE1N4@J2b*39r(s638oO*~VPRN7OvV)Ofu_nog z{cI-$(R12HFU-x$PTdJrOgz*MKo<`dS!yBi383Xg(gmt|MrQ5WL>QNtD3rGb9$YsgLv3|z~$?4!Sa=Jf&K z;KuJi9DDvpe|mc=p;2f4w}ywfaO{dwu6dFCKP#?}0S<&W3&gCLVTP%ar0M?|JN`L3 z538?w=k4i=EDx~+sHcnVf6f>bpZ})g8yRgJ4FB&T&JDf`>|*{$L4Nz>|0~1)e`)uJ z)e&AB^O_;iw6tHrE(N*iJ_WzblBIx=rC+a^{^VF|f=SX)4BtZGq0FtOZyt5xA?+$T zk}f!8M2I}^Mgu4(CymVw;`BMtCCKqqZc0RGYH4VC0;O`vHq=)KA?;)wLIDc1lbKI= zsg5B?g?HnpX{~)sx@{>*ffR-_0k99IZfvxuLv{=udI6(j3W9-%F;Pa^(4F{<8hAAu z<4DQ3pJPM#r;*mZE?28iK1|k;aN(g75R{jJo|P_de(^zGo`yev4Og(_=R5WJX8}`~qv!?_TwW(y^bl#EKzWB?=>iG^GkVfo`C@8T&ym~DMfnZb z4n{HdicF?b8J|}GKA}la-eiTJ$0dV$(r3Jj>=3uW88bTK|4i~Q7jBG!Y<2-uskX9)E4FHt!7r3AATY(-mY7TP60rWx??KeOR~Pr8psN$)m_GK+1iq z()BJ>h_t+|_zZ`Y4rHM1oPU{<_kE4}>f_PYa7x9wq^&xL1k(3a)1F2FM{6udXxt0@}ghGx>=vbEVEflkr?-^ENtxj8+{*HeIK)&G~( zV1tQ;mtx8UA*ghY#aKtHiMO9qv^mR!o|K|Caio?nx8hmI#5uS5cB#+frsbE9t9GO( z+1X}*ycIA_YZ3=#u!KXo*{>w%;(QXO&-vhyM-Uh{rz%%v}g-G%L`*y19W6t zXx^ZODkHQp8z;vxbbsmlmOf9X*%E944`hN-72*SI@Ru?UG12)9{bpb!rL-nUV%UkD zt|Su9m4?1a$KrQUWVSzZ(VzbN6*o))xAZ@l|1|MI5#FwVpG(mUH)ljSeMgjPos`6< zJduky0=IMZvFs8~Cy6TO{5EfXEMm0E#rn%lWU|TZR7%vWjJGNE}PR257*R*;gB0ofKy&qoVD}M1Svckp}k9s`SyYU72Mhja6f~~~n zQ`D;!`v4bDUep<~Dw9Hqxl`@DcUujc#RHTu6TPUzeiszld8$keR`8c0iKTjVNck2N z^$FC#xYJHl3wfes&LawKsomzI3Uke3@t!~V$5xAyBdzeAVQ>8Fhlg!aRrhmByg0sb zalKrm7dJkBV8dy%3*S=lFBoqTec)gSaCarx#@)dInY-t-eZ$G{VCA^>fD)9reszmm zUgdgYhB?|87ndT`-yF#=aRa5?OHXSwnGCX8`B`!pjQ{Zh$QzOk;TW`~77Mp_lKIzX-d4t> z+znGsO|Ux;Eyh?5j2Q#_hBiHs8$9~+(=V-(`6Fa28vS1JaNkELYb`E{`I-_%U4FJ> zl`2RO4Mimi8ja!l3Aw?tH7dle2o*kb2 zw#>4^jez}o=4uw%zOr@#uuY}m=;uid zb3?y-u`5|pbt%($9bVEO!5!F#4b&R4jv1i_3Z_o*(%H9w z1Iil!lk8Kpqw-%gYlG_dZ1Y4{x|aLQu|`Nn#_uKc?}vzQi{5^P=FV3}s{)^UhdjoL ztI6d=;>+xbcqtHl{OE|9OUPXnJ6q<#p2x!U{I@r5x`kgq-9S63T2*PLnMUX_22g|p z^H2V!=&IkQhQRfC%>7Ww(Kw7CcIQfENFUh?Df;u+R;eY*o!{4ZyEh);;(}^Zfzxwi zkKob(ha-fYmN2yk#L4-Meo5V%K=_UM$?*=cXL5gDV`#Mnm1Ek*_@x*Z8VDb^t;9Og zbqiirLb-awHC5rVXx5j82XvU`5jW#;+ZmeL(rZz9O8sPX6{we&H`$Ps{R)8&Mampz zG^WWfalnJ*cA+VI%IigjCR-P$cUdZuABIY-r0HqfZ7nsmwBTU6PACM6KT$=}?Zw9( z!Vpt>P?i?C$xx(_@M|^aCbGsC#uCuvkkp}KhUgC7n8LSt-6IIpFZ6L5G{@EilA;9@ z&a&Jsr~wp`JNpwbu5eWiHCGsX+;ClQJLIyIyF(i7D_s%$oMG;Dxxp1G2 z>PgJe>NQbRvrI6iOa!~1_aV-)GL80CE?YmmBwyU?s9)`!SRYhk+Y}ZVo8ZI0IiL_; zg1a_E{YWEv_V@R*tE=OqqtR5=1h@Bce*7LCRcL}Vy)gzl1)%Mp{#ixmtno@Kb~2z$ zWdoqtOzAv?Gu26&U1e;AreHQVtF&dBKify+JSTw_@r2}uD_XB+$*E=ovPvF~G^CG@cM4uL6mSIZI)Zt(_6j49oVD5G-zxX$Zcje+PEUR*Oq(=4M?zb* z-wg&7w&4()!v4|K7ZsJ0)8@8-y+^0d4fzN5vNr$Gns@X#AGfw9jqA9JU84=ls34gk zaci2ibR<#IK=C7WP4?)eub+f2$NCgM;tIdVq5W7kT4Ml#$)p!(FubywJcv0PT;GU; z%#3NsrB>Bg2Tz*=q@r({*IWDc)MQ0H{8gY}R7|M8pVUnF7EZo#&v_|NAOIQHP@6hb z$Q_o26>-N+sb~Yy^+FhamkfU4tM(VO5b9S5gce$?{v;il;;faJodc z1-YTS-11t4F4|y{Gs4xbY~!E-loeQIp5S-YTw}QxqBrH*NzzABYrCqN>ORSl_Tk`V zL=1C?tk9jRH2O%+Og%^|%<}rsuzc)E`aRhMS}XSoyMyq(5iJxK{5BkT`p3qE&u=yq zt6+b@ycr6|vI+|e$&zPLu+qvt4Jq^bDE>P}=DhMqC$hXRRdr(9dROV~^YxZVu1gGf zg0V34XU?p;bC{Y@zLU!PcYFuzu^kb0wm7Pd8xhzh`|tuKRb492N+>ODkYMu|pfMv+ zH?uS@aFA!km)WqobjH=}=og~z#Jncw6HyOhG*w$+y5v(y*>y5>Zi4yUBZpmxfUZ~S zc_y#FwAk_U-GGaZK9mbFR*6z)EV#`oyFu4u%gb*L2d_O!W~r61u5={`B$%8I6qD=v zre;#q6h=uu50mzVLVETkxH?w~7ek`&&48aR{w0}|xn=Bj)5p$YcAVqAuYZ{+@LL3_ zK-T;EE|EF8_7Lw^^@tRtH`@o}w8Tt76h{hXUHXI^gG|>1I4VjuFtWjdu0ISVX00QX z^MKMz0*E5z#tf#BU|IIgF~ba#!4Hq5uZmqd^E74E-0(aI5Tn)=e2wfsCUzuHW)6+j}+?Xg)vY_zOS|X}Gt!+J+XK!~7NuhDw zE|+n;h(xOvEJO89`S!*$b(*3wadL=ng$!Q$!}1t)#t_K7$FbsR>F50&7u7~0{Jk^l zz}EM>t}6R209(y#LbCdV^D>0DBy>;P)keEy!{;%1S8*yxsx9{EQuiZ#*iXjc@^JBE z{`%NRmFGdVhUi9r|J1{4_RbzU2#|xYa+i zBMCd2HGrrpM)T`Fiw%MKxYRW$+Nxu(hYDi>2;&Ql<>3uAL|U`YRa~_>Gij}PVpVXpA$69w{x!nU!^CN((p*3knkdpf69(K zwKga@B@@_g-odZGpQcc3ChUsq=CJVnQ4Lxzj4`{s zfA^xuiP99Gj%`-voLQSK9Y(p-%vC!)5DqWDi%j=GH1OXiKW({SLwb*a5*&8m29rthAEm_ZUxBp8%l)Y&BphWr62YnRcIC*7xKsr<)3Yd?5~8zqX{FY z8$#wXljTii`E4P1)nIV^Wt=F1Hp@@Jk~x*R)zJdep^xZvxl)MW`xKf38Q!cEiowSH z*$7sUa34`x6AR^U31g3Hc;Jzh`6|#2Nmj-|M#;E1#PnCWZ<9bMTUc;FO}*>*#Kd=R zNxV-p?U{lBaTgKyBWFU?e+^+5n7-K>-kSIuHL?W|F_T3sFMQ`A%yqtFGxM*BnqX%# zzc0FKaI+ykdv@kpy5p?Q{}b@Z;Fa`l)fN42*_j(1x=so_bO$$sPqv9MeOYxp_QKlE z^)<-3eH`gdN6`X4C2qeH&(lfMQlDvmWK7%!?O{nGQHcV$Y*yvE3U+MV8}MV@51XWu zmjB8%-mbomt@=v#DXkzAzm5*OomjoGL_q+Z(-uP_qQCk9AW4wHQv!lx`?q=%V{#OuZ z=Bd!`PoH+XzosFgp>};O@$h;&w??A%MC3>~%P!3gyd(*B2?++`nh`PN9__o~R+JiV z`rcgxF70BfxCY%8xk&W%vREBP`5ftR$8Ak3?fd|T^oeefqSd?pfb99=GHFUrwF$jN z9}2CDq`m@^P7>`eAUDjH1QbPoUU7oFfNdK!y{vh?*&k23G zG4`oZtu-o0tF>O;sss&?)a!|Yt1>PZ?UeiUMGC-4;>bxqsDk4$wki3nd6cXKqpWzk zLd*;gZU2<2m|3X9m)BX9I&OW%Py2RL9&_+l4b9R2IY-?T_>Dq1&1q zKp^`QBtfWSIiFcWGH>~g2Tb~-RW1IOQ(~m{{63bO{Nt_3^(wD!&)m%m#Vm-F&MhpB zjiS<5HZJqH`5_TaB(LCte%5-;XMI=0z7cKDN;RWk;)xS-PaHxSI8z5 zS;arT55H6TLgjFgU?YdwA1)^UH*KQ2_mfFtED9PJyvfsKizq8J-yWjJnWyhUF(9@7mzq<^)T{g*xbk=TVP%LFyKM7D2DOiBN>+7C~DzZH)G`3 zX?-;Nm7Y3Z$b6$Kg>@Y|FQYC0XRk=tXa|42zng0xPq}#9ZkQ6GB^HBhE&sux_aJr(T zxuddQwKX(JgM<6?C@0z31{9np7pzPUYuUqCYbp}&L{DX-#>;8)sEIPmsrC9-Fj%pzSJD0|cxI&`)bz&G zg*<~TPf>Jg1SKq`Tm0gaf%fxgqQOkVx?^x%hGrF?Ry{F*N5NX|IGVZ$e>G~b&E1Vqq-aUZvNZA^F|puge?`NhJP{moezHHT>Tl+R}r2Q_Rlip zt-zyr>&6-i@h$VMb@DR!1Qtv@I`f6up~tmF?!^1sGS*idI1;oNiH{Rz=MMAKK6uTf z_|vfD*Uy5j+rK=WV_%rR2NTJd;nsJQqIsxpOxz9-)4pStP;s? zUs_xLt#+hGSke$l)6F^6M=0sB1buP&2I75XnoWa`@30KXUHzBg~Y4 z!W{btyHNv_;QJtb`F% zL8Ap^A!_yVUuS}=-iXjoTJMabl4khyFC4|d(YQJMeFq?7$lvBTu9+d2c(DbR z7K;Onv)5NXa4x9wQ=_scp&o~p&qoTh*$}-4icKvc- zRM4@;ed3oS{NniGHsBK_4@y?Pn7Z(T2CmJC$@RU9Tvlt>2c|PQ7ryYh%kD0JWW&R2et3BEqEz`GG$^ETT6Ly}sPMw^=Zec6(g7UhINyH0Ikp z+?(90U&nFLAxLKbGJW-k#53@ZsCVNAW+h23f%YC=UVWupI-_);bMdpca%Oo=JFmad^eoj^zV)TM9nZ6#S7+Gj)PrrGzVkt8?8){m z{~V8#FG73c{mu?-vKxxh(PAD`2tU5ljs__yuga~npL*6^rqU07Ej#RV(jVl<3ZqzB zGmoN4^KN~W50StZ_Dymg_uHn(^zg#TOqDj|2+16Kc=`ARs;Ktk<8Lf`Yq*TzKRlYRY!x=L@k zE&qH=RV+1$1-+^3hQcj2p32mA=ZcoRmL3t7-3y}dLspiPyaHK7<|{vBQFXcwNk%4S z4xQ?^Lug9Z5VvDq7sAg)hvbZ&9?h;uRkFW5vHtJdpfk*0$K9_&X+V?aBY?>o2lciG zl%dWe51&o<7?PY;&(Fik_6ZOya?|(*wq!KPJXWdkDXtFoy99ml3 zrC+Fx%*fdK(!a2`dRZyGYf7Wz{ZW(U>wO0{zay17S{$`qn;M)vuqZBUsYse_%AKxj z6jr4Dmj?6Ez;X{1Jt=Ukb&KuqdG5+XBRea(E-vQCf}ZeNG}goV*MaoqUzkz&qHRoie%Wm@ zG7ZWeA(FX$N|GDnC%;eV$LEDNUBN{oJ)tPx{R+B=m3Y!FDlaO?tq;PK{KAej>1YRH z)shR0gXG~?X)`9H@YN(J>266Z)d%>)qp_YGruDNWRJv(UIVQbuJN^yxIqJ)WzhziI z<+t0}ixC)kCH~k+Jv=~}w}s(t)y$JR=s>iIAGZ=J9Ty9DKl_<~ zLn$XHq_bPg+4HTTEMeM#M&@Kq3m3c0I< z?0T8eWC^z4){y`%0#E@XkjzGkP0RV}=rWX@I^M2>^7(dXu&b`$)=1=N!a|iDstgok zdhyG09OC@a(R^b?y4KtXmEeBD-9G=|;vE+z=bi$SLUqPa;XO8=>5}lDX|BLDGs?_c zt86oFvSa1O-C0@0q|wT!Fb=%XSq9S<{*VdFxP8B~N2&n7+;=@`*?H#UFgR!eAQo4Ot@~h0>a$MNovgS(ifE7>EKw1^ zOo^J!9$%aKiQMk(FPfKaq@fhJq0hJlGCJ#x6``EoPkvSqYHKUTe-Awq0=Xc}un+{_1Le zIhIx3qGS?+_0}XN7|7Y5(a}6Vb|$ts{R0@0gQAVV)K3H5M9}%8m>y#Kc|;C_iSmR3)#3ru`;zMV*VPQg&&G45z4_&)~xR0`NIZ z;qL~PZ`s;(W`H{L2C%A#^+vH2Tg5%q=!M#T&Hkx>*ctQd?y4xwD-$LcUyig+;a`J1C^-uxqf;~Opytp|=u%+E%_iuc?59Hh2ig!qwDqsO=7!ekV? zcF%GIVWMtGm8;_qEUmM1AqWGcfof;jvnPg|+gigfy^Olt)|5sP%s5YV&XvWeiUw3m z^(4Kf941^TEd6~Hl(qFyjAv~r! z7xjlhB&PT8<+1JP^UC@{|IADE6O3*Ts3Z$ng{(8Q$I4?zH~xmyL%#V zo(ma3}g>4%Ga$IK{+R(=0mCN|O(QNldX7ZR?K_)#IHUu}xnY&4Iu>F%uXdp(fN zjMOA>C1HAc^U!H(;o!?>qAD>;B^FaA6Un_#rtF3_-E2O~E(OD_(ex6O;F~~sjw}|Z zVdA)+^J$jII7_*&QdHAsJx29L3GWtyx(?cHV&i^P_V&aII#S0owM7y)PpfHEIzLk% z`ffGcq!Q>pKMP-tquWvO(`Gj0IRtDvC9`nAr`dFpVulQ?w9l$phY<^g9+{8rE)wlx zu0Wz)pNc0?zQYw#v%4(HF{NwWA2unpethe43r8Psc%hh`abpE+YF;{DS}?2* z^y$z^{U#9)A@ONt|6s)Tw%S%XtrfVb?`t>;w_J7@(e*%3Mfx8vfVOPCQ+6{#B9rc? z`1>>d-HpX-21O>}`8Eyv_qA##F7B?%`Z{A(O1@3yf6}JD;$zBP9p*Fe>q^SmagpPG z(0jjNDCS&yu~Fi`Wv?hOTD*vV`Y@qLKtMgUC)`5M#LJ$N%nRo^hlVzn@I%Qdp^9A+ ziz~L)C9!-LUD!L)ck-iMgAJV#JWOIplhYzUZs9t-#I1$^1lFh$X9yiLPemXb;oeB5UI5uIoa9j@S$yDcXVb~Wy9yZ zZ)A2cae2!Em+V_Vhz5Cd)k2BWJ1d*TP-O6VMV%cM<@(`;)q;t%E@#sibnBuAZ-w{> zOa5A41+=9-E_!*j*b$hvob{XD9uptBmF*a65k>9bB!?;hGy~E)Gj?3Uf>Qn+C=DpGOx;i%&^F4? zUK4&pF~R1#1F^By_H@$JHq<1sRocfzf=tlVkUab!9OzH0uLv;}VLSCP(BzGRGjQem zZ<0v>6!;J07r7>}Z?+RP*JJV&%I*Q|6Q)jK#?0A2wG1mxLD{j`PFPLjc^Cl*nK5j9 zosO`P&EabT+10hp0o-IyAATKM-(Q{CpQ8WdNP$_Oav8=Y(v~C`%JPj2{N#Ss_r$cB zm`av=$ObGAG!`ppD=a+Z0|Gkv9Ii|2ehiax*CNzad5yh;4Px~?<$(5QKRTBDEY2a% z!G{s&C4D~ROOEUZ!wWILfxWl$`|^$JLdMB92@w&|-}AkJ&x)*I*47>2XU=lRwz`bS z@BweCF&JV0=q8&GCgPJ8g1|czV5Cyqe(`)id1Lh z%H0gJ{+ty={M+nM??CfikBwv!3O>T7UEufcDr(TwXaM*V8w>YuyDAfjp7qGjgB$HB zv2SZ18c`F2y{P9z2Q@b9-Pb_QUvhStCDl*CG!HCiO1oysZ+aObMGA$J*2BF|ae@zN z16SB!)H@dvjy7~Ep46kWR}yDsh1T8cU+=$UalD45OvGPmdRWktl?BMWYT6Ni!r>Z- zkUV$q{7t=O;oP535rzj)5wc5Ma1@`bV~1t!L@M-0;;%w4_RdBm$`<H!ZA;b3Uh}(XEqlThL}~Wn+h<6+ZNN=g|M%@g`b8e zE@R5Ew8#Pbjyoz8U3uoHD<&W^98hUU)^Kb4U1GfXz6D;nSHGLP*Azu}iD{74kd3h2 zup7YkMK)XWSWLVZGpY2G?zD`KBu#In7*M6UUup!lC1sHj$t(i3q$h}eJ!haSJ~l;O zBrgU3|4??0(Q!rnzfa>dZfrJIW1Efbq_NZ3wr$(CHL=;46E?P!JAI!2#oPO4X03hp zI%^&5^W*+}Ur9PTbTsJX3=@Ij%LP=Hs)}MX|4Ebt)yB{876#(yOe}He$l4B4o>f@1 z>8Mt1>xNVs5Or3@Cj9W>B>C#Lq1WX@B&!-4J{mZChzdB1mkUz(&+ zi&ZNxCIL8qFr4X5+2(bFS<6XvbJzVIL7#S9Mnww97X5zogS?C#C8{un)7RS zm<)fjF~cTXNasE~_o^{-WOi9aG#X36+pXKj>4oRPr&nBFo`+y6xhPs@P}@0e0Ko6W z>LfdKdcA{ucVtB_C6uzhYM&Q%@rTBRU_*ZYIG;S2D=aFCl$jZ!QjuckcIV+m(WH)B z#J;I@USVBW8#@LuuQIRAq+LY8VaV`_jeuzB&uSy+x@i$vV^T*fGF?kr`_Fo7Ql{xgCcpzL< z5+U6HK8}z_RQj+@?ahiZqg~sS*x1AQ@q<&yJ|c+#NyOg)0@h`Myn^EF0Mv5U3*9l= zS^~pG8|15rZN9EV=+gKeZ>BDCZY@S-DoG& zY)dE1NImyh9gM8q-h3AQazUTGQyP!~C&>2O4lS)kjvWacIW6oqMDC<{#rB!wB#ol^ z@QWychJ{oCbu@ekf~g{+T)ir?5$Gb$&S^-gOR&kxdUMV*!zFfFl${l~w50P3wBb#x zbk!!`p)N=w{keu(^yj{lXWe^zons}i$@3Y}tji>S@yM|FZC+drSn>rB?@*$^=Dk2X zz0-iWc7p0?)z$ZB+OMeVh>r4(o)cwk;0Ksy!oL0II(au#0TR9DoZts<`JW&B*_$D%IUnI+om@qo2(=M>NY1- zFO4O1Q_t@7bzqe5{b1;QNyf4=#$DFMlx~tDH9Um}W!Q9sco1|x&xu(0Hzr?>$>$e8 zNTOT9AQKX8L@8o-$7z2X_w&dz3$P_LQKQvQ@H>4EYRXa}J$t7n)?JRnpsc?DfOG^q zow&{HE@fH5qM1=MovafQz@~QLj48!PDp7cian)tFXF_j3#T|vdq1`sZ!ZQ=614buh zNH%B!jmdt{B1*)C4^q2cZ~mcle-GcT=bn|_yZeo5)r87#PscSx`+QVcuERqT5;dt} zox()1^``qb*FE0%?Qg0Ze*NUjF2tk^e17xys52+H&@W6}Qd4r@Cr$eZ1+t`pp~yLn zTS=&s>1h(bZWM%#`*I}vM^6^hWzmZs1bmMsdjoPePE0;%eRqGwfk#ANzU}yggit-r zi=)(E*ynh(MG*24v4efUOpI?CzCXJnZ0XV>sZ&qL(+7_p`@hlDqmIt_mzUDYe4?`PC zrv{$OD7L+ictuow$J*@%(?pt`7W5+Hg=uWJmbRUS^L+{{E*`i)H5OKa>;HLjz7o^}K336x+mSlnaK4`eo8gKGDIe-o| zSs=JvN=OCkykt3DO57OP^RW|$n>($HiB_VuXC`6umt6^S%P;KJgY_pjRaBvArT}sQ zp=l~oRo z`0qT|R6P88(M#A8MN@+Eu23+M&f>8S4ZiC1V;O;o29FaS^Jx+pg7^?FL&k&ZX2}%TECWUKBKZ>U zO>RtjHObLj5g&2JDU5i?v2Ws)iD67UA@Z5LqW|63Pb)fqf7=~#5w7Cp)9oucpMH${ zMHTSt3BNwCCSRJl^d8i7nyU{mXU@6P>bn$4jmA!vzpOs71jB#=Xtp3OdQH}T9-$Uo ze!y&}r}*`o^L7)O!fAe}pH`z?!OS`n5Ws2v$a?1e z>+z`}C#d`msX`#7reF+b{M>|IUt&Q#mR0XTnRFlC%kx?*Zxx8EFc%LUa)?CtL@xy~ zqw-hM;j_86lBS|2klaYYSWraud(w>EhpMWWT8zGQ2d-c$B4v}Rgen`lNghK-NKGJ} z^t*HXeq*cDvVwE@XPZw7Hv)bcP<0lz>=#qm{Q; za^DZRrF3v6FsXiHZf`~7!0QbxmK1bADIvCZo}&e;Ps@ETI>2mW%Y5(d4^1R|DQkj@i^MWcAfGRA-An0U8r?tZ zJI(VQsHP{(bpS~O-|=$l(1jwUDA%rLk~Gss(dICYlwint(D*&OX)0W3xfFUT!Ap(< zU#=2R4)Zf%#$yWpzd`z@SATk)uYAY0n6e0bNSzz$nZDO7+5c?G8c?55=R|wBlww{B zmum2R3Hfiv8T4Ci}bdM2pUteu<=NpdVijr=4mu|MC)dRfz zkvx>e4>^G!eRd|$oS2A2PT<~UK9rT^LADUf4k?&I{{!{oJOOn@Kmu-a31-Dv(sbZ^ zyM}*D!o64B%*-UMDXNvf;DV1Dz9pFeU(O4kgj9zc(g>2{eGD@7V+oVZPj=n!+8P~B zXj2I>)XahH>Uz>HRIC`@qi@I$zZ&)(mRf6w#VU=T6QV_BIz!;3gut2zG$#I%<3E8TrAN@9&ygT~Y!NpWbiR;iC_2@xE-l z3rnx8%@IpOm>n86A=;JA9jNLu2g`Wu8Cf%gN!{R#j+^n_`>=Uh8-Ln4cjeq+j^}>X zvL(!Q8>qy^z*DbtSPh*PO~W@9PYsxW$YKYFeMj@~n3v z_%-zM7#CB-?D&LlE%+Ni`0*Tjv@?%=C^uecH=<=3@O%FyKHfY>jlK7i{rCDn8*^t2 zJ?$TZbZ(R&DTF`Hr?DV~Jy}|uAnt+fW zCgwy$-S_wtHUfJ$2Kf+pl0g(EKRg^@E2MUhUzRnN4R;+5PQ5qoax7h%mrrASAu`z+WDQU8^!2h8>m%^}m#i+pp*vF)}3 zm~bLD!VLoJw> zV5T913>=Et+yh?yab|VLe?M3^?h`rr;8R(2Ma_yEDtlu^SErTut94>yF%+K=y|5D5 zxh~=@MxQeIBT9znN5rB9?Y77+35Nlc3xYp;g_UQRY}oMZ`eeKsvc2Nm-JQzZ){2CL zH_PxKulT{xqnX`X_1RieC=zwl99qaO{pQr#l6HJTiKFv0dW|I09&gL$FrU+?K~xrR zgk9iI5XY!y%cTNOTS0^cTYwj19S+MxQU?i+OPh18fMsJ%Dt4p~1Gr$%p(dh-q$(>! zeh@=O-GEcL6tWxi(b#VYsL+mU(z7IocVFHd-`_AA(Ji(+QuBbfJ*<(2_oJ3Mz5T_k znf5kysrWuI;%>1EedD=2$7YP=Dib~Abq7YWN(NW4I+WiMi9^7!@JBJ&Xkf@#69Li* z1f`LkPP34~UibAP<3Vb4(RYg-JuP=~M2=7AXPmaUD|G zOR|7mo%D-vy%c&Ns2O1QK-li?jM(maz$Ide7vZ7BaUS_(qUaFla>lAH=A=mvucv6K zS?O=;9R4(monhlnb9(O9F>Wl(TX?w+O=|A&M+>OiryHg)6Z-uF<`22u(k4fOArBX< zV{=kNbKSQ>vY0uvn|f(5!U$LE(h36Rk*M$V8(;l8KVW$tQ-o!{8i_xc{buBaE2Jy5 zvh`qtO6(6R@d*2x*&jQiE1?6h^7>RDpjk^*>YSN4cY(+|tdoB#))u9?h?Gpmq(p^BTdE22LgLD(I z^jBtY{O2pNt#vap(zf7YD`~jrq1HO|9st?Q<#(GG(I&D`4gEjU$iK%%%$bei*H(M? zy|-!|9o*;bzR5@VbI0DiIR186#0;u;W+^^*Oeb8Lx?$s~=OU%rP=?)pBe{mgalMvv zS#z-9YRjE6nR+|Ukv?ASO88zW4fmBzq1%IJio-WnYR!Sr!-WG)JldpbVR8-1_n^)m zL4*tfU#B&4+Or1`)h{ShP}>~+kVCUJ9@|iBff$^9z402T4O^o#qAYFIc9f#M(!674 zeVo;|?-m?LD^RqX^La3?lOBDWYb0A32-_a0J5(JNeIkDUeB$7&px&14iWGF)4P&a% zu*1b~ZMSn=ZK`cSwB2jQsjc_P17B$^Lxei+51=jYI^)^krv*NRBSa9-qsr@AU|gi} zTdt2do0J&o|L z=c>D27ZX{b4;(ko7sA1ab547_`H(+mE;SPzA$s4h(I*83RpA;+6La)u9{8H0axjFJ zY&jC)=PhcMk1uPE%^?Wzt`sykgYgNa;xtY21X!r3tmtrVC|oWpO$N@;k!;pw%`fnk z2vUIOk4ws%b7EI92NTj%a9=5k zj9|ocDK4@z#fKu)HM%AO7q&(o-etXj>&pp*R0eaEk>;~i$DQnoTApYex<8Wg;1||} zxVgXRQn0wNr$TmWYW9TZ#GUXmT|hfb$UvJNZ&73&}qT(Y$v*^{PuB~b137CI{ zhbN<(=M6~QGL zNHdv(m}@}T^25!#K4X5B1etyUoE#p2qt_8DUSfOq1M1bnn&>B!Y}MPy_DPlp&f_)* zB9D(p$J+JFce)m0?ngQ!E8@sruS*ZQEp8;0``NB@GMarIAJ0b&NXv&pXllr}FG*n} zI*vztK`D%fA6Vn&cRD|vbO<>%*y9&Pv!Rgrrspce#fQd&B%%&tK6|p`1fh6dq6YO{ z*j#614UQ&!_p2Wtm|iaC%Df4k3WI~}7t&SgFmBH(aWo$hIy?72YSr66r>p5K%#}Ey zQn$yl7f3aq7a`8L7YB6A5GNiro*$GSWH9$FK3nCjbwf%8%#aBD4~s#4MGv0ln~ zy~E@7C7CQ=U+$%M@OyGOl{gDmVl6O7J4A`~Q)r8xCg0VA)amgXSXB(lJV3;PQ%l?i zS|yay;WiEuq4Osdmrlq&aslx|$XcHNpp?Iyudfhbb6w6XRd{|DAJjUp(S0R`(C=!X z27ymsMeb<{O~9jmbvMC((d)=AhZEIrdd9cumbDv11aItwIBEI~O#;YRJ;YWLPS8yq zC0AKoF9$Q^x4ArUqfV4>;f(U3hgHEAsr{QMa-lQ6k6H-3#Fzq|)2+J%_3f*6MD)IX zrsIIvnc+eJ78Ntn?rWklOh_1Rz2>BOMC8ukF%Tf`8KX2`4IGUXa&aO#vw6shuQb|hD5vPbkrb4M1y@2*(sP;F!NrBX zeB95}r0~VLI7x)e(ItQ(4sJ>)p`Kt#d3^D@-d=h~;b;oUsD7e7ioc-W@UXa{p(yHh%a9Xn2Fh+L!fTq{LUY3= zRhsn#zH8>T9X1r^G=#2?uXcZh8)vB|C(WZnR3TqN(qnQM1NDBMcx#J4zpkzy9XQ`J4i@I7d8UM zKPwIvTwlSlMU>O+6lub>$mFZ2jsHa97s$D7E+|QOnt?ZlX5j|-(_27qzxwB@6Z(cB zpF!^pZ_2dfXFhCk^Lw4ooH0>T{X}VRNDblU7>;}T5D<>haByT)ftRNsG3uK+Y{1g| z)tR}@EbiBv{#{#dZzx2Id}uNi1KF1lWF@G+s#RiC-cLgC%2F&?e3=Y?&BZ>>`l*oN(t>%3R(bFBM>ivW6BWYx2i5+>0r!uf3v@XGAX+POYRdv zCmoRmh4g~Z$)S-~o=SErlVu%Iy*7-M94*X8{Uab!+}mZ~leGBraSZ!-W zYQ!;Qc;T1dGBln!_1$Ymj%@b~`m(vL-&15!mJrok8~(_@CNeuDa7c-j>GrY}dTkDd z`-N>*Ky)T=$JVm2p$j#HT-n7AxmqZd$#hzjV!EficSwoMv-^uo2Wq5PerX{D#+8%n z!d4jxp5Q->m5QLy!dqEJ2n$zm+>7j@XD#XEhV1Ukw}5lPI8eSD2PfOF;#)$Nu;e@U zUkG*7HFa6B*6hf_C|0X4ULPO3o*9^ZKxH^7oT>L-0yYIkIFCIA8xxgFC%d8VNP?vF zibmHZxDAv#QBbpI1{&b!_%!9ff*`lqQ)=$D7^9!uAvI)Y>zAaymR~TdQ##lg;h;44 z@5CFP&3VB1WSyT1lqBm#02R;Hzef*7wtFz$YsYJ`x&}V-dyUhC1}>LjrAG%&+)_*R z13$eFT>@gzK{x-H+XsQuNJ;W1Hy1>4ej%9=f3bk+1oi~%!4dDZIuF21Prd?e)^p{4 z+H32#B#;tWPh`J7nvac6w;`si{?Tr8Xb$rIyp%4hH$KNonww$I?_DLGj2Rc|YMM2HvaQy3Bcj=SZz^v)_6c>H30|c+NR>e-8IA zixQ(?d$Ip~x{(TdO9drq>>6${gK%Up7ssb~AC77MuJ1PRFj8zOMpRg&2{%%Wo|*2F zAuI9of+uSBAKj2ieT`tgT4J?(R7)Ty$8n-h%IBB_p6k;a4n3*VjPrjeXzYhsrK#VM z`n~{a>zm96WpYP?(xA6IA4=&+@e2*jrU}|tXxV?X9mkUA=j}F&F z$KE>wU?=)lSxAmwr|Xbweo-Al;flaBJ>QMie@99zMs(a;+F)i(#QvlK@g6bMhy4R$ z$b2|CCfE8;kv}k3H>FmpcyI`hc0|tIV007EllpyguP`npNlIP`*rA!jkWMbCc@jg6 zEH{Ps`dE`2$f74|JJOD}+@n4>u_L}I)Kkab~ve~vmKJ>dL4p2r3$WzRVYGJ5YL@}*QW*BMxi&c~i>hQ*$zqLs$U zalKOPPh!DJCUd&la)1J?Wqg{?`FvIis0Bg8ww#k%Ki?cNwGi7DIWM|?LsE1HPr z<9ao07>HtRUNV%$i2)*rjW&p%lmvG*|0I=B4A0_?oeV|@iH+8#frAiYo=#1t4 zzzh@>1Ri!3rBy>J0AIucpvfabON@Dq*=d_B;xxiM41a3)s<#j z=Os0~sTbw#d#p6KLWByJOqY>>A>gkGN#{zma@>LxF+KQxMr zL+*)WU&klpWB+4UBQ4A}UJ6mLEX`byjB7>yPZ&z%ieLr=Plgm#Vg3 zB2vsjXT-0Oq~@W^3k5P372ktM=ayr!!W81n5()m29l%giA@o{?y;- zi%K=fV-zWBiYpWt%bzwyaw+XcP-ZF4831ISAk_aJ`SQ&rsN%&V0$CvU#9%!KX>x!Y z*Q&r6hTB{|I88;>uBe!UN770@M8lpxy-K2qn20QsI44lj2U37dkk<%>J|YhHtREg- z5u3Y(PtaY{V}0#Jw&*H(08rA_kTPCC>|+}Cha_}<&rle;OebM$ivb!9iECNpnSZX~ zYn3&0V_Cvp7g?@c!6k|}PP89RaS@$^OkFa;v0)#gvf4MUQ0;2Ij!f72_&?MYS;DfD z&<%I^XJiVBay`|FxM!rrN6HDlZ+EmDOH(z6a&^Kgau#``;8!Oby`edxG3NIwmXRUK z^IdMpQ?F}wx6);`wT3d^nBMU_UHAs%AAcLb2JSw5K}1v-A5q1Gx2y%$noSaODvBSW z0Dn5VCNO@QvUG9-nMJ!%gu8?^myZUhfAoCzaEXEgt?;d67i?i(^sTrQtDGYO>KY>j z+Mgi_>J*n-}0pX z+}rbsk(v&w@}_UMc< zN+1n|VMzu#DNe$KVeK*N=_0ut4<%73Ku;>l=vxpR$)Kj_0;`NN()qt>ZWOY`pnuRo zSbJzG$8r>5PN}s8k^Q9MABEdA!2@|rDnI@CdP0WyP>a#iWuPY-X z4N&8Y4N2&$+)n&!s(efG(+by4+jU1}lIz36SG>ZAC-ar=kX`n>dDm_${11b29S%mm zjsR~>7?6n79jxkoW7{u1#B98rz4mh(bLYsmhXfo1Us^twTKACDmPZAiPeX=u<%ys! zx+%muFJSlENRLgC6Pl3|Eqc$5UGmsl2Hw;Bzyvj7jD@T|)`P zxV3jk0Z%tB`y<5PDJW=J1GhRl%YYf@+x>0dYw+OHEqb_e#jZGED4r2kdOJkJ{58uxt$B$?avLM>1y)Hn zSR=qcM8tuv*!vXN^$f@j-J=4N^W}l@1e&WwWpsSAUZB8+{RKVI_SD_Fml}k9W?AgX z6m7Z&Sxp?T5fxA;#=RwG^$KRHN3yhJGTWMIM&#vJPyp|~z2SQEj2i|GrsJ`WG@sZ| zR#p8S7mOp3Bz`4%lkQ7GCgCsF<=5xg^;5VJMBA6M z%yb=NmZ$ymH=r~laARdO=7>WWIMVj~F3bCRsSjLjerK?ZKa2Kb{fc8Cb{m~nLq~AFdLPB>r7KeWBmUmI{IXJ`sAFYYtz2nrw+^?jcI^vX~ z3XmK4Zy7ZV-$e{Gi8Kj(&UgXmkV=lQ7PgkAlJIN~QfT2dK6Z>CQyB)g7k+wLaqzgD zQ*^!X*=3z7JP-^UKE z(P`uN__6TV*3*!w|M`?^E&GxdBe8&(drfDok ze8i_p>USkADg-FB#e7%SmyxC$K8P&683pngI}*0>v)H~Ni69Es!5?4HC&foUitG#xJYK>2- zoCmjD2$XqzC4EaEdmR~jeGKVYwr*v&y!EhL-+;)^K}bp7~T_8sXJ#O)`7lXcyMfR;FvjhrHvB#naS8c z2^{6q5@mLdvPWKf?)V=zZ;`!xD@Txf-w_YrmY3ZON03ZiSQ~d0p!DBcV+{yb#$%#f zhg&fO^X-y{-J36WCs+Vg8#f4YCnh>-H5!c$$C} zUso%cs~|vLiU}y8{gc{yozPo$fi)r`;))kpcR`Yyzo>z#m>dNSWJ=`X>k$W%gwwwi zER>)@K%Y_dUtRqI$?X>I0=XG#PIqXCWI1M?5I65u-=E~&&urmoeNb-qn1; zs;>%?+z$<%{XL`5Oq5r(_>S>K@`U6kct6~NFvBp5*hEKY`)kjUq=Zq|eW1Rv#k)on z_-=#iDN14mmI5mGUkjFjuFBsATk~vh+qLvY3zJltMDDo2hTdH?Y3Y^6Ql6(VkxiMG zH(8aKsL(=i1H*+9)Gv2$Ou;NPbzf)=jh-kL7&`rFAGe2keGVtu*b?0*5Qzqre`W2$ zgP>bzp=?u+*T!dLI$W<>#8czV0!N;n9Er1Z!f13aObCGk0|RJ1gh-(ho;`X}3#tEX@B8GYg`o^f{?PT~dX*1G+A-$QHdo|C+Ewk39f z?zsIZDtwv`IRKJh4Mte&YoQ^&C#R+Qv;|Bv;7&3|Pbh{O{BjJgXOBYE zUS@7Vcn7peEE@|4uX*M8?;;k5I<73+Zx^jkqja&Qmp!>H^(P1-%T6zQc+b}z`d3f= zrg|Em@E0qc!9|$FMHWv~i(I%tPd)et|5@2K)*b^%@(hW?*Zr={MUDWDSXxF2ZmYb1 zV@He95Idc!cz&z?bXCOj+7;Vo&`A>H=Rs zk6@}s8OWbHbL&Y@nci>k%BpIIJx`=A-o2q~J;CT#qOHET<)C9c?+EZ-DHL_Livr9E2nN&*?cmCNPdv z5`dk`0l_`rV-{Tu)YzZux5M3gQ5wTCx0rNzhEj977|Dz;U!C{_X`Y!~t2Tm!B^G35 zWOv;dI+U>22C5Zes0p4Ph;4*e3qvmAv(vx-0qGB#PyUL|&G`F9v;xVixMe z$b;mfpu>|me-(dmutiX*(b$O=f!lspfU|!B#^qAu8*c-%w>YgcSx|Cg6!G`>rW_2$ zWEnN-R()b%J9gvWpE%Z=Qj`a*f6(U}yfIE)UB1zk8}viLQxim%r)F_h>U|&zZ1g4< znMM`Cn49|zjNHo}E^qZ69Wv&dM{!ea!_M5UG@2m~4GkqFC4s!e@Tv(G9^)J)PG$WiVb^nYPpOH=VzQu%&APVHpL=2Mxk=Me z@IQJr<_pcU0MZ5nxmH4iNK*}5R-0J#T6+g+kG}BW{1lqLACp1}sYP$uC6i74_xVnN zG!TXbbCMNV7F=dastxg7*1ujG1;I+h35nc&+`8jOxQ{>dmA0^Lc)l(_+VLXmySMd3 zo}N6B&ER$T*F*=}N9n=nE|-JADyA#XiKtCZ)3uBPsiP2J%FD1Y6hC{*K*ss{=R9gK z=)Qq2eh-m5-DxmgTB@Ng_HPa)u@LCC zXNe^#6)92UkKmkE{O44VJtxfh1@AFwCj-AT@m6b7(Y z!z~#WpLT$*Gt4nT3E=obt>?{4#E7&kyUe<;;C+FcNIdC^cGraXt)_~?Fx$xj0fehV zOj1xo;r*bYkyh6h5EuF}MEMC5%*nMy?AdBl$YQI=UmPD2aeTEfX4_)B3U4AiSu27QaglEw#p6?8%m&%#qlFG;d)>2pmhKlm@+S zoRs$zj-Y*)vA}YBp8l@dK6X}2Sq9P+SIa{ubhMc?9i{yjy~EVcOCe03a~Fn6{?&Qr zuB(a5hQ^ZxuM?Z-5&a>aLGSHPjCj0{j7-KFu2li5L4AgGz|HpdR09D7q-@|mQ4Y{1 zwk8YT(M@{-oi*-D*{GTZ>)h=ehi3 zwDsLM^nJfm``gT)via<-_BT1{C{xrFCY`G|D5e>N;M%q(MTtRmvmjdTy5v4o4Uuy_ zkn8R_f3v-ew3cn(KjF^H|I*`N--VCFANZPUsyAd^QJ%ROd5{N0*Li{lWVHwKMul5FR>C@>*y81%1*yrI_9lqg^Go{`e4 zVhO(HL1Y*h9!KbKBf7wP-o1$If&vUVq$#G@7v_#4Wuy)hw7Pvmu`HnsIRjwk^If!K zITB5Z_a(cYn+u+-dXZ)~%Vg>A&#%uDK7EfVHoJS;n01FABjGyFu3iTfte+pzFq*x- zaKA01a{kb~Y~r~)Jxe3Bry5xZHbgVHlH|TmOOy$8DOn2mdKp6~*L*Oyc9jQIBX0ww zEA>lGhT%Ec5tKR85qfY)e+4AU6;=_qaJ}iO^oVc+4c8=ccovdU0jgg`@Z|WK5YV=z zji4!RdvKN&Snd!6Y^UOG@C9SAKx-h!!Y|+I=_g*RP+E!Lax<_*`sF;+-RT}FAx5}y zqWx(~x-0^}^nS_8Y-$`rg{~{EgQ;kJ`F8RU-I1XqC}Z@b`g8Up+WKU|XfD8Fu$6b_ z=A6K7oKmSXjuw*xg?IYd>+%JId}6v(=-kjzpOB@3)#XB($@#;5aC(ls`G<7PT$B3e zZF_j&+ec03$}A>jBGuvFnT_$}rR=vyMqjaU`d@awFwe5mX{z%hjq=vSvrp_jSHYFA zFnLA*z}rzH!5Jd^RlK&qWPn3v_k_>1e5wtx8uo#pCx7YzlwCro+p(Ddu)X^o5&)%h z6{GDwQjh@W+#8zKcZThVH7M?5&vZ)%o+0fk%^@-;UIE6a7TwsD$hp~ckI7Qa3@#pI zxtU*BhzzQz9zNFXJ)b8{^@L>vlJNRn$UUq|J=AQ=aO=nb?r6aELh`f3#f135#QeW_ zAe~X}>I<6hPc%K(UtagQ1g>q6w796*AFP)+nm;dCpHc1Ceq1!_=x~jaJ#I|g*yy4s zu{&(ibJVw4BPijrAr@Pp2hpTiyPpwpi%w@v$~FoNz?7ye+}z-@&YShb?!DNz-N ziIOIzq{O7~adQ3(yfRAilM0%ek|g&>m&DD?C{OOLdgh(8$H#xtSv{Rya3YI#M7^PLlrtA<5HeA`H|snY5Wba!?v%S1169GR$EFIUu96Nk zVuEZ(&(_^^>n9zTF2EKnXwBX#B308A>p5ZKOrt;#H|&7>mLoQ(Hn>3DAVQrb_yuE# zB9y&)cc|Y3*K(e>)snKFcB>!XlW0P{%0xtyUK-ar;XV5ffm?KfhN{kEwa%2@RvA^! zg`jeswyZouUQ-i{EY*}anUp7OI2K(IX99RtEiPi~_tr)14)y$Wt=IALO=Ircc*MKiAd0?y&mmMK3Sq z<{kdNuV>aRA2&R2UaML)noewJcea>6{D)e3hmF=@+$O3U!|s|5RZ~!)Lr4`XnmGv> z(p1s0wEX1g7)Sk%a))uBo&IUy@(pJ)Rv8=J3OVKVn!v!g)b5mrdd{wWThx0L;=gG* zp|fau8v1?NXQ@59lX8CMgq1Myg{;+-0_ptV*P}K6hp%nnNlopwKrH6X`R|Y46rVfn zYSo*fV!L{3m-N8O?RTDyYT8vVbFg7zSmmd-@n6@A@;6K6{K!?lX)>#9UUrr^FfH37 z94<8`qiG(K-G;#In$too>YwFv@YMji2~uo?7`-z59>1Vn=mtSzCXZdSjKd#Ttdz>^ zpe~rgTAUF3jRs_W(Z{5*@7uvEpn={2?O4N`F7{A&9h**X zvUB=3IppFWz3}dQm|`V-oz8@NoA)9Ds&c+qEdeo_Y~!+8BFk@Q((2cL;BSttSEVi| zl_DIgd2g?nAMRo50!bKp9jH&HbIg&_{u}Qa7qfDswvO7;QStDJ$eNlH< z?93r(|C~`~-YPzuO#YrE%N~oj*`E5sCdz=ex0BE3gnyN$a$ILSqxX{(GZZ>d=RKxX z`OhtLuYNlm?Kfj8!u1oWpC??H?%`kn)bI5@JVEK z?{(%J#&qVCTo2FK4>bvEr4*0dQQCniNqO)RAtG+$5ywA(rRK|ooLTU;yN$X0sj@El zyQW=+=ap7<3iS9|`SGpi>QUWs?yY?Gp7rytdb`o(V_D-RzxJ2F2R0+JDHTnP;c#5E z&mHP_^kRoCQcG~5JvJy&fO8TwS(55eA#L3F_{<1f5?j5owyV7PssXo#`!_ATz};=Q@Kk$ZZXt3IkV#)dXAF`@M0!$*pJ zki?faFdzvI4j%EAUA{N+AlH+67^xil;PhE-5YRi1zKE@Hb75V{(!f`;NEIX(hCNrX$*L=S=3V#c`qVQ#I3Z~$|2L79mHsqA@nsQ=!USU zda^|#uWY+6{5@p8E>h8%E*q+o(sK)3G)11WhB@vNVGX<+|F|;M48#oJF;p2BaeKre#1l5FpYUZiT>N&d*h9(#4C#8G zxL7=eUY>Ux&{^p9_71;#Te{sC06g0NYVSd%Hjf@gEIZ`#esa!fT8W>T?ee{ZEWIea@DnYMm)hPSm?ljbJ7|>-a!USLfJ?Jz`E6Cw z?vC7R*^I-v7`nVDy?9rDM%?lxxcPqn;AQkLJL&?dj)H`&ZQNm%1aTI!F&s2v!fL#Q zCLO_|v;o!|dngM0IY+yN1nDzM%Rg)&AZ8&*5VpxKXlMcq>KuX)h^q54;A=s;qPkX^ z^(B#-?x{-J83MbP^Mr}SG7AP}?_d)|?g1a)f(yYHS?T-6;pdi@WzA^hUIhi{wZONV zC5sdGc?I2zl;9c&^K|CNK#6Cjgg|R=Q=FL~q^leFN-F+Ok;x1kql<><4cA8qy6O{? zg@<>YV$GE=xpxXY=MdB{9qXe|(4$NlLf;2Zl2>PDF5dVVHBwnB&1feGrIlDs2p#dv zSlC`zd|n(0PIqjleNU5D(3vl%4&IJ;J(<+Lo5v(OEG40VR6giBy-;&MQ&;yJxb`v$ z_pMx!9q!k$(DYxy9&Ke<8tW4RGxdyr4QHmSn>3ua_L_**ipxqR96dt0k5FO}u~3C3 zN+sZ5tOKSfq>LTNVi(#{L{2+QcpEw*HQ{luno0joRKmr~p)TF`GuwDTt6iNRoX&Q! zij0#Nor0XW%g)h_hkxNeQS=MWEtlP~=Eoi6WX0sj#pwuLbzVh5kV5`g%LV&QgXWs& zEma!UfYgwM`?Xj{r%j69r&QVcL*%r91+Jvpd>%8@d)(QrZee=VZ+!sO5p-m;C0i|sEiD)M5s?o2<|mlpW= zb^QNd*U$fuH)WQXb?!ofI`d!VlJDv#wX+}mQGK4sFOw48e|Ax~UQ(R1YG~?G7cQ@v zMwv#gj&mI}-2Oh%obqJmjfY9EUcCm+@-8WhQf0nf{=g*mq3+>K1X|f%CjY0TCYxV%z4T0IA`{zNSV9pQkx{-yj-?> zxAfi(eJ?LBGu&x4|L^Sbg!8+mmB$+La%-%~UbG+wW<#rd{?Y!m|)atdNv_yrR(uVvrp>hlm0!jyb>;AP_SZdP93wj z&Ky_gTGPf5cHL&S%hO{{RbE{x@;vhkKcCRr+(n6}RJ4+Qwk$dt5;jf9gvrHQYsIS0 zg*(-*20u62>a+NDfO@mDvx~IY<{b-L4t>g6^rd)#t>4cxtY>BiIUfnhIB0V!`&9>P z%$rG4tGvBeYUnT9v1LlvCW&p53s!8Jx3YIK=aJhl-@I9>zivj^%cobOnN7BT5tzGc z0(bg#VHx$ei?-h_yUp$JZ0j`P)~H#tW^`@_P7c1ZDC9d*?fK(hLH+d;y>AaM_v*gn zA-nWatR8U8FfQEYba(adV}ETD8H3Y3oqHyAlrYPjUYPs%^O_vFrZ)^zbRXV2J)5Kd z@*QWy$_&$Wz+qCSp1E^n3qLWbty>RVm||8kXX5W2I?n3mMNY=0y=z`4zdBsJ;fam> zX^Ff^MK83c;|jOV&2aU96zq!7xW~i{)>#U+)uBCy?;d3rvNu+0+UIs$ze62v&ZGs_r@)s z1s*{xD^=6zW^;3Q?P2i=vJ`LFkUQzbuEUL!mI|M*VDaU>e8Ds2&c%|hkaMa+CLe2D zkA3W9>AfC1FE>M^WsM={p|Y~~if>ahyL^v*w!M@$ZG-5MaJ$I!iaBhaJ0(HmgGqC` zS$xt$o<08ARVdZGP-I4%+dSRr57#eCZ0FXnV}I5+sl)|X&4GpyE1Lb(WIyV>eE^!C z0!<)%^aKyPf_N6qpdmwuu(1b8!Y5eztf$UhmYKMKL8GP@JS+(`=$tF_0R;n=BaJK* zSb~6&|17y~?aE!o4Yr#ilwZG+;k=bHDIMajBRjJuC_CP`$QUu}VZ^HzKZzF2r8T~n zFU_%F`0T&y7Q|5;hK9U_OT=}~1p-?#uS}DdUVp{utU2|niSE&l%m(jOv~{6FrNUPq ziX1s?FYMr@IrVRGe$82h9G9+e_JnsQKokEU4?bUXShK^k&)5CW=6^W?%cca)TBd4g z#!&1g1`Q_*aaq1yZqu(z^*qj4zg)d%;-N{imdWxRC{pf*nBX+0n~(p{#5!Be4)@D( z=^M(P@XlJsd~hPd?~-lpi|P+Ei|u=;kn^Q?R@t4ON1?Vq%K2Uu%-{c9pAR;;>$Iov zS46l2IP8JprV3h{0#{5@8|ix zf8W1%ykoG3!@1U8Yt3_>aU91v*A7#Zmw1UnfC2*p^HNGuR2c>a4t!uqk)DH*4i%BV z;2&grNlhmhnAeoh53H2(+Y>N|=qx2ChWHom&1)ip3_`5ce}=?9It#lvTi7|mlvWN) zf+19AFeGZ~Wb9~Z?`&yj3xkDBMghiApyMCx>^&SU%`Kc^%F%{-!04-gMjcHJp{J5M zTiTeya9p7wgCoe$BPw=g&TfW|rZBqpPtem}{Bv?jg6_TGtA|1awiyj4n0lP(%IS+=IhZU zH4F?XjFhObs(a=^mRl-ePkrOsURXxG)+Q1PQXaerrW9*xrY!60VF8?Yl9sMI8 zYiny`xUJfsI;aiE^6(j?%u3HhF_Gf1(Z5AHCUb@$>#mWoO)afV@$(jB&3u~h$dQ;; zb(twuX?LIL?3Wxh^-4G|2+`+CA+woir~!~skfMkDJfX5 zLY$&;$teGG(O+Z=PEKsCu7}S^(_|-06i7t!VvpVb_pXFz>>M1`R&$Kc{9&}LP`h#! zas=R?!H%7h7ykDlx&B&y`ed{{nk7n(k*Ev~{#s|o!NJMi5R*jy&%@jICtxTS6&2wH z3)5he6GUN#iSmufNX-cR_aR?-EG{luSXksXH>V{hzlKi5#)dLZ(*6JQs4>cekQkEx zy)!zBXkg-h%_HLf|HE+bc|xN9^HikRq5o^Yz-Ji$W0U|z(*N6TBKaNaL+j&)6ZvA+ zi*;fCaEPqNy{P1Ik|_r^%S~}^s~#bflgjcuyKe`Fh9dr!{$n-~TVM?lCTilCTB9D6 z%cB(;4-amY5_w8=r1Ls$&D7$7_nkL#pRBCHM9JTM{Qj9%rPz63%Q%L=*JVyuf)xFC zoCNWDB--3&EiduDI1c*oPjG2~AK6RYdN$Jb1HvTAB-3ay(1tL z=_%K&4HhMb6%rFes5Kig8qXE>SY!Iv(V2j`f06yl=J&cjwDTKUZg$dauuj|1l9ECe zyjvJ+0=KG=_8c&Yr>|@Zpp;2If#f`8f@wHj%xLg#`L4gv|GkxAXEsx&rsJ`hG(9`3 zHP>-o#B};i{~;U}?zzcLexlLi{SDvw_=mQ~+kN#Xhd!b{hQ{T1%01im3w7JJQ*qbh z)t80Jx0S6&JeP+{+s$(~kZq?vBDa%er!mv4ES}xMgr$g85vBBlRf)HK4)4X9wwadPGFdB)xt}anjRFtZk+Qjs$1R)1IH|OZ zOl|LwKZ-Dy=+0WF;QM8JIGGg2O)yF5;%r@YKJj0z`3d?9!A!AhHreMH%NKKrZmlRl zwnmH(7weZjwzFpIo1M0m)zo@kFtz!H@` zcOQQ=Ic&hVgZ1~=ElPore2cm4JSCS}ECmAf{faY|)m)`1xTyCdB&Sg{F(ZPpB{YQC zGxYtc`*jE~TcV<((gl`W+|;zl}dulfB`z z{@sJCZ*q5e2v(T1G4_mpJeF2Hj*KA6aZ-x<6g);jVokV~vzc9YD8}qIuAaO9epP37 z7O&gn?CkR&C+l5Ao1-$)(p-miQ>nael_d}Ee50+$9Yb3q86HLK_+XU%q4Eh{=YItwc+h#Ug;KX;+Q zmO8`=jKTMfOZL0pAi3X>5HxzYy~qT~`~ITJZ}YHmZ7a<@+o6r-N@!hgiqVluHWj8& zR8w5mBdk3>KEAvoIQV(T!=WAIdLu?fPj8gT_w+@!*AchC^=~+Vr<*Zcrx*WNl<=3N zs5H8OI89MGM8TFd=&eW|y4#8i?iWO~=g^s-8r53LHPii*wLkHD>gaV}G z3Q1Y204$WCR8E_8HN|HJYaKqQ#C&*D>>dZzeT1bRh~e~AZSk!~EfHZ@)XLi0Lsfnc zR{L616VgbO@o&$0GA>t4>afe}+zVBXFwg6t>vzmk!B;J5b z2)zNw+>s=LtC(V1R_axHBcoZorInRipqx0X&S-b~@@qF(lc6IqyX>iw$05afGEIZ@ zf)8x{AsE%LEBIyG)8pOS1gWyJvQ%!TVvgC7KRpo(Z60h|R-o#Pf=K`%tlqNP9frkF zjquTQY~z$`-9A;p`wteVI;W$&$LJ9~say`^0K?w-O(8%l_w~n9;3PHn>muSY#3P?! z;mQR;26I%!9VPvLVe)K|pv1z<|6<<%6X+88vJNhQ)Hw^F8yg#jk&%(aq$C!zVLVW> zycR1S#I2%~%Su-MB@riLDjIl|9tf)Ru~jD_Oi>_cHEc|`@k#40h;BZr&HDAYkI?MVkGFGU^h{WYSkl5blA)LTmJ0Ce#z6qO@AO!&v?O^Q zx8r`Mh~bO(14R%OpA~+J-D{rB51RKtVS9|(+xt}6`REzV^#`f%qEw}%#{0(c)2B~( zg1+8p9<)ez3P#&>m&<dyS!nc0^#fty~GT=3yET`_v;X9cQz4)@3T-71`dzsMWYM$ehY{1+P z5=e&2Ly6!6t%i;R!pzJJDv3ZFA|G}jV?H(>EOS6^z$-%oT&_W7p;`Z+!?Lvo0%?hXrTJ>*FOELoCHh|FGdTJE6QrbCw_`mJ$#Q(eCHeUQ zfJ9v1PA@MHm#KZTu(hSaLuIv|X9nf;xe#lb$wqG!xE9uD0Lx}8b!9X)@ug{B@g6XP zEBgz9$a`*5bZ`3g+c#s7vAc~}>ShxY6PZ6v)0BPtMzj$>@K(Fgwy2^a3JRit89_l` zsI$ZZi2Cv2j?H$t>EQ_$N#s=`>yKOGPJ>vfH?_ophkpiEMnA|JW^8!pa+cGiuFdP9 zZD{@)_{LO1$~H+GEH(Dvenc;kv(hIbswB^nq@pb<8T8WFBXXoq4`aJw+xsu>`8?z@B93Wy?_z%}VcU(7ZX86U5<11jMN3MVT7v%ZjwHLk5b zBNpG2FC@%hz-%;g;Ao{4*22;f8jl9cO%8mg-Bp$T@jpE|s0x)3Xp2QC!ri%@us!No`2MPDq^S#Y=dh#qqx`(Rf z4XI~~2`TnxI4YU}QST&H?#}SHCe}N!$tl0y_nB2Bg?v4Q*!j^o+X$nFe}QJmpujFe zXqG-|gUIJkOdDQ8DGznFdw|zbb4YqR0kGCj13IrcdO5}^TqO8%H%{6jq!5+0jt)R^ zr|0IJo*u4hEhfmJ)NyDPihDu8!&rR!^hbN`_BFH;W1~0>F*Ke4Qc!L1^V#D`h#<4a znF+Y=REfeifa!k+>8s##>*^A)SE4pJM`mvkAQJchvjU-(}w_Yc9P3 zX4l@03sA&%3?-#*aQ?<9UVKj>lI9!JuS(5%VpVeID6Upx&C`=e;t@ex#o_IJx};Hp z!Gma6-mlt$O^`*GoQes*{+Y}iBtKlhqd`c3)CEB191JwS2wapZXd1^46t11O&0SCB zJa&V*q5hbVAQ=Hfs2|YB`D$ZCUe|+MfQLA&X1{x0e1Z{p*j0c)K{2LffkX@lZ*Emp zRlt(Fu@p>pCyRunQL|kaEoHO$7Un`C@jTB4sG->^*ziQ~2_guh59{;UnPbOAg&m9E zqc^eF0ZTHI{wOr!LC|e{pQ_Rqe7tPzbU2@ofMa$)G1wZ*Q2=Q=}4Z~HnC{w<~$ zgBLOCbMD9MjS5#9Y$Je+XSY#-r`OD8aXA>NpMR^VnGAn~QAf#{U0m_rYJ4EPR;v>j8jZn&fm-#4JXErYhvhA}j;aQBFk_rX@EniN{j}b-Q&l zS(d)9?tD4#7aIghx)vIEk3xix6(BFR2{Y=|i97Y~@0UnWbhXg~A0&V{cy6@(?1uvS z*N1mr85sPrJQ|xgo6=MXvn^@Uokqs`!0#s*4-RO3@atw@y%{j68N%Qd-ia)?ZX`sj zr}a0!vzxp4zNTyGtGVxD)+I6Q9!Bfd+9ggk!gO_9^o3(&jI7u(7Lx7ES@O|H8a>cf z4BV3NSrdXh7a>{Rekhtp^j=O8Co|Or?QLv$8c(%QLY?!#IfY-}`JvZ^< zaN6P;8y8?FEp`8n`;UQmsXL}hSruw2@mspFa)z!sWf%NpMYPsYxB$5p?lhx~F-Yq?~0 z`0h`-_yFxsEe^9xZv(QDj?0W1z-%)FIT&sLoze6j1V^DNuGdQCFTnz%L&U3L}GzQ4kdgkB7qX`GpG;|Su0No5|a<2eV zfu5WRBKUrj$+3KPaw8%TfU9JUy&E$pK~Ov$33;XnCwfDga|gh#wn~2IWrm7BenL zvvA1wv@Fj9C{#3Uwr`lFAduXD94{Z*8}MY&vPw@+hq17;bIasbmOibo@`+*_<%0VR zkQq?UzF4L&1F-CUx3u>B`zj*PDO4#bDPe$YFM)wrlt}3azWk0XKk?7rx2i2f!E4w! z$!;z4k#r7#v$lrQjKioU!}5Wo5Rse(O>ls^?fZPZWRr&~sHlWovAjo3UjS9W0!$T% zC^rjZzP(v)t5Q~0^gvSHgz91`dY+{m?~R#^`+V&HpgTM~6e^osdwjit4zJG|hrx7e z6d}M}Y!X)RCye&4yS(`~L$S`I*+M@{p#e)!EsPk;)V*Wc*;zFN-~%396_2W!9&V2X zO!z#SelKV?VsqY6e7x=x#Ej`nRrh$`ypW@05k5^p~4xcdko5hyH0eov3d3|-9Ezy(L^ET@oyMAQcyJ_8U%oZ`IzJZ*{XKlRmKd1m!^IGlAv4DJgWyPO?i> zpGJGBC@KAn@w+#M0%D+?R7{Hs(-1JmC3vhQ$Xi_w-{rBA|9G@5mF1- z<0{{^-!)z@HT=}4s@592R*4XeJRR_AfJ@b6Dr)k(`kyG zD3D+SXkdRVSNIEGr*qQuKh2|^=QWdSj)ga-BNws|Hl9T>X^7L+UGa@eGTqMHCH{sf zFYn0MX6I75gx^o|;ugMfD=mLZ-@DFOQY8M!f4e_4oURTASOVE<7n3ABRa@KMV~LzL z#x_Tif4{&AX~>_MLb#ZCW>cO(IIYgH$R%`Ci&I-PNZ1K4cRe z$uP2PZkBje@O8)K_yv%jqyF1O%H!=vdh3;OfD~u-Wa+ODnJXybx)IqH( zwl@Msy)v@ROGKQR2sHOJG_0Gg8ac)KopvD)@p7`8q}%+v*3qE=%P9fL7AmpColYPT z*)R$J!CmkFpZbB5ytQrXg^bqOpXkO5$)-(tvaJmYrQKHM=4rcoF~ykGS=Trenu-}n z{Ndl8nKNAWpC3$z!~C-fFq%2KMH4S1ArPJSE2HTzR*eSv`>L|G2}#^0|GJqCMvO`q zY-eU%k!R_mOs1voDXW57_uuPa;~&08ykzejHjlbmpv*`e^f4Qxv_FfKy{WXaYqj>M zoJo6m)p7V2Q)Tg6R+#LDrCoAA0=KIqLKx5f$dDbz83+C zI{%p~%LL4zbnE^*5f#aFea;>)%c>2s)v1Zmsr#B+o5O$d;M@%}$*Uvw&hbatVG<0L z0DGbTbn<$rbPbtg60SpwbinN7A^QQTH45j^j+^ojNL`$<;FSd=;mlfl)7lIjJ~C<;@0ABJOg!K;rUD$PBK zyzR2)l}qq)ER*-kXpg=|(yfc7qeoJZT85;VoSF0es{?!e_{p7s69=;SsaH^u>{nk@ zG~#9C?{S)}NtjEcRUS6-2VpD4!P)1D9R02B6j?UOX}fBDK$1**n)D5d@(VmDszC6R+8t*1eJJQfRLpcn%6s| zl?X_lAVYD#@3@QLaf?{gRI1g>3>rxv&dDz$su|H9070{bMK|XD+C)b(EUk$y+b8;Z zu5~GM$>Mrvi?RD!9-o8=qPBM>=>P#wLev{?-?-&% z*uZ?XNA@3tEwwU>7xEwxQTu>&NhI?96KS4r2*w_7;&^T~4aImEVt{?Dv4T^rsFF0k zDRCqNMw}F_ily8$%{baD-}q6T#^42brQ)pHa>d<&v^qXh=i&3AZp;7f1sI_%9)2s% zEHZFTkNhel8b!R{lVHrV=D4ZSk^hFiPe0p4P6H*&qHFo`br|K9KYneu>Zf*VmZa>h zx{RvSnkUqQ4tLS(^5V-~u>4Fo()!^`nO82fB_NxMDk6(C+K(fbUVcQ??cY_(Hgcau5CRPFW1*9uTfRNPu$m! zzMT9Oa@eiCBR$Y^+S3xO)M8P3n+ zge3|m;Sln0fBR;-i54d^um;IsH7)5G(Z#TLVyEfwW$CAr5CoAsUzh)S?+t?_cS9GZ zrjUPCAr>T^DbnX+R;E35e?Ki{ZbV0&)>rMSBp5IrvEx8?(fjA>dc?*JvY26qg$l12 ze1Eya!p_I*2OG@FwSTT~lCyS=nLr(VY*`fuCwbRf#9rl{w6)1J-r{LUr^bX1kIIY+ z!U{!fAhCPWLXt`-BX`7^9pEodCWAsc8`>n_9i`_qNtkB-ie>s%!=k+1T9!8RazkZv z3wH;{G(_(sCc{dUIc;CZttY(tt&0)(@WHCHKL&PiINH;hD*3?Y=xdUXT%RWq0?j)= z$D*5`!Wnv2=R`6V_eFJ`kMxP0uw6JD%7q|lzgE$^F22EG+e=`hLm2dY8{u-#?3fn& z6%ZpXe!4MA`FS~QLdiZ0cRcxRvG{-VT-W3`Ip#M%+%U1V4CC#6Fd!53B~m304YA;LkyEM4{k z37wdW?&0t|gNh(Nb%PZ}D)Ml$Pq(WbX~#Z=Giw~ra&}}vLfG^N9nw&g;3+nW)G)lL zoUKPr z!VBibsOCZK@{{*$7Fbg!A^| zvf5pq#WbzoaExDqxC%b+`aCsuvBie^{nI65!{NM`m;1(Z(7)$a3N}D z)T=cy0PkNT0RQbdRyn@7^IvT8E@}*7Z}_}DGQ2nxRjyB25z4T~wXQt)3j9b^8$0gw zW>yrZEfsZk+G2MS#}f_fKA0{`lAH(R3w7@)w?vc@F@(g1gsqHPXEBzVlZ&q&1#z8uP;U zs@;=2Y5Psyhso@nqu*|j1MKa`jYam-JeaDl+bI)MlJXPDUq>jZtM{Hxl_+Zw^sqbK ztK)`88{*Z~*PpIV;;?hP$3hOFWuRT(oLe<{447;Bt73jt7a@XSsaqfG!}Ji>OQ~So zz?mOuQ17Ce!S{x~K}Lf>5X_zN<3B$0=iJ^>0(8X+FWoNu9Q*|1V;Wu{F?h+UPYgEk@@w$^*WY1W{``GNV-5&R%>M==l zMLkk7O$|pOLrSuHV)3mie_{=Ci3;Z~yR`TisVdu_&(|f-gr&vh3V;=1jF!|VT8Fg^j_rz`R&>*8-}>L0q3{9tk%S>uqbpu$x~V^w0UT??!3yVtMpFt#nqGee*8V#RiA5mykRFghXxRX(sQ_$ zO9e>n(m>o+%4WQIdd_p%&S93PLyrn8{iUqu=2@DowLL*0FZ&)?MN(S@-#-5Q5@>#3 z!tsvT9wo1O8^dcG?W>TQtab`iC^vVH0wU?K>Y?jonX_abNXhAc#!WkoA3w zyB*y~ds;f3XR!isGx8>XvC9-5c#@_V$rXK1kZG8nB|VgKZ?~SOd2qjsAkI4~5}au8 z(A+~+BTZd2X8qZLa5dRr$qi@rlsQQuI5B1WA_Py1m*jwm)*Y;Ptyrv*c_B0n_yU#*R#ta#U(XI`tHES8=J}#4UY?i(TS!ri@^p?H>_P=*A$dbmKJXD-s2;OWy zZR~FA74pAM2)Q9I;1H!SWaN30t-M=r1n6wvJAT}1+$`P)@)X1W^!PID)&_3^MW{$R zwQmVY{k&kWoJrYdFDdX-@Ks&womg(ZAn@WZX9Z)1$4-q(ohPvIa$dmI0SSN)sH^me zU~qdxd=PMX=_CJeD}3imxNaOiO4Pnk#V+W@tC61LQ%b0WQxWCd>^McR-%6B{Ratnm zaQvZ?UGU{sAta|Uxpuo!6fCL2bTmk6T7t0vCKE3>Bgj>*o;yK}O1J<3HA(xKo@)xq>vQ zM|UjU0?7>v92PgDwQe*?Vn)N0OW zMQZ2#5W3rJmwL)d7%laV(NRC04@<#U6D{*1gWX6e${xQ=QBxmYfYR7gdzf!MiJusm zKALU*NOGswgjHLCpCrIrlz_aa*AZeOLj<>dpKfq5ZVUN<4r4w}`A}G{lR~&_-VkzL zekEJ9qz9?dtF*c^=*-^yQjv9Q9ZP4OeXg!t`9Q-&_M6P895{t^hHD2Yp0($X>{)ZG zZ;G@7QB_#_94RM%>C5ZCPzXu^oc4B3Ac|GwRS4fPTVVkYaFvuFE(b%a+Z?m|=D&q2 zty{}!;_XyXl$j2Lbd2ceM-+&&puEH)NOemiE6ae{V)NsRpaR8IE#6Tf{9r?5`aCzR zrH1fBzdPcQp{=68cvfYcn?E+9AyFl3l!8S@dpDYpOMxq1t=V?5+``F?Cl_6b4CKAn z_i6p(1v_4|ZsE3T(Mq!+k13Cd{hG_c7u}?(m#@YyuIZ zkJR-8KV%LIsx??dY}|0ksI7aGHg+e*y;fP|aWcu-=3+}?S;tMAY}jvFB&bvG=!Em8 zFei59qY%-ID}TkZ=|(~rFpMNp9(O(2iB8}pQ1;fRSOq_@#5-)Z9x}do;NGXJ{&v{s zSjW=$$ZKO&V|L_Zr)#s(OaI7gcP7U;+o^f9C$UNnXx+WS?+SUC<*w1 zl9-Zs8M@e1&5iZLh6et95pO6ef0>hUz<0r>poBS>P4E5@&ClcyMoXDR6AoitY>r7w zHeGH8@+_N;l`B8rNxYzqsw7htH`>^L%h@4rv5b(M_M<-mneb8y(<(dIBFN8#dZ-wX z+NC2+LKt%IXCJuG z0T4dC(v{oad#`dFtW2kyR23yq;vEEAYuB$kxlA0Vijoy-+`!?w!eVM5I;8T93NO!R zD1^QJid`+|I;L`I^h^Iq80yX7%7Ob1&mQh098P5JGvQ|wj#?V+qYYjiKgaEs6}~>L zBX*Olql<2n37ojkUPZ~KEu?o#yxXLUI->tPnZvuFENnFBz_cua(KaS~vqFe%kuV?c zg&f6C?Lvj37)SRjp^CKm)RY;^f+Cf&nD1Dlmx?H^bQC_mi@&P+=;3ChUVq3dcdkg* z^1R8;MEbEFH}I%H1F01C)V-}lcjuyeBP`ohn1(#eM|;8H$<0Ey6{(;OMRCUjwN7fJ zd97eA=;;dv!*RECpI~)Mdr<$0)O6U40QxFZRJP}pN{URulF#=SG&!g&6$988wU;SXse@JQEs)_vio+3`E~L2m6O^#} zF)Tu_?0Pf%VQ%=~EJ>pk$X7{I^}4a+VbxC+vL8pYY)embjK#9 z1)xf7k@d{IcW*dQJCE`-kik0=JdzF5)f*&plXdq9k&@iG<6*9eDC5WZ`#WB%XfGJA zDzI1re4Z`!GGyUep=FTP)QCY;8imraD+E9c+KdEewavX^#`~(03KQ zv2rF4MhRviH)Ut=$v*UZ5ctsH=|&u&f_~PWSGa?&(%kFzy1klsUd=O9!qT~w*6qBs zwm-?HqbfpkqL9$FZMLVtMh+^+AmuOZS^6C-z)R#Hh~KhM>Byh-M@ZRv;tapVgH>SJ z>`)@Ia`}*+bF7y|q)oVoVvO`?Dw(1d&CuQ3Y6s`;gK3C z@s%7Yd9-?3O)JFa(QNx_x*3*&Me|KOBW$|WKx?m5{~E^3%V}b^9}x#>;y8dr$!Qf$ z<#nIT}F;#a{QWS>lnq3*cPT?Z$h|EH2d6MrsOP){YGhR8n0yU z^!|4PhARndg^gA7q4^g4uT(kS(5h?dx4h)cbXsydJ5{+!6YGV2V?TymCA1Cw*d5p2 zbo$(0tS{#L+tR4*@}WfvtnN-kq7&Xx2g<7mQ-SHGRVg;dlx+KZF=`g9L)Dx!)8{&8 zSgOpEQ;e>;sJEH79FdY9T21g$4IGo-ua%tnTz{;vh$ubx-g;gpe=9=wtcZgS?-|?A zBWl}1my2I;M+qmVeQd0o#0eCh8%*lfakMczGU|VO>Vq}@4mNK2yQ)FO46Z3?-*4 zB^KI^O%nGk)ND<>Zvyd@(zO>(_ou?T{er zX42O7+$AOlcY%^?$w3_LOEW5+1iH@?7#&jWS7j8-g}gW_3%`c((*_Bw0>>-7Lfidv zj4SC56|TRInUv6Y-J`ZyyVccFsOVu+j#Oct&MYw7fwD+Y%1MT_@)^1lhBEb#;lTI2 zq^?re1evO~J?SKtV%Kkh2}$*Q-w>^xMVjs_p8P*u!}B4Ju8;(V%>=Zpmq?oiEs znA?$0KQRwqzJ^h4N}T10n1ASwvQR10M$x6Fw;7YsSy1U*-f)PX;IiQY;NCf6j_-=+ zTIWh$K_=gr0muNuAK&oIezI!Jo$_m2OEx}hN6E^N)J-89Exr%o$k2A4G~G|6$(lcu zi<}G;Jl@JN*VsfXX^$!QsfSlj)I9hy?Oa^w`9SNS0SYTlU*;NxFER<1Bj4{u`T=g~ zRP!WW#42g0Y~$)A@vGEry^`81%?0Fh{>-unzYx}g7*wJ+b)7@JL(zu08Ez9DXZV;) z$s){u+HHHQ-p#$lPIDt^p~4p)PF|_&yrPyKYpXXN5D3BI*<&5ns6@2MPg>Vq7@ryc z?Qo3!HTp^xka5U9q{qDK=+#yGDSk2}qy#x%@)`|vA!Yu_6hdvbyk6T6#95&QfO7lQ z%O!M}>&f*@zwlgamsg5or8DmT zw{%W+Y(sG% z)hJoVJ;~dvO3@(ctWo#nDL6fX6?02{rRlWPK`C@E6FKz2KV;x-rtueF_3hCrtZ)m+ zDL;dbK)&-m?K%G)ub7?`Z>Jt3c~YOQv`P0{$!->$U$ z9_kO6sdL$)A?bv!ZC_!} z!%?8%tZR=j-5FOJBA}kPV2gC{;s*YK?$UeZs5RI50VLo;<*`Yom6z)0C0hr_=rk2{ zds=kpR0~ZR#aG$Irz_O$Pi_1upbwB>J+B#SQ&1QWBoet4s#&}|Orxc_@$1VCv6T;b z0BMwRU)_~n=~6BU(umOCOY4ZMNZpE+47MJNUf${yD4w zd*%YUJ-w!g>+BJ{3D$8c9*lysrZGj%)5v_Ll3z+dEB}6xZTI(jQ0+^Akf#2v?g>Si z{I&I}Qu*L+isIFo58w|X2nD&Q1gq|`Wmt?9(@!UVYzl=2sdL0O9a3tJdj#_%(dqEW zJIt}Xa&8ztbUbd`Moc1;xLMyAra7~Cm8BE|(Q&L+q2ck>9sbWer;;1)d+D(Ft*fUn zrP-8tKwE@2buYmMiWA|nB%~H8Iez&9 z_7shT!hVuNy>Y^h?`K#J<>i*0vc9OticU<5e7*4r*&Ib96QVB+ak7-wED-#^`R4|>sLn@ zTqu^w-xKl@-(&b2z*Fdm0P)OHk26Q0#MkEOYFsT*c&+v^A$d_F^zdT@ke2*ON9viT zT3lH`e`}w6El@9njc8cN_!igm1WP6RPrtEuZ~5HyxlmTLm@}1f9hI(HZP+cYZLz~o zJKhH2%PK-IZOz~*OMf#UX6cs+T%rAPw*pM|yGxUqT24 zUlgpl2N;jZBpJFb)uEkV<8#@{sq-dm&8_>96;0IgW?8vkm~%Yb^78^M<`sZCzl5dl zlF=-^w~-_5%l;%rH)0WS2Mywbp%_N~&~^b@_hB{``aT?$-zmp*OJmY;>PTy&JBy z=R^zwm5tu%$nW2w#mzSlu77f#G)FooiNUuUYi@kkS<_%`z~4&~B#xo~$lOvfN>K33 z5coid5({>g#T7PL<MO*(JRtj1Plu>D0)B#8X0LF#n} z!*u5<^8|(jE>o5=m$QAL0WJNAt>4uBazkt8*7jzxF)@*)jexI7$+w~c4)Iu%E>5l2 zYacdm-fL^X`G})u*^`YhEq{I`o^_mbrZsnDkX(?)CPRfsh6$wCh67mgsZPt6$kF%k zKb6eUwJ+Z*GkrZouj`S5>~pcrR9O0QKl08$f&C4n&Ir(#hvD2`w-1m!UmwcoFwroPM7@7*80Z55+e@!Vo=T!%(GNrrr z{Sev3nPvA|de|9#Bg+yPkAKOx$ZtlXtAH;o%~vK* zsO9zFAC}8qw}w?i{uOPTZ)lUM^fO~7Qa*cGg;w!_^(k83z3FL9qzVv2Hg8fUPqw-c7D@#Ur6VT=c1$pz0bu1x zu;xq1HajVoy)E(841TjO6VZ&XzEda`nlOA$L}G3!&js#>vfea-Jv3V_1bU@9&6D@u zeMVkmiTa+ohgv1awT}93<(9dT=mWurb&L*=zDO^#Wlio8a^=2vY7CB5E-|IB@em=X zth4^fz{U8MwVz4?_G$SWQfobRUe@n6Y8>9C0@YKP)<;hgbY=eCulnVs&E)kc7LXyC zQJu-fbH`$BBgAncF>=QS^vM+$sa*_~k#db0*xR4jTiUtp*Z`@ZA$me~CU=n+5gSrg zJ5y&kU>t)KdrzhTJ-Ps^dU_$kB%rq^2KO5KEz*Kf8C;Tf-Od5xP3F_ZP1F^(9+4P9 z+re!(B?(3X77o11l=>ZZ82>&|igfe?+A|;V`~-(>p61z$PudT3_1W_1-?AcX?Y`gS zg%WyE^59YGB6oAlb-BfO?QxWJF`2`n2wqAUY%+xNV5xw8DmYM2kDX|+#6Q#)kR)0a z&vS|236&B>%bA_3)C8ib@NVh`*#k@=`DR_YcNA!7k1hqHh<|zsPP@tRX z&j!xJS%g;ecF>@t^~2|eq9^Cb7q9rjPnv2~CJyVWN4pcf4i6;bM1trfz3V<-^O$3E zbDf!p7?1WwawH67?5mdFhSK^eZAZ%DoUKIIadaNUGzW)yVg|xNe+_}F-$Lt_uUePH z5T3%Ic+fsYp&iBr9fwEpC;Ci@4-rmyt{fX>z+#5w$9p6*ug6l4B8kyL>w9XJrF0nP zUrOo8BLy}aHAjy8Okg9x!rxluAZA%C3OxCuD+ZrRi3dzie4Y#HZ_dpZ_LcqL*m;O; z4hij&5a$|X7CEw`PfOA6ln7R~zATwHes)xS$u3gYaYY*DL&9yVG{BM*5?`hoUbWQu z&X4HGx$aQlSvm|)TA|M=$#@v&P&7&sX0|s1opKoGMzakM;R&wF;*7kD8Mz9P(V&$A zzdC^~dSE{E#j983&iPrFFJ;CDoTby`G0O==d;YR{E!Mx2j^+xRJT1vx%7BT&pe+F% zc?<0;^;J&5`35a<4FiW%HpkUqYU}+$zy4654^nu)l*Nuo;?#FP+iKYb*N|kHMU48S7X_~yYrS?@L}OaeiR=a} zO8|hQkTn`w>ek>b`1=!s4f$1;e{|#Z(g_9|cY%N=XA9ZLm|fM8*XDKsDUuj;XFH)N z=-L(fEJ>?=eLE8;tH^Wo7VP)AC^sg?n{cEn(T_xtP+|Jbj_Rz(qG)Py>}yHw$xU+eYx*)uosagZy&o-8N4d?2a%LnFJ9nn!U6u=LRw5H z@Rii8Jnb6ssYW>#R<#ao9XUrVi2g^N5A7dn0jCQWsy%04OW*%Orvo&wS#q6}yu*sW z`tTder0JLot1xKY(-ds4s^(&`XsI*2ZE(_^tq(8F$#*^o`+sOU%djlFrfnl4ph$<( zElNsvhjd7HOLwN@QiFORXmFgTOZx044#A?n61tvV&Qgi5RUId$^qVb(Q$=2A9 zes#_;YxbVlVVSh1ajb!A1{t%;u zwG_D>$fSAYnSugjK?s)c{h;r)KwSQ9M!v^zaQ10|toVN|3dnzK(P7Z_CRV4iVvNFOnc)-c_IRi6iHkd4Ob6|=^r zp^Q_~zRT~kA@jZgwHN))YPN(Zd3mro}WFR(W?Kcha7^t->y`;!^NZn2Fib=BBE zS`QA;1V|RRB^i>)qC_J_$-Ya~OjTVtr#f?mpKh;3g^sw-M)Yryp}m($0miAE`ucbP zzyJV=aA}XL>Wm6HI9#`z;|<{T+5C@jY2E&i`4_-0?4^f4)aO6&ZcCt0+}vUqlj3>S$CL}fQ8$x22QR?m^Wp=nG26AK{F zS~#dLJm1j;hI9F!XNG$yOSdF8C%g!Of}}Gr`@69kPewiB89MiIV(aXCg{z#g(y^Ln zt2vOLD>VAv&=5}EouUi*6U=BX9mUFySd$2b=UQz2j79a+Nvyv<12>9XR5iinkt|V^ zsI0oWgog(=uu1CNoo{fT{7e{t5#!*wL;M|^I1zpkp3r2}P4$Gy`ePgMh}U8V8m^m<0;JNJ9y>KC z@Q;ssYIDuJji*)*R+yCJ^@rck)Yr(_HigVQjgQ%3Ov8zq9=l`zURFnKy|_FB`OLl+ z^XuD33AeUGxcjzRR^_s+Qo@!sFF5WVFvLD!(XjF>DAbr~NV(%d5r6@rnU%~&09r(k z`@am&hlBr;82fAHCs&--MzV!NWX0t)HGy+VqZ>FjtNY3{TjH0jI?{j*;fqvq4;X%T z0FLB0Ds2z1HMgraN;6I`ua|bCO>O^$ULj2y88iI;O~fLEiYxp^u1Yv2F>(JF>*Lah zB}<2Sb&9WfXq8adJ7MbIU$J0NqejR5wQ`Z#q?_y>x%VFXo9s@x8zjB6$X4gJvi@V= zo8o1>_0-yX_Uu?~N#b^6fdE;i@}-QEMM{*)J~RIM2*&*lfzxZ=yq;t44mi5LyVYBo zoJ{1v$?!fiRa4J-MbQ!iKfT-SX^N*Tni1yr?1K z09d{dzYDKx3h0mw!GBEMi;qah%4-3W|DKQ^>Af(sy4A1AT7Tmp>YJ$t+6HarWbgba z(zr(wP(s1ttnQWGKX;^5Zj+g6c^UaivBymDx(LVqayrI8g@T0}B@cIQaaX%4^x^M{ z6Vt389V)vAN|s8eUV-UIz&5fQR9@z_U!q=GWZOtp-I0&inVLa}rjry$eMn*lH2IHQ z+OJ3iTmz}>c7=t7nZR{`fr&ZMV71nPAYf=qFHv6_m@DWwNg5@D^?gXxxbVRNEs0^M zpGL@Jd&rnc@ZNbLnL+Kz)AkiMNkGCn`r~!@DCTYsMB#YwFm zZQGECkvGlfbpbO=zXV;IL9-J8AsCST6o6;3SnT0EYkm6{c!&UkyxRx#*&s@CD^Ju&!JJzxdhld{wtXJNUFeX}d>3 zej(v=e0RS)=h#zGQyT*AJ6OI1T1^P%A!6yIyk>O=iWtVR1s^J)d!o?yha4JH_l7l- zT1x`@3;lsE61&D%p>84MQVQ2iwy19PbFT|rN-dm_vm7sSN4;AY<}%olz*O$+y@<)H zhR%2_O_b_9o4!>(1>jdZuhI;9@#Fi-La8)L=I$O*R9bL{#O-ZCot+RvqfnZQxdb;9A{yj%5)+8ir$fGNQIwmLiA z(lY^?LOK=V>lAJ2u-y>{h!lodVCJdTrB|ynRTNRKd49YFY?E|HI&|Q7w0c@@b8{+H zq6$F5-%RLu%Hz*=y*}(c^StHMay=jiW+m zx~5){s7E++{CsTQ@$&Z$C5faLNxT`xw1`S|X=cbmDJ13vuQ=U;b32vsT01wyy6xxZ z*S9nY%%9@o;?4jW1Hr}o2*+#c$tlJ6=PwTL=E;pIf*GYZv7+%AQsE)JKnt>DtSvFY zNzUIm_M(gbr5XA-8}4Isg!yV_%l3ltI#XgDEfgQ%jv%c*}uGPRdJlk!Z=`NsEOcu4x2;C@kH=IU!NB=ocH6Ac}(Q3KM4QK`I&O5jX!OJjflF%p5~YwI&Gyw5jSWgM)6fH0|-0swLW z$b_)=30=VA{J0nH3YoG8AsE0 zci}{PiwS~Ah~6kF9NL1b=!B??Yys=Z*h1}^f3OhIIo17NFSXGrlY%_{3YqubX4e+I z23X(q5R5CN@%3a6tp57?u8elwpt@U`BV*k=4Bjm48_xy>2^m6M$ts1{-P?imd=dP! z8T3Mp=k|2TdA+%^pTnzPtOnW!R_!~kB`fQW{90~BM`=CZWtkAE!xJuu?IbU3Yd`9c zj#Ycgept+GOhGH-@{YvhBeiwaPP?{cQ2SH?|#mNXbz+>a%s{uj}&`JQv0ayZq z0gh(8#mVa7>Hx$aeA?^CDWYiPD*p_;y8f+Pj5#`(WVVjPBBqAMSWD*W*f}y3920tZ zoI+jRdPfhN>x@Vi&$-`&cXJ~`A$O?B(Ja4oZBQ0lV%N**Y_8ge3ys=rVP>f+$ZH=Z z39oxWVu?_g*`y7lnWElEv3zpzTO z=(my)UTjf`q+!h57sI;*G{#^5eIFQki_FCbVx}{2_Q@&6fz-^vzSnG}nORs^m|D9X zZ+zwPr_KI&7SrU_jIy@P)18f4ow&Od0h{%206%y;-e9Gj(*cq>Y(rpn6FE;`RZFm2}PL-yBn63Z*exuq?=KFWU8p3k{?+-v_ zkz<8Sw7S@xcD#Bf0}@eH`r6sv^X;0^t>p@1fp&+dWa9TuqS3l6KmpnrPJl!VcOJrM zvJGpt&rHTBIU-@jH7|K0kV~VRoo{|+9**~S-K~XC{U}A{rj^i5nZT5SUct@J=X)=7 z4PFHGjuz{WF7Qplw;W5Msq?rAul1R|*`lXkRFXBGx^+trnH0@_<@A5qx00$;!5}t> zB=gNi;b;vTiaV3DzC;dlt)Jz#zQz%A-nh)1zq0*NFW>Zw$LjN5gmYpsVg_0X zhqtVGVW%mj(tm%aULCplPlf%X=b#4_e=B(kIoW}k=YBh(Lp^?Y{tB(O{n;`|4xI&= z6mz=;rq=U&cktPzS}fI1h#EndqRW9guGSI2;=vm^7*2YtXx3#bv9NQro1ie%+_VmV6l95P6*b z(MHRrWO}gy9LuSF1zRoeoL2)9IHl~qY2fN51ske zJ>tX2$Ouj`d6d=E%2gy5Q5y`Y7)3E5N9*U;hT6y?2IY{rRLJ)^e4~~JOeYBO5DL&Q z0+uXW!a!JqFfX88Lnj%>xVkZw6M5$>Sa1PAtAIZjlm{a+UJvr5tNG2%izwf}e*KyW z&{gIO)qd7&{{cXVl#uB{wILpxHPrZ^oRs!pxpRLweok&~j}RX%88`_YcfE8ftiV&|VgXhy-sD6xL5@2gUNE^TYOVqW^(yG*X127eM0AENy^X=QW zjf|Irj5~n0lDzGYAk2tDndO^eO82-?T?KCk@P(%2JMUk+g48Aj(41Zb0GF@2-mWOh z?qrxa;PUsj=^u-6k8SQ3;`B$YzC{O^u6($}zVNeY&6gJjoV8_;i zlW?}F{G)3Z9#Vc_f6=6hG;fY*#(KYT%z?46q~Uap&Y(su-utg1Na@Rc1Oor+xR^?^ zBS?O?c1RS;lU6blN!`FtcN3_)Vu!75qjrEN=t}XY(eDDHGyJ(yy;Z0RHUKkq|38LdEWnt8FyKi#O_zy3y zSa23b=qyfE`)s`-Xp8QDb~B2~;Itt?s99VD$eHRPESAfORhAJ1+@TpxXR9N?qZ)RE zh|25uSp;7$Gq$XnKj z)8A;Bz-Kv}@p4503M2s6Lu_-s&IVuE{&X2TWkdv6#36?Q6kJ6`>BYtV`+X@^?SnqZ zJOdCQ&q8(Hg{t%ZIB~lBKQYg%9Kwrv{fH`H(^hM+v_Po_G5cjl`-Qwj{pws%0jz1kLcMLTn0i*ZR2C|n9 z;7@Mv?SX(V3V=2Tt8JW?4JiPE1`tt(fzBG`1E@uKw#G23*=jeNzY@g0EY)M7^3Q`@G|d^z{wAH&z%? z3xYAr4evR|S~>bRsR-{6@fKnd$w&KK@X8TKL)w6AktW+xlC`TVS0_Wd0TYaDk(gx8YIUf}s z1_BoZHNh7`fU^=w$P9TOLrjFuUOd*xby6SeSy_RcG$g{q5Ls5bQ-{Nlm(`oiR?&>R z5VK-2H+x~4>ep~cAA$Xal#I%B=KT}7RT9h>vJ|)<9YOFR=+i0!Z>q{K^1|kp^JMXQ zq%A3Gcix)*`|)PrU0UUJ8zBvrVSqvD z3%uvx8=cdzLxj?7aWn)lQz#f8e(=EKsyyZ7P|MVh=(_-dG|&z@joMd$V~~K|HdohA zNihz5w75#K#!RLtO`!BnoW2DV0~6a75PQ)fpdWBCQb16Hh*YzFd|FxrAVTkeD-wM; zfzAlPZ=|PkZjq*K?4J3IJarFAKyN zpR){@F?`^7`pn+xk^IQDEhH2=RnFri(mfZQ(-4%G63Pi;_Pa`F8FzxAc0o?^e`4h{F2h;1D#vteq{k$lEcvK#h*o#|505zd=nn51Gl zn<3Hs=v$8NErhV{0AyTRqm!kEJrH$a?dPhxx`dh|^CS|IH{(nJ)&&lNo#kr)eWy;i zz8ZszAn7y?dO-VHthYeep9Oip%-d#iGXTwnYSf^GT&p?hODDTPAYzW8kYTxQ0aW62 zmtE}B_D9R^cU4t#;Guy~4;-=E}kyOE&*L9!s?jkp55^JZ~B0`XR%tBjv>^g3ctGF2kEXeyCY z|0s-ypU2-9D)x77Oz0P4z3@k59WvweU-JrBE@CsQVBSv5EujQoXNRkW2p6hc6PS_( z8rWqCcMrJG3=rNx2`E+8)AlGjzr`$B6&$c6Yf1ULTBlH!W)|%Izr%P&qfq_=rE5pL zw4z|8{l}}HVcFy86B{K4)oSPM&$6`qL|0l=t7%_GbQGFv?h6m{aaw@>kt3=1^_jQn8?nTeXqq1Pg7@ahVP(S( zHvFF=HKc4lI{z+~dFkb<|F~7k_=~csFgG)OLB{zA4^Pn3fJ;6ZQ}2X5d_9?$^msN_ zJn=T{c&h%KLpAkOds}*_mZBo5wgMU2MoERe^7!Va-eRqZ&+txmVPPPs>uk=~ z`5}4~BJ1*Bz_3L8R1eaFn2ZdoLr8)MLEmV2Jzqn92e%p8$HVvukU5-#kc}E9A_bF2 zuT!Uns3WyYI51_7pghl*ADuxDtZ}fF>85v`s^cizIOX5~G zB^s{Y*nQ9OzC5a@qO_FhMj|?Q_@RXva+AJ=*0n)fsEQntc}*HW08p`8GkH3A???-q zPfd}Qz5ESoStcN=v(lk0-w~(7X~B`Fb8AlV{j~2b4uN0umw`XliX*Z%{ir;K%7#!e zRgj}Hfa}Stn3r*|i5?vqNlvNM>fh+d; zQ!a!Xw~wz`)%9}&YOmb<@rGn#0*Z=T63X$02C98$w-7Wb&~k?XJKClbT`<2)!y@1` zw%cA4&hFA5Q#*gT~zB3vtutR;)qk^C@Yq9l>4r@80(*q=ED9GvS<8SQ?wgZVLK(zk{4ysP@TO4{lp*|k)40e09tDVvOWNl17(ocT{j`n&Lwf)b86%9dZt2zQ-CIB0L2(=3z}NlEE7X4&L_ZM zJ#hPW&&a*B*OL7eyJOh(YTp|LT53wA#gPV(a~O?AKhrG(pEmK`BjiRG?oBngf2>nI;|*>ISI-x%HYcvXgt0YiXjaeUeFc!0_y1GVyp2~?~vfRltn$L@Ak)@ z16|!m_Nzh9j~SIxJ_>P=UXp(PXnVB}NXLainKRoFL$C?Mz1+9U-4F;EICUc>744?~ z?QBKx?gAohVV$R7B>;&+V43HjQv=mZwFJuPh>>4gfM#jF+L~nDcw-k|Tx^ozgV;9e zYfd*|&XRJ$jvFR|Du99%5F~VE07%eNqS+d2JXBOv_j_J1M*sWPZ~c+*gXfNV_b%ns z)WiWrIZeNP8dAg@{tm`L)IG6-!+O;vp}0vztKF4FAbY1!Iu9G(rNs8ZVj;C>$*}NwMvpYdwV(Blg-)p64GNJ4t!HKrOOu<M- zXIVy85hckzjf<3WwSdl1L1TG(aGizMR#VxMXzXqUDtFUcYH1(IH()w@o44gbB_C=< zabCvwkz)RlJJ6bZd9<|cl(_X-uvUj$pz5v#JZyxS0wjg{jaNn`viNqVmWG@5i)?LQy zJt0U(dO*t^>;z!WowI5_$Y&ZnH9vRedICz!uZ=E0i1^d7W+ht23dVXC>j()mXlTbdUTPSt{EbM+gO@Vm-@ny);)pv2(DIYB?5geD zn4sUtAgTaLedi6oPmPDgB_DUX9#327O6vaE3IH8ZmX(Bm8*9a8^^r@BN$6KbB;H5( zL88x59wqSQ&S?Xk4k(B|Sb_+!kz7)h_PE~q1Eeah%egI6y#hfE{>lDWZEW$pG+24I zGjPUHnY1hA#qhl%FAm7Wn>}B#%U4NlZd&7u>+Dd2F^SdT3Fi3}2l4*-uVj3kGs3vJ z@whnC3XfbNB3q$!(BZy8dY)Pwfmu-GTV;-UPcRRa99%gMpD{0ZUyWUxc!x_H|2Y7s zTx3e`bH7pux|E{HMCmtBEi$i;Yg!f(<3y7^3!)Yo6c!HwXx@CaAp+>(lj4MB7Xv4@ z@6(fev%^u}U+=djE6vx!6fM|Zq^6wqb2hR8_6!cImYxf+8A@7$^7?FU;XShxsa6H9 z-5Om14MZ3#47ij_eAc&UsclxQL-Q4Q{%!qIFyg$>0dvQeaPV1~N(4EsBlhS~Ka(AL zwVZL=E1bU27Z^;*PA=w_>RQBq1Gx)#YxwyoUFCJl*jN37?;rEF;JcQ1gp8GP1QxXn z7W%iZC5*Zb+#;hYaV(Noo~k!&NmPo9{{gTk_8f%522kf|gMWTrxEB+g*Os$ULuw1Jx8I1Wy$43k&<{zBd6mqf*0P^Fpz&DesNO(hULdzc0}XU}_=i#Fh&kL!JszG-SJB1@o2udT<`RWB6}avuRl-@=fhub4(8v$W}o}xnlXl(oMOrnjwz69dtay_7XNPA2gy!f3i;_7r(swLj8%Qex2}LRNL_TxK;`4ZajrGF>W489FcjA zc{r&q79Em$9;d`Z(TgW}S0*PW+5pcD)cKm^LmC8>;P!^9NaVBME!Nkqw07@^<*c9e z?;2=C5a2!e0078cd%!+-8-UJqj1UjRe(kf z#I^yDNQY_ASE+ogm;)sjD!|G!7fES0SN*cC8*JHxQ7WbJCI-rIx=^1 zKB3CLP6X#D#Qo=+_yJ3}051wkaagN&!j4Q}0$Hu=w3Atfp;J@BKBToYu}oV4>d*LT zMG)Rv5c#*DCcAMT7#1(luH;30S%}lQDAHQ9SEfs9LsSat09xv1cfD#$H`NN95 z47V`YT*44P!xRR#0l@zTV+XNs;gE7wnZRy`zhG;{=wJ**60cV~YRpuTJVi3AjOba5 z1}%tKrYh3;G8vZepK8tKMyGc{5|+edg7)s+JFb5Nq#yA)VnJ<&7Saot|8GH4`*jo) zvZ3r(XWFl4RN#h_5fcjnQT?J?f8%9XSxTr z79zqtgBxNT#~;#KwO~>;uh8hd$fIYx^ZO!8rI(-kiDpO~HxAjMl_$a!;@tzu)FY3j zpEwib>n`m6m5U7wx&}yRyDu#H4%HKFb}j*B=8M(*+xbPTUlzRB@qcEwk-Z|(&t7o_ zsz_9ieIri#8cy}g8&8s&aoMbljiY3j^F(=*29VBn_GB*cy^D(>iA$Z?T(#924|pQM z*+jm759}v_!tii=W;H;p&5+xZm)l!D?YJ+^Qz&>sFK=Vj-mI5@D4Z`E%i4!|rX2!v z@iFO7nWn%;=uFos3K(Q_zWQdgw=o!h9+fuM{$ZDU>W5W_gBH32fr#~z5mC!HlWzEM zHCtf%e2`an%l68@3=!_U!8o>u@a_iZzASA%l`i8}<|KOJXFFkPtw3ZT3ffK_QDF43?>&eehFhwARImI-JZy(5grPk_>3O{aUsH8u;RH z7GU{*2QobrX@CYOj;E%#K^GpfNCBK+$S$QCBbin$y5iz$qcH-(+%C(8OE9-JEn!Te zy1xM;0fa>QMFvW0%6O@sM%(i~kGR_tB0dB86(ZcI)f#sKRJDYdm{^*}Os#TC0stwM z-8#oaWn@GQ?`%TY&j5QaB8LIlEz={g0=D9alvDlwLEz#GDxnn6ItO}tCs5e-7wf1% zR%E`IyZ2uy>KpM>d3fF9y5i!ee+eDiU@FNFOkuVD8=`W*=>6o-7ovj#p z{V6n`xD-jC-*ICpabYs{R;DX7L*_ncqJ{D^%_jc1|~afe;b0Cq8s`sPE6`F>Pc){@+mw56+Nt-M|GH1H9EaFd}t28`0*ULwS2I=AT z5qpAFS#@ehU>V&I(COYhe}4vQUIFUwr>7?-Y^#9oPC(ce6NdCn%w!N@kqIOlELS9N z!693FT)o|&uOjW#iG(y?0GJ+ZbTW-B1i|7Gkl!!PyOHP2P6wa;yLFN9*#1H?lnyW6 z$J?_#a1f6d>kvw2hLFAP1Ywb;SMEd*2z2?aT7t1bLMoOmeXGw(b!#&g0)f6}N~YW%cM1 zA}vA`1~7Iu5sa=*D zLc;;KfH%dzavr5R4h*W^v3QESTt}o|;!ML;4Waiy?=%mHKh2aMx04t}{jZ$?I`uVx z{SDquT@GsJHmwf`2u&a{o?LdKWv_NWGqSsssM8_i<)mQcC1b+r96=8Bdvb+7ezEO+Qt#p=Bx0dIbfH>VgRSkZQlRhm{o-00z*E>7yAfzzybINbol zGTLQ(`D*l0lxC{m^!L1)tigv^i1j4dmp;5AJYVS|ED+%20AzCgh3RUo1O zndGBQI;fZF!9E*(jq6Tu^w~Y18aL1q--8(#s%Wwa5NRM?UJzMdB0#@z{qi1kuGc|3 z`PcS96r|w-8Yea&^-S6Hg{0Y_a+U%z4@Bkb_3)N9g(C0MLd4!~9O$xBHj9J(Pu*9?3o(!lf?#YwuVLw6 zrG-_7>jDN$vE+h%9$j5sOv5_E@iZ=AP0>F1GcetplbsEnGSUa?up|b<4`7`{K3I`f z3w~UE>ZP4O|C^VzUUk0Uxb z)fb4CeKrb8W4G@NRM_YH_EHvtqO>BT8X{cfMA^r9e(E~&Nr}QmkYa187K&LRERqIg zs!-(t>(n#n+U)OSE$J#TIy?JOLgu{v;1%goq1x+v<HJ$!nqethq}Wk4KLYPZd&(Sf;NMHcT+zkg;ShojwILv4LoN+aCgKGi zJ92^v7|3ooGH>@LVku~Dc1t+MqBoMX?w>|R=nV0SEImz`{%l$X-yR0Rs|&2EASlXL zT{%pP!Ve|~rZF$?`o3dU3Aft9OBHS)*);UcUB|xR{?n2`hVk@sFjgpu%JnzR{XT0!j6K>g+HWYOWGeqY)Kgh~7tN~N(?4<}jPjwH(9`uT z?O8%|UH*w>a;2u9`?I3vn7@o(9(w>IGK$U6_Od0iQib|yn}XLwHVxORm40M1Hn^)x zKnuh{j-_a_Adrp@1hy0-q;WWGLK-r^iGSLa7pH@>wgXuT**5HSI32|Ms+#bC>?e@# zoK=wF$zetaS|Y=Xzie!5l0}6WAXgap6<+&Dn-F4@PTw+kd$yLLtnCqJ%@*3LSH#%o zI1ot;St+CQJ@FSN$R8VzWaYXazDZNW0G@|JVx?UQBHLY*iJ=%Gid9Zc z>Zp)2hHyOgF0c{;0u%@HOvEtY=l6VmfV|>h5y$9ovJiQW(x(cJq5S4TL%Z(b(`E{^ z0w)^5g=t;#xfv!V=HRwR_*6gEq(g9@3K_q0e1{h~RAC}Z3HWTOJn=d%C~2HAR>E-y7P`rjL-#y%3|zf=ZlDnFt{`>gB}DfnL@01 zHqM`67ktz1HO#1oAM$C<7z1S+_xvG#@2&1b_oMVP`}8wmC3`p>I9%3J{PG^J;murs zHb4BGEERl`%E_lFEaeg0wpUHN9(|WpJ)%&SWLWsUIEtvAh1=$~A_G?s(YI8`V&NSz zRUefs4bGQj221sTcIWbD=8Ir0C3yT*@!sOw>e^K7cccUY7c7DyA`av|kr6`R)ioO25Q%9|=y=_Qy0;|Y5kOnB6&i(~i{ zg>P88Cuq1Ena&oA2JUGbSh2-K5EbR?eo6a?M&>Lrv$<)(UHrBi+$F2r!ga^xwHj~4 z{WEYN=&I9-VyyOYVM#LL+wjJpY%o5yY&%S|?D=>CN$Mf1+u*xi-1rXp31|+qhP-*C zm;@LJGs7s8?|EtJq{Y>fi$Z<#-=k-Jj~n}r#EjLsTJ_mT`Et!pXYMETS~*n76ccS& z?8_Si1n(1V)F;QHB1EH%r79$>{a1J3Mxr9&1c`| zO&N@hkCtI|@IXU!gFksn9nh^YO$O5T0L^1&Z&yC|%o5r@3C1_K*y=CLbNOX5ZRJe~ z-dqLsX^mL>llvqlFS*1gPV@m_c!lXnGqpIc5p%~+Ie)5E6r@vr+_7wGL){3j>%;DKoTjDPvv|d-cs0Mh4HkH+x8W|dtSz2)qD6_ zYi6Lhog?9B8?7h+C4%_w1czHh;H^~HCO#9ES;(k~;mOJ4=AjEdm`RZbZVzyNh=gU}WDD<0ehVsSxUUo&$utgS0L(@#zhQ`!&GMX}6XN&z; zLMzN;-ESzB+RMCX7r2wCC>m%~0~Is!ZSRlfTRyVFeql$jMobmj=L>ov5mEZNOUX|y zsdL%i7)(LprjE1H2+J#Ay$2oW&-Zh3w-jKEdr;*{n3_?i$f*k3(P8GKewc8Ie(HiE zQ;L;!8Lfa`cLy zk7JP(3|BIfL=~%Wqzx1?q`~x+X`imNGjR6@~L*HpCnMBe#~Yi*Can8`lv zx4)3%JH&z=eXT|vT4o^!6kY4n0Rc~jxMA1*@~upy0|QFc3jx6r!4a8Ezhax~cGU(b z3gSv5@|lzl(Z=ruqXoN*LiwdIj?`Z&?dZb^SU+1dJ%sf({F4%Z6Ax9Pnrc?j^c|i> zU2OYoWFzoqbk+vGo}d9`{+uV8W{F-zN9llwikN;N77TYR_0Pj`{mIi5$QoZfQKCKx zKx41O)3q}qs_l{;5?u-bJ)OdoMU`FV5rzKcd|&DOYSLS&3_+x@h~aoqFzrPq#`3&D zRb8rHWoOI;&%ewN)t%=biE*43yw&~{N1z^sT~h?iRGXi;GK&*NZMhX`F#b>;t`-G@ z=*Kg>?v-!D27!99I^=gH}G+dV3${d+_ z!K{X~bvKZrqq%6Rt{Q=OANRmUK1fzq-aDs|87(zJ=MXU}HWHC*D`p_xQC=lEQ@#s^ z+S!?CY1K()%7){ZtX5;6;gIwiUOgyXG}^~`7X&xH<1g0bXr?^ui4SaabuCuof=7*V zokqXi?ejRh@vYs*wY9q(9gKdE+dET5uatScEuma3>DRTGY2!Zuz5>kQ)nJKFM}t0P zQj1Zn270r;-I;`i|H{*UTWu8>+o0t>P!*{>d;yKoF!s53$`vWrj`)(-Hx*IG1im2m z>_>CYyPO&_#bM*P&Y8)nSZ`$Dz7@4NKhw-n?|ElD0S^kns=8w(r(Qf;QKey@P`E9H zBAXmz3rkPc@)}k8>Xv&k8)e`u9rt^lZ_)B;G0rvl=-p-p@7}UV%@rk-&!DEY`6|xB zI+McF>o(G@vUEd#$oavlbJhl>vyCc}8tL*gGfHsSxHlTKIuFoktL4TPby4ce=TN_< z`54^h?*%Y4-ILEtmRWk*P$}Il(FGB#1y7P({2WknX3avJ3QAk{u4H3WgJa$_D9*2l z-OE26?H!@J_VieJVwfHy4#2~KOQ4COJe>>4cv;t7z1N}T@q%K%Rm+phGQ}Zi2r0S^ zE0B?kkl;?m+pJ_c3TzW0`0xK_0qPWyNtUok4G;u=o}X#><6PzSlQN-1F&cvL8vrN% zWNZqv6U?%W=vCQip;-1Dx!&&JPu7Tov`O9k=Eokt!>j|=%I}(eSofnnV(`3sMHCO* z{~=p;O%!?3(^r>3ovpvWyDgnvOCJtC#Yr6GmJLJYXvNn)*h3`wX$pK+d;gp*>C&jx z)a?5fxwv1zJ5fy%b3fo5uO~Ki!|X(B={Y!KW^*YKmNcm+2hso zN@*gaSRskt@1`ZS2e7g+e-x>)r+qkY3NQxV{7_f>(BsyC=>H&*Lnh~pToWsbGz89gR%^yD~I_cW`dZOSCAU%g$| zemZKL`yCr~mnlYsW-v6Zt+`z!2eff`&E32~@c2j36MRJtg9pVhc_Yb!zTK|&_SiJo zUEKwxvI*!5OrZ#jR}0s4(7oR{gEEkjH@65mw+Px}jKcV1nDYKuJ)$JN+-gBqlOscC z0gFt%3v*1~onkf~krbBRi+x9;Ajki$D9a}`rqE3bk=1p#!<`=_3oFhcXFVMb^o4T1 zrRsT<3GIqjB=6P_yx?{u*19_EnoeDf4%LV-5Sq`TJ=aY{M=5{*O-B<5Xy{)%Kg>|C zXYm_I|AJ^r5pYIe8X_!K!;(i3YxXVSdR()gpL^;Ktzm>-UX41qOp~xx@JsR`%uQ)$ z!#%=E9E+kgamfr-QAeZ0V1o^9dKR*t#nh7X>DShG>MeQ#hDT8rr&lhbA2xE--yf?4 z)+mz*`{eA=+*RO-TlfEAGIMNJlz|G$ZDY1{8Qhve{0S}f)wh1Mch&2Ict{VMg)%o^ z<(1|%qnpF9+fXybV)Q0ru_}$dDhui5nIMaqzW7p*neG?)x@UpiNI|4MKM8?cb7rxz zXzh6eR4!Qz_B~g}DB`>x$(Qk5$7A9I~_I z6d%~{;Rw5C+pXFbfl<+f{=$om`OHaZj6j;~KTPOsRFVRueN&x>5e%>NX1TgwSfI-! zR+ZID^7ZsfqpQYJCX4M|xB#heABQIl)_W%^QDVYGMB#;@873o?jO~2kT?VmNGQH%@ z=Y2!6tAX^-#ko>A0VVJ729_h=ca z@Y3*X;4pVA>gD_DQMf*+3vlwVqJCRgf>p1ux$AgA)RBsSD^U%(`zy=^KcbSK%U#SY zLV4Z1OOUIICBG!CK@s!K7Hyw>+uGY&Oab=aKdxHKnbhQnPa%rBXWl-s%1p;$HXt^u zNE(i{KlkWS3cxcdcK@o`uupZXKg7drH^{`-w~Q>M{!L7eGuEF{^w8`4@nOwkX?Sc3DZ7|Z94-z>9fMMvHL1@IPj2rKD} zVsQcwS|R0qCI6NU7`aM0lPOr?^^j~S;GKSbJP4?D-L4QtqEoZA9f2jXZT|S$P{JRw z7ZEH{$#mvhqx?Lmhs2)vkL^uWFbDj7v&P`Vq=hR{V>kc7?uq2%FjXkF18FeHUbT(3 z0X*1w7E6ca(Y=VMUa3Z7oa|3MY~NO`pBzUSfB?6U6i~9~0CQ^vBPIA1i-ZChWxoFN zFf*d^T*&=!k;*+SxM?bzHpM+G1_@tue9D++IOBh|84`Du@5N1!@PqlHjeT1OpZ*;X zxEZy%B<}7Ad`W!BI~;x8%Wu?M8hTT%?(DcG0m^*dwpe&g}*v_AR8c@ zu98NLF-p?}oDo$w&hf+E)<{}vst(N@>?XJ-S>O#?npAyVeWNe;Pc1Q6q1=;j#_5Bu zO>&A@y`-TDrv*=S*uVipG3#jeYhd{K`OynI{phaWyqnD5jw@vNUM1wYHebW9>Ic_dL9XtG1U1X&HP` zd`WdFsXSDuu`qWT%U?=1r}) z>*}xXI|bFFFjk5Si|Fw*;aC%&KnA*_-4TpaJgc9hfGJiL?KBc=C+_Fi}MH}K1AYc)v90&p7t?jzKHqQ4G?4h zI=Beg-c4Bc0=dkE84cdw*?g2UqRTTEkc(2z{x`d_8@&u|CQn#8Ga>`eq}tbTLAtCg z)3ZpD_4$ytJ)n4o5%fvC$x2NwQI$S*;)lQ|l=aWLB+89Vn0*9BOfrpnCFPf4rhfnC z``$96&dDUUU_!oswM;mb*J(o5M;g;$e`{}gI~-^v+oJ|cT6z|_+4CzUw9)Oq5lJs6B&~{1s?n8d)OYSPeF@S?pHP#f^GlTwqR9e96rWz8#@fCm zd|<-DxEd?sQtVIxe%hM3ea1?+#kR21-9TAh!-s%KqaI00ehcQ?rE8u<4n;3&o_G!d zLKWj9yk!#jppiqD#D{rQIM+lgw=pBHVHr>P|EZx+$TJUln}n#OCyX(Fs-oZep^cR@0b;&?pdue{oY<%7Pt z;UK6{3*7(1E{uvKxXd#FlUa<$&|T3X=>KhSO`wn#DUEH`^)BYBM~5a{}Ic{{5I(9II$CW zoJ%}p4;In4UZ8q4h>zJ_T~QnW#>=%5&X{++>Z?@N5UNAIkJF&Co@9x@88bP)Wkq7bDb(KkSQX_#(}wY%6N!pl)$$-{{Pzh%C0!N zU|rlDLeSs|E`gxIHMqM5f)gOP%mBfI2M87z+$Feskl;SJ1_|!NptqCv+_la>xL(@kJM8Qy)KCZYkyp)4zfd%y%$z8e6K8IW{%^!s1!8EB)5_rGAUH_m+9x2@d2f2{naHe8YFe@tq+nE9g}(H~IKdUs$V1Zs9uHT9mUe zgC@UO)*9|H@*j$ROXr-(b`FOY1$3EMe%#rsCZ-bh2kLdC4^w(zW|y+U;ig!vUIjKV z&Jw%Y8V#KDEULA=JwnIio&Q(p4ErF(#$ffXur#~qC>JHyYfv|=3T+-)U@#gS0yV6m(Z6@KY=VDi zR`s};&egC|#yVB+Fk3SZtO|}5LPffwLnmGuU_s6r9 z$lr=hR3d1gxQVgx33@~sP1XMB0}UXbV*f(fVV+i?QyH`i0OjW>Dc==lvuzqVFAu+o zv;jk}-#*A`J&qorbeQC^ZT}*@7wOFTwB7m}H{)x4R$;$j>+d&p3WKz$Usqzh*7X^U zdVjLsx9a}OD}IlPB9k}2ctu}D_%7CKupQW#5t!OZMQ5b`@JzcrHL~>vkFl)w7>xok zxlBCU_drihjFp3;XTgaK_*9&VPeS*>Ih@22i|+)3;mjqDg=G1TPS$VTZG?&)HfZ6& z1C|a;(=*!Ji_Iu_AEg>vRp!c~^BF_Ge~9{p^l+m1%OTWeLWbdlSmIKdyu-syA|~j) zioMy-3}yYl5Z3dW;4#Lnx}GLJB6$b^!`}4IE&@hnl>H&L4ymu1_wIMhJgWhQ#X>b*?m%iEjZm;{x);M z$=EERa-+N+ za7g)HE|qS0$Mr5D^0!_usy82X7T_A!rR19?uan2M$7UM7J(lm7y`kuzsuP8?RBI&g zh6}b{a)dalwA?){w!*lDhJ?-5*BVPtM5jf0o5LM2pahcApHVOr)Ya7`HRx6e++9~} zJh+a<{N9eco*mZu`OmD>hOgAVI4NWHrVC__C^tqyA)*De05L5i9qir9G^MrHvegUu zs{&4E9j|eBHS`;B7W!+QtJPB9*ClIhoxV!m5X4XQM`VglOD|q2VA`ceKst!dv^eWh z`hQM0=G6tTsXqv9*_vU=KN0D2Coj1?SG?mFS$xN75;{??Rk6!?1noKDJw0p`9ni)O z3q`{uZho^CT24a2B&{Ly+zgpeNiuzV-@bPWYcoG2?6hn8K3Pq zB5&E`b%Br*dXOTsOL`N;B{L^brA5|^$fMeNP6#456GZymzyQ-qt zx|L-SBob$#0hRhXosuIyM1v6qk1;<&QO^WRed2M^z|BXeIj(0^N4D_|vb6Rfzy96* zMzI&uff3hq^_z0?0m;>%LC1UCd^`PGrAoJ2vy5AKI6X7XYUE+9II<(Q?jG_0{aFKk zZ#l=1WhZHUmB|*+M$Jql7$~I46+PvkmfN%~5L+#;Y8pA%lN=An98|=tG5*Y_I9BDb zl>GI|t!*()rk;z1V(EH(@UgkR=IDZ4aPehstgyZ29fJAII!1%jTI547IuP(jBvE1# zW1Ib;i8N`8aBZL~ zvxwiDUcy7WWUH-D)JIl2!TDZ9>vkrff%8P3SGst_5RQ3 z-Gm`wl%gAsmzfVAqs7}P=;!c7=fX!WI{QxdxfuAk8^w%f{r4zFmW%6Ka^~*kjjuz| zd2Z+N%b-g7CGrov+*?Cjs{0T6GA~NC*`a6I1(To*hq=mJM~+b?-7grpWAgTY?x?WE z$l$J2KIb-bU-ufGv#~(_l-9F=vi^LUP2MIVvS}keBOY^&=4t$cNMh!PXUMp~?CkK9 zYZQNj?DYXSsAF4z_HEf2FU#XM7=7!tuC|<)bQB-yoU2)-XI2`LRD2)K`S>G2wd_gN zlOy2<%H}QzkA6|lNkZC^htMco3ZXD)=rM*Hztb49(fGw~7S7){wRb&^`?&P+cswwo zWvdt?{~V5_yLLgjd^_Fx!|6^nwT2%TZ%kGV`C#qUfm!cXtOyzubPCeH%7Izfx@1G8 z^GbjI8cyigLyNw@bs#t+kYWC!c#RQua`QSi(~q@>HxAu=g-WHo6+JmpdV<&vA#lPy zHIzN}{+e`Lv$uj^wvTlLD2fj+VgRj%i+H`~H)IUD45g6=sB7^Jo4}W>Mzd#+VLz?W z97zh_Kp-N<%+60S8UMJeTjcSD+{YQ;gd#q=nAd2!t0D799pW*478uwf%$C z+%ts+PiKvcw9?8SMY8Iv?JxSA;%I#pEw^U|r5toipY`XYaJxcdxUZedpB(E|)wPlJ zrYRZUU}tHs;eP=LFI)w*Zl`JNh<u;Y(7;Qt`Y83o(c1z(x4iey660=W&lX zXlw0kKGES!0P;l4ZuH6XVrT{=WxkgQk@mdkWp*?}=a@t1ppv#2a1(60J>h{(uYD$s z&3WyL0k2RK1Ypm(v$l+h_HLNW0uq%VKs25l}~t|S1Z$) z!X*9K-a~Ne*_gQNr5U++#AFc|5IvGnFu%o5v1+whh&2_(&+GVFGzRJGFOef4o(Xy5 zhip1xEh7@I)#ipg zjtv@qGHSQ?UZwvz-iAaR7ciV|7q$Zd7dM##B_`>=%WU-B5dN8t5ZUDa~-f6Ta;xQ=gx|10#z^3jvw9T zaqA~QLvPZYb02zGzd?Cl&D@hiFjWF}eB4sH+3^a9u6pVX2(NStJGGtgx^CsU zIOj6IsSH5K$IJ;wobDQQc9!(siQE&11(UUGM#U$;9t!s|N-iW));W23*+HJ_+Gob# zdzh9flz{MO8=CXFg=WhEjK?5;>~RG=i#A z1fqnkUZf~wfi)zeWGWKDXMH47_u3yGzES91+ocn1kfCuk&7I-Y7>vAk95o5Fkdot5 zbJ@Ww{B8%HeY(qsrxm;!T`Tia*MR zK@9oD&#(A&t;aTiNX~YM^)e`#y8rx5uBr%bXECUWM~uIWgNO*)VVO;1=`?%9vW+AU zeDU#nt~+PdF}$e==utQdx3Z?uXuM>P_q~jKqyI2`H<6+&0Yw?w#scUm23|q0-fSyK z6@lKy{8+20o*~b@#h-KVyS6;yrTlT5wMLsU%s_=jM;f=G2YbLvG4)5RY&!gEil1DH z#&zfR+smnEJ{=+*cP$-a$^DvPKHzRmA__(a|27;i2tQ&zUc#~?)B2uVlO>HYE;gxH zpMfW3-v2BhbmrVaL#PJb)(uq*-A+mkkN&ld1qk{x?2h~Xg3CZDGdvf8F`C- zzJ=(M_bTfiNc!qA`d+Xf(n4(w#xX2k%OEXQG;)KPiE{Q}lE6Mnfro=J##>5O{ut^wP}J(hp-A+ zE$^zIUIm2uKpydkicACNF`bXD)QcG33es$J!>OHk8@G9=nvSB1m8r^$$kO1LKc9aO zHh}u~wL~)Rf6h*0>9XO^@3jL@F-xoE^VDtT#p=-kkct5xjL-Z$XmJg(Z$$kxmxzLv zDgOw#c%QeyoaHtJJmG5JJc>`(cvZbm&-LYCUEm_OEuJFeh3rn+QvBOpKo!phs@U!s zff+t=Eu$NZNbS*WD`&rYQyI!9PWVMicZm7O5TDKp(DLH?*CR%B>^q}zHQ7I$K-4ht!51C-bpSg`*?E`?z)pZtZ!>V|0K?nc-;JU% z$c;}NL*br$pNlo|HVj^wkJX#W=0`=@PGo#{zt4F)SN_pbWW8ZNt7p3e{ouhiN;mt7 z-R8^6&Fx*n(lvYj@xw}~y>}^$#6ZTA>p?p>rx`tdEABy8E8?;Yl ze0NYQ=S$LOGS1Mt@lif`@JuOQ@Zf=4$v{5ixbLl~393Km6-?PqSVjVU9SfxNSt zRa>Gy(TwU7^nkF#D14ZAhwty~5@$m(DJq7%D4@Sz}j@{L#bV6>F2g-y7az)trT@s(4pvCL(v ztO7^-q6Yob{`BC-M`{@l4eZYK!4vI8onMIZ~ zGKUvLm6cC< zbgTTFM&0+g^n_NU9f%=cVQ#;sd-$+w!?W8`Mdxvx;aBLjxnQ>0rS^oEoM18+Ls`By z5~YAsTM5UyO);I_BAlYsJ!&S=W2MSgXsjtnMm)B0DuwlG`B)DX(>9zsDL{^l?KoSn z-YMUoo%y=xw4UJkz8KJ`yjD)M^rv9N>Ees;Sl`0H9dU5Cr4T$HgjxK4m91wcqOL|* zF0e2B>W|QeD_$)_jBSun!qSbyCD)Tx`|x}ZHlc|(;&}!bwTvS5-4L2%8& zF@}ql+s#-FcA;9o6>C#i-d!S=*JYFM|Ji{)y(No-e*=$5`C_zv*(XQ+C)63v4+cZq zBV_YTuygnGWpcE8zNIu+ta8-4-j-lHg|~@+Y888tUUw-A?PXRrzlr6N25|ERS)DCX zGK1fbr#Y^!kr#5eo0Nrhw<`w;e7MnKx5!j22LZWXg){^7lGvZqUSe3AK8SO>Ocwcy zDEMAr`g#^DAaf7}0S)%}ZPEh^E&7?D(lSTGaVf4h)k_-WlwmK_d8j8jhV?K9KIP+mNA0hgvmX zOKYrsMuc$XF4u3S;jtCJ(}9XA+O!A;LP!?+YU1ml=Z$UAPD@_GNG!e&judR*YvLTwaexfsW7SS|6bNo7E8RGnDxY@2`8LgTT zI1+je@t30!D<|YlHk)m(u#xUr**+c{l^m34;i_7d1a?fPFtlGP%EJ$p9Jm{f!L}PA zwRU<4&+3|j?EQ&|q%attcM@-q4+!DKRW&2ad6F0k7GmHyRp*#3jShtqGq;_ioM)WK zfBN<2s`N}Yg|6jP>bIFc!h}>-cE!TfUbnp+xUk5y_NL&d@6F3=;g1PlvN^bchHbyx3Jc)kDF@W6c@=~qLxBtebxx>sh#04G0|NGc*L zfBdS{Y(I7eUdDZ*^%S(XtYxv&Um+odEgi)e@AKICW7i03d3k0;Hymn;U%zD~6gN2l z4iR0uC#%T-qjP*K?{I{Mq*2OSt+J$gZ3!e8f}N_u6`kF$Gge85;ndir2h5v>qgCKU zvk^MiDWXeA{gi9l=^{2+z_H}PNrV{`yyXUSI;o||&mVip-g7<1cwYF^y@=L-TrAdGw(Yozg7-xpIGcOAH)=+=Hn-Iro{ z{B?B%1y^2otRE`9(MQvgSs9S{vWHuEa_D8bTGScyGdIeD^mV*7Ie~DUKGF8Z(R{$c z^B*UE0y#fGCRO2!Ja8w6YM2P5JBa29b%>$0-0L?6^%Q$AyH$dI8_|XHt=R3Duh-v~ zBn5j_WQkk^Zi)%ORPKtY`2j<-FvT?Jw2Nw>Iw3qDVrZUw-4wk1O2Kt)uxtn+kPj#1 zHjLZ5n^k_H=lD5K$MLGKBF#E4@pj{pkkE-IC|U|Z4wZO()k2g;x1eu&PXx9VNE((D z*2pqDLejST0YUX{FUbX2=dHVqKY)T&==Yh?H025H(x)GL#|*ojeed#* zqagR5R2R)OM&qh>!d61~2!J3%LFu2nr)vEO=f+#P=u{_Pfo@Hzn)+Bh|7)HeJ~le= zJYHrZpvVZKDPS55N$%0%wBKP1?x;D-`gc#6;-{=SI@;+T({@+)X2x!FVk@(bjeWGjwhf{x+`FjO1Ml21Guvrp9JOyLdU*+|Z4AHDa7> z(*GJy=$#j52ha|us=tqqix3WvQlVnn8P5zh;I(-_9c5&J#-!(^-fY~xEL6)Au$p0s z_*o!hqRV*XaZi9i#1#|o@tj6O?56bUtAZ#B$DA|ApbJd={rg^!0#_$#iJN%H#QMD{ zek&6o@p-O)ACZ~0QiNuXONP+Tv6CR!Y10m)%IsuC8|Z;BOSa3h{pns#@+I0nPIT5p zI~9E*#KJtW2XoW8QwOt&ZKlNt-`|X@Q>F@EC+8vcX{z*Vv)m*lHu z9i2ZDcvL={{1NIT^|Sc-@f}e@H`gUCcr~l}wb7)X6Da#`XgcD4+C7J|*+(K?axYi#G*R-;Ot9CHNFw`|c?gJaAcV zrnUa18Z-4Wo?TJ}Q*2q#SHN=-VyTb`vlwYR2R0QxmcNKg#dsu4Qu{fIy1LxqcB6xt8(s*j2gE)xh!`eAx&Xi0|l2`;eOdvfFp9eSn@J|?pI zEA>Aoptw&sK^*a`}y1iQ7|BKECu~xFEOS=X6m})vNH=NS9aBvTD8tb z*z3uag{=1wFiLbN-8o`DJ|#v7m%j2EXsNWcbs=cIKCJz=j&{0ODO#+}>U>Li-O<5# zd;3+Cy4Rr|h$v2t_&hBtckov?R5YJ@(`YswSp zCpeVB_x|f`)9tD!?rR5d^i;>_L=TUesE+tGCe7WMFAwahjOHTJ*C9Z`#$?SL>&v)= zZllARUQPPWtC9XDG8sY-6}8-Nz|N&G;@lFI5rmvBLbCpXGA}7r>P}7SJQ=G_B zFz89z8+<`3(=*o?Mu2p&GbTsRBg%zYc#J(ROz2j5$2zqOB9nh{%l|rqM(%@^o@gpj z4#uTAiZx5z^0$G6fDasUG!KZEj|LH3g6NUcoHB-0O8D1&5Me{=l3gSyiPO@Dh&Z>&%8E^H8;*)B%gJ8TlM2A zKLT^yVgFwG>|C@f^JZcxlyP)ilwJ1LX&hz5gm!LQ!p0^68w?Wp9kj zkk>Lx;L`Wb?)FeKamyve<52y(QmrSbL*5^fMxPsdFdCgyxRIG+95@SGM%PjVDpr1K ze%o;!&=J~eX{mqRP|IV5VB`MM~S_Whh+YV?Q&8F9G!Vk4@h z+A1Cgk-YcyyNHpuh&gG1VZP-Zg0@39BaS@9M=PbV_rM!u=xb7-jsJxf1-MT;_D~jn z%9#}2nCI{PToJuN$0n7r+^lxadZ=9I#ymYfnaHXj;&eH5Py7xm|67%m|3*!gsUp32 z{j&w_C~0>#KsP@pfCNy4t!@~D+ujOCPZkA)F0OHS83m2g!ed%*L+z3#18!U6jq7?e z0{nZOza4*K%pGX2H)XHB5seUoO9MWm&!jO% z)!zlO(%sW(O2vo#eKao|m$ZORj;s;;yN*U}UmCS#sG+rQTb}JgqS(01B1MjyX&!z7 zrGL2bXvq8Yp5Wr#HrMPpxP=z!_eSE>Ap~U9lmi_Py#(nJ?4+SdM4|5qQ_Oq`E8Fg; zc48(Dbp1D8|9s9VZ4Z}^_dCyo2`q?$OTSS@0Yd73>HNjPaouj0F~AJh8_RZkMp`x|=_m{YiJ zCXZ&pi3$LN_~_~g(DeLCdahMj83e*6-;^QdK-IL6O=HLku{a2mp8eo_ab2WRqE()j69+VC&E2&M=BUYAH;g{yhs- z^Op=&0C@V!d!w&nzHR$MzSaXqs8qb>X4fg*;Yt8P#kTmw%)7nxSOrELIuzw;nU{%u zm;*FXT;Ru-mrTz(Rq_SC-@F?p5Vs>o<7{~mx{{G#@Wf^%ARYpMRKS+Y*Jwb>RR3u> zC^=1cC@z_g$smArV0MN{W{FNQ5K=s*YVfoerB32IpTWsGie=S|L-xVp-Gw(+&ZB_> zX9o#LX*GPlIx45g+5@gg;9;uHy?v{xLC#SCPm@F4m{A^S`Uzhx-t2H9^Vth8j*gRv zgLOZ8GSGb&*sX7{7l3)joI%_n$VPCD;t24!qEKJKv5B;6%MccebT^x<-|p53uWBDY_#Aurs_d@X>xmmBOyS; zzGHS)&qtP1H)BV_`Er=T30?@JZ5Ut^0C#!MA<0;CNnED#5~K|vWSQ>zpBMWFvoLGk zkl2CiKV@~=C1dp<*Ydb+54@$m%ybn~eVpQ=9?Yb+~A8VhsCMKW<6) zQhS6Eb)0_|iJQDFRazpQaveudMlkmLba=456^OrqOEffWCpO0n@+yg9yq4dw&^ks* zp%lQI-Hkpo3`W{A2)`zcCy9=tD$Lb&+3;xUYqyc;P0_J9`d9!mgPD)lt%Rk0tke)aa73 z1nLtr87&>vt`-UwZ@zbH3rycf6xYTsve2x~tI?P`(C2cVD_vmEv#boPgci6pzKFEk z?0e<9{&>hlktn`WXZXlD*!6qoL+XKF z54b&|SR}TToQ0k~SAY?4I?jUX2fW^X2;Eh3ro1*l&yoD5H19Pa064J_0ZTtAim6G+ zv-P}7J4&5-i6D?~i1`?V*|(7y1Cv`A&=Vn?6`EI*hcCxn?V|!MbT7X(HvTcKY11&3 zm}W@Tztc+c6puSyua1GOG>&`m>xI@Ww$s}HCcftK?x zsjBYJA)0!uO#590iBGhMK-$j8rd~cSn$cHyawb+zK6kC!h5E2rqJny8XrAQkv{jq@%|w>mfJ=%%0HDh;`n;vSq_Bmv9V{fpIP{_(rN;@iu-rTt18Us_p#74Wn^SB z`G2)Sv&~EGY9(2WNBg%rHolFO5RZ?xsI?ABR4m;1f4mk&)ByF8PZT$KmGv(%>*ngCmQ1|53^#=maOBJ<#4O(VW#K0J}TsqzCzE*{M-@ zdV@H>7%8F4d_ZfJ->p!XOU-^|_uyiPs4w;p^ z;1dTdB7NbN9i_6qk$S|0sPpq;Blax4nap|&aJfgHzTJC6s=Nwv7lHpn$jcd zZfyrARCa;gtatWPg|7nDXSA|B6U~Pvt=0X+Afe8z-!EgU3;4wQJkD_E-yW6rLxcFl z|M|KA`cLN=aBnAqXJ`4u|EQqX!phRAOKIHD`Na?iw5RT=?g*)ro9~R?iS}7 zOe`^#FWj8VKC{4@TgN6dN{axnDo{j0L+J6}+x?khPc8j+c4)8p%T0e)uJ$7ciGO<} z&WsvjK&>OxS=u3zj;2MSUE=wOt=oho?BxS1Pw-pn&e$okZ~Y@w9NXFeEP%o?_Ro!x z#cuy`ev$5H7M(W`iK1CCP?SK-4`bQSQ}^q{5_S4>)F^P1GEboY?VURm7o+fPa&k~Q z@94NmmEDiul~Z!usCwK5SgR4m7yogFA$IpKt5|eYt%|Wdlq-R>f=Qz^r*pPlTi+U9 z`K)t#LEAHwFcmSp&hw$Jvc7^z(JRM*I;xv_AilVDMhUzl$$wuk-j*VeuQkY7Xms3@ z;ke_E-smaHsPdJs-KFodKlf@a`!kDLacT~Bc9+>_s@8Vycl8O!zSkG(nZcV)pM=~7 zZVb&RGI_ORG69!rL`1P309C-VNS|4tDIMFNKbK^;j7d~rE9KqAsPXXrwj0(cgiq~t z@X8G#{3?q6wDZc_&V9W3)Teo>5$o|^ zmM7e{yBllcGoUab{9b=$pm0KFWJp2%#Z3p*amZ8WK1ELNBe8}&cRaBA_xa^bQ*XVe zDZOXeW6ijkp6M)$9F|y>@~^9K)WVi9P+C%UcHf1%K{6^-*7(FDzD?a9K6uiPa=F;K z&-!#Ngzqjt+!hCzU>Al6kK)VB*x}?yL`1}*RgA3GQ7EJ8*;OdlE)a}6sy?5(zwh7G zGH0~|ckr5(9?*h@n3wQWFWdrF4qM)+T@Vjh%FOuuySq@SmU8JI4|JxL==QJUVHw)> zHdX`zK9yP(mBmXGf@5DXXer=hL58T<&vk4Hw+zf{rb9McZqOXFJax9P!PZ{@4`&bw zA)!V%YN6(v;aXq~!e>tG(;@DKUz_i)GSUELsD(=9R0KyHbE`eV$0}TYXw2BzwOs=_ zIV@FHqW~E#W4*KC`^yhg_vKDT+)Nt^7Yw;$|1HONn(z-xPJ9(h_T103W&elkJIxgh z25fYTlD#yWZJhmW<^jNkTdLifUC<*6S{!b*iSf5iU|;1E*I7~-m-JW$3atXuYzh81 z&7yiD$u}|jFP}%$14fV5n3r|wyOnJ7p~hy?{y9E{vu53+d^r62PbDRRvJWd8@*5kV zcf9Ge`7e_KJMKP-FU3axF@%Qs_X#PN*J)dl-P+RzCD~%2zY(LQA;&~BA^GX+BTwtt zx7)HV6PuVg83Esh{x{!~Q7OTu_GD&w?lb-gL84enGoVygSMaG=@XY%M>+Ynx!nI7p z9T9e;3D-K#m}9Y5YXy@9b5m1$l3ST0KpLL|!^)NRE}9L^@z!5Wv)h%%lKb&Lk*dNm zM#bk~`FfNOkaZN<@MJrFvhl-_OW@yN60JB14e^;#tTd{92>h)jr_=CjYVVl8Flh&! ze!ot=3SB}*=Ca=kqFVf@5%Vg^4Y^*#q%$&jKc*f-u(Fh^AUC$6yiU)x(SowE$Vjg% zdp}R3YEEOzbCsvkaDui}*3qeXc(xze$W3!To%FavL;RhZQLb)|r@HW%()?1eSDRFq z58{VBe-Qh%gGJ|Y&0I(E3xSGbldVc;CB1e-LY>ywgI7oIqGe_z|M92rJH^y(q7h9@ zg36z9*%FExsy@ZZI2<|imt{p*U$vc3X7KlWwZ=)6XZPo~2vp|r`QH=Ei)8Ve1jRW) z{2Z?(`l#m>Erf@l!6Iwtl?@Kt4&5m`9QaGkg2C#TEak7#wI7-WwlTgPLUImnyUP(K z5T+6S<@o~01aB&l1t-f5b4WgnPKwYuNH@5I7Tg_|3jvx{;IVyvw)QgQTnRy}*0x7T zdQN!LeTohAgeaQUuBVLfuoskkDBb*O{kE3vbvCZNYDOdP zc%?2HUz%hmXFH4PS6jpXZsg0U|MpoRrqEI_@lP)=-Hbg$DPIriP~8+Bp$1!%Jq>_y zfaRI-k8Ocp^^t$q!T%rne?W=J3{z&3&vxnYn!=A494D)E1u|j~`Im{3{28*q$(bSz z{I1pyA;>Lz1uRA2;LFTU0;>C=PyOKoic$lO@_-X)yUM2`3j2+jkC3fdV(#xx)!W-E z=zU5HG=+))YNP@q-~ZZz0woc<*4Jq@OGtndC@o$S`zoGDiZ)I8 zy^9NhCg5wN1M1}iZHBF0lmEkyfG7w9f(q=UW#}4z+$l=5v3^-i2|Q|yDg0@P)n-MV z=A#PZxT{y{{7XS_ FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) + { + GetAccountSettingsResponse accountSettings; + try + { + accountSettings = await callLambda(); + } + catch (AmazonLambdaException ex) + { + throw ex; + } + + AccountUsage accountUsage = accountSettings.AccountUsage; + MemoryStream logData = new MemoryStream(); + StreamReader logDataReader = new StreamReader(logData); + + Amazon.Lambda.Serialization.Json.JsonSerializer serializer = new Amazon.Lambda.Serialization.Json.JsonSerializer(); + + serializer.Serialize(System.Environment.GetEnvironmentVariables(), logData); + LambdaLogger.Log("ENVIRONMENT VARIABLES: " + logDataReader.ReadLine()); + logData.Position = 0; + serializer.Serialize(context, logData); + LambdaLogger.Log("CONTEXT: " + logDataReader.ReadLine()); + logData.Position = 0; + serializer.Serialize(invocationEvent, logData); + LambdaLogger.Log("EVENT: " + logDataReader.ReadLine()); + + return accountUsage; + } + + public async Task callLambda() + { + var request = new GetAccountSettingsRequest(); + var response = await lambdaClient.GetAccountSettingsAsync(request); + return response; + } + } +} diff --git a/sample-apps/blank-csharp-with-layer/src/blank-csharp/aws-lambda-tools-defaults.json b/sample-apps/blank-csharp-with-layer/src/blank-csharp/aws-lambda-tools-defaults.json new file mode 100644 index 00000000..9a237927 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/src/blank-csharp/aws-lambda-tools-defaults.json @@ -0,0 +1,20 @@ +{ + "Information" : [ + "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", + "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", + + "dotnet lambda help", + + "All the command line options for the Lambda command can be specified in this file." + ], + + "profile":"default", + "region" : "us-east-1", + "configuration" : "Release", + "framework" : "net6.0", + "function-runtime":"dotnet6", + "function-memory-size" : 512, + "function-timeout" : 30, + "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler", + "function-role" : "blank-csharp-role" +} diff --git a/sample-apps/blank-csharp-with-layer/src/blank-csharp/blank-csharp.csproj b/sample-apps/blank-csharp-with-layer/src/blank-csharp/blank-csharp.csproj new file mode 100644 index 00000000..aa648b33 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/src/blank-csharp/blank-csharp.csproj @@ -0,0 +1,16 @@ + + + net6.0 + true + Lambda + + + + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/FunctionTest.cs b/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/FunctionTest.cs new file mode 100644 index 00000000..76e59c73 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/FunctionTest.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Amazon.XRay.Recorder.Core; +using Amazon.XRay.Recorder.Core.Internal.Entities; +using Amazon.XRay.Recorder.Core.Exceptions; +using Amazon.XRay.Recorder.Core.Sampling; +using Amazon.XRay.Recorder.Core.Internal.Context; +using Amazon.XRay.Recorder.Core.Internal.Utils; + +using Xunit; +using Amazon.Lambda.Core; +using Amazon.Lambda.SQSEvents; +using Amazon.Lambda.TestUtilities; + +using blankCsharp; + +namespace blankCsharp.Tests +{ + public class TraceFixture : IDisposable + { + private static readonly String _traceHeaderValue = "Root=" + "1-5d66d2fe-8e6fcab805a0833803735bc8" + ";Parent=53995c3f42cd8ad8;Sampled=1"; + + public TraceFixture() + { + Environment.SetEnvironmentVariable(AWSXRayRecorder.LambdaTaskRootKey, "test"); + Environment.SetEnvironmentVariable(AWSXRayRecorder.LambdaTraceHeaderKey, _traceHeaderValue); + Environment.SetEnvironmentVariable("AWS_REGION", "us-east-2"); + } + + public void Dispose() + { + Environment.SetEnvironmentVariable(AWSXRayRecorder.LambdaTaskRootKey, null); + Environment.SetEnvironmentVariable(AWSXRayRecorder.LambdaTraceHeaderKey, null); + Environment.SetEnvironmentVariable("AWS_REGION", null); + } + } + + public class FunctionTest : IClassFixture + { + TraceFixture fixture; + + [Fact] + public void TestFunction() + { + var function = new Function(); + var context = new TestLambdaContext(); + SQSEvent input = new SQSEvent(); + var task = function.FunctionHandler(input, context); + task.Wait(7000); + bool completed = task.IsCompleted; + Assert.True(completed); + } + } +} diff --git a/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/blank-csharp.Tests.csproj b/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/blank-csharp.Tests.csproj new file mode 100644 index 00000000..d92b11c0 --- /dev/null +++ b/sample-apps/blank-csharp-with-layer/test/blank-csharp.Tests/blank-csharp.Tests.csproj @@ -0,0 +1,15 @@ + + + netcoreapp2.1 + + + + + + + + + + + + \ No newline at end of file diff --git a/sample-apps/blank-csharp/1-create-bucket.sh b/sample-apps/blank-csharp/1-create-bucket.sh new file mode 100755 index 00000000..64a5f749 --- /dev/null +++ b/sample-apps/blank-csharp/1-create-bucket.sh @@ -0,0 +1,5 @@ +#!/bin/bash +BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') +BUCKET_NAME=lambda-artifacts-$BUCKET_ID +echo $BUCKET_NAME > bucket-name.txt +aws s3 mb s3://$BUCKET_NAME diff --git a/sample-apps/blank-csharp/2-deploy.sh b/sample-apps/blank-csharp/2-deploy.sh new file mode 100755 index 00000000..70ef7625 --- /dev/null +++ b/sample-apps/blank-csharp/2-deploy.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -eo pipefail +ARTIFACT_BUCKET=$(cat bucket-name.txt) +cd src/blank-csharp +dotnet lambda package +cd ../../ +aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml +aws cloudformation deploy --template-file out.yml --stack-name blank-csharp --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/blank-csharp/3-invoke.sh b/sample-apps/blank-csharp/3-invoke.sh new file mode 100755 index 00000000..85ab68d9 --- /dev/null +++ b/sample-apps/blank-csharp/3-invoke.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -eo pipefail +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-csharp --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) +if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi; +while true; do + aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD_PROTOCOL://event.json out.json + cat out.json + echo "" + sleep 2 +done diff --git a/sample-apps/blank-csharp/4-cleanup.sh b/sample-apps/blank-csharp/4-cleanup.sh new file mode 100755 index 00000000..507dc4f5 --- /dev/null +++ b/sample-apps/blank-csharp/4-cleanup.sh @@ -0,0 +1,38 @@ +#!/bin/bash +set -eo pipefail +STACK=blank-csharp +if [[ $# -eq 1 ]] ; then + STACK=$1 + echo "Deleting stack $STACK" +fi +FUNCTION=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) +aws cloudformation delete-stack --stack-name $STACK +echo "Deleted $STACK stack." + +if [ -f bucket-name.txt ]; then + ARTIFACT_BUCKET=$(cat bucket-name.txt) + if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then + echo "Bucket was not created by this application. Skipping." + else + while true; do + read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response + case $response in + [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; rm bucket-name.txt; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac + done + fi +fi + +while true; do + read -p "Delete function log group (/aws/lambda/$FUNCTION)? (y/n)" response + case $response in + [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac +done + +rm -f out.yml out.json +rm -rf src/blank-csharp/bin src/blank-csharp/obj \ No newline at end of file diff --git a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json index 9a237927..c815dcf9 100644 --- a/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json +++ b/sample-apps/blank-csharp/src/blank-csharp/aws-lambda-tools-defaults.json @@ -9,12 +9,11 @@ ], "profile":"default", - "region" : "us-east-1", + "region" : "us-east-2", "configuration" : "Release", "framework" : "net6.0", "function-runtime":"dotnet6", "function-memory-size" : 512, "function-timeout" : 30, - "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler", - "function-role" : "blank-csharp-role" + "function-handler" : "blank-csharp::blankCsharp.Function::FunctionHandler" } diff --git a/sample-apps/blank-csharp/template.yml b/sample-apps/blank-csharp/template.yml new file mode 100644 index 00000000..17836497 --- /dev/null +++ b/sample-apps/blank-csharp/template.yml @@ -0,0 +1,19 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Lambda application that calls the Lambda API. +Resources: + function: + Type: AWS::Serverless::Function + Properties: + Handler: blank-csharp::blankCsharp.Function::FunctionHandler + Runtime: dotnetcore3.1 + CodeUri: src/blank-csharp/bin/Release/netcoreapp3.1/blank-csharp.zip + Description: Call the AWS Lambda API + MemorySize: 256 + Timeout: 9 + # Function's execution role + Policies: + - AWSLambdaBasicExecutionRole + - AWSLambda_ReadOnlyAccess + - AWSXrayWriteOnlyAccess + Tracing: Active From 1a544f1dbe5a3f8a4c6609c55092d6ab22c17bfa Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 29 Aug 2023 13:15:46 -0700 Subject: [PATCH 207/243] Remove unrelated java17 files from commit --- .../example/HandlerIntegerJava17Test.java | 23 ---------- .../src/test/java/example/TestContext.java | 45 ------------------- .../src/test/java/example/TestLogger.java | 15 ------- 3 files changed, 83 deletions(-) delete mode 100644 sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java delete mode 100644 sample-apps/java17-examples/src/test/java/example/TestContext.java delete mode 100644 sample-apps/java17-examples/src/test/java/example/TestLogger.java diff --git a/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java b/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java deleted file mode 100644 index 198422dc..00000000 --- a/sample-apps/java17-examples/src/test/java/example/HandlerIntegerJava17Test.java +++ /dev/null @@ -1,23 +0,0 @@ -package example; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Test; - -import com.amazonaws.services.lambda.runtime.Context; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -class InvokeTest { - - private static final Logger logger = LoggerFactory.getLogger(InvokeTest.class); - - @Test - public void testHandlerIntegerJava17() { - logger.info("Invoke TEST - HandlerIntegerJava17"); - IntegerRecord input = new IntegerRecord(2, 4, "Hello World!"); - Context context = new TestContext(); - HandlerIntegerJava17 handler = new HandlerIntegerJava17(); - assertEquals(6, handler.handleRequest(input, context)); - } -} diff --git a/sample-apps/java17-examples/src/test/java/example/TestContext.java b/sample-apps/java17-examples/src/test/java/example/TestContext.java deleted file mode 100644 index 69e0af00..00000000 --- a/sample-apps/java17-examples/src/test/java/example/TestContext.java +++ /dev/null @@ -1,45 +0,0 @@ -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.CognitoIdentity; -import com.amazonaws.services.lambda.runtime.ClientContext; -import com.amazonaws.services.lambda.runtime.LambdaLogger; - -public class TestContext implements Context{ - - public TestContext() {} - public String getAwsRequestId(){ - return new String("495b12a8-xmpl-4eca-8168-160484189f99"); - } - public String getLogGroupName(){ - return new String("/aws/lambda/my-function"); - } - public String getLogStreamName(){ - return new String("2020/02/26/[$LATEST]704f8dxmpla04097b9134246b8438f1a"); - } - public String getFunctionName(){ - return new String("my-function"); - } - public String getFunctionVersion(){ - return new String("$LATEST"); - } - public String getInvokedFunctionArn(){ - return new String("arn:aws:lambda:us-east-2:123456789012:function:my-function"); - } - public CognitoIdentity getIdentity(){ - return null; - } - public ClientContext getClientContext(){ - return null; - } - public int getRemainingTimeInMillis(){ - return 300000; - } - public int getMemoryLimitInMB(){ - return 512; - } - public LambdaLogger getLogger(){ - return new TestLogger(); - } - -} \ No newline at end of file diff --git a/sample-apps/java17-examples/src/test/java/example/TestLogger.java b/sample-apps/java17-examples/src/test/java/example/TestLogger.java deleted file mode 100644 index a81a274e..00000000 --- a/sample-apps/java17-examples/src/test/java/example/TestLogger.java +++ /dev/null @@ -1,15 +0,0 @@ -package example; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.amazonaws.services.lambda.runtime.LambdaLogger; - -public class TestLogger implements LambdaLogger { - private static final Logger logger = LoggerFactory.getLogger(TestLogger.class); - public TestLogger(){} - public void log(String message){ - logger.info(message); - } - public void log(byte[] message){ - logger.info(new String(message)); - } -} From 4ab6fc2242df3500769deef8d4378ec6c17d07bd Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 19 Sep 2023 11:21:21 -0700 Subject: [PATCH 208/243] Update HandlerStream Java example to not directly close the argument Streams --- .../src/main/java/example/HandlerStream.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sample-apps/java-basic/src/main/java/example/HandlerStream.java b/sample-apps/java-basic/src/main/java/example/HandlerStream.java index e8006c8b..3e7b202f 100644 --- a/sample-apps/java-basic/src/main/java/example/HandlerStream.java +++ b/sample-apps/java-basic/src/main/java/example/HandlerStream.java @@ -5,8 +5,14 @@ import com.amazonaws.services.lambda.runtime.RequestStreamHandler; import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.nio.charset.Charset; // Handler value: example.HandlerStream public class HandlerStream implements RequestStreamHandler { @@ -19,18 +25,20 @@ public class HandlerStream implements RequestStreamHandler { public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException { LambdaLogger logger = context.getLogger(); + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("US-ASCII"))); + PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("US-ASCII")))); int nextChar; try { - while ((nextChar = inputStream.read()) != -1) { + while ((nextChar = reader.read()) != -1) { outputStream.write(nextChar); } } catch (IOException e) { e.printStackTrace(); } finally { - inputStream.close(); - String finalString = outputStream.toString(); + reader.close(); + String finalString = writer.toString(); logger.log("Final string result: " + finalString); - outputStream.close(); + writer.close(); } } } \ No newline at end of file From 521911aaf05132447573cb58bb3ce7ba7065f7c3 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 30 Oct 2023 12:21:30 -0700 Subject: [PATCH 209/243] Java 17 project name --- sample-apps/java17-examples/README.md | 16 ++++++++-------- sample-apps/java17-examples/pom.xml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sample-apps/java17-examples/README.md b/sample-apps/java17-examples/README.md index 75e511a8..ee54ff71 100644 --- a/sample-apps/java17-examples/README.md +++ b/sample-apps/java17-examples/README.md @@ -34,33 +34,33 @@ Download or clone this repository. To create a new bucket for deployment artifacts, run `1-create-bucket.sh`. - java-basic$ ./1-create-bucket.sh + java17-examples$ ./1-create-bucket.sh make_bucket: lambda-artifacts-a5e4xmplb5b22e0d # Deploy To deploy the application, run `2-deploy.sh`. - java-basic$ ./2-deploy.sh + java17-examples$ ./2-deploy.sh BUILD SUCCESSFUL in 1s Successfully packaged artifacts and wrote output template to file out.yml. Waiting for changeset to be created.. - Successfully created/updated stack - java-basic + Successfully created/updated stack - java17-examples This script uses AWS CloudFormation to deploy the Lambda functions and an IAM role. If the AWS CloudFormation stack that contains the resources already exists, the script updates it with any changes to the template or function code. You can also build the application with Maven. To use maven, add `mvn` to the command. - java-basic$ ./2-deploy.sh mvn + java17-examples$ ./2-deploy.sh mvn [INFO] Scanning for projects... - [INFO] -----------------------< com.example:java-basic >----------------------- - [INFO] Building java-basic-function 1.0-SNAPSHOT + [INFO] -----------------------< com.example:java17-examples >----------------------- + [INFO] Building java17-examples-function 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- ... # Test To invoke the function, run `3-invoke.sh`. - java-basic$ ./3-invoke.sh + java17-examples$ ./3-invoke.sh { "StatusCode": 200, "ExecutedVersion": "$LATEST" @@ -72,4 +72,4 @@ Let the script invoke the function a few times and then press `CRTL+C` to exit. # Cleanup To delete the application, run `4-cleanup.sh`. - java-basic$ ./4-cleanup.sh + java17-examples$ ./4-cleanup.sh diff --git a/sample-apps/java17-examples/pom.xml b/sample-apps/java17-examples/pom.xml index 02eae0ea..73a9fcf7 100644 --- a/sample-apps/java17-examples/pom.xml +++ b/sample-apps/java17-examples/pom.xml @@ -5,7 +5,7 @@ java17-examples jar 1.0-SNAPSHOT - java-basic-function + java17-examples-function UTF-8 17 From 03f7fcb0b771f031f7cb3aa43e8b18407c00b3a8 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 30 Oct 2023 17:05:56 -0700 Subject: [PATCH 210/243] use Node.js 18 --- sample-apps/blank-nodejs/2-build-layer.sh | 2 +- sample-apps/blank-nodejs/4-invoke.sh | 2 +- sample-apps/blank-nodejs/README.md | 2 +- sample-apps/blank-nodejs/package.json | 8 +++--- sample-apps/blank-nodejs/template.yml | 4 +-- .../efs-nodejs/20231030-efsreaderror.log | 25 +++++++++++++++++++ sample-apps/efs-nodejs/3-deploy.sh | 1 - sample-apps/efs-nodejs/4-invoke.sh | 2 +- sample-apps/efs-nodejs/README.md | 2 +- .../function/{index.js => index.mjs} | 8 +++--- sample-apps/efs-nodejs/template.yml | 2 +- sample-apps/nodejs-apig/3-invoke.sh | 2 +- sample-apps/nodejs-apig/README.md | 2 +- .../function/{index.js => index.mjs} | 8 +++--- sample-apps/nodejs-apig/template.yml | 2 +- 15 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 sample-apps/efs-nodejs/20231030-efsreaderror.log rename sample-apps/efs-nodejs/function/{index.js => index.mjs} (90%) rename sample-apps/nodejs-apig/function/{index.js => index.mjs} (82%) diff --git a/sample-apps/blank-nodejs/2-build-layer.sh b/sample-apps/blank-nodejs/2-build-layer.sh index d30f3600..0385aba4 100755 --- a/sample-apps/blank-nodejs/2-build-layer.sh +++ b/sample-apps/blank-nodejs/2-build-layer.sh @@ -2,5 +2,5 @@ set -eo pipefail mkdir -p lib/nodejs rm -rf node_modules lib/nodejs/node_modules -npm install --production +npm install --omit=dev mv node_modules lib/nodejs/ \ No newline at end of file diff --git a/sample-apps/blank-nodejs/4-invoke.sh b/sample-apps/blank-nodejs/4-invoke.sh index 1ec3612c..b9cade74 100755 --- a/sample-apps/blank-nodejs/4-invoke.sh +++ b/sample-apps/blank-nodejs/4-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-nodejs --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-nodejs/README.md b/sample-apps/blank-nodejs/README.md index 9f0136d1..8e685a39 100644 --- a/sample-apps/blank-nodejs/README.md +++ b/sample-apps/blank-nodejs/README.md @@ -21,7 +21,7 @@ Variants of this sample application are available for the following languages: Use the following instructions to deploy the sample application. For an in-depth look at its architecture and features, see [Blank Function Sample Application for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/samples-blank-nodejs.html) in the developer guide. # Requirements -- [Node.js 10 with npm](https://nodejs.org/en/download/releases/) +- [Node.js 18 with npm](https://nodejs.org/en/download/releases/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. diff --git a/sample-apps/blank-nodejs/package.json b/sample-apps/blank-nodejs/package.json index b1b429f8..83237315 100644 --- a/sample-apps/blank-nodejs/package.json +++ b/sample-apps/blank-nodejs/package.json @@ -3,13 +3,13 @@ "version": "1.0.0", "private": true, "devDependencies": { - "aws-sdk": "2.814.0", - "jest": "25.4.0" + "jest": "29.7.0" }, "dependencies": { - "aws-xray-sdk-core": "1.1.2" + "aws-sdk": "2.1484.0", + "aws-xray-sdk-core": "3.5.3" }, "scripts": { "test": "jest" } -} +} \ No newline at end of file diff --git a/sample-apps/blank-nodejs/template.yml b/sample-apps/blank-nodejs/template.yml index b376e3a3..1104ad27 100644 --- a/sample-apps/blank-nodejs/template.yml +++ b/sample-apps/blank-nodejs/template.yml @@ -6,7 +6,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: index.handler - Runtime: nodejs16.x + Runtime: nodejs18.x CodeUri: function/. Description: Call the AWS Lambda API Timeout: 10 @@ -25,4 +25,4 @@ Resources: Description: Dependencies for the blank sample app. ContentUri: lib/. CompatibleRuntimes: - - nodejs16.x + - nodejs18.x diff --git a/sample-apps/efs-nodejs/20231030-efsreaderror.log b/sample-apps/efs-nodejs/20231030-efsreaderror.log new file mode 100644 index 00000000..f8369311 --- /dev/null +++ b/sample-apps/efs-nodejs/20231030-efsreaderror.log @@ -0,0 +1,25 @@ +$ ./4-invoke.sh +{ + "StatusCode": 200, + "ExecutedVersion": "$LATEST" +} +{"writeTimeMs":60.659086,"readTimeMs":"Read error: Error: ENOENT: no such file or directory, open '/mnt/efs0/test.bin'","fileSizeBytes":0} +{ + "StatusCode": 200, + "ExecutedVersion": "$LATEST" +} +{"writeTimeMs":60.002857,"readTimeMs":79.54446,"fileSizeBytes":1398104} +{ + "StatusCode": 200, + "ExecutedVersion": "$LATEST" +} +{"writeTimeMs":50.76445,"readTimeMs":39.566218,"fileSizeBytes":1398104} +{ + "StatusCode": 200, + "ExecutedVersion": "$LATEST" +} +{"writeTimeMs":60.457508,"readTimeMs":199.181445,"fileSizeBytes":1398104} +{ + "StatusCode": 200, + "ExecutedVersion": "$LATEST" +} \ No newline at end of file diff --git a/sample-apps/efs-nodejs/3-deploy.sh b/sample-apps/efs-nodejs/3-deploy.sh index de00c5c4..275b7dc6 100755 --- a/sample-apps/efs-nodejs/3-deploy.sh +++ b/sample-apps/efs-nodejs/3-deploy.sh @@ -6,7 +6,6 @@ if [[ $# -eq 1 ]] ; then STACK=$1 echo "Deploying to stack $STACK" fi -cd lib/nodejs && npm install && cd ../../ aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml aws cloudformation deploy --template-file out.yml --stack-name $STACK --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/efs-nodejs/4-invoke.sh b/sample-apps/efs-nodejs/4-invoke.sh index 9da0f12d..d2463a0a 100755 --- a/sample-apps/efs-nodejs/4-invoke.sh +++ b/sample-apps/efs-nodejs/4-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name efs-nodejs --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/efs-nodejs/README.md b/sample-apps/efs-nodejs/README.md index ba3252a1..809c1285 100644 --- a/sample-apps/efs-nodejs/README.md +++ b/sample-apps/efs-nodejs/README.md @@ -28,7 +28,7 @@ Use the following instructions to deploy the sample application. To deploy the sample application, you need the following tools: -- [Node.js 10 with npm](https://nodejs.org/en/download/releases/). +- [Node.js 18 with npm](https://nodejs.org/en/download/releases/). - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. diff --git a/sample-apps/efs-nodejs/function/index.js b/sample-apps/efs-nodejs/function/index.mjs similarity index 90% rename from sample-apps/efs-nodejs/function/index.js rename to sample-apps/efs-nodejs/function/index.mjs index b35724a4..b95cc249 100644 --- a/sample-apps/efs-nodejs/function/index.js +++ b/sample-apps/efs-nodejs/function/index.mjs @@ -1,13 +1,13 @@ -var fs = require('fs').promises -const crypto = require('crypto') +import fs from 'node:fs/promises' +const crypto = await import('node:crypto') const dir = process.env.mountPath -exports.handler = async function(event) { +export const handler = async (event) => { console.log("EVENT: %s", JSON.stringify(event, null, 2)) const filePath = dir + "/" + event.fileName const fileSize = event.fileSize // generate file - const buffer = await crypto.randomBytes(fileSize) + const buffer = crypto.randomBytes(fileSize) // write operation const writeTimeMs = await writeFile(filePath, buffer) // read file diff --git a/sample-apps/efs-nodejs/template.yml b/sample-apps/efs-nodejs/template.yml index 62293bc0..a45fc05b 100644 --- a/sample-apps/efs-nodejs/template.yml +++ b/sample-apps/efs-nodejs/template.yml @@ -25,7 +25,7 @@ Resources: mountPath: !Ref mountPath MemorySize: 128 Timeout: 15 - Runtime: nodejs12.x + Runtime: nodejs18.x Tracing: Active Handler: index.handler VpcConfig: diff --git a/sample-apps/nodejs-apig/3-invoke.sh b/sample-apps/nodejs-apig/3-invoke.sh index a5c32b1d..7838da23 100755 --- a/sample-apps/nodejs-apig/3-invoke.sh +++ b/sample-apps/nodejs-apig/3-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name nodejs-apig --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/nodejs-apig/README.md b/sample-apps/nodejs-apig/README.md index 65ff46c3..acbeed99 100644 --- a/sample-apps/nodejs-apig/README.md +++ b/sample-apps/nodejs-apig/README.md @@ -15,7 +15,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements -- [Node.js 10 with npm](https://nodejs.org/en/download/releases/) +- [Node.js 18 with npm](https://nodejs.org/en/download/releases/) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. diff --git a/sample-apps/nodejs-apig/function/index.js b/sample-apps/nodejs-apig/function/index.mjs similarity index 82% rename from sample-apps/nodejs-apig/function/index.js rename to sample-apps/nodejs-apig/function/index.mjs index 3d5fe80a..db6019ff 100644 --- a/sample-apps/nodejs-apig/function/index.js +++ b/sample-apps/nodejs-apig/function/index.mjs @@ -1,14 +1,14 @@ -const AWS = require('aws-sdk') +import {LambdaClient, GetAccountSettingsCommand} from '@aws-sdk/client-lambda'; // Create client outside of handler to reuse -const lambda = new AWS.Lambda() +const lambda = new LambdaClient() // Handler -exports.handler = async function(event, context) { +export const handler = async (event, context) => { console.log('## ENVIRONMENT VARIABLES: ' + serialize(process.env)) console.log('## CONTEXT: ' + serialize(context)) console.log('## EVENT: ' + serialize(event)) try { - let accountSettings = await getAccountSettings() + let accountSettings = await lambda.send(new GetAccountSettingsCommand()) return formatResponse(serialize(accountSettings.AccountUsage)) } catch(error) { return formatError(error) diff --git a/sample-apps/nodejs-apig/template.yml b/sample-apps/nodejs-apig/template.yml index 998a9c22..57970a15 100644 --- a/sample-apps/nodejs-apig/template.yml +++ b/sample-apps/nodejs-apig/template.yml @@ -12,7 +12,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: index.handler - Runtime: nodejs12.x + Runtime: nodejs18.x CodeUri: function/. Description: Call the AWS Lambda API Timeout: 10 From c5f6ee44c80779cf55ab8d3a5bfbffe0869c2124 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Mon, 30 Oct 2023 17:19:47 -0700 Subject: [PATCH 211/243] CLI command compatibility with v2 --- .../1-create-bucket-and-role.sh | 2 +- sample-apps/blank-csharp-with-layer/README.md | 8 ----- sample-apps/blank-csharp/README.md | 8 ----- sample-apps/blank-go/3-invoke.sh | 2 +- sample-apps/blank-go/README.md | 8 ----- sample-apps/blank-java/4-invoke.sh | 2 +- sample-apps/blank-java/README.md | 8 ----- sample-apps/blank-nodejs/README.md | 8 ----- sample-apps/blank-powershell/3-invoke.sh | 2 +- sample-apps/blank-powershell/README.md | 8 ----- sample-apps/blank-python/4-invoke.sh | 2 +- sample-apps/blank-python/README.md | 8 ----- sample-apps/blank-ruby/4-invoke.sh | 2 +- sample-apps/blank-ruby/README.md | 8 ----- sample-apps/ec2-spot/README.md | 8 ----- sample-apps/efs-nodejs/README.md | 8 ----- sample-apps/error-processor/4-invoke.sh | 4 +-- sample-apps/error-processor/README.md | 8 ----- sample-apps/java-basic/3-invoke.sh | 2 +- sample-apps/java-basic/README.md | 8 ----- sample-apps/java-events-v1sdk/4-invoke.sh | 6 ++-- sample-apps/java-events-v1sdk/README.md | 8 ----- sample-apps/java-events/3-invoke.sh | 30 +++++++++---------- sample-apps/java-events/README.md | 8 ----- sample-apps/java17-examples/3-invoke.sh | 2 +- sample-apps/java17-examples/README.md | 8 ----- sample-apps/list-manager/5-create-dbtable.sh | 2 +- sample-apps/list-manager/6-invoke.sh | 2 +- sample-apps/list-manager/README.md | 8 ----- sample-apps/nodejs-apig/README.md | 8 ----- sample-apps/rds-mysql/5-create-dbtable.sh | 2 +- sample-apps/rds-mysql/6-invoke.sh | 2 +- sample-apps/rds-mysql/README.md | 8 ----- sample-apps/s3-java/5-invoke.sh | 2 +- sample-apps/s3-java/README.md | 8 ----- 35 files changed, 33 insertions(+), 185 deletions(-) diff --git a/sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh b/sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh index c7277596..4b8676ae 100755 --- a/sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh +++ b/sample-apps/blank-csharp-with-layer/1-create-bucket-and-role.sh @@ -6,7 +6,7 @@ echo $BUCKET_NAME > bucket-name.txt aws s3 mb s3://$BUCKET_NAME aws s3 mb s3://$LAYER_BUCKET_NAME -aws iam create-role --role-name blank-csharp-role --assume-role-policy-document file://assume-policy.json +aws iam create-role --role-name blank-csharp-role --assume-role-policy-document fileb://assume-policy.json aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess aws iam attach-role-policy --role-name blank-csharp-role --policy-arn arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess diff --git a/sample-apps/blank-csharp-with-layer/README.md b/sample-apps/blank-csharp-with-layer/README.md index 4e8c5bf0..eac563d9 100644 --- a/sample-apps/blank-csharp-with-layer/README.md +++ b/sample-apps/blank-csharp-with-layer/README.md @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. For more inform - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-csharp/README.md b/sample-apps/blank-csharp/README.md index 6a4687cc..ad905416 100644 --- a/sample-apps/blank-csharp/README.md +++ b/sample-apps/blank-csharp/README.md @@ -16,14 +16,6 @@ Use the following instructions to deploy the sample application. For more inform - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-go/3-invoke.sh b/sample-apps/blank-go/3-invoke.sh index 7c7dcfab..58868b77 100755 --- a/sample-apps/blank-go/3-invoke.sh +++ b/sample-apps/blank-go/3-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-go --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-go/README.md b/sample-apps/blank-go/README.md index 7a762a0e..cd77d84a 100644 --- a/sample-apps/blank-go/README.md +++ b/sample-apps/blank-go/README.md @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-java/4-invoke.sh b/sample-apps/blank-java/4-invoke.sh index 2186f191..80939fa9 100755 --- a/sample-apps/blank-java/4-invoke.sh +++ b/sample-apps/blank-java/4-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-java --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-java/README.md b/sample-apps/blank-java/README.md index bf802927..2c36ddc6 100644 --- a/sample-apps/blank-java/README.md +++ b/sample-apps/blank-java/README.md @@ -20,14 +20,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-nodejs/README.md b/sample-apps/blank-nodejs/README.md index 8e685a39..8f60acbc 100644 --- a/sample-apps/blank-nodejs/README.md +++ b/sample-apps/blank-nodejs/README.md @@ -25,14 +25,6 @@ Use the following instructions to deploy the sample application. For an in-depth - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-powershell/3-invoke.sh b/sample-apps/blank-powershell/3-invoke.sh index 4aa193eb..06190ef1 100755 --- a/sample-apps/blank-powershell/3-invoke.sh +++ b/sample-apps/blank-powershell/3-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-powershell --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-powershell/README.md b/sample-apps/blank-powershell/README.md index 3bc829e9..bcd58c97 100644 --- a/sample-apps/blank-powershell/README.md +++ b/sample-apps/blank-powershell/README.md @@ -17,14 +17,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-python/4-invoke.sh b/sample-apps/blank-python/4-invoke.sh index f6e429d5..c85e4944 100755 --- a/sample-apps/blank-python/4-invoke.sh +++ b/sample-apps/blank-python/4-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-python --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-python/README.md b/sample-apps/blank-python/README.md index 1c6d5710..52ae49f0 100644 --- a/sample-apps/blank-python/README.md +++ b/sample-apps/blank-python/README.md @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/blank-ruby/4-invoke.sh b/sample-apps/blank-ruby/4-invoke.sh index 26c4ea96..fb9f725a 100755 --- a/sample-apps/blank-ruby/4-invoke.sh +++ b/sample-apps/blank-ruby/4-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-ruby --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/blank-ruby/README.md b/sample-apps/blank-ruby/README.md index a34c89de..49fcd9bc 100644 --- a/sample-apps/blank-ruby/README.md +++ b/sample-apps/blank-ruby/README.md @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/ec2-spot/README.md b/sample-apps/ec2-spot/README.md index 54c635ff..442e6a8d 100644 --- a/sample-apps/ec2-spot/README.md +++ b/sample-apps/ec2-spot/README.md @@ -15,14 +15,6 @@ Use the following instructions to deploy the sample application. For more inform - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/efs-nodejs/README.md b/sample-apps/efs-nodejs/README.md index 809c1285..0effd7c4 100644 --- a/sample-apps/efs-nodejs/README.md +++ b/sample-apps/efs-nodejs/README.md @@ -32,14 +32,6 @@ To deploy the sample application, you need the following tools: - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - To run the sample application in AWS, you need permission to use Lambda and the following services. - Amazon EFS ([pricing](https://aws.amazon.com/efs/pricing/)) diff --git a/sample-apps/error-processor/4-invoke.sh b/sample-apps/error-processor/4-invoke.sh index 1c323d73..d6e443dc 100755 --- a/sample-apps/error-processor/4-invoke.sh +++ b/sample-apps/error-processor/4-invoke.sh @@ -6,14 +6,14 @@ while true; do then case $1 in async) - aws lambda invoke --function-name $ERROR_FUNCTION --payload file://event.json --invocation-type Event out.json + aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json --invocation-type Event out.json ;; *) echo -n "Unknown argument" ;; esac else - aws lambda invoke --function-name $ERROR_FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json out.json fi cat out.json echo "" diff --git a/sample-apps/error-processor/README.md b/sample-apps/error-processor/README.md index 76fc4dbd..643bbf3f 100644 --- a/sample-apps/error-processor/README.md +++ b/sample-apps/error-processor/README.md @@ -18,14 +18,6 @@ Use the following instructions to deploy the sample application. For more inform - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/java-basic/3-invoke.sh b/sample-apps/java-basic/3-invoke.sh index 35ee7663..ca4af147 100755 --- a/sample-apps/java-basic/3-invoke.sh +++ b/sample-apps/java-basic/3-invoke.sh @@ -30,7 +30,7 @@ while true; do then aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json else - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json fi cat out.json echo "" diff --git a/sample-apps/java-basic/README.md b/sample-apps/java-basic/README.md index 7013c37d..ad958afe 100644 --- a/sample-apps/java-basic/README.md +++ b/sample-apps/java-basic/README.md @@ -18,14 +18,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/java-events-v1sdk/4-invoke.sh b/sample-apps/java-events-v1sdk/4-invoke.sh index 5c49938d..05ddd9f8 100755 --- a/sample-apps/java-events-v1sdk/4-invoke.sh +++ b/sample-apps/java-events-v1sdk/4-invoke.sh @@ -5,10 +5,10 @@ if [ $1 ] then case $1 in ddb) - PAYLOAD='file://events/dynamodb-record.json' + PAYLOAD='fileb://events/dynamodb-record.json' ;; kin) - PAYLOAD='file://events/kinesis-record.json' + PAYLOAD='fileb://events/kinesis-record.json' ;; *) echo -n "Unknown event type" @@ -20,7 +20,7 @@ while true; do then aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json else - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json fi cat out.json echo "" diff --git a/sample-apps/java-events-v1sdk/README.md b/sample-apps/java-events-v1sdk/README.md index d2299710..6405882d 100644 --- a/sample-apps/java-events-v1sdk/README.md +++ b/sample-apps/java-events-v1sdk/README.md @@ -22,14 +22,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/java-events/3-invoke.sh b/sample-apps/java-events/3-invoke.sh index c4bf8c43..3dfd78e6 100755 --- a/sample-apps/java-events/3-invoke.sh +++ b/sample-apps/java-events/3-invoke.sh @@ -5,46 +5,46 @@ if [ $1 ] then case $1 in apig) - PAYLOAD='file://events/apigateway-v1.json' + PAYLOAD='fileb://events/apigateway-v1.json' ;; cws) - PAYLOAD='file://events/cloudwatch-scheduled.json' + PAYLOAD='fileb://events/cloudwatch-scheduled.json' ;; cwl) - PAYLOAD='file://events/cloudwatch-logs.json' + PAYLOAD='fileb://events/cloudwatch-logs.json' ;; sns) - PAYLOAD='file://events/sns-notification.json' + PAYLOAD='fileb://events/sns-notification.json' ;; cdn) - PAYLOAD='file://events/cloudfront.json' + PAYLOAD='fileb://events/cloudfront.json' ;; cfg) - PAYLOAD='file://events/config-rule.json' + PAYLOAD='fileb://events/config-rule.json' ;; cc) - PAYLOAD='file://events/codecommit-push.json' + PAYLOAD='fileb://events/codecommit-push.json' ;; cog) - PAYLOAD='file://events/cognito-sync.json' + PAYLOAD='fileb://events/cognito-sync.json' ;; kin) - PAYLOAD='file://events/kinesis-record.json' + PAYLOAD='fileb://events/kinesis-record.json' ;; fh) - PAYLOAD='file://events/firehose-record.json' + PAYLOAD='fileb://events/firehose-record.json' ;; lex) - PAYLOAD='file://events/lex-flowers.json' + PAYLOAD='fileb://events/lex-flowers.json' ;; ddb) - PAYLOAD='file://events/dynamodb-record.json' + PAYLOAD='fileb://events/dynamodb-record.json' ;; s3) - PAYLOAD='file://events/s3-notification.json' + PAYLOAD='fileb://events/s3-notification.json' ;; sqs) - PAYLOAD='file://events/sqs-record.json' + PAYLOAD='fileb://events/sqs-record.json' ;; *) echo -n "Unknown event type" @@ -56,7 +56,7 @@ while true; do then aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json else - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json fi cat out.json echo "" diff --git a/sample-apps/java-events/README.md b/sample-apps/java-events/README.md index d04ccf4f..edfc006b 100644 --- a/sample-apps/java-events/README.md +++ b/sample-apps/java-events/README.md @@ -22,14 +22,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/java17-examples/3-invoke.sh b/sample-apps/java17-examples/3-invoke.sh index 4e4cfd5b..7ff3bf1b 100755 --- a/sample-apps/java17-examples/3-invoke.sh +++ b/sample-apps/java17-examples/3-invoke.sh @@ -30,7 +30,7 @@ while true; do then aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD out.json else - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json fi cat out.json echo "" diff --git a/sample-apps/java17-examples/README.md b/sample-apps/java17-examples/README.md index ee54ff71..9d0ab1ad 100644 --- a/sample-apps/java17-examples/README.md +++ b/sample-apps/java17-examples/README.md @@ -18,14 +18,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/list-manager/5-create-dbtable.sh b/sample-apps/list-manager/5-create-dbtable.sh index 213be7fb..d62a5496 100755 --- a/sample-apps/list-manager/5-create-dbtable.sh +++ b/sample-apps/list-manager/5-create-dbtable.sh @@ -1,4 +1,4 @@ #!/bin/bash set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name list-manager --logical-resource-id dbadmin --query 'StackResourceDetail.PhysicalResourceId' --output text) -aws lambda invoke --function-name $FUNCTION --payload file://events/db-create-table.json out.json +aws lambda invoke --function-name $FUNCTION --payload fileb://events/db-create-table.json out.json diff --git a/sample-apps/list-manager/6-invoke.sh b/sample-apps/list-manager/6-invoke.sh index 5d507a48..def323cb 100755 --- a/sample-apps/list-manager/6-invoke.sh +++ b/sample-apps/list-manager/6-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name list-manager --logical-resource-id processor --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://events/kinesis.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://events/kinesis.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/list-manager/README.md b/sample-apps/list-manager/README.md index 4caa983a..f5afdb56 100644 --- a/sample-apps/list-manager/README.md +++ b/sample-apps/list-manager/README.md @@ -45,14 +45,6 @@ To deploy the sample application, you need the following tools: - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - To run the sample application in AWS, you need permission to use Lambda and the following services: - Amazon RDS ([pricing](https://aws.amazon.com/rds/pricing/)) diff --git a/sample-apps/nodejs-apig/README.md b/sample-apps/nodejs-apig/README.md index acbeed99..cc3681b3 100644 --- a/sample-apps/nodejs-apig/README.md +++ b/sample-apps/nodejs-apig/README.md @@ -19,14 +19,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. diff --git a/sample-apps/rds-mysql/5-create-dbtable.sh b/sample-apps/rds-mysql/5-create-dbtable.sh index 7fd45a93..9e9abf49 100755 --- a/sample-apps/rds-mysql/5-create-dbtable.sh +++ b/sample-apps/rds-mysql/5-create-dbtable.sh @@ -1,4 +1,4 @@ #!/bin/bash set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) -aws lambda invoke --function-name $FUNCTION --payload file://events/db-create-table.json out.json +aws lambda invoke --function-name $FUNCTION --payload fileb://events/db-create-table.json out.json diff --git a/sample-apps/rds-mysql/6-invoke.sh b/sample-apps/rds-mysql/6-invoke.sh index 6de0eda1..5782dd31 100755 --- a/sample-apps/rds-mysql/6-invoke.sh +++ b/sample-apps/rds-mysql/6-invoke.sh @@ -3,7 +3,7 @@ set -eo pipefail FUNCTION=$(aws cloudformation describe-stack-resource --stack-name rds-mysql --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) while true; do - aws lambda invoke --function-name $FUNCTION --payload file://events/db-read-table.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://events/db-read-table.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/rds-mysql/README.md b/sample-apps/rds-mysql/README.md index c29f1a7f..f10bbfae 100644 --- a/sample-apps/rds-mysql/README.md +++ b/sample-apps/rds-mysql/README.md @@ -34,14 +34,6 @@ To deploy the sample application, you need the following tools: - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - To run the sample application in AWS, you need permission to use Lambda and the following services. - Amazon RDS ([pricing](https://aws.amazon.com/rds/pricing/)) diff --git a/sample-apps/s3-java/5-invoke.sh b/sample-apps/s3-java/5-invoke.sh index d65db099..9399b6ca 100755 --- a/sample-apps/s3-java/5-invoke.sh +++ b/sample-apps/s3-java/5-invoke.sh @@ -9,7 +9,7 @@ if [ ! -f event.json ]; then fi while true; do - aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json + aws lambda invoke --function-name $FUNCTION --payload fileb://event.json out.json cat out.json echo "" sleep 2 diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index 7adfc9f1..7576c733 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -19,14 +19,6 @@ Use the following instructions to deploy the sample application. - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. -If you use the AWS CLI v2, add the following to your [configuration file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) (`~/.aws/config`): - -``` -cli_binary_format=raw-in-base64-out -``` - -This setting enables the AWS CLI v2 to load JSON events from a file, matching the v1 behavior. - # Setup Download or clone this repository. From 4f313b9c92112c82c235c3542c75ee7ca947cf58 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 31 Oct 2023 09:45:08 -0700 Subject: [PATCH 212/243] remove markdown build (https://aws.amazon.com/blogs/aws/retiring-the-aws-documentation-on-github/) --- CONTRIBUTING.md | 68 +- LICENSE | 166 +--- LICENSE-SAMPLECODE | 14 - LICENSE-SUMMARY | 5 - README.md | 14 +- doc_source/API_AccountLimit.md | 39 - doc_source/API_AccountUsage.md | 23 - doc_source/API_AddLayerVersionPermission.md | 136 --- doc_source/API_AddPermission.md | 173 ---- doc_source/API_AliasConfiguration.md | 49 - doc_source/API_AliasRoutingConfiguration.md | 21 - doc_source/API_AllowedPublishers.md | 20 - ...API_AmazonManagedKafkaEventSourceConfig.md | 20 - doc_source/API_CodeSigningConfig.md | 47 - doc_source/API_CodeSigningPolicies.md | 20 - doc_source/API_Concurrency.md | 17 - doc_source/API_Cors.md | 57 -- doc_source/API_CreateAlias.md | 159 ---- doc_source/API_CreateCodeSigningConfig.md | 99 -- doc_source/API_CreateEventSourceMapping.md | 460 --------- doc_source/API_CreateFunction.md | 519 ---------- doc_source/API_CreateFunctionUrlConfig.md | 144 --- doc_source/API_DeadLetterConfig.md | 19 - doc_source/API_DeleteAlias.md | 76 -- doc_source/API_DeleteCodeSigningConfig.md | 64 -- doc_source/API_DeleteEventSourceMapping.md | 247 ----- doc_source/API_DeleteFunction.md | 81 -- .../API_DeleteFunctionCodeSigningConfig.md | 78 -- doc_source/API_DeleteFunctionConcurrency.md | 74 -- .../API_DeleteFunctionEventInvokeConfig.md | 81 -- doc_source/API_DeleteFunctionUrlConfig.md | 75 -- doc_source/API_DeleteLayerVersion.md | 60 -- .../API_DeleteProvisionedConcurrencyConfig.md | 80 -- doc_source/API_DestinationConfig.md | 23 - doc_source/API_Environment.md | 19 - doc_source/API_EnvironmentError.md | 23 - doc_source/API_EnvironmentResponse.md | 24 - doc_source/API_EphemeralStorage.md | 19 - .../API_EventSourceMappingConfiguration.md | 160 ---- doc_source/API_FileSystemConfig.md | 27 - doc_source/API_Filter.md | 20 - doc_source/API_FilterCriteria.md | 18 - doc_source/API_FunctionCode.md | 42 - doc_source/API_FunctionCodeLocation.md | 33 - doc_source/API_FunctionConfiguration.md | 202 ---- doc_source/API_FunctionEventInvokeConfig.md | 45 - doc_source/API_FunctionUrlConfig.md | 46 - doc_source/API_GetAccountSettings.md | 75 -- doc_source/API_GetAlias.md | 122 --- doc_source/API_GetCodeSigningConfig.md | 82 -- doc_source/API_GetEventSourceMapping.md | 241 ----- doc_source/API_GetFunction.md | 184 ---- .../API_GetFunctionCodeSigningConfig.md | 96 -- doc_source/API_GetFunctionConcurrency.md | 82 -- doc_source/API_GetFunctionConfiguration.md | 312 ------ .../API_GetFunctionEventInvokeConfig.md | 124 --- doc_source/API_GetFunctionUrlConfig.md | 121 --- doc_source/API_GetLayerVersion.md | 135 --- doc_source/API_GetLayerVersionByArn.md | 131 --- doc_source/API_GetLayerVersionPolicy.md | 84 -- doc_source/API_GetPolicy.md | 91 -- .../API_GetProvisionedConcurrencyConfig.md | 120 --- doc_source/API_ImageConfig.md | 31 - doc_source/API_ImageConfigError.md | 23 - doc_source/API_ImageConfigResponse.md | 23 - doc_source/API_Invoke.md | 224 ----- doc_source/API_InvokeAsync.md | 88 -- doc_source/API_Layer.md | 37 - doc_source/API_LayerVersionContentInput.md | 37 - doc_source/API_LayerVersionContentOutput.md | 38 - doc_source/API_LayerVersionsListItem.md | 56 -- doc_source/API_LayersListItem.md | 32 - doc_source/API_ListAliases.md | 111 --- doc_source/API_ListCodeSigningConfigs.md | 86 -- doc_source/API_ListEventSourceMappings.md | 156 --- .../API_ListFunctionEventInvokeConfigs.md | 110 --- doc_source/API_ListFunctionUrlConfigs.md | 109 --- doc_source/API_ListFunctions.md | 166 ---- .../API_ListFunctionsByCodeSigningConfig.md | 84 -- doc_source/API_ListLayerVersions.md | 105 -- doc_source/API_ListLayers.md | 99 -- .../API_ListProvisionedConcurrencyConfigs.md | 103 -- doc_source/API_ListTags.md | 76 -- doc_source/API_ListVersionsByFunction.md | 169 ---- doc_source/API_OnFailure.md | 20 - doc_source/API_OnSuccess.md | 20 - doc_source/API_Operations.md | 66 -- ...PI_ProvisionedConcurrencyConfigListItem.md | 53 -- doc_source/API_PublishLayerVersion.md | 185 ---- doc_source/API_PublishVersion.md | 344 ------- .../API_PutFunctionCodeSigningConfig.md | 116 --- doc_source/API_PutFunctionConcurrency.md | 101 -- .../API_PutFunctionEventInvokeConfig.md | 167 ---- .../API_PutProvisionedConcurrencyConfig.md | 131 --- doc_source/API_Reference.md | 26 - .../API_RemoveLayerVersionPermission.md | 81 -- doc_source/API_RemovePermission.md | 88 -- doc_source/API_SelfManagedEventSource.md | 23 - .../API_SelfManagedKafkaEventSourceConfig.md | 20 - doc_source/API_SourceAccessConfiguration.md | 35 - doc_source/API_TagResource.md | 79 -- doc_source/API_TracingConfig.md | 19 - doc_source/API_TracingConfigResponse.md | 19 - doc_source/API_Types.md | 46 - doc_source/API_UntagResource.md | 71 -- doc_source/API_UpdateAlias.md | 165 ---- doc_source/API_UpdateCodeSigningConfig.md | 109 --- doc_source/API_UpdateEventSourceMapping.md | 399 -------- doc_source/API_UpdateFunctionCode.md | 404 -------- doc_source/API_UpdateFunctionConfiguration.md | 464 --------- .../API_UpdateFunctionEventInvokeConfig.md | 165 ---- doc_source/API_UpdateFunctionUrlConfig.md | 149 --- doc_source/API_VpcConfig.md | 25 - doc_source/API_VpcConfigResponse.md | 30 - doc_source/CommonErrors.md | 75 -- doc_source/CommonParameters.md | 51 - doc_source/access-control-identity-based.md | 241 ----- doc_source/access-control-resource-based.md | 266 ------ doc_source/applications-console.md | 91 -- doc_source/applications-tutorial.md | 351 ------- doc_source/applications-usecases.md | 43 - doc_source/attribute-based-access-control.md | 169 ---- doc_source/best-practices.md | 72 -- doc_source/codewhisperer-overview.md | 79 -- doc_source/codewhisperer-setup.md | 39 - doc_source/codewhisperer.md | 7 - doc_source/configuration-aliases.md | 161 ---- doc_source/configuration-codesigning.md | 195 ---- doc_source/configuration-concurrency.md | 73 -- doc_source/configuration-database.md | 93 -- doc_source/configuration-envvars.md | 308 ------ doc_source/configuration-filesystem.md | 205 ---- doc_source/configuration-function-common.md | 181 ---- doc_source/configuration-function-zip.md | 171 ---- doc_source/configuration-layers.md | 287 ------ doc_source/configuration-tags.md | 132 --- doc_source/configuration-versions.md | 88 -- doc_source/configuration-vpc-endpoints.md | 106 --- doc_source/configuration-vpc.md | 315 ------ doc_source/csharp-context.md | 28 - doc_source/csharp-exceptions.md | 222 ----- doc_source/csharp-handler.md | 318 ------- doc_source/csharp-image.md | 55 -- doc_source/csharp-logging.md | 238 ----- doc_source/csharp-package-cli.md | 192 ---- doc_source/csharp-package-toolkit.md | 48 - doc_source/csharp-package.md | 9 - doc_source/csharp-tracing.md | 146 --- doc_source/deploying-lambda-apps.md | 19 - doc_source/dotnet-native-aot.md | 108 --- ...ple_cross_ApiGatewayDataTracker_section.md | 28 - ...e_cross_ApiGatewayWebsocketChat_section.md | 25 - ..._cross_AuroraRestLendingLibrary_section.md | 28 - .../example_cross_LambdaAPIGateway_section.md | 54 -- .../example_cross_LambdaForBrowser_section.md | 29 - ...ple_cross_LambdaScheduledEvents_section.md | 54 -- ...ample_cross_ServerlessWorkflows_section.md | 38 - ...le_cross_StepFunctionsMessenger_section.md | 27 - .../example_lambda_CreateFunction_section.md | 148 --- .../example_lambda_DeleteFunction_section.md | 85 -- .../example_lambda_GetFunction_section.md | 45 - doc_source/example_lambda_Invoke_section.md | 111 --- .../example_lambda_ListFunctions_section.md | 44 - ...cenario_GettingStartedFunctions_section.md | 899 ------------------ ...ample_lambda_UpdateFunctionCode_section.md | 46 - ...bda_UpdateFunctionConfiguration_section.md | 44 - doc_source/extensions-api-partners.md | 29 - doc_source/extensions-configuration.md | 55 -- doc_source/foundation-arch.md | 84 -- doc_source/foundation-console.md | 187 ---- doc_source/foundation-networking.md | 106 --- doc_source/foundation-progmodel.md | 25 - doc_source/functions-states.md | 69 -- doc_source/getting-started.md | 107 --- doc_source/gettingstarted-awscli.md | 340 ------- doc_source/gettingstarted-concepts.md | 128 --- doc_source/gettingstarted-features.md | 93 -- doc_source/gettingstarted-images.md | 332 ------- doc_source/gettingstarted-limits.md | 60 -- doc_source/gettingstarted-package.md | 117 --- doc_source/glossary.md | 3 - doc_source/go-image.md | 190 ---- doc_source/golang-context.md | 84 -- doc_source/golang-envvars.md | 22 - doc_source/golang-exceptions.md | 138 --- doc_source/golang-handler.md | 185 ---- doc_source/golang-logging.md | 204 ---- doc_source/golang-package.md | 231 ----- doc_source/golang-tracing.md | 139 --- doc_source/images-create.md | 281 ------ doc_source/images-test.md | 166 ---- doc_source/index.md | 392 -------- doc_source/invocation-async.md | 267 ------ doc_source/invocation-eventfiltering.md | 362 ------- doc_source/invocation-eventsourcemapping.md | 116 --- doc_source/invocation-images.md | 28 - doc_source/invocation-layers.md | 259 ----- doc_source/invocation-retries.md | 43 - doc_source/invocation-scaling.md | 69 -- doc_source/invocation-sync.md | 85 -- doc_source/java-context.md | 107 --- doc_source/java-exceptions.md | 218 ----- doc_source/java-handler.md | 177 ---- doc_source/java-image.md | 65 -- doc_source/java-logging.md | 326 ------- doc_source/java-package-eclipse.md | 104 -- doc_source/java-package.md | 336 ------- doc_source/java-samples.md | 11 - doc_source/java-tracing.md | 188 ---- doc_source/kinesis-tutorial-spec.md | 43 - doc_source/lambda-api-permissions-ref.md | 207 ---- doc_source/lambda-csharp.md | 47 - doc_source/lambda-deploy-functions.md | 31 - doc_source/lambda-edge.md | 58 -- doc_source/lambda-extensions.md | 49 - doc_source/lambda-foundation.md | 15 - doc_source/lambda-functions.md | 11 - doc_source/lambda-golang.md | 39 - doc_source/lambda-intro-execution-role.md | 237 ----- doc_source/lambda-invocation.md | 23 - doc_source/lambda-java.md | 83 -- doc_source/lambda-managing.md | 9 - doc_source/lambda-monitoring.md | 15 - doc_source/lambda-nodejs.md | 99 -- doc_source/lambda-permissions.md | 23 - doc_source/lambda-powershell.md | 27 - doc_source/lambda-python.md | 58 -- doc_source/lambda-releases.md | 116 --- doc_source/lambda-rolling-deployments.md | 53 -- doc_source/lambda-ruby.md | 81 -- doc_source/lambda-runtime-environment.md | 71 -- doc_source/lambda-runtimes.md | 94 -- doc_source/lambda-samples.md | 66 -- doc_source/lambda-security.md | 19 - doc_source/lambda-services.md | 75 -- doc_source/lambda-settingup.md | 70 -- doc_source/lambda-stepfunctions.md | 8 - doc_source/lambda-troubleshooting.md | 14 - doc_source/lambda-typescript.md | 58 -- doc_source/lambda-urls.md | 23 - doc_source/logging-using-cloudtrail.md | 165 ---- doc_source/monitoring-cloudwatchlogs.md | 57 -- doc_source/monitoring-code-profiler.md | 50 - .../monitoring-functions-access-metrics.md | 80 -- doc_source/monitoring-insights.md | 137 --- doc_source/monitoring-metrics.md | 75 -- doc_source/monitoring-servicemap.md | 107 --- doc_source/nodejs-context.md | 43 - doc_source/nodejs-exceptions.md | 139 --- doc_source/nodejs-handler.md | 109 --- doc_source/nodejs-image.md | 59 -- doc_source/nodejs-logging.md | 197 ---- doc_source/nodejs-package.md | 131 --- doc_source/nodejs-tracing.md | 209 ---- doc_source/permissions-boundary.md | 60 -- doc_source/powershell-context.md | 26 - doc_source/powershell-devenv.md | 9 - doc_source/powershell-exceptions.md | 159 ---- doc_source/powershell-handler.md | 32 - doc_source/powershell-logging.md | 207 ---- doc_source/powershell-package.md | 74 -- doc_source/provisioned-concurrency.md | 195 ---- doc_source/python-context.md | 46 - doc_source/python-exceptions.md | 161 ---- doc_source/python-handler.md | 143 --- doc_source/python-image.md | 102 -- doc_source/python-logging.md | 220 ----- doc_source/python-package.md | 215 ----- doc_source/python-tracing.md | 187 ---- doc_source/ruby-context.md | 18 - doc_source/ruby-exceptions.md | 146 --- doc_source/ruby-handler.md | 39 - doc_source/ruby-image.md | 99 -- doc_source/ruby-logging.md | 219 ----- doc_source/ruby-package.md | 136 --- doc_source/ruby-tracing.md | 175 ---- doc_source/runtimes-api.md | 192 ---- doc_source/runtimes-avx2.md | 65 -- doc_source/runtimes-custom.md | 72 -- doc_source/runtimes-extensions-api.md | 380 -------- doc_source/runtimes-images.md | 56 -- doc_source/runtimes-logs-api.md | 332 ------- doc_source/runtimes-modify.md | 248 ----- doc_source/runtimes-walkthrough.md | 297 ------ doc_source/samples-blank.md | 236 ----- doc_source/samples-errorprocessor.md | 87 -- doc_source/samples-listmanager.md | 115 --- doc_source/sdk-general-information-section.md | 23 - doc_source/security-compliance.md | 14 - doc_source/security-configuration.md | 7 - doc_source/security-dataprotection.md | 35 - doc_source/security-iam.md | 98 -- doc_source/security-infrastructure.md | 7 - doc_source/security-resilience.md | 13 - .../security_iam_id-based-policy-examples.md | 66 -- doc_source/security_iam_service-with-iam.md | 5 - doc_source/security_iam_troubleshoot.md | 89 -- doc_source/service_code_examples.md | 37 - doc_source/service_code_examples_actions.md | 14 - ...ce_code_examples_cross-service_examples.md | 13 - doc_source/service_code_examples_scenarios.md | 6 - doc_source/services-alb.md | 74 -- doc_source/services-alexa.md | 33 - doc_source/services-apigateway-blueprint.md | 77 -- doc_source/services-apigateway-code.md | 146 --- doc_source/services-apigateway-template.md | 25 - doc_source/services-apigateway-tutorial.md | 494 ---------- doc_source/services-apigateway.md | 315 ------ doc_source/services-cloudformation.md | 102 -- .../services-cloudwatchevents-expressions.md | 42 - .../services-cloudwatchevents-tutorial.md | 170 ---- doc_source/services-cloudwatchevents.md | 79 -- doc_source/services-cloudwatchlogs.md | 40 - doc_source/services-codecommit.md | 36 - doc_source/services-codepipeline.md | 96 -- doc_source/services-cognito.md | 30 - doc_source/services-config.md | 22 - doc_source/services-connect.md | 41 - doc_source/services-ec2.md | 62 -- doc_source/services-efs.md | 47 - doc_source/services-elasticache-tutorial.md | 174 ---- doc_source/services-iot.md | 38 - doc_source/services-iotevents.md | 64 -- doc_source/services-kinesisfirehose.md | 41 - doc_source/services-lex.md | 140 --- doc_source/services-rds-tutorial.md | 213 ----- doc_source/services-rds.md | 41 - doc_source/services-s3-batch.md | 68 -- doc_source/services-s3-object-lambda.md | 9 - doc_source/services-ses.md | 107 --- doc_source/services-stepfunctions.md | 195 ---- doc_source/services-xray.md | 130 --- doc_source/stepfunctions-lc.md | 63 -- doc_source/stepfunctions-patterns.md | 143 --- doc_source/telemetry-api-reference.md | 126 --- doc_source/telemetry-api.md | 263 ----- doc_source/telemetry-otel-spans.md | 98 -- doc_source/telemetry-schema-reference.md | 556 ----------- doc_source/testing-functions.md | 98 -- doc_source/troubleshooting-deployment.md | 115 --- doc_source/troubleshooting-execution.md | 89 -- doc_source/troubleshooting-images.md | 55 -- doc_source/troubleshooting-invocation.md | 116 --- doc_source/troubleshooting-networking.md | 31 - doc_source/typescript-exceptions.md | 90 -- doc_source/typescript-handler.md | 99 -- doc_source/typescript-image.md | 109 --- doc_source/typescript-package.md | 249 ----- doc_source/urls-auth.md | 238 ----- doc_source/urls-configuration.md | 217 ----- doc_source/urls-invocation.md | 201 ---- doc_source/urls-monitoring.md | 37 - doc_source/urls-tutorial.md | 195 ---- doc_source/welcome.md | 105 -- doc_source/with-android-create-package.md | 103 -- doc_source/with-android-example.md | 321 ------- doc_source/with-cloudtrail-create-package.md | 91 -- doc_source/with-cloudtrail.md | 84 -- doc_source/with-ddb-create-package.md | 170 ---- doc_source/with-ddb-example.md | 300 ------ doc_source/with-ddb.md | 633 ------------ doc_source/with-kafka.md | 488 ---------- doc_source/with-kinesis-create-package.md | 166 ---- .../with-kinesis-example-use-app-spec.md | 86 -- doc_source/with-kinesis-example.md | 245 ----- doc_source/with-kinesis.md | 582 ------------ doc_source/with-mq.md | 331 ------- doc_source/with-msk.md | 431 --------- doc_source/with-on-demand-custom-android.md | 11 - doc_source/with-s3-example-use-app-spec.md | 31 - doc_source/with-s3-example.md | 300 ------ doc_source/with-s3-tutorial.md | 548 ----------- doc_source/with-s3.md | 60 -- doc_source/with-secrets-manager.md | 15 - doc_source/with-sns-create-package.md | 114 --- doc_source/with-sns-example.md | 217 ----- doc_source/with-sns.md | 58 -- doc_source/with-sqs-create-package.md | 152 --- doc_source/with-sqs-cross-account-example.md | 237 ----- doc_source/with-sqs-example-use-app-spec.md | 29 - doc_source/with-sqs-example.md | 206 ---- doc_source/with-sqs.md | 293 ------ 382 files changed, 57 insertions(+), 46148 deletions(-) delete mode 100644 LICENSE-SAMPLECODE delete mode 100644 LICENSE-SUMMARY delete mode 100644 doc_source/API_AccountLimit.md delete mode 100644 doc_source/API_AccountUsage.md delete mode 100644 doc_source/API_AddLayerVersionPermission.md delete mode 100644 doc_source/API_AddPermission.md delete mode 100644 doc_source/API_AliasConfiguration.md delete mode 100644 doc_source/API_AliasRoutingConfiguration.md delete mode 100644 doc_source/API_AllowedPublishers.md delete mode 100644 doc_source/API_AmazonManagedKafkaEventSourceConfig.md delete mode 100644 doc_source/API_CodeSigningConfig.md delete mode 100644 doc_source/API_CodeSigningPolicies.md delete mode 100644 doc_source/API_Concurrency.md delete mode 100644 doc_source/API_Cors.md delete mode 100644 doc_source/API_CreateAlias.md delete mode 100644 doc_source/API_CreateCodeSigningConfig.md delete mode 100644 doc_source/API_CreateEventSourceMapping.md delete mode 100644 doc_source/API_CreateFunction.md delete mode 100644 doc_source/API_CreateFunctionUrlConfig.md delete mode 100644 doc_source/API_DeadLetterConfig.md delete mode 100644 doc_source/API_DeleteAlias.md delete mode 100644 doc_source/API_DeleteCodeSigningConfig.md delete mode 100644 doc_source/API_DeleteEventSourceMapping.md delete mode 100644 doc_source/API_DeleteFunction.md delete mode 100644 doc_source/API_DeleteFunctionCodeSigningConfig.md delete mode 100644 doc_source/API_DeleteFunctionConcurrency.md delete mode 100644 doc_source/API_DeleteFunctionEventInvokeConfig.md delete mode 100644 doc_source/API_DeleteFunctionUrlConfig.md delete mode 100644 doc_source/API_DeleteLayerVersion.md delete mode 100644 doc_source/API_DeleteProvisionedConcurrencyConfig.md delete mode 100644 doc_source/API_DestinationConfig.md delete mode 100644 doc_source/API_Environment.md delete mode 100644 doc_source/API_EnvironmentError.md delete mode 100644 doc_source/API_EnvironmentResponse.md delete mode 100644 doc_source/API_EphemeralStorage.md delete mode 100644 doc_source/API_EventSourceMappingConfiguration.md delete mode 100644 doc_source/API_FileSystemConfig.md delete mode 100644 doc_source/API_Filter.md delete mode 100644 doc_source/API_FilterCriteria.md delete mode 100644 doc_source/API_FunctionCode.md delete mode 100644 doc_source/API_FunctionCodeLocation.md delete mode 100644 doc_source/API_FunctionConfiguration.md delete mode 100644 doc_source/API_FunctionEventInvokeConfig.md delete mode 100644 doc_source/API_FunctionUrlConfig.md delete mode 100644 doc_source/API_GetAccountSettings.md delete mode 100644 doc_source/API_GetAlias.md delete mode 100644 doc_source/API_GetCodeSigningConfig.md delete mode 100644 doc_source/API_GetEventSourceMapping.md delete mode 100644 doc_source/API_GetFunction.md delete mode 100644 doc_source/API_GetFunctionCodeSigningConfig.md delete mode 100644 doc_source/API_GetFunctionConcurrency.md delete mode 100644 doc_source/API_GetFunctionConfiguration.md delete mode 100644 doc_source/API_GetFunctionEventInvokeConfig.md delete mode 100644 doc_source/API_GetFunctionUrlConfig.md delete mode 100644 doc_source/API_GetLayerVersion.md delete mode 100644 doc_source/API_GetLayerVersionByArn.md delete mode 100644 doc_source/API_GetLayerVersionPolicy.md delete mode 100644 doc_source/API_GetPolicy.md delete mode 100644 doc_source/API_GetProvisionedConcurrencyConfig.md delete mode 100644 doc_source/API_ImageConfig.md delete mode 100644 doc_source/API_ImageConfigError.md delete mode 100644 doc_source/API_ImageConfigResponse.md delete mode 100644 doc_source/API_Invoke.md delete mode 100644 doc_source/API_InvokeAsync.md delete mode 100644 doc_source/API_Layer.md delete mode 100644 doc_source/API_LayerVersionContentInput.md delete mode 100644 doc_source/API_LayerVersionContentOutput.md delete mode 100644 doc_source/API_LayerVersionsListItem.md delete mode 100644 doc_source/API_LayersListItem.md delete mode 100644 doc_source/API_ListAliases.md delete mode 100644 doc_source/API_ListCodeSigningConfigs.md delete mode 100644 doc_source/API_ListEventSourceMappings.md delete mode 100644 doc_source/API_ListFunctionEventInvokeConfigs.md delete mode 100644 doc_source/API_ListFunctionUrlConfigs.md delete mode 100644 doc_source/API_ListFunctions.md delete mode 100644 doc_source/API_ListFunctionsByCodeSigningConfig.md delete mode 100644 doc_source/API_ListLayerVersions.md delete mode 100644 doc_source/API_ListLayers.md delete mode 100644 doc_source/API_ListProvisionedConcurrencyConfigs.md delete mode 100644 doc_source/API_ListTags.md delete mode 100644 doc_source/API_ListVersionsByFunction.md delete mode 100644 doc_source/API_OnFailure.md delete mode 100644 doc_source/API_OnSuccess.md delete mode 100644 doc_source/API_Operations.md delete mode 100644 doc_source/API_ProvisionedConcurrencyConfigListItem.md delete mode 100644 doc_source/API_PublishLayerVersion.md delete mode 100644 doc_source/API_PublishVersion.md delete mode 100644 doc_source/API_PutFunctionCodeSigningConfig.md delete mode 100644 doc_source/API_PutFunctionConcurrency.md delete mode 100644 doc_source/API_PutFunctionEventInvokeConfig.md delete mode 100644 doc_source/API_PutProvisionedConcurrencyConfig.md delete mode 100644 doc_source/API_Reference.md delete mode 100644 doc_source/API_RemoveLayerVersionPermission.md delete mode 100644 doc_source/API_RemovePermission.md delete mode 100644 doc_source/API_SelfManagedEventSource.md delete mode 100644 doc_source/API_SelfManagedKafkaEventSourceConfig.md delete mode 100644 doc_source/API_SourceAccessConfiguration.md delete mode 100644 doc_source/API_TagResource.md delete mode 100644 doc_source/API_TracingConfig.md delete mode 100644 doc_source/API_TracingConfigResponse.md delete mode 100644 doc_source/API_Types.md delete mode 100644 doc_source/API_UntagResource.md delete mode 100644 doc_source/API_UpdateAlias.md delete mode 100644 doc_source/API_UpdateCodeSigningConfig.md delete mode 100644 doc_source/API_UpdateEventSourceMapping.md delete mode 100644 doc_source/API_UpdateFunctionCode.md delete mode 100644 doc_source/API_UpdateFunctionConfiguration.md delete mode 100644 doc_source/API_UpdateFunctionEventInvokeConfig.md delete mode 100644 doc_source/API_UpdateFunctionUrlConfig.md delete mode 100644 doc_source/API_VpcConfig.md delete mode 100644 doc_source/API_VpcConfigResponse.md delete mode 100644 doc_source/CommonErrors.md delete mode 100644 doc_source/CommonParameters.md delete mode 100644 doc_source/access-control-identity-based.md delete mode 100644 doc_source/access-control-resource-based.md delete mode 100644 doc_source/applications-console.md delete mode 100644 doc_source/applications-tutorial.md delete mode 100644 doc_source/applications-usecases.md delete mode 100644 doc_source/attribute-based-access-control.md delete mode 100644 doc_source/best-practices.md delete mode 100644 doc_source/codewhisperer-overview.md delete mode 100644 doc_source/codewhisperer-setup.md delete mode 100644 doc_source/codewhisperer.md delete mode 100644 doc_source/configuration-aliases.md delete mode 100644 doc_source/configuration-codesigning.md delete mode 100644 doc_source/configuration-concurrency.md delete mode 100644 doc_source/configuration-database.md delete mode 100644 doc_source/configuration-envvars.md delete mode 100644 doc_source/configuration-filesystem.md delete mode 100644 doc_source/configuration-function-common.md delete mode 100644 doc_source/configuration-function-zip.md delete mode 100644 doc_source/configuration-layers.md delete mode 100644 doc_source/configuration-tags.md delete mode 100644 doc_source/configuration-versions.md delete mode 100644 doc_source/configuration-vpc-endpoints.md delete mode 100644 doc_source/configuration-vpc.md delete mode 100644 doc_source/csharp-context.md delete mode 100644 doc_source/csharp-exceptions.md delete mode 100644 doc_source/csharp-handler.md delete mode 100644 doc_source/csharp-image.md delete mode 100644 doc_source/csharp-logging.md delete mode 100644 doc_source/csharp-package-cli.md delete mode 100644 doc_source/csharp-package-toolkit.md delete mode 100644 doc_source/csharp-package.md delete mode 100644 doc_source/csharp-tracing.md delete mode 100644 doc_source/deploying-lambda-apps.md delete mode 100644 doc_source/dotnet-native-aot.md delete mode 100644 doc_source/example_cross_ApiGatewayDataTracker_section.md delete mode 100644 doc_source/example_cross_ApiGatewayWebsocketChat_section.md delete mode 100644 doc_source/example_cross_AuroraRestLendingLibrary_section.md delete mode 100644 doc_source/example_cross_LambdaAPIGateway_section.md delete mode 100644 doc_source/example_cross_LambdaForBrowser_section.md delete mode 100644 doc_source/example_cross_LambdaScheduledEvents_section.md delete mode 100644 doc_source/example_cross_ServerlessWorkflows_section.md delete mode 100644 doc_source/example_cross_StepFunctionsMessenger_section.md delete mode 100644 doc_source/example_lambda_CreateFunction_section.md delete mode 100644 doc_source/example_lambda_DeleteFunction_section.md delete mode 100644 doc_source/example_lambda_GetFunction_section.md delete mode 100644 doc_source/example_lambda_Invoke_section.md delete mode 100644 doc_source/example_lambda_ListFunctions_section.md delete mode 100644 doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md delete mode 100644 doc_source/example_lambda_UpdateFunctionCode_section.md delete mode 100644 doc_source/example_lambda_UpdateFunctionConfiguration_section.md delete mode 100644 doc_source/extensions-api-partners.md delete mode 100644 doc_source/extensions-configuration.md delete mode 100644 doc_source/foundation-arch.md delete mode 100644 doc_source/foundation-console.md delete mode 100644 doc_source/foundation-networking.md delete mode 100644 doc_source/foundation-progmodel.md delete mode 100644 doc_source/functions-states.md delete mode 100644 doc_source/getting-started.md delete mode 100644 doc_source/gettingstarted-awscli.md delete mode 100644 doc_source/gettingstarted-concepts.md delete mode 100644 doc_source/gettingstarted-features.md delete mode 100644 doc_source/gettingstarted-images.md delete mode 100644 doc_source/gettingstarted-limits.md delete mode 100644 doc_source/gettingstarted-package.md delete mode 100644 doc_source/glossary.md delete mode 100644 doc_source/go-image.md delete mode 100644 doc_source/golang-context.md delete mode 100644 doc_source/golang-envvars.md delete mode 100644 doc_source/golang-exceptions.md delete mode 100644 doc_source/golang-handler.md delete mode 100644 doc_source/golang-logging.md delete mode 100644 doc_source/golang-package.md delete mode 100644 doc_source/golang-tracing.md delete mode 100644 doc_source/images-create.md delete mode 100644 doc_source/images-test.md delete mode 100644 doc_source/index.md delete mode 100644 doc_source/invocation-async.md delete mode 100644 doc_source/invocation-eventfiltering.md delete mode 100644 doc_source/invocation-eventsourcemapping.md delete mode 100644 doc_source/invocation-images.md delete mode 100644 doc_source/invocation-layers.md delete mode 100644 doc_source/invocation-retries.md delete mode 100644 doc_source/invocation-scaling.md delete mode 100644 doc_source/invocation-sync.md delete mode 100644 doc_source/java-context.md delete mode 100644 doc_source/java-exceptions.md delete mode 100644 doc_source/java-handler.md delete mode 100644 doc_source/java-image.md delete mode 100644 doc_source/java-logging.md delete mode 100644 doc_source/java-package-eclipse.md delete mode 100644 doc_source/java-package.md delete mode 100644 doc_source/java-samples.md delete mode 100644 doc_source/java-tracing.md delete mode 100644 doc_source/kinesis-tutorial-spec.md delete mode 100644 doc_source/lambda-api-permissions-ref.md delete mode 100644 doc_source/lambda-csharp.md delete mode 100644 doc_source/lambda-deploy-functions.md delete mode 100644 doc_source/lambda-edge.md delete mode 100644 doc_source/lambda-extensions.md delete mode 100644 doc_source/lambda-foundation.md delete mode 100644 doc_source/lambda-functions.md delete mode 100644 doc_source/lambda-golang.md delete mode 100644 doc_source/lambda-intro-execution-role.md delete mode 100644 doc_source/lambda-invocation.md delete mode 100644 doc_source/lambda-java.md delete mode 100644 doc_source/lambda-managing.md delete mode 100644 doc_source/lambda-monitoring.md delete mode 100644 doc_source/lambda-nodejs.md delete mode 100644 doc_source/lambda-permissions.md delete mode 100644 doc_source/lambda-powershell.md delete mode 100644 doc_source/lambda-python.md delete mode 100644 doc_source/lambda-releases.md delete mode 100644 doc_source/lambda-rolling-deployments.md delete mode 100644 doc_source/lambda-ruby.md delete mode 100644 doc_source/lambda-runtime-environment.md delete mode 100644 doc_source/lambda-runtimes.md delete mode 100644 doc_source/lambda-samples.md delete mode 100644 doc_source/lambda-security.md delete mode 100644 doc_source/lambda-services.md delete mode 100644 doc_source/lambda-settingup.md delete mode 100644 doc_source/lambda-stepfunctions.md delete mode 100644 doc_source/lambda-troubleshooting.md delete mode 100644 doc_source/lambda-typescript.md delete mode 100644 doc_source/lambda-urls.md delete mode 100644 doc_source/logging-using-cloudtrail.md delete mode 100644 doc_source/monitoring-cloudwatchlogs.md delete mode 100644 doc_source/monitoring-code-profiler.md delete mode 100644 doc_source/monitoring-functions-access-metrics.md delete mode 100644 doc_source/monitoring-insights.md delete mode 100644 doc_source/monitoring-metrics.md delete mode 100644 doc_source/monitoring-servicemap.md delete mode 100644 doc_source/nodejs-context.md delete mode 100644 doc_source/nodejs-exceptions.md delete mode 100644 doc_source/nodejs-handler.md delete mode 100644 doc_source/nodejs-image.md delete mode 100644 doc_source/nodejs-logging.md delete mode 100644 doc_source/nodejs-package.md delete mode 100644 doc_source/nodejs-tracing.md delete mode 100644 doc_source/permissions-boundary.md delete mode 100644 doc_source/powershell-context.md delete mode 100644 doc_source/powershell-devenv.md delete mode 100644 doc_source/powershell-exceptions.md delete mode 100644 doc_source/powershell-handler.md delete mode 100644 doc_source/powershell-logging.md delete mode 100644 doc_source/powershell-package.md delete mode 100644 doc_source/provisioned-concurrency.md delete mode 100644 doc_source/python-context.md delete mode 100644 doc_source/python-exceptions.md delete mode 100644 doc_source/python-handler.md delete mode 100644 doc_source/python-image.md delete mode 100644 doc_source/python-logging.md delete mode 100644 doc_source/python-package.md delete mode 100644 doc_source/python-tracing.md delete mode 100644 doc_source/ruby-context.md delete mode 100644 doc_source/ruby-exceptions.md delete mode 100644 doc_source/ruby-handler.md delete mode 100644 doc_source/ruby-image.md delete mode 100644 doc_source/ruby-logging.md delete mode 100644 doc_source/ruby-package.md delete mode 100644 doc_source/ruby-tracing.md delete mode 100644 doc_source/runtimes-api.md delete mode 100644 doc_source/runtimes-avx2.md delete mode 100644 doc_source/runtimes-custom.md delete mode 100644 doc_source/runtimes-extensions-api.md delete mode 100644 doc_source/runtimes-images.md delete mode 100644 doc_source/runtimes-logs-api.md delete mode 100644 doc_source/runtimes-modify.md delete mode 100644 doc_source/runtimes-walkthrough.md delete mode 100644 doc_source/samples-blank.md delete mode 100644 doc_source/samples-errorprocessor.md delete mode 100644 doc_source/samples-listmanager.md delete mode 100644 doc_source/sdk-general-information-section.md delete mode 100644 doc_source/security-compliance.md delete mode 100644 doc_source/security-configuration.md delete mode 100644 doc_source/security-dataprotection.md delete mode 100644 doc_source/security-iam.md delete mode 100644 doc_source/security-infrastructure.md delete mode 100644 doc_source/security-resilience.md delete mode 100644 doc_source/security_iam_id-based-policy-examples.md delete mode 100644 doc_source/security_iam_service-with-iam.md delete mode 100644 doc_source/security_iam_troubleshoot.md delete mode 100644 doc_source/service_code_examples.md delete mode 100644 doc_source/service_code_examples_actions.md delete mode 100644 doc_source/service_code_examples_cross-service_examples.md delete mode 100644 doc_source/service_code_examples_scenarios.md delete mode 100644 doc_source/services-alb.md delete mode 100644 doc_source/services-alexa.md delete mode 100644 doc_source/services-apigateway-blueprint.md delete mode 100644 doc_source/services-apigateway-code.md delete mode 100644 doc_source/services-apigateway-template.md delete mode 100644 doc_source/services-apigateway-tutorial.md delete mode 100644 doc_source/services-apigateway.md delete mode 100644 doc_source/services-cloudformation.md delete mode 100644 doc_source/services-cloudwatchevents-expressions.md delete mode 100644 doc_source/services-cloudwatchevents-tutorial.md delete mode 100644 doc_source/services-cloudwatchevents.md delete mode 100644 doc_source/services-cloudwatchlogs.md delete mode 100644 doc_source/services-codecommit.md delete mode 100644 doc_source/services-codepipeline.md delete mode 100644 doc_source/services-cognito.md delete mode 100644 doc_source/services-config.md delete mode 100644 doc_source/services-connect.md delete mode 100644 doc_source/services-ec2.md delete mode 100644 doc_source/services-efs.md delete mode 100644 doc_source/services-elasticache-tutorial.md delete mode 100644 doc_source/services-iot.md delete mode 100644 doc_source/services-iotevents.md delete mode 100644 doc_source/services-kinesisfirehose.md delete mode 100644 doc_source/services-lex.md delete mode 100644 doc_source/services-rds-tutorial.md delete mode 100644 doc_source/services-rds.md delete mode 100644 doc_source/services-s3-batch.md delete mode 100644 doc_source/services-s3-object-lambda.md delete mode 100644 doc_source/services-ses.md delete mode 100644 doc_source/services-stepfunctions.md delete mode 100644 doc_source/services-xray.md delete mode 100644 doc_source/stepfunctions-lc.md delete mode 100644 doc_source/stepfunctions-patterns.md delete mode 100644 doc_source/telemetry-api-reference.md delete mode 100644 doc_source/telemetry-api.md delete mode 100644 doc_source/telemetry-otel-spans.md delete mode 100644 doc_source/telemetry-schema-reference.md delete mode 100644 doc_source/testing-functions.md delete mode 100644 doc_source/troubleshooting-deployment.md delete mode 100644 doc_source/troubleshooting-execution.md delete mode 100644 doc_source/troubleshooting-images.md delete mode 100644 doc_source/troubleshooting-invocation.md delete mode 100644 doc_source/troubleshooting-networking.md delete mode 100644 doc_source/typescript-exceptions.md delete mode 100644 doc_source/typescript-handler.md delete mode 100644 doc_source/typescript-image.md delete mode 100644 doc_source/typescript-package.md delete mode 100644 doc_source/urls-auth.md delete mode 100644 doc_source/urls-configuration.md delete mode 100644 doc_source/urls-invocation.md delete mode 100644 doc_source/urls-monitoring.md delete mode 100644 doc_source/urls-tutorial.md delete mode 100644 doc_source/welcome.md delete mode 100644 doc_source/with-android-create-package.md delete mode 100644 doc_source/with-android-example.md delete mode 100644 doc_source/with-cloudtrail-create-package.md delete mode 100644 doc_source/with-cloudtrail.md delete mode 100644 doc_source/with-ddb-create-package.md delete mode 100644 doc_source/with-ddb-example.md delete mode 100644 doc_source/with-ddb.md delete mode 100644 doc_source/with-kafka.md delete mode 100644 doc_source/with-kinesis-create-package.md delete mode 100644 doc_source/with-kinesis-example-use-app-spec.md delete mode 100644 doc_source/with-kinesis-example.md delete mode 100644 doc_source/with-kinesis.md delete mode 100644 doc_source/with-mq.md delete mode 100644 doc_source/with-msk.md delete mode 100644 doc_source/with-on-demand-custom-android.md delete mode 100644 doc_source/with-s3-example-use-app-spec.md delete mode 100644 doc_source/with-s3-example.md delete mode 100644 doc_source/with-s3-tutorial.md delete mode 100644 doc_source/with-s3.md delete mode 100644 doc_source/with-secrets-manager.md delete mode 100644 doc_source/with-sns-create-package.md delete mode 100644 doc_source/with-sns-example.md delete mode 100644 doc_source/with-sns.md delete mode 100644 doc_source/with-sqs-create-package.md delete mode 100644 doc_source/with-sqs-cross-account-example.md delete mode 100644 doc_source/with-sqs-example-use-app-spec.md delete mode 100644 doc_source/with-sqs-example.md delete mode 100644 doc_source/with-sqs.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 440a6667..2bc36383 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,56 +1,64 @@ -# Guidelines for contributing +# Contributing Guidelines -Thank you for your interest in contributing to AWS documentation! We greatly value feedback and contributions from our community. +Thank you for your interest in contributing to our project. We greatly value feedback and contributions from our community. -Please read through this document before you submit any pull requests or issues. It will help us work together more effectively. +Please read through this document before submitting any issues or pull requests to ensure we have all the necessary +information to effectively respond to your bug report or contribution. -## What to expect when you contribute -When you submit a pull request, our team is notified and will respond as quickly as we can. We'll do our best to work with you to ensure that your pull request adheres to our style and standards. If we merge your pull request, we might make additional edits later for style or clarity. +## Reporting Bugs/Feature Requests -The AWS documentation source files on GitHub aren't published directly to the official documentation website. If we merge your pull request, we'll publish your changes to the documentation website as soon as we can, but they won't appear immediately or automatically. +We welcome you to use the GitHub issue tracker to report bugs or suggest features. -We look forward to receiving your pull requests for: +When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already +reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: -* New content you'd like to contribute (such as new code samples or tutorials) -* Inaccuracies in the content -* Information gaps in the content that need more detail to be complete -* Typos or grammatical errors -* Suggested rewrites that improve clarity and reduce confusion +* A reproducible test case or series of steps +* The version of our code being used +* Any modifications you've made relevant to the bug +* Anything unusual about your environment or deployment -**Note:** We all write differently, and you might not like how we've written or organized something currently. We want that feedback. But please be sure that your request for a rewrite is supported by the previous criteria. If it isn't, we might decline to merge it. -## How to contribute +## Contributing via Pull Requests -To contribute, send us a pull request. For small changes, such as fixing a typo or adding a link, you can use the [GitHub Edit Button](https://blog.github.com/2011-04-26-forking-with-the-edit-button/). For larger changes: +Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: -1. [Fork the repository](https://help.github.com/articles/fork-a-repo/). -2. In your fork, make your change in a branch that's based on this repo's **main** branch. -3. Commit the change to your fork, using a clear and descriptive commit message. -4. [Create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/), answering any questions in the pull request form. +1. You are working against the latest source on the *main* branch. +2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. +3. You open an issue to discuss any significant work - we would hate for your time to be wasted. -Before you send us a pull request, please be sure that: +To send us a pull request, please: -1. You're working from the latest source on the **main** branch. -2. You check [existing open](https://github.com/awsdocs/aws-lambda-developer-guide/pulls), and [recently closed](https://github.com/awsdocs/aws-lambda-developer-guide/pulls?q=is%3Apr+is%3Aclosed), pull requests to be sure that someone else hasn't already addressed the problem. -3. You [create an issue](https://github.com/awsdocs/aws-lambda-developer-guide/issues/new) before working on a contribution that will take a significant amount of your time. +1. Fork the repository. +2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. +3. Ensure local tests pass. +4. Commit to your fork using clear commit messages. +5. Send us a pull request, answering any default questions in the pull request interface. +6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. + +GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and +[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). -For contributions that will take a significant amount of time, [open a new issue](https://github.com/awsdocs/aws-lambda-developer-guide/issues/new) to pitch your idea before you get started. Explain the problem and describe the content you want to see added to the documentation. Let us know if you'll write it yourself or if you'd like us to help. We'll discuss your proposal with you and let you know whether we're likely to accept it. We don't want you to spend a lot of time on a contribution that might be outside the scope of the documentation or that's already in the works. ## Finding contributions to work on -If you'd like to contribute, but don't have a project in mind, look at the [open issues](https://github.com/awsdocs/aws-lambda-developer-guide/issues) in this repository for some ideas. Any issues with the [help wanted](https://github.com/awsdocs/aws-lambda-developer-guide/labels/help%20wanted) or [enhancement](https://github.com/awsdocs/aws-lambda-developer-guide/labels/enhancement) labels are a great place to start. +Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. + -In addition to written content, we really appreciate new examples and code samples for our documentation, such as examples for different platforms or environments, and code samples in additional languages. +## Code of Conduct -## Code of conduct +This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). +For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact +opensource-codeofconduct@amazon.com with any additional questions or comments. -This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information, see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments. ## Security issue notifications -If you discover a potential security issue, please notify AWS Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public issue on GitHub. +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. + ## Licensing -See the [LICENSE](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/LICENSE) file for this project's licensing. We will ask you to confirm the licensing of your contribution. We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. +See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. + +We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. diff --git a/LICENSE b/LICENSE index 7785b904..6aa0c458 100644 --- a/LICENSE +++ b/LICENSE @@ -1,152 +1,14 @@ -Creative Commons Attribution-ShareAlike 4.0 International Public License - -By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. - -Section 1 – Definitions. - - a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - - e. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. - - i. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights under this Public License. - - k. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. - -Section 2 – Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: - - A. reproduce and Share the Licensed Material, in whole or in part; and - - B. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. - - 3. Term. The term of this Public License is specified in Section 6(a). - - 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. - - 5. Downstream recipients. - - A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. - - B. Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. - - C. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. - - 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this Public License. - - 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. - -Section 3 – License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified form), You must: - - A. retain the following if it is supplied by the Licensor with the Licensed Material: - - i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of warranties; - - v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; - - B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and - - C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. - - 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. - - b. ShareAlike.In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. - - 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. - -Section 4 – Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; - - b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and - - c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. -For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. - -Section 5 – Disclaimer of Warranties and Limitation of Liability. - - a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. - - b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. - - c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. - -Section 6 – Term and Termination. - - a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or - - 2. upon express reinstatement by the Licensor. - - c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. - - d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. - - e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. - -Section 7 – Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. - -Section 8 – Interpretation. - - a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. - - c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. - - d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSE-SAMPLECODE b/LICENSE-SAMPLECODE deleted file mode 100644 index 7e0bd89d..00000000 --- a/LICENSE-SAMPLECODE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, -merge, publish, distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSE-SUMMARY b/LICENSE-SUMMARY deleted file mode 100644 index fa2e5700..00000000 --- a/LICENSE-SUMMARY +++ /dev/null @@ -1,5 +0,0 @@ -Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - -The documentation is made available under the Creative Commons Attribution-ShareAlike 4.0 International License. See the LICENSE file. - -The sample code within this documentation is made available under a modified MIT license. See the LICENSE-SAMPLECODE file. diff --git a/README.md b/README.md index bd5728f6..edefa865 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ ## AWS Lambda Developer Guide -This repository contains the Markdown version of the AWS Lambda Developer Guide and sample applications that you can deploy to learn about Lambda concepts and features. +This repository contains additional resources for the AWS Lambda developer guide. -Table of contents: [index.md](/doc_source/index.md) +- [iam-policies](./iam-policies) - Sample permissions policies for cross-service use cases. +- [sample-apps](./sample-apps) - Sample applications that demonstrate features and use cases for the AWS Lambda service and managed runtimes. +- [templates](./templates) - AWS CloudFormation templates for creating functions and VPC network resources. ## License Summary -The documentation is made available under the Creative Commons Attribution-ShareAlike 4.0 International License. See the [LICENSE](./LICENSE) file. - -The sample code within this documentation is made available under a modified MIT license. See the [LICENSE-SAMPLECODE](./LICENSE-SAMPLECODE) file. - -## Default branch -The default branch for this repo has changed to `main`. -If you have cloned the previous default branch, please update your local repo to use the `main` branch. +The sample code within this repo is made available under a modified MIT license. See the [LICENSE](./LICENSE) file. diff --git a/doc_source/API_AccountLimit.md b/doc_source/API_AccountLimit.md deleted file mode 100644 index 24a89f4d..00000000 --- a/doc_source/API_AccountLimit.md +++ /dev/null @@ -1,39 +0,0 @@ -# AccountLimit - -Limits that are related to concurrency and storage\. All file and storage sizes are in bytes\. - -## Contents - - ** CodeSizeUnzipped ** -The maximum size of a function's deployment package and layers when they're extracted\. -Type: Long -Required: No - - ** CodeSizeZipped ** -The maximum size of a deployment package when it's uploaded directly to Lambda\. Use Amazon S3 for larger files\. -Type: Long -Required: No - - ** ConcurrentExecutions ** -The maximum number of simultaneous function executions\. -Type: Integer -Required: No - - ** TotalCodeSize ** -The amount of storage space that you can use for all deployment packages and layer archives\. -Type: Long -Required: No - - ** UnreservedConcurrentExecutions ** -The maximum number of simultaneous function executions, minus the capacity that's reserved for individual functions with [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. -Type: Integer -Valid Range: Minimum value of 0\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountLimit) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountLimit) \ No newline at end of file diff --git a/doc_source/API_AccountUsage.md b/doc_source/API_AccountUsage.md deleted file mode 100644 index 5717c170..00000000 --- a/doc_source/API_AccountUsage.md +++ /dev/null @@ -1,23 +0,0 @@ -# AccountUsage - -The number of functions and amount of storage in use\. - -## Contents - - ** FunctionCount ** -The number of Lambda functions\. -Type: Long -Required: No - - ** TotalCodeSize ** -The amount of storage space, in bytes, that's being used by deployment packages and layer archives\. -Type: Long -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AccountUsage) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AccountUsage) \ No newline at end of file diff --git a/doc_source/API_AddLayerVersionPermission.md b/doc_source/API_AddLayerVersionPermission.md deleted file mode 100644 index 1ee2de37..00000000 --- a/doc_source/API_AddLayerVersionPermission.md +++ /dev/null @@ -1,136 +0,0 @@ -# AddLayerVersionPermission - -Adds permissions to the resource\-based policy of a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Use this action to grant layer usage permission to other accounts\. You can grant permission to a single account, all accounts in an organization, or all AWS accounts\. - -To revoke permission, call [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) with the statement ID that you specified when you added it\. - -## Request Syntax - -``` -POST /2018-10-31/layers/LayerName/versions/VersionNumber/policy?RevisionId=RevisionId HTTP/1.1 -Content-type: application/json - -{ - "Action": "string", - "OrganizationId": "string", - "Principal": "string", - "StatementId": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_AddLayerVersionPermission_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [RevisionId](#API_AddLayerVersionPermission_RequestSyntax) ** -Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - - ** [VersionNumber](#API_AddLayerVersionPermission_RequestSyntax) ** -The version number\. -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Action](#API_AddLayerVersionPermission_RequestSyntax) ** -The API action that grants access to the layer\. For example, `lambda:GetLayerVersion`\. -Type: String -Length Constraints: Maximum length of 22\. -Pattern: `lambda:GetLayerVersion` -Required: Yes - - ** [OrganizationId](#API_AddLayerVersionPermission_RequestSyntax) ** -With the principal set to `*`, grant permission to all accounts in the specified organization\. -Type: String -Length Constraints: Maximum length of 34\. -Pattern: `o-[a-z0-9]{10,32}` -Required: No - - ** [Principal](#API_AddLayerVersionPermission_RequestSyntax) ** -An account ID, or `*` to grant layer usage permission to all accounts in an organization, or all AWS accounts \(if `organizationId` is not specified\)\. For the last case, make sure that you really do want all AWS accounts to have usage permission to this layer\. -Type: String -Pattern: `\d{12}|\*|arn:(aws[a-zA-Z-]*):iam::\d{12}:root` -Required: Yes - - ** [StatementId](#API_AddLayerVersionPermission_RequestSyntax) ** -An identifier that distinguishes the policy from others on the same layer version\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_]+)` -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "RevisionId": "string", - "Statement": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [RevisionId](#API_AddLayerVersionPermission_ResponseSyntax) ** -A unique identifier for the current revision of the policy\. -Type: String - - ** [Statement](#API_AddLayerVersionPermission_ResponseSyntax) ** -The permission statement\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PolicyLengthExceededException ** -The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_AddPermission.md b/doc_source/API_AddPermission.md deleted file mode 100644 index be083542..00000000 --- a/doc_source/API_AddPermission.md +++ /dev/null @@ -1,173 +0,0 @@ -# AddPermission - -Grants an AWS service, account, or organization 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 to version $LATEST\. - -To grant permission to another account, specify the account ID as the `Principal`\. To grant permission to an organization defined in AWS Organizations, specify the organization ID as the `PrincipalOrgID`\. For AWS services, the principal is a domain\-style identifier defined by the service, like `s3.amazonaws.com` or `sns.amazonaws.com`\. For AWS services, you can also specify the ARN of the associated resource as the `SourceArn`\. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function\. - -This action adds a statement to a resource\-based permissions policy for the function\. For more information about function policies, see [Lambda Function Policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html)\. - -## Request Syntax - -``` -POST /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "Action": "string", - "EventSourceToken": "string", - "FunctionUrlAuthType": "string", - "Principal": "string", - "PrincipalOrgID": "string", - "RevisionId": "string", - "SourceAccount": "string", - "SourceArn": "string", - "StatementId": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_AddPermission_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_AddPermission_RequestSyntax) ** -Specify a version or alias to add permissions to a published version of the function\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Action](#API_AddPermission_RequestSyntax) ** -The action that the principal can use on the function\. For example, `lambda:InvokeFunction` or `lambda:GetFunction`\. -Type: String -Pattern: `(lambda:[*]|lambda:[a-zA-Z]+|[*])` -Required: Yes - - ** [EventSourceToken](#API_AddPermission_RequestSyntax) ** -For Alexa Smart Home functions, a token that must be supplied by the invoker\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Pattern: `[a-zA-Z0-9._\-]+` -Required: No - - ** [FunctionUrlAuthType](#API_AddPermission_RequestSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` -Required: No - - ** [Principal](#API_AddPermission_RequestSyntax) ** -The AWS service or account that invokes the function\. If you specify a service, use `SourceArn` or `SourceAccount` to limit who can invoke the function through that service\. -Type: String -Pattern: `[^\s]+` -Required: Yes - - ** [PrincipalOrgID](#API_AddPermission_RequestSyntax) ** -The identifier for your organization in AWS Organizations\. Use this to grant permissions to all the AWS accounts under this organization\. -Type: String -Length Constraints: Minimum length of 12\. Maximum length of 34\. -Pattern: `^o-[a-z0-9]{10,32}$` -Required: No - - ** [RevisionId](#API_AddPermission_RequestSyntax) ** -Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. -Type: String -Required: No - - ** [SourceAccount](#API_AddPermission_RequestSyntax) ** -For Amazon S3, the ID of the account that owns the resource\. Use this together with `SourceArn` to ensure that the resource is owned by the specified account\. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account\. -Type: String -Length Constraints: Maximum length of 12\. -Pattern: `\d{12}` -Required: No - - ** [SourceArn](#API_AddPermission_RequestSyntax) ** -For AWS services, the ARN of the AWS resource that invokes the function\. For example, an Amazon S3 bucket or Amazon SNS topic\. -Note that Lambda configures the comparison using the `StringLike` operator\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** [StatementId](#API_AddPermission_RequestSyntax) ** -A statement identifier that differentiates the statement from others in the same policy\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_]+)` -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "Statement": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [Statement](#API_AddPermission_ResponseSyntax) ** -The permission statement that's added to the function policy\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PolicyLengthExceededException ** -The permissions policy for the resource is too large\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/AddPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AddPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/AddPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/AddPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AddPermission) \ No newline at end of file diff --git a/doc_source/API_AliasConfiguration.md b/doc_source/API_AliasConfiguration.md deleted file mode 100644 index b6aa0d1b..00000000 --- a/doc_source/API_AliasConfiguration.md +++ /dev/null @@ -1,49 +0,0 @@ -# AliasConfiguration - -Provides configuration information about a Lambda function [alias](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)\. - -## Contents - - ** AliasArn ** -The Amazon Resource Name \(ARN\) of the alias\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** Description ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** FunctionVersion ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` -Required: No - - ** Name ** -The name of the alias\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` -Required: No - - ** RevisionId ** -A unique identifier that changes when you update the alias\. -Type: String -Required: No - - ** RoutingConfig ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasConfiguration) \ No newline at end of file diff --git a/doc_source/API_AliasRoutingConfiguration.md b/doc_source/API_AliasRoutingConfiguration.md deleted file mode 100644 index c2c4021b..00000000 --- a/doc_source/API_AliasRoutingConfiguration.md +++ /dev/null @@ -1,21 +0,0 @@ -# AliasRoutingConfiguration - -The [traffic\-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) configuration of a Lambda function alias\. - -## Contents - - ** AdditionalVersionWeights ** -The second version, and the percentage of traffic that's routed to it\. -Type: String to double map -Key Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Key Pattern: `[0-9]+` -Valid Range: Minimum value of 0\.0\. Maximum value of 1\.0\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AliasRoutingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AliasRoutingConfiguration) \ No newline at end of file diff --git a/doc_source/API_AllowedPublishers.md b/doc_source/API_AllowedPublishers.md deleted file mode 100644 index 498de6b5..00000000 --- a/doc_source/API_AllowedPublishers.md +++ /dev/null @@ -1,20 +0,0 @@ -# AllowedPublishers - -List of signing profiles that can sign a code package\. - -## Contents - - ** SigningProfileVersionArns ** -The Amazon Resource Name \(ARN\) for each of the signing profiles\. A signing profile defines a trusted user who can sign a code package\. -Type: Array of strings -Array Members: Minimum number of 1 item\. Maximum number of 20 items\. -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: Yes - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AllowedPublishers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AllowedPublishers) \ No newline at end of file diff --git a/doc_source/API_AmazonManagedKafkaEventSourceConfig.md b/doc_source/API_AmazonManagedKafkaEventSourceConfig.md deleted file mode 100644 index fb7a856a..00000000 --- a/doc_source/API_AmazonManagedKafkaEventSourceConfig.md +++ /dev/null @@ -1,20 +0,0 @@ -# AmazonManagedKafkaEventSourceConfig - -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. - -## Contents - - ** ConsumerGroupId ** -The identifier for the Kafka consumer group to join\. The consumer group ID must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 200\. -Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/AmazonManagedKafkaEventSourceConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningConfig.md b/doc_source/API_CodeSigningConfig.md deleted file mode 100644 index 99a1c44d..00000000 --- a/doc_source/API_CodeSigningConfig.md +++ /dev/null @@ -1,47 +0,0 @@ -# CodeSigningConfig - -Details about a [Code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html)\. - -## Contents - - ** AllowedPublishers ** -List of allowed publishers\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object -Required: Yes - - ** CodeSigningConfigArn ** -The Amazon Resource Name \(ARN\) of the Code signing configuration\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - - ** CodeSigningConfigId ** -Unique identifer for the Code signing configuration\. -Type: String -Pattern: `csc-[a-zA-Z0-9-_\.]{17}` -Required: Yes - - ** CodeSigningPolicies ** -The code signing policy controls the validation failure action for signature mismatch or expiry\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object -Required: Yes - - ** Description ** -Code signing configuration description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** LastModified ** -The date and time that the Code signing configuration was last modified, in ISO\-8601 format \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String -Required: Yes - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CodeSigningPolicies.md b/doc_source/API_CodeSigningPolicies.md deleted file mode 100644 index 6ce8eb1a..00000000 --- a/doc_source/API_CodeSigningPolicies.md +++ /dev/null @@ -1,20 +0,0 @@ -# CodeSigningPolicies - -Code signing configuration [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) specify the validation failure action for signature mismatch or expiry\. - -## Contents - - ** UntrustedArtifactOnDeployment ** -Code signing configuration policy for deployment validation failure\. If you set the policy to `Enforce`, Lambda blocks the deployment request if signature validation checks fail\. If you set the policy to `Warn`, Lambda allows the deployment and creates a CloudWatch log\. -Default value: `Warn` -Type: String -Valid Values:` Warn | Enforce` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CodeSigningPolicies) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CodeSigningPolicies) \ No newline at end of file diff --git a/doc_source/API_Concurrency.md b/doc_source/API_Concurrency.md deleted file mode 100644 index f555752a..00000000 --- a/doc_source/API_Concurrency.md +++ /dev/null @@ -1,17 +0,0 @@ -# Concurrency - -## Contents - - ** ReservedConcurrentExecutions ** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. -Type: Integer -Valid Range: Minimum value of 0\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Concurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Concurrency) \ No newline at end of file diff --git a/doc_source/API_Cors.md b/doc_source/API_Cors.md deleted file mode 100644 index d291431d..00000000 --- a/doc_source/API_Cors.md +++ /dev/null @@ -1,57 +0,0 @@ -# Cors - -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your Lambda function URL\. Use CORS to grant access to your function URL from any origin\. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL\. - -## Contents - - ** AllowCredentials ** -Whether to allow cookies or other credentials in requests to your function URL\. The default is `false`\. -Type: Boolean -Required: No - - ** AllowHeaders ** -The HTTP headers that origins can include in requests to your function URL\. For example: `Date`, `Keep-Alive`, `X-Custom-Header`\. -Type: Array of strings -Array Members: Maximum number of 100 items\. -Length Constraints: Maximum length of 1024\. -Pattern: `.*` -Required: No - - ** AllowMethods ** -The HTTP methods that are allowed when calling your function URL\. For example: `GET`, `POST`, `DELETE`, or the wildcard character \(`*`\)\. -Type: Array of strings -Array Members: Maximum number of 6 items\. -Length Constraints: Maximum length of 6\. -Pattern: `.*` -Required: No - - ** AllowOrigins ** -The origins that can access your function URL\. You can list any number of specific origins, separated by a comma\. For example: `https://www.example.com`, `http://localhost:60905`\. -Alternatively, you can grant access to all origins using the wildcard character \(`*`\)\. -Type: Array of strings -Array Members: Maximum number of 100 items\. -Length Constraints: Minimum length of 1\. Maximum length of 253\. -Pattern: `.*` -Required: No - - ** ExposeHeaders ** -The HTTP headers in your function response that you want to expose to origins that call your function URL\. For example: `Date`, `Keep-Alive`, `X-Custom-Header`\. -Type: Array of strings -Array Members: Maximum number of 100 items\. -Length Constraints: Maximum length of 1024\. -Pattern: `.*` -Required: No - - ** MaxAge ** -The maximum amount of time, in seconds, that web browsers can cache results of a preflight request\. By default, this is set to `0`, which means that the browser doesn't cache results\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 86400\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Cors) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Cors) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Cors) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Cors) \ No newline at end of file diff --git a/doc_source/API_CreateAlias.md b/doc_source/API_CreateAlias.md deleted file mode 100644 index 328a580c..00000000 --- a/doc_source/API_CreateAlias.md +++ /dev/null @@ -1,159 +0,0 @@ -# CreateAlias - -Creates an [alias](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) for a Lambda function version\. Use aliases to provide clients with a function identifier that you can update to invoke a different version\. - -You can also map an alias to split invocation requests between two versions\. Use the `RoutingConfig` parameter to specify a second version and the percentage of invocation requests that it receives\. - -## Request Syntax - -``` -POST /2015-03-31/functions/FunctionName/aliases HTTP/1.1 -Content-type: application/json - -{ - "Description": "string", - "FunctionVersion": "string", - "Name": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_CreateAlias_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Description](#API_CreateAlias_RequestSyntax) ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [FunctionVersion](#API_CreateAlias_RequestSyntax) ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` -Required: Yes - - ** [Name](#API_CreateAlias_RequestSyntax) ** -The name of the alias\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` -Required: Yes - - ** [RoutingConfig](#API_CreateAlias_RequestSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "AliasArn": "string", - "Description": "string", - "FunctionVersion": "string", - "Name": "string", - "RevisionId": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [AliasArn](#API_CreateAlias_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the alias\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Description](#API_CreateAlias_ResponseSyntax) ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [FunctionVersion](#API_CreateAlias_ResponseSyntax) ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [Name](#API_CreateAlias_ResponseSyntax) ** -The name of the alias\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - - ** [RevisionId](#API_CreateAlias_ResponseSyntax) ** -A unique identifier that changes when you update the alias\. -Type: String - - ** [RoutingConfig](#API_CreateAlias_ResponseSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateAlias) \ No newline at end of file diff --git a/doc_source/API_CreateCodeSigningConfig.md b/doc_source/API_CreateCodeSigningConfig.md deleted file mode 100644 index 7966e6cb..00000000 --- a/doc_source/API_CreateCodeSigningConfig.md +++ /dev/null @@ -1,99 +0,0 @@ -# CreateCodeSigningConfig - -Creates a code signing configuration\. A [code signing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html) defines a list of allowed signing profiles and defines the code\-signing validation policy \(action to be taken if deployment validation checks fail\)\. - -## Request Syntax - -``` -POST /2020-04-22/code-signing-configs/ HTTP/1.1 -Content-type: application/json - -{ - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string" -} -``` - -## URI Request Parameters - -The request does not use any URI parameters\. - -## Request Body - -The request accepts the following data in JSON format\. - - ** [AllowedPublishers](#API_CreateCodeSigningConfig_RequestSyntax) ** -Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object -Required: Yes - - ** [CodeSigningPolicies](#API_CreateCodeSigningConfig_RequestSyntax) ** -The code signing policies define the actions to take if the validation checks fail\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object -Required: No - - ** [Description](#API_CreateCodeSigningConfig_RequestSyntax) ** -Descriptive name for this code signing configuration\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "CodeSigningConfig": { - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningConfigArn": "string", - "CodeSigningConfigId": "string", - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string", - "LastModified": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfig](#API_CreateCodeSigningConfig_ResponseSyntax) ** -The code signing configuration\. -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_CreateEventSourceMapping.md b/doc_source/API_CreateEventSourceMapping.md deleted file mode 100644 index 4c68396b..00000000 --- a/doc_source/API_CreateEventSourceMapping.md +++ /dev/null @@ -1,460 +0,0 @@ -# CreateEventSourceMapping - -Creates a mapping between an event source and an AWS Lambda function\. Lambda reads items from the event source and invokes the function\. - -For details about how to configure different event sources, see the following topics\. -+ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) -+ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) -+ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) -+ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) - -The following error handling options are available only for stream sources \(DynamoDB and Kinesis\): -+ `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. -+ `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. -+ `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 -+ `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\. -+ `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. - -For information about which configuration parameters apply to each event source, see the following topics\. -+ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) -+ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) -+ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) -+ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) -+ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) -+ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) - -## Request Syntax - -``` -POST /2015-03-31/event-source-mappings/ HTTP/1.1 -Content-type: application/json - -{ - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "Enabled": boolean, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "Topics": [ "string" ], - "TumblingWindowInSeconds": number -} -``` - -## URI Request Parameters - -The request does not use any URI parameters\. - -## Request Body - -The request accepts the following data in JSON format\. - - ** [AmazonManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_RequestSyntax) ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object -Required: No - - ** [BatchSize](#API_CreateEventSourceMapping_RequestSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -+ **Amazon Kinesis** \- Default 100\. Max 10,000\. -+ **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. -+ **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-managed Apache Kafka** \- Default 100\. Max 10,000\. -+ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. -Required: No - - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. -Type: Boolean -Required: No - - ** [DestinationConfig](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** [Enabled](#API_CreateEventSourceMapping_RequestSyntax) ** -When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. -Default: True -Type: Boolean -Required: No - - ** [EventSourceArn](#API_CreateEventSourceMapping_RequestSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -+ **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. -+ **Amazon DynamoDB Streams** \- The ARN of the stream\. -+ **Amazon Simple Queue Service** \- The ARN of the queue\. -+ **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. -+ **Amazon MQ** \- The ARN of the broker\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** [FilterCriteria](#API_CreateEventSourceMapping_RequestSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object -Required: No - - ** [FunctionName](#API_CreateEventSourceMapping_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Version or Alias ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it's limited to 64 characters in length\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` -Required: No - - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. -Required: No - - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. -Required: No - - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_RequestSyntax) ** -\(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\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. -Required: No - - ** [ParallelizationFactor](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. -Required: No - - ** [Queues](#API_CreateEventSourceMapping_RequestSyntax) ** - \(MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` -Required: No - - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_RequestSyntax) ** -The self\-managed Apache Kafka cluster to receive records from\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object -Required: No - - ** [SelfManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_RequestSyntax) ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object -Required: No - - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_RequestSyntax) ** -An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. -Required: No - - ** [StartingPosition](#API_CreateEventSourceMapping_RequestSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` -Required: No - - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_RequestSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp -Required: No - - ** [Topics](#API_CreateEventSourceMapping_RequestSyntax) ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second and 900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 202 -Content-type: application/json - -{ - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], - "LastModified": number, - "LastProcessingResult": "string", - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "State": "string", - "StateTransitionReason": "string", - "Topics": [ "string" ], - "TumblingWindowInSeconds": number, - "UUID": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 202 response\. - -The following data is returned in JSON format by the service\. - - ** [AmazonManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object - - ** [BatchSize](#API_CreateEventSourceMapping_ResponseSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. - - ** [BisectBatchOnFunctionError](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. -Type: Boolean - - ** [DestinationConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [EventSourceArn](#API_CreateEventSourceMapping_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [FilterCriteria](#API_CreateEventSourceMapping_ResponseSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object - - ** [FunctionArn](#API_CreateEventSourceMapping_ResponseSyntax) ** -The ARN of the Lambda function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionResponseTypes](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` - - ** [LastModified](#API_CreateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. -Type: Timestamp - - ** [LastProcessingResult](#API_CreateEventSourceMapping_ResponseSyntax) ** -The result of the last Lambda invocation of your function\. -Type: String - - ** [MaximumBatchingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. - - ** [MaximumRecordAgeInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. - - ** [MaximumRetryAttempts](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. - - ** [ParallelizationFactor](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. - - ** [Queues](#API_CreateEventSourceMapping_ResponseSyntax) ** - \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` - - ** [SelfManagedEventSource](#API_CreateEventSourceMapping_ResponseSyntax) ** -The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - - ** [SelfManagedKafkaEventSourceConfig](#API_CreateEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object - - ** [SourceAccessConfigurations](#API_CreateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - - ** [StartingPosition](#API_CreateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_CreateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp - - ** [State](#API_CreateEventSourceMapping_ResponseSyntax) ** -The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. -Type: String - - ** [StateTransitionReason](#API_CreateEventSourceMapping_ResponseSyntax) ** -Indicates whether a user or Lambda made the last change to the event source mapping\. -Type: String - - ** [Topics](#API_CreateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - - ** [TumblingWindowInSeconds](#API_CreateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - - ** [UUID](#API_CreateEventSourceMapping_ResponseSyntax) ** -The identifier of the event source mapping\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_CreateFunction.md b/doc_source/API_CreateFunction.md deleted file mode 100644 index 3b2597a8..00000000 --- a/doc_source/API_CreateFunction.md +++ /dev/null @@ -1,519 +0,0 @@ -# CreateFunction - -Creates a Lambda function\. To create a function, you need a [deployment package](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html) and an [execution role](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role)\. The deployment package is a \.zip file archive or container image that contains your function code\. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and X\-Ray for request tracing\. - -You set the package type to `Image` if the deployment package is a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)\. For a container image, the code property must include the URI of a container image in the Amazon ECR registry\. You do not need to specify the handler and runtime properties\. - -You set the package type to `Zip` if the deployment package is a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. For a \.zip file archive, the code property specifies the location of the \.zip file\. You must also specify the handler and runtime properties\. The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. If you do not specify the architecture, the default value is `x86-64`\. - -When you create a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute or so\. During this time, you can't invoke or modify the function\. The `State`, `StateReason`, and `StateReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the function is ready to invoke\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. - -A function has an unpublished version, and can have published versions and aliases\. The unpublished version changes when you update your function's code and configuration\. A published version is a snapshot of your function code and configuration that can't be changed\. An alias is a named resource that maps to a version, and can be changed to map to a different version\. Use the `Publish` parameter to create version `1` of your function from its initial configuration\. - -The other parameters let you configure version\-specific and function\-level settings\. You can modify version\-specific settings later with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. Function\-level settings apply to both the unpublished and published versions of the function, and include tags \([TagResource](API_TagResource.md)\) and per\-function concurrency limits \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\)\. - -You can use code signing if your deployment package is a \.zip file archive\. To enable code signing for this function, specify the ARN of a code\-signing configuration\. When a user attempts to deploy a code package with [UpdateFunctionCode](API_UpdateFunctionCode.md), Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes set set of signing profiles, which define the trusted publishers for this function\. - -If another account or an AWS service invokes your function, use [AddPermission](API_AddPermission.md) to grant permission by creating a resource\-based IAM policy\. You can grant permissions at the function level, on a version, or on an alias\. - -To invoke your function directly, use [Invoke](API_Invoke.md)\. To invoke your function in response to events in other AWS services, create an event source mapping \([CreateEventSourceMapping](API_CreateEventSourceMapping.md)\), or configure a function trigger in the other service\. For more information, see [Invoking Functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html)\. - -## Request Syntax - -``` -POST /2015-03-31/functions HTTP/1.1 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "Code": { - "ImageUri": "string", - "S3Bucket": "string", - "S3Key": "string", - "S3ObjectVersion": "string", - "ZipFile": blob - }, - "CodeSigningConfigArn": "string", - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionName": "string", - "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, - "KMSKeyArn": "string", - "Layers": [ "string" ], - "MemorySize": number, - "PackageType": "string", - "Publish": boolean, - "Role": "string", - "Runtime": "string", - "Tags": { - "string" : "string" - }, - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ] - } -} -``` - -## URI Request Parameters - -The request does not use any URI parameters\. - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Architectures](#API_CreateFunction_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` -Required: No - - ** [Code](#API_CreateFunction_RequestSyntax) ** -The code for the function\. -Type: [FunctionCode](API_FunctionCode.md) object -Required: Yes - - ** [CodeSigningConfigArn](#API_CreateFunction_RequestSyntax) ** -To enable code signing for this function, specify the ARN of a code\-signing configuration\. A code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: No - - ** [DeadLetterConfig](#API_CreateFunction_RequestSyntax) ** -A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object -Required: No - - ** [Description](#API_CreateFunction_RequestSyntax) ** -A description of the function\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [Environment](#API_CreateFunction_RequestSyntax) ** -Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object -Required: No - - ** [EphemeralStorage](#API_CreateFunction_RequestSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object -Required: No - - ** [FileSystemConfigs](#API_CreateFunction_RequestSyntax) ** -Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. -Required: No - - ** [FunctionName](#API_CreateFunction_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Handler](#API_CreateFunction_RequestSyntax) ** -The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_CreateFunction_RequestSyntax) ** -Container image [configuration values](https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-settings) that override the values in the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object -Required: No - - ** [KMSKeyArn](#API_CreateFunction_RequestSyntax) ** -The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` -Required: No - - ** [Layers](#API_CreateFunction_RequestSyntax) ** -A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. -Type: Array of strings -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` -Required: No - - ** [MemorySize](#API_CreateFunction_RequestSyntax) ** -The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - ** [PackageType](#API_CreateFunction_RequestSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for ZIP archive\. -Type: String -Valid Values:` Zip | Image` -Required: No - - ** [Publish](#API_CreateFunction_RequestSyntax) ** -Set to true to publish the first version of the function during creation\. -Type: Boolean -Required: No - - ** [Role](#API_CreateFunction_RequestSyntax) ** -The Amazon Resource Name \(ARN\) of the function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` -Required: Yes - - ** [Runtime](#API_CreateFunction_RequestSyntax) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - ** [Tags](#API_CreateFunction_RequestSyntax) ** -A list of [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to apply to the function\. -Type: String to string map -Required: No - - ** [Timeout](#API_CreateFunction_RequestSyntax) ** -The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. -Type: Integer -Valid Range: Minimum value of 1\. -Required: No - - ** [TracingConfig](#API_CreateFunction_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object -Required: No - - ** [VpcConfig](#API_CreateFunction_RequestSyntax) ** -For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [VpcConfig](API_VpcConfig.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [Architectures](#API_CreateFunction_ResponseSyntax) ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` - - ** [CodeSha256](#API_CreateFunction_ResponseSyntax) ** -The SHA256 hash of the function's deployment package\. -Type: String - - ** [CodeSize](#API_CreateFunction_ResponseSyntax) ** -The size of the function's deployment package, in bytes\. -Type: Long - - ** [DeadLetterConfig](#API_CreateFunction_ResponseSyntax) ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - - ** [Description](#API_CreateFunction_ResponseSyntax) ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [Environment](#API_CreateFunction_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - - ** [EphemeralStorage](#API_CreateFunction_ResponseSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object - - ** [FileSystemConfigs](#API_CreateFunction_ResponseSyntax) ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. - - ** [FunctionArn](#API_CreateFunction_ResponseSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionName](#API_CreateFunction_ResponseSyntax) ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Handler](#API_CreateFunction_ResponseSyntax) ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` - - ** [ImageConfigResponse](#API_CreateFunction_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - - ** [KMSKeyArn](#API_CreateFunction_ResponseSyntax) ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - - ** [LastModified](#API_CreateFunction_ResponseSyntax) ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [LastUpdateStatus](#API_CreateFunction_ResponseSyntax) ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` - - ** [LastUpdateStatusReason](#API_CreateFunction_ResponseSyntax) ** -The reason for the last update that was performed on the function\. -Type: String - - ** [LastUpdateStatusReasonCode](#API_CreateFunction_ResponseSyntax) ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Layers](#API_CreateFunction_ResponseSyntax) ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects - - ** [MasterArn](#API_CreateFunction_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [MemorySize](#API_CreateFunction_ResponseSyntax) ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_CreateFunction_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` - - ** [RevisionId](#API_CreateFunction_ResponseSyntax) ** -The latest updated revision of the function or alias\. -Type: String - - ** [Role](#API_CreateFunction_ResponseSyntax) ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - - ** [Runtime](#API_CreateFunction_ResponseSyntax) ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_CreateFunction_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [State](#API_CreateFunction_ResponseSyntax) ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` - - ** [StateReason](#API_CreateFunction_ResponseSyntax) ** -The reason for the function's current state\. -Type: String - - ** [StateReasonCode](#API_CreateFunction_ResponseSyntax) ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Timeout](#API_CreateFunction_ResponseSyntax) ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [TracingConfig](#API_CreateFunction_ResponseSyntax) ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - - ** [Version](#API_CreateFunction_ResponseSyntax) ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [VpcConfig](#API_CreateFunction_ResponseSyntax) ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object - -## Errors - - ** CodeSigningConfigNotFoundException ** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - ** CodeStorageExceededException ** -You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** CodeVerificationFailedException ** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - ** InvalidCodeSignatureException ** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. -HTTP Status Code: 400 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunction) \ No newline at end of file diff --git a/doc_source/API_CreateFunctionUrlConfig.md b/doc_source/API_CreateFunctionUrlConfig.md deleted file mode 100644 index 53bc5ac9..00000000 --- a/doc_source/API_CreateFunctionUrlConfig.md +++ /dev/null @@ -1,144 +0,0 @@ -# CreateFunctionUrlConfig - -Creates a Lambda function URL with the specified configuration parameters\. A function URL is a dedicated HTTP\(S\) endpoint that you can use to invoke your function\. - -## Request Syntax - -``` -POST /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_CreateFunctionUrlConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_CreateFunctionUrlConfig_RequestSyntax) ** -The alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` - -## Request Body - -The request accepts the following data in JSON format\. - - ** [AuthType](#API_CreateFunctionUrlConfig_RequestSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` -Required: Yes - - ** [Cors](#API_CreateFunctionUrlConfig_RequestSyntax) ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - }, - "CreationTime": "string", - "FunctionArn": "string", - "FunctionUrl": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [AuthType](#API_CreateFunctionUrlConfig_ResponseSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` - - ** [Cors](#API_CreateFunctionUrlConfig_ResponseSyntax) ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object - - ** [CreationTime](#API_CreateFunctionUrlConfig_ResponseSyntax) ** -When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [FunctionArn](#API_CreateFunctionUrlConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of your function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionUrl](#API_CreateFunctionUrlConfig_ResponseSyntax) ** -The HTTP URL endpoint for your function\. -Type: String -Length Constraints: Minimum length of 40\. Maximum length of 100\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunctionUrlConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/CreateFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_DeadLetterConfig.md b/doc_source/API_DeadLetterConfig.md deleted file mode 100644 index 66c1b753..00000000 --- a/doc_source/API_DeadLetterConfig.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeadLetterConfig - -The [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) for failed asynchronous invocations\. - -## Contents - - ** TargetArn ** -The Amazon Resource Name \(ARN\) of an Amazon SQS queue or Amazon SNS topic\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeadLetterConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeadLetterConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteAlias.md b/doc_source/API_DeleteAlias.md deleted file mode 100644 index e2c9e069..00000000 --- a/doc_source/API_DeleteAlias.md +++ /dev/null @@ -1,76 +0,0 @@ -# DeleteAlias - -Deletes a Lambda function [alias](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)\. - -## Request Syntax - -``` -DELETE /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteAlias_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Name](#API_DeleteAlias_RequestSyntax) ** -The name of the alias\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteAlias) \ No newline at end of file diff --git a/doc_source/API_DeleteCodeSigningConfig.md b/doc_source/API_DeleteCodeSigningConfig.md deleted file mode 100644 index 871eeff3..00000000 --- a/doc_source/API_DeleteCodeSigningConfig.md +++ /dev/null @@ -1,64 +0,0 @@ -# DeleteCodeSigningConfig - -Deletes the code signing configuration\. You can delete the code signing configuration only if no function is using it\. - -## Request Syntax - -``` -DELETE /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CodeSigningConfigArn](#API_DeleteCodeSigningConfig_RequestSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteEventSourceMapping.md b/doc_source/API_DeleteEventSourceMapping.md deleted file mode 100644 index 589ce1ed..00000000 --- a/doc_source/API_DeleteEventSourceMapping.md +++ /dev/null @@ -1,247 +0,0 @@ -# DeleteEventSourceMapping - -Deletes an [event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html)\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. - -When you delete an event source mapping, it enters a `Deleting` state and might not be completely deleted for several seconds\. - -## Request Syntax - -``` -DELETE /2015-03-31/event-source-mappings/UUID HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [UUID](#API_DeleteEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 202 -Content-type: application/json - -{ - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], - "LastModified": number, - "LastProcessingResult": "string", - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "State": "string", - "StateTransitionReason": "string", - "Topics": [ "string" ], - "TumblingWindowInSeconds": number, - "UUID": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 202 response\. - -The following data is returned in JSON format by the service\. - - ** [AmazonManagedKafkaEventSourceConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object - - ** [BatchSize](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. - - ** [BisectBatchOnFunctionError](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. -Type: Boolean - - ** [DestinationConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [EventSourceArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [FilterCriteria](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object - - ** [FunctionArn](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The ARN of the Lambda function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionResponseTypes](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` - - ** [LastModified](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. -Type: Timestamp - - ** [LastProcessingResult](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The result of the last Lambda invocation of your function\. -Type: String - - ** [MaximumBatchingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. - - ** [MaximumRecordAgeInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. - - ** [MaximumRetryAttempts](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. - - ** [ParallelizationFactor](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. - - ** [Queues](#API_DeleteEventSourceMapping_ResponseSyntax) ** - \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` - - ** [SelfManagedEventSource](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - - ** [SelfManagedKafkaEventSourceConfig](#API_DeleteEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object - - ** [SourceAccessConfigurations](#API_DeleteEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - - ** [StartingPosition](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_DeleteEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp - - ** [State](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. -Type: String - - ** [StateTransitionReason](#API_DeleteEventSourceMapping_ResponseSyntax) ** -Indicates whether a user or Lambda made the last change to the event source mapping\. -Type: String - - ** [Topics](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - - ** [TumblingWindowInSeconds](#API_DeleteEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - - ** [UUID](#API_DeleteEventSourceMapping_ResponseSyntax) ** -The identifier of the event source mapping\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceInUseException ** -The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_DeleteFunction.md b/doc_source/API_DeleteFunction.md deleted file mode 100644 index a6c75339..00000000 --- a/doc_source/API_DeleteFunction.md +++ /dev/null @@ -1,81 +0,0 @@ -# DeleteFunction - -Deletes a Lambda function\. To delete a specific function version, use the `Qualifier` parameter\. Otherwise, all versions and aliases are deleted\. - -To delete Lambda event source mappings that invoke a function, use [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md)\. For AWS services and resources that invoke your function directly, delete the trigger in the service where you originally configured it\. - -## Request Syntax - -``` -DELETE /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteFunction_RequestSyntax) ** -The name of the Lambda function or version\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:1` \(with version\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_DeleteFunction_RequestSyntax) ** -Specify a version to delete\. You can't delete a version that's referenced by an alias\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunction) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionCodeSigningConfig.md b/doc_source/API_DeleteFunctionCodeSigningConfig.md deleted file mode 100644 index e75f7f19..00000000 --- a/doc_source/API_DeleteFunctionCodeSigningConfig.md +++ /dev/null @@ -1,78 +0,0 @@ -# DeleteFunctionCodeSigningConfig - -Removes the code signing configuration from the function\. - -## Request Syntax - -``` -DELETE /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteFunctionCodeSigningConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** CodeSigningConfigNotFoundException ** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionConcurrency.md b/doc_source/API_DeleteFunctionConcurrency.md deleted file mode 100644 index 2021e7f2..00000000 --- a/doc_source/API_DeleteFunctionConcurrency.md +++ /dev/null @@ -1,74 +0,0 @@ -# DeleteFunctionConcurrency - -Removes a concurrent execution limit from a function\. - -## Request Syntax - -``` -DELETE /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteFunctionConcurrency_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionEventInvokeConfig.md b/doc_source/API_DeleteFunctionEventInvokeConfig.md deleted file mode 100644 index 97c1014e..00000000 --- a/doc_source/API_DeleteFunctionEventInvokeConfig.md +++ /dev/null @@ -1,81 +0,0 @@ -# DeleteFunctionEventInvokeConfig - -Deletes the configuration for asynchronous invocation for a function, version, or alias\. - -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. - -## Request Syntax - -``` -DELETE /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_DeleteFunctionEventInvokeConfig_RequestSyntax) ** -A version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteFunctionUrlConfig.md b/doc_source/API_DeleteFunctionUrlConfig.md deleted file mode 100644 index d2a50b44..00000000 --- a/doc_source/API_DeleteFunctionUrlConfig.md +++ /dev/null @@ -1,75 +0,0 @@ -# DeleteFunctionUrlConfig - -Deletes a Lambda function URL\. When you delete a function URL, you can't recover it\. Creating a new function URL results in a different URL address\. - -## Request Syntax - -``` -DELETE /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteFunctionUrlConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_DeleteFunctionUrlConfig_RequestSyntax) ** -The alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunctionUrlConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_DeleteLayerVersion.md b/doc_source/API_DeleteLayerVersion.md deleted file mode 100644 index 4c05bfd8..00000000 --- a/doc_source/API_DeleteLayerVersion.md +++ /dev/null @@ -1,60 +0,0 @@ -# DeleteLayerVersion - -Deletes a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Deleted versions can no longer be viewed or added to functions\. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it\. - -## Request Syntax - -``` -DELETE /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_DeleteLayerVersion_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [VersionNumber](#API_DeleteLayerVersion_RequestSyntax) ** -The version number\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteLayerVersion) \ No newline at end of file diff --git a/doc_source/API_DeleteProvisionedConcurrencyConfig.md b/doc_source/API_DeleteProvisionedConcurrencyConfig.md deleted file mode 100644 index 8791b35c..00000000 --- a/doc_source/API_DeleteProvisionedConcurrencyConfig.md +++ /dev/null @@ -1,80 +0,0 @@ -# DeleteProvisionedConcurrencyConfig - -Deletes the provisioned concurrency configuration for a function\. - -## Request Syntax - -``` -DELETE /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_DeleteProvisionedConcurrencyConfig_RequestSyntax) ** -The version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_DestinationConfig.md b/doc_source/API_DestinationConfig.md deleted file mode 100644 index 9d70476f..00000000 --- a/doc_source/API_DestinationConfig.md +++ /dev/null @@ -1,23 +0,0 @@ -# DestinationConfig - -A configuration object that specifies the destination of an event after Lambda processes it\. - -## Contents - - ** OnFailure ** -The destination configuration for failed invocations\. -Type: [OnFailure](API_OnFailure.md) object -Required: No - - ** OnSuccess ** -The destination configuration for successful invocations\. -Type: [OnSuccess](API_OnSuccess.md) object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DestinationConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/DestinationConfig) \ No newline at end of file diff --git a/doc_source/API_Environment.md b/doc_source/API_Environment.md deleted file mode 100644 index f6431eea..00000000 --- a/doc_source/API_Environment.md +++ /dev/null @@ -1,19 +0,0 @@ -# Environment - -A function's environment variable settings\. You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that are stored in a function's version\-specific configuration\. - -## Contents - - ** Variables ** -Environment variable key\-value pairs\. For more information, see [Using Lambda environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. -Type: String to string map -Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Environment) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Environment) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Environment) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Environment) \ No newline at end of file diff --git a/doc_source/API_EnvironmentError.md b/doc_source/API_EnvironmentError.md deleted file mode 100644 index 2ddf454e..00000000 --- a/doc_source/API_EnvironmentError.md +++ /dev/null @@ -1,23 +0,0 @@ -# EnvironmentError - -Error messages for environment variables that couldn't be applied\. - -## Contents - - ** ErrorCode ** -The error code\. -Type: String -Required: No - - ** Message ** -The error message\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentError) \ No newline at end of file diff --git a/doc_source/API_EnvironmentResponse.md b/doc_source/API_EnvironmentResponse.md deleted file mode 100644 index 6b9599c1..00000000 --- a/doc_source/API_EnvironmentResponse.md +++ /dev/null @@ -1,24 +0,0 @@ -# EnvironmentResponse - -The results of an operation to update or read environment variables\. If the operation is successful, the response contains the environment variables\. If it failed, the response contains details about the error\. - -## Contents - - ** Error ** -Error messages for environment variables that couldn't be applied\. -Type: [EnvironmentError](API_EnvironmentError.md) object -Required: No - - ** Variables ** -Environment variable key\-value pairs\. Omitted from AWS CloudTrail logs\. -Type: String to string map -Key Pattern: `[a-zA-Z]([a-zA-Z0-9_])+` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EnvironmentResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EnvironmentResponse) \ No newline at end of file diff --git a/doc_source/API_EphemeralStorage.md b/doc_source/API_EphemeralStorage.md deleted file mode 100644 index 6bc86bb3..00000000 --- a/doc_source/API_EphemeralStorage.md +++ /dev/null @@ -1,19 +0,0 @@ -# EphemeralStorage - -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. - -## Contents - - ** Size ** -The size of the function’s /tmp directory\. -Type: Integer -Valid Range: Minimum value of 512\. Maximum value of 10240\. -Required: Yes - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EphemeralStorage) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EphemeralStorage) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EphemeralStorage) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EphemeralStorage) \ No newline at end of file diff --git a/doc_source/API_EventSourceMappingConfiguration.md b/doc_source/API_EventSourceMappingConfiguration.md deleted file mode 100644 index 23d47d32..00000000 --- a/doc_source/API_EventSourceMappingConfiguration.md +++ /dev/null @@ -1,160 +0,0 @@ -# EventSourceMappingConfiguration - -A mapping between an AWS resource and a Lambda function\. For details, see [CreateEventSourceMapping](API_CreateEventSourceMapping.md)\. - -## Contents - - ** AmazonManagedKafkaEventSourceConfig ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object -Required: No - - ** BatchSize ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. -Required: No - - ** BisectBatchOnFunctionError ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. -Type: Boolean -Required: No - - ** DestinationConfig ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** EventSourceArn ** -The Amazon Resource Name \(ARN\) of the event source\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** FilterCriteria ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object -Required: No - - ** FunctionArn ** -The ARN of the Lambda function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** FunctionResponseTypes ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` -Required: No - - ** LastModified ** -The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. -Type: Timestamp -Required: No - - ** LastProcessingResult ** -The result of the last Lambda invocation of your function\. -Type: String -Required: No - - ** MaximumBatchingWindowInSeconds ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. -Required: No - - ** MaximumRecordAgeInSeconds ** -\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. -Required: No - - ** MaximumRetryAttempts ** -\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. -Required: No - - ** ParallelizationFactor ** -\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. -Required: No - - ** Queues ** - \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` -Required: No - - ** SelfManagedEventSource ** -The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object -Required: No - - ** SelfManagedKafkaEventSourceConfig ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object -Required: No - - ** SourceAccessConfigurations ** -An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. -Required: No - - ** StartingPosition ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` -Required: No - - ** StartingPositionTimestamp ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp -Required: No - - ** State ** -The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. -Type: String -Required: No - - ** StateTransitionReason ** -Indicates whether a user or Lambda made the last change to the event source mapping\. -Type: String -Required: No - - ** Topics ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` -Required: No - - ** TumblingWindowInSeconds ** -\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. -Required: No - - ** UUID ** -The identifier of the event source mapping\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/EventSourceMappingConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/EventSourceMappingConfiguration) \ No newline at end of file diff --git a/doc_source/API_FileSystemConfig.md b/doc_source/API_FileSystemConfig.md deleted file mode 100644 index 36843cd4..00000000 --- a/doc_source/API_FileSystemConfig.md +++ /dev/null @@ -1,27 +0,0 @@ -# FileSystemConfig - -Details about the connection between a Lambda function and an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. - -## Contents - - ** Arn ** -The Amazon Resource Name \(ARN\) of the Amazon EFS access point that provides access to the file system\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:aws[a-zA-Z-]*:elasticfilesystem:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:access-point/fsap-[a-f0-9]{17}` -Required: Yes - - ** LocalMountPath ** -The path where the function can access the file system, starting with `/mnt/`\. -Type: String -Length Constraints: Maximum length of 160\. -Pattern: `^/mnt/[a-zA-Z0-9-_.]+$` -Required: Yes - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FileSystemConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FileSystemConfig) \ No newline at end of file diff --git a/doc_source/API_Filter.md b/doc_source/API_Filter.md deleted file mode 100644 index ab0a6041..00000000 --- a/doc_source/API_Filter.md +++ /dev/null @@ -1,20 +0,0 @@ -# Filter - - A structure within a `FilterCriteria` object that defines an event filtering pattern\. - -## Contents - - ** Pattern ** - A filter pattern\. For more information on the syntax of a filter pattern, see [ Filter rule syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax)\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 4096\. -Pattern: `.*` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Filter) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Filter) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Filter) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Filter) \ No newline at end of file diff --git a/doc_source/API_FilterCriteria.md b/doc_source/API_FilterCriteria.md deleted file mode 100644 index 06d99095..00000000 --- a/doc_source/API_FilterCriteria.md +++ /dev/null @@ -1,18 +0,0 @@ -# FilterCriteria - - An object that contains the filters for an event source\. - -## Contents - - ** Filters ** - A list of filters\. -Type: Array of [Filter](API_Filter.md) objects -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FilterCriteria) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FilterCriteria) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FilterCriteria) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FilterCriteria) \ No newline at end of file diff --git a/doc_source/API_FunctionCode.md b/doc_source/API_FunctionCode.md deleted file mode 100644 index 1289dcdb..00000000 --- a/doc_source/API_FunctionCode.md +++ /dev/null @@ -1,42 +0,0 @@ -# FunctionCode - -The code for the Lambda function\. You can specify either an object in Amazon S3, upload a \.zip file archive deployment package directly, or specify the URI of a container image\. - -## Contents - - ** ImageUri ** -URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. -Type: String -Required: No - - ** S3Bucket ** -An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. -Type: String -Length Constraints: Minimum length of 3\. Maximum length of 63\. -Pattern: `^[0-9A-Za-z\.\-_]*(? -The Amazon S3 key of the deployment package\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** S3ObjectVersion ** -For versioned objects, the version of the deployment package object to use\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** ZipFile ** -The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. -Type: Base64\-encoded binary data object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCode) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCode) \ No newline at end of file diff --git a/doc_source/API_FunctionCodeLocation.md b/doc_source/API_FunctionCodeLocation.md deleted file mode 100644 index 0a9aff6c..00000000 --- a/doc_source/API_FunctionCodeLocation.md +++ /dev/null @@ -1,33 +0,0 @@ -# FunctionCodeLocation - -Details about a function's deployment package\. - -## Contents - - ** ImageUri ** -URI of a container image in the Amazon ECR registry\. -Type: String -Required: No - - ** Location ** -A presigned URL that you can use to download the deployment package\. -Type: String -Required: No - - ** RepositoryType ** -The service that's hosting the file\. -Type: String -Required: No - - ** ResolvedImageUri ** -The resolved URI for the image\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionCodeLocation) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionCodeLocation) \ No newline at end of file diff --git a/doc_source/API_FunctionConfiguration.md b/doc_source/API_FunctionConfiguration.md deleted file mode 100644 index fdd4f100..00000000 --- a/doc_source/API_FunctionConfiguration.md +++ /dev/null @@ -1,202 +0,0 @@ -# FunctionConfiguration - -Details about a function's configuration\. - -## Contents - - ** Architectures ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` -Required: No - - ** CodeSha256 ** -The SHA256 hash of the function's deployment package\. -Type: String -Required: No - - ** CodeSize ** -The size of the function's deployment package, in bytes\. -Type: Long -Required: No - - ** DeadLetterConfig ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object -Required: No - - ** Description ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** Environment ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object -Required: No - - ** EphemeralStorage ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object -Required: No - - ** FileSystemConfigs ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. -Required: No - - ** FunctionArn ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** FunctionName ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** Handler ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` -Required: No - - ** ImageConfigResponse ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object -Required: No - - ** KMSKeyArn ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` -Required: No - - ** LastModified ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String -Required: No - - ** LastUpdateStatus ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` -Required: No - - ** LastUpdateStatusReason ** -The reason for the last update that was performed on the function\. -Type: String -Required: No - - ** LastUpdateStatusReasonCode ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` -Required: No - - ** Layers ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects -Required: No - - ** MasterArn ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** MemorySize ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - ** PackageType ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` -Required: No - - ** RevisionId ** -The latest updated revision of the function or alias\. -Type: String -Required: No - - ** Role ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` -Required: No - - ** Runtime ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - ** SigningJobArn ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** SigningProfileVersionArn ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** State ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` -Required: No - - ** StateReason ** -The reason for the function's current state\. -Type: String -Required: No - - ** StateReasonCode ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` -Required: No - - ** Timeout ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. -Required: No - - ** TracingConfig ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object -Required: No - - ** Version ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` -Required: No - - ** VpcConfig ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_FunctionEventInvokeConfig.md b/doc_source/API_FunctionEventInvokeConfig.md deleted file mode 100644 index d5e27544..00000000 --- a/doc_source/API_FunctionEventInvokeConfig.md +++ /dev/null @@ -1,45 +0,0 @@ -# FunctionEventInvokeConfig - -## Contents - - ** DestinationConfig ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** FunctionArn ** -The Amazon Resource Name \(ARN\) of the function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** LastModified ** -The date and time that the configuration was last updated, in Unix time seconds\. -Type: Timestamp -Required: No - - ** MaximumEventAgeInSeconds ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. -Required: No - - ** MaximumRetryAttempts ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_FunctionUrlConfig.md b/doc_source/API_FunctionUrlConfig.md deleted file mode 100644 index aa6c9f3a..00000000 --- a/doc_source/API_FunctionUrlConfig.md +++ /dev/null @@ -1,46 +0,0 @@ -# FunctionUrlConfig - -Details about a Lambda function URL\. - -## Contents - - ** AuthType ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` -Required: Yes - - ** Cors ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object -Required: No - - ** CreationTime ** -When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String -Required: Yes - - ** FunctionArn ** -The Amazon Resource Name \(ARN\) of your function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** FunctionUrl ** -The HTTP URL endpoint for your function\. -Type: String -Length Constraints: Minimum length of 40\. Maximum length of 100\. -Required: Yes - - ** LastModifiedTime ** -When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String -Required: Yes - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/FunctionUrlConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/FunctionUrlConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/FunctionUrlConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/FunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_GetAccountSettings.md b/doc_source/API_GetAccountSettings.md deleted file mode 100644 index dd4292cf..00000000 --- a/doc_source/API_GetAccountSettings.md +++ /dev/null @@ -1,75 +0,0 @@ -# GetAccountSettings - -Retrieves details about your account's [limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) and usage in an AWS Region\. - -## Request Syntax - -``` -GET /2016-08-19/account-settings/ HTTP/1.1 -``` - -## URI Request Parameters - -The request does not use any URI parameters\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AccountLimit": { - "CodeSizeUnzipped": number, - "CodeSizeZipped": number, - "ConcurrentExecutions": number, - "TotalCodeSize": number, - "UnreservedConcurrentExecutions": number - }, - "AccountUsage": { - "FunctionCount": number, - "TotalCodeSize": number - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AccountLimit](#API_GetAccountSettings_ResponseSyntax) ** -Limits that are related to concurrency and code storage\. -Type: [AccountLimit](API_AccountLimit.md) object - - ** [AccountUsage](#API_GetAccountSettings_ResponseSyntax) ** -The number of functions and amount of storage in use\. -Type: [AccountUsage](API_AccountUsage.md) object - -## Errors - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAccountSettings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAccountSettings) \ No newline at end of file diff --git a/doc_source/API_GetAlias.md b/doc_source/API_GetAlias.md deleted file mode 100644 index fdb3ced6..00000000 --- a/doc_source/API_GetAlias.md +++ /dev/null @@ -1,122 +0,0 @@ -# GetAlias - -Returns details about a Lambda function [alias](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetAlias_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Name](#API_GetAlias_RequestSyntax) ** -The name of the alias\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AliasArn": "string", - "Description": "string", - "FunctionVersion": "string", - "Name": "string", - "RevisionId": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AliasArn](#API_GetAlias_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the alias\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Description](#API_GetAlias_ResponseSyntax) ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [FunctionVersion](#API_GetAlias_ResponseSyntax) ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [Name](#API_GetAlias_ResponseSyntax) ** -The name of the alias\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - - ** [RevisionId](#API_GetAlias_ResponseSyntax) ** -A unique identifier that changes when you update the alias\. -Type: String - - ** [RoutingConfig](#API_GetAlias_ResponseSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetAlias) \ No newline at end of file diff --git a/doc_source/API_GetCodeSigningConfig.md b/doc_source/API_GetCodeSigningConfig.md deleted file mode 100644 index 544fa093..00000000 --- a/doc_source/API_GetCodeSigningConfig.md +++ /dev/null @@ -1,82 +0,0 @@ -# GetCodeSigningConfig - -Returns information about the specified code signing configuration\. - -## Request Syntax - -``` -GET /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CodeSigningConfigArn](#API_GetCodeSigningConfig_RequestSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CodeSigningConfig": { - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningConfigArn": "string", - "CodeSigningConfigId": "string", - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string", - "LastModified": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfig](#API_GetCodeSigningConfig_ResponseSyntax) ** -The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetEventSourceMapping.md b/doc_source/API_GetEventSourceMapping.md deleted file mode 100644 index 82f1e546..00000000 --- a/doc_source/API_GetEventSourceMapping.md +++ /dev/null @@ -1,241 +0,0 @@ -# GetEventSourceMapping - -Returns details about an event source mapping\. You can get the identifier of a mapping from the output of [ListEventSourceMappings](API_ListEventSourceMappings.md)\. - -## Request Syntax - -``` -GET /2015-03-31/event-source-mappings/UUID HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [UUID](#API_GetEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], - "LastModified": number, - "LastProcessingResult": "string", - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "State": "string", - "StateTransitionReason": "string", - "Topics": [ "string" ], - "TumblingWindowInSeconds": number, - "UUID": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AmazonManagedKafkaEventSourceConfig](#API_GetEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object - - ** [BatchSize](#API_GetEventSourceMapping_ResponseSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. - - ** [BisectBatchOnFunctionError](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. -Type: Boolean - - ** [DestinationConfig](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [EventSourceArn](#API_GetEventSourceMapping_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [FilterCriteria](#API_GetEventSourceMapping_ResponseSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object - - ** [FunctionArn](#API_GetEventSourceMapping_ResponseSyntax) ** -The ARN of the Lambda function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionResponseTypes](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` - - ** [LastModified](#API_GetEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. -Type: Timestamp - - ** [LastProcessingResult](#API_GetEventSourceMapping_ResponseSyntax) ** -The result of the last Lambda invocation of your function\. -Type: String - - ** [MaximumBatchingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. - - ** [MaximumRecordAgeInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. - - ** [MaximumRetryAttempts](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. - - ** [ParallelizationFactor](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. - - ** [Queues](#API_GetEventSourceMapping_ResponseSyntax) ** - \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` - - ** [SelfManagedEventSource](#API_GetEventSourceMapping_ResponseSyntax) ** -The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - - ** [SelfManagedKafkaEventSourceConfig](#API_GetEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object - - ** [SourceAccessConfigurations](#API_GetEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - - ** [StartingPosition](#API_GetEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_GetEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp - - ** [State](#API_GetEventSourceMapping_ResponseSyntax) ** -The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. -Type: String - - ** [StateTransitionReason](#API_GetEventSourceMapping_ResponseSyntax) ** -Indicates whether a user or Lambda made the last change to the event source mapping\. -Type: String - - ** [Topics](#API_GetEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - - ** [TumblingWindowInSeconds](#API_GetEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - - ** [UUID](#API_GetEventSourceMapping_ResponseSyntax) ** -The identifier of the event source mapping\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_GetFunction.md b/doc_source/API_GetFunction.md deleted file mode 100644 index be157bf2..00000000 --- a/doc_source/API_GetFunction.md +++ /dev/null @@ -1,184 +0,0 @@ -# GetFunction - -Returns information about the function or function version, with a link to download the deployment package that's valid for 10 minutes\. If you specify a function version, only details that are specific to that version are returned\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunction_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetFunction_RequestSyntax) ** -Specify a version or alias to get details about a published version of the function\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Code": { - "ImageUri": "string", - "Location": "string", - "RepositoryType": "string", - "ResolvedImageUri": "string" - }, - "Concurrency": { - "ReservedConcurrentExecutions": number - }, - "Configuration": { - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } - }, - "Tags": { - "string" : "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Code](#API_GetFunction_ResponseSyntax) ** -The deployment package of the function or version\. -Type: [FunctionCodeLocation](API_FunctionCodeLocation.md) object - - ** [Concurrency](#API_GetFunction_ResponseSyntax) ** -The function's [reserved concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. -Type: [Concurrency](API_Concurrency.md) object - - ** [Configuration](#API_GetFunction_ResponseSyntax) ** -The configuration of the function or version\. -Type: [FunctionConfiguration](API_FunctionConfiguration.md) object - - ** [Tags](#API_GetFunction_ResponseSyntax) ** -The function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. -Type: String to string map - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunction) \ No newline at end of file diff --git a/doc_source/API_GetFunctionCodeSigningConfig.md b/doc_source/API_GetFunctionCodeSigningConfig.md deleted file mode 100644 index be6ec7ca..00000000 --- a/doc_source/API_GetFunctionCodeSigningConfig.md +++ /dev/null @@ -1,96 +0,0 @@ -# GetFunctionCodeSigningConfig - -Returns the code signing configuration for the specified function\. - -## Request Syntax - -``` -GET /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunctionCodeSigningConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CodeSigningConfigArn": "string", - "FunctionName": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfigArn](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - - ** [FunctionName](#API_GetFunctionCodeSigningConfig_ResponseSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConcurrency.md b/doc_source/API_GetFunctionConcurrency.md deleted file mode 100644 index c6757228..00000000 --- a/doc_source/API_GetFunctionConcurrency.md +++ /dev/null @@ -1,82 +0,0 @@ -# GetFunctionConcurrency - -Returns details about the reserved concurrency configuration for a function\. To set a concurrency limit for a function, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. - -## Request Syntax - -``` -GET /2019-09-30/functions/FunctionName/concurrency HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunctionConcurrency_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "ReservedConcurrentExecutions": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [ReservedConcurrentExecutions](#API_GetFunctionConcurrency_ResponseSyntax) ** -The number of simultaneous executions that are reserved for the function\. -Type: Integer -Valid Range: Minimum value of 0\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_GetFunctionConfiguration.md b/doc_source/API_GetFunctionConfiguration.md deleted file mode 100644 index 72f016d4..00000000 --- a/doc_source/API_GetFunctionConfiguration.md +++ /dev/null @@ -1,312 +0,0 @@ -# GetFunctionConfiguration - -Returns the version\-specific settings of a Lambda function or version\. The output includes only options that can vary between versions of a function\. To modify these settings, use [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. - -To get all of a function's details, including function\-level settings, use [GetFunction](API_GetFunction.md)\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName/configuration?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunctionConfiguration_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetFunctionConfiguration_RequestSyntax) ** -Specify a version or alias to get details about a published version of the function\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Architectures](#API_GetFunctionConfiguration_ResponseSyntax) ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` - - ** [CodeSha256](#API_GetFunctionConfiguration_ResponseSyntax) ** -The SHA256 hash of the function's deployment package\. -Type: String - - ** [CodeSize](#API_GetFunctionConfiguration_ResponseSyntax) ** -The size of the function's deployment package, in bytes\. -Type: Long - - ** [DeadLetterConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - - ** [Description](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [Environment](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - - ** [EphemeralStorage](#API_GetFunctionConfiguration_ResponseSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object - - ** [FileSystemConfigs](#API_GetFunctionConfiguration_ResponseSyntax) ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. - - ** [FunctionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionName](#API_GetFunctionConfiguration_ResponseSyntax) ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Handler](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` - - ** [ImageConfigResponse](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - - ** [KMSKeyArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - - ** [LastModified](#API_GetFunctionConfiguration_ResponseSyntax) ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [LastUpdateStatus](#API_GetFunctionConfiguration_ResponseSyntax) ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` - - ** [LastUpdateStatusReason](#API_GetFunctionConfiguration_ResponseSyntax) ** -The reason for the last update that was performed on the function\. -Type: String - - ** [LastUpdateStatusReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Layers](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects - - ** [MasterArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [MemorySize](#API_GetFunctionConfiguration_ResponseSyntax) ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_GetFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` - - ** [RevisionId](#API_GetFunctionConfiguration_ResponseSyntax) ** -The latest updated revision of the function or alias\. -Type: String - - ** [Role](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - - ** [Runtime](#API_GetFunctionConfiguration_ResponseSyntax) ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_GetFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [State](#API_GetFunctionConfiguration_ResponseSyntax) ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` - - ** [StateReason](#API_GetFunctionConfiguration_ResponseSyntax) ** -The reason for the function's current state\. -Type: String - - ** [StateReasonCode](#API_GetFunctionConfiguration_ResponseSyntax) ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Timeout](#API_GetFunctionConfiguration_ResponseSyntax) ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [TracingConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - - ** [Version](#API_GetFunctionConfiguration_ResponseSyntax) ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [VpcConfig](#API_GetFunctionConfiguration_ResponseSyntax) ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_GetFunctionEventInvokeConfig.md b/doc_source/API_GetFunctionEventInvokeConfig.md deleted file mode 100644 index 8c634b3e..00000000 --- a/doc_source/API_GetFunctionEventInvokeConfig.md +++ /dev/null @@ -1,124 +0,0 @@ -# GetFunctionEventInvokeConfig - -Retrieves the configuration for asynchronous invocation for a function, version, or alias\. - -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. - -## Request Syntax - -``` -GET /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetFunctionEventInvokeConfig_RequestSyntax) ** -A version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "FunctionArn": "string", - "LastModified": number, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [DestinationConfig](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [FunctionArn](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [LastModified](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** -The date and time that the configuration was last updated, in Unix time seconds\. -Type: Timestamp - - ** [MaximumEventAgeInSeconds](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. - - ** [MaximumRetryAttempts](#API_GetFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_GetFunctionUrlConfig.md b/doc_source/API_GetFunctionUrlConfig.md deleted file mode 100644 index cbfcdefb..00000000 --- a/doc_source/API_GetFunctionUrlConfig.md +++ /dev/null @@ -1,121 +0,0 @@ -# GetFunctionUrlConfig - -Returns details about a Lambda function URL\. - -## Request Syntax - -``` -GET /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetFunctionUrlConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetFunctionUrlConfig_RequestSyntax) ** -The alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - }, - "CreationTime": "string", - "FunctionArn": "string", - "FunctionUrl": "string", - "LastModifiedTime": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AuthType](#API_GetFunctionUrlConfig_ResponseSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` - - ** [Cors](#API_GetFunctionUrlConfig_ResponseSyntax) ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object - - ** [CreationTime](#API_GetFunctionUrlConfig_ResponseSyntax) ** -When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [FunctionArn](#API_GetFunctionUrlConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of your function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionUrl](#API_GetFunctionUrlConfig_ResponseSyntax) ** -The HTTP URL endpoint for your function\. -Type: String -Length Constraints: Minimum length of 40\. Maximum length of 100\. - - ** [LastModifiedTime](#API_GetFunctionUrlConfig_ResponseSyntax) ** -When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunctionUrlConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersion.md b/doc_source/API_GetLayerVersion.md deleted file mode 100644 index 685e82bc..00000000 --- a/doc_source/API_GetLayerVersion.md +++ /dev/null @@ -1,135 +0,0 @@ -# GetLayerVersion - -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. - -## Request Syntax - -``` -GET /2018-10-31/layers/LayerName/versions/VersionNumber HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_GetLayerVersion_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [VersionNumber](#API_GetLayerVersion_RequestSyntax) ** -The version number\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "Content": { - "CodeSha256": "string", - "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - }, - "CreatedDate": "string", - "Description": "string", - "LayerArn": "string", - "LayerVersionArn": "string", - "LicenseInfo": "string", - "Version": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CompatibleArchitectures](#API_GetLayerVersion_ResponseSyntax) ** -A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Type: Array of strings -Array Members: Maximum number of 2 items\. -Valid Values:` x86_64 | arm64` - - ** [CompatibleRuntimes](#API_GetLayerVersion_ResponseSyntax) ** -The layer's compatible runtimes\. -Type: Array of strings -Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [Content](#API_GetLayerVersion_ResponseSyntax) ** -Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - - ** [CreatedDate](#API_GetLayerVersion_ResponseSyntax) ** -The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [Description](#API_GetLayerVersion_ResponseSyntax) ** -The description of the version\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [LayerArn](#API_GetLayerVersion_ResponseSyntax) ** -The ARN of the layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - - ** [LayerVersionArn](#API_GetLayerVersion_ResponseSyntax) ** -The ARN of the layer version\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - - ** [LicenseInfo](#API_GetLayerVersion_ResponseSyntax) ** -The layer's software license\. -Type: String -Length Constraints: Maximum length of 512\. - - ** [Version](#API_GetLayerVersion_ResponseSyntax) ** -The version number\. -Type: Long - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersion) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionByArn.md b/doc_source/API_GetLayerVersionByArn.md deleted file mode 100644 index 7f2e0380..00000000 --- a/doc_source/API_GetLayerVersionByArn.md +++ /dev/null @@ -1,131 +0,0 @@ -# GetLayerVersionByArn - -Returns information about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html), with a link to download the layer archive that's valid for 10 minutes\. - -## Request Syntax - -``` -GET /2018-10-31/layers?find=LayerVersion&Arn=Arn HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [Arn](#API_GetLayerVersionByArn_RequestSyntax) ** -The ARN of the layer version\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "Content": { - "CodeSha256": "string", - "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - }, - "CreatedDate": "string", - "Description": "string", - "LayerArn": "string", - "LayerVersionArn": "string", - "LicenseInfo": "string", - "Version": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CompatibleArchitectures](#API_GetLayerVersionByArn_ResponseSyntax) ** -A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Type: Array of strings -Array Members: Maximum number of 2 items\. -Valid Values:` x86_64 | arm64` - - ** [CompatibleRuntimes](#API_GetLayerVersionByArn_ResponseSyntax) ** -The layer's compatible runtimes\. -Type: Array of strings -Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [Content](#API_GetLayerVersionByArn_ResponseSyntax) ** -Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - - ** [CreatedDate](#API_GetLayerVersionByArn_ResponseSyntax) ** -The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [Description](#API_GetLayerVersionByArn_ResponseSyntax) ** -The description of the version\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [LayerArn](#API_GetLayerVersionByArn_ResponseSyntax) ** -The ARN of the layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - - ** [LayerVersionArn](#API_GetLayerVersionByArn_ResponseSyntax) ** -The ARN of the layer version\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - - ** [LicenseInfo](#API_GetLayerVersionByArn_ResponseSyntax) ** -The layer's software license\. -Type: String -Length Constraints: Maximum length of 512\. - - ** [Version](#API_GetLayerVersionByArn_ResponseSyntax) ** -The version number\. -Type: Long - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionByArn) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionByArn) \ No newline at end of file diff --git a/doc_source/API_GetLayerVersionPolicy.md b/doc_source/API_GetLayerVersionPolicy.md deleted file mode 100644 index ad5f3319..00000000 --- a/doc_source/API_GetLayerVersionPolicy.md +++ /dev/null @@ -1,84 +0,0 @@ -# GetLayerVersionPolicy - -Returns the permission policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. - -## Request Syntax - -``` -GET /2018-10-31/layers/LayerName/versions/VersionNumber/policy HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_GetLayerVersionPolicy_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [VersionNumber](#API_GetLayerVersionPolicy_RequestSyntax) ** -The version number\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Policy": "string", - "RevisionId": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Policy](#API_GetLayerVersionPolicy_ResponseSyntax) ** -The policy document\. -Type: String - - ** [RevisionId](#API_GetLayerVersionPolicy_ResponseSyntax) ** -A unique identifier for the current revision of the policy\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetLayerVersionPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetLayerVersionPolicy) \ No newline at end of file diff --git a/doc_source/API_GetPolicy.md b/doc_source/API_GetPolicy.md deleted file mode 100644 index 68add8e0..00000000 --- a/doc_source/API_GetPolicy.md +++ /dev/null @@ -1,91 +0,0 @@ -# GetPolicy - -Returns the [resource\-based IAM policy](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) for a function, version, or alias\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName/policy?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetPolicy_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetPolicy_RequestSyntax) ** -Specify a version or alias to get the policy for that resource\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Policy": "string", - "RevisionId": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Policy](#API_GetPolicy_ResponseSyntax) ** -The resource\-based policy\. -Type: String - - ** [RevisionId](#API_GetPolicy_ResponseSyntax) ** -A unique identifier for the current revision of the policy\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetPolicy) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetPolicy) \ No newline at end of file diff --git a/doc_source/API_GetProvisionedConcurrencyConfig.md b/doc_source/API_GetProvisionedConcurrencyConfig.md deleted file mode 100644 index 4e066681..00000000 --- a/doc_source/API_GetProvisionedConcurrencyConfig.md +++ /dev/null @@ -1,120 +0,0 @@ -# GetProvisionedConcurrencyConfig - -Retrieves the provisioned concurrency configuration for a function's alias or version\. - -## Request Syntax - -``` -GET /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifier HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_GetProvisionedConcurrencyConfig_RequestSyntax) ** -The version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AllocatedProvisionedConcurrentExecutions": number, - "AvailableProvisionedConcurrentExecutions": number, - "LastModified": "string", - "RequestedProvisionedConcurrentExecutions": number, - "Status": "string", - "StatusReason": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AllocatedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. -Type: Integer -Valid Range: Minimum value of 0\. - - ** [AvailableProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency available\. -Type: Integer -Valid Range: Minimum value of 0\. - - ** [LastModified](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. -Type: String - - ** [RequestedProvisionedConcurrentExecutions](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency requested\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [Status](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -The status of the allocation process\. -Type: String -Valid Values:` IN_PROGRESS | READY | FAILED` - - ** [StatusReason](#API_GetProvisionedConcurrencyConfig_ResponseSyntax) ** -For failed allocations, the reason that provisioned concurrency could not be allocated\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ProvisionedConcurrencyConfigNotFoundException ** -The specified configuration does not exist\. -HTTP Status Code: 404 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/GetProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfig.md b/doc_source/API_ImageConfig.md deleted file mode 100644 index a50ee895..00000000 --- a/doc_source/API_ImageConfig.md +++ /dev/null @@ -1,31 +0,0 @@ -# ImageConfig - -Configuration values that override the container image Dockerfile settings\. See [Container settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms)\. - -## Contents - - ** Command ** -Specifies parameters that you want to pass in with ENTRYPOINT\. -Type: Array of strings -Array Members: Maximum number of 1500 items\. -Required: No - - ** EntryPoint ** -Specifies the entry point to their application, which is typically the location of the runtime executable\. -Type: Array of strings -Array Members: Maximum number of 1500 items\. -Required: No - - ** WorkingDirectory ** -Specifies the working directory\. -Type: String -Length Constraints: Maximum length of 1000\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfig) \ No newline at end of file diff --git a/doc_source/API_ImageConfigError.md b/doc_source/API_ImageConfigError.md deleted file mode 100644 index 9a1372b5..00000000 --- a/doc_source/API_ImageConfigError.md +++ /dev/null @@ -1,23 +0,0 @@ -# ImageConfigError - -Error response to GetFunctionConfiguration\. - -## Contents - - ** ErrorCode ** -Error code\. -Type: String -Required: No - - ** Message ** -Error message\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigError) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigError) \ No newline at end of file diff --git a/doc_source/API_ImageConfigResponse.md b/doc_source/API_ImageConfigResponse.md deleted file mode 100644 index fdba6bfb..00000000 --- a/doc_source/API_ImageConfigResponse.md +++ /dev/null @@ -1,23 +0,0 @@ -# ImageConfigResponse - -Response to GetFunctionConfiguration request\. - -## Contents - - ** Error ** -Error response to GetFunctionConfiguration\. -Type: [ImageConfigError](API_ImageConfigError.md) object -Required: No - - ** ImageConfig ** -Configuration values that override the container image Dockerfile\. -Type: [ImageConfig](API_ImageConfig.md) object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ImageConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ImageConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Invoke.md b/doc_source/API_Invoke.md deleted file mode 100644 index 9a18dea1..00000000 --- a/doc_source/API_Invoke.md +++ /dev/null @@ -1,224 +0,0 @@ -# Invoke - -Invokes a Lambda function\. You can invoke a function synchronously \(and wait for the response\), or asynchronously\. To invoke a function asynchronously, set `InvocationType` to `Event`\. - -For [synchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-sync.html), details about the function response, including errors, are included in the response body and headers\. For either invocation type, you can find more information in the [execution log](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html) and [trace](https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html)\. - -When an error occurs, your function may be invoked multiple times\. Retry behavior varies by error type, client, event source, and invocation type\. For example, if you invoke a function asynchronously and it returns an error, Lambda executes the function up to two more times\. For more information, see [Retry Behavior](https://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html)\. - -For [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html), Lambda adds events to a queue before sending them to your function\. If your function does not have enough capacity to keep up with the queue, events may be lost\. Occasionally, your function may receive the same event multiple times, even if no error occurs\. To retain events that were not processed, configure your function with a [dead\-letter queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. - -The status code in the API response doesn't reflect function errors\. Error codes are reserved for errors that prevent your function from executing, such as permissions errors, [limit errors](https://docs.aws.amazon.com/lambda/latest/dg/limits.html), or issues with your function's code and configuration\. For example, Lambda returns `TooManyRequestsException` if executing the function would cause you to exceed a concurrency limit at either the account level \(`ConcurrentInvocationLimitExceeded`\) or function level \(`ReservedFunctionConcurrentInvocationLimitExceeded`\)\. - -For functions with a long timeout, your client might be disconnected during synchronous invocation while it waits for a response\. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep\-alive settings\. - -This operation requires permission for the [lambda:InvokeFunction](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) action\. For details on how to set up permissions for cross\-account invocations, see [Granting function access to other accounts](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountinvoke)\. - -## Request Syntax - -``` -POST /2015-03-31/functions/FunctionName/invocations?Qualifier=Qualifier HTTP/1.1 -X-Amz-Invocation-Type: InvocationType -X-Amz-Log-Type: LogType -X-Amz-Client-Context: ClientContext - -Payload -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [ClientContext](#API_Invoke_RequestSyntax) ** -Up to 3583 bytes of base64\-encoded data about the invoking client to pass to the function in the context object\. - - ** [FunctionName](#API_Invoke_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [InvocationType](#API_Invoke_RequestSyntax) ** -Choose from the following options\. -+ `RequestResponse` \(default\) \- Invoke the function synchronously\. Keep the connection open until the function returns a response or times out\. The API response includes the function response and additional data\. -+ `Event` \- Invoke the function asynchronously\. Send events that fail multiple times to the function's dead\-letter queue \(if it's configured\)\. The API response only includes a status code\. -+ `DryRun` \- Validate parameter values and verify that the user or role has permission to invoke the function\. -Valid Values:` Event | RequestResponse | DryRun` - - ** [LogType](#API_Invoke_RequestSyntax) ** -Set to `Tail` to include the execution log in the response\. Applies to synchronously invoked functions only\. -Valid Values:` None | Tail` - - ** [Qualifier](#API_Invoke_RequestSyntax) ** -Specify a version or alias to invoke a published version of the function\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request accepts the following binary data\. - - ** [Payload](#API_Invoke_RequestSyntax) ** -The JSON that you want to provide to your Lambda function as input\. -You can enter the JSON directly\. For example, `--payload '{ "key": "value" }'`\. You can also specify a file path\. For example, `--payload file://payload.json`\. - -## Response Syntax - -``` -HTTP/1.1 StatusCode -X-Amz-Function-Error: FunctionError -X-Amz-Log-Result: LogResult -X-Amz-Executed-Version: ExecutedVersion - -Payload -``` - -## Response Elements - -If the action is successful, the service sends back the following HTTP response\. - - ** [StatusCode](#API_Invoke_ResponseSyntax) ** -The HTTP status code is in the 200 range for a successful request\. For the `RequestResponse` invocation type, this status code is 200\. For the `Event` invocation type, this status code is 202\. For the `DryRun` invocation type, the status code is 204\. - -The response returns the following HTTP headers\. - - ** [ExecutedVersion](#API_Invoke_ResponseSyntax) ** -The version of the function that executed\. When you invoke a function with an alias, this indicates which version the alias resolved to\. -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [FunctionError](#API_Invoke_ResponseSyntax) ** -If present, indicates that an error occurred during function execution\. Details about the error are included in the response payload\. - - ** [LogResult](#API_Invoke_ResponseSyntax) ** -The last 4 KB of the execution log, which is base64 encoded\. - -The response returns the following as the HTTP body\. - - ** [Payload](#API_Invoke_ResponseSyntax) ** -The response from the function, or an error object\. - -## Errors - - ** EC2AccessDeniedException ** -Need additional permissions to configure VPC settings\. -HTTP Status Code: 502 - - ** EC2ThrottledException ** - AWS Lambda was throttled by Amazon EC2 during Lambda function initialization using the execution role provided for the Lambda function\. -HTTP Status Code: 502 - - ** EC2UnexpectedException ** - AWS Lambda received an unexpected EC2 client exception while setting up for the Lambda function\. -HTTP Status Code: 502 - - ** EFSIOException ** -An error occurred when reading from or writing to a connected file system\. -HTTP Status Code: 410 - - ** EFSMountConnectivityException ** -The function couldn't make a network connection to the configured file system\. -HTTP Status Code: 408 - - ** EFSMountFailureException ** -The function couldn't mount the configured file system due to a permission or configuration issue\. -HTTP Status Code: 403 - - ** EFSMountTimeoutException ** -The function was able to make a network connection to the configured file system, but the mount operation timed out\. -HTTP Status Code: 408 - - ** ENILimitReachedException ** - AWS Lambda was not able to create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached\. -HTTP Status Code: 502 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** InvalidRequestContentException ** -The request body could not be parsed as JSON\. -HTTP Status Code: 400 - - ** InvalidRuntimeException ** -The runtime or runtime version specified is not supported\. -HTTP Status Code: 502 - - ** InvalidSecurityGroupIDException ** -The Security Group ID provided in the Lambda function VPC configuration is invalid\. -HTTP Status Code: 502 - - ** InvalidSubnetIDException ** -The Subnet ID provided in the Lambda function VPC configuration is invalid\. -HTTP Status Code: 502 - - ** InvalidZipFileException ** - AWS Lambda could not unzip the deployment package\. -HTTP Status Code: 502 - - ** KMSAccessDeniedException ** -Lambda was unable to decrypt the environment variables because KMS access was denied\. Check the Lambda function's KMS permissions\. -HTTP Status Code: 502 - - ** KMSDisabledException ** -Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Check the Lambda function's KMS key settings\. -HTTP Status Code: 502 - - ** KMSInvalidStateException ** -Lambda was unable to decrypt the environment variables because the KMS key used is in an invalid state for Decrypt\. Check the function's KMS key settings\. -HTTP Status Code: 502 - - ** KMSNotFoundException ** -Lambda was unable to decrypt the environment variables because the KMS key was not found\. Check the function's KMS key settings\. -HTTP Status Code: 502 - - ** RequestTooLargeException ** -The request payload exceeded the `Invoke` request body JSON input limit\. For more information, see [Limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)\. -HTTP Status Code: 413 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ResourceNotReadyException ** -The function is inactive and its VPC connection is no longer available\. Wait for the VPC connection to reestablish and try again\. -HTTP Status Code: 502 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** SubnetIPAddressLimitReachedException ** - AWS Lambda was not able to set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses\. -HTTP Status Code: 502 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - - ** UnsupportedMediaTypeException ** -The content type of the `Invoke` request body is not JSON\. -HTTP Status Code: 415 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/Invoke) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/Invoke) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Invoke) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Invoke) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/Invoke) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/Invoke) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Invoke) \ No newline at end of file diff --git a/doc_source/API_InvokeAsync.md b/doc_source/API_InvokeAsync.md deleted file mode 100644 index 8a6281c5..00000000 --- a/doc_source/API_InvokeAsync.md +++ /dev/null @@ -1,88 +0,0 @@ -# InvokeAsync - - *This action has been deprecated\.* - -**Important** -For asynchronous function invocation, use [Invoke](API_Invoke.md)\. - -Invokes a function asynchronously\. - -## Request Syntax - -``` -POST /2014-11-13/functions/FunctionName/invoke-async/ HTTP/1.1 - -InvokeArgs -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_InvokeAsync_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following binary data\. - - ** [InvokeArgs](#API_InvokeAsync_RequestSyntax) ** -The JSON that you want to provide to your Lambda function as input\. -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 Status -``` - -## Response Elements - -If the action is successful, the service sends back the following HTTP response\. - - ** [Status](#API_InvokeAsync_ResponseSyntax) ** -The status code\. - -## Errors - - ** InvalidRequestContentException ** -The request body could not be parsed as JSON\. -HTTP Status Code: 400 - - ** InvalidRuntimeException ** -The runtime or runtime version specified is not supported\. -HTTP Status Code: 502 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/InvokeAsync) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/InvokeAsync) \ No newline at end of file diff --git a/doc_source/API_Layer.md b/doc_source/API_Layer.md deleted file mode 100644 index 89f0c7a8..00000000 --- a/doc_source/API_Layer.md +++ /dev/null @@ -1,37 +0,0 @@ -# Layer - -An [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. - -## Contents - - ** Arn ** -The Amazon Resource Name \(ARN\) of the function layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` -Required: No - - ** CodeSize ** -The size of the layer archive in bytes\. -Type: Long -Required: No - - ** SigningJobArn ** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - - ** SigningProfileVersionArn ** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/Layer) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/Layer) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Layer) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/Layer) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentInput.md b/doc_source/API_LayerVersionContentInput.md deleted file mode 100644 index 3a7d97d3..00000000 --- a/doc_source/API_LayerVersionContentInput.md +++ /dev/null @@ -1,37 +0,0 @@ -# LayerVersionContentInput - -A ZIP archive that contains the contents of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. You can specify either an Amazon S3 location, or upload a layer archive directly\. - -## Contents - - ** S3Bucket ** -The Amazon S3 bucket of the layer archive\. -Type: String -Length Constraints: Minimum length of 3\. Maximum length of 63\. -Pattern: `^[0-9A-Za-z\.\-_]*(? -The Amazon S3 key of the layer archive\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** S3ObjectVersion ** -For versioned objects, the version of the layer archive object to use\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** ZipFile ** -The base64\-encoded contents of the layer archive\. AWS SDK and AWS CLI clients handle the encoding for you\. -Type: Base64\-encoded binary data object -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentInput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentInput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionContentOutput.md b/doc_source/API_LayerVersionContentOutput.md deleted file mode 100644 index 68c14788..00000000 --- a/doc_source/API_LayerVersionContentOutput.md +++ /dev/null @@ -1,38 +0,0 @@ -# LayerVersionContentOutput - -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. - -## Contents - - ** CodeSha256 ** -The SHA\-256 hash of the layer archive\. -Type: String -Required: No - - ** CodeSize ** -The size of the layer archive in bytes\. -Type: Long -Required: No - - ** Location ** -A link to the layer archive in Amazon S3 that is valid for 10 minutes\. -Type: String -Required: No - - ** SigningJobArn ** -The Amazon Resource Name \(ARN\) of a signing job\. -Type: String -Required: No - - ** SigningProfileVersionArn ** -The Amazon Resource Name \(ARN\) for a signing profile version\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionContentOutput) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionContentOutput) \ No newline at end of file diff --git a/doc_source/API_LayerVersionsListItem.md b/doc_source/API_LayerVersionsListItem.md deleted file mode 100644 index 053e2f44..00000000 --- a/doc_source/API_LayerVersionsListItem.md +++ /dev/null @@ -1,56 +0,0 @@ -# LayerVersionsListItem - -Details about a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. - -## Contents - - ** CompatibleArchitectures ** -A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Type: Array of strings -Array Members: Maximum number of 2 items\. -Valid Values:` x86_64 | arm64` -Required: No - - ** CompatibleRuntimes ** -The layer's compatible runtimes\. -Type: Array of strings -Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - ** CreatedDate ** -The date that the version was created, in ISO 8601 format\. For example, `2018-11-27T15:10:45.123+0000`\. -Type: String -Required: No - - ** Description ** -The description of the version\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** LayerVersionArn ** -The ARN of the layer version\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` -Required: No - - ** LicenseInfo ** -The layer's open\-source license\. -Type: String -Length Constraints: Maximum length of 512\. -Required: No - - ** Version ** -The version number\. -Type: Long -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayerVersionsListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayerVersionsListItem) \ No newline at end of file diff --git a/doc_source/API_LayersListItem.md b/doc_source/API_LayersListItem.md deleted file mode 100644 index 76e34d54..00000000 --- a/doc_source/API_LayersListItem.md +++ /dev/null @@ -1,32 +0,0 @@ -# LayersListItem - -Details about an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. - -## Contents - - ** LatestMatchingVersion ** -The newest version of the layer\. -Type: [LayerVersionsListItem](API_LayerVersionsListItem.md) object -Required: No - - ** LayerArn ** -The Amazon Resource Name \(ARN\) of the function layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` -Required: No - - ** LayerName ** -The name of the layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/LayersListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/LayersListItem) \ No newline at end of file diff --git a/doc_source/API_ListAliases.md b/doc_source/API_ListAliases.md deleted file mode 100644 index e785f1fb..00000000 --- a/doc_source/API_ListAliases.md +++ /dev/null @@ -1,111 +0,0 @@ -# ListAliases - -Returns a list of [aliases](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) for a Lambda function\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName/aliases?FunctionVersion=FunctionVersion&Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_ListAliases_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [FunctionVersion](#API_ListAliases_RequestSyntax) ** -Specify a function version to only list aliases that invoke that version\. -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [Marker](#API_ListAliases_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListAliases_RequestSyntax) ** -Limit the number of aliases returned\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Aliases": [ - { - "AliasArn": "string", - "Description": "string", - "FunctionVersion": "string", - "Name": "string", - "RevisionId": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Aliases](#API_ListAliases_ResponseSyntax) ** -A list of aliases\. -Type: Array of [AliasConfiguration](API_AliasConfiguration.md) objects - - ** [NextMarker](#API_ListAliases_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListAliases) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListAliases) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListAliases) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListAliases) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListAliases) \ No newline at end of file diff --git a/doc_source/API_ListCodeSigningConfigs.md b/doc_source/API_ListCodeSigningConfigs.md deleted file mode 100644 index 7e951ff5..00000000 --- a/doc_source/API_ListCodeSigningConfigs.md +++ /dev/null @@ -1,86 +0,0 @@ -# ListCodeSigningConfigs - -Returns a list of [code signing configurations](https://docs.aws.amazon.com/lambda/latest/dg/configuring-codesigning.html)\. A request returns up to 10,000 configurations per call\. You can use the `MaxItems` parameter to return fewer configurations per call\. - -## Request Syntax - -``` -GET /2020-04-22/code-signing-configs/?Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [Marker](#API_ListCodeSigningConfigs_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListCodeSigningConfigs_RequestSyntax) ** -Maximum number of items to return\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CodeSigningConfigs": [ - { - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningConfigArn": "string", - "CodeSigningConfigId": "string", - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string", - "LastModified": "string" - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfigs](#API_ListCodeSigningConfigs_ResponseSyntax) ** -The code signing configurations -Type: Array of [CodeSigningConfig](API_CodeSigningConfig.md) objects - - ** [NextMarker](#API_ListCodeSigningConfigs_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListCodeSigningConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListCodeSigningConfigs) \ No newline at end of file diff --git a/doc_source/API_ListEventSourceMappings.md b/doc_source/API_ListEventSourceMappings.md deleted file mode 100644 index ffb51e45..00000000 --- a/doc_source/API_ListEventSourceMappings.md +++ /dev/null @@ -1,156 +0,0 @@ -# ListEventSourceMappings - -Lists event source mappings\. Specify an `EventSourceArn` to show only event source mappings for a single event source\. - -## Request Syntax - -``` -GET /2015-03-31/event-source-mappings/?EventSourceArn=EventSourceArn&FunctionName=FunctionName&Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [EventSourceArn](#API_ListEventSourceMappings_RequestSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -+ **Amazon Kinesis** \- The ARN of the data stream or a stream consumer\. -+ **Amazon DynamoDB Streams** \- The ARN of the stream\. -+ **Amazon Simple Queue Service** \- The ARN of the queue\. -+ **Amazon Managed Streaming for Apache Kafka** \- The ARN of the cluster\. -+ **Amazon MQ** \- The ARN of the broker\. -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [FunctionName](#API_ListEventSourceMappings_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Version or Alias ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it's limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Marker](#API_ListEventSourceMappings_RequestSyntax) ** -A pagination token returned by a previous call\. - - ** [MaxItems](#API_ListEventSourceMappings_RequestSyntax) ** -The maximum number of event source mappings to return\. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "EventSourceMappings": [ - { - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], - "LastModified": number, - "LastProcessingResult": "string", - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "State": "string", - "StateTransitionReason": "string", - "Topics": [ "string" ], - "TumblingWindowInSeconds": number, - "UUID": "string" - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [EventSourceMappings](#API_ListEventSourceMappings_ResponseSyntax) ** -A list of event source mappings\. -Type: Array of [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) objects - - ** [NextMarker](#API_ListEventSourceMappings_ResponseSyntax) ** -A pagination token that's returned when the response doesn't contain all event source mappings\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListEventSourceMappings) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListEventSourceMappings) \ No newline at end of file diff --git a/doc_source/API_ListFunctionEventInvokeConfigs.md b/doc_source/API_ListFunctionEventInvokeConfigs.md deleted file mode 100644 index 56f281a8..00000000 --- a/doc_source/API_ListFunctionEventInvokeConfigs.md +++ /dev/null @@ -1,110 +0,0 @@ -# ListFunctionEventInvokeConfigs - -Retrieves a list of configurations for asynchronous invocation for a function\. - -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. - -## Request Syntax - -``` -GET /2019-09-25/functions/FunctionName/event-invoke-config/list?Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Marker](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListFunctionEventInvokeConfigs_RequestSyntax) ** -The maximum number of configurations to return\. -Valid Range: Minimum value of 1\. Maximum value of 50\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "FunctionEventInvokeConfigs": [ - { - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "FunctionArn": "string", - "LastModified": number, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [FunctionEventInvokeConfigs](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** -A list of configurations\. -Type: Array of [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) objects - - ** [NextMarker](#API_ListFunctionEventInvokeConfigs_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionEventInvokeConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctionUrlConfigs.md b/doc_source/API_ListFunctionUrlConfigs.md deleted file mode 100644 index 82f48986..00000000 --- a/doc_source/API_ListFunctionUrlConfigs.md +++ /dev/null @@ -1,109 +0,0 @@ -# ListFunctionUrlConfigs - -Returns a list of Lambda function URLs for the specified function\. - -## Request Syntax - -``` -GET /2021-10-31/functions/FunctionName/urls?Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_ListFunctionUrlConfigs_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Marker](#API_ListFunctionUrlConfigs_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListFunctionUrlConfigs_RequestSyntax) ** -The maximum number of function URLs to return in the response\. Note that `ListFunctionUrlConfigs` returns a maximum of 50 items in each response, even if you set the number higher\. -Valid Range: Minimum value of 1\. Maximum value of 50\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "FunctionUrlConfigs": [ - { - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - }, - "CreationTime": "string", - "FunctionArn": "string", - "FunctionUrl": "string", - "LastModifiedTime": "string" - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [FunctionUrlConfigs](#API_ListFunctionUrlConfigs_ResponseSyntax) ** -A list of function URL configurations\. -Type: Array of [FunctionUrlConfig](API_FunctionUrlConfig.md) objects - - ** [NextMarker](#API_ListFunctionUrlConfigs_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionUrlConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionUrlConfigs) \ No newline at end of file diff --git a/doc_source/API_ListFunctions.md b/doc_source/API_ListFunctions.md deleted file mode 100644 index e8c4e4b5..00000000 --- a/doc_source/API_ListFunctions.md +++ /dev/null @@ -1,166 +0,0 @@ -# ListFunctions - -Returns a list of Lambda functions, with the version\-specific configuration of each\. Lambda returns up to 50 functions per call\. - -Set `FunctionVersion` to `ALL` to include all published versions of each function in addition to the unpublished version\. - -**Note** -The `ListFunctions` action returns a subset of the [FunctionConfiguration](API_FunctionConfiguration.md) fields\. To get the additional fields \(State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode\) for a function or version, use [GetFunction](API_GetFunction.md)\. - -## Request Syntax - -``` -GET /2015-03-31/functions/?FunctionVersion=FunctionVersion&Marker=Marker&MasterRegion=MasterRegion&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionVersion](#API_ListFunctions_RequestSyntax) ** -Set to `ALL` to include entries for all published versions of each function\. -Valid Values:` ALL` - - ** [Marker](#API_ListFunctions_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MasterRegion](#API_ListFunctions_RequestSyntax) ** -For Lambda@Edge functions, the AWS Region of the master function\. For example, `us-east-1` filters the list of functions to only include Lambda@Edge functions replicated from a master function in US East \(N\. Virginia\)\. If specified, you must set `FunctionVersion` to `ALL`\. -Pattern: `ALL|[a-z]{2}(-gov)?-[a-z]+-\d{1}` - - ** [MaxItems](#API_ListFunctions_RequestSyntax) ** -The maximum number of functions to return in the response\. Note that `ListFunctions` returns a maximum of 50 items in each response, even if you set the number higher\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Functions": [ - { - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Functions](#API_ListFunctions_ResponseSyntax) ** -A list of Lambda functions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects - - ** [NextMarker](#API_ListFunctions_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctions) \ No newline at end of file diff --git a/doc_source/API_ListFunctionsByCodeSigningConfig.md b/doc_source/API_ListFunctionsByCodeSigningConfig.md deleted file mode 100644 index 60377544..00000000 --- a/doc_source/API_ListFunctionsByCodeSigningConfig.md +++ /dev/null @@ -1,84 +0,0 @@ -# ListFunctionsByCodeSigningConfig - -List the functions that use the specified code signing configuration\. You can use this method prior to deleting a code signing configuration, to verify that no functions are using it\. - -## Request Syntax - -``` -GET /2020-04-22/code-signing-configs/CodeSigningConfigArn/functions?Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CodeSigningConfigArn](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - - ** [Marker](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListFunctionsByCodeSigningConfig_RequestSyntax) ** -Maximum number of items to return\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "FunctionArns": [ "string" ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [FunctionArns](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** -The function ARNs\. -Type: Array of strings -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [NextMarker](#API_ListFunctionsByCodeSigningConfig_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListFunctionsByCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_ListLayerVersions.md b/doc_source/API_ListLayerVersions.md deleted file mode 100644 index 2a6bf434..00000000 --- a/doc_source/API_ListLayerVersions.md +++ /dev/null @@ -1,105 +0,0 @@ -# ListLayerVersions - -Lists the versions of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. Versions that have been deleted aren't listed\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only versions that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layer versions that are compatible with that architecture\. - -## Request Syntax - -``` -GET /2018-10-31/layers/LayerName/versions?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CompatibleArchitecture](#API_ListLayerVersions_RequestSyntax) ** -The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Valid Values:` x86_64 | arm64` - - ** [CompatibleRuntime](#API_ListLayerVersions_RequestSyntax) ** -A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [LayerName](#API_ListLayerVersions_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [Marker](#API_ListLayerVersions_RequestSyntax) ** -A pagination token returned by a previous call\. - - ** [MaxItems](#API_ListLayerVersions_RequestSyntax) ** -The maximum number of versions to return\. -Valid Range: Minimum value of 1\. Maximum value of 50\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "LayerVersions": [ - { - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "CreatedDate": "string", - "Description": "string", - "LayerVersionArn": "string", - "LicenseInfo": "string", - "Version": number - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [LayerVersions](#API_ListLayerVersions_ResponseSyntax) ** -A list of versions\. -Type: Array of [LayerVersionsListItem](API_LayerVersionsListItem.md) objects - - ** [NextMarker](#API_ListLayerVersions_ResponseSyntax) ** -A pagination token returned when the response doesn't contain all versions\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayerVersions) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayerVersions) \ No newline at end of file diff --git a/doc_source/API_ListLayers.md b/doc_source/API_ListLayers.md deleted file mode 100644 index 6f0e9aaa..00000000 --- a/doc_source/API_ListLayers.md +++ /dev/null @@ -1,99 +0,0 @@ -# ListLayers - -Lists [AWS Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and shows information about the latest version of each\. Specify a [runtime identifier](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) to list only layers that indicate that they're compatible with that runtime\. Specify a compatible architecture to include only layers that are compatible with that [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. - -## Request Syntax - -``` -GET /2018-10-31/layers?CompatibleArchitecture=CompatibleArchitecture&CompatibleRuntime=CompatibleRuntime&Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CompatibleArchitecture](#API_ListLayers_RequestSyntax) ** -The compatible [instruction set architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Valid Values:` x86_64 | arm64` - - ** [CompatibleRuntime](#API_ListLayers_RequestSyntax) ** -A runtime identifier\. For example, `go1.x`\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [Marker](#API_ListLayers_RequestSyntax) ** -A pagination token returned by a previous call\. - - ** [MaxItems](#API_ListLayers_RequestSyntax) ** -The maximum number of layers to return\. -Valid Range: Minimum value of 1\. Maximum value of 50\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Layers": [ - { - "LatestMatchingVersion": { - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "CreatedDate": "string", - "Description": "string", - "LayerVersionArn": "string", - "LicenseInfo": "string", - "Version": number - }, - "LayerArn": "string", - "LayerName": "string" - } - ], - "NextMarker": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Layers](#API_ListLayers_ResponseSyntax) ** -A list of function layers\. -Type: Array of [LayersListItem](API_LayersListItem.md) objects - - ** [NextMarker](#API_ListLayers_ResponseSyntax) ** -A pagination token returned when the response doesn't contain all layers\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListLayers) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListLayers) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListLayers) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListLayers) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListLayers) \ No newline at end of file diff --git a/doc_source/API_ListProvisionedConcurrencyConfigs.md b/doc_source/API_ListProvisionedConcurrencyConfigs.md deleted file mode 100644 index e05f6c95..00000000 --- a/doc_source/API_ListProvisionedConcurrencyConfigs.md +++ /dev/null @@ -1,103 +0,0 @@ -# ListProvisionedConcurrencyConfigs - -Retrieves a list of provisioned concurrency configurations for a function\. - -## Request Syntax - -``` -GET /2019-09-30/functions/FunctionName/provisioned-concurrency?List=ALL&Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Marker](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListProvisionedConcurrencyConfigs_RequestSyntax) ** -Specify a number to limit the number of configurations returned\. -Valid Range: Minimum value of 1\. Maximum value of 50\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "NextMarker": "string", - "ProvisionedConcurrencyConfigs": [ - { - "AllocatedProvisionedConcurrentExecutions": number, - "AvailableProvisionedConcurrentExecutions": number, - "FunctionArn": "string", - "LastModified": "string", - "RequestedProvisionedConcurrentExecutions": number, - "Status": "string", - "StatusReason": "string" - } - ] -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [NextMarker](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - - ** [ProvisionedConcurrencyConfigs](#API_ListProvisionedConcurrencyConfigs_ResponseSyntax) ** -A list of provisioned concurrency configurations\. -Type: Array of [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) objects - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListProvisionedConcurrencyConfigs) \ No newline at end of file diff --git a/doc_source/API_ListTags.md b/doc_source/API_ListTags.md deleted file mode 100644 index bf96edde..00000000 --- a/doc_source/API_ListTags.md +++ /dev/null @@ -1,76 +0,0 @@ -# ListTags - -Returns a function's [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)\. You can also view tags with [GetFunction](API_GetFunction.md)\. - -## Request Syntax - -``` -GET /2017-03-31/tags/ARN HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [ARN](#API_ListTags_RequestSyntax) ** -The function's Amazon Resource Name \(ARN\)\. Note: Lambda does not support adding tags to aliases or versions\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Tags": { - "string" : "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Tags](#API_ListTags_ResponseSyntax) ** -The function's tags\. -Type: String to string map - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListTags) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListTags) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListTags) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListTags) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListTags) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListTags) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListTags) \ No newline at end of file diff --git a/doc_source/API_ListVersionsByFunction.md b/doc_source/API_ListVersionsByFunction.md deleted file mode 100644 index d428616b..00000000 --- a/doc_source/API_ListVersionsByFunction.md +++ /dev/null @@ -1,169 +0,0 @@ -# ListVersionsByFunction - -Returns a list of [versions](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html), with the version\-specific configuration of each\. Lambda returns up to 50 versions per call\. - -## Request Syntax - -``` -GET /2015-03-31/functions/FunctionName/versions?Marker=Marker&MaxItems=MaxItems HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_ListVersionsByFunction_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Marker](#API_ListVersionsByFunction_RequestSyntax) ** -Specify the pagination token that's returned by a previous request to retrieve the next page of results\. - - ** [MaxItems](#API_ListVersionsByFunction_RequestSyntax) ** -The maximum number of versions to return\. Note that `ListVersionsByFunction` returns a maximum of 50 items in each response, even if you set the number higher\. -Valid Range: Minimum value of 1\. Maximum value of 10000\. - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "NextMarker": "string", - "Versions": [ - { - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } - } - ] -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [NextMarker](#API_ListVersionsByFunction_ResponseSyntax) ** -The pagination token that's included if more results are available\. -Type: String - - ** [Versions](#API_ListVersionsByFunction_ResponseSyntax) ** -A list of Lambda function versions\. -Type: Array of [FunctionConfiguration](API_FunctionConfiguration.md) objects - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListVersionsByFunction) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ListVersionsByFunction) \ No newline at end of file diff --git a/doc_source/API_OnFailure.md b/doc_source/API_OnFailure.md deleted file mode 100644 index 6bb084a9..00000000 --- a/doc_source/API_OnFailure.md +++ /dev/null @@ -1,20 +0,0 @@ -# OnFailure - -A destination for events that failed processing\. - -## Contents - - ** Destination ** -The Amazon Resource Name \(ARN\) of the destination resource\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 350\. -Pattern: `^$|arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnFailure) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnFailure) \ No newline at end of file diff --git a/doc_source/API_OnSuccess.md b/doc_source/API_OnSuccess.md deleted file mode 100644 index 7dd22ba6..00000000 --- a/doc_source/API_OnSuccess.md +++ /dev/null @@ -1,20 +0,0 @@ -# OnSuccess - -A destination for events that were processed successfully\. - -## Contents - - ** Destination ** -The Amazon Resource Name \(ARN\) of the destination resource\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 350\. -Pattern: `^$|arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/OnSuccess) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/OnSuccess) \ No newline at end of file diff --git a/doc_source/API_Operations.md b/doc_source/API_Operations.md deleted file mode 100644 index 2fa8ad5f..00000000 --- a/doc_source/API_Operations.md +++ /dev/null @@ -1,66 +0,0 @@ -# Actions - -The following actions are supported: -+ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) -+ [AddPermission](API_AddPermission.md) -+ [CreateAlias](API_CreateAlias.md) -+ [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [CreateFunction](API_CreateFunction.md) -+ [CreateFunctionUrlConfig](API_CreateFunctionUrlConfig.md) -+ [DeleteAlias](API_DeleteAlias.md) -+ [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -+ [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) -+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) -+ [DeleteFunctionUrlConfig](API_DeleteFunctionUrlConfig.md) -+ [DeleteLayerVersion](API_DeleteLayerVersion.md) -+ [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) -+ [GetAccountSettings](API_GetAccountSettings.md) -+ [GetAlias](API_GetAlias.md) -+ [GetCodeSigningConfig](API_GetCodeSigningConfig.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [GetFunction](API_GetFunction.md) -+ [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) -+ [GetFunctionConcurrency](API_GetFunctionConcurrency.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) -+ [GetFunctionUrlConfig](API_GetFunctionUrlConfig.md) -+ [GetLayerVersion](API_GetLayerVersion.md) -+ [GetLayerVersionByArn](API_GetLayerVersionByArn.md) -+ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) -+ [GetPolicy](API_GetPolicy.md) -+ [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) -+ [Invoke](API_Invoke.md) -+ [InvokeAsync](API_InvokeAsync.md) -+ [ListAliases](API_ListAliases.md) -+ [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) -+ [ListFunctions](API_ListFunctions.md) -+ [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) -+ [ListFunctionUrlConfigs](API_ListFunctionUrlConfigs.md) -+ [ListLayers](API_ListLayers.md) -+ [ListLayerVersions](API_ListLayerVersions.md) -+ [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) -+ [ListTags](API_ListTags.md) -+ [ListVersionsByFunction](API_ListVersionsByFunction.md) -+ [PublishLayerVersion](API_PublishLayerVersion.md) -+ [PublishVersion](API_PublishVersion.md) -+ [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) -+ [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) -+ [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) -+ [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) -+ [RemovePermission](API_RemovePermission.md) -+ [TagResource](API_TagResource.md) -+ [UntagResource](API_UntagResource.md) -+ [UpdateAlias](API_UpdateAlias.md) -+ [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) -+ [UpdateFunctionUrlConfig](API_UpdateFunctionUrlConfig.md) \ No newline at end of file diff --git a/doc_source/API_ProvisionedConcurrencyConfigListItem.md b/doc_source/API_ProvisionedConcurrencyConfigListItem.md deleted file mode 100644 index a3fa85da..00000000 --- a/doc_source/API_ProvisionedConcurrencyConfigListItem.md +++ /dev/null @@ -1,53 +0,0 @@ -# ProvisionedConcurrencyConfigListItem - -Details about the provisioned concurrency configuration for a function alias or version\. - -## Contents - - ** AllocatedProvisionedConcurrentExecutions ** -The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. -Type: Integer -Valid Range: Minimum value of 0\. -Required: No - - ** AvailableProvisionedConcurrentExecutions ** -The amount of provisioned concurrency available\. -Type: Integer -Valid Range: Minimum value of 0\. -Required: No - - ** FunctionArn ** -The Amazon Resource Name \(ARN\) of the alias or version\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** LastModified ** -The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. -Type: String -Required: No - - ** RequestedProvisionedConcurrentExecutions ** -The amount of provisioned concurrency requested\. -Type: Integer -Valid Range: Minimum value of 1\. -Required: No - - ** Status ** -The status of the allocation process\. -Type: String -Valid Values:` IN_PROGRESS | READY | FAILED` -Required: No - - ** StatusReason ** -For failed allocations, the reason that provisioned concurrency could not be allocated\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/ProvisionedConcurrencyConfigListItem) \ No newline at end of file diff --git a/doc_source/API_PublishLayerVersion.md b/doc_source/API_PublishLayerVersion.md deleted file mode 100644 index 2f0a5b46..00000000 --- a/doc_source/API_PublishLayerVersion.md +++ /dev/null @@ -1,185 +0,0 @@ -# PublishLayerVersion - -Creates an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) from a ZIP archive\. Each time you call `PublishLayerVersion` with the same layer name, a new version is created\. - -Add layers to your function with [CreateFunction](API_CreateFunction.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. - -## Request Syntax - -``` -POST /2018-10-31/layers/LayerName/versions HTTP/1.1 -Content-type: application/json - -{ - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "Content": { - "S3Bucket": "string", - "S3Key": "string", - "S3ObjectVersion": "string", - "ZipFile": blob - }, - "Description": "string", - "LicenseInfo": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_PublishLayerVersion_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [CompatibleArchitectures](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Type: Array of strings -Array Members: Maximum number of 2 items\. -Valid Values:` x86_64 | arm64` -Required: No - - ** [CompatibleRuntimes](#API_PublishLayerVersion_RequestSyntax) ** -A list of compatible [function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Used for filtering with [ListLayers](API_ListLayers.md) and [ListLayerVersions](API_ListLayerVersions.md)\. -Type: Array of strings -Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - ** [Content](#API_PublishLayerVersion_RequestSyntax) ** -The function layer archive\. -Type: [LayerVersionContentInput](API_LayerVersionContentInput.md) object -Required: Yes - - ** [Description](#API_PublishLayerVersion_RequestSyntax) ** -The description of the version\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [LicenseInfo](#API_PublishLayerVersion_RequestSyntax) ** -The layer's software license\. It can be any of the following: -+ An [SPDX license identifier](https://spdx.org/licenses/)\. For example, `MIT`\. -+ The URL of a license hosted on the internet\. For example, `https://opensource.org/licenses/MIT`\. -+ The full text of the license\. -Type: String -Length Constraints: Maximum length of 512\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "CompatibleArchitectures": [ "string" ], - "CompatibleRuntimes": [ "string" ], - "Content": { - "CodeSha256": "string", - "CodeSize": number, - "Location": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - }, - "CreatedDate": "string", - "Description": "string", - "LayerArn": "string", - "LayerVersionArn": "string", - "LicenseInfo": "string", - "Version": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [CompatibleArchitectures](#API_PublishLayerVersion_ResponseSyntax) ** -A list of compatible [instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)\. -Type: Array of strings -Array Members: Maximum number of 2 items\. -Valid Values:` x86_64 | arm64` - - ** [CompatibleRuntimes](#API_PublishLayerVersion_ResponseSyntax) ** -The layer's compatible runtimes\. -Type: Array of strings -Array Members: Maximum number of 15 items\. -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [Content](#API_PublishLayerVersion_ResponseSyntax) ** -Details about the layer version\. -Type: [LayerVersionContentOutput](API_LayerVersionContentOutput.md) object - - ** [CreatedDate](#API_PublishLayerVersion_ResponseSyntax) ** -The date that the layer version was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [Description](#API_PublishLayerVersion_ResponseSyntax) ** -The description of the version\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [LayerArn](#API_PublishLayerVersion_ResponseSyntax) ** -The ARN of the layer\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+` - - ** [LayerVersionArn](#API_PublishLayerVersion_ResponseSyntax) ** -The ARN of the layer version\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` - - ** [LicenseInfo](#API_PublishLayerVersion_ResponseSyntax) ** -The layer's software license\. -Type: String -Length Constraints: Maximum length of 512\. - - ** [Version](#API_PublishLayerVersion_ResponseSyntax) ** -The version number\. -Type: Long - -## Errors - - ** CodeStorageExceededException ** -You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishLayerVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishLayerVersion) \ No newline at end of file diff --git a/doc_source/API_PublishVersion.md b/doc_source/API_PublishVersion.md deleted file mode 100644 index 15c91663..00000000 --- a/doc_source/API_PublishVersion.md +++ /dev/null @@ -1,344 +0,0 @@ -# PublishVersion - -Creates a [version](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) from the current code and configuration of a function\. Use versions to create a snapshot of your function code and configuration that doesn't change\. - - AWS Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version\. Use [UpdateFunctionCode](API_UpdateFunctionCode.md) or [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) to update the function before publishing a version\. - -Clients can invoke versions directly or with an alias\. To create an alias, use [CreateAlias](API_CreateAlias.md)\. - -## Request Syntax - -``` -POST /2015-03-31/functions/FunctionName/versions HTTP/1.1 -Content-type: application/json - -{ - "CodeSha256": "string", - "Description": "string", - "RevisionId": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_PublishVersion_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [CodeSha256](#API_PublishVersion_RequestSyntax) ** -Only publish a version if the hash value matches the value that's specified\. Use this option to avoid publishing a version if the function code has changed since you last updated it\. You can get the hash for the version that you uploaded from the output of [UpdateFunctionCode](API_UpdateFunctionCode.md)\. -Type: String -Required: No - - ** [Description](#API_PublishVersion_RequestSyntax) ** -A description for the version to override the description in the function configuration\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [RevisionId](#API_PublishVersion_RequestSyntax) ** -Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid publishing a version if the function configuration has changed since you last updated it\. -Type: String -Required: No - -## Response Syntax - -``` -HTTP/1.1 201 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 201 response\. - -The following data is returned in JSON format by the service\. - - ** [Architectures](#API_PublishVersion_ResponseSyntax) ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` - - ** [CodeSha256](#API_PublishVersion_ResponseSyntax) ** -The SHA256 hash of the function's deployment package\. -Type: String - - ** [CodeSize](#API_PublishVersion_ResponseSyntax) ** -The size of the function's deployment package, in bytes\. -Type: Long - - ** [DeadLetterConfig](#API_PublishVersion_ResponseSyntax) ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - - ** [Description](#API_PublishVersion_ResponseSyntax) ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [Environment](#API_PublishVersion_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - - ** [EphemeralStorage](#API_PublishVersion_ResponseSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object - - ** [FileSystemConfigs](#API_PublishVersion_ResponseSyntax) ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. - - ** [FunctionArn](#API_PublishVersion_ResponseSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionName](#API_PublishVersion_ResponseSyntax) ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Handler](#API_PublishVersion_ResponseSyntax) ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` - - ** [ImageConfigResponse](#API_PublishVersion_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - - ** [KMSKeyArn](#API_PublishVersion_ResponseSyntax) ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - - ** [LastModified](#API_PublishVersion_ResponseSyntax) ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [LastUpdateStatus](#API_PublishVersion_ResponseSyntax) ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` - - ** [LastUpdateStatusReason](#API_PublishVersion_ResponseSyntax) ** -The reason for the last update that was performed on the function\. -Type: String - - ** [LastUpdateStatusReasonCode](#API_PublishVersion_ResponseSyntax) ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Layers](#API_PublishVersion_ResponseSyntax) ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects - - ** [MasterArn](#API_PublishVersion_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [MemorySize](#API_PublishVersion_ResponseSyntax) ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_PublishVersion_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` - - ** [RevisionId](#API_PublishVersion_ResponseSyntax) ** -The latest updated revision of the function or alias\. -Type: String - - ** [Role](#API_PublishVersion_ResponseSyntax) ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - - ** [Runtime](#API_PublishVersion_ResponseSyntax) ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_PublishVersion_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [State](#API_PublishVersion_ResponseSyntax) ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` - - ** [StateReason](#API_PublishVersion_ResponseSyntax) ** -The reason for the function's current state\. -Type: String - - ** [StateReasonCode](#API_PublishVersion_ResponseSyntax) ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Timeout](#API_PublishVersion_ResponseSyntax) ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [TracingConfig](#API_PublishVersion_ResponseSyntax) ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - - ** [Version](#API_PublishVersion_ResponseSyntax) ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [VpcConfig](#API_PublishVersion_ResponseSyntax) ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object - -## Errors - - ** CodeStorageExceededException ** -You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PublishVersion) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PublishVersion) \ No newline at end of file diff --git a/doc_source/API_PutFunctionCodeSigningConfig.md b/doc_source/API_PutFunctionCodeSigningConfig.md deleted file mode 100644 index c2cf8b73..00000000 --- a/doc_source/API_PutFunctionCodeSigningConfig.md +++ /dev/null @@ -1,116 +0,0 @@ -# PutFunctionCodeSigningConfig - -Update the code signing configuration for the function\. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function\. - -## Request Syntax - -``` -PUT /2020-06-30/functions/FunctionName/code-signing-config HTTP/1.1 -Content-type: application/json - -{ - "CodeSigningConfigArn": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_RequestSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CodeSigningConfigArn": "string", - "FunctionName": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfigArn](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Type: String -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` - - ** [FunctionName](#API_PutFunctionCodeSigningConfig_ResponseSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - -## Errors - - ** CodeSigningConfigNotFoundException ** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_PutFunctionConcurrency.md b/doc_source/API_PutFunctionConcurrency.md deleted file mode 100644 index 22521e8a..00000000 --- a/doc_source/API_PutFunctionConcurrency.md +++ /dev/null @@ -1,101 +0,0 @@ -# PutFunctionConcurrency - -Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level\. - -Concurrency settings apply to the function as a whole, including all published versions and the unpublished version\. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level\. Use [GetFunction](API_GetFunction.md) to see the current setting for a function\. - -Use [GetAccountSettings](API_GetAccountSettings.md) to see your Regional concurrency limit\. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per\-function limit\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)\. - -## Request Syntax - -``` -PUT /2017-10-31/functions/FunctionName/concurrency HTTP/1.1 -Content-type: application/json - -{ - "ReservedConcurrentExecutions": number -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_PutFunctionConcurrency_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_RequestSyntax) ** -The number of simultaneous executions to reserve for the function\. -Type: Integer -Valid Range: Minimum value of 0\. -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "ReservedConcurrentExecutions": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [ReservedConcurrentExecutions](#API_PutFunctionConcurrency_ResponseSyntax) ** -The number of concurrent executions that are reserved for this function\. For more information, see [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. -Type: Integer -Valid Range: Minimum value of 0\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionConcurrency) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionConcurrency) \ No newline at end of file diff --git a/doc_source/API_PutFunctionEventInvokeConfig.md b/doc_source/API_PutFunctionEventInvokeConfig.md deleted file mode 100644 index 48345d0c..00000000 --- a/doc_source/API_PutFunctionEventInvokeConfig.md +++ /dev/null @@ -1,167 +0,0 @@ -# PutFunctionEventInvokeConfig - -Configures options for [asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) on a function, version, or alias\. If a configuration already exists for a function, version, or alias, this operation overwrites it\. If you exclude any settings, they are removed\. To set one option without affecting existing settings for other options, use [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md)\. - -By default, Lambda retries an asynchronous invocation twice if the function returns an error\. It retains events in a queue for up to six hours\. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it\. To retain discarded events, configure a dead\-letter queue with [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. - -To send an invocation record to a queue, topic, function, or event bus, specify a [destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)\. You can configure separate destinations for successful invocations \(on\-success\) and events that fail all processing attempts \(on\-failure\)\. You can configure destinations in addition to or instead of a dead\-letter queue\. - -## Request Syntax - -``` -PUT /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** -A version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request accepts the following data in JSON format\. - - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. -Required: No - - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_RequestSyntax) ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "FunctionArn": "string", - "LastModified": number, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [DestinationConfig](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [FunctionArn](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [LastModified](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** -The date and time that the configuration was last updated, in Unix time seconds\. -Type: Timestamp - - ** [MaximumEventAgeInSeconds](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. - - ** [MaximumRetryAttempts](#API_PutFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_PutProvisionedConcurrencyConfig.md b/doc_source/API_PutProvisionedConcurrencyConfig.md deleted file mode 100644 index af3f197d..00000000 --- a/doc_source/API_PutProvisionedConcurrencyConfig.md +++ /dev/null @@ -1,131 +0,0 @@ -# PutProvisionedConcurrencyConfig - -Adds a provisioned concurrency configuration to a function's alias or version\. - -## Request Syntax - -``` -PUT /2019-09-30/functions/FunctionName/provisioned-concurrency?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "ProvisionedConcurrentExecutions": number -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** -The version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [ProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_RequestSyntax) ** -The amount of provisioned concurrency to allocate for the version or alias\. -Type: Integer -Valid Range: Minimum value of 1\. -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 202 -Content-type: application/json - -{ - "AllocatedProvisionedConcurrentExecutions": number, - "AvailableProvisionedConcurrentExecutions": number, - "LastModified": "string", - "RequestedProvisionedConcurrentExecutions": number, - "Status": "string", - "StatusReason": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 202 response\. - -The following data is returned in JSON format by the service\. - - ** [AllocatedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency allocated\. When a weighted alias is used during linear and canary deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function versions\. -Type: Integer -Valid Range: Minimum value of 0\. - - ** [AvailableProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency available\. -Type: Integer -Valid Range: Minimum value of 0\. - - ** [LastModified](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The date and time that a user last updated the configuration, in [ISO 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)\. -Type: String - - ** [RequestedProvisionedConcurrentExecutions](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The amount of provisioned concurrency requested\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [Status](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -The status of the allocation process\. -Type: String -Valid Values:` IN_PROGRESS | READY | FAILED` - - ** [StatusReason](#API_PutProvisionedConcurrencyConfig_ResponseSyntax) ** -For failed allocations, the reason that provisioned concurrency could not be allocated\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/PutProvisionedConcurrencyConfig) \ No newline at end of file diff --git a/doc_source/API_Reference.md b/doc_source/API_Reference.md deleted file mode 100644 index 23fef105..00000000 --- a/doc_source/API_Reference.md +++ /dev/null @@ -1,26 +0,0 @@ -# API reference - -This section contains the AWS Lambda API Reference documentation\. When making the API calls, you will need to authenticate your request by providing a signature\. AWS Lambda supports signature version 4\. For more information, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *Amazon Web Services General Reference*\. - -For an overview of the service, see [What is AWS Lambda?](welcome.md)\. - -You can use the AWS CLI to explore the AWS Lambda API\. This guide provides several tutorials that use the AWS CLI\. - -**Topics** -+ [Actions](API_Operations.md) -+ [Data Types](API_Types.md) - -## Certificate errors when using an SDK - -Because AWS SDKs use the CA certificates from your computer, changes to the certificates on the AWS servers can cause connection failures when you attempt to use an SDK\. You can prevent these failures by keeping your computer's CA certificates and operating system up\-to\-date\. If you encounter this issue in a corporate environment and do not manage your own computer, you might need to ask an administrator to assist with the update process\. The following list shows minimum operating system and Java versions: -+ Microsoft Windows versions that have updates from January 2005 or later installed contain at least one of the required CAs in their trust list\. -+ Mac OS X 10\.4 with Java for Mac OS X 10\.4 Release 5 \(February 2007\), Mac OS X 10\.5 \(October 2007\), and later versions contain at least one of the required CAs in their trust list\. -+ Red Hat Enterprise Linux 5 \(March 2007\), 6, and 7 and CentOS 5, 6, and 7 all contain at least one of the required CAs in their default trusted CA list\. -+ Java 1\.4\.2\_12 \(May 2006\), 5 Update 2 \(March 2005\), and all later versions, including Java 6 \(December 2006\), 7, and 8, contain at least one of the required CAs in their default trusted CA list\. - -When accessing the AWS Lambda management console or AWS Lambda API endpoints, whether through browsers or programmatically, you will need to ensure your client machines support any of the following CAs: -+ Amazon Root CA 1 -+ Starfield Services Root Certificate Authority \- G2 -+ Starfield Class 2 Certification Authority - -Root certificates from the first two authorities are available from [Amazon trust services](https://www.amazontrust.com/repository/), but keeping your computer up\-to\-date is the more straightforward solution\. To learn more about ACM\-provided certificates, see [AWS Certificate Manager FAQs\.](https://aws.amazon.com/certificate-manager/faqs/#certificates) \ No newline at end of file diff --git a/doc_source/API_RemoveLayerVersionPermission.md b/doc_source/API_RemoveLayerVersionPermission.md deleted file mode 100644 index 8c1673de..00000000 --- a/doc_source/API_RemoveLayerVersionPermission.md +++ /dev/null @@ -1,81 +0,0 @@ -# RemoveLayerVersionPermission - -Removes a statement from the permissions policy for a version of an [AWS Lambda layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. For more information, see [AddLayerVersionPermission](API_AddLayerVersionPermission.md)\. - -## Request Syntax - -``` -DELETE /2018-10-31/layers/LayerName/versions/VersionNumber/policy/StatementId?RevisionId=RevisionId HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [LayerName](#API_RemoveLayerVersionPermission_RequestSyntax) ** -The name or Amazon Resource Name \(ARN\) of the layer\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+` -Required: Yes - - ** [RevisionId](#API_RemoveLayerVersionPermission_RequestSyntax) ** -Only update the policy if the revision ID matches the ID specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - - ** [StatementId](#API_RemoveLayerVersionPermission_RequestSyntax) ** -The identifier that was specified when the statement was added\. -Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_]+)` -Required: Yes - - ** [VersionNumber](#API_RemoveLayerVersionPermission_RequestSyntax) ** -The version number\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemoveLayerVersionPermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemoveLayerVersionPermission) \ No newline at end of file diff --git a/doc_source/API_RemovePermission.md b/doc_source/API_RemovePermission.md deleted file mode 100644 index 58c33758..00000000 --- a/doc_source/API_RemovePermission.md +++ /dev/null @@ -1,88 +0,0 @@ -# RemovePermission - -Revokes function\-use permission from an AWS service or another account\. You can get the ID of the statement from the output of [GetPolicy](API_GetPolicy.md)\. - -## Request Syntax - -``` -DELETE /2015-03-31/functions/FunctionName/policy/StatementId?Qualifier=Qualifier&RevisionId=RevisionId HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_RemovePermission_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_RemovePermission_RequestSyntax) ** -Specify a version or alias to remove permissions from a published version of the function\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - - ** [RevisionId](#API_RemovePermission_RequestSyntax) ** -Only update the policy if the revision ID matches the ID that's specified\. Use this option to avoid modifying a policy that has changed since you last read it\. - - ** [StatementId](#API_RemovePermission_RequestSyntax) ** -Statement ID of the permission to remove\. -Length Constraints: Minimum length of 1\. Maximum length of 100\. -Pattern: `([a-zA-Z0-9-_.]+)` -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/RemovePermission) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/RemovePermission) \ No newline at end of file diff --git a/doc_source/API_SelfManagedEventSource.md b/doc_source/API_SelfManagedEventSource.md deleted file mode 100644 index 04777747..00000000 --- a/doc_source/API_SelfManagedEventSource.md +++ /dev/null @@ -1,23 +0,0 @@ -# SelfManagedEventSource - -The self\-managed Apache Kafka cluster for your event source\. - -## Contents - - ** Endpoints ** -The list of bootstrap servers for your Kafka brokers in the following format: `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`\. -Type: String to array of strings map -Map Entries: Maximum number of 2 items\. -Valid Keys:` KAFKA_BOOTSTRAP_SERVERS` -Array Members: Minimum number of 1 item\. Maximum number of 10 items\. -Length Constraints: Minimum length of 1\. Maximum length of 300\. -Pattern: `^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]):[0-9]{1,5}` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedEventSource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedEventSource) \ No newline at end of file diff --git a/doc_source/API_SelfManagedKafkaEventSourceConfig.md b/doc_source/API_SelfManagedKafkaEventSourceConfig.md deleted file mode 100644 index c3e83808..00000000 --- a/doc_source/API_SelfManagedKafkaEventSourceConfig.md +++ /dev/null @@ -1,20 +0,0 @@ -# SelfManagedKafkaEventSourceConfig - -Specific configuration settings for a self\-managed Apache Kafka event source\. - -## Contents - - ** ConsumerGroupId ** -The identifier for the Kafka consumer group to join\. The consumer group ID must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. For more information, see [Customizable consumer group ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 200\. -Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SelfManagedKafkaEventSourceConfig) \ No newline at end of file diff --git a/doc_source/API_SourceAccessConfiguration.md b/doc_source/API_SourceAccessConfiguration.md deleted file mode 100644 index f943784e..00000000 --- a/doc_source/API_SourceAccessConfiguration.md +++ /dev/null @@ -1,35 +0,0 @@ -# SourceAccessConfiguration - -To secure and define access to your event source, you can specify the authentication protocol, VPC components, or virtual host\. - -## Contents - - ** Type ** -The type of authentication protocol, VPC components, or virtual host for your event source\. For example: `"Type":"SASL_SCRAM_512_AUTH"`\. -+ `BASIC_AUTH` \- \(Amazon MQ\) The AWS Secrets Manager secret that stores your broker credentials\. -+ `BASIC_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL/PLAIN authentication of your Apache Kafka brokers\. -+ `VPC_SUBNET` \- \(Self\-managed Apache Kafka\) The subnets associated with your VPC\. Lambda connects to these subnets to fetch data from your self\-managed Apache Kafka cluster\. -+ `VPC_SECURITY_GROUP` \- \(Self\-managed Apache Kafka\) The VPC security group used to manage access to your self\-managed Apache Kafka brokers\. -+ `SASL_SCRAM_256_AUTH` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL SCRAM\-256 authentication of your self\-managed Apache Kafka brokers\. -+ `SASL_SCRAM_512_AUTH` \- \(Amazon MSK, Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key used for SASL SCRAM\-512 authentication of your self\-managed Apache Kafka brokers\. -+ `VIRTUAL_HOST` \- \(RabbitMQ\) The name of the virtual host in your RabbitMQ broker\. Lambda uses this RabbitMQ host as the event source\. This property cannot be specified in an UpdateEventSourceMapping API call\. -+ `CLIENT_CERTIFICATE_TLS_AUTH` \- \(Amazon MSK, self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the certificate chain \(X\.509 PEM\), private key \(PKCS\#8 PEM\), and private key password \(optional\) used for mutual TLS authentication of your MSK/Apache Kafka brokers\. -+ `SERVER_ROOT_CA_CERTIFICATE` \- \(Self\-managed Apache Kafka\) The Secrets Manager ARN of your secret key containing the root CA certificate \(X\.509 PEM\) used for TLS encryption of your Apache Kafka brokers\. -Type: String -Valid Values:` BASIC_AUTH | VPC_SUBNET | VPC_SECURITY_GROUP | SASL_SCRAM_512_AUTH | SASL_SCRAM_256_AUTH | VIRTUAL_HOST | CLIENT_CERTIFICATE_TLS_AUTH | SERVER_ROOT_CA_CERTIFICATE` -Required: No - - ** URI ** -The value for your chosen configuration in `Type`\. For example: `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 200\. -Pattern: `[a-zA-Z0-9-\/*:_+=.@-]*` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/SourceAccessConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/SourceAccessConfiguration) \ No newline at end of file diff --git a/doc_source/API_TagResource.md b/doc_source/API_TagResource.md deleted file mode 100644 index 0104ba08..00000000 --- a/doc_source/API_TagResource.md +++ /dev/null @@ -1,79 +0,0 @@ -# TagResource - -Adds [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to a function\. - -## Request Syntax - -``` -POST /2017-03-31/tags/ARN HTTP/1.1 -Content-type: application/json - -{ - "Tags": { - "string" : "string" - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [ARN](#API_TagResource_RequestSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Tags](#API_TagResource_RequestSyntax) ** -A list of tags to apply to the function\. -Type: String to string map -Required: Yes - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/TagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/TagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/TagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TagResource) \ No newline at end of file diff --git a/doc_source/API_TracingConfig.md b/doc_source/API_TracingConfig.md deleted file mode 100644 index 4833a916..00000000 --- a/doc_source/API_TracingConfig.md +++ /dev/null @@ -1,19 +0,0 @@ -# TracingConfig - -The function's [AWS X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) tracing configuration\. To sample and record incoming requests, set `Mode` to `Active`\. - -## Contents - - ** Mode ** -The tracing mode\. -Type: String -Valid Values:` Active | PassThrough` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfig) \ No newline at end of file diff --git a/doc_source/API_TracingConfigResponse.md b/doc_source/API_TracingConfigResponse.md deleted file mode 100644 index d5bf88f8..00000000 --- a/doc_source/API_TracingConfigResponse.md +++ /dev/null @@ -1,19 +0,0 @@ -# TracingConfigResponse - -The function's AWS X\-Ray tracing configuration\. - -## Contents - - ** Mode ** -The tracing mode\. -Type: String -Valid Values:` Active | PassThrough` -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/TracingConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/TracingConfigResponse) \ No newline at end of file diff --git a/doc_source/API_Types.md b/doc_source/API_Types.md deleted file mode 100644 index 6c1f567d..00000000 --- a/doc_source/API_Types.md +++ /dev/null @@ -1,46 +0,0 @@ -# Data Types - -The following data types are supported: -+ [AccountLimit](API_AccountLimit.md) -+ [AccountUsage](API_AccountUsage.md) -+ [AliasConfiguration](API_AliasConfiguration.md) -+ [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) -+ [AllowedPublishers](API_AllowedPublishers.md) -+ [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) -+ [CodeSigningConfig](API_CodeSigningConfig.md) -+ [CodeSigningPolicies](API_CodeSigningPolicies.md) -+ [Concurrency](API_Concurrency.md) -+ [Cors](API_Cors.md) -+ [DeadLetterConfig](API_DeadLetterConfig.md) -+ [DestinationConfig](API_DestinationConfig.md) -+ [Environment](API_Environment.md) -+ [EnvironmentError](API_EnvironmentError.md) -+ [EnvironmentResponse](API_EnvironmentResponse.md) -+ [EphemeralStorage](API_EphemeralStorage.md) -+ [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) -+ [FileSystemConfig](API_FileSystemConfig.md) -+ [Filter](API_Filter.md) -+ [FilterCriteria](API_FilterCriteria.md) -+ [FunctionCode](API_FunctionCode.md) -+ [FunctionCodeLocation](API_FunctionCodeLocation.md) -+ [FunctionConfiguration](API_FunctionConfiguration.md) -+ [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) -+ [FunctionUrlConfig](API_FunctionUrlConfig.md) -+ [ImageConfig](API_ImageConfig.md) -+ [ImageConfigError](API_ImageConfigError.md) -+ [ImageConfigResponse](API_ImageConfigResponse.md) -+ [Layer](API_Layer.md) -+ [LayersListItem](API_LayersListItem.md) -+ [LayerVersionContentInput](API_LayerVersionContentInput.md) -+ [LayerVersionContentOutput](API_LayerVersionContentOutput.md) -+ [LayerVersionsListItem](API_LayerVersionsListItem.md) -+ [OnFailure](API_OnFailure.md) -+ [OnSuccess](API_OnSuccess.md) -+ [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) -+ [SelfManagedEventSource](API_SelfManagedEventSource.md) -+ [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) -+ [SourceAccessConfiguration](API_SourceAccessConfiguration.md) -+ [TracingConfig](API_TracingConfig.md) -+ [TracingConfigResponse](API_TracingConfigResponse.md) -+ [VpcConfig](API_VpcConfig.md) -+ [VpcConfigResponse](API_VpcConfigResponse.md) \ No newline at end of file diff --git a/doc_source/API_UntagResource.md b/doc_source/API_UntagResource.md deleted file mode 100644 index 8abf4139..00000000 --- a/doc_source/API_UntagResource.md +++ /dev/null @@ -1,71 +0,0 @@ -# UntagResource - -Removes [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) from a function\. - -## Request Syntax - -``` -DELETE /2017-03-31/tags/ARN?tagKeys=TagKeys HTTP/1.1 -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [ARN](#API_UntagResource_RequestSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [TagKeys](#API_UntagResource_RequestSyntax) ** -A list of tag keys to remove from the function\. -Required: Yes - -## Request Body - -The request does not have a request body\. - -## Response Syntax - -``` -HTTP/1.1 204 -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UntagResource) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UntagResource) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UntagResource) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UntagResource) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UntagResource) \ No newline at end of file diff --git a/doc_source/API_UpdateAlias.md b/doc_source/API_UpdateAlias.md deleted file mode 100644 index c1ffe2e9..00000000 --- a/doc_source/API_UpdateAlias.md +++ /dev/null @@ -1,165 +0,0 @@ -# UpdateAlias - -Updates the configuration of a Lambda function [alias](https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)\. - -## Request Syntax - -``` -PUT /2015-03-31/functions/FunctionName/aliases/Name HTTP/1.1 -Content-type: application/json - -{ - "Description": "string", - "FunctionVersion": "string", - "RevisionId": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_UpdateAlias_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Name](#API_UpdateAlias_RequestSyntax) ** -The name of the alias\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Description](#API_UpdateAlias_RequestSyntax) ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [FunctionVersion](#API_UpdateAlias_RequestSyntax) ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` -Required: No - - ** [RevisionId](#API_UpdateAlias_RequestSyntax) ** -Only update the alias if the revision ID matches the ID that's specified\. Use this option to avoid modifying an alias that has changed since you last read it\. -Type: String -Required: No - - ** [RoutingConfig](#API_UpdateAlias_RequestSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AliasArn": "string", - "Description": "string", - "FunctionVersion": "string", - "Name": "string", - "RevisionId": "string", - "RoutingConfig": { - "AdditionalVersionWeights": { - "string" : number - } - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AliasArn](#API_UpdateAlias_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the alias\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Description](#API_UpdateAlias_ResponseSyntax) ** -A description of the alias\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [FunctionVersion](#API_UpdateAlias_ResponseSyntax) ** -The function version that the alias invokes\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [Name](#API_UpdateAlias_ResponseSyntax) ** -The name of the alias\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(?!^[0-9]+$)([a-zA-Z0-9-_]+)` - - ** [RevisionId](#API_UpdateAlias_ResponseSyntax) ** -A unique identifier that changes when you update the alias\. -Type: String - - ** [RoutingConfig](#API_UpdateAlias_ResponseSyntax) ** -The [routing configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) of the alias\. -Type: [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateAlias) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateAlias) \ No newline at end of file diff --git a/doc_source/API_UpdateCodeSigningConfig.md b/doc_source/API_UpdateCodeSigningConfig.md deleted file mode 100644 index 5ea4611b..00000000 --- a/doc_source/API_UpdateCodeSigningConfig.md +++ /dev/null @@ -1,109 +0,0 @@ -# UpdateCodeSigningConfig - -Update the code signing configuration\. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function\. - -## Request Syntax - -``` -PUT /2020-04-22/code-signing-configs/CodeSigningConfigArn HTTP/1.1 -Content-type: application/json - -{ - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string" -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [CodeSigningConfigArn](#API_UpdateCodeSigningConfig_RequestSyntax) ** -The The Amazon Resource Name \(ARN\) of the code signing configuration\. -Length Constraints: Maximum length of 200\. -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:\d{12}:code-signing-config:csc-[a-z0-9]{17}` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [AllowedPublishers](#API_UpdateCodeSigningConfig_RequestSyntax) ** -Signing profiles for this code signing configuration\. -Type: [AllowedPublishers](API_AllowedPublishers.md) object -Required: No - - ** [CodeSigningPolicies](#API_UpdateCodeSigningConfig_RequestSyntax) ** -The code signing policy\. -Type: [CodeSigningPolicies](API_CodeSigningPolicies.md) object -Required: No - - ** [Description](#API_UpdateCodeSigningConfig_RequestSyntax) ** -Descriptive name for this code signing configuration\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "CodeSigningConfig": { - "AllowedPublishers": { - "SigningProfileVersionArns": [ "string" ] - }, - "CodeSigningConfigArn": "string", - "CodeSigningConfigId": "string", - "CodeSigningPolicies": { - "UntrustedArtifactOnDeployment": "string" - }, - "Description": "string", - "LastModified": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [CodeSigningConfig](#API_UpdateCodeSigningConfig_ResponseSyntax) ** -The code signing configuration -Type: [CodeSigningConfig](API_CodeSigningConfig.md) object - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateCodeSigningConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateCodeSigningConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateEventSourceMapping.md b/doc_source/API_UpdateEventSourceMapping.md deleted file mode 100644 index dca009fc..00000000 --- a/doc_source/API_UpdateEventSourceMapping.md +++ /dev/null @@ -1,399 +0,0 @@ -# UpdateEventSourceMapping - -Updates an event source mapping\. You can change the function that AWS Lambda invokes, or pause invocation and resume later from the same location\. - -For details about how to configure different event sources, see the following topics\. -+ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping) -+ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping) -+ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource) -+ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping) -+ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) -+ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) - -The following error handling options are available only for stream sources \(DynamoDB and Kinesis\): -+ `BisectBatchOnFunctionError` \- If the function returns an error, split the batch in two and retry\. -+ `DestinationConfig` \- Send discarded records to an Amazon SQS queue or Amazon SNS topic\. -+ `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 -+ `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\. -+ `ParallelizationFactor` \- Process multiple batches from each shard concurrently\. - -For information about which configuration parameters apply to each event source, see the following topics\. -+ [ Amazon DynamoDB Streams](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params) -+ [ Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params) -+ [ Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params) -+ [ Amazon MQ and RabbitMQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params) -+ [ Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms) -+ [ Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms) - -## Request Syntax - -``` -PUT /2015-03-31/event-source-mappings/UUID HTTP/1.1 -Content-type: application/json - -{ - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "Enabled": boolean, - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionName": "string", - "FunctionResponseTypes": [ "string" ], - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "TumblingWindowInSeconds": number -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [UUID](#API_UpdateEventSourceMapping_RequestSyntax) ** -The identifier of the event source mapping\. -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [BatchSize](#API_UpdateEventSourceMapping_RequestSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -+ **Amazon Kinesis** \- Default 100\. Max 10,000\. -+ **Amazon DynamoDB Streams** \- Default 100\. Max 10,000\. -+ **Amazon Simple Queue Service** \- Default 10\. For standard queues the max is 10,000\. For FIFO queues the max is 10\. -+ **Amazon Managed Streaming for Apache Kafka** \- Default 100\. Max 10,000\. -+ **Self\-managed Apache Kafka** \- Default 100\. Max 10,000\. -+ **Amazon MQ \(ActiveMQ and RabbitMQ\)** \- Default 100\. Max 10,000\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. -Required: No - - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. -Type: Boolean -Required: No - - ** [DestinationConfig](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** [Enabled](#API_UpdateEventSourceMapping_RequestSyntax) ** -When true, the event source mapping is active\. When false, Lambda pauses polling and invocation\. -Default: True -Type: Boolean -Required: No - - ** [FilterCriteria](#API_UpdateEventSourceMapping_RequestSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object -Required: No - - ** [FunctionName](#API_UpdateEventSourceMapping_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `MyFunction`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`\. -+ **Version or Alias ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`\. -+ **Partial ARN** \- `123456789012:function:MyFunction`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it's limited to 64 characters in length\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: No - - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` -Required: No - - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. -Required: No - - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is infinite \(\-1\)\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. -Required: No - - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(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\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. -Required: No - - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The number of batches to process from each shard concurrently\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. -Required: No - - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_RequestSyntax) ** -An array of authentication protocols or VPC components required to secure your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. -Required: No - - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_RequestSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is between 1 second and 900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 202 -Content-type: application/json - -{ - "AmazonManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "BatchSize": number, - "BisectBatchOnFunctionError": boolean, - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "EventSourceArn": "string", - "FilterCriteria": { - "Filters": [ - { - "Pattern": "string" - } - ] - }, - "FunctionArn": "string", - "FunctionResponseTypes": [ "string" ], - "LastModified": number, - "LastProcessingResult": "string", - "MaximumBatchingWindowInSeconds": number, - "MaximumRecordAgeInSeconds": number, - "MaximumRetryAttempts": number, - "ParallelizationFactor": number, - "Queues": [ "string" ], - "SelfManagedEventSource": { - "Endpoints": { - "string" : [ "string" ] - } - }, - "SelfManagedKafkaEventSourceConfig": { - "ConsumerGroupId": "string" - }, - "SourceAccessConfigurations": [ - { - "Type": "string", - "URI": "string" - } - ], - "StartingPosition": "string", - "StartingPositionTimestamp": number, - "State": "string", - "StateTransitionReason": "string", - "Topics": [ "string" ], - "TumblingWindowInSeconds": number, - "UUID": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 202 response\. - -The following data is returned in JSON format by the service\. - - ** [AmazonManagedKafkaEventSourceConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event source\. -Type: [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) object - - ** [BatchSize](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function\. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation \(6 MB\)\. -Default value: Varies by service\. For Amazon SQS, the default is 10\. For all other services, the default is 100\. -Related setting: When you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10000\. - - ** [BisectBatchOnFunctionError](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) If the function returns an error, split the batch in two and retry\. The default value is false\. -Type: Boolean - - ** [DestinationConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) An Amazon SQS queue or Amazon SNS topic destination for discarded records\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [EventSourceArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the event source\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [FilterCriteria](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An object that defines the filter criteria that determine whether Lambda should process an event\. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)\. -Type: [FilterCriteria](API_FilterCriteria.md) object - - ** [FunctionArn](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The ARN of the Lambda function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionResponseTypes](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams and Amazon SQS\) A list of current response type enums applied to the event source mapping\. -Type: Array of strings -Array Members: Minimum number of 0 items\. Maximum number of 1 item\. -Valid Values:` ReportBatchItemFailures` - - ** [LastModified](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The date that the event source mapping was last updated or that its state changed, in Unix time seconds\. -Type: Timestamp - - ** [LastProcessingResult](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The result of the last Lambda invocation of your function\. -Type: String - - ** [MaximumBatchingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. -For streams and Amazon SQS event sources, the default batching window is 0 seconds\. For Amazon MSK, Self\-managed Apache Kafka, and Amazon MQ event sources, the default batching window is 500 ms\. Note that because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -Related setting: For streams and Amazon SQS event sources, when you set `BatchSize` to a value greater than 10, you must set `MaximumBatchingWindowInSeconds` to at least 1\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 300\. - - ** [MaximumRecordAgeInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records older than the specified age\. The default value is \-1, which sets the maximum age to infinite\. When the value is set to infinite, Lambda never discards old records\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 604800\. - - ** [MaximumRetryAttempts](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) Discard records after the specified number of retries\. The default value is \-1, which sets the maximum number of retries to infinite\. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source\. -Type: Integer -Valid Range: Minimum value of \-1\. Maximum value of 10000\. - - ** [ParallelizationFactor](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The number of batches to process concurrently from each shard\. The default value is 1\. -Type: Integer -Valid Range: Minimum value of 1\. Maximum value of 10\. - - ** [Queues](#API_UpdateEventSourceMapping_ResponseSyntax) ** - \(Amazon MQ\) The name of the Amazon MQ broker destination queue to consume\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 1000\. -Pattern: `[\s\S]*` - - ** [SelfManagedEventSource](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The self\-managed Apache Kafka cluster for your event source\. -Type: [SelfManagedEventSource](API_SelfManagedEventSource.md) object - - ** [SelfManagedKafkaEventSourceConfig](#API_UpdateEventSourceMapping_ResponseSyntax) ** -Specific configuration settings for a self\-managed Apache Kafka event source\. -Type: [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) object - - ** [SourceAccessConfigurations](#API_UpdateEventSourceMapping_ResponseSyntax) ** -An array of the authentication protocol, VPC components, or virtual host to secure and define your event source\. -Type: Array of [SourceAccessConfiguration](API_SourceAccessConfiguration.md) objects -Array Members: Minimum number of 0 items\. Maximum number of 22 items\. - - ** [StartingPosition](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The position in a stream from which to start reading\. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK stream sources\. `AT_TIMESTAMP` is supported only for Amazon Kinesis streams\. -Type: String -Valid Values:` TRIM_HORIZON | LATEST | AT_TIMESTAMP` - - ** [StartingPositionTimestamp](#API_UpdateEventSourceMapping_ResponseSyntax) ** -With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to start reading, in Unix time seconds\. -Type: Timestamp - - ** [State](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The state of the event source mapping\. It can be one of the following: `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, or `Deleting`\. -Type: String - - ** [StateTransitionReason](#API_UpdateEventSourceMapping_ResponseSyntax) ** -Indicates whether a user or Lambda made the last change to the event source mapping\. -Type: String - - ** [Topics](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The name of the Kafka topic\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Length Constraints: Minimum length of 1\. Maximum length of 249\. -Pattern: `^[^.]([a-zA-Z0-9\-_.]+)` - - ** [TumblingWindowInSeconds](#API_UpdateEventSourceMapping_ResponseSyntax) ** -\(Streams only\) The duration in seconds of a processing window\. The range is 1–900 seconds\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 900\. - - ** [UUID](#API_UpdateEventSourceMapping_ResponseSyntax) ** -The identifier of the event source mapping\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceInUseException ** -The operation conflicts with the resource's availability\. For example, you attempted to update an EventSource Mapping in CREATING, or tried to delete a EventSource mapping currently in the UPDATING state\. -HTTP Status Code: 400 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateEventSourceMapping) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateEventSourceMapping) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionCode.md b/doc_source/API_UpdateFunctionCode.md deleted file mode 100644 index 439dafb9..00000000 --- a/doc_source/API_UpdateFunctionCode.md +++ /dev/null @@ -1,404 +0,0 @@ -# UpdateFunctionCode - -Updates a Lambda function's code\. If code signing is enabled for the function, the code package must be signed by a trusted publisher\. For more information, see [Configuring code signing](https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html)\. - -If the function's package type is `Image`, you must specify the code package in `ImageUri` as the URI of a [container image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) in the Amazon ECR registry\. - -If the function's package type is `Zip`, you must specify the deployment package as a [\.zip file archive](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)\. Enter the Amazon S3 bucket and key of the code \.zip file location\. You can also provide the function code inline using the `ZipFile` field\. - -The code in the deployment package must be compatible with the target instruction set architecture of the function \(`x86-64` or `arm64`\)\. - -The function's code is locked when you publish a version\. You can't modify the code of a published version, only the unpublished version\. - -**Note** -For a function defined as a container image, Lambda resolves the image tag to an image digest\. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function\. - -## Request Syntax - -``` -PUT /2015-03-31/functions/FunctionName/code HTTP/1.1 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "DryRun": boolean, - "ImageUri": "string", - "Publish": boolean, - "RevisionId": "string", - "S3Bucket": "string", - "S3Key": "string", - "S3ObjectVersion": "string", - "ZipFile": blob -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_UpdateFunctionCode_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [Architectures](#API_UpdateFunctionCode_RequestSyntax) ** -The instruction set architecture that the function supports\. Enter a string array with one of the valid values \(arm64 or x86\_64\)\. The default value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` -Required: No - - ** [DryRun](#API_UpdateFunctionCode_RequestSyntax) ** -Set to true to validate the request parameters and access permissions without modifying the function code\. -Type: Boolean -Required: No - - ** [ImageUri](#API_UpdateFunctionCode_RequestSyntax) ** -URI of a container image in the Amazon ECR registry\. Do not use for a function defined with a \.zip file archive\. -Type: String -Required: No - - ** [Publish](#API_UpdateFunctionCode_RequestSyntax) ** -Set to true to publish a new version of the function after updating the code\. This has the same effect as calling [PublishVersion](API_PublishVersion.md) separately\. -Type: Boolean -Required: No - - ** [RevisionId](#API_UpdateFunctionCode_RequestSyntax) ** -Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. -Type: String -Required: No - - ** [S3Bucket](#API_UpdateFunctionCode_RequestSyntax) ** -An Amazon S3 bucket in the same AWS Region as your function\. The bucket can be in a different AWS account\. Use only with a function defined with a \.zip file archive deployment package\. -Type: String -Length Constraints: Minimum length of 3\. Maximum length of 63\. -Pattern: `^[0-9A-Za-z\.\-_]*(? -The Amazon S3 key of the deployment package\. Use only with a function defined with a \.zip file archive deployment package\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** [S3ObjectVersion](#API_UpdateFunctionCode_RequestSyntax) ** -For versioned objects, the version of the deployment package object to use\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Required: No - - ** [ZipFile](#API_UpdateFunctionCode_RequestSyntax) ** -The base64\-encoded contents of the deployment package\. AWS SDK and AWS CLI clients handle the encoding for you\. Use only with a function defined with a \.zip file archive deployment package\. -Type: Base64\-encoded binary data object -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Architectures](#API_UpdateFunctionCode_ResponseSyntax) ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` - - ** [CodeSha256](#API_UpdateFunctionCode_ResponseSyntax) ** -The SHA256 hash of the function's deployment package\. -Type: String - - ** [CodeSize](#API_UpdateFunctionCode_ResponseSyntax) ** -The size of the function's deployment package, in bytes\. -Type: Long - - ** [DeadLetterConfig](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - - ** [Description](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [Environment](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - - ** [EphemeralStorage](#API_UpdateFunctionCode_ResponseSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object - - ** [FileSystemConfigs](#API_UpdateFunctionCode_ResponseSyntax) ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. - - ** [FunctionArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionName](#API_UpdateFunctionCode_ResponseSyntax) ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Handler](#API_UpdateFunctionCode_ResponseSyntax) ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` - - ** [ImageConfigResponse](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - - ** [KMSKeyArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - - ** [LastModified](#API_UpdateFunctionCode_ResponseSyntax) ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [LastUpdateStatus](#API_UpdateFunctionCode_ResponseSyntax) ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` - - ** [LastUpdateStatusReason](#API_UpdateFunctionCode_ResponseSyntax) ** -The reason for the last update that was performed on the function\. -Type: String - - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Layers](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects - - ** [MasterArn](#API_UpdateFunctionCode_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [MemorySize](#API_UpdateFunctionCode_ResponseSyntax) ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionCode_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` - - ** [RevisionId](#API_UpdateFunctionCode_ResponseSyntax) ** -The latest updated revision of the function or alias\. -Type: String - - ** [Role](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - - ** [Runtime](#API_UpdateFunctionCode_ResponseSyntax) ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionCode_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [State](#API_UpdateFunctionCode_ResponseSyntax) ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` - - ** [StateReason](#API_UpdateFunctionCode_ResponseSyntax) ** -The reason for the function's current state\. -Type: String - - ** [StateReasonCode](#API_UpdateFunctionCode_ResponseSyntax) ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Timeout](#API_UpdateFunctionCode_ResponseSyntax) ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [TracingConfig](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - - ** [Version](#API_UpdateFunctionCode_ResponseSyntax) ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [VpcConfig](#API_UpdateFunctionCode_ResponseSyntax) ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object - -## Errors - - ** CodeSigningConfigNotFoundException ** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - ** CodeStorageExceededException ** -You have exceeded your maximum total code size per account\. [Learn more](https://docs.aws.amazon.com/lambda/latest/dg/limits.html) -HTTP Status Code: 400 - - ** CodeVerificationFailedException ** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - ** InvalidCodeSignatureException ** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. -HTTP Status Code: 400 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionCode) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionConfiguration.md b/doc_source/API_UpdateFunctionConfiguration.md deleted file mode 100644 index 7fbcf30b..00000000 --- a/doc_source/API_UpdateFunctionConfiguration.md +++ /dev/null @@ -1,464 +0,0 @@ -# UpdateFunctionConfiguration - -Modify the version\-specific settings of a Lambda function\. - -When you update a function, Lambda provisions an instance of the function and its supporting resources\. If your function connects to a VPC, this process can take a minute\. During this time, you can't modify the function, but you can still invoke it\. The `LastUpdateStatus`, `LastUpdateStatusReason`, and `LastUpdateStatusReasonCode` fields in the response from [GetFunctionConfiguration](API_GetFunctionConfiguration.md) indicate when the update is complete and the function is processing events with the new configuration\. For more information, see [Function States](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)\. - -These settings can vary between versions of a function and are locked when you publish a version\. You can't modify the configuration of a published version, only the unpublished version\. - -To configure function concurrency, use [PutFunctionConcurrency](API_PutFunctionConcurrency.md)\. To grant invoke permissions to an account or AWS service, use [AddPermission](API_AddPermission.md)\. - -## Request Syntax - -``` -PUT /2015-03-31/functions/FunctionName/configuration HTTP/1.1 -Content-type: application/json - -{ - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "Handler": "string", - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - }, - "KMSKeyArn": "string", - "Layers": [ "string" ], - "MemorySize": number, - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ] - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - -## Request Body - -The request accepts the following data in JSON format\. - - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing\. For more information, see [Dead Letter Queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object -Required: No - - ** [Description](#API_UpdateFunctionConfiguration_RequestSyntax) ** -A description of the function\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. -Required: No - - ** [Environment](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Environment variables that are accessible from function code during execution\. -Type: [Environment](API_Environment.md) object -Required: No - - ** [EphemeralStorage](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object -Required: No - - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Connection settings for an Amazon EFS file system\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. -Required: No - - ** [Handler](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The name of the method within your code that Lambda calls to execute your function\. Handler is required if the deployment package is a \.zip file archive\. The format includes the file name\. It can also include namespaces and other qualifiers, depending on the runtime\. For more information, see [Programming Model](https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html)\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` -Required: No - - ** [ImageConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** - [Container image configuration values](https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html) that override the values in the container image Docker file\. -Type: [ImageConfig](API_ImageConfig.md) object -Required: No - - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The ARN of the AWS Key Management Service \(AWS KMS\) key that's used to encrypt your function's environment variables\. If it's not provided, AWS Lambda uses a default service key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` -Required: No - - ** [Layers](#API_UpdateFunctionConfiguration_RequestSyntax) ** -A list of [function layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) to add to the function's execution environment\. Specify each layer by its ARN, including the version\. -Type: Array of strings -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `arn:[a-zA-Z0-9-]+:lambda:[a-zA-Z0-9-]+:\d{12}:layer:[a-zA-Z0-9-_]+:[0-9]+` -Required: No - - ** [MemorySize](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of [memory available to the function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html) at runtime\. Increasing the function memory also increases its CPU allocation\. The default value is 128 MB\. The value can be any multiple of 1 MB\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. -Required: No - - ** [RevisionId](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Only update the function if the revision ID matches the ID that's specified\. Use this option to avoid modifying a function that has changed since you last read it\. -Type: String -Required: No - - ** [Role](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The Amazon Resource Name \(ARN\) of the function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` -Required: No - - ** [Runtime](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The identifier of the function's [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)\. Runtime is required if the deployment package is a \.zip file archive\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` -Required: No - - ** [Timeout](#API_UpdateFunctionConfiguration_RequestSyntax) ** -The amount of time \(in seconds\) that Lambda allows a function to run before stopping it\. The default is 3 seconds\. The maximum allowed value is 900 seconds\. For additional information, see [Lambda execution environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)\. -Type: Integer -Valid Range: Minimum value of 1\. -Required: No - - ** [TracingConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -Set `Mode` to `Active` to sample and trace a subset of incoming requests with [X\-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)\. -Type: [TracingConfig](API_TracingConfig.md) object -Required: No - - ** [VpcConfig](#API_UpdateFunctionConfiguration_RequestSyntax) ** -For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC\. When you connect a function to a VPC, it can only access resources and the internet through that VPC\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. -Type: [VpcConfig](API_VpcConfig.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "Architectures": [ "string" ], - "CodeSha256": "string", - "CodeSize": number, - "DeadLetterConfig": { - "TargetArn": "string" - }, - "Description": "string", - "Environment": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "Variables": { - "string" : "string" - } - }, - "EphemeralStorage": { - "Size": number - }, - "FileSystemConfigs": [ - { - "Arn": "string", - "LocalMountPath": "string" - } - ], - "FunctionArn": "string", - "FunctionName": "string", - "Handler": "string", - "ImageConfigResponse": { - "Error": { - "ErrorCode": "string", - "Message": "string" - }, - "ImageConfig": { - "Command": [ "string" ], - "EntryPoint": [ "string" ], - "WorkingDirectory": "string" - } - }, - "KMSKeyArn": "string", - "LastModified": "string", - "LastUpdateStatus": "string", - "LastUpdateStatusReason": "string", - "LastUpdateStatusReasonCode": "string", - "Layers": [ - { - "Arn": "string", - "CodeSize": number, - "SigningJobArn": "string", - "SigningProfileVersionArn": "string" - } - ], - "MasterArn": "string", - "MemorySize": number, - "PackageType": "string", - "RevisionId": "string", - "Role": "string", - "Runtime": "string", - "SigningJobArn": "string", - "SigningProfileVersionArn": "string", - "State": "string", - "StateReason": "string", - "StateReasonCode": "string", - "Timeout": number, - "TracingConfig": { - "Mode": "string" - }, - "Version": "string", - "VpcConfig": { - "SecurityGroupIds": [ "string" ], - "SubnetIds": [ "string" ], - "VpcId": "string" - } -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [Architectures](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The instruction set architecture that the function supports\. Architecture is a string array with one of the valid values\. The default architecture value is `x86_64`\. -Type: Array of strings -Array Members: Fixed number of 1 item\. -Valid Values:` x86_64 | arm64` - - ** [CodeSha256](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The SHA256 hash of the function's deployment package\. -Type: String - - ** [CodeSize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The size of the function's deployment package, in bytes\. -Type: Long - - ** [DeadLetterConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's dead letter queue\. -Type: [DeadLetterConfig](API_DeadLetterConfig.md) object - - ** [Description](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's description\. -Type: String -Length Constraints: Minimum length of 0\. Maximum length of 256\. - - ** [Environment](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's [environment variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)\. Omitted from AWS CloudTrail logs\. -Type: [EnvironmentResponse](API_EnvironmentResponse.md) object - - ** [EphemeralStorage](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The size of the function’s /tmp directory in MB\. The default value is 512, but can be any whole number between 512 and 10240 MB\. -Type: [EphemeralStorage](API_EphemeralStorage.md) object - - ** [FileSystemConfigs](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -Connection settings for an [Amazon EFS file system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)\. -Type: Array of [FileSystemConfig](API_FileSystemConfig.md) objects -Array Members: Maximum number of 1 item\. - - ** [FunctionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's Amazon Resource Name \(ARN\)\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_\.]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionName](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The name of the function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 170\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [Handler](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function that Lambda calls to begin executing your function\. -Type: String -Length Constraints: Maximum length of 128\. -Pattern: `[^\s]+` - - ** [ImageConfigResponse](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's image configuration values\. -Type: [ImageConfigResponse](API_ImageConfigResponse.md) object - - ** [KMSKeyArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The AWS KMS key that's used to encrypt the function's environment variables\. This key is only returned if you've configured a customer managed key\. -Type: String -Pattern: `(arn:(aws[a-zA-Z-]*)?:[a-z0-9-.]+:.*)|()` - - ** [LastModified](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The date and time that the function was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [LastUpdateStatus](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The status of the last update that was performed on the function\. This is first set to `Successful` after function creation completes\. -Type: String -Valid Values:` Successful | Failed | InProgress` - - ** [LastUpdateStatusReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The reason for the last update that was performed on the function\. -Type: String - - ** [LastUpdateStatusReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The reason code for the last update that was performed on the function\. -Type: String -Valid Values:` EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Layers](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's [ layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)\. -Type: Array of [Layer](API_Layer.md) objects - - ** [MasterArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -For Lambda@Edge functions, the ARN of the main function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [MemorySize](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The amount of memory available to the function at runtime\. -Type: Integer -Valid Range: Minimum value of 128\. Maximum value of 10240\. - - ** [PackageType](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The type of deployment package\. Set to `Image` for container image and set `Zip` for \.zip file archive\. -Type: String -Valid Values:` Zip | Image` - - ** [RevisionId](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The latest updated revision of the function or alias\. -Type: String - - ** [Role](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's execution role\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+` - - ** [Runtime](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The runtime environment for the Lambda function\. -Type: String -Valid Values:` nodejs | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs10.x | nodejs12.x | nodejs14.x | nodejs16.x | java8 | java8.al2 | java11 | python2.7 | python3.6 | python3.7 | python3.8 | python3.9 | dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | dotnetcore3.1 | dotnet6 | nodejs4.3-edge | go1.x | ruby2.5 | ruby2.7 | provided | provided.al2` - - ** [SigningJobArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing job\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [SigningProfileVersionArn](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The ARN of the signing profile version\. -Type: String -Pattern: `arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\-])+:([a-z]{2}(-gov)?-[a-z]+-\d{1})?:(\d{12})?:(.*)` - - ** [State](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The current state of the function\. When the state is `Inactive`, you can reactivate the function by invoking it\. -Type: String -Valid Values:` Pending | Active | Inactive | Failed` - - ** [StateReason](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The reason for the function's current state\. -Type: String - - ** [StateReasonCode](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The reason code for the function's current state\. When the code is `Creating`, you can't invoke or modify the function\. -Type: String -Valid Values:` Idle | Creating | Restoring | EniLimitExceeded | InsufficientRolePermissions | InvalidConfiguration | InternalError | SubnetOutOfIPAddresses | InvalidSubnet | InvalidSecurityGroup | ImageDeleted | ImageAccessDenied | InvalidImage` - - ** [Timeout](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The amount of time in seconds that Lambda allows a function to run before stopping it\. -Type: Integer -Valid Range: Minimum value of 1\. - - ** [TracingConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's AWS X\-Ray tracing configuration\. -Type: [TracingConfigResponse](API_TracingConfigResponse.md) object - - ** [Version](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The version of the Lambda function\. -Type: String -Length Constraints: Minimum length of 1\. Maximum length of 1024\. -Pattern: `(\$LATEST|[0-9]+)` - - ** [VpcConfig](#API_UpdateFunctionConfiguration_ResponseSyntax) ** -The function's networking configuration\. -Type: [VpcConfigResponse](API_VpcConfigResponse.md) object - -## Errors - - ** CodeSigningConfigNotFoundException ** -The specified code signing configuration does not exist\. -HTTP Status Code: 404 - - ** CodeVerificationFailedException ** -The code signature failed one or more of the validation checks for signature mismatch or expiry, and the code signing policy is set to ENFORCE\. Lambda blocks the deployment\. -HTTP Status Code: 400 - - ** InvalidCodeSignatureException ** -The code signature failed the integrity check\. Lambda always blocks deployment if the integrity check fails, even if code signing policy is set to WARN\. -HTTP Status Code: 400 - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** PreconditionFailedException ** -The RevisionId provided does not match the latest RevisionId for the Lambda function or alias\. Call the `GetFunction` or the `GetAlias` API to retrieve the latest RevisionId for your resource\. -HTTP Status Code: 412 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionConfiguration) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionEventInvokeConfig.md b/doc_source/API_UpdateFunctionEventInvokeConfig.md deleted file mode 100644 index cd8ae575..00000000 --- a/doc_source/API_UpdateFunctionEventInvokeConfig.md +++ /dev/null @@ -1,165 +0,0 @@ -# UpdateFunctionEventInvokeConfig - -Updates the configuration for asynchronous invocation for a function, version, or alias\. - -To configure options for asynchronous invocation, use [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md)\. - -## Request Syntax - -``` -POST /2019-09-25/functions/FunctionName/event-invoke-config?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** -The name of the Lambda function, version, or alias\. - -**Name formats** -+ **Function name** \- `my-function` \(name\-only\), `my-function:v1` \(with alias\)\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -You can append a version number or alias to any of the formats\. The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** -A version number or alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(|[a-zA-Z0-9$_-]+)` - -## Request Body - -The request accepts the following data in JSON format\. - - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object -Required: No - - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. -Required: No - - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_RequestSyntax) ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "DestinationConfig": { - "OnFailure": { - "Destination": "string" - }, - "OnSuccess": { - "Destination": "string" - } - }, - "FunctionArn": "string", - "LastModified": number, - "MaximumEventAgeInSeconds": number, - "MaximumRetryAttempts": number -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [DestinationConfig](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** -A destination for events after they have been sent to a function for processing\. - -**Destinations** -+ **Function** \- The Amazon Resource Name \(ARN\) of a Lambda function\. -+ **Queue** \- The ARN of an SQS queue\. -+ **Topic** \- The ARN of an SNS topic\. -+ **Event Bus** \- The ARN of an Amazon EventBridge event bus\. -Type: [DestinationConfig](API_DestinationConfig.md) object - - ** [FunctionArn](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of the function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [LastModified](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** -The date and time that the configuration was last updated, in Unix time seconds\. -Type: Timestamp - - ** [MaximumEventAgeInSeconds](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum age of a request that Lambda sends to a function for processing\. -Type: Integer -Valid Range: Minimum value of 60\. Maximum value of 21600\. - - ** [MaximumRetryAttempts](#API_UpdateFunctionEventInvokeConfig_ResponseSyntax) ** -The maximum number of times to retry when the function returns an error\. -Type: Integer -Valid Range: Minimum value of 0\. Maximum value of 2\. - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionEventInvokeConfig) \ No newline at end of file diff --git a/doc_source/API_UpdateFunctionUrlConfig.md b/doc_source/API_UpdateFunctionUrlConfig.md deleted file mode 100644 index afdfc1c3..00000000 --- a/doc_source/API_UpdateFunctionUrlConfig.md +++ /dev/null @@ -1,149 +0,0 @@ -# UpdateFunctionUrlConfig - -Updates the configuration for a Lambda function URL\. - -## Request Syntax - -``` -PUT /2021-10-31/functions/FunctionName/url?Qualifier=Qualifier HTTP/1.1 -Content-type: application/json - -{ - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - } -} -``` - -## URI Request Parameters - -The request uses the following URI parameters\. - - ** [FunctionName](#API_UpdateFunctionUrlConfig_RequestSyntax) ** -The name of the Lambda function\. - -**Name formats** -+ **Function name** \- `my-function`\. -+ **Function ARN** \- `arn:aws:lambda:us-west-2:123456789012:function:my-function`\. -+ **Partial ARN** \- `123456789012:function:my-function`\. -The length constraint applies only to the full ARN\. If you specify only the function name, it is limited to 64 characters in length\. -Length Constraints: Minimum length of 1\. Maximum length of 140\. -Pattern: `(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?` -Required: Yes - - ** [Qualifier](#API_UpdateFunctionUrlConfig_RequestSyntax) ** -The alias name\. -Length Constraints: Minimum length of 1\. Maximum length of 128\. -Pattern: `(^\$LATEST$)|((?!^[0-9]+$)([a-zA-Z0-9-_]+))` - -## Request Body - -The request accepts the following data in JSON format\. - - ** [AuthType](#API_UpdateFunctionUrlConfig_RequestSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` -Required: No - - ** [Cors](#API_UpdateFunctionUrlConfig_RequestSyntax) ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object -Required: No - -## Response Syntax - -``` -HTTP/1.1 200 -Content-type: application/json - -{ - "AuthType": "string", - "Cors": { - "AllowCredentials": boolean, - "AllowHeaders": [ "string" ], - "AllowMethods": [ "string" ], - "AllowOrigins": [ "string" ], - "ExposeHeaders": [ "string" ], - "MaxAge": number - }, - "CreationTime": "string", - "FunctionArn": "string", - "FunctionUrl": "string", - "LastModifiedTime": "string" -} -``` - -## Response Elements - -If the action is successful, the service sends back an HTTP 200 response\. - -The following data is returned in JSON format by the service\. - - ** [AuthType](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -The type of authentication that your function URL uses\. Set to `AWS_IAM` if you want to restrict access to authenticated `IAM` users only\. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint\. For more information, see [ Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)\. -Type: String -Valid Values:` NONE | AWS_IAM` - - ** [Cors](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -The [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL\. -Type: [Cors](API_Cors.md) object - - ** [CreationTime](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -When the function URL was created, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - - ** [FunctionArn](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -The Amazon Resource Name \(ARN\) of your function\. -Type: String -Pattern: `arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}(-gov)?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-_]+(:(\$LATEST|[a-zA-Z0-9-_]+))?` - - ** [FunctionUrl](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -The HTTP URL endpoint for your function\. -Type: String -Length Constraints: Minimum length of 40\. Maximum length of 100\. - - ** [LastModifiedTime](#API_UpdateFunctionUrlConfig_ResponseSyntax) ** -When the function URL configuration was last updated, in [ISO\-8601 format](https://www.w3.org/TR/NOTE-datetime) \(YYYY\-MM\-DDThh:mm:ss\.sTZD\)\. -Type: String - -## Errors - - ** InvalidParameterValueException ** -One of the parameters in the request is invalid\. -HTTP Status Code: 400 - - ** ResourceConflictException ** -The resource already exists, or another operation is in progress\. -HTTP Status Code: 409 - - ** ResourceNotFoundException ** -The resource specified in the request does not exist\. -HTTP Status Code: 404 - - ** ServiceException ** -The AWS Lambda service encountered an internal error\. -HTTP Status Code: 500 - - ** TooManyRequestsException ** -The request throughput limit was exceeded\. -HTTP Status Code: 429 - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS Command Line Interface](https://docs.aws.amazon.com/goto/aws-cli/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for \.NET](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for JavaScript](https://docs.aws.amazon.com/goto/AWSJavaScriptSDK/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionUrlConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/UpdateFunctionUrlConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfig.md b/doc_source/API_VpcConfig.md deleted file mode 100644 index 00a22693..00000000 --- a/doc_source/API_VpcConfig.md +++ /dev/null @@ -1,25 +0,0 @@ -# VpcConfig - -The VPC security groups and subnets that are attached to a Lambda function\. For more information, see [VPC Settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)\. - -## Contents - - ** SecurityGroupIds ** -A list of VPC security groups IDs\. -Type: Array of strings -Array Members: Maximum number of 5 items\. -Required: No - - ** SubnetIds ** -A list of VPC subnet IDs\. -Type: Array of strings -Array Members: Maximum number of 16 items\. -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfig) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfig) \ No newline at end of file diff --git a/doc_source/API_VpcConfigResponse.md b/doc_source/API_VpcConfigResponse.md deleted file mode 100644 index 24c5badc..00000000 --- a/doc_source/API_VpcConfigResponse.md +++ /dev/null @@ -1,30 +0,0 @@ -# VpcConfigResponse - -The VPC security groups and subnets that are attached to a Lambda function\. - -## Contents - - ** SecurityGroupIds ** -A list of VPC security groups IDs\. -Type: Array of strings -Array Members: Maximum number of 5 items\. -Required: No - - ** SubnetIds ** -A list of VPC subnet IDs\. -Type: Array of strings -Array Members: Maximum number of 16 items\. -Required: No - - ** VpcId ** -The ID of the VPC\. -Type: String -Required: No - -## See Also - -For more information about using this API in one of the language\-specific AWS SDKs, see the following: -+ [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Go](https://docs.aws.amazon.com/goto/SdkForGoV1/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/VpcConfigResponse) -+ [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/lambda-2015-03-31/VpcConfigResponse) \ No newline at end of file diff --git a/doc_source/CommonErrors.md b/doc_source/CommonErrors.md deleted file mode 100644 index d5311270..00000000 --- a/doc_source/CommonErrors.md +++ /dev/null @@ -1,75 +0,0 @@ -# Common Errors - -This section lists the errors common to the API actions of all AWS services\. For errors specific to an API action for this service, see the topic for that API action\. - - **AccessDeniedException** -You do not have sufficient access to perform this action\. -HTTP Status Code: 400 - - **IncompleteSignature** -The request signature does not conform to AWS standards\. -HTTP Status Code: 400 - - **InternalFailure** -The request processing has failed because of an unknown error, exception or failure\. -HTTP Status Code: 500 - - **InvalidAction** -The action or operation requested is invalid\. Verify that the action is typed correctly\. -HTTP Status Code: 400 - - **InvalidClientTokenId** -The X\.509 certificate or AWS access key ID provided does not exist in our records\. -HTTP Status Code: 403 - - **InvalidParameterCombination** -Parameters that must not be used together were used together\. -HTTP Status Code: 400 - - **InvalidParameterValue** -An invalid or out\-of\-range value was supplied for the input parameter\. -HTTP Status Code: 400 - - **InvalidQueryParameter** -The AWS query string is malformed or does not adhere to AWS standards\. -HTTP Status Code: 400 - - **MalformedQueryString** -The query string contains a syntax error\. -HTTP Status Code: 404 - - **MissingAction** -The request is missing an action or a required parameter\. -HTTP Status Code: 400 - - **MissingAuthenticationToken** -The request must contain either a valid \(registered\) AWS access key ID or X\.509 certificate\. -HTTP Status Code: 403 - - **MissingParameter** -A required parameter for the specified action is not supplied\. -HTTP Status Code: 400 - - **NotAuthorized** -You do not have permission to perform this action\. -HTTP Status Code: 400 - - **OptInRequired** -The AWS access key ID needs a subscription for the service\. -HTTP Status Code: 403 - - **RequestExpired** -The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date \(such as for pre\-signed URLs\), or the date stamp on the request is more than 15 minutes in the future\. -HTTP Status Code: 400 - - **ServiceUnavailable** -The request has failed due to a temporary failure of the server\. -HTTP Status Code: 503 - - **ThrottlingException** -The request was denied due to request throttling\. -HTTP Status Code: 400 - - **ValidationError** -The input fails to satisfy the constraints specified by an AWS service\. -HTTP Status Code: 400 \ No newline at end of file diff --git a/doc_source/CommonParameters.md b/doc_source/CommonParameters.md deleted file mode 100644 index 3116ae8e..00000000 --- a/doc_source/CommonParameters.md +++ /dev/null @@ -1,51 +0,0 @@ -# Common Parameters - -The following list contains the parameters that all actions use for signing Signature Version 4 requests with a query string\. Any action\-specific parameters are listed in the topic for that action\. For more information about Signature Version 4, see [Signature Version 4 Signing Process](http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *Amazon Web Services General Reference*\. - - **Action** -The action to be performed\. -Type: string - Required: Yes - - **Version** -The API version that the request is written for, expressed in the format YYYY\-MM\-DD\. -Type: string - Required: Yes - - **X\-Amz\-Algorithm** -The hash algorithm that you used to create the request signature\. -Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. -Type: string - Valid Values: `AWS4-HMAC-SHA256` - Required: Conditional - - **X\-Amz\-Credential** -The credential scope value, which is a string that includes your access key, the date, the region you are targeting, the service you are requesting, and a termination string \("aws4\_request"\)\. The value is expressed in the following format: *access\_key*/*YYYYMMDD*/*region*/*service*/aws4\_request\. -For more information, see [Task 2: Create a String to Sign for Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html) in the *Amazon Web Services General Reference*\. -Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. -Type: string - Required: Conditional - - **X\-Amz\-Date** -The date that is used to create the signature\. The format must be ISO 8601 basic format \(YYYYMMDD'T'HHMMSS'Z'\)\. For example, the following date time is a valid X\-Amz\-Date value: `20120325T120000Z`\. -Condition: X\-Amz\-Date is optional for all requests; it can be used to override the date used for signing requests\. If the Date header is specified in the ISO 8601 basic format, X\-Amz\-Date is not required\. When X\-Amz\-Date is used, it always overrides the value of the Date header\. For more information, see [Handling Dates in Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-date-handling.html) in the *Amazon Web Services General Reference*\. -Type: string - Required: Conditional - - **X\-Amz\-Security\-Token** -The temporary security token that was obtained through a call to AWS Security Token Service \(AWS STS\)\. For a list of services that support temporary security credentials from AWS Security Token Service, go to [AWS Services That Work with IAM](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*\. -Condition: If you're using temporary security credentials from the AWS Security Token Service, you must include the security token\. -Type: string - Required: Conditional - - **X\-Amz\-Signature** -Specifies the hex\-encoded signature that was calculated from the string to sign and the derived signing key\. -Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. -Type: string - Required: Conditional - - **X\-Amz\-SignedHeaders** -Specifies all the HTTP headers that were included as part of the canonical request\. For more information about specifying signed headers, see [ Task 1: Create a Canonical Request For Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html) in the * Amazon Web Services General Reference*\. -Condition: Specify this parameter when you include authentication information in a query string instead of in the HTTP authorization header\. -Type: string - Required: Conditional \ No newline at end of file diff --git a/doc_source/access-control-identity-based.md b/doc_source/access-control-identity-based.md deleted file mode 100644 index 4e92f94e..00000000 --- a/doc_source/access-control-identity-based.md +++ /dev/null @@ -1,241 +0,0 @@ -# Identity\-based IAM policies for Lambda - -You can use identity\-based policies in AWS Identity and Access Management \(IAM\) to grant users in your account access to Lambda\. Identity\-based policies can apply to users directly, or to groups and roles that are associated with a user\. You can also grant users in another account permission to assume a role in your account and access your Lambda resources\. - -Lambda provides AWS managed policies that grant access to Lambda API actions and, in some cases, access to other AWS services used to develop and manage Lambda resources\. Lambda updates these managed policies as needed to ensure that your users have access to new features when they're released\. - -**Note** -The AWS managed policies **AWSLambdaFullAccess** and **AWSLambdaReadOnlyAccess** will be [deprecated](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) on March 1, 2021\. After this date, you cannot attach these policies to new IAM users\. For more information, see the related [troubleshooting topic](security_iam_troubleshoot.md#security_iam_troubleshoot-admin-deprecation)\. -+ **AWSLambda\_FullAccess** – Grants full access to Lambda actions and other AWS services used to develop and maintain Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. -+ **AWSLambda\_ReadOnlyAccess** – Grants read\-only access to Lambda resources\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. -+ **AWSLambdaRole** – Grants permissions to invoke Lambda functions\. - -AWS managed policies grant permission to API actions without restricting the Lambda functions or layers that a user can modify\. For finer\-grained control, you can create your own policies that limit the scope of a user's permissions\. - -**Topics** -+ [Function development](#permissions-user-function) -+ [Layer development and use](#permissions-user-layer) -+ [Cross\-account roles](#permissions-user-xaccount) -+ [Condition keys for VPC settings](#permissions-condition-keys) - -## Function development - -Use identity\-based policies to allow users to perform operations on Lambda functions\. - -**Note** -For a function defined as a container image, the user permission to access the image MUST be configured in the Amazon Elastic Container Registry For an example, see [Amazon ECR permissions\.](gettingstarted-images.md#configuration-images-permissions) - -The following shows an example of a permissions policy with limited scope\. It allows a user to create and manage Lambda functions named with a designated prefix \(`intern-`\), and configured with a designated execution role\. - -**Example Function development policy** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "ReadOnlyPermissions", - "Effect": "Allow", - "Action": [ - "lambda:GetAccountSettings", - "lambda:GetEventSourceMapping", - "lambda:GetFunction", - "lambda:GetFunctionConfiguration", - "lambda:GetFunctionCodeSigningConfig", - "lambda:GetFunctionConcurrency", - "lambda:ListEventSourceMappings", - "lambda:ListFunctions", - "lambda:ListTags", - "iam:ListRoles" - ], - "Resource": "*" - }, - { - "Sid": "DevelopFunctions", - "Effect": "Allow", - "NotAction": [ - "lambda:AddPermission", - "lambda:PutFunctionConcurrency" - ], - "Resource": "arn:aws:lambda:*:*:function:intern-*" - }, - { - "Sid": "DevelopEventSourceMappings", - "Effect": "Allow", - "Action": [ - "lambda:DeleteEventSourceMapping", - "lambda:UpdateEventSourceMapping", - "lambda:CreateEventSourceMapping" - ], - "Resource": "*", - "Condition": { - "StringLike": { - "lambda:FunctionArn": "arn:aws:lambda:*:*:function:intern-*" - } - } - }, - { - "Sid": "PassExecutionRole", - "Effect": "Allow", - "Action": [ - "iam:ListRolePolicies", - "iam:ListAttachedRolePolicies", - "iam:GetRole", - "iam:GetRolePolicy", - "iam:PassRole", - "iam:SimulatePrincipalPolicy" - ], - "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" - }, - { - "Sid": "ViewLogs", - "Effect": "Allow", - "Action": [ - "logs:*" - ], - "Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/intern-*" - } - ] -} -``` - -The permissions in the policy are organized into statements based on the [resources and conditions](lambda-api-permissions-ref.md) that they support\. -+ `ReadOnlyPermissions` – The Lambda console uses these permissions when you browse and view functions\. They don't support resource patterns or conditions\. - - ``` - "Action": [ - "lambda:GetAccountSettings", - "lambda:GetEventSourceMapping", - "lambda:GetFunction", - "lambda:GetFunctionConfiguration", - "lambda:GetFunctionCodeSigningConfig", - "lambda:GetFunctionConcurrency", - "lambda:ListEventSourceMappings", - "lambda:ListFunctions", - "lambda:ListTags", - "iam:ListRoles" - ], - "Resource": "*" - ``` -+ `DevelopFunctions` – Use any Lambda action that operates on functions prefixed with `intern-`, *except* `AddPermission` and `PutFunctionConcurrency`\. `AddPermission` modifies the [resource\-based policy](access-control-resource-based.md) on the function and can have security implications\. `PutFunctionConcurrency` reserves scaling capacity for a function and can take capacity away from other functions\. - - ``` - "NotAction": [ - "lambda:AddPermission", - "lambda:PutFunctionConcurrency" - ], - "Resource": "arn:aws:lambda:*:*:function:intern-*" - ``` -+ `DevelopEventSourceMappings` – Manage event source mappings on functions that are prefixed with `intern-`\. These actions operate on event source mappings, but you can restrict them by function with a *condition*\. - - ``` - "Action": [ - "lambda:DeleteEventSourceMapping", - "lambda:UpdateEventSourceMapping", - "lambda:CreateEventSourceMapping" - ], - "Resource": "*", - "Condition": { - "StringLike": { - "lambda:FunctionArn": "arn:aws:lambda:*:*:function:intern-*" - } - } - ``` -+ `PassExecutionRole` – View and pass only a role named `intern-lambda-execution-role`, which must be created and managed by a user with IAM permissions\. `PassRole` is used when you assign an execution role to a function\. - - ``` - "Action": [ - "iam:ListRolePolicies", - "iam:ListAttachedRolePolicies", - "iam:GetRole", - "iam:GetRolePolicy", - "iam:PassRole", - "iam:SimulatePrincipalPolicy" - ], - "Resource": "arn:aws:iam::*:role/intern-lambda-execution-role" - ``` -+ `ViewLogs` – Use CloudWatch Logs to view logs for functions that are prefixed with `intern-`\. - - ``` - "Action": [ - "logs:*" - ], - "Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/intern-*" - ``` - -This policy allows a user to get started with Lambda, without putting other users' resources at risk\. It doesn't allow a user to configure a function to be triggered by or call other AWS services, which requires broader IAM permissions\. It also doesn't include permission to services that don't support limited\-scope policies, like CloudWatch and X\-Ray\. Use the read\-only policies for these services to give the user access to metrics and trace data\. - -When you configure triggers for your function, you need access to use the AWS service that invokes your function\. For example, to configure an Amazon S3 trigger, you need permission to use the Amazon S3 actions that manage bucket notifications\. Many of these permissions are included in the **AWSLambdaFullAccess** managed policy\. Example policies are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. - -## Layer development and use - -The following policy grants a user permission to create layers and use them with functions\. The resource patterns allow the user to work in any AWS Region and with any layer version, as long as the name of the layer starts with `test-`\. - -**Example layer development policy** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "PublishLayers", - "Effect": "Allow", - "Action": [ - "lambda:PublishLayerVersion" - ], - "Resource": "arn:aws:lambda:*:*:layer:test-*" - }, - { - "Sid": "ManageLayerVersions", - "Effect": "Allow", - "Action": [ - "lambda:GetLayerVersion", - "lambda:DeleteLayerVersion" - ], - "Resource": "arn:aws:lambda:*:*:layer:test-*:*" - } - ] -} -``` - -You can also enforce layer use during function creation and configuration with the `lambda:Layer` condition\. For example, you can prevent users from using layers published by other accounts\. The following policy adds a condition to the `CreateFunction` and `UpdateFunctionConfiguration` actions to require that any layers specified come from account `123456789012`\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "ConfigureFunctions", - "Effect": "Allow", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Resource": "*", - "Condition": { - "ForAllValues:StringLike": { - "lambda:Layer": [ - "arn:aws:lambda:*:123456789012:layer:*:*" - ] - } - } - } - ] -} -``` - -To ensure that the condition applies, verify that no other statements grant the user permission to these actions\. - -## Cross\-account roles - -You can apply any of the preceding policies and statements to a role, which you can then share with another account to give it access to your Lambda resources\. Unlike an IAM user, a role doesn't have credentials for authentication\. Instead, it has a *trust policy* that specifies who can assume the role and use its permissions\. - -You can use cross\-account roles to give accounts that you trust access to Lambda actions and resources\. If you just want to grant permission to invoke a function or use a layer, use [resource\-based policies](access-control-resource-based.md) instead\. - -For more information, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *IAM User Guide*\. - -## Condition keys for VPC settings - -You can use condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can enforce that all Lambda functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the functions are allowed to use, or are denied from using\. - -For more information, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. \ No newline at end of file diff --git a/doc_source/access-control-resource-based.md b/doc_source/access-control-resource-based.md deleted file mode 100644 index 26bb3390..00000000 --- a/doc_source/access-control-resource-based.md +++ /dev/null @@ -1,266 +0,0 @@ -# Using resource\-based policies for Lambda - -Lambda supports resource\-based permissions policies for Lambda functions and layers\. Resource\-based policies let you grant usage permission to other AWS accounts or organizations on a per\-resource basis\. You also use a resource\-based policy to allow an AWS service to invoke your function on your behalf\. - -For Lambda functions, you can [grant an account permission](#permissions-resource-xaccountinvoke) to invoke or manage a function\. You can also use a single resource\-based policy to grant permissions to an entire organization in AWS Organizations\. You can also use resource\-based policies to [grant invoke permission to an AWS service](#permissions-resource-serviceinvoke) that invokes a function in response to activity in your account\. - -**To view a function's resource\-based policy** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Permissions**\. - -1. Scroll down to **Resource\-based policy** and then choose **View policy document**\. The resource\-based policy shows the permissions that are applied when another account or AWS service attempts to access the function\. The following example shows a statement that allows Amazon S3 to invoke a function named `my-function` for a bucket named `my-bucket` in account `123456789012`\. -**Example Resource\-based policy** - - ``` - { - "Version": "2012-10-17", - "Id": "default", - "Statement": [ - { - "Sid": "lambda-allow-s3-my-function", - "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" - } - } - } - ] - } - ``` - -For Lambda layers, you can only use a resource\-based policy on a specific layer version, instead of the entire layer\. In addition to policies that grant permission to a single account or multiple accounts, for layers, you can also grant permission to all accounts in an organization\. - -**Note** -You can only update resource\-based policies for Lambda resources within the scope of the [AddPermission](API_AddPermission.md) and [AddLayerVersionPermission](API_AddLayerVersionPermission.md) API actions\. Currently, you can't author policies for your Lambda resources in JSON, or use conditions that don't map to parameters for those actions\. - -Resource\-based policies apply to a single function, version, alias, or layer version\. They grant permission to one or more services and accounts\. For trusted accounts that you want to have access to multiple resources, or to use API actions that resource\-based policies don't support, you can use [cross\-account roles](access-control-identity-based.md)\. - -**Topics** -+ [Granting function access to AWS services](#permissions-resource-serviceinvoke) -+ [Granting function access to an organization](#permissions-resource-xorginvoke) -+ [Granting function access to other accounts](#permissions-resource-xaccountinvoke) -+ [Granting layer access to other accounts](#permissions-resource-xaccountlayer) -+ [Cleaning up resource\-based policies](#permissions-resource-cleanup) - -## Granting function access to AWS services - -When you [use an AWS service to invoke your function](lambda-services.md), you grant permission in a statement on a resource\-based policy\. You can apply the statement to the entire function to be invoked or managed, or limit the statement to a single version or alias\. - -**Note** -When you add a trigger to your function with the Lambda console, the console updates the function's resource\-based policy to allow the service to invoke it\. To grant permissions to other accounts or services that aren't available in the Lambda console, you can use the AWS CLI\. - -Add a statement with the `add-permission` command\. The simplest resource\-based policy statement allows a service to invoke a function\. The following command grants Amazon SNS permission to invoke a function named `my-function`\. - -``` -aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns \ ---principal sns.amazonaws.com --output text -``` - -You should see the following output: - -``` -{"Sid":"sns","Effect":"Allow","Principal":{"Service":"sns.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} -``` - -This lets Amazon SNS call the `lambda:Invoke` API for the function, but it doesn't restrict the Amazon SNS topic that triggers the invocation\. To ensure that your function is only invoked by a specific resource, specify the Amazon Resource Name \(ARN\) of the resource with the `source-arn` option\. The following command only allows Amazon SNS to invoke the function for subscriptions to a topic named `my-topic`\. - -``` -aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id sns-my-topic \ ---principal sns.amazonaws.com --source-arn arn:aws:sns:us-east-2:123456789012:my-topic -``` - -Some services can invoke functions in other accounts\. If you specify a source ARN that has your account ID in it, that isn't an issue\. For Amazon S3, however, the source is a bucket whose ARN doesn't have an account ID in it\. It's possible that you could delete the bucket and another account could create a bucket with the same name\. Use the `source-account` option with your account ID to ensure that only resources in your account can invoke the function\. - -``` -aws lambda add-permission --function-name my-function --action lambda:InvokeFunction --statement-id s3-account \ ---principal s3.amazonaws.com --source-arn arn:aws:s3:::my-bucket-123456 --source-account 123456789012 -``` - -## Granting function access to an organization - -To grant permissions to an organization in AWS Organizations, specify the organization ID as the `principal-org-id`\. The following [AddPermission](API_AddPermission.md) AWS CLI command grants invocation access to all users in organization `o-a1b2c3d4e5f`\. - -``` -aws lambda add-permission --function-name example \ ---statement-id PrincipalOrgIDExample --action lambda:InvokeFunction \ ---principal * --principal-org-id o-a1b2c3d4e5f -``` - -**Note** -In this command, `Principal` is `*`\. This means that all users in the organization `o-a1b2c3d4e5f` get function invocation permissions\. If you specify an AWS account or role as the `Principal`, then only that principal gets function invocation permissions, but only if they are also part of the `o-a1b2c3d4e5f` organization\. - -This command creates a resource\-based policy that looks like the following: - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "PrincipalOrgIDExample", - "Effect": "Allow", - "Principal": "*", - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:example", - "Condition": { - "StringEquals": { - "aws:PrincipalOrgID": "o-a1b2c3d4e5f" - } - } - } - ] -} -``` - -For more information, see [ aws:PrincipalOrgID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-principalorgid) in the AWS Identity and Access Management user guide\. - -## Granting function access to other accounts - -To grant permissions to another AWS account, specify the account ID as the `principal`\. The following example grants account `111122223333` permission to invoke `my-function` with the `prod` alias\. - -``` -aws lambda add-permission --function-name my-function:prod --statement-id xaccount --action lambda:InvokeFunction \ ---principal 111122223333 --output text -``` - -You should see the following output: - -``` -{"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function"} -``` - -The resource\-based policy grants permission for the other account to access the function, but doesn't allow users in that account to exceed their permissions\. Users in the other account must have the corresponding [user permissions](access-control-identity-based.md) to use the Lambda API\. - -To limit access to a user or role in another account, specify the full ARN of the identity as the principal\. For example, `arn:aws:iam::123456789012:user/developer`\. - -The [alias](configuration-aliases.md) limits which version the other account can invoke\. It requires the other account to include the alias in the function ARN\. - -``` -aws lambda invoke --function-name arn:aws:lambda:us-west-2:123456789012:function:my-function:prod out -``` - -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "1" -} -``` - -The function owner can then update the alias to point to a new version without the caller needing to change the way they invoke your function\. This ensures that the other account doesn't need to change its code to use the new version, and it only has permission to invoke the version of the function associated with the alias\. - -You can grant cross\-account access for most API actions that [operate on an existing function](lambda-api-permissions-ref.md#permissions-resources-function)\. For example, you could grant access to `lambda:ListAliases` to let an account get a list of aliases, or `lambda:GetFunction` to let them download your function code\. Add each permission separately, or use `lambda:*` to grant access to all actions for the specified function\. - -**Cross\-account APIs** - -Currently, Lambda doesn’t support cross\-account actions for all of its APIs via resource\-based policies\. The following APIs are supported: -+ [Invoke](API_Invoke.md) -+ [GetFunction](API_GetFunction.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [DeleteFunction](API_DeleteFunction.md) -+ [PublishVersion](API_PublishVersion.md) -+ [ListVersionsByFunction](API_ListVersionsByFunction.md) -+ [CreateAlias](API_CreateAlias.md) -+ [GetAlias](API_GetAlias.md) -+ [ListAliases](API_ListAliases.md) -+ [UpdateAlias](API_UpdateAlias.md) -+ [DeleteAlias](API_DeleteAlias.md) -+ [GetPolicy](API_GetPolicy.md) -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) -+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [ListTags](API_ListTags.md) -+ [TagResource](API_TagResource.md) -+ [UntagResource](API_UntagResource.md) - -To grant other accounts permission for multiple functions, or for actions that don't operate on a function, we recommend that you use [IAM roles](access-control-identity-based.md)\. - -## Granting layer access to other accounts - -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. - -``` -aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 111122223333 --version-number 1 --output text -``` - -You should see output similar to the following: - -``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} -``` - -Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. - -To grant permission to all accounts in an organization, use the `organization-id` option\. The following example grants all accounts in an organization permission to use version 3 of a layer\. - -``` -aws lambda add-layer-version-permission --layer-name my-layer \ ---statement-id engineering-org --version-number 3 --principal '*' \ ---action lambda:GetLayerVersion --organization-id o-t194hfs8cz --output text -``` - -You should see the following output: - -``` -b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" -``` - -To grant permission to all AWS accounts, use `*` for the principal, and omit the organization ID\. For multiple accounts or organizations, you need to add multiple statements\. - -## Cleaning up resource\-based policies - -To view a function's resource\-based policy, use the `get-policy` command\. - -``` -aws lambda get-policy --function-name my-function --output text -``` - -You should see the following output: - -``` -{"Version":"2012-10-17","Id":"default","Statement":[{"Sid":"sns","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Action":"lambda:InvokeFunction","Resource":"arn:aws:lambda:us-east-2:123456789012:function:my-function","Condition":{"ArnLike":{"AWS:SourceArn":"arn:aws:sns:us-east-2:123456789012:lambda*"}}}]} 7c681fc9-b791-4e91-acdf-eb847fdaa0f0 -``` - -For versions and aliases, append the version number or alias to the function name\. - -``` -aws lambda get-policy --function-name my-function:PROD -``` - -To remove permissions from your function, use `remove-permission`\. - -``` -aws lambda remove-permission --function-name example --statement-id sns -``` - -Use the `get-layer-version-policy` command to view the permissions on a layer\. - -``` -aws lambda get-layer-version-policy --layer-name my-layer --version-number 3 --output text -``` - -You should see the following output: - -``` -b0cd9796-d4eb-4564-939f-de7fe0b42236 {"Sid":"engineering-org","Effect":"Allow","Principal":"*","Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-west-2:123456789012:layer:my-layer:3","Condition":{"StringEquals":{"aws:PrincipalOrgID":"o-t194hfs8cz"}}}" -``` - -Use `remove-layer-version-permission` to remove statements from the policy\. - -``` -aws lambda remove-layer-version-permission --layer-name my-layer --version-number 3 --statement-id engineering-org -``` \ No newline at end of file diff --git a/doc_source/applications-console.md b/doc_source/applications-console.md deleted file mode 100644 index 6d9fe420..00000000 --- a/doc_source/applications-console.md +++ /dev/null @@ -1,91 +0,0 @@ -# Managing applications in the AWS Lambda console - -The AWS Lambda console helps you monitor and manage your [Lambda applications](deploying-lambda-apps.md)\. The **Applications** menu lists AWS CloudFormation stacks with Lambda functions\. The menu includes stacks that you launch in AWS CloudFormation by using the AWS CloudFormation console, the AWS Serverless Application Repository, the AWS CLI, or the AWS SAM CLI\. - -**To view a Lambda application** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose an application\. -![\[A monitoring widget.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/applications-page.png) - -The overview shows the following information about your application\. -+ **AWS CloudFormation template** or **SAM template** – The template that defines your application\. -+ **Resources** – The AWS resources that are defined in your application's template\. To manage your application's Lambda functions, choose a function name from the list\. - -## Monitoring applications - -The **Monitoring** tab shows an Amazon CloudWatch dashboard with aggregate metrics for the resources in your application\. - -**To monitor a Lambda application** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose **Monitoring**\. - -By default, the Lambda console shows a basic dashboard\. You can customize this page by defining custom dashboards in your application template\. When your template includes one or more dashboards, the page shows your dashboards instead of the default dashboard\. You can switch between dashboards with the drop\-down menu on the top right of the page\. - -## Custom monitoring dashboards - -Customize your application monitoring page by adding one or more Amazon CloudWatch dashboards to your application template with the [AWS::CloudWatch::Dashboard](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dashboard.html) resource type\. The following example creates a dashboard with a single widget that graphs the number of invocations of a function named `my-function`\. - -**Example function dashboard template** - -``` -Resources: - MyDashboard: - Type: AWS::CloudWatch::Dashboard - Properties: - DashboardName: my-dashboard - DashboardBody: | - { - "widgets": [ - { - "type": "metric", - "width": 12, - "height": 6, - "properties": { - "metrics": [ - [ - "AWS/Lambda", - "Invocations", - "FunctionName", - "my-function", - { - "stat": "Sum", - "label": "MyFunction" - } - ], - [ - { - "expression": "SUM(METRICS())", - "label": "Total Invocations" - } - ] - ], - "region": "us-east-1", - "title": "Invocations", - "view": "timeSeries", - "stacked": false - } - } - ] - } -``` - -You can get the definition for any of the widgets in the default monitoring dashboard from the CloudWatch console\. - -**To view a widget definition** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose an application that has the standard dashboard\. - -1. Choose **Monitoring**\. - -1. On any widget, choose **View in metrics** from the drop\-down menu\. -![\[A monitoring widget.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/applications-monitoring-widget.png) - -1. Choose **Source**\. - -For more information about authoring CloudWatch dashboards and widgets, see [Dashboard body structure and syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html) in the *Amazon CloudWatch API Reference*\. \ No newline at end of file diff --git a/doc_source/applications-tutorial.md b/doc_source/applications-tutorial.md deleted file mode 100644 index c5b60a90..00000000 --- a/doc_source/applications-tutorial.md +++ /dev/null @@ -1,351 +0,0 @@ -# Creating an application with continuous delivery in the Lambda console - -You can use the Lambda console to create an application with an integrated continuous delivery pipeline\. With continuous delivery, every change that you push to your source control repository triggers a pipeline that builds and deploys your application automatically\. The Lambda console provides starter projects for common application types with Node\.js sample code and templates that create supporting resources\. - -In this tutorial, you create the following resources\. -+ **Application** – A Node\.js Lambda function, build specification, and AWS Serverless Application Model \(AWS SAM\) template\. -+ **Pipeline** – An AWS CodePipeline pipeline that connects the other resources to enable continuous delivery\. -+ **Repository** – A Git repository in AWS CodeCommit\. When you push a change, the pipeline copies the source code into an Amazon S3 bucket and passes it to the build project\. -+ **Trigger** – An Amazon EventBridge \(CloudWatch Events\) rule that watches the main branch of the repository and triggers the pipeline\. -+ **Build project** – An AWS CodeBuild build that gets the source code from the pipeline and packages the application\. The source includes a build specification with commands that install dependencies and prepare the application template for deployment\. -+ **Deployment configuration** – The pipeline's deployment stage defines a set of actions that take the processed AWS SAM template from the build output, and deploy the new version with AWS CloudFormation\. -+ **Bucket** – An Amazon Simple Storage Service \(Amazon S3\) bucket for deployment artifact storage\. -+ **Roles** – The pipeline's source, build, and deploy stages have IAM roles that allow them to manage AWS resources\. The application's function has an [execution role](lambda-intro-execution-role.md) that allows it to upload logs and can be extended to access other services\. - -Your application and pipeline resources are defined in AWS CloudFormation templates that you can customize and extend\. Your application repository includes a template that you can modify to add Amazon DynamoDB tables, an Amazon API Gateway API, and other application resources\. The continuous delivery pipeline is defined in a separate template outside of source control and has its own stack\. - -The pipeline maps a single branch in a repository to a single application stack\. You can create additional pipelines to add environments for other branches in the same repository\. You can also add stages to your pipeline for testing, staging, and manual approvals\. For more information about AWS CodePipeline, see [What is AWS CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html)\. - -**Topics** -+ [Prerequisites](#applications-tutorial-prepare) -+ [Create an application](#applications-tutorial-wizard) -+ [Invoke the function](#applications-tutorial-invoke) -+ [Add an AWS resource](#applications-tutorial-update) -+ [Update the permissions boundary](#applications-tutorial-permissions) -+ [Update the function code](#applications-tutorial-code) -+ [Next steps](#applications-tutorial-nextsteps) -+ [Troubleshooting](#applications-tutorial-troubleshooting) -+ [Clean up](#applications-tutorial-cleanup) - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -This tutorial uses CodeCommit for source control\. To set up your local machine to access and update application code, see [Setting up](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up.html) in the *AWS CodeCommit User Guide*\. - -## Create an application - -Create an application in the Lambda console\. In Lambda, an application is an AWS CloudFormation stack with a Lambda function and any number of supporting resources\. In this tutorial, you create an application that has a function and its execution role\. - -**To create an application** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose **Create application**\. - -1. Choose **Author from scratch**\. - -1. Configure application settings\. - + **Application name** – **my\-app**\. - + **Runtime** – **Node\.js 14\.x**\. - + **Source control service** – **CodeCommit**\. - + **Repository name** – **my\-app\-repo**\. - + **Permissions** – **Create roles and permissions boundary**\. - -1. Choose **Create**\. - -Lambda creates the pipeline and related resources and commits the sample application code to the Git repository\. As resources are created, they appear on the overview page\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-resources.png) - -The **Infrastructure** stack contains the repository, build project, and other resources that combine to form a continuous delivery pipeline\. When this stack finishes deploying, it in turn deploys the application stack that contains the function and execution role\. These are the application resources that appear under **Resources**\. - -## Invoke the function - -When the deployment process completes, invoke the function from the Lambda console\. - -**To invoke the application's function** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose **my\-app**\. - -1. Under **Resources**, choose **helloFromLambdaFunction**\. - -1. Choose **Test**\. - -1. Configure a test event\. - + **Event name** – **event** - + **Body** – **\{\}** - -1. Choose **Create**\. - -1. Choose **Test**\. - -The Lambda console runs your function and displays the result\. Expand the **Details** section under the result to see the output and execution details\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-result.png) - -## Add an AWS resource - -In the previous step, Lambda console created a Git repository that contains function code, a template, and a build specification\. You can add resources to your application by modifying the template and pushing changes to the repository\. To get a copy of the application on your local machine, clone the repository\. - -**To clone the project repository** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose **my\-app**\. - -1. Choose **Code**\. - -1. Under **Repository details**, copy the HTTP or SSH repository URI, depending on the authentication mode that you configured during [setup](#applications-tutorial-prepare)\. - -1. To clone the repository, use the `git clone` command\. - - ``` - git clone ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/my-app-repo - ``` - -To add a DynamoDB table to the application, define an `AWS::Serverless::SimpleTable` resource in the template\. - -**To add a DynamoDB table** - -1. Open `template.yml` in a text editor\. - -1. Add a table resource, an environment variable that passes the table name to the function, and a permissions policy that allows the function to manage it\. -**Example template\.yml \- resources** - - ``` - ... - Resources: - ddbTable: - Type: AWS::Serverless::SimpleTable - Properties: - PrimaryKey: - Name: id - Type: String - ProvisionedThroughput: - ReadCapacityUnits: 1 - WriteCapacityUnits: 1 - helloFromLambdaFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: ./ - Handler: src/handlers/hello-from-lambda.helloFromLambdaHandler - Runtime: nodejs14.x - MemorySize: 128 - Timeout: 60 - Description: A Lambda function that returns a static string. - Environment: - Variables: - DDB_TABLE: !Ref ddbTable - Policies: - - DynamoDBCrudPolicy: - TableName: !Ref ddbTable - - AWSLambdaBasicExecutionRole - ``` - -1. Commit and push the change\. - - ``` - git commit -am "Add DynamoDB table" - git push - ``` - -When you push a change, it triggers the application's pipeline\. Use the **Deployments** tab of the application screen to track the change as it flows through the pipeline\. When the deployment is complete, proceed to the next step\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-deployment.png) - -## Update the permissions boundary - -The sample application applies a *permissions boundary* to its function's execution role\. The permissions boundary limits the permissions that you can add to the function's role\. Without the boundary, users with write access to the project repository could modify the project template to give the function permission to access resources and services outside of the scope of the sample application\. - -In order for the function to use the DynamoDB permission that you added to its execution role in the previous step, you must extend the permissions boundary to allow the additional permissions\. The Lambda console detects resources that aren't in the permissions boundary and provides an updated policy that you can use to update it\. - -**To update the application's permissions boundary** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose your application\. - -1. Under **Resources**, choose **Edit permissions boundary**\. - -1. Follow the instructions shown to update the boundary to allow access to the new table\. - -For more information about permissions boundaries, see [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md)\. - -## Update the function code - -Next, update the function code to use the table\. The following code uses the DynamoDB table to track the number of invocations processed by each instance of the function\. It uses the log stream ID as a unique identifier for the function instance\. - -**To update the function code** - -1. Add a new handler named `index.js` to the `src/handlers` folder with the following content\. -**Example src/handlers/index\.js** - - ``` - const dynamodb = require('aws-sdk/clients/dynamodb'); - const docClient = new dynamodb.DocumentClient(); - - exports.handler = async (event, context) => { - const message = 'Hello from Lambda!'; - const tableName = process.env.DDB_TABLE; - const logStreamName = context.logStreamName; - var params = { - TableName : tableName, - Key: { id : logStreamName }, - UpdateExpression: 'set invocations = if_not_exists(invocations, :start) + :inc', - ExpressionAttributeValues: { - ':start': 0, - ':inc': 1 - }, - ReturnValues: 'ALL_NEW' - }; - await docClient.update(params).promise(); - - const response = { - body: JSON.stringify(message) - }; - console.log(`body: ${response.body}`); - return response; - } - ``` - -1. Open the application template and change the handler value to `src/handlers/index.handler`\. -**Example template\.yml** - - ``` - ... - helloFromLambdaFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: ./ - Handler: src/handlers/index.handler - Runtime: nodejs14.x - ``` - -1. Commit and push the change\. - - ``` - git add . && git commit -m "Use DynamoDB table" - git push - ``` - -After the code change is deployed, invoke the function a few times to update the DynamoDB table\. - -**To view the DynamoDB table** - -1. Open the [Tables page of the DynamoDB console](https://console.aws.amazon.com/dynamodb/home#tables:)\. - -1. Choose the table that starts with **my\-app**\. - -1. Choose **Items**\. - -1. Choose **Start search**\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/application-create-ddbtable.png) - -Lambda creates additional instances of your function to handle multiple concurrent invocations\. Each log stream in the CloudWatch Logs log group corresponds to a function instance\. A new function instance is also created when you change your function's code or configuration\. For more information on scaling, see [Lambda function scaling](invocation-scaling.md)\. - -## Next steps - -The AWS CloudFormation template that defines your application resources uses the AWS Serverless Application Model transform to simplify the syntax for resource definitions, and automate uploading the deployment package and other artifacts\. AWS SAM also provides a command line interface \(the AWS SAM CLI\), which has the same packaging and deployment functionality as the AWS CLI, with additional features specific to Lambda applications\. Use the AWS SAM CLI to test your application locally in a Docker container that emulates the Lambda execution environment\. -+ [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) -+ [Testing and debugging serverless applications with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html) -+ [Deploying serverless applications using CI/CD systems with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) - -AWS Cloud9 provides an online development environment that includes Node\.js, the AWS SAM CLI, and Docker\. With AWS Cloud9, you can start developing quickly and access your development environment from any computer\. For instructions, see [Getting started](https://docs.aws.amazon.com/cloud9/latest/user-guide/get-started.html) in the *AWS Cloud9 User Guide*\. - -For local development, AWS toolkits for integrated development environments \(IDEs\) let you test and debug functions before pushing them to your repository\. -+ [AWS Toolkit for JetBrains](https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/) – Plugin for PyCharm \(Python\) and IntelliJ \(Java\) IDEs\. -+ [AWS Toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/) – Plugin for Eclipse IDE \(multiple languages\)\. -+ [AWS Toolkit for Visual Studio Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/) – Plugin for Visual Studio Code IDE \(multiple languages\)\. -+ [AWS Toolkit for Visual Studio](https://docs.aws.amazon.com/AWSToolkitVS/latest/UserGuide/) – Plugin for Visual Studio IDE \(multiple languages\)\. - -## Troubleshooting - -As you develop your application, you will likely encounter the following types of errors\. -+ **Build errors** – Issues that occur during the build phase, including compilation, test, and packaging errors\. -+ **Deployment errors** – Issues that occur when AWS CloudFormation isn't able to update the application stack\. These include permissions errors, account quotas, service issues, or template errors\. -+ **Invocation errors** – Errors that are returned by a function's code or runtime\. - -For build and deployment errors, you can identify the cause of an error in the Lambda console\. - -**To troubleshoot application errors** - -1. Open the Lambda console [Applications page](https://console.aws.amazon.com/lambda/home#/applications)\. - -1. Choose an application\. - -1. Choose **Deployments**\. - -1. To view the application's pipeline, choose **Deployment pipeline**\. - -1. Identify the action that encountered an error\. - -1. To view the error in context, choose **Details**\. - -For deployment errors that occur during the **ExecuteChangeSet** action, the pipeline links to a list of stack events in the AWS CloudFormation console\. Search for an event with the status **UPDATE\_FAILED**\. Because AWS CloudFormation rolls back after an error, the relevant event is under several other events in the list\. If AWS CloudFormation could not create a change set, the error appears under **Change sets** instead of under **Events**\. - -A common cause of deployment and invocation errors is a lack of permissions in one or more roles\. The pipeline has a role for deployments \(`CloudFormationRole`\) that's equivalent to the [user permissions](access-control-identity-based.md) that you would use to update an AWS CloudFormation stack directly\. If you add resources to your application or enable Lambda features that require user permissions, the deployment role is used\. You can find a link to the deployment role under **Infrastructure** in the application overview\. - -If your function accesses other AWS services or resources, or if you enable features that require the function to have additional permissions, the function's [execution role](lambda-intro-execution-role.md) is used\. All execution roles that are created in your application template are also subject to the application's permissions boundary\. This boundary requires you to explicitly grant access to additional services and resources in IAM after adding permissions to the execution role in the template\. - -For example, to [connect a function to a virtual private cloud](configuration-vpc.md) \(VPC\), you need user permissions to describe VPC resources\. The execution role needs permission to manage network interfaces\. This requires the following steps\. - -1. Add the required user permissions to the deployment role in IAM\. - -1. Add the execution role permissions to the permissions boundary in IAM\. - -1. Add the execution role permissions to the execution role in the application template\. - -1. Commit and push to deploy the updated execution role\. - -After you address permissions errors, choose **Release change** in the pipeline overview to rerun the build and deployment\. - -## Clean up - -You can continue to modify and use the sample to develop your own application\. If you are done using the sample, delete the application to avoid paying for the pipeline, repository, and storage\. - -**To delete the application** - -1. Open the [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation)\. - -1. Delete the application stack – **my\-app**\. - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Delete the artifact bucket – ***us\-east\-2*\-*123456789012*\-my\-app\-pipe**\. - -1. Return to the AWS CloudFormation console and delete the infrastructure stack – **serverlessrepo\-my\-app\-toolchain**\. - -Function logs are not associated with the application or infrastructure stack in AWS CloudFormation\. Delete the log group separately in the CloudWatch Logs console\. - -**To delete the log group** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the Amazon CloudWatch console\. - -1. Choose the function's log group \(`/aws/lambda/my-app-helloFromLambdaFunction-YV1VXMPLK7QK`\)\. - -1. Choose **Actions**, and then choose **Delete log group**\. - -1. Choose **Yes, Delete**\. \ No newline at end of file diff --git a/doc_source/applications-usecases.md b/doc_source/applications-usecases.md deleted file mode 100644 index dcc91b89..00000000 --- a/doc_source/applications-usecases.md +++ /dev/null @@ -1,43 +0,0 @@ -# Common Lambda application types and use cases - -Lambda functions and triggers are the core components of building applications on AWS Lambda\. A Lambda function is the code and runtime that process events, while a trigger is the AWS service or application that invokes the function\. To illustrate, consider the following scenarios: -+ **File processing** – Suppose you have a photo sharing application\. People use your application to upload photos, and the application stores these user photos in an Amazon S3 bucket\. Then, your application creates a thumbnail version of each user's photos and displays them on the user's profile page\. In this scenario, you may choose to create a Lambda function that creates a thumbnail automatically\. Amazon S3 is one of the supported AWS event sources that can publish *object\-created events* and invoke your Lambda function\. Your Lambda function code can read the photo object from the S3 bucket, create a thumbnail version, and then save it in another S3 bucket\. -+ **Data and analytics** – Suppose you are building an analytics application and storing raw data in a DynamoDB table\. When you write, update, or delete items in a table, DynamoDB streams can publish item update events to a stream associated with the table\. In this case, the event data provides the item key, event name \(such as insert, update, and delete\), and other relevant details\. You can write a Lambda function to generate custom metrics by aggregating raw data\. -+ **Websites** – Suppose you are creating a website and you want to host the backend logic on Lambda\. You can invoke your Lambda function over HTTP using Amazon API Gateway as the HTTP endpoint\. Now, your web client can invoke the API, and then API Gateway can route the request to Lambda\. -+ **Mobile applications** – Suppose you have a custom mobile application that produces events\. You can create a Lambda function to process events published by your custom application\. For example, you can configure a Lambda function to process the clicks within your custom mobile application\. - -AWS Lambda supports many AWS services as event sources\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. When you configure these event sources to trigger a Lambda function, the Lambda function is invoked automatically when events occur\. You define *event source mapping*, which is how you identify what events to track and which Lambda function to invoke\. - -The following are introductory examples of event sources and how the end\-to\-end experience works\. - -## Example 1: Amazon S3 pushes events and invokes a Lambda function - -Amazon S3 can publish events of different types, such as PUT, POST, COPY, and DELETE object events on a bucket\. Using the bucket notification feature, you can configure an event source mapping that directs Amazon S3 to invoke a Lambda function when a specific type of event occurs\. - -The following is a typical sequence: - -1. The user creates an object in a bucket\. - -1. Amazon S3 detects the object created event\. - -1. Amazon S3 invokes your Lambda function using the permissions provided by the [execution role](lambda-intro-execution-role.md)\. - -1. AWS Lambda runs the Lambda function, specifying the event as a parameter\. - -You configure Amazon S3 to invoke your function as a bucket notification action\. To grant Amazon S3 permission to invoke the function, update the function's [resource\-based policy](access-control-resource-based.md)\. - -## Example 2: AWS Lambda pulls events from a Kinesis stream and invokes a Lambda function - -For poll\-based event sources, AWS Lambda polls the source and then invokes the Lambda function when records are detected on that source\. -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) - -The following steps describe how a custom application writes records to a Kinesis stream: - -1. The custom application writes records to a Kinesis stream\. - -1. AWS Lambda continuously polls the stream, and invokes the Lambda function when the service detects new records on the stream\. AWS Lambda knows which stream to poll and which Lambda function to invoke based on the event source mapping you create in Lambda\. - -1. The Lambda function is invoked with the incoming event\. - -When working with stream\-based event sources, you create event source mappings in AWS Lambda\. Lambda reads items from the stream and invokes the function synchronously\. You don't need to grant Lambda permission to invoke the function, but it does need permission to read from the stream\. \ No newline at end of file diff --git a/doc_source/attribute-based-access-control.md b/doc_source/attribute-based-access-control.md deleted file mode 100644 index 8f7301f0..00000000 --- a/doc_source/attribute-based-access-control.md +++ /dev/null @@ -1,169 +0,0 @@ -# Attribute\-based access control for Lambda - -With [attribute\-based access control \(ABAC\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html), you can use tags to control access to your Lambda functions\. You can attach tags to a Lambda function, pass them in certain API requests, or attach them to the AWS Identity and Access Management \(IAM\) principal making the request\. For more information about how AWS grants attribute\-based access, see [Controlling access to AWS resources using tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html) in the *IAM User Guide*\. - -You can use ABAC to [grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) without specifying an Amazon Resource Name \(ARN\) or ARN pattern in the IAM policy\. Instead, you can specify a tag in the [condition element](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) of an IAM policy to control access\. Scaling is easier with ABAC because you don't have to update your IAM policies when you create new functions\. Instead, add tags to the new functions to control access\. - -In Lambda, tags work at the function level\. Tags aren't supported for layers, code signing configurations, or event source mappings\. When you tag a function, those tags apply to all versions and aliases associated with the function\. For information about how to tag functions, see [Using tags on Lambda functions](configuration-tags.md)\. - -You can use the following condition keys to control function actions: -+ [aws:ResourceTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag): Control access based on the tags that are attached to Lambda functions\. -+ [aws:RequestTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag): Require tags to be present in a request, such as when creating a new function\. -+ [aws:PrincipalTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-principaltag): Control what the IAM principal \(the person making the request\) is allowed to do based on the tags that are attached to their IAM [user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags_users.html) or [role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags_roles.html)\. -+ [aws:TagKeys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys): Control whether specific tag keys can be used in a request\. - -For a complete list of Lambda actions that support ABAC, see [Function actions](lambda-api-permissions-ref.md#permissions-resources-function) and check the **Condition** column in the table\. - -The following steps demonstrate one way to set up permissions using ABAC\. In this example scenario, you'll create four IAM permissions policies\. Then, you'll attach these policies to a new IAM role\. Finally, you'll create an IAM user and give that user permission to assume the new role\. - -## Prerequisites - -Make sure that you have a [Lambda execution role](lambda-intro-execution-role.md)\. You'll use this role when you grant IAM permissions and when you create a Lambda function\. - -## Step 1: Require tags on new functions - -When using ABAC with Lambda, it's a best practice to require that all functions have tags\. This helps ensure that your ABAC permissions policies work as expected\. - -[Create an IAM policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) similar to the following example\. This policy uses the [aws:RequestTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag) and [aws:TagKeys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys) condition keys to require that new functions and the IAM principal creating the functions both have the `project` tag\. The `ForAllValues` modifier ensures that `project` is the only allowed tag\. If you don't include the `ForAllValues` modifier, users can add other tags to the function as long as they also pass `project`\. - -**Example – Require tags on new functions** - -``` -{ - "Version": "2012-10-17", - "Statement": { - "Effect": "Allow", - "Action": [ - "lambda:CreateFunction", - "lambda:TagResource" - ], - "Resource": "arn:aws:lambda:*:*:function:*", - "Condition": { - "StringEquals": { - "aws:RequestTag/project": "${aws:PrincipalTag/project}" - }, - "ForAllValues:StringEquals": { - "aws:TagKeys": "project" - } - } - } -} -``` - -## Step 2: Allow actions based on tags attached to a Lambda function and IAM principal - -Create a second IAM policy using the [aws:ResourceTag/tag\-key](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag) condition key to require the principal's tag to match the tag that's attached to the function\. The following example policy allows principals with the `project` tag to invoke functions with the `project` tag\. If a function has any other tags, the action is denied\. - -**Example – Require matching tags on function and IAM principal** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction", - "lambda:GetFunction" - ], - "Resource": "arn:aws:lambda:*:*:function:*", - "Condition": { - "StringEquals": { - "aws:ResourceTag/project": "${aws:PrincipalTag/project}" - } - } - } - ] -} -``` - -## Step 3: Grant list permissions - -Create a policy that allows the principal to list Lambda functions and IAM roles\. This allows the principal to see all Lambda functions and IAM roles on the console and when calling the API actions\. - -**Example – Grant Lambda and IAM list permissions** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "AllResourcesLambdaNoTags", - "Effect": "Allow", - "Action": [ - "lambda:GetAccountSettings", - "lambda:ListFunctions", - "iam:ListRoles" - ], - "Resource": "*" - } - ] -} -``` - -## Step 4: Grant IAM permissions - -Create a policy that allows **iam:PassRole**\. This permission is required when you assign an execution role to a function\. In the following example policy, replace the example ARN with the ARN of your Lambda execution role\. - -**Note** -Do not use the `ResourceTag` condition key in a policy with the `iam:PassRole` action\. You cannot use the tag on an IAM role to control access to who can pass that role\. For more information about permissions required to pass a role to a service, see [Granting a user permissions to pass a role to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html)\. - -**Example – Grant permission to pass the execution role** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "iam:PassRole" - ], - "Resource": "arn:aws:iam::111122223333:role/lambda-ex" - } - ] -} -``` - -## Step 5: Create the IAM role - -It's a best practice to [use roles to delegate permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#delegate-using-roles)\. [Create an IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html#roles-creatingrole-user-console) called `abac-project-role`: -+ On **Step 1: Select trusted entity**: Choose **AWS account** and then choose **This account**\. -+ On **Step 2: Add permissions**: Attach the four IAM policies that you created in the previous steps\. -+ On **Step 3: Name, review, and create**: Choose **Add tag**\. For **Key**, enter `project`\. Don't enter a **Value**\. - -## Step 6: Create the IAM user - -[Create an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html#id_users_create_console) called `abac-test-user`\. In the **Set permissions** section, choose **Attach existing policies directly** and then choose **Create policy**\. Enter the following policy definition\. Replace *111122223333* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingYourAccountIdentifiers)\. This policy allows `abac-test-user` to assume `abac-project-role`\. - -**Example – Allow IAM user to assume ABAC role** - -``` -{ - "Version": "2012-10-17", - "Statement": { - "Effect": "Allow", - "Action": "sts:AssumeRole", - "Resource": "arn:aws:iam::111122223333:role/abac-project-role" - } -} -``` - -## Step 7: Test the permissions - -1. Sign in to the AWS console as `abac-test-user`\. For more information, see [Sign in as an IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html#user-sign-in-page)\. - -1. Switch to the `abac-project-role` role\. For more information, see [Switching to a role \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. - -1. [Create a Lambda function](configuration-tags.md#using-tags-with-the-console): - + Under **Permissions**, choose **Change default execution role**, and then for **Execution role**, choose **Use an existing role**\. Choose the same execution role that you used in [Step 4: Grant IAM permissions](#abac-iam-permissions)\. - + Under **Advanced settings**, choose **Enable tags** and then choose **Add new tag**\. For **Key**, enter `project`\. Don't enter a **Value**\. - -1. [Test the function](testing-functions.md)\. - -1. Create a second Lambda function and add a different tag, such as `environment`\. This operation should fail because the ABAC policy that you created in [Step 1: Require tags on new functions](#require-tag-on-create) only allows the principal to create functions with the `project` tag\. - -1. Create a third function without tags\. This operation should fail because the ABAC policy that you created in [Step 1: Require tags on new functions](#require-tag-on-create) doesn't allow the principal to create functions without tags\. - -This authorization strategy allows you to control access without creating new policies for each new user\. To grant access to new users, simply give them permission to assume the role that corresponds to their assigned project\. \ No newline at end of file diff --git a/doc_source/best-practices.md b/doc_source/best-practices.md deleted file mode 100644 index af5366f1..00000000 --- a/doc_source/best-practices.md +++ /dev/null @@ -1,72 +0,0 @@ -# Best practices for working with AWS Lambda functions - -The following are recommended best practices for using AWS Lambda: - -**Topics** -+ [Function code](#function-code) -+ [Function configuration](#function-configuration) -+ [Metrics and alarms](#alarming-metrics) -+ [Working with streams](#stream-events) - -For more information about best practices for Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. - -## Function code -+ **Separate the Lambda handler from your core logic\.** This allows you to make a more unit\-testable function\. In Node\.js this may look like: - - ``` - exports.myHandler = function(event, context, callback) { - var foo = event.foo; - var bar = event.bar; - var result = MyLambdaFunction (foo, bar); - - callback(null, result); - } - - function MyLambdaFunction (foo, bar) { - // MyLambdaFunction logic here - } - ``` -+ **Take advantage of execution environment reuse to improve the performance of your function\.** Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the `/tmp` directory\. Subsequent invocations processed by the same instance of your function can reuse these resources\. This saves cost by reducing function run time\. - - To avoid potential data leaks across invocations, don’t use the execution environment to store user data, events, or other information with security implications\. If your function relies on a mutable state that can’t be stored in memory within the handler, consider creating a separate function or separate versions of a function for each user\. -+ **Use a keep\-alive directive to maintain persistent connections\.** Lambda purges idle connections over time\. Attempting to reuse an idle connection when invoking a function will result in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.aws.amazon.com//sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)\. -+ **Use [environment variables](configuration-envvars.md) to pass operational parameters to your function\.** For example, if you are writing to an Amazon S3 bucket, instead of hard\-coding the bucket name you are writing to, configure the bucket name as an environment variable\. -+ **Control the dependencies in your function's deployment package\. ** The AWS Lambda execution environment contains a number of libraries such as the AWS SDK for the Node\.js and Python runtimes \(a full list can be found here: [Lambda runtimes](lambda-runtimes.md)\)\. To enable the latest set of features and security updates, Lambda will periodically update these libraries\. These updates may introduce subtle changes to the behavior of your Lambda function\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. -+ **Minimize your deployment package size to its runtime necessities\. ** This will reduce the amount of time that it takes for your deployment package to be downloaded and unpacked ahead of invocation\. For functions authored in Java or \.NET Core, avoid uploading the entire AWS SDK library as part of your deployment package\. Instead, selectively depend on the modules which pick up components of the SDK you need \(e\.g\. DynamoDB, Amazon S3 SDK modules and [Lambda core libraries](https://github.com/aws/aws-lambda-java-libs)\)\. -+ **Reduce the time it takes Lambda to unpack deployment packages** authored in Java by putting your dependency `.jar` files in a separate /lib directory\. This is faster than putting all your function’s code in a single jar with a large number of `.class` files\. See [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) for instructions\. -+ **Minimize the complexity of your dependencies\.** Prefer simpler frameworks that load quickly on [execution environment](lambda-runtime-environment.md) startup\. For example, prefer simpler Java dependency injection \(IoC\) frameworks like [Dagger](https://google.github.io/dagger/) or [Guice](https://github.com/google/guice), over more complex ones like [Spring Framework](https://github.com/spring-projects/spring-framework)\. -+ **Avoid using recursive code** in your Lambda function, wherein the function automatically calls itself until some arbitrary criteria is met\. This could lead to unintended volume of function invocations and escalated costs\. If you do accidentally do so, set the function reserved concurrency to `0` immediately to throttle all invocations to the function, while you update the code\. -+ **Do not use non\-documented, non\-public APIs** in your Lambda function code\. For AWS Lambda managed runtimes, Lambda periodically applies security and functional updates to Lambda's internal APIs\. These internal API updates may be backwards\-incompatible, leading to unintended consequences such as invocation failures if your function has a dependency on these non\-public APIs\. See [the API reference](API_Operations.md) for a list of publicly available APIs\. -+ **Write idempotent code\.** Writing idempotent code for your functions ensures that duplicate events are handled the same way\. Your code should properly validate events and gracefully handle duplicate events\. For more information, see [How do I make my Lambda function idempotent?](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-idempotent/)\. - -## Function configuration -+ **Performance testing your Lambda function** is a crucial part in ensuring you pick the optimum memory size configuration\. Any increase in memory size triggers an equivalent increase in CPU available to your function\. The memory usage for your function is determined per\-invoke and can be viewed in [Amazon CloudWatch](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatchLogs.html)\. On each invoke a `REPORT:` entry will be made, as shown below: - - ``` - REPORT RequestId: 3604209a-e9a3-11e6-939a-754dd98c7be3 Duration: 12.34 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB - ``` - - By analyzing the `Max Memory Used:` field, you can determine if your function needs more memory or if you over\-provisioned your function's memory size\. - - **To find the right memory configuration** for your functions, we recommend using the open source AWS Lambda Power Tuning project\. For more information, see [AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) on GitHub\. - - To optimize function performance, we also recommend deploying libraries that can leverage [Advanced Vector Extensions 2 \(AVX2\)](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-avx2.html)\. This allows you to process demanding workloads, including machine learning inferencing, media processing, high performance computing \(HPC\), scientific simulations, and financial modeling\. For more information, see [ Creating faster AWS Lambda functions with AVX2](http://aws.amazon.com/blogs/compute/creating-faster-aws-lambda-functions-with-avx2/)\. -+ **Load test your Lambda function** to determine an optimum timeout value\. It is important to analyze how long your function runs so that you can better determine any problems with a dependency service that may increase the concurrency of the function beyond what you expect\. This is especially important when your Lambda function makes network calls to resources that may not handle Lambda's scaling\. -+ **Use most\-restrictive permissions when setting IAM policies\.** Understand the resources and operations your Lambda function needs, and limit the execution role to these permissions\. For more information, see [Lambda permissions](lambda-permissions.md)\. -+ **Be familiar with [Lambda quotas](gettingstarted-limits.md)\.** Payload size, file descriptors and /tmp space are often overlooked when determining runtime resource limits\. -+ **Delete Lambda functions that you are no longer using\.** By doing so, the unused functions won't needlessly count against your deployment package size limit\. -+ **If you are using Amazon Simple Queue Service** as an event source, make sure the value of the function's expected invocation time does not exceed the [Visibility Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) value on the queue\. This applies both to [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md)\. - + In the case of **CreateFunction**, AWS Lambda will fail the function creation process\. - + In the case of **UpdateFunctionConfiguration**, it could result in duplicate invocations of the function\. - -## Metrics and alarms -+ **Use [Working with Lambda function metrics](monitoring-metrics.md) and [ CloudWatch Alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html)** instead of creating or updating a metric from within your Lambda function code\. It's a much more efficient way to track the health of your Lambda functions, allowing you to catch issues early in the development process\. For instance, you can configure an alarm based on the expected duration of your Lambda function invocation in order to address any bottlenecks or latencies attributable to your function code\. -+ **Leverage your logging library and [AWS Lambda Metrics and Dimensions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/lam-metricscollected.html)** to catch app errors \(e\.g\. ERR, ERROR, WARNING, etc\.\) -+ **Use [AWS Cost Anomaly Detection](https://docs.aws.amazon.com/cost-management/latest/userguide/manage-ad.html)** to detect unusual activity on your account\. Cost Anomaly Detection uses machine learning to continuously monitor your cost and usage while minimizing false positive alerts\. Cost Anomaly Detection uses data from AWS Cost Explorer, which has a delay of up to 24 hours\. As a result, it can take up to 24 hours to detect an anomaly after usage occurs\. To get started with Cost Anomaly Detection, you must first [ sign up for Cost Explorer](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html)\. Then, [access Cost Anomaly Detection](https://docs.aws.amazon.com/cost-management/latest/userguide/settingup-ad.html#access-ad)\. - -## Working with streams -+ **Test with different batch and record sizes **so that the polling frequency of each event source is tuned to how quickly your function is able to complete its task\. The [CreateEventSourceMapping](API_CreateEventSourceMapping.md) BatchSize parameter controls the maximum number of records that can be sent to your function with each invoke\. A larger batch size can often more efficiently absorb the invoke overhead across a larger set of records, increasing your throughput\. - - By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. -+ **Increase Kinesis stream processing throughput by adding shards\.** A Kinesis stream is composed of one or more shards\. Lambda will poll each shard with at most one concurrent invocation\. For example, if your stream has 100 active shards, there will be at most 100 Lambda function invocations running concurrently\. Increasing the number of shards will directly increase the number of maximum concurrent Lambda function invocations and can increase your Kinesis stream processing throughput\. If you are increasing the number of shards in a Kinesis stream, make sure you have picked a good partition key \(see [Partition Keys](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key)\) for your data, so that related records end up on the same shards and your data is well distributed\. -+ **Use [Amazon CloudWatch](https://docs.aws.amazon.com/streams/latest/dev/monitoring-with-cloudwatch.html)** on IteratorAge to determine if your Kinesis stream is being processed\. For example, configure a CloudWatch alarm with a maximum setting to 30000 \(30 seconds\)\. \ No newline at end of file diff --git a/doc_source/codewhisperer-overview.md b/doc_source/codewhisperer-overview.md deleted file mode 100644 index e10f0d2f..00000000 --- a/doc_source/codewhisperer-overview.md +++ /dev/null @@ -1,79 +0,0 @@ -# Overview of Amazon CodeWhisperer for AWS Lambda - -This overview contains a list of Amazon CodeWhisperer user actions and common ways for you to utilize CodeWhisperer in the AWS Lambda code editor\. - -**Note** -In the Lambda console, CodeWhisperer only supports functions using the Python and Node\.js runtimes\. - -**Topics** -+ [User actions](#codewhisperer-actions) -+ [Use cases and examples](#codewhisperer-examples) - -## User actions - -When you're using the Lambda code editor, you can use the following keyboard shortcuts to perform various CodeWhisperer user actions\. - - -**CodeWhisperer user actions and keyboard shortcuts** - -| Action | Keyboard shortcut | -| --- | --- | -| Manually fetch a code suggestion | MacOS: `Option` \+ `C` Windows: `Alt` \+ `C` | -| Accept a suggestion | `Tab` | -| Reject a suggestion | `ESC`, `Backspace`, scroll in any direction, or keep typing and the recommendation automatically disappears\. | - -## Use cases and examples - -Here are some common ways for you to utilize Amazon CodeWhisperer while authoring Lambda functions\. - -### Single\-line code completion - -When you start typing out single lines of code, CodeWhisperer makes suggestions based on your current and previous inputs\. In the image below, a user has begun to define a variable for an Amazon S3 client\. Based on this, CodeWhisperer then suggests a way to complete this line of code\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-single-line-completion-s3-client.png) - -As another example, in the image below, a user has already written some code, and now wants to send a message to an Amazon SQS queue\. CodeWhisperer suggests a way to complete this final line of code\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-single-line-completion-sqs.png) - -### Full function generation - -CodeWhisperer can generate an entire function based on your function signature or code comments\. In the following image, a user has written a function signature for reading a file from Amazon S3\. Amazon CodeWhisperer then suggests a full implementation of the `read_from_s3` method\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-read-from-s3.png) - -**Note** -Sometimes, as in the previous example, CodeWhisperer includes `import` statements as part of its suggestions\. As a best practice, manually move these `import` statements to the top of your file\. - -As another example, in the following image, a user has written a function signature\. CodeWhisperer then suggests a full implementation of the `quicksort` method\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-quicksort.png) - -CodeWhisperer considers past code snippets when making suggestions\. In the following image, the user in the previous example has accepted the suggested implementation for `quicksort` above\. The user then writes another function signature for a generic `sort` method\. CodeWhisperer then suggests an implementation based on what has already been written\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-from-context-sort.png) - -In the following image, a user has written a comment\. Based on this comment, CodeWhisperer then suggests a function signature\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-comment-binary-search.png) - -In the following image, the user in the previous example has accepted the suggested function signature\. CodeWhisperer can then suggest a complete implementation of the `binary_search` function\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-function-binary-search.png) - -### Line\-by\-line recommendations - -Depending on your use case, CodeWhisperer may not be able to generate an entire function block in one recommendation\. However, CodeWhisperer can still provide line\-by\-line recommendations\. In the following image, the customer has written an initial comment indicating that they want to publish a message to an Amazon CloudWatch Logs group\. Given this context, CodeWhisperer is only able to suggest the client initialization code in its first recommendation, as shown in the following image\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-1.png) - -However, if the user continues to request line\-by\-line recommendations, CodeWhisperer also continues to suggest lines of code based on what's already been written\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-2.png) - -**Note** -In the example above, `VPCFlowLogs` may not be the correct constant value\. As CodeWhisperer makes suggestions, remember to rename any constants as required\. - -CodeWhisperer can eventually complete the entire code block as shown in the following image\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/whisper-line-by-line-cwlogs-3.png) \ No newline at end of file diff --git a/doc_source/codewhisperer-setup.md b/doc_source/codewhisperer-setup.md deleted file mode 100644 index 227a7c97..00000000 --- a/doc_source/codewhisperer-setup.md +++ /dev/null @@ -1,39 +0,0 @@ -# Setting up Amazon CodeWhisperer with Lambda - -This document describes how to request access to and activate Amazon CodeWhisperer for the Lambda console\. Once activated, CodeWhisperer can make code recommendations on\-demand in the Lambda code editor as you develop your function\. - -**Note** -In the Lambda console, CodeWhisperer only supports functions using the Python and Node\.js runtimes\. - -**Topics** -+ [Requesting CodeWhisperer access \(experimental feature\)](#codewhisperer-request-access) -+ [Activating Amazon CodeWhisperer \(experimental feature\)](#codewhisperer-activate) - -## Requesting CodeWhisperer access \(experimental feature\) - -To use Amazon CodeWhisperer in the Lambda console, you must first get allow listed\. Request allow listing by completing these steps\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console, and choose the function that you want to edit\. - -1. In the code editor under **Code source**, choose **Tools** in the top menu bar\. - -1. Choose **Request CodeWhisperer access**\. This opens up a link to a [request form](https://pages.awscloud.com/codewhisperer-sign-up-form.html) in a new tab\. - -1. Fill out the form\. For Lambda users, you must fill out the **AWS Account ID** field\. - -You will receive an email when the CodeWhisperer team approves your request\. - -## Activating Amazon CodeWhisperer \(experimental feature\) - -**Note** -You must be allow listed to use CodeWhisperer in the Lambda console\. If you aren't allow listed, see [Requesting CodeWhisperer access \(experimental feature\)](#codewhisperer-request-access)\. - -To activate CodeWhisperer in the Lambda console code editor, complete these steps\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console, and choose the function that you want to edit\. - -1. In the code editor under **Code source**, choose **Tools** in the top menu bar\. - -1. Choose **CodeWhisperer code suggestions**\. This immediately activates the CodeWhisperer service, and a check mark appears next to this option\. To deactivate, choose this option again\. - -The first time you activate CodeWhisperer, you'll see a pop\-up containing terms and conditions for using CodeWhisperer\. Read the terms and conditions and choose **Accept** to continue\. \ No newline at end of file diff --git a/doc_source/codewhisperer.md b/doc_source/codewhisperer.md deleted file mode 100644 index 1730dd47..00000000 --- a/doc_source/codewhisperer.md +++ /dev/null @@ -1,7 +0,0 @@ -# Working with Amazon CodeWhisperer in the Lambda console - -Amazon CodeWhisperer is a general purpose, machine learning\-powered code generator that provides you with code recommendations in realtime\. When activated in the Lambda console, CodeWhisperer automatically generates suggestions based on your existing code and comments\. Your personalized recommendations can vary in size and scope, ranging from a single one\-liner to fully\-formed functions\. - -**Topics** -+ [Setting up Amazon CodeWhisperer with Lambda](codewhisperer-setup.md) -+ [Overview of Amazon CodeWhisperer for AWS Lambda](codewhisperer-overview.md) \ No newline at end of file diff --git a/doc_source/configuration-aliases.md b/doc_source/configuration-aliases.md deleted file mode 100644 index 5796b543..00000000 --- a/doc_source/configuration-aliases.md +++ /dev/null @@ -1,161 +0,0 @@ -# Lambda function aliases - -You can create one or more aliases for your Lambda function\. A Lambda alias is like a pointer to a specific function version with the exception that it can point to two function versions during [traffic shifting](https://aws.amazon.com/about-aws/whats-new/2017/11/aws-lambda-supports-traffic-shifting-and-phased-deployments-with-aws-codedeploy/)\. Users can access the function version using the alias Amazon Resource Name \(ARN\)\. - -**Topics** -+ [Creating a function alias \(Console\)](#configuration-aliases-config) -+ [Managing aliases with the Lambda API](#versioning-aliases-api) -+ [Using aliases](#using-aliases) -+ [Resource policies](#versioning-permissions-alias) -+ [Alias routing configuration](#configuring-alias-routing) - -## Creating a function alias \(Console\) - -You can create a function alias using the Lambda console\. - -**To create an alias** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Aliases** and then choose **Create alias**\. - -1. On the **Create alias** page, do the following: - - 1. Enter a **Name** for the alias\. - - 1. \(Optional\) Enter a **Description** for the alias\. - - 1. For **Version**, choose a function version that you want the alias to point to\. - - 1. \(Optional\) To configure routing on the alias, expand **Weighted alias**\. For more information, see [Alias routing configuration](#configuring-alias-routing)\. - - 1. Choose **Save**\. - -## Managing aliases with the Lambda API - -To create an alias using the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-alias.html) command\. - -``` -aws lambda create-alias --function-name my-function --name alias-name --function-version version-number --description " " -``` - -To change an alias to point a new version of the function, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-alias.html) command\. - -``` -aws lambda update-alias --function-name my-function --name alias-name --function-version version-number -``` - -To delete an alias, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/delete-alias.html) command\. - -``` -aws lambda delete-alias --function-name my-function --name alias-name -``` - - The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: -+ [CreateAlias](API_CreateAlias.md) -+ [UpdateAlias](API_UpdateAlias.md) -+ [DeleteAlias](API_DeleteAlias.md) - -## Using aliases - -Each alias has a unique ARN\. An alias can point only to a function version, not to another alias\. You can update an alias to point to a new version of the function\. - -Event sources such as Amazon Simple Storage Service \(Amazon S3\) invoke your Lambda function\. These event sources maintain a mapping that identifies the function to invoke when events occur\. If you specify a Lambda function alias in the mapping configuration, you don't need to update the mapping when the function version changes\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. - -In a resource policy, you can grant permissions for event sources to use your Lambda function\. If you specify an alias ARN in the policy, you don't need to update the policy when the function version changes\. - -## Resource policies - -You can use a [resource\-based policy](access-control-resource-based.md) to give a service, resource, or account access to your function\. The scope of that permission depends on whether you apply it to an alias, a version, or the entire function\. For example, if you use an alias name \(such as `helloworld:PROD`\), the permission allows you to invoke the `helloworld` function using the alias ARN \(`helloworld:PROD`\)\. - -If you attempt to invoke the function without an alias or a specific version, then you get a permission error\. This permission error still occurs even if you attempt to directly invoke the function version associated with the alias\. - -For example, the following AWS CLI command grants Amazon S3 permissions to invoke the PROD alias of the `helloworld` function when Amazon S3 is acting on behalf of `examplebucket`\. - -``` -aws lambda add-permission --function-name helloworld \ ---qualifier PROD --statement-id 1 --principal s3.amazonaws.com --action lambda:InvokeFunction \ ---source-arn arn:aws:s3:::examplebucket --source-account 123456789012 -``` - -For more information about using resource names in policies, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. - -## Alias routing configuration - -Use routing configuration on an alias to send a portion of traffic to a second function version\. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version\. - -Note that Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. - -You can point an alias to a maximum of two Lambda function versions\. The versions must meet the following criteria: -+ Both versions must have the same [execution role](lambda-intro-execution-role.md)\. -+ Both versions must have the same [dead\-letter queue](invocation-async.md#invocation-dlq) configuration, or no dead\-letter queue configuration\. -+ Both versions must be published\. The alias cannot point to `$LATEST`\. - -**To configure routing on an alias** -**Note** -Verify that the function has at least two published versions\. To create additional versions, follow the instructions in [Lambda function versions](configuration-versions.md)\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Aliases** and then choose **Create alias**\. - -1. On the **Create alias** page, do the following: - - 1. Enter a **Name** for the alias\. - - 1. \(Optional\) Enter a **Description** for the alias\. - - 1. For **Version**, choose the first function version that you want the alias to point to\. - - 1. Expand **Weighted alias**\. - - 1. For **Additional version**, choose the second function version that you want the alias to point to\. - - 1. For **Weight \(%\)**, enter a weight value for the function\. *Weight* is the percentage of traffic that is assigned to that version when the alias is invoked\. The first version receives the residual weight\. For example, if you specify 10 percent to **Additional version**, the first version is assigned 90 percent automatically\. - - 1. Choose **Save**\. - -### Configuring alias routing using CLI - -Use the `create-alias` and `update-alias` AWS CLI commands to configure the traffic weights between two function versions\. When you create or update the alias, you specify the traffic weight in the `routing-config` parameter\. - -The following example creates a Lambda function alias named **routing\-alias** that points to version 1 of the function\. Version 2 of the function receives 3 percent of the traffic\. The remaining 97 percent of traffic is routed to version 1\. - -``` -aws lambda create-alias --name routing-alias --function-name my-function --function-version 1 \ ---routing-config AdditionalVersionWeights={"2"=0.03} -``` - -Use the `update-alias` command to increase the percentage of incoming traffic to version 2\. In the following example, you increase the traffic to 5 percent\. - -``` -aws lambda update-alias --name routing-alias --function-name my-function \ ---routing-config AdditionalVersionWeights={"2"=0.05} -``` - -To route all traffic to version 2, use the `update-alias` command to change the `function-version` property to point the alias to version 2\. The command also resets the routing configuration\. - -``` -aws lambda update-alias --name routing-alias --function-name my-function \ ---function-version 2 --routing-config AdditionalVersionWeights={} -``` - - The AWS CLI commands in the preceding steps correspond to the following Lambda API operations: -+ [CreateAlias](API_CreateAlias.md) -+ [UpdateAlias](API_UpdateAlias.md) - -### Determining which version has been invoked - -When you configure traffic weights between two function versions, there are two ways to determine the Lambda function version that has been invoked: -+ **CloudWatch Logs** – Lambda automatically emits a `START` log entry that contains the invoked version ID to Amazon CloudWatch Logs for every function invocation\. The following is an example: - - `19:44:37 START RequestId: request id Version: $version ` - - For alias invocations, Lambda uses the `Executed Version` dimension to filter the metric data by the invoked version\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. -+ **Response payload \(synchronous invocations\)** – Responses to synchronous function invocations include an `x-amz-executed-version` header to indicate which function version has been invoked\. - - diff --git a/doc_source/configuration-codesigning.md b/doc_source/configuration-codesigning.md deleted file mode 100644 index 49be75a6..00000000 --- a/doc_source/configuration-codesigning.md +++ /dev/null @@ -1,195 +0,0 @@ -# Configuring code signing for AWS Lambda - -Code signing for AWS Lambda helps to ensure that only trusted code runs in your Lambda functions\. When you enable code signing for a function, Lambda checks every code deployment and verifies that the code package is signed by a trusted source\. - -**Note** -Functions defined as container images do not support code signing\. - -To verify code integrity, use [AWS Signer](https://docs.aws.amazon.com/signer/latest/developerguide/Welcome.html) to create digitally signed code packages for functions and layers\. When a user attempts to deploy a code package, Lambda performs validation checks on the code package before accepting the deployment\. Because code signing validation checks run at deployment time, there is no performance impact on function execution\. - -You also use AWS Signer to create *signing profiles*\. You use a signing profile to create the signed code package\. Use AWS Identity and Access Management \(IAM\) to control who can sign code packages and create signing profiles\. For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/signer/latest/developerguide/accessctrl-toplevel.html) in the *AWS Signer Developer Guide*\. - -To enable code signing for a function, you create a *code signing configuration* and attach it to the function\. A code signing configuration defines a list of allowed signing profiles and the policy action to take if any of the validation checks fail\. - -Lambda layers follow the same signed code package format as function code packages\. When you add a layer to a function that has code signing enabled, Lambda checks that the layer is signed by an allowed signing profile\. When you enable code signing for a function, all layers that are added to the function must also be signed by one of the allowed signing profiles\. - -Use IAM to control who can create code signing configurations\. Typically, you allow only specific administrative users to have this ability\. Additionally, you can set up IAM policies to enforce that developers only create functions that have code signing enabled\. - -You can configure code signing to log changes to AWS CloudTrail\. Successful and blocked deployments to functions are logged to CloudTrail with information about the signature and validation checks\. - -You can configure code signing for your functions using the Lambda console, the AWS Command Line Interface \(AWS CLI\), AWS CloudFormation, and the AWS Serverless Application Model \(AWS SAM\)\. - -There is no additional charge for using AWS Signer or code signing for AWS Lambda\. - -**Topics** -+ [Signature validation](#config-codesigning-valid) -+ [Configuration prerequisites](#config-codesigning-prereqs) -+ [Creating code signing configurations](#config-codesigning-config-console) -+ [Updating a code signing configuration](#config-codesigning-config-update) -+ [Deleting a code signing configuration](#config-codesigning-config-delete) -+ [Enabling code signing for a function](#config-codesigning-function-console) -+ [Configuring IAM policies](#config-codesigning-policies) -+ [Configuring code signing with the Lambda API](#config-codesigning-api) - -## Signature validation - -Lambda performs the following validation checks when you deploy a signed code package to your function: - -1. Integrity – Validates that the code package has not been modified since it was signed\. Lambda compares the hash of the package with the hash from the signature\. - -1. Expiry – Validates that the signature of the code package has not expired\. - -1. Mismatch – Validates that the code package is signed with one of the allowed signing profiles for the Lambda function\. A mismatch also occurs if a signature is not present\. - -1. Revocation – Validates that the signature of the code package has not been revoked\. - -The signature validation policy defined in the code signing configuration determines which of the following actions Lambda takes if any of the validation checks fail: -+ Warn – Lambda allows the deployment of the code package, but issues a warning\. Lambda issues a new Amazon CloudWatch metric and also stores the warning in the CloudTrail log\. -+ Enforce – Lambda issues a warning \(the same as for the Warn action\) and blocks the deployment of the code package\. - -You can configure the policy for the expiry, mismatch, and revocation validation checks\. Note that you cannot configure a policy for the integrity check\. If the integrity check fails, Lambda blocks deployment\. - -## Configuration prerequisites - -Before you can configure code signing for a Lambda function, use AWS Signer to do the following: -+ Create one or more signing profiles\. -+ Use a signing profile to create a signed code package for your function\. - -For more information, see [Creating Signing Profiles \(Console\)](https://docs.aws.amazon.com/signer/latest/developerguide/ConsoleLambda.html) in the *AWS Signer Developer Guide*\. - -## Creating code signing configurations - -A code signing configuration defines a list of allowed signing profiles and the signature validation policy\. - -**To create a code signing configuration \(console\)** - -1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. - -1. Choose **Create configuration**\. - -1. For **Description**, enter a descriptive name for the configuration\. - -1. Under **Signing profiles**, add up to 20 signing profiles to the configuration\. - - 1. For **Signing profile version ARN**, choose a profile version's Amazon Resource Name \(ARN\), or enter the ARN\. - - 1. To add an additional signing profile, choose **Add signing profiles**\. - -1. Under **Signature validation policy**, choose **Warn** or **Enforce**\. - -1. Choose **Create configuration**\. - -## Updating a code signing configuration - -When you update a code signing configuration, the changes impact the future deployments of functions that have the code signing configuration attached\. - -**To update a code signing configuration \(console\)** - -1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. - -1. Select a code signing configuration to update, and then choose **Edit**\. - -1. For **Description**, enter a descriptive name for the configuration\. - -1. Under **Signing profiles**, add up to 20 signing profiles to the configuration\. - - 1. For **Signing profile version ARN**, choose a profile version's Amazon Resource Name \(ARN\), or enter the ARN\. - - 1. To add an additional signing profile, choose **Add signing profiles**\. - -1. Under **Signature validation policy**, choose **Warn** or **Enforce**\. - -1. Choose **Save changes**\. - -## Deleting a code signing configuration - -You can delete a code signing configuration only if no functions are using it\. - -**To delete a code signing configuration \(console\)** - -1. Open the [Code signing configurations page](https://console.aws.amazon.com/lambda/home#/code-signing-configurations) of the Lambda console\. - -1. Select a code signing configuration to delete, and then choose **Delete**\. - -1. To confirm, choose **Delete** again\. - -## Enabling code signing for a function - -To enable code signing for a function, you associate a code signing configuration with the function\. - -**To associate a code signing configuration with a function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function for which you want to enable code signing\. - -1. Under **Code signing configuration**, choose **Edit**\. - -1. In **Edit code signing**, choose a code signing configuration for this function\. - -1. Choose **Save**\. - -## Configuring IAM policies - -To grant permission for a user to access the [code signing API operations](#config-codesigning-api), attach one or more policy statements to the user policy\. For more information about user policies, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. - -The following example policy statement grants permission to create, update, and retrieve code signing configurations\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "lambda:CreateCodeSigningConfig", - "lambda:UpdateCodeSigningConfig", - "lambda:GetCodeSigningConfig" - ], - "Resource": "*" - } - ] -} -``` - -Administrators can use the `CodeSigningConfigArn` condition key to specify the code signing configurations that developers must use to create or update your functions\. - -The following example policy statement grants permission to create a function\. The policy statement includes a `lambda:CodeSigningConfigArn` condition to specify the allowed code signing configuration\. Lambda blocks any `CreateFunction` API request if its `CodeSigningConfigArn` parameter is missing or does not match the value in the condition\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "AllowReferencingCodeSigningConfig", - "Effect": "Allow", - "Action": [ - "lambda:CreateFunction", - ], - "Resource": "*", - "Condition": { - "StringEquals": { - "lambda:CodeSigningConfigArn": - “arn:aws:lambda:us-west-2:123456789012:code-signing-config:csc-0d4518bd353a0a7c6” - } - } - } - ] -} -``` - -## Configuring code signing with the Lambda API - -To manage code signing configurations with the AWS CLI or AWS SDK, use the following API operations: -+ [ListCodeSigningConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListCodeSigningConfigs.html) -+ [CreateCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateCodeSigningConfig.html) -+ [GetCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetCodeSigningConfig.html) -+ [UpdateCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateCodeSigningConfig.html) -+ [DeleteCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteCodeSigningConfig.html) - -To manage the code signing configuration for a function, use the following API operations: -+ [CreateFunction](API_CreateFunction.md) -+ [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) -+ [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) -+ [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) -+ [ListFunctionsByCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionsByCodeSigningConfig.html) \ No newline at end of file diff --git a/doc_source/configuration-concurrency.md b/doc_source/configuration-concurrency.md deleted file mode 100644 index bbfbefac..00000000 --- a/doc_source/configuration-concurrency.md +++ /dev/null @@ -1,73 +0,0 @@ -# Managing Lambda reserved concurrency - -There are two types of concurrency controls available: -+ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. -+ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. - -This topic details how to manage and configure reserved concurrency\. If you want to decrease latency for your functions, use [provisioned concurrency](provisioned-concurrency.md)\. - -Concurrency is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda allocates an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function's concurrency\. The total concurrency for all of the functions in your account is subject to a per\-region quota\. - -To learn about how concurrency interacts with scaling, [see Lambda function scaling](https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)\. - -**Topics** -+ [Configuring reserved concurrency](#configuration-concurrency-reserved) -+ [Configuring concurrency with the Lambda API](#configuration-concurrency-api) - -## Configuring reserved concurrency - -To manage reserved concurrency settings for a function, use the Lambda console\. - -**To reserve concurrency for a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Concurrency**\. - -1. Under **Concurrency**, choose **Edit**\. - -1. Choose **Reserve concurrency**\. Enter the amount of concurrency to reserve for the function\. - -1. Choose **Save**\. - -You can reserve up to the **Unreserved account concurrency** value that is shown, minus 100 for functions that don't have reserved concurrency\. To throttle a function, set the reserved concurrency to zero\. This stops any events from being processed until you remove the limit\. - -The following example shows two functions with pools of reserved concurrency, and the unreserved concurrency pool used by other functions\. Throttling errors occur when all of the concurrency in a pool is in use\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-reserved.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.concurrency.png) Function concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.reserved.png) Reserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.unreserved.png) Unreserved concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency.throttling.png) Throttling - -Reserving concurrency has the following effects\. -+ **Other functions can't prevent your function from scaling** – All of your account's functions in the same Region without reserved concurrency share the pool of unreserved concurrency\. Without reserved concurrency, other functions can use up all of the available concurrency\. This prevents your function from scaling up when needed\. -+ **Your function can't scale out of control** – Reserved concurrency also limits your function from using concurrency from the unreserved pool, which caps its maximum concurrency\. You can reserve concurrency to prevent your function from using all the available concurrency in the Region, or from overloading downstream resources\. - -Setting per\-function concurrency can impact the concurrency pool that is available to other functions\. To avoid issues, limit the number of users who can use the `PutFunctionConcurrency` and `DeleteFunctionConcurrency` API operations\. - -## Configuring concurrency with the Lambda API - -To manage concurrency settings the AWS CLI or AWS SDK, use the following API operations\. -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) -+ [GetFunctionConcurrency](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConcurrency.html) -+ [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) -+ [GetAccountSettings](API_GetAccountSettings.md) - -To configure reserved concurrency with the AWS CLI, use the `put-function-concurrency` command\. The following command reserves a concurrency of 100 for a function named `my-function`: - -``` -aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions 100 -``` - -You should see the following output: - -``` -{ - "ReservedConcurrentExecutions": 100 -} -``` \ No newline at end of file diff --git a/doc_source/configuration-database.md b/doc_source/configuration-database.md deleted file mode 100644 index 04478967..00000000 --- a/doc_source/configuration-database.md +++ /dev/null @@ -1,93 +0,0 @@ -# Configuring database access for a Lambda function - -You can create an Amazon RDS Proxy database proxy for your function\. A database proxy manages a pool of database connections and relays queries from a function\. This enables a function to reach high [concurrency](gettingstarted-concepts.md#gettingstarted-concepts-concurrency) levels without exhausting database connections\. - -**Topics** -+ [Creating a database proxy \(console\)](#configuration-database-config) -+ [Using the function's permissions for authentication](#configuration-database-auth) -+ [Sample application](#configuration-database-sample) - -## Creating a database proxy \(console\) - -You can use the Lambda console to create an Amazon RDS Proxy database proxy\. - -**To create a database proxy** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Database proxies**\. - -1. Choose **Add database proxy**\. - -1. Configure the following options\. - + **Proxy identifier** – The name of the proxy\. - + **RDS DB instance** – A [supported MySQL or PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html#rds-proxy.limitations) DB instance or cluster\. - + **Secret** – A Secrets Manager secret with the database user name and password\. -**Example secret** - - ``` - { - "username": "admin", - "password": "e2abcecxmpldc897" - } - ``` - + **IAM role** – An IAM role with permission to use the secret, and a trust policy that allows Amazon RDS to assume the role\. - + **Authentication** – The authentication and authorization method for connecting to the proxy from your function code\. - -1. Choose **Add**\. - -**Pricing** -Amazon RDS charges a hourly price for proxies that is determined by the instance size of your database\. For details, see [RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/)\. - -Proxy creation takes a few minutes\. When the proxy is available, configure your function to connect to the proxy endpoint instead of the database endpoint\. - -Standard [Amazon RDS Proxy pricing](https://aws.amazon.com/rds/proxy/pricing/) applies\. For more information, see [Managing connections with the Amazon RDS Proxy](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/rds-proxy.html) in the Amazon Aurora User Guide\. - -## Using the function's permissions for authentication - -By default, you can connect to a proxy with the same username and password that it uses to connect to the database\. The only difference in your function code is the endpoint that the database client connects to\. The drawback of this method is that you must expose the password to your function code, either by configuring it in a secure environment variable or by retrieving it from Secrets Manager\. - -You can create a database proxy that uses the function's IAM credentials for authentication and authorization instead of a password\. To use the function's permissions to connect to the proxy, set **Authentication** to **Execution role**\. - -The Lambda console adds the required permission \(`rds-db:connect`\) to the execution role\. You can then use the AWS SDK to generate a token that allows it to connect to the proxy\. The following example shows how to configure a database connection with the `mysql2` library in Node\.js\. - -**Example [dbadmin/index\-iam\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/dbadmin/index-iam.js) – AWS SDK signer** - -``` -const signer = new AWS.RDS.Signer({ - region: region, - hostname: host, - port: sqlport, - username: username -}) - -exports.handler = async (event) => { - let connectionConfig = { - host : host, - user : username, - database : database, - ssl: 'Amazon RDS', - authPlugins: { mysql_clear_password: () => () => signer.getAuthToken() } - } - var connection = mysql.createConnection(connectionConfig) - var query = event.query - var result - connection.connect() -} -``` - -For more information, see [IAM database authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) in the Amazon RDS User Guide\. - -## Sample application - -Sample applications that demonstrate the use of Lambda with an Amazon RDS database are available in this guide's GitHub repository\. There are two applications: -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – The AWS CloudFormation template `template-vpcrds.yml` creates a MySQL 5\.7 database in a private VPC\. In the sample application, a Lambda function proxies queries to the database\. The function and database templates both use Secrets Manager to access database credentials\. - - [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) -+ [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A processor function reads events from a Kinesis stream\. It uses the data from the events to update DynamoDB tables, and stores a copy of the event in a MySQL database\. - - [https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) - -To use the sample applications, follow the instructions in the GitHub repository: [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql/README.md), [List Manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/README.md)\. \ No newline at end of file diff --git a/doc_source/configuration-envvars.md b/doc_source/configuration-envvars.md deleted file mode 100644 index 4e2ef460..00000000 --- a/doc_source/configuration-envvars.md +++ /dev/null @@ -1,308 +0,0 @@ -# Using AWS Lambda environment variables - -You can use environment variables to adjust your function's behavior without updating code\. An environment variable is a pair of strings that is stored in a function's version\-specific configuration\. The Lambda runtime makes environment variables available to your code and sets additional environment variables that contain information about the function and invocation request\. - -**Note** -To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. - -Environment variables are not evaluated prior to the function invocation\. Any value you define is considered a literal string and not expanded\. Perform the variable evaluation in your function code\. - -**Topics** -+ [Configuring environment variables](#configuration-envvars-config) -+ [Configuring environment variables with the API](#configuration-envvars-api) -+ [Example scenario for environment variables](#configuration-envvars-example) -+ [Retrieve environment variables](#configuration-envvars-retrieve) -+ [Defined runtime environment variables](#configuration-envvars-runtime) -+ [Securing environment variables](#configuration-envvars-encryption) -+ [Sample code and templates](#configuration-envvars-samples) - -## Configuring environment variables - -You define environment variables on the unpublished version of your function\. When you publish a version, the environment variables are locked for that version along with other [version\-specific configuration](configuration-function-common.md)\. - -You create an environment variable for your function by defining a key and a value\. Your function uses the name of the key to retrieve the value of environment variable\. - -**To set environment variables in the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration**, then choose **Environment variables**\. - -1. Under **Environment variables**, choose **Edit**\. - -1. Choose **Add environment variable**\. - -1. Enter a key and value\. - -**Requirements** - + Keys start with a letter and are at least two characters\. - + Keys only contain letters, numbers, and the underscore character \(`_`\)\. - + Keys aren't [reserved by Lambda](#configuration-envvars-runtime)\. - + The total size of all environment variables doesn't exceed 4 KB\. - -1. Choose **Save**\. - -## Configuring environment variables with the API - -To manage environment variables with the AWS CLI or AWS SDK, use the following API operations\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example sets two environment variables on a function named `my-function`\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --environment "Variables={BUCKET=my-bucket,KEY=file.txt}" -``` - -When you apply environment variables with the `update-function-configuration` command, the entire contents of the `Variables` structure is replaced\. To retain existing environment variables when you add a new one, include all existing values in your request\. - -To get the current configuration, use the `get-function-configuration` command\. - -``` -aws lambda get-function-configuration --function-name my-function -``` - -You should see the following output: - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Environment": { - "Variables": { - "BUCKET": "my-bucket", - "KEY": "file.txt" - } - }, - "RevisionId": "0894d3c1-2a3d-4d48-bf7f-abade99f3c15", - ... -} -``` - -To ensure that the values don't change between when you read the configuration and when you update it, you can pass the revision ID from the output of `get-function-configuration` as a parameter to `update-function-configuration`\. - -To configure a function's encryption key, set the `KMSKeyARN` option\. - -``` -aws lambda update-function-configuration --function-name my-function \ - --kms-key-arn arn:aws:kms:us-east-2:123456789012:key/055efbb4-xmpl-4336-ba9c-538c7d31f599 -``` - -## Example scenario for environment variables - -You can use environment variables to customize function behavior in your test environment and production environment\. For example, you can create two functions with the same code but different configurations\. One function connects to a test database, and the other connects to a production database\. In this situation, you use environment variables to tell the function the hostname and other connection details for the database\. - -The following example shows how to define the database host and database name as environment variables\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-env.png) - -If you want your test environment to generate more debug information than the production environment, you could set an environment variable to configure your test environment to use more verbose logging or more detailed tracing\. - -## Retrieve environment variables - -To retrieve environment variables in your function code, use the standard method for your programming language\. - ------- -#### [ Node\.js ] - -``` -let region = process.env.AWS_REGION -``` - ------- -#### [ Python ] - -``` -import os - region = os.environ['AWS_REGION'] -``` - -**Note** -In some cases, you may need to use the following format: - -``` -region = os.environ.get('AWS_REGION') -``` - ------- -#### [ Ruby ] - -``` -region = ENV["AWS_REGION"] -``` - ------- -#### [ Java ] - -``` -String region = System.getenv("AWS_REGION"); -``` - ------- -#### [ Go ] - -``` -var region = os.Getenv("AWS_REGION") -``` - ------- -#### [ C\# ] - -``` -string region = Environment.GetEnvironmentVariable("AWS_REGION"); -``` - ------- -#### [ PowerShell ] - -``` -$region = $env:AWS_REGION -``` - ------- - -Lambda stores environment variables securely by encrypting them at rest\. You can [configure Lambda to use a different encryption key](#configuration-envvars-encryption), encrypt environment variable values on the client side, or set environment variables in an AWS CloudFormation template with AWS Secrets Manager\. - -## Defined runtime environment variables - -Lambda [runtimes](lambda-runtimes.md) set several environment variables during initialization\. Most of the environment variables provide information about the function or runtime\. The keys for these environment variables are *reserved* and cannot be set in your function configuration\. - -**Reserved environment variables** -+ `_HANDLER` – The handler location configured on the function\. -+ `_X_AMZN_TRACE_ID` – The [X\-Ray tracing header](services-xray.md)\. This environment variable is not defined for custom runtimes \(for example, runtimes that use the `provided` or `provided.al2` identifiers\)\. You can set `_X_AMZN_TRACE_ID` for custom runtimes using the `Lambda-Runtime-Trace-Id` response header from the [Next invocation](runtimes-api.md#runtimes-api-next)\. -+ `AWS_REGION` – The AWS Region where the Lambda function is executed\. -+ `AWS_EXECUTION_ENV` – The [runtime identifier](lambda-runtimes.md), prefixed by `AWS_Lambda_` \(for example, `AWS_Lambda_java8`\)\. This environment variable is not defined for custom runtimes \(for example, runtimes that use the `provided` or `provided.al2` identifiers\)\. -+ `AWS_LAMBDA_FUNCTION_NAME` – The name of the function\. -+ `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` – The amount of memory available to the function in MB\. -+ `AWS_LAMBDA_FUNCTION_VERSION` – The version of the function being executed\. - - `AWS_LAMBDA_INITIALIZATION_TYPE` – The initialization type of the function, which is either `on-demand` or `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. -+ `AWS_LAMBDA_LOG_GROUP_NAME`, `AWS_LAMBDA_LOG_STREAM_NAME` – The name of the Amazon CloudWatch Logs group and stream for the function\. -+ `AWS_ACCESS_KEY`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` – The access keys obtained from the function's [execution role](lambda-intro-execution-role.md)\. -+ `AWS_LAMBDA_RUNTIME_API` – \([Custom runtime](runtimes-custom.md)\) The host and port of the [runtime API](runtimes-api.md)\. -+ `LAMBDA_TASK_ROOT` – The path to your Lambda function code\. -+ `LAMBDA_RUNTIME_DIR` – The path to runtime libraries\. - -The following additional environment variables aren't reserved and can be extended in your function configuration\. - -**Unreserved environment variables** -+ `LANG` – The locale of the runtime \(`en_US.UTF-8`\)\. -+ `PATH` – The execution path \(`/usr/local/bin:/usr/bin/:/bin:/opt/bin`\)\. -+ `LD_LIBRARY_PATH` – The system library path \(`/lib64:/usr/lib64:$LAMBDA_RUNTIME_DIR:$LAMBDA_RUNTIME_DIR/lib:$LAMBDA_TASK_ROOT:$LAMBDA_TASK_ROOT/lib:/opt/lib`\)\. -+ `NODE_PATH` – \([Node\.js](lambda-nodejs.md)\) The Node\.js library path \(`/opt/nodejs/node12/node_modules/:/opt/nodejs/node_modules:$LAMBDA_RUNTIME_DIR/node_modules`\)\. -+ `PYTHONPATH` – \([Python 2\.7, 3\.6, 3\.8](lambda-python.md)\) The Python library path \(`$LAMBDA_RUNTIME_DIR`\)\. -+ `GEM_PATH` – \([Ruby](lambda-ruby.md)\) The Ruby library path \(`$LAMBDA_TASK_ROOT/vendor/bundle/ruby/2.5.0:/opt/ruby/gems/2.5.0`\)\. -+ `AWS_XRAY_CONTEXT_MISSING` – For X\-Ray tracing, Lambda sets this to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. -+ `AWS_XRAY_DAEMON_ADDRESS` – For X\-Ray tracing, the IP address and port of the X\-Ray daemon\. -+ `AWS_LAMBDA_DOTNET_PREJIT` – For the \.NET 3\.1 runtime, set this variable to enable or disable \.NET 3\.1 specific runtime optimizations\. Values include `always`, `never`, and `provisioned-concurrency`\. For information, see [ Configuring provisioned concurrency](provisioned-concurrency.md)\. -+ `TZ` – The environment's time zone \(`UTC`\)\. The execution environment uses NTP to synchronize the system clock\. - -The sample values shown reflect the latest runtimes\. The presence of specific variables or their values can vary on earlier runtimes\. - -## Securing environment variables - -For securing your environment variables, you can use server\-side encryption to protect your data at rest and client\-side encryption to protect your data in transit\. - -**Note** -To increase database security, we recommend that you use AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. - -**Security at rest** -Lambda always provides server\-side encryption at rest with an AWS KMS key\. By default, Lambda uses an AWS managed key\. If this default behavior suits your workflow, you don't need to set anything else up\. Lambda creates the AWS managed key in your account and manages permissions to it for you\. AWS doesn't charge you to use this key\. - -If you prefer, you can provide an AWS KMS customer managed key instead\. You might do this to have control over rotation of the KMS key or to meet the requirements of your organization for managing KMS keys\. When you use a customer managed key, only users in your account with access to the KMS key can view or manage environment variables on the function\. - -Customer managed keys incur standard AWS KMS charges\. For more information, see [AWS Key Management Service pricing](https://aws.amazon.com/kms/pricing/), in the *AWS KMS product pages*\. - -**Security in transit** -For additional security, you can enable helpers for encryption in transit, which ensures that your environment variables are encrypted client\-side for protection in transit\. - -**To configure encryption for your environment variables** - -1. Use the AWS Key Management Service \(AWS KMS\) to create any customer managed keys for Lambda to use for server\-side and client\-side encryption\. For more information, see [Creating keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) in the *[AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/)*\. - -1. Using the Lambda console, navigate to the **Edit environment variables** page\. - - 1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - - 1. Choose a function\. - - 1. Choose **Configuration**, then choose **Environment variables** from the left navigation bar\. - - 1. In the **Environment variables** section, choose **Edit**\. - - 1. Expand **Encryption configuration**\. - -1. Optionally, enable console encryption helpers to use client\-side encryption to protect your data in transit\. - - 1. Under **Encryption in transit**, choose **Enable helpers for encryption in transit**\. - - 1. For each environment variable that you want to enable console encryption helpers for, choose **Encrypt** next to the environment variable\. - - 1. Under AWS KMS key to encrypt in transit, choose a customer managed key that you created at the beginning of this procedure\. - - 1. Choose **Execution role policy** and copy the policy\. This policy grants permission to your function's execution role to decrypt the environment variables\. - - Save this policy to use in the last step of this procedure\. - - 1. Add code to your function that decrypts the environment variables\. Choose **Decrypt secrets snippet** to see an example\. - -1. Optionally, specify your customer managed key for encryption at rest\. - - 1. Choose **Use a customer master key**\. - - 1. Choose a customer managed key that you created at the beginning of this procedure\. - -1. Choose **Save**\. - -1. Set up permissions\. - - If you're using a customer managed key with server\-side encryption, grant permissions to any AWS Identity and Access Management \(IAM\) users or roles that you want to be able to view or manange environment variables on the function\. For more information, see [Managing permissions to your server\-side encryption KMS key](#managing-permissions-to-your-server-side-encryption-key)\. - - If you're enabling client\-side encryption for security in transit, your function needs permission to call the `kms:Decrypt` API operation\. Add the policy that you saved previously in this procedure to the function's [execution role](lambda-intro-execution-role.md)\. - -### Managing permissions to your server\-side encryption KMS key - -No AWS KMS permissions are required for your user or the function's execution role to use the default encryption key\. To use a customer managed key, you need permission to use the key\. Lambda uses your permissions to create a grant on the key\. This allows Lambda to use it for encryption\. -+ `kms:ListAliases` – To view keys in the Lambda console\. -+ `kms:CreateGrant`, `kms:Encrypt` – To configure a customer managed key on a function\. -+ `kms:Decrypt` – To view and manage environment variables that are encrypted with a customer managed key\. - -You can get these permissions from your user account or from a key's resource\-based permissions policy\. `ListAliases` is provided by the [managed policies for Lambda](access-control-identity-based.md)\. Key policies grant the remaining permissions to users in the **Key users** group\. - -Users without `Decrypt` permissions can still manage functions, but they can't view environment variables or manage them in the Lambda console\. To prevent a user from viewing environment variables, add a statement to the user's permissions that denies access to the default key, a customer managed key, or all keys\. - -**Example IAM policy – Deny access by key ARN** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Deny", - "Action": [ - "kms:Decrypt" - ], - "Resource": "arn:aws:kms:us-east-2:123456789012:key/3be10e2d-xmpl-4be4-bc9d-0405a71945cc" - } - ] -} -``` - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/env-accessdenied.png) - -For details on managing key permissions, see [Using key policies in AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide\. - -## Sample code and templates - -Sample applications in this guide's GitHub repository demonstrate the use of environment variables in function code and AWS CloudFormation templates\. - -**Sample applications** -+ [Blank function](samples-blank.md) – Create a basic function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests, and the AWS SDK\. -+ [RDS MySQL](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – Create a VPC and an Amazon RDS DB instance in one template, with a password stored in Secrets Manager\. In the application template, import database details from the VPC stack, read the password from Secrets Manager, and pass all connection configuration to the function in environment variables\. \ No newline at end of file diff --git a/doc_source/configuration-filesystem.md b/doc_source/configuration-filesystem.md deleted file mode 100644 index ab227774..00000000 --- a/doc_source/configuration-filesystem.md +++ /dev/null @@ -1,205 +0,0 @@ -# Configuring file system access for Lambda functions - -You can configure a function to mount an Amazon Elastic File System \(Amazon EFS\) file system to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. - -**Topics** -+ [Execution role and user permissions](#configuration-filesystem-permissions) -+ [Configuring a file system and access point](#configuration-filesystem-setup) -+ [Connecting to a file system \(console\)](#configuration-filesystem-config) -+ [Configuring file system access with the Lambda API](#configuration-filesystem-api) -+ [AWS CloudFormation and AWS SAM](#configuration-filesystem-cloudformation) -+ [Sample applications](#configuration-filesystem-samples) - -## Execution role and user permissions - -If the file system doesn't have a user\-configured IAM policy, EFS uses a default policy that grants full access to any client that can connect to the file system using a file system mount target\. If the file system has a user\-configured IAM policy, your function's execution role must have the correct `elasticfilesystem` permissions\. - -**Execution role permissions** -+ **elasticfilesystem:ClientMount** -+ **elasticfilesystem:ClientWrite \(not required for read\-only connections\)** - -These permissions are included in the **AmazonElasticFileSystemClientReadWriteAccess** managed policy\. Additionally, your execution role must have the [permissions required to connect to the file system's VPC](configuration-vpc.md#vpc-permissions)\. - -When you configure a file system, Lambda uses your permissions to verify mount targets\. To configure a function to connect to a file system, your IAM user needs the following permissions: - -**User permissions** -+ **elasticfilesystem:DescribeMountTargets** - -## Configuring a file system and access point - -Create a file system in Amazon EFS with a mount target in every Availability Zone that your function connects to\. For performance and resilience, use at least two Availability Zones\. For example, in a simple configuration you could have a VPC with two private subnets in separate Availability Zones\. The function connects to both subnets and a mount target is available in each\. Ensure that NFS traffic \(port 2049\) is allowed by the security groups used by the function and mount targets\. - -**Note** -When you create a file system, you choose a performance mode that can't be changed later\. **General purpose** mode has lower latency, and **Max I/O** mode supports a higher maximum throughput and IOPS\. For help choosing, see [Amazon EFS performance](https://docs.aws.amazon.com/efs/latest/ug/performance.html) in the *Amazon Elastic File System User Guide*\. - -An access point connects each instance of the function to the right mount target for the Availability Zone it connects to\. For best performance, create an access point with a non\-root path, and limit the number of files that you create in each directory\. The following example creates a directory named `my-function` on the file system and sets the owner ID to 1001 with standard directory permissions \(755\)\. - -**Example access point configuration** -+ **Name** – `files` -+ **User ID** – `1001` -+ **Group ID** – `1001` -+ **Path** – `/my-function` -+ **Permissions** – `755` -+ **Owner user ID** – `1001` -+ **Group user ID** – `1001` - -When a function uses the access point, it is given user ID 1001 and has full access to the directory\. - -For more information, see the following topics in the *Amazon Elastic File System User Guide*: -+ [Creating resources for Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/creating-using.html) -+ [Working with users, groups, and permissions](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions.html) - -## Connecting to a file system \(console\) - -A function connects to a file system over the local network in a VPC\. The subnets that your function connects to can be the same subnets that contain mount points for your file system, or subnets in the same Availability Zone that can route NFS traffic \(port 2049\) to the file system\. - -**Note** -If your function is not already connected to a VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. - -**To configure file system access** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **File systems**\. - -1. Under **File system**, choose **Add file system**\. - -1. Configure the following properties: - + **EFS file system** – The access point for a file system in the same VPC\. - + **Local mount path** – The location where the file system is mounted on the Lambda function, starting with `/mnt/`\. - -**Pricing** -Amazon EFS charges for storage and throughput, with rates that vary by storage class\. For details, see [Amazon EFS pricing](https://aws.amazon.com/efs/pricing)\. -Lambda charges for data transfer between VPCs\. This only applies if your function's VPC is peered to another VPC with a file system\. The rates are the same as for Amazon EC2 data transfer between VPCs in the same Region\. For details, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. - -For more information about Lambda's integration with Amazon EFS, see [Using Amazon EFS with Lambda](services-efs.md)\. - -## Configuring file system access with the Lambda API - -Use the following API operations to connect your Lambda function to a file system: -+ [CreateFunction](API_CreateFunction.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - -To connect a function to a file system, use the `update-function-configuration` command\. The following example connects a function named `my-function` to a file system with ARN of an access point\. - -``` -ARN=arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd -aws lambda update-function-configuration --function-name my-function \ - --file-system-configs Arn=$ARN,LocalMountPath=/mnt/efs0 -``` - -You can get the ARN of a file system's access point with the `describe-access-points` command\. - -``` -aws efs describe-access-points -``` - -You should see the following output: - -``` -{ - "AccessPoints": [ - { - "ClientToken": "console-aa50c1fd-xmpl-48b5-91ce-57b27a3b1017", - "Name": "lambda-ap", - "Tags": [ - { - "Key": "Name", - "Value": "lambda-ap" - } - ], - "AccessPointId": "fsap-015cxmplb72b405fd", - "AccessPointArn": "arn:aws:elasticfilesystem:us-east-2:123456789012:access-point/fsap-015cxmplb72b405fd", - "FileSystemId": "fs-aea3xmpl", - "RootDirectory": { - "Path": "/" - }, - "OwnerId": "123456789012", - "LifeCycleState": "available" - } - ] -} -``` - -## AWS CloudFormation and AWS SAM - -You can use AWS CloudFormation and the AWS Serverless Application Model \(AWS SAM\) to automate the creation of Lambda applications\. To enable a file system connection on an AWS SAM `AWS::Serverless::Function` resource, use the `FileSystemConfigs` property\. - -**Example template\.yml – File system configuration** - -``` -Transform: AWS::Serverless-2016-10-31 -Resources: - VPC: - Type: AWS::EC2::VPC - Properties: - CidrBlock: 10.0.0.0/16 - Subnet1: - Type: AWS::EC2::Subnet - Properties: - VpcId: - Ref: VPC - CidrBlock: 10.0.1.0/24 - AvailabilityZone: "us-west-2a" - EfsSecurityGroup: - Type: AWS::EC2::SecurityGroup - Properties: - VpcId: - Ref: VPC - GroupDescription: "mnt target sg" - SecurityGroupIngress: - - IpProtocol: -1 - CidrIp: "0.0.0.0/0" - FileSystem: - Type: AWS::EFS::FileSystem - Properties: - PerformanceMode: generalPurpose - AccessPoint: - Type: AWS::EFS::AccessPoint - Properties: - FileSystemId: - Ref: FileSystem - PosixUser: - Uid: "1001" - Gid: "1001" - RootDirectory: - CreationInfo: - OwnerGid: "1001" - OwnerUid: "1001" - Permissions: "755" - MountTarget1: - Type: AWS::EFS::MountTarget - Properties: - FileSystemId: - Ref: FileSystem - SubnetId: - Ref: Subnet1 - SecurityGroups: - - Ref: EfsSecurityGroup - MyFunctionWithEfs: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: python3.9 - VpcConfig: - SecurityGroupIds: - - Ref: EfsSecurityGroup - SubnetIds: - - Ref: Subnet1 - FileSystemConfigs: - - Arn: !GetAtt AccessPoint.Arn - LocalMountPath: "/mnt/efs" - Description: Use a file system. - DependsOn: "MountTarget1" -``` - -You must add the `DependsOn` to ensure that the mount targets are fully created before the Lambda runs for the first time\. - -For the AWS CloudFormation `AWS::Lambda::Function` type, the property name and fields are the same\. For more information, see [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md)\. - -## Sample applications - -The GitHub repository for this guide includes a sample application that demonstrates the use of Amazon EFS with a Lambda function\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. \ No newline at end of file diff --git a/doc_source/configuration-function-common.md b/doc_source/configuration-function-common.md deleted file mode 100644 index 15aa2993..00000000 --- a/doc_source/configuration-function-common.md +++ /dev/null @@ -1,181 +0,0 @@ -# Configuring Lambda function options - -After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. - -You can also create and edit test events to test your function using the console\. - -For function configuration best practices, see [Function configuration](best-practices.md#function-configuration)\. - -**Topics** -+ [Function versions](#configuration-function-latest) -+ [Using the function overview](#configuration-functions-designer) -+ [Configuring functions \(console\)](#configuration-common-summary) -+ [Configuring functions \(API\)](#configuration-function-api) -+ [Configuring function memory \(console\)](#configuration-memory-console) -+ [Configuring function timeout \(console\)](#configuration-timeout-console) -+ [Configuring ephemeral storage \(console\)](#configuration-ephemeral-storage) -+ [Accepting function memory recommendations \(console\)](#configuration-memory-optimization-accept) -+ [Configuring triggers \(console\)](#configuration-common-triggers) -+ [Testing functions \(console\)](#configuration-common-test) - -## Function versions - -A function has an unpublished version, and can have published versions and aliases\. By default, the console displays configuration information for the unpublished version of the function\. You change the unpublished version when you update your function's code and configuration\. - -A published version is a snapshot of your function code and configuration that can't be changed \(except for a few configuration items relevant to a function version, such as provisioned concurrency\)\. - -## Using the function overview - -The **Function overview** shows a visualization of your function and its upstream and downstream resources\. You can use it to jump to trigger and destination configuration\. You can use it to jump to layer configuration for functions defined as \.zip file archives\. - -![\[The Lambda function overview, with no configured triggers or destinations.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-designer.png) - -## Configuring functions \(console\) - -For the following function configurations, you can change the settings only for the unpublished version of a function\. In the console, the function **Configuration** tab provides the following sections: -+ **General configuration** – Configure [memory](#configuration-memory-console) or opt in to the [AWS Compute Optimizer](#configuration-memory-optimization-accept)\. You can also configure function [timeout](#configuration-timeout-console) and the execution role\. -+ **Permissions** – Configure the execution role and other [permissions](lambda-permissions.md)\. -+ **Environment variables** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. -+ **Tags** – Key\-value pairs that Lambda attaches to your function resource\. [Use tags](configuration-tags.md) to organize Lambda functions into groups for cost reporting and filtering in the Lambda console\. - - Tags apply to the entire function, including all versions and aliases\. -+ **Virtual private cloud \(VPC\)** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. -+ **Monitoring and operations tools** – configure CloudWatch and other [monitoring tools](lambda-monitoring.md)\. -+ **Concurrency** – [Reserve concurrency for a function](configuration-concurrency.md) to set the maximum number of simultaneous executions for a function\. Provision concurrency to ensure that a function can scale without fluctuations in latency\. Reserved concurrency applies to the entire function, including all versions and aliases\. -+ **Function URL** – Configure a [function URL](lambda-urls.md) to add a unique HTTP\(S\) endpoint to your Lambda function\. You can configure a function URL on the `$LATEST` unpublished function version, or on any function alias\. - -You can configure the following options on a function, a function version, or an alias\. -+ **Triggers** – Configure [triggers](#configuration-common-triggers)\. -+ **Destinations** – Configure [destinations](invocation-async.md#invocation-async-destinations) for asynchronous invocations \. -+ **Asynchronous invocation** – [Configure error handling behavior](invocation-async.md) to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them\. [Configure a dead\-letter queue](invocation-async.md#invocation-dlq) to retain discarded events\. -+ **Code signing** – To use [Code signing](configuration-codesigning.md) with your function, configure the function to include a code\-signing configuration\. -+ **Database proxies** – [Create a database proxy](configuration-database.md) for functions that use an Amazon RDS DB instance or cluster\. -+ **File systems** – Connect your function to a [file system](configuration-filesystem.md)\. -+ **State machines** – Use a state machine to orchestrate and apply error handling to your function\. - -The console provides separate tabs to configure aliases and versions: -+ **Aliases** – An alias is a named resource that maps to a function version\. You can change an alias to map to a different function version\. -+ **Versions** – Lambda assigns a new version number each time you publish your function\. For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. - -You can configure the following items for a published function version: -+ Triggers -+ Destinations -+ Provisioned concurrency -+ Asynchronous invocation -+ Database proxies - -## Configuring functions \(API\) - -To configure functions with the Lambda API, use the following actions: -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) – Update the function's code\. -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) – Update version\-specific settings\. -+ [TagResource](API_TagResource.md) – Tag a function\. -+ [AddPermission](API_AddPermission.md) – Modify the [resource\-based policy](access-control-resource-based.md) of a function, version, or alias\. -+ [PutFunctionConcurrency](API_PutFunctionConcurrency.md) – Configure a function's reserved concurrency\. -+ [PublishVersion](API_PublishVersion.md) – Create an immutable version with the current code and configuration\. -+ [CreateAlias](API_CreateAlias.md) – Create aliases for function versions\. -+ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) – Configure error handling for asynchronous invocation\. -+ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) – Create a function URL configuration\. -+ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) – Update an existing function URL configuration\. - -## Configuring function memory \(console\) - -Lambda allocates CPU power in proportion to the amount of memory configured\. *Memory* is the amount of memory available to your Lambda function at runtime\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1\-MB increments\. At 1,769 MB, a function has the equivalent of one vCPU \(one vCPU\-second of credits per second\)\. - -You can configure the memory of your function in the Lambda console\. - -**To update the memory of a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. - -1. For **Memory \(MB\)**, set a value from 128 MB to 10,240 MB\. - -1. Choose **Save**\. - -## Configuring function timeout \(console\) - -Lambda runs your code for a set amount of time before timing out\. *Timeout* is the maximum amount of time in seconds that a Lambda function can run\. The default value for this setting is 3 seconds, but you can adjust this in increments of 1 second up to a maximum value of 15 minutes\. - -You can configure the timeout of your function in the Lambda console\. - -**To change the timeout of a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. - -1. For **Timeout**, set a value from 1 second to 15 minutes\. - -1. Choose **Save**\. - -## Configuring ephemeral storage \(console\) - - By default, Lambda allocates 512 MB for a function’s /tmp directory\. You can increase or decrease this amount using the **Ephemeral storage \(MB\)** setting\. To configure the size of a function’s /tmp directory, set a whole number value between 512 MB and 10,240 MB, in 1\-MB increments\. - -**Note** - Configuring ephemeral storage past the default 512 MB allocated incurs a cost\. For more information, see [Lambda pricing](https://aws.amazon.com/lambda/pricing)\. - -You can configure the size of a function’s /tmp directory in the Lambda console\. - -**To update the size of a function’s /tmp directory** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. - -1. For **Ephemeral storage \(MB\)**, set a value from 512 MB to 10,240 MB\. - -1. Choose **Save**\. - -## Accepting function memory recommendations \(console\) - -If you have administrator permissions in AWS Identity and Access Management \(IAM\), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer\. For instructions on opting in to memory recommendations for your account or organization, see [Opting in your account](https://docs.aws.amazon.com/compute-optimizer/latest/ug/getting-started.html#account-opt-in) in the *AWS Compute Optimizer User Guide*\. - -**Note** -Compute Optimizer supports only functions that use x86\_64 architecture\. - -When you've opted in and your [Lambda function meets Compute Optimizer requirements](https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions), you can view and accept function memory recommendations from Compute Optimizer in the Lambda console\. - -**To accept a function memory recommendation** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. On the function configuration page, on the **General configuration** pane, choose **Edit**\. - -1. Under **Memory \(MB\)**, in the memory alert, choose **Update**\. - -1. Choose **Save**\. - -## Configuring triggers \(console\) - -You can configure other AWS services to trigger your function each time a specified event occurs\. - -For details about how services trigger Lambda functions, see [Using AWS Lambda with other services](lambda-services.md)\. - -**To add a trigger to your function\.** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. From the drop\-down list of triggers, choose a trigger\. The console displays additional configuration fields required for this trigger\. - -1. Choose **Add**\. - -## Testing functions \(console\) - -You can create test events for your function from the **Test** tab\. For more information, see [Testing Lambda functions in the console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html)\. - -You can also invoke your function without saving your test event by choosing **Test** before saving\. This creates an unsaved test event that Lambda will preserve for the duration of the session\. You can access your unsaved test events from either the **Test** or **Code** tab\. \ No newline at end of file diff --git a/doc_source/configuration-function-zip.md b/doc_source/configuration-function-zip.md deleted file mode 100644 index 6b8c8a2f..00000000 --- a/doc_source/configuration-function-zip.md +++ /dev/null @@ -1,171 +0,0 @@ -# Deploying Lambda functions as \.zip file archives - -When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function depends on the deployment package type\. To configure a function defined as a container image, see [Deploying Lambda functions as container images](gettingstarted-images.md)\. - -You can use the Lambda console and the Lambda API to create a function defined with a \.zip file archive\. You can also upload an updated \.zip file to change the function code\. - -**Note** -You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. - -**Topics** -+ [Creating the function](#configuration-function-create) -+ [Using the console code editor](#configuration-functions-console-update) -+ [Updating function code](#configuration-function-update) -+ [Changing the runtime or runtime version](#configuration-function-runtime) -+ [Changing the architecture](#configuration-function-arch) -+ [Using the Lambda API](#configuration-function-api) -+ [AWS CloudFormation](#configuration-function-cloudformation) - -## Creating the function - -When you create a function defined with a \.zip file archive, you choose a code template, the language version, and the execution role for the function\. You add your function code after Lambda creates the function\. - -**To create the function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Choose **Author from scratch** or **Use a blueprint** to create your function\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. - - 1. For **Runtime**, choose the language version to use for your function\. - - 1. \(Optional\) For **Architecture**, choose the instruction set architecture to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. - -1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. You can create a new **Execution role** or use an existing role\. - -1. \(Optional\) Expand **Advanced settings**\. You can choose a **Code signing configuration** for the function\. You can also configure an \(Amazon VPC\) for the function to access\. - -1. Choose **Create function**\. - -Lambda creates the new function\. You can now use the console to add the function code and configure other function parameters and features\. For code deployment instructions, see the handler page for the runtime your function uses\. - ------- -#### [ Node\.js ] - -[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) - ------- -#### [ Python ] - - [Deploy Python Lambda functions with \.zip file archives](python-package.md) - ------- -#### [ Ruby ] - - [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) - ------- -#### [ Java ] - - [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) - ------- -#### [ Go ] - - [Deploy Go Lambda functions with \.zip file archives](golang-package.md) - ------- -#### [ C\# ] - - [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) - ------- -#### [ PowerShell ] - - [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ------- - -## Using the console code editor - -The console creates a Lambda function with a single source file\. For scripting languages, you can edit this file and add more files using the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. - -**Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. - -## Updating function code - -For scripting languages \(Node\.js, Python, and Ruby\), you can edit your function code in the embedded code [editor](foundation-console.md#code-editor)\. If the code is larger than 3MB, or if you need to add libraries, or for languages that the editor doesn't support \(Java, Go, C\#\), you must upload your function code as a \.zip archive\. If the \.zip file archive is smaller than 50 MB, you can upload the \.zip file archive from your local machine\. If the file is larger than 50 MB, upload the file to the function from an Amazon S3 bucket\. - -**To upload function code as a \.zip archive** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update and choose the **Code** tab\. - -1. Under **Code source**, choose **Upload from**\. - -1. Choose **\.zip file**, and then choose **Upload**\. - - 1. In the file chooser, select the new image version, choose **Open**, and then choose **Save**\. - -1. \(Alternative to step 4\) Choose **Amazon S3 location**\. - - 1. In the text box, enter the S3 link URL of the \.zip file archive, then choose **Save**\. - -## Changing the runtime or runtime version - -If you update the function configuration to use a new runtime version, you may need to update the function code to be compatible with the new version\. If you update the function configuration to use a different runtime, you **must** provide new function code that is compatible with the runtime and architecture\. For instructions on how to create a deployment package for the function code, see the handler page for the runtime that the function uses\. - -**To change the runtime or runtime version** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update and choose the **Code** tab\. - -1. Scroll down to the **Runtime settings** section, which is under the code editor\. - -1. Choose **Edit**\. - - 1. For **Runtime**, select the runtime version\. - - 1. For **Handler**, specify file name and handler for your function\. - - 1. For **Architecture**, choose the instruction set architecture to use for your function\. - -1. Choose **Save**\. - -## Changing the architecture - -Before you can change the instruction set architecture, you need to ensure that your function's code is compatible with the target architecture\. - -If you use Node\.js, Python, or Ruby and you edit your function code in the embedded [editor](foundation-console.md#code-editor), the existing code may run without modification\. - -However, if you provide your function code using a \.zip file archive deployment package, you must prepare a new \.zip file archive that is compiled and built correctly for the target runtime and instruction\-set architecture\. For instructions, see the handler page for your function runtime\. - -**To change the instruction set architecture** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update and choose the **Code** tab\. - -1. Under **Runtime settings**, choose **Edit**\. - -1. For **Architecture**, choose the instruction set architecture to use for your function\. - -1. Choose **Save**\. - -## Using the Lambda API - -To create and configure a function that uses a \.zip file archive, use the following API operations: -+ [CreateFunction](API_CreateFunction.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - -## AWS CloudFormation - -You can use AWS CloudFormation to create a Lambda function that uses a \.zip file archive\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. - -In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a \.zip file archive: -+ AWS::Lambda::Function - + PackageType – Set to `Zip`\. - + Code – Enter the Amazon S3 bucket name and \.zip file name in the `S3Bucket` and `S3Key`fields\. For Node\.js or Python, you can provide inline source code of your Lambda function\. - + Runtime – Set the runtime value\. - + Architecture – Set the architecture value to `arm64` to use the AWS Graviton2 processor\. By default, the architecture value is `x86_64`\. \ No newline at end of file diff --git a/doc_source/configuration-layers.md b/doc_source/configuration-layers.md deleted file mode 100644 index ce26aa28..00000000 --- a/doc_source/configuration-layers.md +++ /dev/null @@ -1,287 +0,0 @@ -# Creating and sharing Lambda layers - -Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. - -A layer is a \.zip file archive that can contain additional code or data\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. Layers promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. - -You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For functions [defined as a container image](images-create.md), you package your preferred runtime and all code dependencies when you create the container image\. For more information, see [Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. - -You can create layers using the Lambda console, the Lambda API, AWS CloudFormation, or the AWS Serverless Application Model \(AWS SAM\)\. For more information about creating layers with AWS SAM, see [Working with layers](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-layers.html) in the *AWS Serverless Application Model Developer Guide*\. - -**Note** -For Node\.js runtimes, Lambda doesn't currently support ES module dependencies in layers\. - -**Topics** -+ [Creating layer content](#configuration-layers-upload) -+ [Compiling the \.zip file archive for your layer](#configuration-layers-compile) -+ [Including library dependencies in a layer](#configuration-layers-path) -+ [Language\-specific instructions](#configuration-layers-zip-cli) -+ [Creating a layer](#configuration-layers-create) -+ [Deleting a layer version](#configuration-layers-delete) -+ [Configuring layer permissions](#configuration-layers-permissions) -+ [Using AWS CloudFormation with layers](#invocation-layers-cloudformation) - -## Creating layer content - -When you create a layer, you must bundle all its content into a \.zip file archive\. You upload the \.zip file archive to your layer from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. Lambda extracts the layer contents into the `/opt` directory when setting up the execution environment for the function\. - -## Compiling the \.zip file archive for your layer - -You build your layer code into a \.zip file archive using the same procedure that you would use for a function deployment package\. If your layer includes any native code libraries, you must compile and build these libraries using a Linux development machine so that the binaries are compatible with [Amazon Linux](lambda-runtimes.md)\. - -When you create a layer, you can specify whether the layer is compatible with one or both of the instruction set architectures\. You may need to set specific compile flags to build a layer that is compatible with the `arm64` architecture\. - -One way to ensure that you package libraries correctly for Lambda is to use [AWS Cloud9](http://aws.amazon.com/cloud9/)\. For more information, see [Using Lambda layers to simplify your development process](http://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/) on the AWS Compute Blog\. - -## Including library dependencies in a layer - -For each [Lambda runtime](lambda-runtimes.md), the PATH variable includes specific folders in the `/opt` directory\. If you define the same folder structure in your layer \.zip file archive, your function code can access the layer content without the need to specify the path\. - -The following table lists the folder paths that each runtime supports\. - - -**Layer paths for each Lambda runtime** -[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) - -The following examples show how you can structure the folders in your layer \.zip archive\. - ------- -#### [ Node\.js ] - -**Example file structure for the AWS X\-Ray SDK for Node\.js** - -``` -xray-sdk.zip -└ nodejs/node_modules/aws-xray-sdk -``` - ------- -#### [ Python ] - -**Example file structure for the Pillow library** - -``` -pillow.zip -│ python/PIL -└ python/Pillow-5.3.0.dist-info -``` - ------- -#### [ Ruby ] - -**Example file structure for the JSON gem** - -``` -json.zip -└ ruby/gems/2.7.0/ - | build_info - | cache - | doc - | extensions - | gems - | └ json-2.1.0 - └ specifications - └ json-2.1.0.gemspec -``` - ------- -#### [ Java ] - -**Example file structure for the Jackson JAR file** - -``` -jackson.zip -└ java/lib/jackson-core-2.2.3.jar -``` - ------- -#### [ All ] - -**Example file structure for the jq library** - -``` -jq.zip -└ bin/jq -``` - ------- - -For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. - -## Language\-specific instructions - - For language\-specific instructions on how to create a \.zip file archive, see the following topics\. - ------- -#### [ Node\.js ] - -[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) - ------- -#### [ Python ] - - [Deploy Python Lambda functions with \.zip file archives](python-package.md) - ------- -#### [ Ruby ] - - [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) - ------- -#### [ Java ] - - [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) - ------- -#### [ Go ] - - [Deploy Go Lambda functions with \.zip file archives](golang-package.md) - ------- -#### [ C\# ] - - [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) - ------- -#### [ PowerShell ] - - [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ------- - -## Creating a layer - -You can create new layers using the Lambda console or the Lambda API\. - -Layers can have one or more version\. When you create a layer, Lambda sets the layer version to version 1\. You can configure permissions on an existing layer version, but to update the code or make other configuration changes, you must create a new version of the layer\. - -**To create a layer \(console\)** - -1. Open the [Layers page](https://console.aws.amazon.com/lambda/home#/layers) of the Lambda console\. - -1. Choose **Create layer**\. - -1. Under **Layer configuration**, for **Name**, enter a name for your layer\. - -1. \(Optional\) For **Description**, enter a description for your layer\. - -1. To upload your layer code, do one of the following: - + To upload a \.zip file from your computer, choose **Upload a \.zip file**\. Then, choose **Upload** to select your local \.zip file\. - + To upload a file from Amazon S3, choose **Upload a file from Amazon S3**\. Then, for **Amazon S3 link URL**, enter a link to the file\. - -1. \(Optional\) For **Compatible instruction set architectures**, choose one value or both values\. - -1. \(Optional\) For **Compatible runtimes**, choose up to 15 runtimes\. - -1. \(Optional\) For **License**, enter any necessary license information\. - -1. Choose **Create**\. - -**To create a layer \(API\)** - -To create a layer, use the publish\-layer\-version command with a name, description, \.zip file archive, a list of [runtimes](lambda-runtimes.md) and a list of architectures that are compatible with the layer\. The runtimes and architecture parameters are optional\. - -``` -aws lambda publish-layer-version --layer-name my-layer --description "My layer" \ ---license-info "MIT" --content S3Bucket=lambda-layers-us-east-2-123456789012,S3Key=layer.zip \ - --compatible-runtimes python3.6 python3.7 python3.8 - --compatible-architectures "arm64" "x86_64" -``` - -You should see output similar to the following: - -``` -{ - "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 layer", - "CreatedDate": "2018-11-14T23:03:52.894+0000", - "Version": 1, - "CompatibleArchitectures": [ - "arm64", - "x86_64" - ], - "LicenseInfo": "MIT", - "CompatibleRuntimes": [ - "python3.6", - "python3.7", - "python3.8" - ] -} -``` - -**Note** -Each time that you call `publish-layer-version`, you create a new version of the layer\. - -## Deleting a layer version - -To delete a layer version, use the delete\-layer\-version command\. - -``` -aws lambda delete-layer-version --layer-name my-layer --version-number 1 -``` - -When you delete a layer version, you can no longer configure a Lambda function to use it\. However, any function that already uses the version continues to have access to it\. Version numbers are never reused for a layer name\. - -## Configuring layer permissions - -By default, a layer that you create is private to your AWS account\. However, you can optionally share the layer with other accounts or make it public\. - -To grant layer\-usage permission to another account, add a statement to the layer version's permissions policy using the add\-layer\-version\-permission command\. In each statement, you can grant permission to a single account, all accounts, or an organization\. - -``` -aws lambda add-layer-version-permission --layer-name xray-sdk-nodejs --statement-id xaccount \ ---action lambda:GetLayerVersion --principal 111122223333 --version-number 1 --output text -``` - -You should see output similar to the following: - -``` -e210ffdc-e901-43b0-824b-5fcd0dd26d16 {"Sid":"xaccount","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:root"},"Action":"lambda:GetLayerVersion","Resource":"arn:aws:lambda:us-east-2:123456789012:layer:xray-sdk-nodejs:1"} -``` - -Permissions apply only to a single layer version\. Repeat the process each time that you create a new layer version\. - -For more examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. - -## Using AWS CloudFormation with layers - -You can use AWS CloudFormation to create a layer and associate the layer with your Lambda function\. The following example template creates a layer named **blank\-nodejs\-lib** and attaches the layer to the Lambda function using the **Layers** property\. - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: A Lambda application that calls the Lambda API. -Resources: - function: - Type: AWS::Serverless::Function - Properties: - Handler: index.handler - Runtime: nodejs12.x - CodeUri: function/. - Description: Call the Lambda API - Timeout: 10 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - Tracing: Active - Layers: - - !Ref libs - libs: - Type: AWS::Lambda::LayerVersion - Properties: - LayerName: blank-nodejs-lib - Description: Dependencies for the blank sample app. - Content: - S3Bucket: my-bucket-region-123456789012 - S3Key: layer.zip - CompatibleRuntimes: - - nodejs12.x -``` \ No newline at end of file diff --git a/doc_source/configuration-tags.md b/doc_source/configuration-tags.md deleted file mode 100644 index bcaa564d..00000000 --- a/doc_source/configuration-tags.md +++ /dev/null @@ -1,132 +0,0 @@ -# Using tags on Lambda functions - -You can tag AWS Lambda functions to activate [attribute\-based access control \(ABAC\)](attribute-based-access-control.md) and to organize them by owner, project, or department\. Tags are free\-form key\-value pairs that are supported across AWS services for use in ABAC, filtering resources, and [adding detail to billing reports\.](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) - -Tags apply at the function level, not to versions or aliases\. Tags are not part of the version\-specific configuration that Lambda creates a snapshot of when you publish a version\. - -**Topics** -+ [Permissions required for working with tags](#permissions-required-for-working-with-tags-cli) -+ [Using tags with the Lambda console](#using-tags-with-the-console) -+ [Using tags with the AWS CLI](#configuration-tags-cli) -+ [Requirements for tags](#configuration-tags-restrictions) - -## Permissions required for working with tags - -Grant appropriate permissions to the AWS Identity and Access Management \(IAM\) identity \(user, group, or role\) for the person working with the function: -+ **lambda:ListTags **– When a function has tags, grant this permission to anyone who needs to call `GetFunction` or `ListTags` on it\. -+ **lambda:TagResource** – Grant this permission to anyone who needs to call `CreateFunction` or `TagResource`\. - -For more information, see [Identity\-based IAM policies for Lambda](access-control-identity-based.md)\. - -## Using tags with the Lambda console - -You can use the Lambda console to create functions that have tags, add tags to existing functions, and filter functions by tags that you add\. - -**To add tags when you create a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Choose **Author from scratch** or **Container image**\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter the function name\. Function names are limited to 64 characters in length\. - - 1. For **Runtime**, choose the language version to use for your function\. - - 1. \(Optional\) For **Architecture**, choose the [instruction set architecture](foundation-arch.md) to use for your function\. The default architecture is x86\_64\. When you build the deployment package for your function, make sure that it is compatible with the instruction set architecture that you choose\. - -1. Expand **Advanced settings**, and then select **Enable tags**\. - -1. Choose **Add new tag**, and then enter a **Key** and an optional **Value**\. To add more tags, repeat this step\. - -1. Choose **Create function**\. - -**To add tags to an existing function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Choose **Configuration**, and then choose **Tags**\. - -1. Under **Tags**, choose **Manage tags**\. - -1. Choose **Add new tag**, and then enter a **Key** and an optional **Value**\. To add more tags, repeat this step\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-add.png) - -1. Choose **Save**\. - -**To filter functions with tags** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the search bar to see a list of function attributes and tag keys\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-key.png) - -1. Choose a tag key to see a list of values that are in use in the current AWS Region\. - -1. Choose a value to see functions with that value, or choose **\(all values\)** to see all functions that have a tag with that key\. -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/configuration-tags-value.png) - -The search bar also supports searching for tag keys\. Enter `tag` to see only a list of tag keys, or enter the name of a key to find it in the list\. - -## Using tags with the AWS CLI - -### Adding and removing tags - -To create a new Lambda function with tags, use the create\-function command with the \-\-tags option\. - -``` -aws lambda create-function --function-name my-function ---handler index.js --runtime nodejs16.x \ ---role arn:aws:iam::123456789012:role/lambda-role \ ---tags Department=Marketing,CostCenter=1234ABCD -``` - -To add tags to an existing function, use the tag\-resource command\. - -``` -aws lambda tag-resource \ ---resource arn:aws:lambda:us-east-2:123456789012:function:my-function \ ---tags Department=Marketing,CostCenter=1234ABCD -``` - -To remove tags, use the untag\-resource command\. - -``` -aws lambda untag-resource --resource arn:aws:lambda:us-east-1:123456789012:function:my-function \ ---tag-keys Department -``` - -### Viewing tags on a function - -If you want to view the tags that are applied to a specific Lambda function, you can use either of the following AWS CLI commands: -+ [ListTags](API_ListTags.md) – To view a list of the tags associated with this function, include your Lambda function ARN \(Amazon Resource Name\): - - ``` - aws lambda list-tags --resource arn:aws:lambda:us-east-1:123456789012:function:my-function - ``` -+ [GetFunction](API_GetFunction.md) – To view a list of the tags associated with this function, include your Lambda function name: - - ``` - aws lambda get-function --function-name my-function - ``` - -#### Filtering functions by tag - -You can use the AWS Resource Groups Tagging API [GetResources](https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) API operation to filter your resources by tags\. The `GetResources` operation receives up to 10 filters, with each filter containing a tag key and up to 10 tag values\. You provide `GetResources` with a `ResourceType` to filter by specific resource types\. - -For more information about AWS Resource Groups, see [What are resource groups?](https://docs.aws.amazon.com/ARG/latest/userguide/resource-groups.html) in the *AWS Resource Groups and Tags User Guide*\. - -## Requirements for tags - -The following requirements apply to tags: -+ Maximum number of tags per resource: 50 -+ Maximum key length: 128 Unicode characters in UTF\-8 -+ Maximum value length: 256 Unicode characters in UTF\-8 -+ Tag keys and values are case sensitive\. -+ Do not use the `aws:` prefix in your tag names or values because it is reserved for AWS use\. You can't edit or delete tag names or values with this prefix\. Tags with this prefix do not count against your tags per resource limit\. -+ If you plan to use your tagging schema across multiple services and resources, remember that other services may have restrictions on allowed characters\. Generally allowed characters are: letters, spaces, and numbers representable in UTF\-8, plus the following special characters: \+ \- = \. \_ : / @\. \ No newline at end of file diff --git a/doc_source/configuration-versions.md b/doc_source/configuration-versions.md deleted file mode 100644 index fd15b395..00000000 --- a/doc_source/configuration-versions.md +++ /dev/null @@ -1,88 +0,0 @@ -# Lambda function versions - -You can use versions to manage the deployment of your functions\. For example, you can publish a new version of a function for beta testing without affecting users of the stable production version\. Lambda creates a new version of your function each time that you publish the function\. The new version is a copy of the unpublished version of the function\. - -**Note** -Lambda doesn't create a new version if the code in the unpublished version is the same as the previous published version\. You need to deploy code changes in $LATEST before you can create a new version\. - -A function version includes the following information: -+ The function code and all associated dependencies\. -+ The Lambda runtime that invokes the function\. -+ All the function settings, including the environment variables\. -+ A unique Amazon Resource Name \(ARN\) to identify the specific version of the function\. - -**Topics** -+ [Creating function versions](#configuration-versions-config) -+ [Managing versions with the Lambda API](#versioning-versions-api) -+ [Using versions](#versioning-versions-using) -+ [Granting permissions](#versioning-permissions) - -## Creating function versions - -You can change the function code and settings only on the unpublished version of a function\. When you publish a version, Lambda locks the code and most of the settings to maintain a consistent experience for users of that version\. For more information about configuring function settings, see [Configuring Lambda function options](configuration-function-common.md)\. - -You can create a function version using the Lambda console\. - -**To create a new function version** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function and then choose **Versions**\. - -1. On the versions configuration page, choose **Publish new version**\. - -1. \(Optional\) Enter a version description\. - -1. Choose **Publish**\. - -## Managing versions with the Lambda API - -To publish a version of a function, use the [PublishVersion](API_PublishVersion.md) API operation\. - -The following example publishes a new version of a function\. The response returns configuration information about the new version, including the version number and the function ARN with the version suffix\. - -``` -aws lambda publish-version --function-name my-function -``` - -You should see the following output: - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", - "Version": "1", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "function.handler", - "Runtime": "nodejs16.x", - ... -} -``` - -## Using versions - -You can reference your Lambda function using either a qualified ARN or an unqualified ARN\. -+ **Qualified ARN** – The function ARN with a version suffix\. The following example refers to version 42 of the `helloworld` function\. - - ``` - arn:aws:lambda:aws-region:acct-id:function:helloworld:42 - ``` -+ **Unqualified ARN** – The function ARN without a version suffix\. - - ``` - arn:aws:lambda:aws-region:acct-id:function:helloworld - ``` - -You can use a qualified or an unqualified ARN in all relevant API operations\. However, you can't use an unqualified ARN to create an alias\. - -If you decide not to publish function versions, you can invoke the function using either the qualified or unqualified ARN in your [event source mapping](invocation-eventsourcemapping.md)\. When you invoke a function using an unqualified ARN, Lambda implicitly invokes $LATEST\. - -Lambda publishes a new function version only if the code has never been published or if the code has changed from the last published version\. If there is no change, the function version remains at the last published version\. - -The qualified ARN for each Lambda function version is unique\. After you publish a version, you can't change the ARN or the function code\. - -## Granting permissions - -You can use a [resource\-based policy](access-control-resource-based.md) or an [identity\-based policy](access-control-identity-based.md) to grant access to your function\. The scope of the permission depends on whether you apply the policy to a function or to one version of a function\. For more information about function resource names in policies, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. - -You can simplify the management of event sources and AWS Identity and Access Management \(IAM\) policies by using function aliases\. For more information, see [Lambda function aliases](configuration-aliases.md)\. \ No newline at end of file diff --git a/doc_source/configuration-vpc-endpoints.md b/doc_source/configuration-vpc-endpoints.md deleted file mode 100644 index fdf6f193..00000000 --- a/doc_source/configuration-vpc-endpoints.md +++ /dev/null @@ -1,106 +0,0 @@ -# Configuring interface VPC endpoints for Lambda - -If you use Amazon Virtual Private Cloud \(Amazon VPC\) to host your AWS resources, you can establish a connection between your VPC and Lambda\. You can use this connection to invoke your Lambda function without crossing the public internet\. - -To establish a private connection between your VPC and Lambda, create an [interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html)\. Interface endpoints are powered by [AWS PrivateLink](http://aws.amazon.com/privatelink), which enables you to privately access Lambda APIs without an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection\. Instances in your VPC don't need public IP addresses to communicate with Lambda APIs\. Traffic between your VPC and Lambda does not leave the AWS network\. - -Each interface endpoint is represented by one or more [elastic network interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in your subnets\. A network interface provides a private IP address that serves as an entry point for traffic to Lambda\. - -**Topics** -+ [Considerations for Lambda interface endpoints](#vpc-endpoint-considerations) -+ [Creating an interface endpoint for Lambda](#vpc-endpoint-create) -+ [Creating an interface endpoint policy for Lambda](#vpc-endpoint-policy) - -## Considerations for Lambda interface endpoints - -Before you set up an interface endpoint for Lambda, be sure to review [Interface endpoint properties and limitations](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-interface-limitations) in the *Amazon VPC User Guide*\. - -You can call any of the Lambda API operations from your VPC\. For example, you can invoke the Lambda function by calling the `Invoke` API from within your VPC\. For the full list of Lambda APIs, see [Actions](https://docs.aws.amazon.com/lambda/latest/dg/API_Operations.html) in the Lambda API reference\. - -### Keep\-alive for persistent connections - -Lambda purges idle connections over time, so you must use a keep\-alive directive to maintain persistent connections\. Attempting to reuse an idle connection when invoking a function results in a connection error\. To maintain your persistent connection, use the keep\-alive directive associated with your runtime\. For an example, see [Reusing Connections with Keep\-Alive in Node\.js](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) in the *AWS SDK for JavaScript Developer Guide*\. - -### Billing Considerations - -There is no additional cost to access a Lambda function through an interface endpoint\. For more Lambda pricing information, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. - -Standard pricing for AWS PrivateLink applies to interface endpoints for Lambda\. Your AWS account is billed for every hour an interface endpoint is provisioned in each Availability Zone and for data processed through the interface endpoint\. For more interface endpoint pricing information, see [AWS PrivateLink pricing](http://aws.amazon.com/privatelink/pricing/)\. - -### VPC Peering Considerations - -You can connect other VPCs to the VPC with interface endpoints using [VPC peering](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html)\. VPC peering is a networking connection between two VPCs\. You can establish a VPC peering connection between your own two VPCs, or with a VPC in another AWS account\. The VPCs can also be in two different AWS Regions\. - -Traffic between peered VPCs stays on the AWS network and does not traverse the public internet\. Once VPCs are peered, resources like Amazon Elastic Compute Cloud \(Amazon EC2\) instances, Amazon Relational Database Service \(Amazon RDS\) instances, or VPC\-enabled Lambda functions in both VPCs can access the Lambda API through interface endpoints created in the one of the VPCs\. - -## Creating an interface endpoint for Lambda - -You can create an interface endpoint for Lambda using either the Amazon VPC console or the AWS Command Line Interface \(AWS CLI\)\. For more information, see [Creating an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide*\. - -**To create an interface endpoint for Lambda \(console\)** - -1. Open the [Endpoints page](https://console.aws.amazon.com/vpc/home?#Endpoints) of the Amazon VPC console\. - -1. Choose **Create Endpoint**\. - -1. For **Service category**, verify that **AWS services** is selected\. - -1. For **Service Name**, choose **com\.amazonaws\.*region*\.lambda**\. Verify that the **Type** is **Interface**\. - -1. Choose a VPC and subnets\. - -1. To enable private DNS for the interface endpoint, select the **Enable DNS Name** check box\. - -1. For **Security group**, choose one or more security groups\. - -1. Choose **Create endpoint**\. - -To use the private DNS option, you must set the `enableDnsHostnames` and `enableDnsSupportattributes` of your VPC\. For more information, see [Viewing and updating DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-updating) in the *Amazon VPC User Guide*\. If you enable private DNS for the interface endpoint, you can make API requests to Lambda using its default DNS name for the Region, for example, `lambda.us-east-1.amazonaws.com`\. For more service endpoints, see [Service endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html) in the *AWS General Reference*\. - -For more information, see [Accessing a service through an interface endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#access-service-though-endpoint) in the *Amazon VPC User Guide*\. - -For information about creating and configuring an endpoint using AWS CloudFormation, see the [AWS::EC2::VPCEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html) resource in the *AWS CloudFormation User Guide*\. - -**To create an interface endpoint for Lambda \(AWS CLI\)** -Use the `create-vpc-endpoint` command and specify the VPC ID, VPC endpoint type \(interface\), service name, subnets that will use the endpoint, and security groups to associate with the endpoint's network interfaces\. For example: - -``` -aws ec2 create-vpc-endpoint --vpc-id vpc-ec43eb89 --vpc-endpoint-type Interface --service-name \ - com.amazonaws.us-east-1.lambda --subnet-id subnet-abababab --security-group-id sg-1a2b3c4d -``` - -## Creating an interface endpoint policy for Lambda - -To control who can use your interface endpoint and which Lambda functions the user can access, you can attach an endpoint policy to your endpoint\. The policy specifies the following information: -+ The principal that can perform actions\. -+ The actions that the principal can perform\. -+ The resources on which the principal can perform actions\. - -For more information, see [Controlling access to services with VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html) in the *Amazon VPC User Guide*\. - -**Example: Interface endpoint policy for Lambda actions** -The following is an example of an endpoint policy for Lambda\. When attached to an endpoint, this policy allows user `MyUser` to invoke the function `my-function`\. - -**Note** -You need to include both the qualified and the unqualified function ARN in the resource\. - -``` -{ - "Statement":[ - { - "Principal": - { - "AWS": "arn:aws:iam::111122223333:user/MyUser" - }, - "Effect":"Allow", - "Action":[ - "lambda:InvokeFunction" - ], - "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "arn:aws:lambda:us-east-2:123456789012:function:my-function:*" - ] - } - ] -} -``` diff --git a/doc_source/configuration-vpc.md b/doc_source/configuration-vpc.md deleted file mode 100644 index 3d856b1c..00000000 --- a/doc_source/configuration-vpc.md +++ /dev/null @@ -1,315 +0,0 @@ -# Configuring a Lambda function to access resources in a VPC - -You can configure a Lambda function to connect to private subnets in a virtual private cloud \(VPC\) in your AWS account\. Use Amazon Virtual Private Cloud \(Amazon VPC\) to create a private network for resources such as databases, cache instances, or internal services\. Connect your function to the VPC to access private resources while the function is running\. - -When you connect a function to a VPC, Lambda assigns your function to a Hyperplane ENI \(elastic network interface\) for each subnet in your function's VPC configuration\. Lambda creates a Hyperplane ENI the first time a unique subnet and security group combination is defined for a VPC\-enabled function in an account\. - -While Lambda creates a Hyperplane ENI, you can't perform additional operations that target the function, such as [creating versions](configuration-versions.md) or updating the function's code\. For new functions, you can't invoke the function until its state changes from `Pending` to `Active`\. For existing functions, you can still invoke an earlier version while the update is in progress\. For details about the Hyperplane ENI lifecycle, see [Lambda Hyperplane ENIs](foundation-networking.md#foundation-nw-eni)\. - -Lambda functions can't connect directly to a VPC with [ dedicated instance tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)\. To connect to resources in a dedicated VPC, [peer it to a second VPC with default tenancy](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-dedicated-vpc/)\. - -**Topics** -+ [Managing VPC connections](#vpc-managing-eni) -+ [Execution role and user permissions](#vpc-permissions) -+ [Configuring VPC access \(console\)](#vpc-configuring) -+ [Configuring VPC access \(API\)](#vpc-configuring-api) -+ [Using IAM condition keys for VPC settings](#vpc-conditions) -+ [Internet and service access for VPC\-connected functions](#vpc-internet) -+ [VPC tutorials](#vpc-tutorials) -+ [Sample VPC configurations](#vpc-samples) - -## Managing VPC connections - -This section provides a summary of Lambda VPC connections\. For details about VPC networking in Lambda, see [ VPC networking for Lambda](foundation-networking.md)\. - -Multiple functions can share a network interface, if the functions share the same subnet and security group\. Connecting additional functions to the same VPC configuration \(subnet and security group\) that has an existing Lambda\-managed network interface is much quicker than creating a new network interface\. - -If your functions aren't active for a long period of time, Lambda reclaims its network interfaces, and the functions become `Idle`\. To reactivate an idle function, invoke it\. This invocation fails, and the function enters a `Pending` state again until a network interface is available\. - -If you update your function to access a different VPC, it terminates connectivity from the Hyperplane ENI to the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, Lambda connects function invocations to the previous VPC\. After the update is complete, new invocations start using the new VPC and the Lambda function is no longer connected to the older VPC\. - -For short\-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself\. To ensure connection reuse for short\-lived/infrequently invoked functions, we recommend that you use *TCP keep\-alive* for connections that were created during your function initialization, to avoid creating new connections for subsequent invokes\. For more information on reusing connections using keep\-alive, refer to [Lambda documentation on reusing connections](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html)[\.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html) - -## Execution role and user permissions - -Lambda uses your function's permissions to create and manage network interfaces\. To connect to a VPC, your function's [execution role](lambda-intro-execution-role.md) must have the following permissions: - -**Execution role permissions** -+ **ec2:CreateNetworkInterface** -+ **ec2:DescribeNetworkInterfaces** – This action only works if it's allowed on all resources \(`"Resource": "*"`\)\. -+ **ec2:DeleteNetworkInterface** – If you don't specify a resource ID for **DeleteNetworkInterface** in the execution role, your function may not be able to access the VPC\. Either specify a unique resource ID, or include all resource IDs, for example, `"Resource": "arn:aws:ec2:us-west-2:123456789012:*/*"`\. -+ **ec2:AssignPrivateIpAddresses** -+ **ec2:UnassignPrivateIpAddresses** - -These permissions are included in the AWS managed policy **AWSLambdaVPCAccessExecutionRole**\. Note that these permissions are required only to create ENIs, not to invoke your VPC function\. In other words, you are still able to invoke your VPC function successfully even if you remove these permissions from your execution role\. To completely disassociate your Lambda function from the VPC, update the function's VPC configuration settings using the console or the [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) API\. - -When you configure VPC connectivity, Lambda uses your permissions to verify network resources\. To configure a function to connect to a VPC, your AWS Identity and Access Management \(IAM\) user needs the following permissions: - -**User permissions** -+ **ec2:DescribeSecurityGroups** -+ **ec2:DescribeSubnets** -+ **ec2:DescribeVpcs** - -## Configuring VPC access \(console\) - -If your [IAM permissions](#vpc-conditions) allow you only to create Lambda functions that connect to your VPC, you must configure the VPC when you create the function\. If your IAM permissions allow you to create functions that aren't connected to your VPC, you can add the VPC configuration after you create the function\. - -**To configure a VPC when you create a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Under **Basic information**, for **Function name**, enter a name for your function\. - -1. Expand **Advanced settings**\. - -1. Under **Network**, choose a **VPC** for your function to access\. - -1. Choose subnets and security groups\. When you choose a security group, the console displays the inbound and outbound rules for that security group\. -**Note** -To access private resources, connect your function to private subnets\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. - -1. Choose **Create function**\. - -**To configure a VPC for an existing function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **VPC**\. - -1. Under **VPC**, choose **Edit**\. - -1. Choose a VPC, subnets, and security groups\. -**Note** -To access private resources, connect your function to private subnets\. If your function needs internet access, use [network address translation \(NAT\)](#vpc-internet)\. Connecting a function to a public subnet doesn't give it internet access or a public IP address\. - -1. Choose **Save**\. - -## Configuring VPC access \(API\) - -To connect a Lambda function to a VPC, you can use the following API operations: -+ [CreateFunction](API_CreateFunction.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - -To create a function and connect it to a VPC using the AWS Command Line Interface \(AWS CLI\), you can use the `create-function` command with the `vpc-config` option\. The following example creates a function with a connection to a VPC with two subnets and one security group\. - -``` -aws lambda create-function --function-name my-function \ ---runtime nodejs16.x --handler index.js --zip-file fileb://function.zip \ ---role arn:aws:iam::123456789012:role/lambda-role \ ---vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb -``` - -To connect an existing function to a VPC, use the `update-function-configuration` command with the `vpc-config` option\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---vpc-config SubnetIds=subnet-071f712345678e7c8,subnet-07fd123456788a036,SecurityGroupIds=sg-085912345678492fb -``` - -To disconnect your function from a VPC, update the function configuration with an empty list of subnets and security groups\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---vpc-config SubnetIds=[],SecurityGroupIds=[] -``` - -## Using IAM condition keys for VPC settings - -You can use Lambda\-specific condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. - -Lambda supports the following condition keys in IAM policies: -+ **lambda:VpcIds** – Allow or deny one or more VPCs\. -+ **lambda:SubnetIds** – Allow or deny one or more subnets\. -+ **lambda:SecurityGroupIds** – Allow or deny one or more security groups\. - -The Lambda API operations [CreateFunction](API_CreateFunction.md) and [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) support these condition keys\. For more information about using condition keys in IAM policies, see [IAM JSON Policy Elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. - -**Tip** -If your function already includes a VPC configuration from a previous API request, you can send an `UpdateFunctionConfiguration` request without the VPC configuration\. - -### Example policies with condition keys for VPC settings - -The following examples demonstrate how to use condition keys for VPC settings\. After you create a policy statement with the desired restrictions, append the policy statement for the target IAM user or role\. - -#### Ensure that users deploy only VPC\-connected functions - -To ensure that all users deploy only VPC\-connected functions, you can deny function create and update operations that don't include a valid VPC ID\. - -Note that VPC ID is not an input parameter to the `CreateFunction` or `UpdateFunctionConfiguration` request\. Lambda retrieves the VPC ID value based on the subnet and security group parameters\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "EnforceVPCFunction", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Deny", - "Resource": "*", - "Condition": { - "Null": { - "lambda:VpcIds": "true" - } - } - } - ] -} -``` - -#### Deny users access to specific VPCs, subnets, or security groups - -To deny users access to specific VPCs, use `StringEquals` to check the value of the `lambda:VpcIds` condition\. The following example denies users access to `vpc-1` and `vpc-2`\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "EnforceOutOfVPC", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Deny", - "Resource": "*", - "Condition": { - "StringEquals": { - "lambda:VpcIds": ["vpc-1", "vpc-2"] - } - } - } -``` - -To deny users access to specific subnets, use `StringEquals` to check the value of the `lambda:SubnetIds` condition\. The following example denies users access to `subnet-1` and `subnet-2`\. - -``` -{ - "Sid": "EnforceOutOfSubnet", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Deny", - "Resource": "*", - "Condition": { - "ForAnyValue:StringEquals": { - "lambda:SubnetIds": ["subnet-1", "subnet-2"] - } - } - } -``` - -To deny users access to specific security groups, use `StringEquals` to check the value of the `lambda:SecurityGroupIds` condition\. The following example denies users access to `sg-1` and `sg-2`\. - -``` -{ - "Sid": "EnforceOutOfSecurityGroups", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Deny", - "Resource": "*", - "Condition": { - "ForAnyValue:StringEquals": { - "lambda:SecurityGroupIds": ["sg-1", "sg-2"] - } - } - } - ] -} -``` - -#### Allow users to create and update functions with specific VPC settings - -To allow users to access specific VPCs, use `StringEquals` to check the value of the `lambda:VpcIds` condition\. The following example allows users to access `vpc-1` and `vpc-2`\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "EnforceStayInSpecificVpc", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Allow", - "Resource": "*", - "Condition": { - "StringEquals": { - "lambda:VpcIds": ["vpc-1", "vpc-2"] - } - } - } -``` - -To allow users to access specific subnets, use `StringEquals` to check the value of the `lambda:SubnetIds` condition\. The following example allows users to access `subnet-1` and `subnet-2`\. - -``` -{ - "Sid": "EnforceStayInSpecificSubnets", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Allow", - "Resource": "*", - "Condition": { - "ForAllValues:StringEquals": { - "lambda:SubnetIds": ["subnet-1", "subnet-2"] - } - } - } -``` - -To allow users to access specific security groups, use `StringEquals` to check the value of the `lambda:SecurityGroupIds` condition\. The following example allows users to access `sg-1` and `sg-2`\. - -``` -{ - "Sid": "EnforceStayInSpecificSecurityGroup", - "Action": [ - "lambda:CreateFunction", - "lambda:UpdateFunctionConfiguration" - ], - "Effect": "Allow", - "Resource": "*", - "Condition": { - "ForAllValues:StringEquals": { - "lambda:SecurityGroupIds": ["sg-1", "sg-2"] - } - } - } - ] -} -``` - -## Internet and service access for VPC\-connected functions - -By default, Lambda runs your functions in a secure VPC with access to AWS services and the internet\. Lambda owns this VPC, which isn't connected to your account's [default VPC](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. - -**Note** -Several AWS services offer [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)\. You can use VPC endpoints to connect to AWS services from within a VPC without internet access\. - -Internet access from a private subnet requires network address translation \(NAT\)\. To give your function access to the internet, route outbound traffic to a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. An idle NAT gateway connection will [ time out after 350 seconds\.](https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-troubleshooting.html#nat-gateway-troubleshooting-timeout) For more information, see [How do I give internet access to my Lambda function in a VPC?](https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/) - -## VPC tutorials - -In the following tutorials, you connect a Lambda function to resources in your VPC\. -+ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) -+ [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) - -## Sample VPC configurations - -You can use the following sample AWS CloudFormation templates to create VPC configurations to use with Lambda functions\. There are two templates available in this guide's GitHub repository: -+ [vpc\-private\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-private.yaml) – A VPC with two private subnets and VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. Use this template to create a VPC for functions that don't need internet access\. This configuration supports use of Amazon S3 and DynamoDB with the AWS SDKs, and access to database resources in the same VPC over a local network connection\. -+ [vpc\-privatepublic\.yaml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/main/templates/vpc-privatepublic.yaml) – A VPC with two private subnets, VPC endpoints, a public subnet with a NAT gateway, and an internet gateway\. Internet\-bound traffic from functions in the private subnets is routed to the NAT gateway using a route table\. - -To create a VPC using a template, on the AWS CloudFormation console [Stacks page](https://console.aws.amazon.com/cloudformation/home#/stacks), choose **Create stack**, and then follow the instructions in the **Create stack** wizard\. diff --git a/doc_source/csharp-context.md b/doc_source/csharp-context.md deleted file mode 100644 index 539c4cec..00000000 --- a/doc_source/csharp-context.md +++ /dev/null @@ -1,28 +0,0 @@ -# AWS Lambda context object in C\# - -When Lambda runs your function, it passes a context object to the [handler](csharp-handler.md)\. This object provides properties with information about the invocation, function, and execution environment\. - -**Context properties** -+ `FunctionName` – The name of the Lambda function\. -+ `FunctionVersion` – The [version](configuration-versions.md) of the function\. -+ `InvokedFunctionArn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `MemoryLimitInMB` – The amount of memory that's allocated for the function\. -+ `AwsRequestId` – The identifier of the invocation request\. -+ `LogGroupName` – The log group for the function\. -+ `LogStreamName` – The log stream for the function instance\. -+ `RemainingTime` \(`TimeSpan`\) – The number of milliseconds left before the execution times out\. -+ `Identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. -+ `ClientContext` – \(mobile apps\) Client context that's provided to Lambda by the client application\. -+ `Logger` The [logger object](csharp-logging.md) for the function\. - - The following C\# code snippet shows a simple handler function that prints some of the context information\. - -``` -public async Task Handler(ILambdaContext context) -{ - Console.WriteLine("Function name: " + context.FunctionName); - Console.WriteLine("RemainingTime: " + context.RemainingTime); - await Task.Delay(TimeSpan.FromSeconds(0.42)); - Console.WriteLine("RemainingTime after sleep: " + context.RemainingTime); -} -``` \ No newline at end of file diff --git a/doc_source/csharp-exceptions.md b/doc_source/csharp-exceptions.md deleted file mode 100644 index 3e3c8975..00000000 --- a/doc_source/csharp-exceptions.md +++ /dev/null @@ -1,222 +0,0 @@ -# AWS Lambda function errors in C\# - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the C\# runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Syntax](#csharp-exceptions-syntax) -+ [How it works](#csharp-exceptions-how) -+ [Using the Lambda console](#csharp-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-exceptions-cli) -+ [Error handling in other AWS services](#csharp-exceptions-other-services) -+ [What's next?](#csharp-exceptions-next-up) - -## Syntax - -In the initialization phase, exceptions can be thrown for invalid handler strings, a rule\-breaking type or method \(see [Lambda function handler restrictions](csharp-handler.md#csharp-handler-restrictions)\), or any other validation method \(such as forgetting the serializer attribute and having a POCO as your input or output type\)\. These exceptions are of type `LambdaException`\. For example: - -``` -{ - "errorType": "LambdaException", - "errorMessage": "Invalid lambda function handler: 'http://this.is.not.a.valid.handler/'. - The valid format is 'ASSEMBLY::TYPE::METHOD'." -} -``` - -If your constructor throws an exception, the error type is also of type `LambdaException`, but the exception thrown during construction is provided in the `cause` property, which is itself a modeled exception object: - -``` -{ - "errorType": "LambdaException", - "errorMessage": "An exception was thrown when the constructor for type 'LambdaExceptionTestFunction.ThrowExceptionInConstructor' - was invoked. Check inner exception for more details.", - "cause": { - "errorType": "TargetInvocationException", - "errorMessage": "Exception has been thrown by the target of an invocation.", - "stackTrace": [ - "at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean&canBeCached, - RuntimeMethodHandleInternal&ctor, Boolean& bNeedSecurityCheck)", - "at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)", - "at System.Activator.CreateInstance(Type type, Boolean nonPublic)", - "at System.Activator.CreateInstance(Type type)" - ], - "cause": { - "errorType": "ArithmeticException", - "errorMessage": "Sorry, 2 + 2 = 5", - "stackTrace": [ - "at LambdaExceptionTestFunction.ThrowExceptionInConstructor..ctor()" - ] - } - } -} -``` - -As the example shows, the inner exceptions are always preserved \(as the `cause` property\), and can be deeply nested\. - -Exceptions can also occur during invocation\. In this case, the exception type is preserved and the exception is returned directly as the payload and in the CloudWatch logs\. For example: - -``` -{ - "errorType": "AggregateException", - "errorMessage": "One or more errors occurred. (An unknown web exception occurred!)", - "stackTrace": [ - "at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)", - "at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)", - "at lambda_method(Closure , Stream , Stream , ContextInfo )" - ], - "cause": { - "errorType": "UnknownWebException", - "errorMessage": "An unknown web exception occurred!", - "stackTrace": [ - "at LambdaDemo107.LambdaEntryPoint.d__1.MoveNext()", - "--- End of stack trace from previous location where exception was thrown ---", - "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()", - "at LambdaDemo107.LambdaEntryPoint.d__0.MoveNext()" - ], - "cause": { - "errorType": "WebException", - "errorMessage": "An error occurred while sending the request. SSL peer certificate or SSH remote key was not OK", - "stackTrace": [ - "at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)", - "at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)", - "--- End of stack trace from previous location where exception was thrown ---", - "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()", - "at LambdaDemo107.LambdaEntryPoint.d__1.MoveNext()" - ], - "cause": { - "errorType": "HttpRequestException", - "errorMessage": "An error occurred while sending the request.", - "stackTrace": [ - "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)", - "at System.Net.Http.HttpClient.d__58.MoveNext()", - "--- End of stack trace from previous location where exception was thrown ---", - "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)", - "at System.Net.HttpWebRequest.d__63.MoveNext()", - "--- End of stack trace from previous location where exception was thrown ---", - "at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)", - "at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)", - "at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)" - ], - "cause": { - "errorType": "CurlException", - "errorMessage": "SSL peer certificate or SSH remote key was not OK", - "stackTrace": [ - "at System.Net.Http.CurlHandler.ThrowIfCURLEError(CURLcode error)", - "at System.Net.Http.CurlHandler.MultiAgent.FinishRequest(StrongToWeakReference`1 easyWrapper, CURLcode messageResult)" - ] - } - } - } - } -} -``` - -The method in which error information is conveyed depends on the invocation type: -+ `RequestResponse` invocation type \(that is, synchronous execution\): In this case, you get the error message back\. - - For example, if you invoke a Lambda function using the Lambda console, the `RequestResponse` is always the invocation type and the console displays the error information returned by AWS Lambda in the **Execution result** section of the console\. -+ `Event` invocation type \(that is, asynchronous execution\): In this case AWS Lambda does not return anything\. Instead, it logs the error information in CloudWatch Logs and CloudWatch metrics\. - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [Lambda function logging in C\#](csharp-logging.md)\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting C\# code in AWS Lambda](csharp-tracing.md)\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [Lambda function logging in C\#](csharp-logging.md) page\. \ No newline at end of file diff --git a/doc_source/csharp-handler.md b/doc_source/csharp-handler.md deleted file mode 100644 index f2423e9b..00000000 --- a/doc_source/csharp-handler.md +++ /dev/null @@ -1,318 +0,0 @@ -# Lambda function handler in C\# - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -You define a Lambda function handler as an instance or static method in a class\. For access to the Lambda context object, you can define a method parameter of type *ILambdaContext*\. You can use this to access information about the current invocation, such as the name of the function, memory limit, remaining execution time, and logging\. - -``` -returnType handler-name(inputType input, ILambdaContext context) { - ... -} -``` - -In the syntax, note the following: -+ *inputType* – The first handler parameter is the input to the handler\. This can be event data \(that an event source publishes\) or custom input that you provide, such as a string or any custom data object\. -+ *returnType* – If you plan to invoke the Lambda function synchronously \(using the `RequestResponse` invocation type\), you can return the output of your function using any of the supported data types\. For example, if you use a Lambda function as a mobile application backend, you are invoking it synchronously\. Your output data type is serialized into JSON\. - - If you plan to invoke the Lambda function asynchronously \(using the `Event` invocation type\), the `returnType` should be `void`\. For example, if you use Lambda with event sources such as Amazon Simple Storage Service \(Amazon S3\) or Amazon Simple Notification Service \(Amazon SNS\), these event sources invoke the Lambda function using the `Event` invocation type\. -+ `ILambdaContext context` – The second argument in the handler signature is optional\. It provides access to the [context object](csharp-context.md), which has information about the function and request\. - -## Handling streams - -By default, Lambda supports only the `System.IO.Stream` type as an input parameter\. - -For example, consider the following C\# example code\. - -``` -using System.IO; - -namespace Example -{ - public class Hello - { - public Stream MyHandler(Stream stream) - { - //function logic - } - } -} -``` - -In the example C\# code, the first handler parameter is the input to the handler \(MyHandler\)\. This can be event data \(published by an event source such as Amazon S3\) or custom input that you provide, such as a `Stream` \(as in this example\) or any custom data object\. The output is of type `Stream`\. - -## Handling standard data types - -All the following other types require you to specify a serializer: -+ Primitive \.NET types \(such as string or int\) -+ Collections and maps – IList, IEnumerable, IList, Array, IDictionary, IDictionary -+ POCO types \(Plain old CLR objects\) -+ Predefined AWS event types -+ For asynchronous invocations, Lambda ignores the return type\. In such cases, the return type may be set to void\. -+ If you are using \.NET asynchronous programming, the return type can be Task and Task types and use `async` and `await` keywords\. For more information, see [Using async in C\# functions with Lambda](#csharp-handler-async)\. - -Unless your function input and output parameters are of type `System.IO.Stream`, you must serialize them\. Lambda provides default serializers that can be applied at the assembly or method level of your application, or you can define your own by implementing the `ILambdaSerializer` interface provided by the `Amazon.Lambda.Core` library\. For more information, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - - To add the default serializer attribute to a method, first add a dependency on `Amazon.Lambda.Serialization.SystemTextJson` in your `.csproj` file\. - -``` - - - - net6.0 - enable - enable - true - Lambda - - true - - true - - - - - - - - -``` - -The example below illustrates the flexibility you can leverage by specifying the default System\.Text\.Json serializer on one method and another of your choosing on a different method: - -``` -public class ProductService - { - [LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] - public Product DescribeProduct(DescribeProductRequest request) - { - return catalogService.DescribeProduct(request.Id); - } - - [LambdaSerializer(typeof(MyJsonSerializer))] - public Customer DescribeCustomer(DescribeCustomerRequest request) - { - return customerService.DescribeCustomer(request.Id); - } -} -``` - -### Source generation for JSON serialization - -C\# 9 provides source generators that allow code generation during compilation\. Starting with \.NET 6, the native JSON library `System.Text.Json` can use source generators, allowing JSON parsing without the need for reflection APIs\. This can help improve cold start performance\. - -**To use the source generator** - -1. In your project, define an empty, partial class that derives from `System.Text.Json.Serialization.JsonSerializerContext`\. - -1. Add the `JsonSerializable` attribute for each \.NET type that the source generator must generate serialization code for\. - -**Example API Gateway integration leveraging source generation** - -``` -using System.Collections.Generic; -using System.Net; -using System.Text.Json.Serialization; - -using Amazon.Lambda.Core; -using Amazon.Lambda.APIGatewayEvents; -using Amazon.Lambda.Serialization.SystemTextJson; - -[assembly: -LambdaSerializer(typeof(SourceGeneratorLambdaJsonSerializer))] - -namespace SourceGeneratorExample; - -[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyRequest))] -[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyResponse))] -public partial class HttpApiJsonSerializerContext : JsonSerializerContext -{ -} - -public class Functions -{ - public APIGatewayProxyResponse Get(APIGatewayHttpApiV2ProxyRequest -request, ILambdaContext context) - { - context.Logger.LogInformation("Get Request"); - var response = new APIGatewayHttpApiV2ProxyResponse - { - StatusCode = (int)HttpStatusCode.OK, - Body = "Hello AWS Serverless", - Headers = new Dictionary { { "Content-Type", -"text/plain" } } - }; - - return response; - } -} -``` - -When you invoke your function, Lambda uses the source\-generated JSON serialization code to handle the serialization of Lambda events and responses\. - -## Handler signatures - -When creating Lambda functions, you have to provide a handler string that tells Lambda where to look for the code to invoke\. In C\#, the format is: - - *ASSEMBLY::TYPE::METHOD* where: -+ *ASSEMBLY* is the name of the \.NET assembly file for your application\. When using the \.NET Core CLI to build your application, if you haven't set the assembly name using the `AssemblyName` property in the \.csproj file, the *ASSEMBLY* name is the \.csproj file name\. For more information, see [\.NET Core CLI](csharp-package-cli.md)\. In this case, let's assume that the \.csproj file is `HelloWorldApp.csproj`\. -+ *TYPE* is the full name of the handler type, which consists of the *Namespace* and the *ClassName*\. In this case `Example.Hello`\. -+ *METHOD* is name of the function handler, in this case `MyHandler`\. - -Ultimately, the signature is of this format: *Assembly::Namespace\.ClassName::MethodName* - -Consider the following example: - -``` -using System.IO; - -namespace Example -{ - public class Hello - { - public Stream MyHandler(Stream stream) - { - //function logic - } - } -} -``` - -The handler string would be: `HelloWorldApp::Example.Hello::MyHandler` - -**Important** -If the method specified in your handler string is overloaded, you must provide the exact signature of the method that Lambda should invoke\. If the resolution would require selecting among multiple \(overloaded\) signatures, Lambda will reject an otherwise valid signature\. - -## Using top\-level statements - -Starting with \.NET 6, you can write functions using *top\-level statements*\. Top\-level statements remove some of the boilerplate code required for \.NET projects, reducing the number of lines of code that you write\. For example, you can rewrite the previous example using top\-level statements: - -``` -using Amazon.Lambda.RuntimeSupport; - -var handler = (Stream stream) => -{ - //function logic -}; - -await LambdaBootstrapBuilder.Create(handler).Build().RunAsync(); -``` - - When using top\-level statements, you only include the `ASSEMBLY` name when providing the handler signature\. Continuing from the previous example, the handler string would be `HelloWorldApp`\. - - By setting the handler to the assembly name Lambda will treat the assembly as an executable and execute it at startup\. You must add the NuGet package `Amazon.Lambda.RuntimeSupport` to the project so that the executable that runs at startup starts the Lambda runtime client\. - -## Serializing Lambda functions - -For any Lambda functions that use input or output types other than a `Stream` object, you must add a serialization library to your application\. You can do this in the following ways: -+ Use the `Amazon.Lambda.Serialization.SystemTextJson` NuGet package\. This library uses the native \.NET Core JSON serializer to handle serialization\. This package provides a performance improvement over `Amazon.Lambda.Serialization.Json`, but note the limitations described in the [ Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to?pivots=dotnet-core-3-1)\. This library is available for \.NET Core 3\.1 and later runtimes\. -+ Use the `Amazon.Lambda.Serialization.Json` NuGet package\. This library uses JSON\.NET to handle serialization\. -+ Create your own serialization library by implementing the `ILambdaSerializer` interface, which is available as part of the `Amazon.Lambda.Core` library\. The interface defines two methods: - + `T Deserialize(Stream requestStream);` - - You implement this method to deserialize the request payload from the `Invoke` API into the object that is passed to the Lambda function handler\. - + `T Serialize(T response, Stream responseStream);`\. - - You implement this method to serialize the result returned from the Lambda function handler into the response payload that the `Invoke` API operation returns\. - -To use the serializer, you must add a dependency to your `MyProject.csproj` file\. - -``` -... - - - - - -``` - -Next, you must define the serializer\. The following example defines the ` Amazon.Lambda.Serialization.SystemTextJson` serializer in the AssemblyInfo\.cs file\. - -``` -[assembly: LambdaSerializer(typeof(DefaultLambdaJsonSerializer))] -``` - -The following example defines the `Amazon.Lambda.Serialization.Json` serializer in the AssemblyInfo\.cs file\. - -``` -[assembly: LambdaSerializer(typeof(JsonSerializer))] -``` - -You can define a custom serialization attribute at the method level, which overrides the default serializer specified at the assembly level\. - -``` -public class ProductService{ - - [LambdaSerializer(typeof(JsonSerializer))] - public Product DescribeProduct(DescribeProductRequest request) - { - return catalogService.DescribeProduct(request.Id); - } - - [LambdaSerializer(typeof(MyJsonSerializer))] - public Customer DescribeCustomer(DescribeCustomerRequest request) - { - return customerService.DescribeCustomer(request.Id); - } -} -``` - -## Lambda function handler restrictions - -Note that there are some restrictions on the handler signature\. -+ It may not be `unsafe` and use pointer types in the handler signature, though you can use `unsafe` context inside the handler method and its dependencies\. For more information, see [unsafe \(C\# Reference\)](https://msdn.microsoft.com/en-us/library/chfa2zb8.aspx) on the Microsoft Docs website\. -+ It may not pass a variable number of parameters using the `params` keyword, or use `ArgIterator` as an input or a return parameter, which is used to support a variable number of parameters\. -+ The handler may not be a generic method, for example, IList Sort\(IList input\)\. -+ Async handlers with signature `async void` are not supported\. - -## Using async in C\# functions with Lambda - -If you know that your Lambda function will require a long\-running process, such as uploading large files to Amazon S3 or reading a large stream of records from Amazon DynamoDB, you can take advantage of the async/await pattern\. When you use this signature, Lambda invokes the function synchronously and waits for the function to return a response or for execution to time out\. - -``` -public async Task ProcessS3ImageResizeAsync(SimpleS3Event input) -{ - var response = await client.DoAsyncWork(input); - return response; -} -``` - -If you use this pattern, consider the following: -+ Lambda does not support `async void` methods\. -+ If you create an async Lambda function without implementing the `await` operator, \.NET will issue a compiler warning and you will observe unexpected behavior\. For example, some async actions will run while others won't\. Or some async actions won't complete before the function invocation completes\. - - ``` - public async Task ProcessS3ImageResizeAsync(SimpleS3Event event) // Compiler warning - { - client.DoAsyncWork(input); - } - ``` -+ Your Lambda function can include multiple async calls, which can be invoked in parallel\. You can use the `Task.WhenAll` and `Task.WhenAny` methods to work with multiple tasks\. To use the `Task.WhenAll` method, you pass a list of the operations as an array to the method\. Note that in the following example, if you neglect to include any operation to the array, that call may return before its operation completes\. - - ``` - public async Task DoesNotWaitForAllTasks1() - { - // In Lambda, Console.WriteLine goes to CloudWatch Logs. - var task1 = Task.Run(() => Console.WriteLine("Test1")); - var task2 = Task.Run(() => Console.WriteLine("Test2")); - var task3 = Task.Run(() => Console.WriteLine("Test3")); - - // Lambda may return before printing "Test2" since we never wait on task2. - await Task.WhenAll(task1, task3); - } - ``` - - To use the `Task.WhenAny` method, you again pass a list of operations as an array to the method\. The call returns as soon as the first operation completes, even if the others are still running\. - - ``` - public async Task DoesNotWaitForAllTasks2() - { - // In Lambda, Console.WriteLine goes to CloudWatch Logs. - var task1 = Task.Run(() => Console.WriteLine("Test1")); - var task2 = Task.Run(() => Console.WriteLine("Test2")); - var task3 = Task.Run(() => Console.WriteLine("Test3")); - - // Lambda may return before printing all tests since we're waiting for only one to finish. - await Task.WhenAny(task1, task2, task3); - } - ``` \ No newline at end of file diff --git a/doc_source/csharp-image.md b/doc_source/csharp-image.md deleted file mode 100644 index 5fc7d93b..00000000 --- a/doc_source/csharp-image.md +++ /dev/null @@ -1,55 +0,0 @@ -# Deploy \.NET Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. - -AWS provides the following resources to help you build a container image for your \.NET function: - -AWS provides base images for the x86\_64 architecture for all supported \.NET runtimes, and for the arm64 architecture for the \.NET Core 3\.1 and \.NET 6\.0 runtimes\. -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for \.NET](#csharp-image-base) -+ [Using a \.NET base image](#csharp-image-instructions) -+ [\.NET runtime interface clients](#csharp-image-clients) -+ [Deploy the container image](#csharp-image-deploy) - -## AWS base images for \.NET - -AWS provides the following base images for \.NET: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| core3\.1 | \.NET Core 3\.1 | Amazon Linux 2 | [Dockerfile for \.NET Core 3\.1 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnetcore3.1/Dockerfile.dotnetcore3.1) | Mar 31, 2023 | -| 6 | \.NET 6 | Amazon Linux 2 | [Dockerfile for \.NET 6 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet6/Dockerfile.dotnet6) | | -| 5\.0 | \.NET 5 | Amazon Linux 2 | [Dockerfile for \.NET 5 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/dotnet5.0/Dockerfile.dotnet5.0) | | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/dotnet](https://gallery.ecr.aws/lambda/dotnet) - -## Using a \.NET base image - -For instructions on how to use a \.NET base image, choose the **usage** tab on [AWS Lambda base images for \.NET](https://gallery.ecr.aws/lambda/dotnet) in the *Amazon ECR repository*\. - -## \.NET runtime interface clients - -Download the \.NET runtime interface client from the [AWS Lambda for \.NET Core](https://github.com/aws/aws-lambda-dotnet) repository on GitHub\. - -## Deploy the container image - -For a new function, you deploy the container image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/csharp-logging.md b/doc_source/csharp-logging.md deleted file mode 100644 index 99e4ff1a..00000000 --- a/doc_source/csharp-logging.md +++ /dev/null @@ -1,238 +0,0 @@ -# Lambda function logging in C\# - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#csharp-logging-output) -+ [Using log levels](#log-levels) -+ [Using the Lambda console](#csharp-logging-console) -+ [Using the CloudWatch console](#csharp-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#csharp-logging-cli) -+ [Deleting logs](#csharp-logging-delete) - -## Creating a function that returns logs - -To output logs from your function code, you can use methods on the [Console class](https://docs.microsoft.com/en-us/dotnet/api/system.console), or any logging library that writes to `stdout` or `stderr`\. The following example uses the `LambdaLogger` class from the [Amazon\.Lambda\.Core](lambda-csharp.md) library\. - -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Logging** - -``` -public async Task FunctionHandler(SQSEvent invocationEvent, ILambdaContext context) - { - GetAccountSettingsResponse accountSettings; - try - { - accountSettings = await callLambda(); - } - catch (AmazonLambdaException ex) - { - throw ex; - } - AccountUsage accountUsage = accountSettings.AccountUsage; - LambdaLogger.Log("ENVIRONMENT VARIABLES: " + JsonConvert.SerializeObject(System.Environment.GetEnvironmentVariables())); - LambdaLogger.Log("CONTEXT: " + JsonConvert.SerializeObject(context)); - LambdaLogger.Log("EVENT: " + JsonConvert.SerializeObject(invocationEvent)); - return accountUsage; - } -``` - -**Example log format** - -``` -START RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Version: $LATEST -ENVIRONMENT VARIABLES: -{ - "AWS_EXECUTION_ENV": "AWS_Lambda_dotnet6", - "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", - "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/blank-csharp-function-WU56XMPLV2XA", - "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", - "AWS_LAMBDA_LOG_STREAM_NAME": "2020/03/27/[$LATEST]5296xmpl084f411d9fb73b258393f30c", - "AWS_LAMBDA_FUNCTION_NAME": "blank-csharp-function-WU56XMPLV2XA", - ... -EVENT: -{ - "Records": [ - { - "MessageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "ReceiptHandle": "MessageReceiptHandle", - "Body": "Hello from SQS!", - "Md5OfBody": "7b270e59b47ff90a553787216d55d91d", - "Md5OfMessageAttributes": null, - "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:MyQueue", - "EventSource": "aws:sqs", - "AwsRegion": "us-west-2", - "Attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1523232000000", - "SenderId": "123456789012", - "ApproximateFirstReceiveTimestamp": "1523232000001" - }, - ... -END RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d -REPORT RequestId: d1cf0ccb-xmpl-46e6-950d-04c96c9b1c5d Duration: 4157.16 ms Billed Duration: 4200 ms Memory Size: 256 MB Max Memory Used: 99 MB Init Duration: 841.60 ms -XRAY TraceId: 1-5e7e8131-7ff0xmpl32bfb31045d0a3bb SegmentId: 0152xmpl6016310f Sampled: true -``` - -The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using log levels - -Starting with \.NET 6, you can use log levels for additional logging from Lambda functions\. Log levels provide filtering and categorization for the logs that your function writes to Amazon EventBridge \(CloudWatch Events\)\. - -The log levels available are: -+ `LogCritical` -+ `LogError` -+ `LogWarning` -+ `LogInformation` -+ `LogDebug` -+ `LogTrace` - - By default, Lambda writes `LogInformation` level logs and above to CloudWatch\. You can adjust the level of logs that Lambda writes using the `AWS_LAMBDA_HANDLER_LOG_LEVEL` environment variable\. Set the value of the environment variable to the string enum value for the level desired, as outlined in the [LogLevel enum](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.Core/ILambdaLogger.cs#L7)\. For example, if you set `AWS_LAMBDA_HANDLER_LOG_LEVEL` to `Error`, Lambda writes `LogError` and `LogCritical` messages to CloudWatch\. - - Lambda writes `Console.WriteLine` calls as info level messages, and `Console.Error.WriteLine` calls as error level messages\. - - If you prefer the previous style of logging in \.NET, set `AWS_LAMBDA_HANDLER_LOG_FORMAT` to `Unformatted`\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/csharp-package-cli.md b/doc_source/csharp-package-cli.md deleted file mode 100644 index 9f0c3583..00000000 --- a/doc_source/csharp-package-cli.md +++ /dev/null @@ -1,192 +0,0 @@ -# \.NET Core CLI - -The \.NET Core CLI offers a cross\-platform way for you to create \.NET\-based Lambda applications\. This section assumes that you have installed the \.NET Core CLI\. If you haven't, see [Download \.NET](https://dotnet.microsoft.com/download) on the Microsoft website\. - -In the \.NET CLI, you use the `new` command to create \.NET projects from a command line\. This is useful if you want to create a project outside of Visual Studio\. To view a list of the available project types, open a command line, navigate to where you installed the \.NET Core runtime, and then run the following command: - -``` -dotnet new -all -Usage: new [options] -... -Templates Short Name Language Tags ----------------------------------------------------------------------------------------------------------------------------- -Console Application console [C#], F#, VB Common/Console -Class library classlib [C#], F#, VB Common/Library -Unit Test Project mstest [C#], F#, VB Test/MSTest -xUnit Test Project xunit [C#], F#, VB Test/xUnit -... -Examples: - dotnet new mvc --auth Individual - dotnet new viewstart - dotnet new --help -``` - -Lambda offers additional templates via the [Amazon\.Lambda\.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) NuGet package\. To install this package, run the following command: - -``` -dotnet new -i Amazon.Lambda.Templates -``` - -Once the install is complete, the Lambda templates show up as part of `dotnet new`\. To examine details about a template, use the `help` option\. - -``` -dotnet new lambda.EmptyFunction --help -``` - -The `lambda.EmptyFunction` template supports the following options: -+ `--name` – The name of the function -+ `--profile` – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) -+ `--region` – The AWS Region to create the function in - -These options are saved to a file named `aws-lambda-tools-defaults.json`\. - -Create a function project with the `lambda.EmptyFunction` template\. - -``` -dotnet new lambda.EmptyFunction --name MyFunction -``` - -Under the `src/myfunction` directory, examine the following files: -+ **aws\-lambda\-tools\-defaults\.json**: This is where you specify the command line options when deploying your Lambda function\. For example: - - ``` - "profile" : "default", - "region" : "us-east-2", - "configuration" : "Release", - "function-runtime":"dotnet6", - "function-memory-size" : 256, - "function-timeout" : 30, - "function-handler" : "MyFunction::MyFunction.Function::FunctionHandler" - ``` -+ **Function\.cs**: Your Lambda handler function code\. It's a C\# template that includes the default `Amazon.Lambda.Core` library and a default `LambdaSerializer` attribute\. For more information on serialization requirements and options, see [Serializing Lambda functions](csharp-handler.md#csharp-handler-serializer)\. It also includes a sample function that you can edit to apply your Lambda function code\. - - ``` - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - using Amazon.Lambda.Core; - - // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. - [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] - - namespace MyFunction - { - public class Function - { - - public string FunctionHandler(string input, ILambdaContext context) - { - return input.ToUpper(); - } - } - } - ``` -+ **MyFunction\.csproj**: An [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your application\. - - ``` - - - - net6.0 - enable - enable - true - Lambda - - true - - true - - - - - - - - - ``` -+ **Readme**: Use this file to document your Lambda function\. - -Under the `myfunction/test` directory, examine the following files: -+ **myFunction\.Tests\.csproj**: As noted previously, this is an [MSBuild](https://msdn.microsoft.com/en-us/library/dd393574.aspx) file that lists the files and assemblies that comprise your test project\. Note also that it includes the `Amazon.Lambda.Core` library, so you can seamlessly integrate any Lambda templates required to test your function\. - - ``` - - ... - - - ... - ``` -+ **FunctionTest\.cs**: The same C\# code template file that it is included in the `src` directory\. Edit this file to mirror your function's production code and test it before uploading your Lambda function to a production environment\. - - ``` - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - using Xunit; - using Amazon.Lambda.Core; - using Amazon.Lambda.TestUtilities; - - using MyFunction; - - namespace MyFunction.Tests - { - public class FunctionTest - { - [Fact] - public void TestToUpperFunction() - { - - // Invoke the lambda function and confirm the string was upper cased. - var function = new Function(); - var context = new TestLambdaContext(); - var upperCase = function.FunctionHandler("hello world", context); - - Assert.Equal("HELLO WORLD", upperCase); - } - } - } - ``` - -Once your function has passed its tests, you can build and deploy using the Amazon\.Lambda\.Tools [\.NET Core Global Tool](http://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/)\. To install the \.NET Core Global Tool, run the following command: - -``` -dotnet tool install -g Amazon.Lambda.Tools -``` - -If you already have the tool installed, you can make sure that it is the latest version using the following command: - -``` -dotnet tool update -g Amazon.Lambda.Tools -``` - -For more information about the Amazon\.Lambda\.Tools \.NET Core Global Tool, see the [AWS Extensions for \.NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) repository on GitHub\. - -With the Amazon\.Lambda\.Tools installed, you can deploy your function using the following command: - -``` -dotnet lambda deploy-function MyFunction --function-role role -``` - -After deployment, you can re\-test it in a production environment using the following command, and pass in a different value to your Lambda function handler: - -``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" -``` - -If everything is successful, you see the following: - -``` -dotnet lambda invoke-function MyFunction --payload "Just Checking If Everything is OK" -Payload: -"JUST CHECKING IF EVERYTHING IS OK" - -Log Tail: -START RequestId: id Version: $LATEST -END RequestId: id -REPORT RequestId: id Duration: 0.99 ms Billed Duration: 1 ms Memory Size: 256 MB Max Memory Used: 12 MB -``` \ No newline at end of file diff --git a/doc_source/csharp-package-toolkit.md b/doc_source/csharp-package-toolkit.md deleted file mode 100644 index 88473f87..00000000 --- a/doc_source/csharp-package-toolkit.md +++ /dev/null @@ -1,48 +0,0 @@ -# AWS Toolkit for Visual Studio - -You can build \.NET\-based Lambda applications using the Lambda plugin for the [AWS Toolkit for Visual Studio](http://aws.amazon.com/visualstudio/)\. The toolkit is available as a [Visual Studio extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2017)\. - -1. Launch Microsoft Visual Studio and choose **New project**\. - - 1. From the **File** menu, choose **New**, and then choose **Project**\. - - 1. In the **New Project** window, choose **Lambda Project \(\.NET Core\)**, and then choose **OK**\. - - 1. In the **Select Blueprint** window, select from the list of sample applications with sample code to help you get started with creating a \.NET\-based Lambda application\. - - 1. To create a Lambda application from scratch, choose **Empty Function**, and then choose **Finish**\. - -1. Review the `aws-lambda-tools-defaults.json` file, which is created as part of your project\. You can set the options in this file, which the Lambda tooling reads by default\. The project templates created in Visual Studio set many of these fields with default values\. Note the following fields: - + **profile** – The name of a profile in your [AWS SDK for \.NET credentials file](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) - + **function\-handler** – The field where you specify the `function handler`\. \(This is why you don't have to set it in the wizard\.\) However, whenever you rename the *Assembly*, *Namespace*, *Class*, or *Function* in your function code, you must update the corresponding fields in the `aws-lambda-tools-defaults.json` file\. - - ``` - { - "profile":"default", - "region" : "us-east-2", - "configuration" : "Release", - "function-runtime":"dotnet6", - "function-memory-size" : 256, - "function-timeout" : 30, - "function-handler" : "Assembly::Namespace.Class::Function" - } - ``` - -1. Open the **Function\.cs** file\. You are provided with a template to implement your Lambda function handler code\. - -1. After writing the code that represents your Lambda function, upload it by opening the context \(right\-click\) menu for the **Project** node in your application and then choosing **Publish to AWS Lambda**\. - -1. In the **Upload Lambda Function** window, enter a name for the function, or select a previously published function to republish\. Then choose **Next**\. - -1. In the **Advanced Function Details** window, configure the following options: - + **Role Name** \(required\) – The [AWS Identity and Access Management \(IAM\) role](lambda-intro-execution-role.md) that Lambda assumes when it runs your function\. - + **Environment** – Key\-value pairs that Lambda sets in the execution environment\. To extend your function's configuration outside of code, [use environment variables](configuration-envvars.md)\. - + **Memory** – The amount of memory available to the function at runtime\. Choose an amount [between 128 MB and 10,240 MB](gettingstarted-limits.md) in 1\-MB increments\. - + **Timeout** – The amount of time that Lambda allows a function to run before stopping it\. The default is three seconds\. The maximum allowed value is 900 seconds\. - + **VPC** – If your function needs network access to resources that are not available over the internet, [configure it to connect to a virtual private cloud \(VPC\)](configuration-vpc.md)\. - + **DLQ** – If your function is invoked asynchronously, [choose a dead\-letter queue](invocation-async.md#invocation-dlq) to receive failed invocations\. - + **Enable active tracing** – Sample incoming requests and [trace sampled requests with AWS X\-Ray](services-xray.md)\. - -1. Choose **Next**, and then choose **Upload** to deploy your application\. - -For more information, see [Deploying an AWS Lambda Project with the \.NET Core CLI](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-cli-publish.html)\. \ No newline at end of file diff --git a/doc_source/csharp-package.md b/doc_source/csharp-package.md deleted file mode 100644 index cf47126e..00000000 --- a/doc_source/csharp-package.md +++ /dev/null @@ -1,9 +0,0 @@ -# Deploy C\# Lambda functions with \.zip file archives - -A \.NET Core deployment package \(\.zip file archive\) contains your function's compiled assembly along with all of its assembly dependencies\. The package also contains a `proj.deps.json` file\. This signals to the \.NET Core runtime all of your function's dependencies and a `proj.runtimeconfig.json` file, which is used to configure the runtime\. The \.NET command line interface \(CLI\) `publish` command can create a folder with all of these files\. By default, the `proj.runtimeconfig.json` is not included because a Lambda project is typically configured to be a class library\. To force the `proj.runtimeconfig.json` to be written as part of the `publish` process, pass in the command line argument `/p:GenerateRuntimeConfigurationFiles=true` to the `publish` command\. - -Although it is possible to create the deployment package with the `dotnet publish` command, we recommend that you create the deployment package with either the [\.NET Core CLI](csharp-package-cli.md) or the [AWS Toolkit for Visual Studio](csharp-package-toolkit.md)\. These are tools optimized specifically for Lambda to ensure that the `lambda-project.runtimeconfig.json` file exists and optimizes the package bundle, including the removal of any non\-Linux\-based dependencies\. - -**Topics** -+ [\.NET Core CLI](csharp-package-cli.md) -+ [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) \ No newline at end of file diff --git a/doc_source/csharp-tracing.md b/doc_source/csharp-tracing.md deleted file mode 100644 index b1a833ad..00000000 --- a/doc_source/csharp-tracing.md +++ /dev/null @@ -1,146 +0,0 @@ -# Instrumenting C\# code in AWS Lambda - -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can instrument your function code to record metadata and trace downstream calls\. To record detail about calls that your function makes to other resources and services, use the X\-Ray SDK for \.NET\. To get the SDK, add the `AWSXRayRecorder` packages to your project file\. - -**Example [src/blank\-csharp/blank\-csharp\.csproj](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/blank-csharp.csproj)** - -``` - - - netcoreapp3.1 - true - Lambda - - - - - - - - - - - - -``` - -To instrument AWS SDK clients, call the `RegisterXRayForAllServices` method in your initialization code\. - -**Example [src/blank\-csharp/Function\.cs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp/src/blank-csharp/Function.cs) – Initialize X\-Ray** - -``` - static async void initialize() { - AWSSDKHandler.RegisterXRayForAllServices(); - lambdaClient = new AmazonLambdaClient(); - await callLambda(); - } -``` - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for \.NET](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-dotnet.html) in the AWS X\-Ray Developer Guide\. - -**Topics** -+ [Enabling active tracing with the Lambda API](#csharp-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#csharp-tracing-cloudformation) - -## Enabling active tracing with the Lambda API - -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Enabling active tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` \ No newline at end of file diff --git a/doc_source/deploying-lambda-apps.md b/doc_source/deploying-lambda-apps.md deleted file mode 100644 index 632f8355..00000000 --- a/doc_source/deploying-lambda-apps.md +++ /dev/null @@ -1,19 +0,0 @@ -# AWS Lambda applications - -An AWS Lambda application is a combination of Lambda functions, event sources, and other resources that work together to perform tasks\. You can use AWS CloudFormation and other tools to collect your application's components into a single package that can be deployed and managed as one resource\. Applications make your Lambda projects portable and enable you to integrate with additional developer tools, such as AWS CodePipeline, AWS CodeBuild, and the AWS Serverless Application Model command line interface \(SAM CLI\)\. - -The [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/) provides a collection of Lambda applications that you can deploy in your account with a few clicks\. The repository includes both ready\-to\-use applications and samples that you can use as a starting point for your own projects\. You can also submit your own projects for inclusion\. - -[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-concepts.html) enables you to create a template that defines your application's resources and lets you manage the application as a *stack*\. You can more safely add or modify resources in your application stack\. If any part of an update fails, AWS CloudFormation automatically rolls back to the previous configuration\. With AWS CloudFormation parameters, you can create multiple environments for your application from the same template\. [AWS SAM](lambda-settingup.md#lambda-settingup-awssam) extends AWS CloudFormation with a simplified syntax focused on Lambda application development\. - -The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates, testing locally, and integrating with CI/CD systems\. - -When creating an application, you can create its Git repository using either CodeCommit or an AWS CodeStar connection to GitHub\. CodeCommit enables you to use the IAM console to manage SSH keys and HTTP credentials for your users\. AWS CodeStar connections enables you to connect to your GitHub account\. For more information about connections, see [ What are connections?](https://docs.aws.amazon.com/connect/latest/userguide/welcome-connections.html) in the *Developer Tools console User Guide*\. - -For more information about designing Lambda applications, see [Application design](https://docs.aws.amazon.com/lambda/latest/operatorguide/application-design.html) in the *Lambda operator guide*\. - -**Topics** -+ [Managing applications in the AWS Lambda console](applications-console.md) -+ [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) -+ [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) -+ [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) \ No newline at end of file diff --git a/doc_source/dotnet-native-aot.md b/doc_source/dotnet-native-aot.md deleted file mode 100644 index 51af0ee6..00000000 --- a/doc_source/dotnet-native-aot.md +++ /dev/null @@ -1,108 +0,0 @@ -# \.NET functions with native AOT compilation - -\.NET 7 supports native ahead\-of\-time \(AOT\) compilation\. With *native AOT*, you can compile your Lambda function code to a native runtime format, which removes the need to compile \.NET code at runtime\. Native AOT compilation can reduce the cold start time for Lambda functions that you write in \.NET\. - -**Topics** -+ [Limitations](#dotnet-native-aot-limitations) -+ [Prerequisites](#dotnet-native-aot-prerequisites) -+ [Lambda runtime](#dotnet-native-aot-runtime) -+ [Set up your project](#dotnet-native-aot-runtime-setup) -+ [Edit your Lambda function code](#dotnet-native-aot-runtime-edit) -+ [Deploy your Lambda function](#dotnet-native-aot-deploy) -+ [Add support for complex types](#dotnet-native-aot-complex-types) -+ [Troubleshooting](#dotnet-native-aot-troubleshooting) - -## Limitations - -There are limitations to functionality that you can include in native AOT functions\. For more information, see [Limitations of Native AOT deployment](https://learn.microsoft.com/dotnet/core/deploying/native-aot/#limitations-of-native-aot-deployment) on the Microsoft Learn website\. - -## Prerequisites - -**Docker** -You must compile your function with native AOT on the same operating system that your code will run on\. As a result, on any operating system other than Amazon Linux 2, you need Docker to develop Lambda functions that use native AOT\. - -**\.NET 7 SDK** -Native AOT compilation is a feature of \.NET 7\. You must install the [\.NET 7 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) on your system, not only the runtime\. - -**Amazon\.Lambda\.Tools** -To create your Lambda functions, use the [https://www.nuget.org/packages/Amazon.Lambda.Tools](https://www.nuget.org/packages/Amazon.Lambda.Tools) [\.NET Core global tool](https://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/)\. The current version of the \.NET Core global tool for Lambda supports using Docker for native AOT\. To install Amazon\.Lambda\.Tools, run the following command: - -``` -dotnet tool install -g Amazon.Lambda.Tools -``` -For more information about the Amazon\.Lambda\.Tools \.NET Core global tool, see the [AWS Extensions for \.NET CLI](https://github.com/aws/aws-extensions-for-dotnet-cli) repository on GitHub\. - -**Amazon\.Lambda\.Templates** -To generate your Lambda function code, use the [https://www.nuget.org/packages/Amazon.Lambda.Templates](https://www.nuget.org/packages/Amazon.Lambda.Templates) NuGet package\. To install this template package, run the following command: - -``` -dotnet new install Amazon.Lambda.Templates -``` - -## Lambda runtime - -Use the `provided.al2` custom runtime with the `x86_64` architecture to deploy a Lambda function that you build with native AOT compilation\. When you use a \.NET Lambda runtime, your application is compiled into Intermediate Language \(IL\) code\. At runtime, the just\-in\-time \(JIT\) compiler takes the IL code and compiles it into machine code as needed\. With a Lambda function that is compiled ahead of time with native AOT, the runtime environment doesn't include the \.NET SDK or \.NET runtime\. You compile your code into machine code before it runs\. - -## Set up your project - -Use the \.NET Core global tool for Lambda to create your new environment\. To initialize your project, run the following command: - -``` -dotnet new lambda.NativeAOT -``` - -## Edit your Lambda function code - -The \.NET Core global tool for Lambda generates a basic Lambda function that accepts a `String` and returns a `String`\. Edit the function code as required for your use case\. For how to change the parameters and return types of your function, see [Add support for complex types](#dotnet-native-aot-complex-types)\. - -## Deploy your Lambda function - -If you're using Windows or macOS, make sure that Docker is running\. - -Then, to compile and deploy your Lambda function, run the following command: - -``` -dotnet lambda deploy-function -``` - -The `deploy-function` process automatically downloads a Docker image of Amazon Linux 2 to perform the native AOT compilation for your function\. After this container image has downloaded, the deploy process builds your function and then creates a `.zip` file that gets deployed into your AWS account\. - -## Add support for complex types - -The default Lambda function provides a basic starting point of a `String` parameter and a `String` return type\. To accept or return complex types, update your code to include functionality that generates serialization code at compile time, rather than at runtime\. - -Add more JsonSerializable attributes to your custom serializer object definition as needed\. - -### API Gateway example - -For example, to use Amazon API Gateway events, add a reference to the NuGet package `Amazon.Lambda.ApiGatewayEvents`\. Then, add the following `using` statement to your Lambda function source code: - -``` -using Amazon.Lambda.APIGatewayEvents; -``` - -Add the following attributes to your class definition of your custom serializer: - -``` -[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyRequest))] -[JsonSerializable(typeof(APIGatewayHttpApiV2ProxyResponse))] -``` - -Update your function signature to the following: - -``` -public static async Task FunctionHandler(APIGatewayHttpApiV2ProxyRequest input, ILambdaContext context) -``` - -## Troubleshooting - -**Error: Cross\-OS native compilation is not supported\.** -Your version of the Amazon\.Lambda\.Tools \.NET Core global tool is out of date\. Update to the latest version and try again\. - -**Docker: image operating system "linux" cannot be used on this platform\.** -Docker on your system is configured to use Windows containers\. Swap to Linux containers to run the native AOT build environment\. - -**Unhandled Exception: System\.ApplicationException: The serializer NativeAoT\.MyCustomJsonSerializerContext is missing a constructor that takes in JsonSerializerOptions object** -If you encounter this error when you invoke your Lambda function, add an `rd.xml` file to your project, and then redeploy\. - -For more information about common errors, see the [AWS NativeAOT for \.NET](https://github.com/awslabs/dotnet-nativeaot-labs#common-errors) repository on GitHub\. \ No newline at end of file diff --git a/doc_source/example_cross_ApiGatewayDataTracker_section.md b/doc_source/example_cross_ApiGatewayDataTracker_section.md deleted file mode 100644 index eb7d2363..00000000 --- a/doc_source/example_cross_ApiGatewayDataTracker_section.md +++ /dev/null @@ -1,28 +0,0 @@ -# Create an API Gateway REST API to track COVID\-19 data - -The following code example shows how to create a REST API that simulates a system to track daily cases of COVID\-19 in the United States, using fictional data\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - Shows how to use AWS Chalice with the AWS SDK for Python \(Boto3\) to create a serverless REST API that uses Amazon API Gateway, AWS Lambda, and Amazon DynamoDB\. The REST API simulates a system that tracks daily cases of COVID\-19 in the United States, using fictional data\. Learn how to: -+ Use AWS Chalice to define routes in Lambda functions that are called to handle REST requests that come through API Gateway\. -+ Use Lambda functions to retrieve and store data in a DynamoDB table to serve REST requests\. -+ Define table structure and security role resources in an AWS CloudFormation template\. -+ Use AWS Chalice and CloudFormation to package and deploy all necessary resources\. -+ Use CloudFormation to clean up all created resources\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/apigateway_covid-19_tracker)\. - -**Services used in this example** -+ API Gateway -+ AWS CloudFormation -+ DynamoDB -+ Lambda - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_ApiGatewayWebsocketChat_section.md b/doc_source/example_cross_ApiGatewayWebsocketChat_section.md deleted file mode 100644 index 5c295d93..00000000 --- a/doc_source/example_cross_ApiGatewayWebsocketChat_section.md +++ /dev/null @@ -1,25 +0,0 @@ -# Create a websocket chat application with API Gateway - -The following code example shows how to create a chat application that is served by a websocket API built on Amazon API Gateway\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - Shows how to use the AWS SDK for Python \(Boto3\) with Amazon API Gateway V2 to create a websocket API that integrates with AWS Lambda and Amazon DynamoDB\. -+ Create a websocket API served by API Gateway\. -+ Define a Lambda handler that stores connections in DynamoDB and posts messages to other chat participants\. -+ Connect to the websocket chat application and send messages with the Websockets package\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/apigateway_websocket_chat)\. - -**Services used in this example** -+ API Gateway -+ DynamoDB -+ Lambda - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_AuroraRestLendingLibrary_section.md b/doc_source/example_cross_AuroraRestLendingLibrary_section.md deleted file mode 100644 index 7af05bbd..00000000 --- a/doc_source/example_cross_AuroraRestLendingLibrary_section.md +++ /dev/null @@ -1,28 +0,0 @@ -# Create a lending library REST API - -The following code example shows how to create a lending library where patrons can borrow and return books by using a REST API backed by an Amazon Aurora database\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - Shows how to use the AWS SDK for Python \(Boto3\) with the Amazon Relational Database Service \(Amazon RDS\) API and AWS Chalice to create a REST API backed by an Amazon Aurora database\. The web service is fully serverless and represents a simple lending library where patrons can borrow and return books\. Learn how to: -+ Create and manage a serverless Aurora database cluster\. -+ Use AWS Secrets Manager to manage database credentials\. -+ Implement a data storage layer that uses Amazon RDS to move data into and out of the database\. -+ Use AWS Chalice to deploy a serverless REST API to Amazon API Gateway and AWS Lambda\. -+ Use the Requests package to send requests to the web service\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/aurora_rest_lending_library)\. - -**Services used in this example** -+ API Gateway -+ Lambda -+ Amazon RDS -+ Secrets Manager - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaAPIGateway_section.md b/doc_source/example_cross_LambdaAPIGateway_section.md deleted file mode 100644 index 0b7d1574..00000000 --- a/doc_source/example_cross_LambdaAPIGateway_section.md +++ /dev/null @@ -1,54 +0,0 @@ -# Use API Gateway to invoke a Lambda function - -The following code examples show how to create an AWS Lambda function invoked by Amazon API Gateway\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - Shows how to create an AWS Lambda function by using the Lambda Java runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create a Lambda function invoked by Amazon API Gateway that scans an Amazon DynamoDB table for work anniversaries and uses Amazon Simple Notification Service \(Amazon SNS\) to send a text message to your employees that congratulates them at their one year anniversary date\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_lambda_apigateway)\. - -**Services used in this example** -+ API Gateway -+ DynamoDB -+ Lambda -+ Amazon SNS - ------- -#### [ JavaScript ] - -**SDK for JavaScript V3** - Shows how to create an AWS Lambda function by using the Lambda JavaScript runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create a Lambda function invoked by Amazon API Gateway that scans an Amazon DynamoDB table for work anniversaries and uses Amazon Simple Notification Service \(Amazon SNS\) to send a text message to your employees that congratulates them at their one year anniversary date\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-api-gateway)\. -This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/api-gateway-invoking-lambda-example.html)\. - -**Services used in this example** -+ API Gateway -+ DynamoDB -+ Lambda -+ Amazon SNS - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - This example shows how to create and use an Amazon API Gateway REST API that targets an AWS Lambda function\. The Lambda handler demonstrates how to route based on HTTP methods; how to get data from the query string, header, and body; and how to return a JSON response\. -+ Deploy a Lambda function\. -+ Create an API Gateway REST API\. -+ Create a REST resource that targets the Lambda function\. -+ Grant permission to let API Gateway invoke the Lambda function\. -+ Use the Requests package to send requests to the REST API\. -+ Clean up all resources created during the demo\. - This example is best viewed on GitHub\. For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#readme)\. - -**Services used in this example** -+ API Gateway -+ Lambda - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaForBrowser_section.md b/doc_source/example_cross_LambdaForBrowser_section.md deleted file mode 100644 index e7d76b0b..00000000 --- a/doc_source/example_cross_LambdaForBrowser_section.md +++ /dev/null @@ -1,29 +0,0 @@ -# Invoke a Lambda function from a browser - -The following code example shows how to invoke an AWS Lambda function from a browser\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ JavaScript ] - -**SDK for JavaScript V2** - You can create a browser\-based application that uses an AWS Lambda function to update an Amazon DynamoDB table with user selections\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascript/example_code/lambda/lambda-for-browser)\. - -**Services used in this example** -+ DynamoDB -+ Lambda - -**SDK for JavaScript V3** - You can create a browser\-based application that uses an AWS Lambda function to update an Amazon DynamoDB table with user selections\. This app uses AWS SDK for JavaScript v3\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-for-browser)\. - -**Services used in this example** -+ DynamoDB -+ Lambda - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_LambdaScheduledEvents_section.md b/doc_source/example_cross_LambdaScheduledEvents_section.md deleted file mode 100644 index 6f3a62f6..00000000 --- a/doc_source/example_cross_LambdaScheduledEvents_section.md +++ /dev/null @@ -1,54 +0,0 @@ -# Use scheduled events to invoke a Lambda function - -The following code examples show how to create an AWS Lambda function invoked by an Amazon EventBridge scheduled event\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - Shows how to create an Amazon EventBridge scheduled event that invokes an AWS Lambda function\. Configure EventBridge to use a cron expression to schedule when the Lambda function is invoked\. In this example, you create a Lambda function by using the Lambda Java runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create an app that sends a mobile text message to your employees that congratulates them at the one year anniversary date\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_scheduled_events)\. - -**Services used in this example** -+ DynamoDB -+ EventBridge -+ Lambda -+ Amazon SNS - ------- -#### [ JavaScript ] - -**SDK for JavaScript V3** - Shows how to create an Amazon EventBridge scheduled event that invokes an AWS Lambda function\. Configure EventBridge to use a cron expression to schedule when the Lambda function is invoked\. In this example, you create a Lambda function by using the Lambda JavaScript runtime API\. This example invokes different AWS services to perform a specific use case\. This example demonstrates how to create an app that sends a mobile text message to your employees that congratulates them at the one year anniversary date\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-scheduled-events)\. -This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/scheduled-events-invoking-lambda-example.html)\. - -**Services used in this example** -+ DynamoDB -+ EventBridge -+ Lambda -+ Amazon SNS - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - This example shows how to register an AWS Lambda function as the target of a scheduled Amazon EventBridge event\. The Lambda handler writes a friendly message and the full event data to Amazon CloudWatch Logs for later retrieval\. -+ Deploys a Lambda function\. -+ Creates an EventBridge scheduled event and makes the Lambda function the target\. -+ Grants permission to let EventBridge invoke the Lambda function\. -+ Prints the latest data from CloudWatch Logs to show the result of the scheduled invocations\. -+ Cleans up all resources created during the demo\. - This example is best viewed on GitHub\. For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#readme)\. - -**Services used in this example** -+ CloudWatch Logs -+ EventBridge -+ Lambda - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_ServerlessWorkflows_section.md b/doc_source/example_cross_ServerlessWorkflows_section.md deleted file mode 100644 index 12100c9e..00000000 --- a/doc_source/example_cross_ServerlessWorkflows_section.md +++ /dev/null @@ -1,38 +0,0 @@ -# Use Step Functions to invoke Lambda functions - -The following code examples show how to create an AWS Step Functions state machine that invokes AWS Lambda functions in sequence\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - Shows how to create an AWS serverless workflow by using AWS Step Functions and the AWS SDK for Java 2\.x\. Each workflow step is implemented using an AWS Lambda function\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/usecases/creating_workflows_stepfunctions)\. - -**Services used in this example** -+ DynamoDB -+ Lambda -+ Amazon SES -+ Step Functions - ------- -#### [ JavaScript ] - -**SDK for JavaScript V3** - Shows how to create an AWS serverless workflow by using AWS Step Functions and the AWS SDK for JavaScript\. Each workflow step is implemented using an AWS Lambda function\. -Lambda is a compute service that enables you to run code without provisioning or managing servers\. Step Functions is a serverless orchestration service that lets you combine Lambda functions and other AWS services to build business\-critical applications\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3/example_code/cross-services/lambda-step-functions)\. -This example is also available in the [AWS SDK for JavaScript v3 developer guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/serverless-step-functions-example.html)\. - -**Services used in this example** -+ DynamoDB -+ Lambda -+ Amazon SES -+ Step Functions - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_cross_StepFunctionsMessenger_section.md b/doc_source/example_cross_StepFunctionsMessenger_section.md deleted file mode 100644 index c70018cd..00000000 --- a/doc_source/example_cross_StepFunctionsMessenger_section.md +++ /dev/null @@ -1,27 +0,0 @@ -# Create a messenger application with Step Functions - -The following code example shows how to create an AWS Step Functions messenger application that retrieves message records from a database table\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - Shows how to use the AWS SDK for Python \(Boto3\) with AWS Step Functions to create a messenger application that retrieves message records from an Amazon DynamoDB table and sends them with Amazon Simple Queue Service \(Amazon SQS\)\. The state machine integrates with an AWS Lambda function to scan the database for unsent messages\. -+ Create a state machine that retrieves and updates message records from an Amazon DynamoDB table\. -+ Update the state machine definition to also send messages to Amazon Simple Queue Service \(Amazon SQS\)\. -+ Start and stop state machine runs\. -+ Connect to Lambda, DynamoDB, and Amazon SQS from a state machine by using service integrations\. - For complete source code and instructions on how to set up and run, see the full example on [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/cross_service/stepfunctions_messenger)\. - -**Services used in this example** -+ DynamoDB -+ Lambda -+ Amazon SQS -+ Step Functions - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_CreateFunction_section.md b/doc_source/example_lambda_CreateFunction_section.md deleted file mode 100644 index da336143..00000000 --- a/doc_source/example_lambda_CreateFunction_section.md +++ /dev/null @@ -1,148 +0,0 @@ -# Create a Lambda function using an AWS SDK - -The following code examples show how to create a Lambda function\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. - - -``` - public static void createLambdaFunction(LambdaClient awsLambda, - String functionName, - String filePath, - String role, - String handler) { - - try { - LambdaWaiter waiter = awsLambda.waiter(); - InputStream is = new FileInputStream(filePath); - SdkBytes fileToUpload = SdkBytes.fromInputStream(is); - - FunctionCode code = FunctionCode.builder() - .zipFile(fileToUpload) - .build(); - - CreateFunctionRequest functionRequest = CreateFunctionRequest.builder() - .functionName(functionName) - .description("Created by the Lambda Java API") - .code(code) - .handler(handler) - .runtime(Runtime.JAVA8) - .role(role) - .build(); - - // Create a Lambda function using a waiter. - CreateFunctionResponse functionResponse = awsLambda.createFunction(functionRequest); - GetFunctionRequest getFunctionRequest = GetFunctionRequest.builder() - .functionName(functionName) - .build(); - WaiterResponse waiterResponse = waiter.waitUntilFunctionExists(getFunctionRequest); - waiterResponse.matched().response().ifPresent(System.out::println); - System.out.println("The function ARN is " + functionResponse.functionArn()); - - } catch(LambdaException | FileNotFoundException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } -``` -+ For API details, see [CreateFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) in *AWS SDK for Java 2\.x API Reference*\. - ------- -#### [ Kotlin ] - -**SDK for Kotlin** -This is prerelease documentation for a feature in preview release\. It is subject to change\. - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. - - -``` -suspend fun createNewFunction( - myFunctionName: String, - s3BucketName: String, - myS3Key: String, - myHandler: String, - myRole: String -): String? { - - val functionCode = FunctionCode { - s3Bucket = s3BucketName - s3Key = myS3Key - } - - val request = CreateFunctionRequest { - functionName = myFunctionName - code = functionCode - description = "Created by the Lambda Kotlin API" - handler = myHandler - role = myRole - runtime = Runtime.Java8 - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val functionResponse = awsLambda.createFunction(request) - awsLambda.waitUntilFunctionActive { - functionName = myFunctionName - } - return functionResponse.functionArn - } -} -``` -+ For API details, see [CreateFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def create_function(self, function_name, handler_name, iam_role, deployment_package): - """ - Deploys a Lambda function. - - :param function_name: The name of the Lambda function. - :param handler_name: The fully qualified name of the handler function. This - must include the file name and the function name. - :param iam_role: The IAM role to use for the function. - :param deployment_package: The deployment package that contains the function - code in .zip format. - :return: The Amazon Resource Name (ARN) of the newly created function. - """ - try: - response = self.lambda_client.create_function( - FunctionName=function_name, - Description="AWS Lambda doc example", - Runtime='python3.8', - Role=iam_role.arn, - Handler=handler_name, - Code={'ZipFile': deployment_package}, - Publish=True) - function_arn = response['FunctionArn'] - waiter = self.lambda_client.get_waiter('function_active_v2') - waiter.wait(FunctionName=function_name) - logger.info("Created function '%s' with ARN: '%s'.", - function_name, response['FunctionArn']) - except ClientError: - logger.error("Couldn't create function %s.", function_name) - raise - else: - return function_arn -``` -+ For API details, see [CreateFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_DeleteFunction_section.md b/doc_source/example_lambda_DeleteFunction_section.md deleted file mode 100644 index ef7d69c9..00000000 --- a/doc_source/example_lambda_DeleteFunction_section.md +++ /dev/null @@ -1,85 +0,0 @@ -# Delete a Lambda function using an AWS SDK - -The following code examples show how to delete a Lambda function\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. - - -``` - public static void deleteLambdaFunction(LambdaClient awsLambda, String functionName) { - try { - DeleteFunctionRequest request = DeleteFunctionRequest.builder() - .functionName(functionName) - .build(); - - awsLambda.deleteFunction(request); - System.out.println("The "+functionName +" function was deleted"); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } -``` -+ For API details, see [DeleteFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) in *AWS SDK for Java 2\.x API Reference*\. - ------- -#### [ Kotlin ] - -**SDK for Kotlin** -This is prerelease documentation for a feature in preview release\. It is subject to change\. - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. - - -``` -suspend fun delLambdaFunction(myFunctionName: String) { - - val request = DeleteFunctionRequest { - functionName = myFunctionName - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - awsLambda.deleteFunction(request) - println("$myFunctionName was deleted") - } -} -``` -+ For API details, see [DeleteFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def delete_function(self, function_name): - """ - Deletes a Lambda function. - - :param function_name: The name of the function to delete. - """ - try: - self.lambda_client.delete_function(FunctionName=function_name) - except ClientError: - logger.exception("Couldn't delete function %s.", function_name) - raise -``` -+ For API details, see [DeleteFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_GetFunction_section.md b/doc_source/example_lambda_GetFunction_section.md deleted file mode 100644 index e2b119bc..00000000 --- a/doc_source/example_lambda_GetFunction_section.md +++ /dev/null @@ -1,45 +0,0 @@ -# Get a Lambda function using an AWS SDK - -The following code example shows how to get a Lambda function\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def get_function(self, function_name): - """ - Gets data about a Lambda function. - - :param function_name: The name of the function. - :return: The function data. - """ - response = None - try: - response = self.lambda_client.get_function(FunctionName=function_name) - except ClientError as err: - if err.response['Error']['Code'] == 'ResourceNotFoundException': - logger.info("Function %s does not exist.", function_name) - else: - logger.error( - "Couldn't get function %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - return response -``` -+ For API details, see [GetFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_Invoke_section.md b/doc_source/example_lambda_Invoke_section.md deleted file mode 100644 index 065668c2..00000000 --- a/doc_source/example_lambda_Invoke_section.md +++ /dev/null @@ -1,111 +0,0 @@ -# Invoke a Lambda function using an AWS SDK - -The following code examples show how to invoke a Lambda function\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. - - -``` - public static void invokeFunction(LambdaClient awsLambda, String functionName) { - - InvokeResponse res = null ; - try { - // Need a SdkBytes instance for the payload. - JSONObject jsonObj = new JSONObject(); - jsonObj.put("inputValue", "2000"); - String json = jsonObj.toString(); - SdkBytes payload = SdkBytes.fromUtf8String(json) ; - - // Setup an InvokeRequest. - InvokeRequest request = InvokeRequest.builder() - .functionName(functionName) - .payload(payload) - .build(); - - res = awsLambda.invoke(request); - String value = res.payload().asUtf8String() ; - System.out.println(value); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } -``` -+ For API details, see [Invoke](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) in *AWS SDK for Java 2\.x API Reference*\. - ------- -#### [ Kotlin ] - -**SDK for Kotlin** -This is prerelease documentation for a feature in preview release\. It is subject to change\. - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. - - -``` -suspend fun invokeFunction(functionNameVal: String) { - - val json = """{"inputValue":"1000"}""" - val byteArray = json.trimIndent().encodeToByteArray() - val request = InvokeRequest { - functionName = functionNameVal - logType = LogType.Tail - payload = byteArray - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val res = awsLambda.invoke(request) - println("${res.payload?.toString(Charsets.UTF_8)}") - println("The log result is ${res.logResult}") - } -} -``` -+ For API details, see [Invoke](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) in *AWS SDK for Kotlin API reference*\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def invoke_function(self, function_name, function_params, get_log=False): - """ - Invokes a Lambda function. - - :param function_name: The name of the function to invoke. - :param function_params: The parameters of the function as a dict. This dict - is serialized to JSON before it is sent to Lambda. - :param get_log: When true, the last 4 KB of the execution log are included in - the response. - :return: The response from the function invocation. - """ - try: - response = self.lambda_client.invoke( - FunctionName=function_name, - Payload=json.dumps(function_params), - LogType='Tail' if get_log else 'None') - logger.info("Invoked function %s.", function_name) - except ClientError: - logger.exception("Couldn't invoke function %s.", function_name) - raise - return response -``` -+ For API details, see [Invoke](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_ListFunctions_section.md b/doc_source/example_lambda_ListFunctions_section.md deleted file mode 100644 index 45636763..00000000 --- a/doc_source/example_lambda_ListFunctions_section.md +++ /dev/null @@ -1,44 +0,0 @@ -# List Lambda functions using an AWS SDK - -The following code example shows how to list Lambda functions\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def list_functions(self): - """ - Lists the Lambda functions for the current account. - """ - try: - func_paginator = self.lambda_client.get_paginator('list_functions') - for func_page in func_paginator.paginate(): - for func in func_page['Functions']: - print(func['FunctionName']) - desc = func.get('Description') - if desc: - print(f"\t{desc}") - print(f"\t{func['Runtime']}: {func['Handler']}") - except ClientError as err: - logger.error( - "Couldn't list functions. Here's why: %s: %s", - err.response['Error']['Code'], err.response['Error']['Message']) - raise -``` -+ For API details, see [ListFunctions](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md b/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md deleted file mode 100644 index 1d38bbf4..00000000 --- a/doc_source/example_lambda_Scenario_GettingStartedFunctions_section.md +++ /dev/null @@ -1,899 +0,0 @@ -# Get started creating and invoking Lambda functions using an AWS SDK - -The following code examples show how to: -+ Create an AWS Identity and Access Management \(IAM\) role that grants Lambda permission to write to logs\. -+ Create a Lambda function and upload handler code\. -+ Invoke the function with a single parameter and get results\. -+ Update the function code and configure its Lambda environment with an environment variable\. -+ Invoke the function with new parameters and get results\. Display the execution log that's returned from the invocation\. -+ List the functions for your account\. -+ Delete the IAM role and the Lambda function\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - -For more information, see [Create a Lambda function with the console](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html)\. - ------- -#### [ Java ] - -**SDK for Java 2\.x** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2/example_code/lambda#readme)\. - - -``` -public class LambdaScenario { - - public static void main(String[] args) throws InterruptedException { - - final String usage = "\n" + - "Usage:\n" + - " \n\n" + - "Where:\n" + - " functionName - The name of the Lambda function. \n"+ - " filePath - The path to the .zip or .jar where the code is located. \n"+ - " role - The AWS Identity and Access Management (IAM) service role that has Lambda permissions. \n"+ - " handler - The fully qualified method name (for example, example.Handler::handleRequest). \n"+ - " bucketName - The Amazon Simple Storage Service (Amazon S3) bucket name that contains the .zip or .jar used to update the Lambda function's code. \n"+ - " key - The Amazon S3 key name that represents the .zip or .jar (for example, LambdaHello-1.0-SNAPSHOT.jar)." ; - - if (args.length != 6) { - System.out.println(usage); - System.exit(1); - } - - String functionName = args[0]; - String filePath = args[1]; - String role = args[2]; - String handler = args[3]; - String bucketName = args[4]; - String key = args[5]; - Region region = Region.US_WEST_2; - LambdaClient awsLambda = LambdaClient.builder() - .region(region) - .credentialsProvider(ProfileCredentialsProvider.create()) - .build(); - - String funArn = createLambdaFunction(awsLambda, functionName, filePath, role, handler); - System.out.println("The AWS Lambda ARN is "+funArn); - - // Get the Lambda function. - System.out.println("Getting the " +functionName +" AWS Lambda function."); - getFunction(awsLambda, functionName); - - // List the Lambda functions. - System.out.println("Listing all functions."); - LambdaScenario.listFunctions(awsLambda); - - System.out.println("*** Sleep for 1 min to get Lambda function ready."); - Thread.sleep(60000); - - System.out.println("*** Invoke the Lambda function."); - invokeFunction(awsLambda, functionName); - - System.out.println("*** Update the Lambda function code."); - LambdaScenario.updateFunctionCode(awsLambda, functionName, bucketName, key); - - System.out.println("*** Sleep for 1 min to get Lambda function ready."); - Thread.sleep(60000); - System.out.println("*** Invoke the Lambda function again with the updated code."); - invokeFunction(awsLambda, functionName); - - System.out.println("Update a Lambda function's configuration value."); - updateFunctionConfiguration(awsLambda, functionName, handler); - - System.out.println("Delete the AWS Lambda function."); - LambdaScenario.deleteLambdaFunction(awsLambda, functionName); - awsLambda.close(); - } - - public static String createLambdaFunction(LambdaClient awsLambda, - String functionName, - String filePath, - String role, - String handler) { - - try { - LambdaWaiter waiter = awsLambda.waiter(); - InputStream is = new FileInputStream(filePath); - SdkBytes fileToUpload = SdkBytes.fromInputStream(is); - - FunctionCode code = FunctionCode.builder() - .zipFile(fileToUpload) - .build(); - - CreateFunctionRequest functionRequest = CreateFunctionRequest.builder() - .functionName(functionName) - .description("Created by the Lambda Java API") - .code(code) - .handler(handler) - .runtime(Runtime.JAVA8) - .role(role) - .build(); - - // Create a Lambda function using a waiter - CreateFunctionResponse functionResponse = awsLambda.createFunction(functionRequest); - GetFunctionRequest getFunctionRequest = GetFunctionRequest.builder() - .functionName(functionName) - .build(); - WaiterResponse waiterResponse = waiter.waitUntilFunctionExists(getFunctionRequest); - waiterResponse.matched().response().ifPresent(System.out::println); - return functionResponse.functionArn(); - - } catch(LambdaException | FileNotFoundException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - return ""; - } - - public static void getFunction(LambdaClient awsLambda, String functionName) { - try { - GetFunctionRequest functionRequest = GetFunctionRequest.builder() - .functionName(functionName) - .build(); - - GetFunctionResponse response = awsLambda.getFunction(functionRequest); - System.out.println("The runtime of this Lambda function is " +response.configuration().runtime()); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } - - public static void listFunctions(LambdaClient awsLambda) { - try { - ListFunctionsResponse functionResult = awsLambda.listFunctions(); - List list = functionResult.functions(); - for (FunctionConfiguration config: list) { - System.out.println("The function name is "+config.functionName()); - } - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } - - public static void invokeFunction(LambdaClient awsLambda, String functionName) { - - InvokeResponse res; - try { - // Need a SdkBytes instance for the payload. - JSONObject jsonObj = new JSONObject(); - jsonObj.put("inputValue", "2000"); - String json = jsonObj.toString(); - SdkBytes payload = SdkBytes.fromUtf8String(json) ; - - InvokeRequest request = InvokeRequest.builder() - .functionName(functionName) - .payload(payload) - .build(); - - res = awsLambda.invoke(request); - String value = res.payload().asUtf8String() ; - System.out.println(value); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } - - public static void updateFunctionCode(LambdaClient awsLambda, String functionName, String bucketName, String key) { - try { - LambdaWaiter waiter = awsLambda.waiter(); - UpdateFunctionCodeRequest functionCodeRequest = UpdateFunctionCodeRequest.builder() - .functionName(functionName) - .publish(true) - .s3Bucket(bucketName) - .s3Key(key) - .build(); - - UpdateFunctionCodeResponse response = awsLambda.updateFunctionCode(functionCodeRequest) ; - GetFunctionConfigurationRequest getFunctionConfigRequest = GetFunctionConfigurationRequest.builder() - .functionName(functionName) - .build(); - - WaiterResponse waiterResponse = waiter.waitUntilFunctionUpdated(getFunctionConfigRequest); - waiterResponse.matched().response().ifPresent(System.out::println); - System.out.println("The last modified value is " +response.lastModified()); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } - - public static void updateFunctionConfiguration(LambdaClient awsLambda, String functionName, String handler ){ - try { - UpdateFunctionConfigurationRequest configurationRequest = UpdateFunctionConfigurationRequest.builder() - .functionName(functionName) - .handler(handler) - .runtime(Runtime.JAVA11 ) - .build(); - - awsLambda.updateFunctionConfiguration(configurationRequest); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } - - public static void deleteLambdaFunction(LambdaClient awsLambda, String functionName ) { - try { - DeleteFunctionRequest request = DeleteFunctionRequest.builder() - .functionName(functionName) - .build(); - - awsLambda.deleteFunction(request); - System.out.println("The "+functionName +" function was deleted"); - - } catch(LambdaException e) { - System.err.println(e.getMessage()); - System.exit(1); - } - } -} -``` -+ For API details, see the following topics in *AWS SDK for Java 2\.x API Reference*\. - + [CreateFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/CreateFunction) - + [DeleteFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/DeleteFunction) - + [GetFunction](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/GetFunction) - + [Invoke](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/Invoke) - + [ListFunctions](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/ListFunctions) - + [UpdateFunctionCode](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionCode) - + [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/SdkForJavaV2/lambda-2015-03-31/UpdateFunctionConfiguration) - ------- -#### [ Kotlin ] - -**SDK for Kotlin** -This is prerelease documentation for a feature in preview release\. It is subject to change\. - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin/services/lambda#code-examples)\. - - -``` -suspend fun main(args: Array) { - - val usage = """ - Usage: - - - Where: - functionName - The name of the AWS Lambda function. - role - The AWS Identity and Access Management (IAM) service role that has AWS Lambda permissions. - handler - The fully qualified method name (for example, example.Handler::handleRequest). - bucketName - The Amazon Simple Storage Service (Amazon S3) bucket name that contains the ZIP or JAR used for the Lambda function's code. - updatedBucketName - The Amazon S3 bucket name that contains the .zip or .jar used to update the Lambda function's code. - key - The Amazon S3 key name that represents the .zip or .jar file (for example, LambdaHello-1.0-SNAPSHOT.jar). - """ - - if (args.size != 6) { - println(usage) - exitProcess(1) - } - - val functionName = args[0] - val role = args[1] - val handler = args[2] - val bucketName = args[3] - val updatedBucketName = args[4] - val key = args[5] - - println("Creating a Lambda function named $functionName.") - val funArn = createScFunction(functionName, bucketName, key, handler, role) - println("The AWS Lambda ARN is $funArn") - - // Get a specific Lambda function. - println("Getting the $functionName AWS Lambda function.") - getFunction(functionName) - - // List the Lambda functions. - println("Listing all AWS Lambda functions.") - listFunctionsSc() - - // Invoke the Lambda function. - println("*** Invoke the Lambda function.") - invokeFunctionSc(functionName) - - // Update the AWS Lambda function code. - println("*** Update the Lambda function code.") - updateFunctionCode(functionName, updatedBucketName, key) - - // println("*** Invoke the function again after updating the code.") - invokeFunctionSc(functionName) - - // Update the AWS Lambda function configuration. - println("Update the run time of the function.") - UpdateFunctionConfiguration(functionName, handler) - - // Delete the AWS Lambda function. - println("Delete the AWS Lambda function.") - delFunction(functionName) -} - -suspend fun createScFunction( - myFunctionName: String, - s3BucketName: String, - myS3Key: String, - myHandler: String, - myRole: String -): String { - - val functionCode = FunctionCode { - s3Bucket = s3BucketName - s3Key = myS3Key - } - - val request = CreateFunctionRequest { - functionName = myFunctionName - code = functionCode - description = "Created by the Lambda Kotlin API" - handler = myHandler - role = myRole - runtime = Runtime.Java8 - } - - // Create a Lambda function using a waiter - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val functionResponse = awsLambda.createFunction(request) - awsLambda.waitUntilFunctionActive { - functionName = myFunctionName - } - return functionResponse.functionArn.toString() - } -} - -suspend fun getFunction(functionNameVal: String) { - - val functionRequest = GetFunctionRequest { - functionName = functionNameVal - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val response = awsLambda.getFunction(functionRequest) - println("The runtime of this Lambda function is ${response.configuration?.runtime}") - } -} - -suspend fun listFunctionsSc() { - - val request = ListFunctionsRequest { - maxItems = 10 - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val response = awsLambda.listFunctions(request) - response.functions?.forEach { function -> - println("The function name is ${function.functionName}") - } - } -} - -suspend fun invokeFunctionSc(functionNameVal: String) { - - val json = """{"inputValue":"1000"}""" - val byteArray = json.trimIndent().encodeToByteArray() - val request = InvokeRequest { - functionName = functionNameVal - payload = byteArray - logType = LogType.Tail - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val res = awsLambda.invoke(request) - println("The function payload is ${res.payload?.toString(Charsets.UTF_8)}") - } -} - -suspend fun updateFunctionCode(functionNameVal: String?, bucketName: String?, key: String?) { - - val functionCodeRequest = UpdateFunctionCodeRequest { - functionName = functionNameVal - publish = true - s3Bucket = bucketName - s3Key = key - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - val response = awsLambda.updateFunctionCode(functionCodeRequest) - awsLambda.waitUntilFunctionUpdated { - functionName = functionNameVal - } - println("The last modified value is " + response.lastModified) - } -} - -suspend fun UpdateFunctionConfiguration(functionNameVal: String?, handlerVal: String?) { - - val configurationRequest = UpdateFunctionConfigurationRequest { - functionName = functionNameVal - handler = handlerVal - runtime = Runtime.Java11 - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - awsLambda.updateFunctionConfiguration(configurationRequest) - } -} - -suspend fun delFunction(myFunctionName: String) { - - val request = DeleteFunctionRequest { - functionName = myFunctionName - } - - LambdaClient { region = "us-west-2" }.use { awsLambda -> - awsLambda.deleteFunction(request) - println("$myFunctionName was deleted") - } -} -``` -+ For API details, see the following topics in *AWS SDK for Kotlin API reference*\. - + [CreateFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [DeleteFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [GetFunction](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [Invoke](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [ListFunctions](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [UpdateFunctionCode](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - + [UpdateFunctionConfiguration](https://github.com/awslabs/aws-sdk-kotlin#generating-api-documentation) - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. -Define a Lambda handler that increments a number\. - -``` -import logging - -logger = logging.getLogger() -logger.setLevel(logging.INFO) - - -def lambda_handler(event, context): - """ - Accepts an action and a single number, performs the specified action on the number, - and returns the result. The only allowable action is 'increment'. - - :param event: The event dict that contains the parameters sent when the function - is invoked. - :param context: The context in which the function is called. - :return: The result of the action. - """ - result = None - action = event.get('action') - if action == 'increment': - result = event.get('number', 0) + 1 - logger.info('Calculated result of %s', result) - else: - logger.error("%s is not a valid action.", action) - - response = {'result': result} - return response -``` -Define a second Lambda handler that performs arithmetic operations\. - -``` -import logging -import os - - -logger = logging.getLogger() - -# Define a list of Python lambda functions that are called by this AWS Lambda function. -ACTIONS = { - 'plus': lambda x, y: x + y, - 'minus': lambda x, y: x - y, - 'times': lambda x, y: x * y, - 'divided-by': lambda x, y: x / y} - - -def lambda_handler(event, context): - """ - Accepts an action and two numbers, performs the specified action on the numbers, - and returns the result. - - :param event: The event dict that contains the parameters sent when the function - is invoked. - :param context: The context in which the function is called. - :return: The result of the specified action. - """ - # Set the log level based on a variable configured in the Lambda environment. - logger.setLevel(os.environ.get('LOG_LEVEL', logging.INFO)) - logger.debug('Event: %s', event) - - action = event.get('action') - func = ACTIONS.get(action) - x = event.get('x') - y = event.get('y') - result = None - try: - if func is not None and x is not None and y is not None: - result = func(x, y) - logger.info("%s %s %s is %s", x, action, y, result) - else: - logger.error("I can't calculate %s %s %s.", x, action, y) - except ZeroDivisionError: - logger.warning("I can't divide %s by 0!", x) - - response = {'result': result} - return response -``` -Create functions that wrap Lambda actions\. - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - @staticmethod - def create_deployment_package(source_file, destination_file): - """ - Creates a Lambda deployment package in .zip format in an in-memory buffer. This - buffer can be passed directly to Lambda when creating the function. - - :param source_file: The name of the file that contains the Lambda handler - function. - :param destination_file: The name to give the file when it's deployed to Lambda. - :return: The deployment package. - """ - buffer = io.BytesIO() - with zipfile.ZipFile(buffer, 'w') as zipped: - zipped.write(source_file, destination_file) - buffer.seek(0) - return buffer.read() - - def get_iam_role(self, iam_role_name): - """ - Get an AWS Identity and Access Management (IAM) role. - - :param iam_role_name: The name of the role to retrieve. - :return: The IAM role. - """ - role = None - try: - temp_role = self.iam_resource.Role(iam_role_name) - temp_role.load() - role = temp_role - logger.info("Got IAM role %s", role.name) - except ClientError as err: - if err.response['Error']['Code'] == 'NoSuchEntity': - logger.info("IAM role %s does not exist.", iam_role_name) - else: - logger.error( - "Couldn't get IAM role %s. Here's why: %s: %s", iam_role_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - return role - - def create_iam_role_for_lambda(self, iam_role_name): - """ - Creates an IAM role that grants the Lambda function basic permissions. If a - role with the specified name already exists, it is used for the demo. - - :param iam_role_name: The name of the role to create. - :return: The role and a value that indicates whether the role is newly created. - """ - role = self.get_iam_role(iam_role_name) - if role is not None: - return role, False - - lambda_assume_role_policy = { - 'Version': '2012-10-17', - 'Statement': [ - { - 'Effect': 'Allow', - 'Principal': { - 'Service': 'lambda.amazonaws.com' - }, - 'Action': 'sts:AssumeRole' - } - ] - } - policy_arn = 'arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole' - - try: - role = self.iam_resource.create_role( - RoleName=iam_role_name, - AssumeRolePolicyDocument=json.dumps(lambda_assume_role_policy)) - logger.info("Created role %s.", role.name) - role.attach_policy(PolicyArn=policy_arn) - logger.info("Attached basic execution policy to role %s.", role.name) - except ClientError as error: - if error.response['Error']['Code'] == 'EntityAlreadyExists': - role = self.iam_resource.Role(iam_role_name) - logger.warning("The role %s already exists. Using it.", iam_role_name) - else: - logger.exception( - "Couldn't create role %s or attach policy %s.", - iam_role_name, policy_arn) - raise - - return role, True - - def get_function(self, function_name): - """ - Gets data about a Lambda function. - - :param function_name: The name of the function. - :return: The function data. - """ - response = None - try: - response = self.lambda_client.get_function(FunctionName=function_name) - except ClientError as err: - if err.response['Error']['Code'] == 'ResourceNotFoundException': - logger.info("Function %s does not exist.", function_name) - else: - logger.error( - "Couldn't get function %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - return response - - def create_function(self, function_name, handler_name, iam_role, deployment_package): - """ - Deploys a Lambda function. - - :param function_name: The name of the Lambda function. - :param handler_name: The fully qualified name of the handler function. This - must include the file name and the function name. - :param iam_role: The IAM role to use for the function. - :param deployment_package: The deployment package that contains the function - code in .zip format. - :return: The Amazon Resource Name (ARN) of the newly created function. - """ - try: - response = self.lambda_client.create_function( - FunctionName=function_name, - Description="AWS Lambda doc example", - Runtime='python3.8', - Role=iam_role.arn, - Handler=handler_name, - Code={'ZipFile': deployment_package}, - Publish=True) - function_arn = response['FunctionArn'] - waiter = self.lambda_client.get_waiter('function_active_v2') - waiter.wait(FunctionName=function_name) - logger.info("Created function '%s' with ARN: '%s'.", - function_name, response['FunctionArn']) - except ClientError: - logger.error("Couldn't create function %s.", function_name) - raise - else: - return function_arn - - def delete_function(self, function_name): - """ - Deletes a Lambda function. - - :param function_name: The name of the function to delete. - """ - try: - self.lambda_client.delete_function(FunctionName=function_name) - except ClientError: - logger.exception("Couldn't delete function %s.", function_name) - raise - - def invoke_function(self, function_name, function_params, get_log=False): - """ - Invokes a Lambda function. - - :param function_name: The name of the function to invoke. - :param function_params: The parameters of the function as a dict. This dict - is serialized to JSON before it is sent to Lambda. - :param get_log: When true, the last 4 KB of the execution log are included in - the response. - :return: The response from the function invocation. - """ - try: - response = self.lambda_client.invoke( - FunctionName=function_name, - Payload=json.dumps(function_params), - LogType='Tail' if get_log else 'None') - logger.info("Invoked function %s.", function_name) - except ClientError: - logger.exception("Couldn't invoke function %s.", function_name) - raise - return response - - def update_function_code(self, function_name, deployment_package): - """ - Updates the code for a Lambda function by submitting a .zip archive that contains - the code for the function. - - :param function_name: The name of the function to update. - :param deployment_package: The function code to update, packaged as bytes in - .zip format. - :return: Data about the update, including the status. - """ - try: - response = self.lambda_client.update_function_code( - FunctionName=function_name, ZipFile=deployment_package) - except ClientError as err: - logger.error( - "Couldn't update function %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - else: - return response - - def update_function_configuration(self, function_name, env_vars): - """ - Updates the environment variables for a Lambda function. - - :param function_name: The name of the function to update. - :param env_vars: A dict of environment variables to update. - :return: Data about the update, including the status. - """ - try: - response = self.lambda_client.update_function_configuration( - FunctionName=function_name, Environment={'Variables': env_vars}) - except ClientError as err: - logger.error( - "Couldn't update function configuration %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - else: - return response - - def list_functions(self): - """ - Lists the Lambda functions for the current account. - """ - try: - func_paginator = self.lambda_client.get_paginator('list_functions') - for func_page in func_paginator.paginate(): - for func in func_page['Functions']: - print(func['FunctionName']) - desc = func.get('Description') - if desc: - print(f"\t{desc}") - print(f"\t{func['Runtime']}: {func['Handler']}") - except ClientError as err: - logger.error( - "Couldn't list functions. Here's why: %s: %s", - err.response['Error']['Code'], err.response['Error']['Message']) - raise -``` -Create a function that runs the scenario\. - -``` -class UpdateFunctionWaiter(CustomWaiter): - """A custom waiter that waits until a function is successfully updated.""" - def __init__(self, client): - super().__init__( - 'UpdateSuccess', 'GetFunction', - 'Configuration.LastUpdateStatus', - {'Successful': WaitState.SUCCESS, 'Failed': WaitState.FAILURE}, - client) - - def wait(self, function_name): - self._wait(FunctionName=function_name) - - -def run_scenario(lambda_client, iam_resource, basic_file, calculator_file, lambda_name): - """ - Runs the scenario. - - :param lambda_client: A Boto3 Lambda client. - :param iam_resource: A Boto3 IAM resource. - :param basic_file: The name of the file that contains the basic Lambda handler. - :param calculator_file: The name of the file that contains the calculator Lambda handler. - :param lambda_name: The name to give resources created for the scenario, such as the - IAM role and the Lambda function. - """ - logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') - - print('-'*88) - print("Welcome to the AWS Lambda getting started with functions demo.") - print('-'*88) - - wrapper = LambdaWrapper(lambda_client, iam_resource) - - print("Checking for IAM role for Lambda...") - iam_role, should_wait = wrapper.create_iam_role_for_lambda(lambda_name) - if should_wait: - logger.info("Giving AWS time to create resources...") - wait(10) - - print(f"Looking for function {lambda_name}...") - function = wrapper.get_function(lambda_name) - if function is None: - print("Zipping the Python script into a deployment package...") - deployment_package = wrapper.create_deployment_package(basic_file, f"{lambda_name}.py") - print(f"...and creating the {lambda_name} Lambda function.") - wrapper.create_function( - lambda_name, f'{lambda_name}.lambda_handler', iam_role, deployment_package) - else: - print(f"Function {lambda_name} already exists.") - print('-'*88) - - print(f"Let's invoke {lambda_name}. This function increments a number.") - action_params = { - 'action': 'increment', - 'number': q.ask("Give me a number to increment: ", q.is_int)} - print(f"Invoking {lambda_name}...") - response = wrapper.invoke_function(lambda_name, action_params) - print(f"Incrementing {action_params['number']} resulted in " - f"{json.load(response['Payload'])}") - print('-'*88) - - print(f"Let's update the function to an arithmetic calculator.") - q.ask("Press Enter when you're ready.") - print("Creating a new deployment package...") - deployment_package = wrapper.create_deployment_package(calculator_file, f"{lambda_name}.py") - print(f"...and updating the {lambda_name} Lambda function.") - update_waiter = UpdateFunctionWaiter(lambda_client) - wrapper.update_function_code(lambda_name, deployment_package) - update_waiter.wait(lambda_name) - print(f"This function uses an environment variable to control logging level.") - print(f"Let's set it to DEBUG to get the most logging.") - wrapper.update_function_configuration( - lambda_name, {'LOG_LEVEL': logging.getLevelName(logging.DEBUG)}) - - actions = ['plus', 'minus', 'times', 'divided-by'] - want_invoke = True - while want_invoke: - print(f"Let's invoke {lambda_name}. You can invoke these actions:") - for index, action in enumerate(actions): - print(f"{index + 1}: {action}") - action_params = {} - action_index = q.ask( - "Enter the number of the action you want to take: ", - q.is_int, q.in_range(1, len(actions))) - action_params['action'] = actions[action_index - 1] - print(f"You've chosen to invoke 'x {action_params['action']} y'.") - action_params['x'] = q.ask("Enter a value for x: ", q.is_int) - action_params['y'] = q.ask("Enter a value for y: ", q.is_int) - print(f"Invoking {lambda_name}...") - response = wrapper.invoke_function(lambda_name, action_params, True) - print(f"Calculating {action_params['x']} {action_params['action']} {action_params['y']} " - f"resulted in {json.load(response['Payload'])}") - q.ask("Press Enter to see the logs from the call.") - print(base64.b64decode(response['LogResult']).decode()) - want_invoke = q.ask("That was fun. Shall we do it again? (y/n) ", q.is_yesno) - print('-'*88) - - if q.ask("Do you want to list all of the functions in your account? (y/n) "): - wrapper.list_functions() - print('-'*88) - - if q.ask("Ready to delete the function and role? (y/n) ", q.is_yesno): - for policy in iam_role.attached_policies.all(): - policy.detach_role(RoleName=iam_role.name) - iam_role.delete() - print(f"Deleted role {lambda_name}.") - wrapper.delete_function(lambda_name) - print(f"Deleted function {lambda_name}.") - - print("\nThanks for watching!") - print('-'*88) - - -if __name__ == '__main__': - try: - run_scenario( - boto3.client('lambda'), boto3.resource('iam'), 'lambda_handler_basic.py', - 'lambda_handler_calculator.py', 'doc_example_lambda_calculator') - except Exception: - logging.exception("Something went wrong with the demo!") -``` -+ For API details, see the following topics in *AWS SDK for Python \(Boto3\) API Reference*\. - + [CreateFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/CreateFunction) - + [DeleteFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/DeleteFunction) - + [GetFunction](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/GetFunction) - + [Invoke](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/Invoke) - + [ListFunctions](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/ListFunctions) - + [UpdateFunctionCode](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) - + [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_UpdateFunctionCode_section.md b/doc_source/example_lambda_UpdateFunctionCode_section.md deleted file mode 100644 index e1f89f93..00000000 --- a/doc_source/example_lambda_UpdateFunctionCode_section.md +++ /dev/null @@ -1,46 +0,0 @@ -# Update Lambda function code using an AWS SDK - -The following code example shows how to update Lambda function code\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def update_function_code(self, function_name, deployment_package): - """ - Updates the code for a Lambda function by submitting a .zip archive that contains - the code for the function. - - :param function_name: The name of the function to update. - :param deployment_package: The function code to update, packaged as bytes in - .zip format. - :return: Data about the update, including the status. - """ - try: - response = self.lambda_client.update_function_code( - FunctionName=function_name, ZipFile=deployment_package) - except ClientError as err: - logger.error( - "Couldn't update function %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - else: - return response -``` -+ For API details, see [UpdateFunctionCode](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionCode) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/example_lambda_UpdateFunctionConfiguration_section.md b/doc_source/example_lambda_UpdateFunctionConfiguration_section.md deleted file mode 100644 index 71846e12..00000000 --- a/doc_source/example_lambda_UpdateFunctionConfiguration_section.md +++ /dev/null @@ -1,44 +0,0 @@ -# Update Lambda function configuration using an AWS SDK - -The following code example shows how to update Lambda function configuration\. - -**Note** -The source code for these examples is in the [AWS Code Examples GitHub repository](https://github.com/awsdocs/aws-doc-sdk-examples)\. Have feedback on a code example? [Create an Issue](https://github.com/awsdocs/aws-doc-sdk-examples/issues/new/choose) in the code examples repo\. - ------- -#### [ Python ] - -**SDK for Python \(Boto3\)** - To learn how to set up and run this example, see [GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/lambda#code-examples)\. - - -``` -class LambdaWrapper: - def __init__(self, lambda_client, iam_resource): - self.lambda_client = lambda_client - self.iam_resource = iam_resource - - def update_function_configuration(self, function_name, env_vars): - """ - Updates the environment variables for a Lambda function. - - :param function_name: The name of the function to update. - :param env_vars: A dict of environment variables to update. - :return: Data about the update, including the status. - """ - try: - response = self.lambda_client.update_function_configuration( - FunctionName=function_name, Environment={'Variables': env_vars}) - except ClientError as err: - logger.error( - "Couldn't update function configuration %s. Here's why: %s: %s", function_name, - err.response['Error']['Code'], err.response['Error']['Message']) - raise - else: - return response -``` -+ For API details, see [UpdateFunctionConfiguration](https://docs.aws.amazon.com/goto/boto3/lambda-2015-03-31/UpdateFunctionConfiguration) in *AWS SDK for Python \(Boto3\) API Reference*\. - ------- - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. \ No newline at end of file diff --git a/doc_source/extensions-api-partners.md b/doc_source/extensions-api-partners.md deleted file mode 100644 index aee8c7b7..00000000 --- a/doc_source/extensions-api-partners.md +++ /dev/null @@ -1,29 +0,0 @@ -# AWS Lambda extensions partners - -AWS Lambda has partnered with several third party entities to provide extensions to integrate with your Lambda functions\. The following list details third party extensions that are ready for you to use at any time\. -+ [https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime](https://docs.appdynamics.com/display/PRO20X/Use+the+AppDynamics+AWS+Lambda+Extension+to+Instrument+Serverless+APM+at+Runtime) – Provides automatic instrumentation of Node\.js or Python Lambda functions, providing visibility and alerting on function performance\. -+ [https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk172491&partition=Advanced&product=CloudGuard) – An extension\-based runtime solution that offers full lifecycle security for serverless applications\. -+ [https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/) – Provides comprehensive, real\-time visibility to your serverless applications through the use of metrics, traces, and logs\. -+ [https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/](https://www.dynatrace.com/support/help/technology-support/cloud-platforms/amazon-web-services/integrations/deploy-oneagent-as-lambda-extension/) – Provides visibility into traces and metrics, and leverages AI for automated error detection and root cause analysis across the entire application stack\. -+ [https://docs.epsagon.com/docs/aws-lambda-layer](https://docs.epsagon.com/docs/aws-lambda-layer) – Listens to invocation events, stores traces, and sends them in parallel to Lambda function executions\. -+ [https://docs.fastly.com/signalsciences/install-guides/paas/aws-lambda/](https://docs.fastly.com/signalsciences/install-guides/paas/aws-lambda/)– Protects your Lambda functions from suspicious activity, such as injection\-style attacks, account takeover via credential stuffing, malicious bots, and API abuse\. -+ [https://learn.hashicorp.com/tutorials/vault/aws-lambda](https://learn.hashicorp.com/tutorials/vault/aws-lambda) – Manages secrets and makes them available for developers to use within function code, without making functions Vault aware\. -+ [https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/](https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/) – Observability tool for debugging your app stack\. -+ [https://docs.lumigo.io/docs/lambda-extensions](https://docs.lumigo.io/docs/lambda-extensions) – Profiles Lambda function invocations and collects metrics for troubleshooting issues in serverless and microservice environments\. -+ [https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring](https://docs.newrelic.com/docs/serverless-function-monitoring/aws-lambda-monitoring/get-started/monitoring-aws-lambda-serverless-monitoring) – Runs alongside Lambda functions, automatically collecting, enhancing, and transporting telemetry to New Relic's unified observability platform\. -+ [https://docs.sentry.io/product/integrations/aws-lambda/](https://docs.sentry.io/product/integrations/aws-lambda/) – Diagnose, fix, and optimize performance of Lambda functions\. -+ [https://www.site24x7.com/help/aws/lambda-execution-logs.html](https://www.site24x7.com/help/aws/lambda-execution-logs.html) – Achieve real\-time observability into your Lambda environments -+ [https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension](https://github.com/signalfx/lambda-layer-versions/tree/master/lambda-extension) – Collects high\-resolution, low\-latency metrics for efficient and effective monitoring of Lambda functions\. -+ [https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension](https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension) – Provides visibility into the health and performance of serverless applications\. -+ [https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions](https://apm.docs.thundra.io/performance/zero-overhead-with-lambda-extensions) – Provides asynchronous telemetry reporting, such as traces, metrics, and logs\. - -## AWS managed extensions - -AWS provides its own managed extensions, including: -+ [AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions.html#appconfig-integration-lambda-extensions-enabling) – Use feature flags and dynamic data to update your Lambda functions\. You can also use this extension to update other dynamic configuration, such as ops throttling and tuning\. -+ [Amazon CodeGuru Profiler](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) – Improves application performance and reduces cost by pinpointing an application's most expensive line of code and providing recommendations for improving code\. -+ [CloudWatch Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights.html) – Monitor, troubleshoot, and optimize the performance of your Lambda functions through automated dashboards\. -+ [AWS Distro for Open Telemetry](https://aws-otel.github.io/docs/getting-started/lambda) – Enables functions to send trace data to AWS monitoring services such as AWS X\-Ray, and to destinations that support OpenTelemetry such as Honeycomb and Lightstep\. -+ **AWS Parameters and Secrets** – Enables customers to securely retrieve parameters from [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/ps-integration-lambda-extensions.html) and secrets from [AWS Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_lambda.html)\. - -For additional extensions samples and demo projects, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions)\. \ No newline at end of file diff --git a/doc_source/extensions-configuration.md b/doc_source/extensions-configuration.md deleted file mode 100644 index c6a225f3..00000000 --- a/doc_source/extensions-configuration.md +++ /dev/null @@ -1,55 +0,0 @@ -# Configuring Lambda extensions - -## Configuring extensions \(\.zip file archive\) - -You can add an extension to your function as a [Lambda layer](configuration-layers.md)\. Using layers enables you to share extensions across your organization or to the entire community of Lambda developers\. You can add one or more extensions to a layer\. You can register up to 10 extensions for a function\. - -You add the extension to your function using the same method as you would for any layer\. For more information, see [Using layers with your Lambda function](invocation-layers.md)\. - -**Add an extension to your function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose the **Code** tab if it is not already selected\. - -1. Under **Layers**, choose **Edit**\. - -1. For **Choose a layer**, choose **Specify an ARN**\. - -1. For **Specify an ARN**, enter the Amazon Resource Name \(ARN\) of an extension layer\. - -1. Choose **Add**\. - -## Using extensions in container images - -You can add extensions to your [container image](images-create.md)\. The ENTRYPOINT container image setting specifies the main process for the function\. Configure the ENTRYPOINT setting in the Dockerfile, or as an override in the function configuration\. - -You can run multiple processes within a container\. Lambda manages the lifecycle of the main process and any additional processes\. Lambda uses the [Extensions API](runtimes-extensions-api.md) to manage the extension lifecycle\. - -### Example: Adding an external extension - -An external extension runs in a separate process from the Lambda function\. Lambda starts a process for each extension in the `/opt/extensions/` directory\. Lambda uses the Extensions API to manage the extension lifecycle\. After the function has run to completion, Lambda sends a `Shutdown` event to each external extension\. - -**Example of adding an external extension to a Python base image** - -``` -FROM public.ecr.aws/lambda/python:3.8 - -# Copy and install the app -COPY /app /app -WORKDIR /app -RUN pip install -r requirements.txt - -# Add an extension from the local directory into /opt -ADD my-extension.zip /opt -CMD python ./my-function.py -``` - -## Next steps - -To learn more about extensions, we recommend the following resources: -+ For a basic working example, see [Building Extensions for AWS Lambda](http://aws.amazon.com/blogs/compute/building-extensions-for-aws-lambda-in-preview/) on the AWS Compute Blog\. -+ For information about extensions that AWS Lambda Partners provides, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/) on the AWS Compute Blog\. -+ To view available example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. \ No newline at end of file diff --git a/doc_source/foundation-arch.md b/doc_source/foundation-arch.md deleted file mode 100644 index 601d4b76..00000000 --- a/doc_source/foundation-arch.md +++ /dev/null @@ -1,84 +0,0 @@ -# Lambda instruction set architectures - - The *instruction set architecture* of a Lambda function determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: -+ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. The arm64 architecture is available in most AWS Regions\. -+ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. - -**Topics** -+ [Advantages of using arm64 architecture](#foundation-arch-adv) -+ [Function migration to arm64 architecture](#foundation-arch-consider) -+ [Function code compatibility with arm64 architecture](#foundation-arch-considerations) -+ [Suggested migration steps](#foundation-arch-steps) -+ [Configuring the instruction set architecture](#foundation-arch-config) - -## Advantages of using arm64 architecture - -Lambda functions that use arm64 architecture \(AWS Graviton2 processor\) can achieve significantly better price and performance than the equivalent function running on x86\_64 architecture\. Consider using arm64 for compute\-intensive applications such as high\-performance computing, video encoding, and simulation workloads\. - -The Graviton2 CPU uses the Neoverse N1 core and supports Armv8\.2 \(including CRC and crypto extensions\) plus several other architectural extensions\. - -Graviton2 reduces memory read time by providing a larger L2 cache per vCPU, which improves the latency performance of web and mobile backends, microservices, and data processing systems\. Graviton2 also provides improved encryption performance and supports instruction sets that improve the latency of CPU\-based machine learning inference\. - -For more information about AWS Graviton2, see [AWS Graviton Processor](http://aws.amazon.com/ec2/graviton)\. - -## Function migration to arm64 architecture - -When you select a Lambda function to migrate to arm64 architecture, to ensure a smooth migration, make sure that your function meets the following requirements: -+ The function currently uses a Lambda Amazon Linux 2 runtime\. -+ The deployment package contains only open\-source components and source code that you control, so that you can make any necessary updates for the migration\. -+ If the function code includes third\-party dependencies, each library or package provides an arm64 version\. - -## Function code compatibility with arm64 architecture - -Your Lambda function code must be compatible with the instruction set architecture of the function\. Before you migrate a function to arm64 architecture, note the following points about the current function code: -+ If you added your function code using the embedded code editor, your code probably runs on either architecture without modification\. -+ If you uploaded your function code, you must upload new code that is compatible with your target architecture\. -+ If your function uses layers, you must [check each layer](invocation-layers.md#configuration-layers-finding) to ensure that it is compatible with the new architecture\. If a layer is not compatible, edit the function to replace the current layer version with a compatible layer version\. -+ If your function uses Lambda extensions, you must check each extension to ensure that it is compatible with the new architecture\. -+ If your function uses a container image deployment package type, you must create a new container image that is compatible with the architecture of the function\. - -## Suggested migration steps - - - -To migrate a Lambda function to the arm64 architecture, we recommend following these steps: - -1. Build the list of dependencies for your application or workload\. Common dependencies include: - + All the libraries and packages that the function uses\. - + The tools that you use to build, deploy, and test the function, such as compilers, test suites, continuous integration and continuous delivery \(CI/CD\) pipelines, provisioning tools, and scripts\. - + The Lambda extensions and third\-party tools that you use to monitor the function in production\. - -1. For each of the dependencies, check the version, and then check whether arm64 versions are available\. - -1. Build an environment to migrate your application\. - -1. Bootstrap the application\. - -1. Test and debug the application\. - -1. Test the performance of the arm64 function\. Compare the performance with the x86\_64 version\. - -1. Update your infrastructure pipeline to support arm64 Lambda functions\. - -1. Stage your deployment to production\. - - For example, use [alias routing configuration](configuration-aliases.md#configuring-alias-routing) to split traffic between the x86 and arm64 versions of the function, and compare the performance and latency\. - -For more information about how to create a code environment for arm64 architecture, including language\-specific information for Java, Go, \.NET, and Python, see the [Getting started with AWS Graviton](https://github.com/aws/aws-graviton-getting-started) GitHub repository\. - -## Configuring the instruction set architecture - -You can configure the instruction set architecture for new Lambda functions using the Lambda console, AWS SDKs, AWS Command Line Interface \(AWS CLI\), or AWS CloudFormation\. You can deploy the function code to Lambda with either a \.zip archive file or a container image deployment package\. - -Lambda provides the following runtimes for the arm64 architecture\. These runtimes all use the Amazon Linux 2 operating system\. -+ Node\.js 12, Node\.js 14, Node\.js 16 -+ Python 3\.8, Python 3\.9 -+ Java 8 \(AL2\), Java 11 -+ \.NET Core 3\.1 -+ Ruby 2\.7 -+ Custom Runtime on Amazon Linux 2 - -**Note** -Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. For example, see [Build a Go function for the provided\.al2 runtime](golang-package.md#golang-package-al2) or [Create a Go image from the provided\.al2 base image](go-image.md#go-image-al2)\. - -For an example of how to create a function with arm64 architecture, see [AWS Lambda Functions Powered by AWS Graviton2 Processor](http://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/)\. \ No newline at end of file diff --git a/doc_source/foundation-console.md b/doc_source/foundation-console.md deleted file mode 100644 index b3a46334..00000000 --- a/doc_source/foundation-console.md +++ /dev/null @@ -1,187 +0,0 @@ -# Lambda console - -You can use the Lambda console to configure applications, functions, code signing configurations, and layers\. - -**Topics** -+ [Applications](#foundation-applications) -+ [Functions](#foundation-functions) -+ [Code signing](#foundation-code-signing) -+ [Layers](#foundation-layers) -+ [Edit code using the console editor](#code-editor) - -## Applications - -The [Applications](deploying-lambda-apps.md) page shows you a list of applications that have been deployed using AWS CloudFormation, or other tools including the AWS Serverless Application Model\. Filter to find applications based on keywords\. - -## Functions - -The functions page shows you a list of functions defined for your account in this region\. The initial console flow to create a function depends on whether the function uses a [container image](gettingstarted-images.md) or [\.zip file archive](configuration-function-zip.md) for the deployment package\. Many of the optional [configuration tasks](configuration-function-common.md) are common to both types of function\. - -The console provides a [code editor](#code-editor) for your convenience\. - -## Code signing - -You can attach a [code signing](configuration-codesigning.md) configuration to a function\. With code signing, you can ensure that the code has been signed by an approved source and has not been altered since signing, and that the code signature has not expired or been revoked\. - -## Layers - -Create [layers](configuration-layers.md) to separate your \.zip archive function code from its dependencies\. A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies\. With layers, you can use libraries in your function without needing to include them in your deployment package\. - -## Edit code using the console editor - -You can use the code editor in the AWS Lambda console to write, test, and view the execution results of your Lambda function code\. The code editor supports languages that do not require compiling, such as Node\.js and Python\. The code editor supports only \.zip archive deployment packages, and the size of the deployment package must be less than 3 MB\. - -The code editor includes the *menu bar*, *windows*, and the *editor pane*\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor.png) - -For a list of what the commands do, see the [Menu commands reference](https://docs.aws.amazon.com/cloud9/latest/user-guide/menu-commands.html) in the *AWS Cloud9 User Guide*\. Note that some of the commands listed in that reference are not available in the code editor\. - -**Topics** -+ [Working with files and folders](#code-editor-files) -+ [Working with code](#code-editor-code) -+ [Working in fullscreen mode](#code-editor-fullscreen) -+ [Working with preferences](#code-editor-prefs) - -### Working with files and folders - -You can use the **Environment** window in the code editor to create, open, and manage files for your function\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env.png) - -**To show or hide the Environment window**, choose the **Environment** button\. If the **Environment** button is not visible, choose **Window, Environment** on the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-button.png) - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-menu.png) - - - -**To open a single file and show its contents in the editor pane**, double\-click the file in the **Environment** window\. - -**To open multiple files and show their contents in the editor pane**, choose the files in the **Environment** window\. Right\-click the selection, and then choose **Open**\. - -**To create a new file**, do one of the following: -+ In the **Environment** window, right\-click the folder where you want the new file to go, and then choose **New File**\. Type the file's name and extension, and then press Enter \. -+ Choose **File, New File** on the menu bar\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. -+ In the tab buttons bar in the editor pane, choose the **\+** button, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-new.png) - - - -**To create a new folder**, right\-click the folder in the **Environment** window where you want the new folder to go, and then choose **New Folder**\. Type the folder's name, and then press Enter \. - -**To save a file**, with the file open and its contents visible in the editor pane, choose **File, Save** on the menu bar\. - -**To rename a file or folder**, right\-click the file or folder in the **Environment** window\. Type the replacement name, and then press Enter \. - -**To delete files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Delete**\. Then confirm the deletion by choosing **Yes** \(for a single selection\) or **Yes to All**\. - -**To cut, copy, paste, or duplicate files or folders**, choose the files or folders in the **Environment** window\. Right\-click the selection, and then choose **Cut**, **Copy**, **Paste**, or **Duplicate**, respectively\. - -**To collapse folders**, choose the gear icon in the **Environment** window, and then choose **Collapse All Folders**\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-env-collapse.png) - -**To show or hide hidden files**, choose the gear icon in the **Environment** window, and then choose **Show Hidden Files**\. - -### Working with code - -Use the editor pane in the code editor to view and write code\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-editor-pane.png) - - - -#### Working with tab buttons - -Use the *tab buttons bar* to select, view, and create files\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-tab-buttons-bar.png) - - - -**To display an open file's contents**, do one of the following: -+ Choose the file's tab\. -+ Choose the drop\-down menu button in the tab buttons bar, and then choose the file's name\. - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-drop-down-list.png) - - - -**To close an open file**, do one of the following: -+ Choose the **X** icon in the file's tab\. -+ Choose the file's tab\. Then choose the drop\-down menu button in the tab buttons bar, and choose **Close Pane**\. - -**To close multiple open files**, choose the drop\-down menu in the tab buttons bar, and then choose **Close All Tabs in All Panes** or **Close All But Current Tab** as needed\. - -**To create a new file**, choose the **\+** button in the tab buttons bar, and then choose **New File**\. When you're ready to save the file, choose **File, Save** or **File, Save As** on the menu bar\. Then use the **Save As** dialog box that displays to name the file and choose where to save it\. - -#### Working with the status bar - -Use the status bar to move quickly to a line in the active file and to change how code is displayed\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar.png) - - - -**To move quickly to a line in the active file**, choose the line selector, type the line number to go to, and then press Enter \. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-line-selector.png) - - - -**To change the code color scheme in the active file**, choose the code color scheme selector, and then choose the new code color scheme\. - - - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-code-color.png) - -**To change in the active file whether soft tabs or spaces are used, the tab size, or whether to convert to spaces or tabs**, choose the spaces and tabs selector, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-spaces-tabs.png) - -**To change for all files whether to show or hide invisible characters or the gutter, auto\-pair brackets or quotes, wrap lines, or the font size**, choose the gear icon, and then choose the new settings\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-status-bar-settings.png) - - - -### Working in fullscreen mode - -You can expand the code editor to get more room to work with your code\. - -To expand the code editor to the edges of the web browser window, choose the **Toggle fullscreen** button in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-fullscreen.png) - - - -To shrink the code editor to its original size, choose the **Toggle fullscreen** button again\. - -In fullscreen mode, additional options are displayed on the menu bar: **Save** and **Test**\. Choosing **Save** saves the function code\. Choosing **Test** or **Configure Events** enables you to create or edit the function's test events\. - -### Working with preferences - -You can change various code editor settings such as which coding hints and warnings are displayed, code folding behaviors, code autocompletion behaviors, and much more\. - -To change code editor settings, choose the **Preferences** gear icon in the menu bar\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/code-editor/code-editor-menu-bar-preferences.png) - -For a list of what the settings do, see the following references in the *AWS Cloud9 User Guide*\. -+ [Project setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-project.html#settings-project-change) -+ [User setting changes you can make](https://docs.aws.amazon.com/cloud9/latest/user-guide/settings-user.html#settings-user-change) - -Note that some of the settings listed in those references are not available in the code editor\. \ No newline at end of file diff --git a/doc_source/foundation-networking.md b/doc_source/foundation-networking.md deleted file mode 100644 index 1a72ab63..00000000 --- a/doc_source/foundation-networking.md +++ /dev/null @@ -1,106 +0,0 @@ -# VPC networking for Lambda - -Amazon Virtual Private Cloud \(Amazon VPC\) is a virtual network in the AWS cloud, dedicated to your AWS account\. You can use Amazon VPC to create a private network for resources such as databases, cache instances, or internal services\. For more information about Amazon VPC, see [What is Amazon VPC?](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) - -A Lambda function always runs inside a VPC owned by the Lambda service\. Lambda applies network access and security rules to this VPC and Lambda maintains and monitors the VPC automatically\. If your Lambda function needs to access the resources in your account VPC, [ configure the function to access the VPC](configuration-vpc.md)\. Lambda provides managed resources named Hyperplane ENIs, which your Lambda function uses to connect from the Lambda VPC to an ENI \(Elastic network interface\) in your account VPC\. - -There's no additional charge for using a VPC or a Hyperplane ENI\. There are charges for some VPC components, such as NAT gateways\. For more information, see [Amazon VPC Pricing](http://aws.amazon.com/vpc/pricing)\. - -**Topics** -+ [VPC network elements](#foundation-nw-concepts) -+ [Connecting Lambda functions to your VPC](#foundation-nw-connecting) -+ [Lambda Hyperplane ENIs](#foundation-nw-eni) -+ [Connections](#foundation-nw-addressing) -+ [Security](#foundation-nw-security) -+ [Observability](#foundation-nw-obs) - -## VPC network elements - -Amazon VPC networks includes the following network elements: -+ Elastic network interface – [elastic network interface](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ElasticNetworkInterfaces.html) is a logical networking component in a VPC that represents a virtual network card\. -+ Subnet – A range of IP addresses in your VPC\. You can add AWS resources to a specified subnet\. Use a public subnet for resources that must connect to the internet, and a private subnet for resources that don't connect to the internet\. -+ Security group – use security groups to control access to the AWS resources in each subnet\. -+ Access control list \(ACL\) – use a network ACL to provide additional security in a subnet\. The default subnet ACL allows all inbound and outbound traffic\. -+ Route table – contains a set of routes that AWS uses to direct the network traffic for your VPC\. You can explicitly associate a subnet with a particular route table\. By default, the subnet is associated with the main route table\. -+ Route – each route in a route table specifies a range of IP addresses and the destination where Lambda sends the traffic for that range\. The route also specifies a target, which is the gateway, network interface, or connection through which to send the traffic\. -+ NAT gateway – An AWS Network Address Translation \(NAT\) service that controls access from a private VPC private subnet to the Internet\. -+ VPC endpoints – You can use an Amazon VPC endpoint to create private connectivity to services hosted in AWS, without requiring access over the internet or through a NAT device, VPN connection, or AWS Direct Connect connection\. For more information, see [AWS PrivateLink and VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-overview.html)\. - -For more information about Amazon VPC networking definitions, see [ How Amazon VPC works](https://docs.aws.amazon.com/vpc/latest/userguide/how-it-works.html) in the Amazon VPC Developer Guide and the [Amazon VPC FAQs\.](http://aws.amazon.com/vpc/faqs.html) - -## Connecting Lambda functions to your VPC - -A Lambda function always runs inside a VPC owned by the Lambda service\. By default, a Lambda function isn't connected to VPCs in your account\. When you connect a function to a VPC in your account, the function can't access the internet unless your VPC provides access\. - -Lambda accesses resources in your VPC using a Hyperplane ENI\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC using VPC\-to\-VPC NAT \(V2N\)\. V2N provides connectivity from the Lambda VPC to your account VPC, but not in the other direction\. - -When you create a Lambda function \(or update its VPC settings\), Lambda allocates a Hyperplane ENI for each subnet in your function's VPC configuration\. Multiple Lambda functions can share a network interface, if the functions share the same subnet and security group\. - -To connect to another AWS service, you can use [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) for private communications between your VPC and supported AWS services\. An alternative approach is to use a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) to route outbound traffic to another AWS service\. - -To give your function access to the internet, route outbound traffic to a NAT gateway in a public subnet\. The NAT gateway has a public IP address and can connect to the internet through the VPC's internet gateway\. - -For information about how to configure Lambda VPC networking, see [Lambda networking](configuration-vpc.md)\. - -## Lambda Hyperplane ENIs - -The Hyperplane ENI is a managed network resource that the Lambda service creates and manages\. Multiple execution environments in the Lambda VPC can use a Hyperplane ENI to securely access resources inside of VPCs in your account\. Hyperplane ENIs provide NAT capabilities from the Lambda VPC to your account VPC\. For more information about Hyperplane ENIs, see [Improved VPC networking for AWS Lambda functions ](http://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/) in the AWS compute blog\. - -Each unique security group and subnet combination in your account requires a different network interface\. Functions in the account that share the same security group and subnet combination use the same network interfaces\. - -Because the functions in your account share the ENI resources, the ENI lifecycle is more complex than other Lambda resources\. The following sections describe the ENI lifecycle\. - -**Topics** -+ [Creating ENIs](#foundation-nw-eni-create) -+ [Managing ENIs](#foundation-nw-eni-man) -+ [Deleting ENIs](#foundation-nw-eni-delete) - -### Creating ENIs - -Lambda may create Hyperplane ENI resources for a newly created VPC\-enabled function or for a VPC configuration change to an existing function\. The function remains in pending state while Lambda creates the required resources\. When the Hyperplane ENI is ready, the function transitions to active state and the ENI becomes available for use\. Lambda can require several minutes to create a Hyperplane ENI\. - -For a newly created VPC\-enabled function, any invocations or other API actions that operate on the function fail until the function state transitions to active\. - -For a VPC configuration change to an existing function, any function invocations continue to use the Hyperplane ENI associated with the old subnet and security group configuration until the function state transitions to active\. - -If a Lambda function remains idle for consecutive weeks, Lambda reclaims the unused Hyperplane ENIs and sets the function state to idle\. The next invocation causes Lambda to reactivate the idle function\. The invocation fails, and the function enters pending state until Lambda completes the creation or allocation of a Hyperplane ENI\. - -For more information about function states, see [Lambda function states](functions-states.md)\. - -### Managing ENIs - -Lambda uses permissions in your function's execution role to create and manage network interfaces\. Lambda creates a Hyperplane ENI when you define a unique subnet plus security group combination for a VPC\-enabled function in an account\. Lambda reuses the Hyperplane ENI for other VPC\-enabled functions in your account that use the same subnet and security group combination\. - -There is no quota on the number of Lambda functions that can use the same Hyperplane ENI\. However, each Hyperplane ENI supports up to 65,000 connections/ports\. If the number of connections exceeds 65,000, Lambda creates a new Hyperplane ENI to provide additional connections\. - -When you update your function configuration to access a different VPC, Lambda terminates connectivity to the Hyperplane ENI in the previous VPC\. The process to update the connectivity to a new VPC can take several minutes\. During this time, invocations to the function continue to use the previous VPC\. After the update is complete, new invocations start using the Hyperplane ENI in the new VPC\. At this point, the Lambda function is no longer connected to the previous VPC\. - -### Deleting ENIs - -When you update a function to remove its VPC configuration, Lambda requires up to 20 minutes to delete the attached Hyperplane ENI\. Lambda only deletes the ENI if no other function \(or published function version\) is using that Hyperplane ENI\. - -Lambda relies on permissions in the function [ execution role](lambda-intro-execution-role.md) to delete the Hyperplane ENI\. If you delete the execution role before Lambda deletes the Hyperplane ENI, Lambda won't be able to delete the Hyperplane ENI\. You can manually perform the deletion\. - -Lambda doesn't delete network interfaces that are in use by functions or function versions in your account\. You can use the [Lambda ENI Finder](https://github.com/awslabs/aws-support-tools/tree/master/Lambda/FindEniMappings) to identify the functions or function versions that are using a Hyperplane ENI\. For any functions or function versions that you no longer need, you can remove the VPC configuration so that Lambda deletes the Hyperplane ENI\. - -## Connections - -Lambda supports two types of connections: TCP \(Transmission Control Protocol\) and UDP \(User Datagram Protocol\)\. - -When you create a VPC, Lambda automatically creates a set of DHCP options and associates them with the VPC\. You can configure your own DHCP options set for your VPC\. For more details, refer to [Amazon VPC DHCP options](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)\. - -Amazon provides a DNS server \(the Amazon Route 53 resolver\) for your VPC\. For more information, see [DNS support for your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html)\. - -## Security - -AWS provides [https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) and [https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html) to increase security in your VPC\. Security groups control inbound and outbound traffic for your instances, and network ACLs control inbound and outbound traffic for your subnets\. Security groups provide enough access control for most subnets\. You can use network ACLs if you want an additional layer of security for your VPC\. For more information, see [Internetwork traffic privacy in Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Security.html)\. Every subnet that you create is automatically associated with the VPC's default network ACL\. You can change the association, and you can change the contents of the default network ACL\. - -For general security best practices, see [VPC security best practices](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html)\. For details on how you can use IAM to manage access to the Lambda API and resources, see [AWS Lambda permissions](lambda-permissions.md)\. - -You can use Lambda\-specific condition keys for VPC settings to provide additional permission controls for your Lambda functions\. For more information about VPC condition keys, see [Using IAM condition keys for VPC settings](configuration-vpc.md#vpc-conditions)\. - -## Observability - -You can use [VPC Flow Logs](https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html) to capture information about the IP traffic going to and from network interfaces in your VPC\. You can publish Flow log data to Amazon CloudWatch Logs or Amazon S3\. After you've created a flow log, you can retrieve and view its data in the chosen destination\. - -Note: when you attach a function to a VPC, the CloudWatch log messages do not use the VPC routes\. Lambda sends them using the regular routing for logs\. \ No newline at end of file diff --git a/doc_source/foundation-progmodel.md b/doc_source/foundation-progmodel.md deleted file mode 100644 index 4d8c87cc..00000000 --- a/doc_source/foundation-progmodel.md +++ /dev/null @@ -1,25 +0,0 @@ -# Lambda programming model - -Lambda provides a programming model that is common to all of the runtimes\. The programming model defines the interface between your code and the Lambda system\. You tell Lambda the entry point to your function by defining a *handler* in the function configuration\. The runtime passes in objects to the handler that contain the invocation *event* and the *context*, such as the function name and request ID\. - -When the handler finishes processing the first event, the runtime sends it another\. The function's class stays in memory, so clients and variables that are declared outside of the handler method in *initialization code* can be reused\. To save processing time on subsequent events, create reusable resources like AWS SDK clients during initialization\. Once initialized, each instance of your function can process thousands of requests\. - -When [AWS X\-Ray tracing](services-xray.md) is enabled, the runtime records separate subsegments for initialization and execution\. - -Your function also has access to local storage in the `/tmp` directory\. Instances of your function that are serving requests remain active for a few hours before being recycled\. - -The runtime captures logging output from your function and sends it to Amazon CloudWatch Logs\. In addition to logging your function's output, the runtime also logs entries when function invocation starts and ends\. This includes a report log with the request ID, billed duration, initialization duration, and other details\. If your function throws an error, the runtime returns that error to the invoker\. - -**Note** -Logging is subject to [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html)\. Log data can be lost due to throttling or, in some cases, when an instance of your function is stopped\. - -For a hands\-on introduction to the programming model in your preferred programming language, see the following chapters\. -+ [Building Lambda functions with Node\.js](lambda-nodejs.md) -+ [Building Lambda functions with Python](lambda-python.md) -+ [Building Lambda functions with Ruby](lambda-ruby.md) -+ [Building Lambda functions with Java](lambda-java.md) -+ [Building Lambda functions with Go](lambda-golang.md) -+ [Building Lambda functions with C\#](lambda-csharp.md) -+ [Building Lambda functions with PowerShell](lambda-powershell.md) - -Lambda scales your function by running additional instances of it as demand increases, and by stopping instances as demand decreases\. Unless noted otherwise, incoming requests might be processed out of order or concurrently\. Store your application's state in other services, and don't rely on instances of your function being long lived\. Use local storage and class\-level objects to increase performance, but keep to a minimum the size of your deployment package and the amount of data that you transfer onto the execution environment\. \ No newline at end of file diff --git a/doc_source/functions-states.md b/doc_source/functions-states.md deleted file mode 100644 index 8e38415b..00000000 --- a/doc_source/functions-states.md +++ /dev/null @@ -1,69 +0,0 @@ -# Lambda function states - -Lambda includes a state field in the function configuration for all functions to indicate when your function is ready to invoke\. `State` provides information about the current status of the function, including whether you can successfully invoke the function\. Function states do not change the behavior of function invocations or how your function runs the code\. Function states include: -+ `Pending` – After Lambda creates the function, it sets the state to pending\. While in pending state, Lambda attempts to create or configure resources for the function, such as VPC or EFS resources\. Lambda does not invoke a function during pending state\. Any invocations or other API actions that operate on the function will fail\. -+ `Active` – Your function transitions to active state after Lambda completes resource configuration and provisioning\. Functions can only be successfully invoked while active\. -+ `Failed` – Indicates that resource configuration or provisioning encountered an error\. -+ `Inactive` – A function becomes inactive when it has been idle long enough for Lambda to reclaim the external resources that were configured for it\. When you try to invoke a function that is inactive, the invocation fails and Lambda sets the function to pending state until the function resources are recreated\. If Lambda fails to recreate the resources, the function is set to the inactive state\. - -If you are using SDK\-based automation workflows or calling Lambda’s service APIs directly, ensure that you check a function's state before invocation to verify that it is active\. You can do this with the Lambda API action [GetFunction](API_GetFunction.md), or by configuring a waiter using the [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2)\. - -``` -aws lambda get-function --function-name my-function --query 'Configuration.[State, LastUpdateStatus]' -``` - -You should see the following output: - -``` -[ - "Active", - "Successful" -] -``` - -Functions have two other attributes, `StateReason` and `StateReasonCode`\. These provide information and context about the function’s state when it is not active for troubleshooting issues\. - -The following operations fail while function creation is pending: -+ [Invoke](API_Invoke.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) - -## Function states while updating - -Lambda provides additional context for functions undergoing updates with the `LastUpdateStatus` attribute, which can have the following statuses: -+ `InProgress` – An update is happening on an existing function\. While a function update is in progress, invocations go to the function’s previous code and configuration\. -+ `Successful` – The update has completed\. Once Lambda finishes the update, this stays set until a further update\. -+ `Failed` – The function update has failed\. Lambda aborts the update and the function’s previous code and configuration remain available\. - -**Example** -The following is the result of `get-function-configuration` on a function undergoing an update\. - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "VpcConfig": { - "SubnetIds": [ - "subnet-071f712345678e7c8", - "subnet-07fd123456788a036", - "subnet-0804f77612345cacf" - ], - "SecurityGroupIds": [ - "sg-085912345678492fb" - ], - "VpcId": "vpc-08e1234569e011e83" - }, - "State": "Active", - "LastUpdateStatus": "InProgress", - ... -} -``` - -[FunctionConfiguration](API_FunctionConfiguration.md) has two other attributes, `LastUpdateStatusReason` and `LastUpdateStatusReasonCode`, to help troubleshoot issues with updating\. - -The following operations fail while an asynchronous update is in progress: -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) \ No newline at end of file diff --git a/doc_source/getting-started.md b/doc_source/getting-started.md deleted file mode 100644 index fdf9fafb..00000000 --- a/doc_source/getting-started.md +++ /dev/null @@ -1,107 +0,0 @@ -# Getting started with Lambda - -To get started with Lambda, use the Lambda console to create a function\. In a few minutes, you can create a function, invoke it, and then view logs, metrics, and trace data\. - -**Note** -To use Lambda and other AWS services, you need an AWS account\. If you don't have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) -As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. - -You can author functions in the Lambda console, or with an IDE toolkit, command line tools, or the AWS SDKs\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. The [AWS Command Line Interface \(AWS CLI\)](gettingstarted-awscli.md) gives you direct access to the Lambda API for advanced configuration and automation use cases\. - -You deploy your function code to Lambda using a deployment package\. Lambda supports two types of deployment packages: -+ A [\.zip file archive](configuration-function-zip.md) that contains your function code and its dependencies\. For a tutorial, see [Create a Lambda function with the console](#getting-started-create-function)\. -+ A [container image](images-create.md) that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. - -## Create a Lambda function with the console - -In this getting started exercise, you create a Lambda function using the console\. The function uses the default code that Lambda creates\. The Lambda console provides a [code editor](foundation-console.md#code-editor) for non\-compiled languages that lets you modify and test code quickly\. For compiled languages, you must create a [\.zip archive deployment package](gettingstarted-package.md#gettingstarted-package-zip) to upload your Lambda function code\. - -### Create the function - -You create a Node\.js Lambda function using the Lambda console\. Lambda automatically creates default code for the function\. - -**To create a Lambda function with the console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter **my\-function**\. - - 1. For **Runtime**, confirm that **Node\.js 14\.x** is selected\. Note that Lambda provides runtimes for \.NET \(PowerShell, C\#\), Go, Java, Node\.js, Python, and Ruby\. - -1. Choose **Create function**\. - -Lambda creates a Node\.js function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. The Lambda function assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. - -### Invoke the Lambda function - -Invoke your Lambda function using the sample event data provided in the console\. - -**To invoke a function** - -1. After selecting your function, choose the **Test** tab\. - -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: - - ``` - { - "key1": "value1", - "key2": "value2", - "key3": "value3" - } - ``` - -1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. - - Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. - -1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. - -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. - -1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. - -### Clean up - -If you are done working with the example function, delete it\. You can also delete the log group that stores the function's logs, and the execution role that the console created\. - -**To delete a Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Actions**, **Delete**\. - -1. In the **Delete function** dialog box, choose **Delete**\. - -**To delete the log group** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home#logs:) of the CloudWatch console\. - -1. Select the function's log group \(`/aws/lambda/my-function`\)\. - -1. Choose **Actions**, **Delete log group\(s\)**\. - -1. In the **Delete log group\(s\)** dialog box, choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home?#/roles) of the AWS Identity and Access Management \(IAM\) console\. - -1. Select the function's role \(`my-function-role-31exxmpl`\)\. - -1. Choose **Delete role**\. - -1. In the **Delete role** dialog box, choose **Yes, delete**\. - -You can automate the creation and cleanup of functions, log groups, and roles with AWS CloudFormation and the AWS Command Line Interface \(AWS CLI\)\. For fully functional sample applications, see [Lambda sample applications](lambda-samples.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-awscli.md b/doc_source/gettingstarted-awscli.md deleted file mode 100644 index 70397360..00000000 --- a/doc_source/gettingstarted-awscli.md +++ /dev/null @@ -1,340 +0,0 @@ -# Using Lambda with the AWS CLI - -You can use the AWS Command Line Interface to manage functions and other AWS Lambda resources\. The AWS CLI uses the AWS SDK for Python \(Boto\) to interact with the Lambda API\. You can use it to learn about the API, and apply that knowledge in building applications that use Lambda with the AWS SDK\. - -In this tutorial, you manage and invoke Lambda functions with the AWS CLI\. For more information, see [What is the AWS CLI?](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) in the *AWS Command Line Interface User Guide*\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function)\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -This tutorial uses the AWS Command Line Interface \(AWS CLI\) to call service API operations\. To install the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the AWS Command Line Interface User Guide\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. To create an execution role with the AWS CLI, use the `create-role` command\. - -In the following example, you specify the trust policy inline\. Requirements for escaping quotes in the JSON string vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - -You can also define the [trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#delegation) for the role using a JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. This trust policy allows Lambda to use the role's permissions by giving the service principal `lambda.amazonaws.com` permission to call the AWS Security Token Service \(AWS STS\) `AssumeRole` action\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json -``` - -You should see the following output: - -``` -{ - "Role": { - "Path": "/", - "RoleName": "lambda-ex", - "RoleId": "AROAQFOXMPL6TZ6ITKWND", - "Arn": "arn:aws:iam::123456789012:role/lambda-ex", - "CreateDate": "2020-01-17T23:19:12Z", - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - } -} -``` - -To add permissions to the role, use the attach\-policy\-to\-role command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. - -``` -aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole -``` - -The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -## Create the function - -The following example logs the values of environment variables and the event object\. - -**Example index\.js** - -``` -exports.handler = async function(event, context) { - console.log("ENVIRONMENT VARIABLES\n" + JSON.stringify(process.env, null, 2)) - console.log("EVENT\n" + JSON.stringify(event, null, 2)) - return context.logStreamName -} -``` - -**To create the function** - -1. Copy the sample code into a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. Replace the highlighted text in the role ARN with your account ID\. - - ``` - aws lambda create-function --function-name my-function \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs16.x \ - --role arn:aws:iam::123456789012:role/lambda-ex - ``` - - You should see the following output: - - ``` - { - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "index.handler", - "CodeSha256": "FpFMvUhayLkOoVBpNuNiIVML/tuGv2iJQ7t0yWVTU8c=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "88ebe1e1-bfdf-4dc3-84de-3017268fa1ff", - ... - } - ``` - -To get logs for an invocation from the command line, use the `--log-type` option\. The response includes a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` - -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -You can use the `base64` utility to decode the logs\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` - -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST - "AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` - -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. For macOS, the command is `base64 -D`\. - -To get full log events from the command line, you can include the log stream name in the output of your function, as shown in the preceding example\. The following example script invokes a function named `my-function` and downloads the last five log events\. - -**Example get\-logs\.sh Script** -This example requires that `my-function` returns a log stream ID\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name $(cat out) --limit 5 -``` - -The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to be available\. The output includes the response from Lambda and the output from the `get-log-events` command\. - -``` -./get-logs.sh -``` - -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Update the function - -After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access\. You can also adjust resources associated with the function, such as memory and concurrency\. These configurations apply to functions defined as \.zip file archives and to functions defined as container images\. - -Use the [update\-function\-configuration](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-function-configuration.html) command to configure functions\. The following example sets the function memory to 256 MB\. - -**Example update\-function\-configuration command** - -``` -aws lambda update-function-configuration \ ---function-name my-function \ ---memory-size 256 -``` - -## List the Lambda functions in your account - -Run the following AWS CLI `list-functions` command to retrieve a list of functions that you have created\. - -``` -aws lambda list-functions --max-items 10 -``` - -You should see the following output: - -``` -{ - "Functions": [ - { - "FunctionName": "cli", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "Handler": "index.handler", - ... - }, - { - "FunctionName": "random-error", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:random-error", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "index.handler", - ... - }, - ... - ], - "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0=" -} -``` - -In response, Lambda returns a list of up to 10 functions\. If there are more functions you can retrieve, `NextToken` provides a marker you can use in the next `list-functions` request\. The following `list-functions` AWS CLI command is an example that shows the `--starting-token` parameter\. - -``` -aws lambda list-functions --max-items 10 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0= -``` - -## Retrieve a Lambda function - -The Lambda CLI `get-function` command returns Lambda function metadata and a presigned URL that you can use to download the function's deployment package\. - -``` -aws lambda get-function --function-name my-function -``` - -You should see the following output: - -``` -{ - "Configuration": { - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-ex", - "CodeSha256": "FpFMvUhayLkOoVBpNuNiIVML/tuGv2iJQ7t0yWVTU8c=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "88ebe1e1-bfdf-4dc3-84de-3017268fa1ff", - ... - }, - "Code": { - "RepositoryType": "S3", - "Location": "https://awslambda-us-east-2-tasks.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-function-4203078a-b7c9-4f35-..." - } -} -``` - -For more information, see [GetFunction](API_GetFunction.md)\. - -## Clean up - -Run the following `delete-function` command to delete the `my-function` function\. - -``` -aws lambda delete-function --function-name my-function -``` - -Delete the IAM role you created in the IAM console\. For information about deleting a role, see [Deleting roles or instance profiles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage_delete.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-concepts.md b/doc_source/gettingstarted-concepts.md deleted file mode 100644 index 656c777a..00000000 --- a/doc_source/gettingstarted-concepts.md +++ /dev/null @@ -1,128 +0,0 @@ -# Lambda concepts - -Lambda runs instances of your function to process events\. You can invoke your function directly using the Lambda API, or you can configure an AWS service or resource to invoke your function\. - -**Topics** -+ [Function](#gettingstarted-concepts-function) -+ [Trigger](#gettingstarted-concepts-trigger) -+ [Event](#gettingstarted-concepts-event) -+ [Execution environment](#gettingstarted-concepts-ee) -+ [Instruction set architecture](#gettingstarted-concepts-arch) -+ [Deployment package](#gettingstarted-concepts-dp) -+ [Runtime](#gettingstarted-concepts-runtime) -+ [Layer](#gettingstarted-concepts-layer) -+ [Extension](#gettingstarted-concepts-extensions) -+ [Concurrency](#gettingstarted-concepts-concurrency) -+ [Qualifier](#gettingstarted-concepts-qualifier) -+ [Destination](#gettingstarted-concepts-destinations) - -## Function - -A *function* is a resource that you can invoke to run your code in Lambda\. A function has code to process the [events](#gettingstarted-concepts-event) that you pass into the function or that other AWS services send to the function\. - -For more information, see [Configuring AWS Lambda functions](lambda-functions.md)\. - -## Trigger - -A *trigger* is a resource or configuration that invokes a Lambda function\. Triggers include AWS services that you can configure to invoke a function and [event source mappings](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from a stream or queue and invokes a function\. For more information, see [Invoking Lambda functions](lambda-invocation.md) and [Using AWS Lambda with other services](lambda-services.md)\. - -## Event - -An *event* is a JSON\-formatted document that contains data for a Lambda function to process\. The runtime converts the event to an object and passes it to your function code\. When you invoke a function, you determine the structure and contents of the event\. - -**Example custom event – weather data** - -``` -{ - "TemperatureK": 281, - "WindKmh": -3, - "HumidityPct": 0.55, - "PressureHPa": 1020 -} -``` - -When an AWS service invokes your function, the service defines the shape of the event\. - -**Example service event – Amazon SNS notification** - -``` -{ - "Records": [ - { - "Sns": { - "Timestamp": "2019-01-02T12:45:07.000Z", - "Signature": "tcc6faL2yUC6dgZdmrwh1Y4cGa/ebXEkAi6RibDsvpi+tE/1+82j...65r==", - "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e", - "Message": "Hello from SNS!", - ... -``` - -For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. - -## Execution environment - -An *execution environment* provides a secure and isolated runtime environment for your Lambda function\. An execution environment manages the processes and resources that are required to run the function\. The execution environment provides lifecycle support for the function and for any [extensions](#gettingstarted-concepts-extensions) associated with your function\. - -For more information, see [Lambda execution environment](lambda-runtime-environment.md)\. - -## Instruction set architecture - - The *instruction set architecture* determines the type of computer processor that Lambda uses to run the function\. Lambda provides a choice of instruction set architectures: -+ arm64 – 64\-bit ARM architecture, for the AWS Graviton2 processor\. -+ x86\_64 – 64\-bit x86 architecture, for x86\-based processors\. - -For more information, see [Lambda instruction set architectures](foundation-arch.md)\. - -## Deployment package - -You deploy your Lambda function code using a *deployment package*\. Lambda supports two types of deployment packages: -+ A \.zip file archive that contains your function code and its dependencies\. Lambda provides the operating system and runtime for your function\. -+ A container image that is compatible with the [Open Container Initiative \(OCI\)](https://opencontainers.org/) specification\. You add your function code and dependencies to the image\. You must also include the operating system and a Lambda runtime\. - -For more information, see [Lambda deployment packages](gettingstarted-package.md)\. - -## Runtime - -The *runtime* provides a language\-specific environment that runs in an execution environment\. The runtime relays invocation events, context information, and responses between Lambda and the function\. You can use runtimes that Lambda provides, or build your own\. If you package your code as a \.zip file archive, you must configure your function to use a runtime that matches your programming language\. For a container image, you include the runtime when you build the image\. - -For more information, see [Lambda runtimes](lambda-runtimes.md)\. - -## Layer - -A Lambda *layer* is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a [custom runtime](runtimes-custom.md), data, or configuration files\. - -Layers provide a convenient way to package libraries and other dependencies that you can use with your Lambda functions\. Using layers reduces the size of uploaded deployment archives and makes it faster to deploy your code\. Layers also promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. - -You can include up to five layers per function\. Layers count towards the standard Lambda [deployment size quotas](gettingstarted-limits.md)\. When you include a layer in a function, the contents are extracted to the `/opt` directory in the execution environment\. - -By default, the layers that you create are private to your AWS account\. You can choose to share a layer with other accounts or to make the layer public\. If your functions consume a layer that a different account published, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function or update functions using a deleted layer version\. - -Functions deployed as a container image do not use layers\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. - -For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. - -## Extension - -Lambda *extensions* enable you to augment your functions\. For example, you can use extensions to integrate your functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. - -An internal extension runs in the runtime process and shares the same lifecycle as the runtime\. An external extension runs as a separate process in the execution environment\. The external extension is initialized before the function is invoked, runs in parallel with the function's runtime, and continues to run after the function invocation is complete\. - -For more information, see [Lambda extensions](lambda-extensions.md)\. - -## Concurrency - -*Concurrency* is the number of requests that your function is serving at any given time\. When your function is invoked, Lambda provisions an instance of it to process the event\. When the function code finishes running, it can handle another request\. If the function is invoked again while a request is still being processed, another instance is provisioned, increasing the function's concurrency\. - -Concurrency is subject to [quotas](gettingstarted-limits.md) at the AWS Region level\. You can configure individual functions to limit their concurrency, or to enable them to reach a specific level of concurrency\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. - -## Qualifier - -When you invoke or view a function, you can include a *qualifier* to specify a version or alias\. A *version* is an immutable snapshot of a function's code and configuration that has a numerical qualifier\. For example, `my-function:1`\. An *alias* is a pointer to a version that you can update to map to a different version, or split traffic between two versions\. For example, `my-function:BLUE`\. You can use versions and aliases together to provide a stable interface for clients to invoke your function\. - -For more information, see [Lambda function versions](configuration-versions.md)\. - -## Destination - -A *destination* is an AWS resource where Lambda can send events from an asynchronous invocation\. You can configure a destination for events that fail processing\. Some services also support a destination for events that are successfully processed\. - -For more information, see [Configuring destinations for asynchronous invocation](invocation-async.md#invocation-async-destinations)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-features.md b/doc_source/gettingstarted-features.md deleted file mode 100644 index 9518d0a7..00000000 --- a/doc_source/gettingstarted-features.md +++ /dev/null @@ -1,93 +0,0 @@ -# Lambda features - -Lambda provides a management console and API for managing and invoking functions\. It provides runtimes that support a standard set of features so that you can easily switch between languages and frameworks, depending on your needs\. In addition to functions, you can also create versions, aliases, layers, and custom runtimes\. - -**Topics** -+ [Scaling](#gettingstarted-features-scaling) -+ [Concurrency controls](#gettingstarted-features-concurrency) -+ [Function URLs](#gettingstarted-features-urls) -+ [Asynchronous invocation](#gettingstarted-features-async) -+ [Event source mappings](#gettingstarted-features-eventsourcemapping) -+ [Destinations](#gettingstarted-features-destinations) -+ [Function blueprints](#gettingstarted-features-blueprints) -+ [Testing and deployment tools](#gettingstarted-features-tools) -+ [Application templates](#gettingstarted-features-templates) - -## Scaling - -Lambda manages the infrastructure that runs your code, and scales automatically in response to incoming requests\. When your function is invoked more quickly than a single instance of your function can process events, Lambda scales up by running additional instances\. When traffic subsides, inactive instances are frozen or stopped\. You pay only for the time that your function is initializing or processing events\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) - -For more information, see [Lambda function scaling](invocation-scaling.md)\. - -## Concurrency controls - -Use concurrency settings to ensure that your production applications are highly available and highly responsive\. To prevent a function from using too much concurrency, and to reserve a portion of your account's available concurrency for a function, use *reserved concurrency*\. Reserved concurrency splits the pool of available concurrency into subsets\. A function with reserved concurrency only uses concurrency from its dedicated pool\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-concurrency-reserved.png) - -To enable functions to scale without fluctuations in latency, use *provisioned concurrency*\. For functions that take a long time to initialize, or that require extremely low latency for all invocations, provisioned concurrency enables you to pre\-initialize instances of your function and keep them running at all times\. Lambda integrates with Application Auto Scaling to support autoscaling for provisioned concurrency based on utilization\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) - -For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. - -## Function URLs - -Lambda offers built\-in HTTP\(S\) endpoint support through *function URLs*\. With function URLs, you can assign a dedicated HTTP endpoint to your Lambda function\. When your function URL is configured, you can use it to invoke your function through a web browser, curl, Postman, or any HTTP client\. - -You can add a function URL to an existing function, or create a new function with a function URL\. For more information, see [Invoking Lambda function URLs](urls-invocation.md)\. - -## Asynchronous invocation - -When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With asynchronous invocation, Lambda queues the event for processing and returns a response immediately\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-async.png) - -For asynchronous invocations, Lambda handles retries if the function returns an error or is throttled\. To customize this behavior, you can configure error handling settings on a function, version, or alias\. You can also configure Lambda to send events that failed processing to a dead\-letter queue, or to send a record of any invocation to a [destination](#gettingstarted-features-destinations)\. - -For more information, see [Asynchronous invocation](invocation-async.md)\. - -## Event source mappings - -To process items from a stream or queue, you can create an *event source mapping*\. An event source mapping is a resource in Lambda that reads items from an Amazon Simple Queue Service \(Amazon SQS\) queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends the items to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png) - -Event source mappings maintain a local queue of unprocessed items and handle retries if the function returns an error or is throttled\. You can configure an event source mapping to customize batching behavior and error handling, or to send a record of items that fail processing to a destination\. - -For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md)\. - -## Destinations - -A destination is an AWS resource that receives invocation records for a function\. For [asynchronous invocation](#gettingstarted-features-async), you can configure Lambda to send invocation records to a queue, topic, function, or event bus\. You can configure separate destinations for successful invocations and events that failed processing\. The invocation record contains details about the event, the function's response, and the reason that the record was sent\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-destinations.png) - -For [event source mappings](#gettingstarted-features-eventsourcemapping) that read from streams, you can configure Lambda to send a record of batches that failed processing to a queue or topic\. A failure record for an event source mapping contains metadata about the batch, and it points to the items in the stream\. - -For more information, see [Configuring destinations for asynchronous invocation](invocation-async.md#invocation-async-destinations) and the error handling sections of [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) and [Using AWS Lambda with Amazon Kinesis](with-kinesis.md)\. - -## Function blueprints - -When you create a function in the Lambda console, you can choose to start from scratch, use a blueprint, use a [container image](gettingstarted-package.md#gettingstarted-package-images), or deploy an application from the [AWS Serverless Application Repository](https://docs.aws.amazon.com/serverlessrepo/latest/devguide/what-is-serverlessrepo.html)\. A blueprint provides sample code that shows how to use Lambda with an AWS service or a popular third\-party application\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. - -Blueprints are provided for use under the [Amazon Software License](http://aws.amazon.com/asl/)\. They are available only in the Lambda console\. - -## Testing and deployment tools - -Lambda supports deploying code as is or as [container images](gettingstarted-package.md#gettingstarted-package-images)\. You can use AWS services and popular community tools like the Docker command line interface \(CLI\) to author, build, and deploy your Lambda functions\. To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. - -The [AWS CLI](lambda-settingup.md#lambda-settingup-awscli) and [SAM CLI](lambda-settingup.md#lambda-settingup-samcli) are command line tools for managing Lambda application stacks\. In addition to commands for managing application stacks with the AWS CloudFormation API, the AWS CLI supports higher\-level commands that simplify tasks like uploading deployment packages and updating templates\. The AWS SAM CLI provides additional functionality, including validating templates, testing locally, and integrating with CI/CD systems\. -+ [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) -+ [Testing and debugging serverless applications with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html) -+ [Deploying serverless applications using CI/CD systems with AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) - -## Application templates - -You can use the Lambda console to create an application with a continuous delivery pipeline\. Application templates in the Lambda console include code for one or more functions, an application template that defines functions and supporting AWS resources, and an infrastructure template that defines an AWS CodePipeline pipeline\. The pipeline has build and deploy stages that run every time you push changes to the included Git repository\. - -Application templates are provided for use under the [MIT No Attribution](https://spdx.org/licenses/MIT-0.html) license\. They are available only in the Lambda console\. - -For more information, see [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-images.md b/doc_source/gettingstarted-images.md deleted file mode 100644 index 933f983b..00000000 --- a/doc_source/gettingstarted-images.md +++ /dev/null @@ -1,332 +0,0 @@ -# Deploying Lambda functions as container images - -When you create a Lambda function, you package your function code into a deployment package\. Lambda supports two types of deployment packages: [container images](gettingstarted-package.md#gettingstarted-package-images) and [\.zip file archives](gettingstarted-package.md#gettingstarted-package-zip)\. The workflow to create a function is different depending on the deployment package type\. To configure a function defined as a \.zip file archive, see [Deploying Lambda functions as \.zip file archives](configuration-function-zip.md)\. - -You can use the Lambda console and the Lambda API to create a function defined as a container image, update and test the image code, and configure other function settings\. - -**Note** -You cannot convert an existing container image function to use a \.zip file archive\. You must create a new function\. - -When you select an image using an image tag, Lambda translates the tag to the underlying image digest\. To retrieve the digest for your image, use the [GetFunctionConfiguration](API_GetFunctionConfiguration.md) API operation\. To update the function to a newer image version, you must use the Lambda console to [update the function code](#configuration-images-update), or use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. Configuration operations such as [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) do not update the function's container image\. - -**Topics** -- [Deploying Lambda functions as container images](#deploying-lambda-functions-as-container-images) - - [Prerequisites](#prerequisites) - - [Permissions](#permissions) - - [Amazon ECR permissions](#amazon-ecr-permissions) - - [Amazon ECR cross-account permissions](#amazon-ecr-cross-account-permissions) - - [Creating the function](#creating-the-function) - - [Testing the function](#testing-the-function) - - [Overriding container settings](#overriding-container-settings) - - [Updating function code](#updating-function-code) - - [Function version $LATEST](#function-version-latest) - - [Using the Lambda API](#using-the-lambda-api) - - [AWS CloudFormation](#aws-cloudformation) - -## Prerequisites - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -Before you create the function, you must [create a container image and upload it to Amazon ECR](images-create.md)\. - -## Permissions - -Make sure that the permissions for the IAM user or role that creates the function contain the AWS managed policies `GetRepositoryPolicy` and `SetRepositoryPolicy`\. - -For example, use the IAM console to create a role with the following policy: - -``` -{ -"Version": "2012-10-17", -"Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": ["ecr:SetRepositoryPolicy","ecr:GetRepositoryPolicy"], - "Resource": "arn:aws:ecr:::repository//" - } -] -} -``` - -### Amazon ECR permissions - -For a function in the same account as the container image in Amazon ECR, you can add `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` permissions to your Amazon ECR repository\. The following example shows the minimum policy: - -``` -{ - "Sid": "LambdaECRImageRetrievalPolicy", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ] - } -``` - -For more information about Amazon ECR repository permissions, see [Repository policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html) in the *Amazon Elastic Container Registry User Guide*\. - -If the Amazon ECR repository does not include these permissions, Lambda adds `ecr:BatchGetImage` and `ecr:GetDownloadUrlForLayer` to the container image repository permissions\. Lambda can add these permissions only if the Principal calling Lambda has `ecr:getRepositoryPolicy` and `ecr:setRepositoryPolicy` permissions\. - -To view or edit your Amazon ECR repository permissions, follow the directions in [Setting a repository policy statement](https://docs.aws.amazon.com/AmazonECR/latest/userguide/set-repository-policy.html) in the *Amazon Elastic Container Registry User Guide*\. - -#### Amazon ECR cross\-account permissions - -A different account in the same region can create a function that uses a container image owned by your account\. In the following example, your Amazon ECR repository permissions policy needs the following statements to grant access to account number 123456789012\. -+ **CrossAccountPermission** – Allows account 123456789012 to create and update Lambda functions that use images from this ECR repository\. -+ **LambdaECRImageCrossAccountRetrievalPolicy** – Lambda will eventually set a function's state to inactive if it is not invoked for an extended period\. This statement is required so that Lambda can retrieve the container image for optimization and caching on behalf of the function owned by 123456789012\. - -**Example Add cross\-account permission to your repository** - -``` -{"Version": "2012-10-17", - "Statement": [ - { - "Sid": "CrossAccountPermission", - "Effect": "Allow", - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Principal": { - "AWS": "arn:aws:iam:::root" - } - }, - { - "Sid": "LambdaECRImageCrossAccountRetrievalPolicy", - "Effect": "Allow", - "Action": [ - "ecr:BatchGetImage", - "ecr:GetDownloadUrlForLayer" - ], - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Condition": { - "StringLike": { - "aws:sourceARN": - "arn:aws:lambda:::function:*" - } - } - } - ] - } -``` - -To give access to multiple accounts, you add the account IDs to the Principal list in the `CrossAccountPermission` policy and to the Condition evaluation list in the `LambdaECRImageCrossAccountRetrievalPolicy`\. - -If you are working with multiple accounts in an AWS Organization, we recommend that you enumerate each account ID in the ECR permissions policy\. This approach aligns with the AWS security best practice of setting narrow permissions in IAM policies\. - -## Creating the function - -To create a function defined as a container image, you must first [create the image](images-create.md) and then store the image in the Amazon ECR repository\. - -**To create the function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Choose the **Container image** option\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter the function name\. - - 1. For **Container image URI**, provide a container image that is compatible with the instruction set architecture that you want for your function code\. - - You can enter the Amazon ECR image URI or browse for the Amazon ECR image\. - + Enter the Amazon ECR image URI\. - + Or, to browse an Amazon ECR repository for the image, choose **Browse images**\. Select the Amazon ECR repository from the dropdown list, and then select the image\. - -1. \(Optional\) To override configuration settings that are included in the Dockerfile, expand **Container image overrides**\. You can override any of the following settings: - + For **Entrypoint**, enter the full path of the runtime executable\. The following example shows an entrypoint for a Node\.js function: - - ``` - "/usr/bin/npx", "aws-lambda-ric" - ``` - + For **Command**, enter additional parameters to pass in to the image with **Entrypoint**\. The following example shows a command for a Node\.js function: - - ``` - "app.handler" - ``` - + For **Working directory**, enter the full path of the working directory for the function\. The following example shows the working directory for an AWS base image for Lambda: - - ``` - "/var/task" - ``` -**Note** -For the override settings, make sure that you enclose each string in quotation marks \(" "\)\. - -1. \(Optional\) For **Architecture**, choose the instruction set architecture for the function\. The default architecture is x86\_64\. Note: when you build the container image for your function, make sure that it is compatible with this [instruction set architecture](foundation-arch.md)\. - -1. \(Optional\) Under **Permissions**, expand **Change default execution role**\. Then, choose to create a new **Execution role**, or to use an existing role\. - -1. Choose **Create function**\. - -Lambda creates your function and an [execution role](lambda-intro-execution-role.md) that grants the function permission to upload logs\. Lambda assumes the execution role when you invoke your function, and uses the execution role to create credentials for the AWS SDK and to read data from event sources\. - -When you deploy code as a container image to a Lambda function, the image undergoes an optimization process for running on Lambda\. This process can take a few seconds, during which the function is in pending state\. When the optimization process completes, the function enters the active state\. - -## Testing the function - -Invoke your Lambda function using the sample event data provided in the console\. - -**To invoke a function** - -1. After selecting your function, choose the **Test** tab\. - -1. In the **Test event** section, choose **New event**\. In **Template**, leave the default **hello\-world** option\. Enter a **Name** for this test and note the following sample event template: - - ``` - { - "key1": "value1", - "key2": "value2", - "key3": "value3" - } - ``` - -1. Choose **Save changes**, and then choose **Test**\. Each user can create up to 10 test events per function\. Those test events are not available to other users\. - - Lambda runs your function on your behalf\. The function handler receives and then processes the sample event\. - -1. Upon successful completion, view the results in the console\. - + The **Execution result** shows the execution status as **succeeded**\. To view the function execution results, expand **Details**\. Note that the **logs** link opens the **Log groups** page in the CloudWatch console\. - + The **Summary** section shows the key information reported in the **Log output** section \(the *REPORT* line in the execution log\)\. - + The **Log output** section shows the log that Lambda generates for each invocation\. The function writes these logs to CloudWatch\. The Lambda console shows these logs for your convenience\. Choose **Click here** to add logs to the CloudWatch log group and open the **Log groups** page in the CloudWatch console\. - -1. Run the function \(choose **Test**\) a few more times to gather some metrics that you can view in the next step\. - -1. Choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. - -## Overriding container settings - -You can use the Lambda console or the Lambda API to override the following container image settings: -+ ENTRYPOINT – Specifies the absolute path of the entry point to the application\. -+ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. -+ WORKDIR – Specifies the absolute path of the working directory\. -+ ENV – Specifies an environment variable for the Lambda function\. - -Any values that you provide in the Lambda console or the Lambda API override the values [in the Dockerfile](images-create.md#images-parms)\. - -**To override the configuration values in the container image** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update\. - -1. Under **Image configuration**, choose **Edit**\. - -1. Enter new values for any of the override settings, and then choose **Save**\. - -1. \(Optional\) To add or override environment variables, under **Environment variables**, choose **Edit**\. - - For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. - -## Updating function code - -After you deploy a container image to a function, the image is read\-only\. To update the function code, you must first deploy a new image version\. [Create a new image version](images-create.md), and then store the image in the Amazon ECR repository\. - -**To configure the function to use an updated container image** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to update\. - -1. Under **Image**, choose **Deploy new image**\. - -1. Choose **Browse images**\. - -1. In the **Select container image** dialog box, select the Amazon ECR repository from the dropdown list, and then select the new image version\. - -1. Choose **Save**\. - -### Function version $LATEST - -When you publish a function version, the code and most of the configuration settings are locked to maintain a consistent experience for users of that version\. You can change the code and many configuration settings only on the unpublished version of the function\. By default, the console displays configuration information for the unpublished version of the function\. To view the versions of a function, choose **Qualifiers**\. The unpublished version is named **$LATEST**\. - -Note that Amazon Elastic Container Registry \(Amazon ECR\) also uses a *latest* tag to denote the latest version of the container image\. Be careful not to confuse this tag with the **$LATEST** function version\. - -For more information about managing versions, see [Lambda function versions](configuration-versions.md)\. - -## Using the Lambda API - -To manage functions defined as container images, use the following API operations: -+ [CreateFunction](API_CreateFunction.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - -To create a function defined as container image, use the `create-function` command\. Set the `package-type` to `Image` and specify your container image URI using the `code` parameter\. - -When you create the function, you can specify the instruction set architecture\. The default architecture is `x86-64`\. Make sure that the code in your container image is compatible with the architecture\. - - You can create the function from the same account as the container registry or from a different account in the same region as the container registry in Amazon ECR\. For cross\-account access, adjust the [Amazon ECR permissions](#configuration-images-xaccount-permissions) for the image\. - -``` -aws lambda create-function --region --function-name my-function \ - --package-type Image \ - --code ImageUri= \ - --role arn:aws:iam:::role/lambda-ex -``` - -To update the function code, use the `update-function-code` command\. Specify the container image location using the `image-uri` parameter\. - -**Note** -You cannot change the `package-type` of a function\. - -``` -aws lambda update-function-code --region --function-name my-function \ - --image-uri \ -``` - -To update the function parameters, use the `update-function-configuration` operation\. Specify `EntryPoint` and `Command` as arrays of strings, and `WorkingDirectory` as a string\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---image-config '{"EntryPoint": ["/usr/bin/npx", "aws-lambda-ric"], \ - "Command": ["app.handler"] , \ - "WorkingDirectory": "/var/task"}' -``` - -## AWS CloudFormation - -You can use AWS CloudFormation to create Lambda functions defined as container images\. In your AWS CloudFormation template, the `AWS::Lambda::Function` resource specifies the Lambda function\. For descriptions of the properties in the `AWS::Lambda::Function` resource, see [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) in the *AWS CloudFormation User Guide*\. - -In the `AWS::Lambda::Function` resource, set the following properties to create a function defined as a container image: -+ AWS::Lambda::Function - + PackageType – Set to `Image`\. - + Code – Enter your container image URI in the `ImageUri` field\. - + ImageConfig – \(Optional\) Override the container image configuration properties\. - -The `ImageConfig` property in `AWS::Lambda::Function` contains the following fields: -+ Command – Specifies parameters that you want to pass in with `EntryPoint`\. -+ EntryPoint – Specifies the entry point to the application\. -+ WorkingDirectory – Specifies the working directory\. - -**Note** -If you declare an `ImageConfig` property in your AWS CloudFormation template, you must provide values for all three of the `ImageConfig` properties\. - -For more information, see [ImageConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/gettingstarted-limits.md b/doc_source/gettingstarted-limits.md deleted file mode 100644 index fb7c64d0..00000000 --- a/doc_source/gettingstarted-limits.md +++ /dev/null @@ -1,60 +0,0 @@ -# Lambda quotas - -**Important** -New AWS accounts have reduced concurrency and memory quotas\. AWS raises these quotas automatically based on your usage\. You can also [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)\. - -## Compute and storage - -Lambda sets quotas for the amount of compute and storage resources that you can use to run and store functions\. The following quotas apply per AWS Region and can be increased\. For more information, see [Requesting a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) in the *Service Quotas User Guide*\. - - -| Resource | Default quota | Can be increased up to | -| --- | --- | --- | -| Concurrent executions | 1,000 | Tens of thousands | -| Storage for uploaded functions \(\.zip file archives\) and layers\. Each function version and layer version consumes storage\. For best practices on managing your code storage, see [Monitoring Lambda code storage](https://docs.aws.amazon.com/lambda/latest/operatorguide/code-storage.html) in the *Lambda Operator Guide*\. | 75 GB | Terabytes | -| Storage for functions defined as container images\. These images are stored in Amazon ECR\. | See [Amazon ECR service quotas](https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html)\. | | -| [Elastic network interfaces per virtual private cloud \(VPC\)](configuration-vpc.md) This quota is shared with other services, such as Amazon Elastic File System \(Amazon EFS\)\. See [Amazon VPC quotas](https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html)\. | 250 | Hundreds | - -For details on concurrency and how Lambda scales your function concurrency in response to traffic, see [Lambda function scaling](invocation-scaling.md)\. - -## Function configuration, deployment, and execution - -The following quotas apply to function configuration, deployment, and execution\. They cannot be changed\. - -**Note** -The Lambda documentation, log messages, and console use the abbreviation MB \(rather than MiB\) to refer to 1024 KB\. - - -| Resource | Quota | -| --- | --- | -| Function [memory allocation](configuration-function-common.md) | 128 MB to 10,240 MB, in 1\-MB increments\. **Note:** Lambda allocates CPU power in proportion to the amount of memory configured\. You can increase or decrease the memory and CPU power allocated to your function using the **Memory \(MB\)** setting\. At 1,769 MB, a function has the equivalent of one vCPU\. | -| Function timeout | 900 seconds \(15 minutes\) | -| Function [environment variables](configuration-envvars.md) | 4 KB, for all environment variables associated with the function, in aggregate | -| Function [resource\-based policy](access-control-resource-based.md) | 20 KB | -| Function [layers](configuration-layers.md) | five layers | -| Function [burst concurrency](invocation-scaling.md) | 500 \- 3000 \(varies per Region\) | -| [Invocation payload](lambda-invocation.md) \(request and response\) | 6 MB each for request and response \(synchronous\) 256 KB \(asynchronous\) | -| [Deployment package \(\.zip file archive\)](gettingstarted-package.md) size | 50 MB \(zipped, for direct upload\) 250 MB \(unzipped\) This quota applies to all the files you upload, including layers and custom runtimes\. 3 MB \(console editor\) | -| [Container image](images-create.md) code package size | 10 GB | -| Test events \(console editor\) | 10 | -| `/tmp` directory storage | Between 512 MB and 10,240 MB, in 1\-MB increments | -| File descriptors | 1,024 | -| Execution processes/threads | 1,024 | - -## Lambda API requests - -The following quotas are associated with Lambda API requests\. - - -| Resource | Quota | -| --- | --- | -| Invocation requests per Region \(requests per second\) | 10 x concurrent executions quota \([synchronous](invocation-sync.md), all sources\) 10 x concurrent executions quota \([asynchronous](invocation-async.md), non\-AWS sources\) | -| Invocation requests per Region \(requests per second\) for asynchronous [AWS service sources](lambda-services.md) | Unlimited requests accepted\. Execution rate is based on concurrency available to the function\. See [Asynchronous invocation](invocation-async.md)\. | -| Invocation requests per function version or alias \(requests per second\) | 10 x allocated [provisioned concurrency](configuration-concurrency.md) This quota applies only to functions that use provisioned concurrency\. | -| [GetFunction](API_GetFunction.md) API requests | 100 requests per second | -| [GetPolicy](API_GetPolicy.md) API requests | 15 requests per second | -| Remainder of the control plane API requests \(excludes invocation, GetFunction, and GetPolicy requests\) | 15 requests per second | - -## Other services - -Quotas for other services, such as AWS Identity and Access Management \(IAM\), Amazon CloudFront \(Lambda@Edge\), and Amazon Virtual Private Cloud \(Amazon VPC\), can impact your Lambda functions\. For more information, see [AWS service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) in the *Amazon Web Services General Reference*, and [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/gettingstarted-package.md b/doc_source/gettingstarted-package.md deleted file mode 100644 index 4cf6f175..00000000 --- a/doc_source/gettingstarted-package.md +++ /dev/null @@ -1,117 +0,0 @@ -# Lambda deployment packages - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -**Topics** -+ [Container images](#gettingstarted-package-images) -+ [\.zip file archives](#gettingstarted-package-zip) -+ [Layers](#gettingstarted-package-layers) -+ [Using other AWS services to build a deployment package](#gettingstarted-package-awsother) - -## Container images - -A container image includes the base operating system, the runtime, Lambda extensions, your application code and its dependencies\. You can also add static data, such as machine learning models, into the image\. - -Lambda provides a set of open\-source base images that you can use to build your container image\. To create and test container images, you can use the AWS Serverless Application Model \(AWS SAM\) command line interface \(CLI\) or native container tools such as the Docker CLI\. - -You upload your container images to Amazon Elastic Container Registry \(Amazon ECR\), a managed AWS container image registry service\. To deploy the image to your function, you specify the Amazon ECR image URL using the Lambda console, the Lambda API, command line tools, or the AWS SDKs\. - -For more information about Lambda container images, see [Creating Lambda container images](images-create.md)\. - -**Note** -Container images aren't supported for Lambda functions in the Middle East \(UAE\) Region\. - -## \.zip file archives - -A \.zip file archive includes your application code and its dependencies\. When you author functions using the Lambda console or a toolkit, Lambda automatically creates a \.zip file archive of your code\. - -When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. - -You can upload a \.zip file as your deployment package using the Lambda console, AWS Command Line Interface \(AWS CLI\), or to an Amazon Simple Storage Service \(Amazon S3\) bucket\. - -### Using the Lambda console - -The following steps demonstrate how to upload a \.zip file as your deployment package using the Lambda console\. - -**To upload a \.zip file on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) on the Lambda console\. - -1. Select a function\. - -1. In the **Code Source** pane, choose **Upload from** and then **\.zip file**\. - -1. Choose **Upload** to select your local \.zip file\. - -1. Choose **Save**\. - -### Using the AWS CLI - -You can upload a \.zip file as your deployment package using the AWS Command Line Interface \(AWS CLI\)\. For language\-specific instructions, see the following topics\. - ------- -#### [ Node\.js ] - -[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) - ------- -#### [ Python ] - - [Deploy Python Lambda functions with \.zip file archives](python-package.md) - ------- -#### [ Ruby ] - - [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) - ------- -#### [ Java ] - - [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) - ------- -#### [ Go ] - - [Deploy Go Lambda functions with \.zip file archives](golang-package.md) - ------- -#### [ C\# ] - - [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) - ------- -#### [ PowerShell ] - - [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ------- - -### Using Amazon S3 - -You can upload a \.zip file as your deployment package using Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using other AWS services to build a deployment package](#gettingstarted-package-awsother)\. - -## Layers - -If you deploy your function code using a \.zip file archive, you can use Lambda layers as a distribution mechanism for libraries, custom runtimes, and other function dependencies\. Layers enable you to manage your in\-development function code independently from the unchanging code and resources that it uses\. You can configure your function to use layers that you create, layers that AWS provides, or layers from other AWS customers\. - -You do not use layers with container images\. Instead, you package your preferred runtime, libraries, and other dependencies into the container image when you build the image\. - -For more information about layers, see [Creating and sharing Lambda layers](configuration-layers.md)\. - -## Using other AWS services to build a deployment package - -The following section describes other AWS services you can use to package dependencies for your Lambda function\. - -### Deployment packages with C or C\+\+ libraries - -If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. - -For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. - -### Deployment packages over 50 MB - -If your deployment package is larger than 50 MB, upload your function code and dependencies to an Amazon S3 bucket\. - -You can create a deployment package and upload the \.zip file to your Amazon S3 bucket in the AWS Region where you want to create a Lambda function\. When you create your Lambda function, specify the S3 bucket name and object key name on the Lambda console, or using the AWS CLI\. - -To create a bucket using the Amazon S3 console, see [How do I create an S3 Bucket?](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html) in the *Amazon Simple Storage Service Console User Guide*\. \ No newline at end of file diff --git a/doc_source/glossary.md b/doc_source/glossary.md deleted file mode 100644 index 0fccc48a..00000000 --- a/doc_source/glossary.md +++ /dev/null @@ -1,3 +0,0 @@ -# AWS glossary - -For the latest AWS terminology, see the [AWS glossary](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html) in the *AWS General Reference*\. \ No newline at end of file diff --git a/doc_source/go-image.md b/doc_source/go-image.md deleted file mode 100644 index d599bfbf..00000000 --- a/doc_source/go-image.md +++ /dev/null @@ -1,190 +0,0 @@ -# Deploy Go Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Go function: -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for Go](#go-image-base) -+ [Go runtime interface clients](#go-image-clients) -+ [Using the Go:1\.x base image](#go-image-v1) -+ [Create a Go image from the `provided.al2` base image](#go-image-al2) -+ [Create a Go image from an alternative base image](#go-image-other) -+ [Deploy the container image](#go-image-deploy) - -## AWS base images for Go - -AWS provides the following base image for Go: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| 1 | Go 1\.x | Amazon Linux | [Dockerfile for Go 1\.x on GitHub](https://github.com/aws/aws-lambda-base-images/blob/go1.x/Dockerfile.go1.x) | | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/go](https://gallery.ecr.aws/lambda/go) - -## Go runtime interface clients - -AWS does not provide a separate runtime interface client for Go\. The `aws-lambda-go/lambda` package includes an implementation of the runtime interface\. - -## Using the Go:1\.x base image - -For instructions on how to use the base image for Go:1\.x, choose the **usage** tab on [Lambda base images for Go](https://gallery.ecr.aws/lambda/go) in the *Amazon ECR repository*\. - -## Create a Go image from the `provided.al2` base image - -To build a container image for Go that runs on Amazon Linux 2, use the `provided.al2` base image\. For more information about this base image, see [provided](https://gallery.ecr.aws/lambda/provided) in the Amazon ECR public gallery\. - -You include the `aws-lambda-go/lambda` package with your Go handler\. This package implements the programming model for Go, including the runtime interface client\. The `provided.al2` base image also includes the runtime interface emulator\. - -**To build and deploy a Go function with the `provided.al2` base image\.** - -Note that the first three steps are identical whether you deploy your function as a \.zip file archive or as a container image\. - -1. On your local machine, create a project directory for your new function\. - -1. From your project folder, run the following command to install the required Lambda Go libraries\. - - ``` - go get github.com/aws/aws-lambda-go - ``` - - For a description of the Lambda Go libraries libraries, see [Building Lambda functions with Go](lambda-golang.md)\. - -1. Create your [Go handler code](golang-handler.md) and include the `aws-lambda-go/lambda` package\. - -1. Use a text editor to create a Dockerfile in your project directory\. The following example Dockerfile uses the AWS `provided.al2` base image\. - - ``` - FROM public.ecr.aws/lambda/provided:al2 as build - # install compiler - RUN yum install -y golang - RUN go env -w GOPROXY=direct - # cache dependencies - ADD go.mod go.sum ./ - RUN go mod download - # build - ADD . . - RUN go build -o /main - # copy artifacts to a clean image - FROM public.ecr.aws/lambda/provided:al2 - COPY --from=build /main /main - ENTRYPOINT [ "/main" ] - ``` - -1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. - - ``` - docker build -t hello-world . - ``` - -1. Authenticate the Docker CLI to your Amazon ECR registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -Now that your container image resides in the Amazon ECR container registry, you can [create](gettingstarted-images.md) the Lambda function and deploy the image\. - -## Create a Go image from an alternative base image - -You can build a container image for Go from an alternative base image\. The following example Dockerfile uses [alpine](https://gallery.ecr.aws/h1a5s9h8/alpine) as the base image\. - -``` -FROM alpine as build -# install build tools -RUN apk add go git -RUN go env -w GOPROXY=direct -# cache dependencies -ADD go.mod go.sum ./ -RUN go mod download -# build -ADD . . -RUN go build -o /main -# copy artifacts to a clean image -FROM alpine -COPY --from=build /main /main -ENTRYPOINT [ "/main" ] -``` - -The steps are the same as described for a `provided.al2` base image, with one additional consideration: if you want to add the RIE to your image, you need to follow these additional steps before you run the `docker build` command\. For more information about testing your image locally with the RIE, see [Testing Lambda container images locally](images-test.md)\. - -**To add RIE to the image** - -1. In your Dockerfile, replace the ENTRYPOINT instruction with the following content: - - ``` - # (Optional) Add Lambda Runtime Interface Emulator and use a script in the ENTRYPOINT for simpler local runs - ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/bin/aws-lambda-rie - RUN chmod 755 /usr/bin/aws-lambda-rie - COPY entry.sh / - RUN chmod 755 /entry.sh - ENTRYPOINT [ "/entry.sh" ] - ``` - -1. Use a text editor to create file `entry.sh` in your project directory, containing the following content: - - ``` - #!/bin/sh - if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/bin/aws-lambda-rie "$@" - else - exec "$@" - fi - ``` - -If you do not want to add the RIE to your image, you can test your image locally without adding RIE to the image\. - -**To test locally without adding RIE to the image** - -1. From your project directory, run the following command to download the RIE from GitHub and install it on your local machine\. - - ``` - mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie - ``` - -1. Run your Lambda image function using the `docker run` command\. In the following example, `/main` is the path to the function entry point\. - - ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda --entrypoint /aws-lambda/aws-lambda-rie -p 9000:8080 myfunction:latest /main - ``` - - This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. - -1. Post an event to the following endpoint using a `curl` command: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - - This command invokes the function running in the container image and returns a response\. - -Now that your container image resides in the Amazon ECR container registry, you can you can [create](gettingstarted-images.md) the Lambda function and deploy the image\. - -## Deploy the container image - -For a new function, you deploy the Go image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/golang-context.md b/doc_source/golang-context.md deleted file mode 100644 index e2898688..00000000 --- a/doc_source/golang-context.md +++ /dev/null @@ -1,84 +0,0 @@ -# AWS Lambda context object in Go - -When Lambda runs your function, it passes a context object to the [handler](golang-handler.md)\. This object provides methods and properties with information about the invocation, function, and execution environment\. - -The Lambda context library provides the following global variables, methods, and properties\. - -**Global variables** -+ `FunctionName` – The name of the Lambda function\. -+ `FunctionVersion` – The [version](configuration-versions.md) of the function\. -+ `MemoryLimitInMB` – The amount of memory that's allocated for the function\. -+ `LogGroupName` – The log group for the function\. -+ `LogStreamName` – The log stream for the function instance\. - -**Context methods** -+ `Deadline` – Returns the date that the execution times out, in Unix time milliseconds\. - -**Context properties** -+ `InvokedFunctionArn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `AwsRequestID` – The identifier of the invocation request\. -+ `Identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. -+ `ClientContext` – \(mobile apps\) Client context that's provided to Lambda by the client application\. - -## Accessing invoke context information - -Lambda functions have access to metadata about their environment and the invocation request\. This can be accessed at [Package context](https://golang.org/pkg/context/)\. Should your handler include `context.Context` as a parameter, Lambda will insert information about your function into the context's `Value` property\. Note that you need to import the `lambdacontext` library to access the contents of the `context.Context` object\. - -``` -package main - -import ( - "context" - "log" - "github.com/aws/aws-lambda-go/lambda" - "github.com/aws/aws-lambda-go/lambdacontext" -) - -func CognitoHandler(ctx context.Context) { - lc, _ := lambdacontext.FromContext(ctx) - log.Print(lc.Identity.CognitoIdentityPoolID) -} - -func main() { - lambda.Start(CognitoHandler) -} -``` - -In the example above, `lc` is the variable used to consume the information that the context object captured and `log.Print(lc.Identity.CognitoIdentityPoolID)` prints that information, in this case, the CognitoIdentityPoolID\. - -The following example introduces how to use the context object to monitor how long your Lambda function takes to complete\. This allows you to analyze performance expectations and adjust your function code accordingly, if needed\. - -``` -package main - -import ( - "context" - "log" - "time" - "github.com/aws/aws-lambda-go/lambda" -) - -func LongRunningHandler(ctx context.Context) (string, error) { - - deadline, _ := ctx.Deadline() - deadline = deadline.Add(-100 * time.Millisecond) - timeoutChannel := time.After(time.Until(deadline)) - - for { - - select { - - case <- timeoutChannel: - return "Finished before timing out.", nil - - default: - log.Print("hello!") - time.Sleep(50 * time.Millisecond) - } - } -} - -func main() { - lambda.Start(LongRunningHandler) -} -``` \ No newline at end of file diff --git a/doc_source/golang-envvars.md b/doc_source/golang-envvars.md deleted file mode 100644 index ad97c3f5..00000000 --- a/doc_source/golang-envvars.md +++ /dev/null @@ -1,22 +0,0 @@ -# Using environment variables - -To access [environment variables](configuration-envvars.md) in Go, use the [Getenv](https://golang.org/pkg/os/#Getenv) function\. - -The following explains how to do this\. Note that the function imports the [fmt](https://golang.org/pkg/fmt/) package to format the printed results and the [os](https://golang.org/pkg/os/) package, a platform\-independent system interface that allows you to access environment variables\. - -``` -package main - -import ( - "fmt" - "os" - "github.com/aws/aws-lambda-go/lambda" -) - -func main() { - fmt.Printf("%s is %s. years old\n", os.Getenv("NAME"), os.Getenv("AGE")) - -} -``` - -For a list of environment variables that are set by the Lambda runtime, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. \ No newline at end of file diff --git a/doc_source/golang-exceptions.md b/doc_source/golang-exceptions.md deleted file mode 100644 index d3794b86..00000000 --- a/doc_source/golang-exceptions.md +++ /dev/null @@ -1,138 +0,0 @@ -# AWS Lambda function errors in Go - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the Go runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Creating a function that returns exceptions](#go-exceptions-createfunction) -+ [How it works](#go-exceptions-how) -+ [Using the Lambda console](#go-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#go-exceptions-cli) -+ [Error handling in other AWS services](#go-exceptions-other-services) -+ [What's next?](#go-exceptions-next-up) - -## Creating a function that returns exceptions - -The following code sample demonstrates custom error handling that raises an exception directly from a Lambda function and handles it directly\. Note that custom errors in Go must import the `errors` module\. - -``` -package main - -import ( - "errors" - "github.com/aws/aws-lambda-go/lambda" -) - -func OnlyErrors() error { - return errors.New("something went wrong!") -} - -func main() { - lambda.Start(OnlyErrors) -} -``` - -Which returns the following: - -``` -{ - "errorMessage": "something went wrong!", - "errorType": "errorString" -} -``` - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting Go code in AWS Lambda](golang-tracing.md)\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Go](golang-logging.md) page\. \ No newline at end of file diff --git a/doc_source/golang-handler.md b/doc_source/golang-handler.md deleted file mode 100644 index a797e03f..00000000 --- a/doc_source/golang-handler.md +++ /dev/null @@ -1,185 +0,0 @@ -# AWS Lambda function handler in Go - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -A Lambda function written in [Go](https://golang.org/) is authored as a Go executable\. In your Lambda function code, you need to include the [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) package, which implements the Lambda programming model for Go\. In addition, you need to implement handler function code and a `main()` function\. - -``` -package main - -import ( - "fmt" - "context" - "github.com/aws/aws-lambda-go/lambda" -) - -type MyEvent struct { - Name string `json:"name"` -} - -func HandleRequest(ctx context.Context, name MyEvent) (string, error) { - return fmt.Sprintf("Hello %s!", name.Name ), nil -} - -func main() { - lambda.Start(HandleRequest) -} -``` - -Note the following: -+ **package main**: In Go, the package containing `func main()` must always be named `main`\. -+ **import**: Use this to include the libraries your Lambda function requires\. In this instance, it includes: - + **context: **[AWS Lambda context object in Go](golang-context.md)\. - + **fmt:** The Go [Formatting](https://golang.org/pkg/fmt/) object used to format the return value of your function\. - + **github\.com/aws/aws\-lambda\-go/lambda:** As mentioned previously, implements the Lambda programming model for Go\. -+ **func HandleRequest\(ctx context\.Context, name MyEvent\) \(string, error\)**: This is your Lambda handler signature and includes the code which will be executed\. In addition, the parameters included denote the following: - + **ctx context\.Context**: Provides runtime information for your Lambda function invocation\. `ctx` is the variable you declare to leverage the information available via [AWS Lambda context object in Go](golang-context.md)\. - + **name MyEvent**: An input type with a variable name of `name` whose value will be returned in the `return` statement\. - + **string, error**: Returns two values: string for success and standard [error](https://golang.org/pkg/builtin/#error) information\. For more information on custom error handling, see [AWS Lambda function errors in Go](golang-exceptions.md)\. - + **return fmt\.Sprintf\("Hello %s\!", name\), nil**: Simply returns a formatted "Hello" greeting with the name you supplied in the input event\. `nil` indicates there were no errors and the function executed successfully\. -+ **func main\(\)**: The entry point that runs your Lambda function code\. This is required\. - - By adding `lambda.Start(HandleRequest)` between `func main(){}` code brackets, your Lambda function will be executed\. Per Go language standards, the opening bracket, `{` must be placed directly at end the of the `main` function signature\. - -## Naming - -When you configure a function in Go, the value of the handler setting is the executable file name\. For example, if you set the value of the handler to `Handler`, Lambda will call the `main()` function in the `Handler` executable file\. - -To change the function handler name in the Lambda console, on the **Runtime** settings pane, choose **edit**\. - -## Lambda function handler using structured types - -In the example above, the input type was a simple string\. But you can also pass in structured events to your function handler: - -``` -package main - -import ( - "fmt" - "github.com/aws/aws-lambda-go/lambda" -) - -type MyEvent struct { - Name string `json:"What is your name?"` - Age int `json:"How old are you?"` -} - -type MyResponse struct { - Message string `json:"Answer:"` -} - -func HandleLambdaEvent(event MyEvent) (MyResponse, error) { - return MyResponse{Message: fmt.Sprintf("%s is %d years old!", event.Name, event.Age)}, nil -} - -func main() { - lambda.Start(HandleLambdaEvent) -} -``` - -Your request would then look like this: - -``` -# request -{ - "What is your name?": "Jim", - "How old are you?": 33 -} -``` - -And the response would look like this: - -``` -# response -{ - "Answer": "Jim is 33 years old!" -} -``` - -To be exported, field names in the event struct must be capitalized\. For more information on handling events from AWS event sources, see [aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events)\. - -### Valid handler signatures - -You have several options when building a Lambda function handler in Go, but you must adhere to the following rules: -+ The handler must be a function\. -+ The handler may take between 0 and 2 arguments\. If there are two arguments, the first argument must implement `context.Context`\. -+ The handler may return between 0 and 2 arguments\. If there is a single return value, it must implement `error`\. If there are two return values, the second value must implement `error`\. For more information on implementing error\-handling information, see [AWS Lambda function errors in Go](golang-exceptions.md)\. - -The following lists valid handler signatures\. `TIn` and `TOut` represent types compatible with the *encoding/json* standard library\. For more information, see [func Unmarshal](https://golang.org/pkg/encoding/json/#Unmarshal) to learn how these types are deserialized\. -+ - - ``` - func () - ``` -+ - - ``` - func () error - ``` -+ - - ``` - func (TIn) error - ``` -+ - - ``` - func () (TOut, error) - ``` -+ - - ``` - func (context.Context) error - ``` -+ - - ``` - func (context.Context, TIn) error - ``` -+ - - ``` - func (context.Context) (TOut, error) - ``` -+ - - ``` - func (context.Context, TIn) (TOut, error) - ``` - -## Using global state - -You can declare and modify global variables that are independent of your Lambda function's handler code\. In addition, your handler may declare an `init` function that is executed when your handler is loaded\. This behaves the same in AWS Lambda as it does in standard Go programs\. A single instance of your Lambda function will never handle multiple events simultaneously\. - -``` -package main - -import ( - "log" - "github.com/aws/aws-lambda-go/lambda" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/aws/aws-sdk-go/aws" -) - -var invokeCount = 0 -var myObjects []*s3.Object -func init() { - svc := s3.New(session.New()) - input := &s3.ListObjectsV2Input{ - Bucket: aws.String("examplebucket"), - } - result, _ := svc.ListObjectsV2(input) - myObjects = result.Contents -} - -func LambdaHandler() (int, error) { - invokeCount = invokeCount + 1 - log.Print(myObjects) - return invokeCount, nil -} - -func main() { - lambda.Start(LambdaHandler) -} -``` \ No newline at end of file diff --git a/doc_source/golang-logging.md b/doc_source/golang-logging.md deleted file mode 100644 index e25a956a..00000000 --- a/doc_source/golang-logging.md +++ /dev/null @@ -1,204 +0,0 @@ -# AWS Lambda function logging in Go - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#golang-logging-output) -+ [Using the Lambda console](#golang-logging-console) -+ [Using the CloudWatch console](#golang-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#golang-logging-cli) -+ [Deleting logs](#golang-logging-delete) - -## Creating a function that returns logs - - To output logs from your function code, you can use methods on [the fmt package](https://golang.org/pkg/fmt/), or any logging library that writes to `stdout` or `stderr`\. The following example uses [the log package](https://golang.org/pkg/log/)\. - -**Example [main\.go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go/function/main.go) – Logging** - -``` -func handleRequest(ctx context.Context, event events.SQSEvent) (string, error) { - // event - eventJson, _ := json.MarshalIndent(event, "", " ") - log.Printf("EVENT: %s", eventJson) - // environment variables - log.Printf("REGION: %s", os.Getenv("AWS_REGION")) - log.Println("ALL ENV VARS:") - for _, element := range os.Environ() { - log.Println(element) - } -``` - -**Example log format** - -``` -START RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Version: $LATEST -2020/03/27 03:40:05 EVENT: { - "Records": [ - { - "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "receiptHandle": "MessageReceiptHandle", - "body": "Hello from SQS!", - "md5OfBody": "7b27xmplb47ff90a553787216d55d91d", - "md5OfMessageAttributes": "", - "attributes": { - "ApproximateFirstReceiveTimestamp": "1523232000001", - "ApproximateReceiveCount": "1", - "SenderId": "123456789012", - "SentTimestamp": "1523232000000" - }, - ... -2020/03/27 03:40:05 AWS_LAMBDA_LOG_STREAM_NAME=2020/03/27/[$LATEST]569cxmplc3c34c7489e6a97ad08b4419 -2020/03/27 03:40:05 AWS_LAMBDA_FUNCTION_NAME=blank-go-function-9DV3XMPL6XBC -2020/03/27 03:40:05 AWS_LAMBDA_FUNCTION_MEMORY_SIZE=128 -2020/03/27 03:40:05 AWS_LAMBDA_FUNCTION_VERSION=$LATEST -2020/03/27 03:40:05 AWS_EXECUTION_ENV=AWS_Lambda_go1.x -END RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 -REPORT RequestId: dbda340c-xmpl-4031-8810-11bb609b4c71 Duration: 38.66 ms Billed Duration: 39 ms Memory Size: 128 MB Max Memory Used: 54 MB Init Duration: 203.69 ms -XRAY TraceId: 1-5e7d7595-212fxmpl9ee07c4884191322 SegmentId: 42ffxmpl0645f474 Sampled: true -``` - -The Go runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/golang-package.md b/doc_source/golang-package.md deleted file mode 100644 index 5433a3d0..00000000 --- a/doc_source/golang-package.md +++ /dev/null @@ -1,231 +0,0 @@ -# Deploy Go Lambda functions with \.zip file archives - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -This page describes how to create a \.zip file as your deployment package for the Go runtime, and then use the \.zip file to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. - -**Topics** -+ [Prerequisites](#golang-package-prereqs) -+ [Tools and libraries](#golang-package-libraries) -+ [Sample applications](#golang-package-sample) -+ [Creating a \.zip file on macOS and Linux](#golang-package-mac-linux) -+ [Creating a \.zip file on Windows](#golang-package-windows) -+ [Creating a Lambda function using a \.zip archive](#golang-package-create-function) -+ [Build Go with the provided\.al2 runtime](#golang-package-al2) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Tools and libraries - -Lambda provides the following tools and libraries for the Go runtime: - -**Tools and libraries for Go** -+ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. -+ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. -+ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. -+ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. - -For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. - -## Sample applications - -Lambda provides the following sample applications for the Go runtime: - -**Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. - -## Creating a \.zip file on macOS and Linux - -The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) library from GitHub with `go get`, and compile your executable with [go build](https://golang.org/cmd/go/)\. - -1. Download the **lambda** library from GitHub\. - - ``` - go get github.com/aws/aws-lambda-go/lambda - ``` - -1. Compile your executable\. - - ``` - GOOS=linux GOARCH=amd64 go build -o main main.go - ``` - - Setting `GOOS` to `linux` ensures that the compiled executable is compatible with the [Go runtime](lambda-runtimes.md), even if you compile it in a non\-Linux environment\. - -1. \(Optional\) If your `main` package consists of multiple files, use the following [go build](https://golang.org/cmd/go/) command to compile the package: - - ``` - GOOS=linux GOARCH=amd64 go build main - ``` - -1. \(Optional\) You may need to compile packages with `CGO_ENABLED=0` set on Linux: - - ``` - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go - ``` - - This command creates a stable binary package for standard C library \(`libc`\) versions, which may be different on Lambda and other devices\. - -1. Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. - -1. Create a deployment package by packaging the executable in a \.zip file\. - - ``` - zip main.zip main - ``` - -## Creating a \.zip file on Windows - -The following steps demonstrate how to download the [lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda) library from GitHub with `go get`, download the [build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/main/cmd/build-lambda-zip) tool for Windows from GitHub with `go install`, and compile your executable with [go build](https://golang.org/cmd/go/)\. - -**Note** -If you have not already done so, you must install [git](https://git-scm.com/) and then add the `git` executable to your Windows `%PATH%` environment variable\. - -1. Download the **lambda** library from GitHub\. - - ``` - go get github.com/aws/aws-lambda-go/lambda - ``` - -1. Download the **build\-lambda\-zip** tool from GitHub\. - - ``` - go.exe install github.com/aws/aws-lambda-go/cmd/build-lambda-zip@latest - ``` - -1. Use the tool from your `GOPATH` to create a \.zip file\. If you have a default installation of Go, the tool is typically in `%USERPROFILE%\Go\bin`\. Otherwise, navigate to where you installed the Go runtime and do one of the following: - ------- -#### [ cmd\.exe ] - - In cmd\.exe, run the following: - - ``` - set GOOS=linux - set GOARCH=amd64 - set CGO_ENABLED=0 - go build -o main main.go - %USERPROFILE%\Go\bin\build-lambda-zip.exe -o main.zip main - ``` - ------- -#### [ PowerShell ] - - In PowerShell, run the following: - - ``` - $env:GOOS = "linux" - $env:GOARCH = "amd64" - $env:CGO_ENABLED = "0" - go build -o main main.go - ~\Go\Bin\build-lambda-zip.exe -o main.zip main - ``` - ------- - -## Creating a Lambda function using a \.zip archive - - In addition to the `main.zip` deployment package you have created, to create a Lambda function you also need an execution role\. The execution role grants the function permission to use AWS services such as Amazon CloudWatch Logs for log streaming and AWS X\-Ray for request tracing\. You can create an execution role for your function in the IAM console or using the AWS Command Line Interface \(AWS CLI\)\. - - The following steps demonstrate how to create the execution role using the AWS CLI and then create a Lambda function using your \.zip deployment package\. - -1. Create a trust policy giving the Lambda service permission to assume the execution role\. Copy the following JSON and create a file named `trust-policy.json` in the current directory\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - ``` - -1. Create the execution role\. - - ``` - aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json - ``` - - You should see the following output\. Make a note of your role's ARN\. You will need this to create your function\. - - ``` - { - "Role": { - "Path": "/", - "RoleName": "lambda-ex", - "RoleId": "AROAQFOXMPL6TZ6ITKWND", - "Arn": "arn:aws:iam::123456789012:role/lambda-ex", - "CreateDate": "2020-01-17T23:19:12Z", - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - } - } - ``` - -1. Add permissions to the role using the `attach-role-policy` command\. In the example below, you add the `AWSLambdaBasicExecutionRole` managed policy, which allows your Lambda function to upload logs to CloudWatch\. If your Lambda function interacts with other AWS services, such as Amazon S3 or DynamoDB, you will need to add policies allowing your Lambda function to access these services\. See [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features) for more information\. - - ``` - aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole - ``` - -1. Create the function\. - - ``` - aws lambda create-function --function-name my-function --runtime go1.x --role arn:aws:iam::123456789012:role/lambda-ex --handler main --zip-file fileb://main.zip - ``` - -**Note** -When you create a Go Lambda function using the AWS CLI, the value of the handler setting you define is the executable file name\. For more information, see [AWS Lambda function handler in Go](golang-handler.md)\. - -## Build Go with the provided\.al2 runtime - -Go is implemented differently than other native runtimes\. Lambda treats Go as a custom runtime, so you can create a Go function on the provided\.al2 runtime\. You can use the AWS SAM build command to build the \.zip file package\. - -**Using AWS SAM to build Go for AL2 function** - -1. Update the AWS SAM template to use the provided\.al2 runtime\. Also set the BuildMethod to makefile\. - - ``` - Resources: - HelloWorldFunction: - Type: AWS::Serverless::Function - Properties: - CodeUri: hello-world/ - Handler: my.bootstrap.file - Runtime: provided.al2 - Architectures: [arm64] - Metadata: - BuildMethod: makefile - ``` - - Remove the `Architectures` property to build the package for the x86\_64 instruction set architecture\. - -1. Add file makefile to the project folder, with the following contents: - - ``` - GOOS=linux go build -o bootstrap - cp ./bootstrap $(ARTIFACTS_DIR)/. - ``` - -For an example application, download [ Go on AL2](https://github.com/aws-samples/sessions-with-aws-sam/tree/master/go-al2)\. The readme file contains the instructions to build and run the application\. You can also view the blog post [ Migrating AWS Lambda functions to Amazon Linux 2](https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-to-al2/)\. \ No newline at end of file diff --git a/doc_source/golang-tracing.md b/doc_source/golang-tracing.md deleted file mode 100644 index 04bd5548..00000000 --- a/doc_source/golang-tracing.md +++ /dev/null @@ -1,139 +0,0 @@ -# Instrumenting Go code in AWS Lambda - -Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. - -To send tracing data to X\-Ray, you can use one of two SDK libraries: -+ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. -+ [AWS X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-go.html) – An SDK for generating and sending trace data to X\-Ray\. - -Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. - -**Important** -**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. - -**Topics** -+ [Using ADOT to instrument your Go functions](#golang-adot) -+ [Using the X\-Ray SDK to instrument your Go functions](#golang-xray-sdk) -+ [Activating tracing with the Lambda console](#golang-tracing-console) -+ [Activating tracing with the Lambda API](#golang-tracing-api) -+ [Activating tracing with AWS CloudFormation](#golang-tracing-cloudformation) -+ [Interpreting an X\-Ray trace](#golang-tracing-interpretation) - -## Using ADOT to instrument your Go functions - -ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. - -For Go runtimes, you can add the **AWS managed Lambda layer for ADOT Go** to automatically instrument your functions\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for Go](https://aws-otel.github.io/docs/getting-started/lambda/lambda-go) in the ADOT documentation\. - -## Using the X\-Ray SDK to instrument your Go functions - -To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Go\. To get the SDK, download the SDK from its [GitHub repository](https://github.com/aws/aws-xray-sdk-go) with `go get`: - -``` -go get github.com/aws/aws-xray-sdk-go -``` - -To instrument AWS SDK clients, pass the client to the `xray.AWS()` method\. You can then trace calls by using the `WithContext` version of the method\. - -``` -svc := s3.New(session.New()) -xray.AWS(svc.Client) -... -svc.ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput) -``` - -After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. - -## Activating tracing with the Lambda console - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -## Activating tracing with the Lambda API - -Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Activating tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` - -## Interpreting an X\-Ray trace - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Go](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the *AWS X\-Ray Developer Guide*\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. \ No newline at end of file diff --git a/doc_source/images-create.md b/doc_source/images-create.md deleted file mode 100644 index 4fe2b934..00000000 --- a/doc_source/images-create.md +++ /dev/null @@ -1,281 +0,0 @@ -# Creating Lambda container images - -AWS provides a set of open\-source [base images](runtimes-images.md#runtimes-images-lp) that you can use to create your container image\. These base images include a [runtime interface client](runtimes-images.md#runtimes-api-client) to manage the interaction between Lambda and your function code\. - -For example applications, including a Node\.js example and a Python example, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. - -**Note** -Container images aren't supported for Lambda functions in the Middle East \(UAE\) Region\. - -**Topics** -+ [Base images for Lambda](runtimes-images.md) -+ [Testing Lambda container images locally](images-test.md) -+ [Prerequisites](#images-reqs) -+ [Image types](#images-types) -+ [Container tools](#images-tools) -+ [Container image settings](#images-parms) -+ [Creating images from AWS base images](#images-create-from-base) -+ [Creating images from alternative base images](#images-create-from-alt) -+ [Upload the image to the Amazon ECR repository](#images-upload) -+ [Create an image using the AWS SAM toolkit](#images-create-sam) - -## Prerequisites - -To deploy a container image to Lambda, you need the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [Docker CLI](https://docs.docker.com/get-docker)\. Additionally, note the following requirements: -+ The container image must implement the Lambda [Runtime API](runtimes-api.md)\. The AWS open\-source [runtime interface clients](runtimes-images.md#runtimes-api-client) implement the API\. You can add a runtime interface client to your preferred base image to make it compatible with Lambda\. -+ The container image must be able to run on a read\-only file system\. Your function code can access a writable `/tmp` directory with between 512 MB and 10,240 MB, in 1\-MB increments, of storage\. -+ The default Lambda user must be able to read all the files required to run your function code\. Lambda follows security best practices by defining a default Linux user with least\-privileged permissions\. Verify that your application code does not rely on files that other Linux users are restricted from running\. -+ Lambda supports only Linux\-based container images\. -+ Lambda provides multi\-architecture base images\. However, the image you build for your function must target only one of the architectures\. Lambda does not support functions that use multi\-architecture container images\. - -## Image types - -You can use an AWS provided base image or an alternative base image, such as Alpine or Debian\. Lambda supports any image that conforms to one of the following image manifest formats: -+ Docker image manifest V2, schema 2 \(used with Docker version 1\.10 and newer\) -+ Open Container Initiative \(OCI\) Specifications \(v1\.0\.0 and up\) - -Lambda supports images up to 10 GB in size\. - -## Container tools - -To create your container image, you can use any development tool that supports one of the following container image manifest formats: -+ Docker image manifest V2, schema 2 \(used with Docker version 1\.10 and newer\) -+ OCI Specifications \(v1\.0\.0 and up\) - -For example, you can use the Docker CLI to build, test, and deploy your container images\. - -## Container image settings - -Lambda supports the following container image settings in the Dockerfile: -+ ENTRYPOINT – Specifies the absolute path to the entry point of the application\. -+ CMD – Specifies parameters that you want to pass in with ENTRYPOINT\. -+ WORKDIR – Specifies the absolute path to the working directory\. -+ ENV – Specifies an environment variable for the Lambda function\. - -**Note** -Lambda ignores the values of any unsupported container image settings in the Dockerfile\. - -For more information about how Docker uses the container image settings, see [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) in the Dockerfile reference on the Docker Docs website\. For more information about using ENTRYPOINT and CMD, see [Demystifying ENTRYPOINT and CMD in Docker](http://aws.amazon.com/blogs/opensource/demystifying-entrypoint-cmd-docker/) on the AWS Open Source Blog\. - -You can specify the container image settings in the Dockerfile when you build your image\. You can also override these configurations using the Lambda console or Lambda API\. This allows you to deploy multiple functions that deploy the same container image but with different runtime configurations\. - -**Warning** -When you specify ENTRYPOINT or CMD in the Dockerfile or as an override, make sure that you enter the absolute path\. Also, do not use symlinks as the entry point to the container\. - -## Creating images from AWS base images - -To build a container image for a new Lambda function, you can start with an AWS base image for Lambda\. Lambda provides two types of base images: -+ Multi\-architecture base image - - Specify one of the main image tags \(such as `python:3.9` or `java:11`\) to choose this type of image\. -+ Architecture\-specific base image - - Specify an image tag with an architecture suffix\. For example, specify `3.9-arm64` to choose the arm64 base image for Python 3\.9\. - -You can also use an [alternative base image from another container registry](#images-create-from-alt)\. Lambda provides open\-source runtime interface clients that you add to an alternative base image to make it compatible with Lambda\. - -**Note** -AWS periodically provides updates to the AWS base images for Lambda\. If your Dockerfile includes the image name in the FROM property, your Docker client pulls the latest version of the image from the Amazon ECR repository\. To use the updated base image, you must rebuild your container image and [update the function code](gettingstarted-images.md#configuration-images-update)\. - -**To create an image from an AWS base image for Lambda** - -1. On your local machine, create a project directory for your new function\. - -1. Create a directory named **app** in the project directory, and then add your function handler code to the app directory\. - -1. Use a text editor to create a new Dockerfile\. - - The AWS base images provide the following environment variables: - + LAMBDA\_TASK\_ROOT=/var/task - + LAMBDA\_RUNTIME\_DIR=/var/runtime - - Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. - - The following shows an example Dockerfile for Node\.js, Python, and Ruby: - ------- -#### [ Node\.js 14 ] - - ``` - FROM public.ecr.aws/lambda/nodejs:14 - - # Assumes your function is named "app.js", and there is a package.json file in the app directory - COPY app.js package.json ${LAMBDA_TASK_ROOT} - - # Install NPM dependencies for function - RUN npm install - - # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) - CMD [ "app.handler" ] - ``` - ------- -#### [ Python 3\.8 ] - - ``` - FROM public.ecr.aws/lambda/python:3.8 - - # Install the function's dependencies using file requirements.txt - # from your project folder. - - COPY requirements.txt . - RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" - - # Copy function code - COPY app.py ${LAMBDA_TASK_ROOT} - - # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) - CMD [ "app.handler" ] - ``` - ------- -#### [ Ruby 2\.7 ] - - ``` - FROM public.ecr.aws/lambda/ruby:2.7 - - # Copy function code - COPY app.rb ${LAMBDA_TASK_ROOT} - - # Copy dependency management file - COPY Gemfile ${LAMBDA_TASK_ROOT} - - # Install dependencies under LAMBDA_TASK_ROOT - ENV GEM_HOME=${LAMBDA_TASK_ROOT} - RUN bundle install - - # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) - CMD [ "app.LambdaFunction::Handler.process" ] - ``` - ------- - -1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. - - ``` - docker build -t hello-world . - ``` - -1. Start the Docker image with the `docker run` command\. For this example, enter `hello-world` as the image name\. - - ``` - docker run -p 9000:8080 hello-world - ``` - -1. \(Optional\) Test your application locally using the [runtime interface emulator](images-test.md)\. From a new terminal window, post an event to the following endpoint using a `curl` command: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - - This command invokes the function running in the container image and returns a response\. - -## Creating images from alternative base images - -**Prerequisites** -+ The AWS CLI -+ Docker Desktop -+ Your function code - -**To create an image using an alternative base image** - -1. Choose a base image\. Lambda supports all Linux distributions, such as Alpine, Debian, and Ubuntu\. - -1. On your local machine, create a project directory for your new function\. - -1. Create a directory named **app** in the project directory, and then add your function handler code to the app directory\. - -1. Use a text editor to create a new Dockerfile with the following configuration: - + Set the `FROM` property to the URI of the base image\. - + Add instructions to install the runtime interface client\. - + Set the `ENTRYPOINT` property to invoke the runtime interface client\. - + Set the `CMD` argument to specify the Lambda function handler\. - - The following example shows a Dockerfile for Python: - - ``` - # Define function directory - ARG FUNCTION_DIR="/function" - - FROM python:buster as build-image - - # Install aws-lambda-cpp build dependencies - RUN apt-get update && \ - apt-get install -y \ - g++ \ - make \ - cmake \ - unzip \ - libcurl4-openssl-dev - - # Include global arg in this stage of the build - ARG FUNCTION_DIR - # Create function directory - RUN mkdir -p ${FUNCTION_DIR} - - # Copy function code - COPY app/* ${FUNCTION_DIR} - - # Install the runtime interface client - RUN pip install \ - --target ${FUNCTION_DIR} \ - awslambdaric - - # Multi-stage build: grab a fresh copy of the base image - FROM python:buster - - # Include global arg in this stage of the build - ARG FUNCTION_DIR - # Set working directory to function root directory - WORKDIR ${FUNCTION_DIR} - - # Copy in the build image dependencies - COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR} - - ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ] - CMD [ "app.handler" ] - ``` - -1. Build your Docker image with the `docker build` command\. Enter a name for the image\. The following example names the image `hello-world`\. - - ``` - docker build -t hello-world . - ``` - -1. \(Optional\) Test your application locally using the [Runtime interface emulator](images-test.md)\. - -## Upload the image to the Amazon ECR repository - -In the following commands, replace `123456789012` with your AWS account ID and set the region value to the region where you want to create the Amazon ECR repository\. - -**Note** -In Amazon ECR, if you reassign the image tag to another image, Lambda does not update the image version\. - -1. Authenticate the Docker CLI to your Amazon ECR registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Create a repository in Amazon ECR using the `create-repository` command\. - - ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` - -1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -Now that your container image resides in the Amazon ECR container registry, you can [create and run](gettingstarted-images.md) the Lambda function\. - -## Create an image using the AWS SAM toolkit - -You can use the AWS Serverless Application Model \(AWS SAM\) toolkit to create and deploy a function defined as a container image\. For a new project, you can use the AWS SAM CLI `init` command to set up the scaffolding for your project in your preferred runtime\. - -In your AWS SAM template, you set the `Runtime` type to `Image` and provide the URI of the base image\. - -For more information, see [Building applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/images-test.md b/doc_source/images-test.md deleted file mode 100644 index 0dad96f2..00000000 --- a/doc_source/images-test.md +++ /dev/null @@ -1,166 +0,0 @@ -# Testing Lambda container images locally - -The AWS Lambda Runtime Interface Emulator \(RIE\) is a proxy for the Lambda Runtime API that allows you to locally test your Lambda function packaged as a container image\. The emulator is a lightweight web server that converts HTTP requests into JSON events to pass to the Lambda function in the container image\. - -The AWS base images for Lambda include the RIE component\. If you use an alternate base image, you can test your image without adding RIE to the image\. You can also build the RIE component into your base image\. AWS provides an open\-sourced RIE component on the AWS GitHub repository\. Note that there are separate RIE components for the x86\-64 architecture and the arm64 architecture\. - -You can use the emulator to test whether your function code is compatible with the Lambda environment\. Also use the emulator to test that your Lambda function runs to completion successfully and provides the expected output\. If you build extensions and agents into your container image, you can use the emulator to test that the extensions and agents work correctly with the Lambda Extensions API\. - -For examples of how to use the RIE, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. - -**Topics** -+ [Guidelines for using the RIE](#images-test-limitations) -+ [Environment variables](#images-test-env) -+ [Test an image with RIE included in the image](#images-test-AWSbase) -+ [Build RIE into your base image](#images-test-alternative) -+ [Test an image without adding RIE to the image](#images-test-add) - -## Guidelines for using the RIE - -Note the following guidelines when using the Runtime Interface Emulator: -+ The RIE does not emulate Lambda’s security and authentication configurations, or Lambda orchestration\. -+ Lambda provides an emulator for each of the instruction set architectures\. -+ The emulator does not support AWS X\-Ray tracing or other Lambda integrations\. - -## Environment variables - -The runtime interface emulator supports a subset of [environment variables](configuration-envvars.md) for the Lambda function in the local running image\. - -If your function uses security credentials, you can configure the credentials by setting the following environment variables: -+ `AWS_ACCESS_KEY_ID` -+ `AWS_SECRET_ACCESS_KEY` -+ `AWS_SESSION_TOKEN` -+ `AWS_REGION` - -To set the function timeout, configure `AWS_LAMBDA_FUNCTION_TIMEOUT`\. Enter the maximum number of seconds that you want to allow the function to run\. - -The emulator does not populate the following Lambda environment variables\. However, you can set them to match the values that you expect when the function runs in the Lambda service: -+ `AWS_LAMBDA_FUNCTION_VERSION` -+ `AWS_LAMBDA_FUNCTION_NAME` -+ `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` - -## Test an image with RIE included in the image - -The AWS base images for Lambda include the runtime interface emulator\. You can also follow these steps after you build the RIE into your alternative base image\. - -**To test your Lambda function with the emulator** - -1. Build your image locally using the `docker build` command\. - - ``` - docker build -t myfunction:latest . - ``` - -1. Run your container image locally using the `docker run` command\. - - ``` - docker run -p 9000:8080 myfunction:latest - ``` - - This command runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. - -1. From a new terminal window, post an event to the following endpoint using a `curl` command: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - - This command invokes the Lambda function running in the container image and returns a response\. - -## Build RIE into your base image - -You can build RIE into a base image\. The following steps show how to download the RIE from GitHub to your local machine and update your Dockerfile to install RIE\. - -**To build the emulator into your image** - -1. Create a script and save it in your project directory\. Set execution permissions for the script file\. - - The script checks for the presence of the `AWS_LAMBDA_RUNTIME_API` environment variable, which indicates the presence of the runtime API\. If the runtime API is present, the script runs the [runtime interface client](runtimes-images.md#runtimes-api-client)\. Otherwise, the script runs the runtime interface emulator\. - - The following example shows a typical script for a Node\.js function\. - - ``` - #!/bin/sh - if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/local/bin/npx aws-lambda-ric $@ - else - exec /usr/local/bin/npx aws-lambda-ric $@ - fi - ``` - - The following example shows a typical script for a Python function\. - - ``` - #!/bin/sh - if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then - exec /usr/local/bin/aws-lambda-rie /usr/local/bin/python -m awslambdaric $@ - else - exec /usr/local/bin/python -m awslambdaric $@ - fi - ``` - -1. Download the runtime interface emulator for your target architecture from GitHub into your project directory\. Lambda provides an emulator for each of the instruction set architectures\. - + x86\_64 – Download [aws\-lambda\-rie](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) - + arm64 – Download [aws\-lambda\-rie\-arm64](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64) - -1. Copy the script, install the emulator package, and change `ENTRYPOINT` to run the new script by adding the following lines to your Dockerfile\. - - To use the default x86\-64 architecture: - - ``` - COPY ./entry_script.sh /entry_script.sh - ADD aws-lambda-rie-x86_64 /usr/local/bin/aws-lambda-rie - ENTRYPOINT [ "/entry_script.sh" ] - ``` - - To use the arm64 architecture: - - ``` - COPY ./entry_script.sh /entry_script.sh - ADD aws-lambda-rie-arm64 /usr/local/bin/aws-lambda-rie - ENTRYPOINT [ "/entry_script.sh" ] - ``` - -1. Build your image locally using the `docker build` command\. - - ``` - docker build -t myfunction:latest . - ``` - -## Test an image without adding RIE to the image - -You install the runtime interface emulator to your local machine\. When you run the container image, you set the entry point to be the emulator\. - -**To test an image without adding RIE to the image** - -1. From your project directory, run the following command to download the RIE \(x86\-64 architecture\) from GitHub and install it on your local machine\. - - ``` - mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \ - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \ - && chmod +x ~/.aws-lambda-rie/aws-lambda-rie - ``` - - To download the RIE for arm64 architecture, use the previous command with a different GitHub download url\. - - ``` - https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-arm64 \ - ``` - -1. Run your Lambda function using the `docker run` command\. - - ``` - docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \ - --entrypoint /aws-lambda/aws-lambda-rie hello-world:latest \ - <(optional) image command> - ``` - - This runs the image as a container and starts up an endpoint locally at `localhost:9000/2015-03-31/functions/function/invocations`\. - -1. Post an event to the following endpoint using a `curl` command: - - ``` - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' - ``` - - This command invokes the function running in the container image and returns a response\. \ No newline at end of file diff --git a/doc_source/index.md b/doc_source/index.md deleted file mode 100644 index 67a9b736..00000000 --- a/doc_source/index.md +++ /dev/null @@ -1,392 +0,0 @@ -# AWS Lambda Developer Guide - ------ -*****Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.***** - ------ -Amazon's trademarks and trade dress may not be used in -connection with any product or service that is not Amazon's, -in any manner that is likely to cause confusion among customers, -or in any manner that disparages or discredits Amazon. All other -trademarks not owned by Amazon are the property of their respective -owners, who may or may not be affiliated with, connected to, or -sponsored by Amazon. - ------ -## Contents -+ [What is AWS Lambda?](welcome.md) -+ [Prerequisites](lambda-settingup.md) -+ [Getting started with Lambda](getting-started.md) -+ [AWS Lambda foundations](lambda-foundation.md) - + [Lambda concepts](gettingstarted-concepts.md) - + [Lambda features](gettingstarted-features.md) - + [Lambda programming model](foundation-progmodel.md) - + [Lambda instruction set architectures](foundation-arch.md) - + [Lambda execution environment](lambda-runtime-environment.md) - + [VPC networking for Lambda](foundation-networking.md) - + [Lambda function scaling](invocation-scaling.md) - + [Lambda deployment packages](gettingstarted-package.md) - + [Lambda console](foundation-console.md) - + [Using Lambda with the AWS CLI](gettingstarted-awscli.md) -+ [Lambda permissions](lambda-permissions.md) - + [Lambda execution role](lambda-intro-execution-role.md) - + [Identity-based IAM policies for Lambda](access-control-identity-based.md) - + [Attribute-based access control for Lambda](attribute-based-access-control.md) - + [Using resource-based policies for Lambda](access-control-resource-based.md) - + [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) - + [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) -+ [Lambda runtimes](lambda-runtimes.md) - + [Modifying the runtime environment](runtimes-modify.md) - + [Custom AWS Lambda runtimes](runtimes-custom.md) - + [AWS Lambda runtime API](runtimes-api.md) - + [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) - + [Using AVX2 vectorization in Lambda](runtimes-avx2.md) -+ [Lambda extensions](lambda-extensions.md) - + [Configuring Lambda extensions](extensions-configuration.md) - + [AWS Lambda extensions partners](extensions-api-partners.md) - + [Lambda Extensions API](runtimes-extensions-api.md) - + [Lambda Telemetry API](telemetry-api.md) - + [Lambda Telemetry API reference](telemetry-api-reference.md) - + [Lambda Telemetry API Event schema reference](telemetry-schema-reference.md) - + [Converting Lambda Telemetry API Event objects to OpenTelemetry Spans](telemetry-otel-spans.md) - + [Lambda Logs API](runtimes-logs-api.md) -+ [Deploying Lambda functions](lambda-deploy-functions.md) - + [Deploying Lambda functions as .zip file archives](configuration-function-zip.md) - + [Deploying Lambda functions as container images](gettingstarted-images.md) -+ [Creating Lambda container images](images-create.md) - + [Base images for Lambda](runtimes-images.md) - + [Testing Lambda container images locally](images-test.md) -+ [Configuring AWS Lambda functions](lambda-functions.md) - + [Creating and sharing Lambda layers](configuration-layers.md) - + [Configuring Lambda function options](configuration-function-common.md) - + [Using AWS Lambda environment variables](configuration-envvars.md) - + [Lambda function versions](configuration-versions.md) - + [Lambda function aliases](configuration-aliases.md) -+ [Managing AWS Lambda functions](lambda-managing.md) - + [Managing Lambda reserved concurrency](configuration-concurrency.md) - + [Managing Lambda provisioned concurrency](provisioned-concurrency.md) - + [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md) - + [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md) - + [Configuring database access for a Lambda function](configuration-database.md) - + [Configuring file system access for Lambda functions](configuration-filesystem.md) - + [Configuring code signing for AWS Lambda](configuration-codesigning.md) - + [Using tags on Lambda functions](configuration-tags.md) - + [Using layers with your Lambda function](invocation-layers.md) -+ [Invoking Lambda functions](lambda-invocation.md) - + [Synchronous invocation](invocation-sync.md) - + [Asynchronous invocation](invocation-async.md) - + [Lambda event source mappings](invocation-eventsourcemapping.md) - + [Lambda event filtering](invocation-eventfiltering.md) - + [Lambda function states](functions-states.md) - + [Error handling and automatic retries in AWS Lambda](invocation-retries.md) - + [Testing Lambda functions in the console](testing-functions.md) - + [Invoking functions defined as container images](invocation-images.md) -+ [Lambda function URLs](lambda-urls.md) - + [Creating and managing Lambda function URLs](urls-configuration.md) - + [Security and auth model for Lambda function URLs](urls-auth.md) - + [Invoking Lambda function URLs](urls-invocation.md) - + [Monitoring Lambda function URLs](urls-monitoring.md) - + [Tutorial: Creating a Lambda function with a function URL](urls-tutorial.md) -+ [Building Lambda functions with Node.js](lambda-nodejs.md) - + [AWS Lambda function handler in Node.js](nodejs-handler.md) - + [Deploy Node.js Lambda functions with .zip file archives](nodejs-package.md) - + [Deploy Node.js Lambda functions with container images](nodejs-image.md) - + [AWS Lambda context object in Node.js](nodejs-context.md) - + [AWS Lambda function logging in Node.js](nodejs-logging.md) - + [AWS Lambda function errors in Node.js](nodejs-exceptions.md) - + [Instrumenting Node.js code in AWS Lambda](nodejs-tracing.md) -+ [Building Lambda functions with TypeScript](lambda-typescript.md) - + [AWS Lambda function handler in TypeScript](typescript-handler.md) - + [Deploy transpiled TypeScript code in Lambda with .zip file archives](typescript-package.md) - + [Deploy transpiled TypeScript code in Lambda with container images](typescript-image.md) - + [AWS Lambda function errors in TypeScript](typescript-exceptions.md) -+ [Building Lambda functions with Python](lambda-python.md) - + [Lambda function handler in Python](python-handler.md) - + [Deploy Python Lambda functions with .zip file archives](python-package.md) - + [Deploy Python Lambda functions with container images](python-image.md) - + [AWS Lambda context object in Python](python-context.md) - + [AWS Lambda function logging in Python](python-logging.md) - + [AWS Lambda function errors in Python](python-exceptions.md) - + [Instrumenting Python code in AWS Lambda](python-tracing.md) -+ [Building Lambda functions with Ruby](lambda-ruby.md) - + [AWS Lambda function handler in Ruby](ruby-handler.md) - + [Deploy Ruby Lambda functions with .zip file archives](ruby-package.md) - + [Deploy Ruby Lambda functions with container images](ruby-image.md) - + [AWS Lambda context object in Ruby](ruby-context.md) - + [AWS Lambda function logging in Ruby](ruby-logging.md) - + [AWS Lambda function errors in Ruby](ruby-exceptions.md) - + [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) -+ [Building Lambda functions with Java](lambda-java.md) - + [AWS Lambda function handler in Java](java-handler.md) - + [Deploy Java Lambda functions with .zip or JAR file archives](java-package.md) - + [Deploy Java Lambda functions with container images](java-image.md) - + [AWS Lambda context object in Java](java-context.md) - + [AWS Lambda function logging in Java](java-logging.md) - + [AWS Lambda function errors in Java](java-exceptions.md) - + [Instrumenting Java code in AWS Lambda](java-tracing.md) - + [Creating a deployment package using Eclipse](java-package-eclipse.md) - + [Java sample applications for AWS Lambda](java-samples.md) -+ [Building Lambda functions with Go](lambda-golang.md) - + [AWS Lambda function handler in Go](golang-handler.md) - + [AWS Lambda context object in Go](golang-context.md) - + [Deploy Go Lambda functions with .zip file archives](golang-package.md) - + [Deploy Go Lambda functions with container images](go-image.md) - + [AWS Lambda function logging in Go](golang-logging.md) - + [AWS Lambda function errors in Go](golang-exceptions.md) - + [Instrumenting Go code in AWS Lambda](golang-tracing.md) - + [Using environment variables](golang-envvars.md) -+ [Building Lambda functions with C#](lambda-csharp.md) - + [Lambda function handler in C#](csharp-handler.md) - + [Deploy C# Lambda functions with .zip file archives](csharp-package.md) - + [.NET Core CLI](csharp-package-cli.md) - + [AWS Toolkit for Visual Studio](csharp-package-toolkit.md) - + [Deploy .NET Lambda functions with container images](csharp-image.md) - + [AWS Lambda context object in C#](csharp-context.md) - + [Lambda function logging in C#](csharp-logging.md) - + [AWS Lambda function errors in C#](csharp-exceptions.md) - + [Instrumenting C# code in AWS Lambda](csharp-tracing.md) - + [.NET functions with native AOT compilation](dotnet-native-aot.md) -+ [Building Lambda functions with PowerShell](lambda-powershell.md) - + [Setting Up a PowerShell Development Environment](powershell-devenv.md) - + [Deploy PowerShell Lambda functions with .zip file archives](powershell-package.md) - + [AWS Lambda function handler in PowerShell](powershell-handler.md) - + [AWS Lambda context object in PowerShell](powershell-context.md) - + [AWS Lambda function logging in PowerShell](powershell-logging.md) - + [AWS Lambda function errors in PowerShell](powershell-exceptions.md) -+ [Using AWS Lambda with other services](lambda-services.md) - + [Common Lambda application types and use cases](applications-usecases.md) - + [Using AWS Lambda with Alexa](services-alexa.md) - + [Using AWS Lambda with Amazon API Gateway](services-apigateway.md) - + [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) - + [Sample function code](services-apigateway-code.md) - + [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) - + [AWS SAM template for an API Gateway application](services-apigateway-template.md) - + [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md) - + [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) - + [Sample function code](with-cloudtrail-create-package.md) - + [Using AWS Lambda with Amazon EventBridge (CloudWatch Events)](services-cloudwatchevents.md) - + [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) - + [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) - + [Using Lambda with CloudWatch Logs](services-cloudwatchlogs.md) - + [Using AWS Lambda with AWS CloudFormation](services-cloudformation.md) - + [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md) - + [Using AWS Lambda with AWS CodeCommit](services-codecommit.md) - + [Using AWS Lambda with AWS CodePipeline](services-codepipeline.md) - + [Working with Amazon CodeWhisperer in the Lambda console](codewhisperer.md) - + [Setting up Amazon CodeWhisperer with Lambda](codewhisperer-setup.md) - + [Overview of Amazon CodeWhisperer for AWS Lambda](codewhisperer-overview.md) - + [Using AWS Lambda with Amazon Cognito](services-cognito.md) - + [Using AWS Lambda with AWS Config](services-config.md) - + [Using Lambda with Amazon Connect](services-connect.md) - + [Using AWS Lambda with Amazon DynamoDB](with-ddb.md) - + [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) - + [Sample function code](with-ddb-create-package.md) - + [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) - + [Using AWS Lambda with Amazon EC2](services-ec2.md) - + [Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC](services-elasticache-tutorial.md) - + [Using AWS Lambda with an Application Load Balancer](services-alb.md) - + [Using Amazon EFS with Lambda](services-efs.md) - + [Using AWS Lambda with AWS IoT](services-iot.md) - + [Using AWS Lambda with AWS IoT Events](services-iotevents.md) - + [Using Lambda with self-managed Apache Kafka](with-kafka.md) - + [Using AWS Lambda with Amazon Kinesis Data Firehose](services-kinesisfirehose.md) - + [Using AWS Lambda with Amazon Kinesis](with-kinesis.md) - + [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) - + [Sample function code](with-kinesis-create-package.md) - + [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) - + [Using AWS Lambda with Amazon Lex](services-lex.md) - + [Using Lambda with Amazon MQ](with-mq.md) - + [Using Lambda with Amazon MSK](with-msk.md) - + [Using AWS Lambda with Amazon RDS](services-rds.md) - + [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) - + [Using AWS Lambda with Amazon S3](with-s3.md) - + [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) - + [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) - + [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) - + [Using AWS Lambda with Amazon S3 batch operations](services-s3-batch.md) - + [Transforming S3 Objects with S3 Object Lambda](services-s3-object-lambda.md) - + [Using AWS Lambda with Secrets Manager](with-secrets-manager.md) - + [Using AWS Lambda with Amazon SES](services-ses.md) - + [Using AWS Lambda with Amazon SNS](with-sns.md) - + [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) - + [Sample function code](with-sns-create-package.md) - + [Using Lambda with Amazon SQS](with-sqs.md) - + [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) - + [Tutorial: Using a cross-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) - + [Sample Amazon SQS function code](with-sqs-create-package.md) - + [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) - + [Using AWS Lambda with AWS X-Ray](services-xray.md) -+ [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md) - + [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) - + [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) - + [Working with Lambda function metrics](monitoring-metrics.md) - + [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) - + [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) - + [Example workflows using other AWS services](monitoring-servicemap.md) -+ [Security in AWS Lambda](lambda-security.md) - + [Data protection in AWS Lambda](security-dataprotection.md) - + [Identity and access management for Lambda](security-iam.md) - + [How AWS Lambda works with IAM](security_iam_service-with-iam.md) - + [AWS Lambda identity-based policy examples](security_iam_id-based-policy-examples.md) - + [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md) - + [Compliance validation for AWS Lambda](security-compliance.md) - + [Resilience in AWS Lambda](security-resilience.md) - + [Infrastructure security in AWS Lambda](security-infrastructure.md) - + [Configuration and vulnerability analysis in AWS Lambda](security-configuration.md) -+ [Troubleshooting issues in Lambda](lambda-troubleshooting.md) - + [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) - + [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) - + [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) - + [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) - + [Troubleshoot container image issues in Lambda](troubleshooting-images.md) -+ [AWS Lambda applications](deploying-lambda-apps.md) - + [Managing applications in the AWS Lambda console](applications-console.md) - + [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md) - + [Rolling deployments for Lambda functions](lambda-rolling-deployments.md) - + [Invoking Lambda functions with the AWS Mobile SDK for Android](with-on-demand-custom-android.md) - + [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) - + [Sample function code](with-android-create-package.md) -+ [Orchestrating functions with Step Functions](lambda-stepfunctions.md) - + [State machine application patterns](stepfunctions-patterns.md) - + [Managing state machines in the Lambda console](stepfunctions-lc.md) - + [Orchestration examples with Step Functions](services-stepfunctions.md) -+ [Best practices for working with AWS Lambda functions](best-practices.md) -+ [Lambda quotas](gettingstarted-limits.md) -+ [Using Lambda with an AWS SDK](sdk-general-information-section.md) -+ [Lambda sample applications](lambda-samples.md) - + [Blank function sample application for AWS Lambda](samples-blank.md) - + [Error processor sample application for AWS Lambda](samples-errorprocessor.md) - + [List manager sample application for AWS Lambda](samples-listmanager.md) -+ [Code examples for Lambda using AWS SDKs](service_code_examples.md) - + [Actions for Lambda using AWS SDKs](service_code_examples_actions.md) - + [Create a Lambda function using an AWS SDK](example_lambda_CreateFunction_section.md) - + [Delete a Lambda function using an AWS SDK](example_lambda_DeleteFunction_section.md) - + [Get a Lambda function using an AWS SDK](example_lambda_GetFunction_section.md) - + [Invoke a Lambda function using an AWS SDK](example_lambda_Invoke_section.md) - + [List Lambda functions using an AWS SDK](example_lambda_ListFunctions_section.md) - + [Update Lambda function code using an AWS SDK](example_lambda_UpdateFunctionCode_section.md) - + [Update Lambda function configuration using an AWS SDK](example_lambda_UpdateFunctionConfiguration_section.md) - + [Scenarios for Lambda using AWS SDKs](service_code_examples_scenarios.md) - + [Get started creating and invoking Lambda functions using an AWS SDK](example_lambda_Scenario_GettingStartedFunctions_section.md) - + [Cross-service examples for Lambda using AWS SDKs](service_code_examples_cross-service_examples.md) - + [Create an API Gateway REST API to track COVID-19 data](example_cross_ApiGatewayDataTracker_section.md) - + [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) - + [Create a messenger application with Step Functions](example_cross_StepFunctionsMessenger_section.md) - + [Create a websocket chat application with API Gateway](example_cross_ApiGatewayWebsocketChat_section.md) - + [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) - + [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) - + [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) - + [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) -+ [AWS Lambda releases](lambda-releases.md) -+ [API reference](API_Reference.md) - + [Actions](API_Operations.md) - + [AddLayerVersionPermission](API_AddLayerVersionPermission.md) - + [AddPermission](API_AddPermission.md) - + [CreateAlias](API_CreateAlias.md) - + [CreateCodeSigningConfig](API_CreateCodeSigningConfig.md) - + [CreateEventSourceMapping](API_CreateEventSourceMapping.md) - + [CreateFunction](API_CreateFunction.md) - + [CreateFunctionUrlConfig](API_CreateFunctionUrlConfig.md) - + [DeleteAlias](API_DeleteAlias.md) - + [DeleteCodeSigningConfig](API_DeleteCodeSigningConfig.md) - + [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - + [DeleteFunction](API_DeleteFunction.md) - + [DeleteFunctionCodeSigningConfig](API_DeleteFunctionCodeSigningConfig.md) - + [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) - + [DeleteFunctionEventInvokeConfig](API_DeleteFunctionEventInvokeConfig.md) - + [DeleteFunctionUrlConfig](API_DeleteFunctionUrlConfig.md) - + [DeleteLayerVersion](API_DeleteLayerVersion.md) - + [DeleteProvisionedConcurrencyConfig](API_DeleteProvisionedConcurrencyConfig.md) - + [GetAccountSettings](API_GetAccountSettings.md) - + [GetAlias](API_GetAlias.md) - + [GetCodeSigningConfig](API_GetCodeSigningConfig.md) - + [GetEventSourceMapping](API_GetEventSourceMapping.md) - + [GetFunction](API_GetFunction.md) - + [GetFunctionCodeSigningConfig](API_GetFunctionCodeSigningConfig.md) - + [GetFunctionConcurrency](API_GetFunctionConcurrency.md) - + [GetFunctionConfiguration](API_GetFunctionConfiguration.md) - + [GetFunctionEventInvokeConfig](API_GetFunctionEventInvokeConfig.md) - + [GetFunctionUrlConfig](API_GetFunctionUrlConfig.md) - + [GetLayerVersion](API_GetLayerVersion.md) - + [GetLayerVersionByArn](API_GetLayerVersionByArn.md) - + [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) - + [GetPolicy](API_GetPolicy.md) - + [GetProvisionedConcurrencyConfig](API_GetProvisionedConcurrencyConfig.md) - + [Invoke](API_Invoke.md) - + [InvokeAsync](API_InvokeAsync.md) - + [ListAliases](API_ListAliases.md) - + [ListCodeSigningConfigs](API_ListCodeSigningConfigs.md) - + [ListEventSourceMappings](API_ListEventSourceMappings.md) - + [ListFunctionEventInvokeConfigs](API_ListFunctionEventInvokeConfigs.md) - + [ListFunctions](API_ListFunctions.md) - + [ListFunctionsByCodeSigningConfig](API_ListFunctionsByCodeSigningConfig.md) - + [ListFunctionUrlConfigs](API_ListFunctionUrlConfigs.md) - + [ListLayers](API_ListLayers.md) - + [ListLayerVersions](API_ListLayerVersions.md) - + [ListProvisionedConcurrencyConfigs](API_ListProvisionedConcurrencyConfigs.md) - + [ListTags](API_ListTags.md) - + [ListVersionsByFunction](API_ListVersionsByFunction.md) - + [PublishLayerVersion](API_PublishLayerVersion.md) - + [PublishVersion](API_PublishVersion.md) - + [PutFunctionCodeSigningConfig](API_PutFunctionCodeSigningConfig.md) - + [PutFunctionConcurrency](API_PutFunctionConcurrency.md) - + [PutFunctionEventInvokeConfig](API_PutFunctionEventInvokeConfig.md) - + [PutProvisionedConcurrencyConfig](API_PutProvisionedConcurrencyConfig.md) - + [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) - + [RemovePermission](API_RemovePermission.md) - + [TagResource](API_TagResource.md) - + [UntagResource](API_UntagResource.md) - + [UpdateAlias](API_UpdateAlias.md) - + [UpdateCodeSigningConfig](API_UpdateCodeSigningConfig.md) - + [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) - + [UpdateFunctionCode](API_UpdateFunctionCode.md) - + [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - + [UpdateFunctionEventInvokeConfig](API_UpdateFunctionEventInvokeConfig.md) - + [UpdateFunctionUrlConfig](API_UpdateFunctionUrlConfig.md) - + [Data Types](API_Types.md) - + [AccountLimit](API_AccountLimit.md) - + [AccountUsage](API_AccountUsage.md) - + [AliasConfiguration](API_AliasConfiguration.md) - + [AliasRoutingConfiguration](API_AliasRoutingConfiguration.md) - + [AllowedPublishers](API_AllowedPublishers.md) - + [AmazonManagedKafkaEventSourceConfig](API_AmazonManagedKafkaEventSourceConfig.md) - + [CodeSigningConfig](API_CodeSigningConfig.md) - + [CodeSigningPolicies](API_CodeSigningPolicies.md) - + [Concurrency](API_Concurrency.md) - + [Cors](API_Cors.md) - + [DeadLetterConfig](API_DeadLetterConfig.md) - + [DestinationConfig](API_DestinationConfig.md) - + [Environment](API_Environment.md) - + [EnvironmentError](API_EnvironmentError.md) - + [EnvironmentResponse](API_EnvironmentResponse.md) - + [EphemeralStorage](API_EphemeralStorage.md) - + [EventSourceMappingConfiguration](API_EventSourceMappingConfiguration.md) - + [FileSystemConfig](API_FileSystemConfig.md) - + [Filter](API_Filter.md) - + [FilterCriteria](API_FilterCriteria.md) - + [FunctionCode](API_FunctionCode.md) - + [FunctionCodeLocation](API_FunctionCodeLocation.md) - + [FunctionConfiguration](API_FunctionConfiguration.md) - + [FunctionEventInvokeConfig](API_FunctionEventInvokeConfig.md) - + [FunctionUrlConfig](API_FunctionUrlConfig.md) - + [ImageConfig](API_ImageConfig.md) - + [ImageConfigError](API_ImageConfigError.md) - + [ImageConfigResponse](API_ImageConfigResponse.md) - + [Layer](API_Layer.md) - + [LayersListItem](API_LayersListItem.md) - + [LayerVersionContentInput](API_LayerVersionContentInput.md) - + [LayerVersionContentOutput](API_LayerVersionContentOutput.md) - + [LayerVersionsListItem](API_LayerVersionsListItem.md) - + [OnFailure](API_OnFailure.md) - + [OnSuccess](API_OnSuccess.md) - + [ProvisionedConcurrencyConfigListItem](API_ProvisionedConcurrencyConfigListItem.md) - + [SelfManagedEventSource](API_SelfManagedEventSource.md) - + [SelfManagedKafkaEventSourceConfig](API_SelfManagedKafkaEventSourceConfig.md) - + [SourceAccessConfiguration](API_SourceAccessConfiguration.md) - + [TracingConfig](API_TracingConfig.md) - + [TracingConfigResponse](API_TracingConfigResponse.md) - + [VpcConfig](API_VpcConfig.md) - + [VpcConfigResponse](API_VpcConfigResponse.md) - + [Common Errors](CommonErrors.md) - + [Common Parameters](CommonParameters.md) -+ [AWS glossary](glossary.md) \ No newline at end of file diff --git a/doc_source/invocation-async.md b/doc_source/invocation-async.md deleted file mode 100644 index 0aa5b64b..00000000 --- a/doc_source/invocation-async.md +++ /dev/null @@ -1,267 +0,0 @@ -# Asynchronous invocation - -Several AWS services, such as Amazon Simple Storage Service \(Amazon S3\) and Amazon Simple Notification Service \(Amazon SNS\), invoke functions asynchronously to process events\. When you invoke a function asynchronously, you don't wait for a response from the function code\. You hand off the event to Lambda and Lambda handles the rest\. You can configure how Lambda handles errors, and can send invocation records to a downstream resource to chain together components of your application\. - -**Topics** -+ [How Lambda handles asynchronous invocations](#async-overview) -+ [Configuring error handling for asynchronous invocation](#invocation-async-errors) -+ [Configuring destinations for asynchronous invocation](#invocation-async-destinations) -+ [Asynchronous invocation configuration API](#invocation-async-api) -+ [Dead\-letter queues](#invocation-dlq) - -## How Lambda handles asynchronous invocations - -The following diagram shows clients invoking a Lambda function asynchronously\. Lambda queues the events before sending them to the function\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-async.png) - -For asynchronous invocation, Lambda places the event in a queue and returns a success response without additional information\. A separate process reads events from the queue and sends them to your function\. To invoke a function asynchronously, set the invocation type parameter to `Event`\. - -``` -aws lambda invoke \ - --function-name my-function \ - --invocation-type Event \ - --cli-binary-format raw-in-base64-out \ - --payload '{ "key": "value" }' response.json -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -{ - "StatusCode": 202 -} -``` - -The output file \(`response.json`\) doesn't contain any information, but is still created when you run this command\. If Lambda isn't able to add the event to the queue, the error message appears in the command output\. - -Lambda manages the function's asynchronous event queue and attempts to retry on errors\. If the function returns an error, Lambda attempts to run it two more times, with a one\-minute wait between the first two attempts, and two minutes between the second and third attempts\. Function errors include errors returned by the function's code and errors returned by the function's runtime, such as timeouts\. - -If the function doesn't have enough concurrency available to process all events, additional requests are throttled\. For throttling errors \(429\) and system errors \(500\-series\), Lambda returns the event to the queue and attempts to run the function again for up to 6 hours\. The retry interval increases exponentially from 1 second after the first attempt to a maximum of 5 minutes\. If the queue contains many entries, Lambda increases the retry interval and reduces the rate at which it reads events from the queue\. - -Even if your function doesn't return an error, it's possible for it to receive the same event from Lambda multiple times because the queue itself is eventually consistent\. If the function can't keep up with incoming events, events might also be deleted from the queue without being sent to the function\. Ensure that your function code gracefully handles duplicate events, and that you have enough concurrency available to handle all invocations\. - -When the queue is very long, new events might age out before Lambda has a chance to send them to your function\. When an event expires or fails all processing attempts, Lambda discards it\. You can [configure error handling](#invocation-async-errors) for a function to reduce the number of retries that Lambda performs, or to discard unprocessed events more quickly\. - -You can also configure Lambda to send an invocation record to another service\. Lambda supports the following [destinations](#invocation-async-destinations) for asynchronous invocation\. -+ **Amazon SQS** – A standard SQS queue\. -+ **Amazon SNS** – An SNS topic\. -+ **AWS Lambda** – A Lambda function\. -+ **Amazon EventBridge** – An EventBridge event bus\. - -The invocation record contains details about the request and response in JSON format\. You can configure separate destinations for events that are processed successfully, and events that fail all processing attempts\. Alternatively, you can configure an Amazon SQS queue or Amazon SNS topic as a [dead\-letter queue](#invocation-dlq) for discarded events\. For dead\-letter queues, Lambda only sends the content of the event, without details about the response\. - -**Note** -To prevent a function from triggering, you can set the function's reserved concurrency to zero\. When you set reserved concurrency to zero for an asynchronously\-invoked function, Lambda begins sending new events to the configured [dead\-letter queue](#invocation-dlq) or the on\-failure [event destination](#invocation-async-destinations), without any retries\. To process events that were sent while reserved concurrency was set to zero, you need to consume the events from the dead\-letter queue or the on\-failure event destination\. - -## Configuring error handling for asynchronous invocation - -Use the Lambda console to configure error handling settings on a function, a version, or an alias\. - -**To configure error handling** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Asynchronous invocation**\. - -1. Under **Asynchronous invocation**, choose **Edit**\. - -1. Configure the following settings\. - + **Maximum age of event** – The maximum amount of time Lambda retains an event in the asynchronous event queue, up to 6 hours\. - + **Retry attempts** – The number of times Lambda retries when the function returns an error, between 0 and 2\. - -1. Choose **Save**\. - -When an invocation event exceeds the maximum age or fails all retry attempts, Lambda discards it\. To retain a copy of discarded events, configure a failed\-event destination\. - -## Configuring destinations for asynchronous invocation - -To send records of asynchronous invocations to another service, add a destination to your function\. You can configure separate destinations for events that fail processing and events that are successfully processed\. Like error handling settings, you can configure destinations on a function, a version, or an alias\. - -The following example shows a function that is processing asynchronous invocations\. When the function returns a success response or exits without throwing an error, Lambda sends a record of the invocation to an EventBridge event bus\. When an event fails all processing attempts, Lambda sends an invocation record to an Amazon SQS queue\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-destinations.png) - -To send events to a destination, your function needs additional permissions\. Add a policy with the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Each destination service requires a different permission, as follows: -+ **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) -+ **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) -+ **Lambda** – [InvokeFunction](API_Invoke.md) -+ **EventBridge** – [events:PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) - -Add destinations to your function in the Lambda console's function visualization\. - -**To configure a destination for asynchronous invocation records** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Under **Function overview**, choose **Add destination**\. - -1. For **Source**, choose **Asynchronous invocation**\. - -1. For **Condition**, choose from the following options: - + **On failure** – Send a record when the event fails all processing attempts or exceeds the maximum age\. - + **On success** – Send a record when the function successfully processes an asynchronous invocation\. - -1. For **Destination type**, choose the type of resource that receives the invocation record\. - -1. For **Destination**, choose a resource\. - -1. Choose **Save**\. - -When an invocation matches the condition, Lambda sends a JSON document with details about the invocation to the destination\. - -**Destination\-specific JSON format** -+ For Amazon SQS and Amazon SNS \(`SnsDestination` and `SqsDestination`\), the invocation record is passed as the `Message` to the destination\. -+ For Lambda \(`LambdaDestination`\), the invocation record is passed as the payload to the function\. -+ For EventBridge \(`EventBridgeDestination`\), the invocation record is passed as the `detail` in the [PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) call\. The value for the `source` event field is `lambda`\. The value for the `detail-type` event field is either *Lambda Function Invocation Result – Success* or *Lambda Function Invocation Result – Failure*\. The `resource` event field contains the function and destination Amazon Resource Names \(ARNs\)\. For other event fields, see [Amazon EventBridge events](https://docs.aws.amazon.com/eventbridge/latest/userguide/aws-events.html)\. - -The following example shows an invocation record for an event that failed three processing attempts due to a function error\. - -**Example invocation record** - -``` -{ - "version": "1.0", - "timestamp": "2019-11-14T18:16:05.568Z", - "requestContext": { - "requestId": "e4b46cbf-b738-xmpl-8880-a18cdf61200e", - "functionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST", - "condition": "RetriesExhausted", - "approximateInvokeCount": 3 - }, - "requestPayload": { - "ORDER_IDS": [ - "9e07af03-ce31-4ff3-xmpl-36dce652cb4f", - "637de236-e7b2-464e-xmpl-baf57f86bb53", - "a81ddca6-2c35-45c7-xmpl-c3a03a31ed15" - ] - }, - "responseContext": { - "statusCode": 200, - "executedVersion": "$LATEST", - "functionError": "Unhandled" - }, - "responsePayload": { - "errorMessage": "RequestId: e4b46cbf-b738-xmpl-8880-a18cdf61200e Process exited before completing request" - } -} -``` - -The invocation record contains details about the event, the response, and the reason that the record was sent\. - -## Asynchronous invocation configuration API - -To manage asynchronous invocation settings with the AWS CLI or AWS SDK, use the following API operations\. -+ [PutFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionEventInvokeConfig.html) -+ [GetFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionEventInvokeConfig.html) -+ [UpdateFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionEventInvokeConfig.html) -+ [ListFunctionEventInvokeConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionEventInvokeConfigs.html) -+ [DeleteFunctionEventInvokeConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionEventInvokeConfig.html) - -To configure asynchronous invocation with the AWS CLI, use the `put-function-event-invoke-config` command\. The following example configures a function with a maximum event age of 1 hour and no retries\. - -``` -aws lambda put-function-event-invoke-config --function-name error \ ---maximum-event-age-in-seconds 3600 --maximum-retry-attempts 0 -``` - -You should see the following output: - -``` -{ - "LastModified": 1573686021.479, - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", - "MaximumRetryAttempts": 0, - "MaximumEventAgeInSeconds": 3600, - "DestinationConfig": { - "OnSuccess": {}, - "OnFailure": {} - } -} -``` - -The `put-function-event-invoke-config` command overwrites any existing configuration on the function, version, or alias\. To configure an option without resetting others, use `update-function-event-invoke-config`\. The following example configures Lambda to send a record to an SQS queue named `destination` when an event can't be processed\. - -``` -aws lambda update-function-event-invoke-config --function-name error \ ---destination-config '{"OnFailure":{"Destination": "arn:aws:sqs:us-east-2:123456789012:destination"}}' -``` - -You should see the following output: - -``` -{ - "LastModified": 1573687896.493, - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:error:$LATEST", - "MaximumRetryAttempts": 0, - "MaximumEventAgeInSeconds": 3600, - "DestinationConfig": { - "OnSuccess": {}, - "OnFailure": { - "Destination": "arn:aws:sqs:us-east-2:123456789012:destination" - } - } -} -``` - -## Dead\-letter queues - -As an alternative to an [on\-failure destination](#invocation-async-destinations), you can configure your function with a dead\-letter queue to save discarded events for further processing\. A dead\-letter queue acts the same as an on\-failure destination in that it is used when an event fails all processing attempts or expires without being processed\. However, a dead\-letter queue is part of a function's version\-specific configuration, so it is locked in when you publish a version\. On\-failure destinations also support additional targets and include details about the function's response in the invocation record\. - -To reprocess events in a dead\-letter queue, you can set it as an event source for your Lambda function\. Alternatively, you can manually retrieve the events\. - -You can choose an Amazon SQS queue or Amazon SNS topic for your dead\-letter queue\. If you don't have a queue or topic, create one\. Choose the target type that matches your use case\. -+ [Amazon SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-create-queue.html) – A queue holds failed events until they're retrieved\. Choose an Amazon SQS queue if you expect a single entity, such as a Lambda function or CloudWatch alarm, to process the failed event\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. - - Create a queue in the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. -+ [Amazon SNS topic](https://docs.aws.amazon.com/sns/latest/gsg/CreateTopic.html) – A topic relays failed events to one or more destinations\. Choose an Amazon SNS topic if you expect multiple entities to act on a failed event\. For example, you can configure a topic to send events to an email address, a Lambda function, and/or an HTTP endpoint\. For more information, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. - - Create a topic in the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. - -To send events to a queue or topic, your function needs additional permissions\. Add a policy with the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. -+ **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) -+ **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - -If the target queue or topic is encrypted with a customer managed key, the execution role must also be a user in the key's [resource\-based policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)\. - -After creating the target and updating your function's execution role, add the dead\-letter queue to your function\. You can configure multiple functions to send events to the same target\. - -**To configure a dead\-letter queue** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Asynchronous invocation**\. - -1. Under **Asynchronous invocation**, choose **Edit**\. - -1. Set **DLQ resource** to **Amazon SQS** or **Amazon SNS**\. - -1. Choose the target queue or topic\. - -1. Choose **Save**\. - -To configure a dead\-letter queue with the AWS CLI, use the `update-function-configuration` command\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---dead-letter-config TargetArn=arn:aws:sns:us-east-2:123456789012:my-topic -``` - -Lambda sends the event to the dead\-letter queue as\-is, with additional information in attributes\. You can use this information to identify the error that the function returned, or to correlate the event with logs or an AWS X\-Ray trace\. - -**Dead\-letter queue message attributes** -+ **RequestID** \(String\) – The ID of the invocation request\. Request IDs appear in function logs\. You can also use the X\-Ray SDK to record the request ID on an attribute in the trace\. You can then search for traces by request ID in the X\-Ray console\. For an example, see the [error processor sample](samples-errorprocessor.md)\. -+ **ErrorCode** \(Number\) – The HTTP status code\. -+ **ErrorMessage** \(String\) – The first 1 KB of the error message\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-dlq-attributes.png) - -If Lambda can't send a message to the dead\-letter queue, it deletes the event and emits the [DeadLetterErrors](monitoring-metrics.md) metric\. This can happen because of lack of permissions, or if the total size of the message exceeds the limit for the target queue or topic\. For example, if an Amazon SNS notification with a body close to 256 KB triggers a function that results in an error, the additional event data added by Amazon SNS, combined with the attributes added by Lambda, can cause the message to exceed the maximum size allowed in the dead\-letter queue\. - -If you're using Amazon SQS as an event source, configure a dead\-letter queue on the Amazon SQS queue itself and not on the Lambda function\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. \ No newline at end of file diff --git a/doc_source/invocation-eventfiltering.md b/doc_source/invocation-eventfiltering.md deleted file mode 100644 index ee60a90c..00000000 --- a/doc_source/invocation-eventfiltering.md +++ /dev/null @@ -1,362 +0,0 @@ -# Lambda event filtering - -You can use event filtering to control which events Lambda sends to your function for processing\. For example, you can define filter criteria so that you process only the records from a Kinesis stream that have the status code `ERROR`\. - -You can define up to five different filters for a single event source\. If an event satisfies any one of these five filters, Lambda sends the event to your function\. Otherwise, Lambda discards the event\. An event either satisfies the filter criteria or it doesn't\. If you're using batching windows, Lambda applies your filter criteria to each new event to determine whether to add it to the current batch\. - -**Topics** -+ [Event filtering basics](#filtering-basics) -+ [Filter rule syntax](#filtering-syntax) -+ [Filtering examples](#filtering-examples) -+ [Attaching filter criteria to an event source mapping \(console\)](#filtering-console) -+ [Attaching filter criteria to an event source mapping \(AWS CLI\)](#filtering-cli) -+ [Properly filtering Amazon SQS messages](#filtering-sqs) -+ [Properly filtering Kinesis and DynamoDB messages](#filtering-streams) -+ [Properly filtering Amazon Managed Streaming for Apache Kafka, self\-managed Apache Kafka, and Amazon MQ messages](#filtering-poller) - -## Event filtering basics - -A filter criteria \(`FilterCriteria`\) object is a structure that consists of a list of filters \(`Filters`\)\. Each filter \(`Filter`\) is a structure that defines an event filtering pattern \(`Pattern`\)\. A `Pattern` is a string representation of a JSON filter rule\. A `FilterCriteria` object looks like the following example: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"Metadata1\": [ rule1 ], \"data\": { \"Data1\": [ rule2 ] }}" - } - ] -} -``` - -For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON: - -``` -{ - "Metadata1": [ pattern1 ], - "data": { - "Data1": [ pattern2 ] - } -} -``` - -There are three main parts to a `FilterCriteria` object: metadata properties, data properties, and filter patterns\. For example, suppose you receive a Kinesis event from your event source that looks like the following: - -``` -"kinesis": { - "partitionKey": "1", - "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", - "data": { - "City": "Seattle", - "State": "WA", - "Temperature": "46", - "Month": "December" - }, - "approximateArrivalTimestamp": 1545084650.987 -} -``` -+ **Metadata properties** are the fields of the event object\. In the example `FilterCriteria`, `Metadata1` refers to a metadata property\. In the Kinesis event example, `Metadata1` could refer to a field such as `partitionKey`\. -+ **Data properties** are the fields of the event body\. In the example `FilterCriteria`, `Data1` refers to a data property\. In the Kinesis event example, `Data1` could refer to fields such as `City` and `Temperature`\. -**Note** -To filter on data properties, make sure to contain them in `FilterCriteria` within the proper key\. This key depends on the event source\. For Kinesis event sources, the data key is `data`\. For Amazon SQS event sources, the data key is `body`\. For DynamoDB event sources, the data key is `dynamodb`\. -+ **Filter rules** define the filter that you want to apply to a specific property\. In the example `FilterCriteria`, `rule1` applies to `Metadata1`, and `rule2` applies to `Data1`\. The syntax of your filter rule depends on the comparison operator that you use\. For more information, see [Filter rule syntax](#filtering-syntax)\. - -When you create a `FilterCriteria` object, specify only the metadata properties and data properties that you want the filter to match on\. For Lambda to consider the event a match, the event must contain all the field names included in a filter\. Lambda ignores the fields that aren't included in a filter\. - -### Duplicate keys - -If a pattern contains duplicate keys with different values, Lambda uses only the last value for that key\. For example, here's a JSON filter pattern that contains multiple values for `"duplicateKey"`: - -``` -{ - "Metadata1": [ "pattern1" ], - "data": { - "duplicateKey" : ["hello"], - "uniqueKey" : ["test123"], - "duplicateKey" : ["world"] - } -} -``` - -In this scenario, Lambda interprets the filter rule as follows: - -``` -{ - "Metadata1": [ "pattern1" ], - "data": { - "uniqueKey" : ["test123"], - "duplicateKey" : ["world"] - } -} -``` - -## Filter rule syntax - -For filter rules, Lambda supports the same set of syntax and rules as Amazon EventBridge\. For more information, see [Amazon EventBridge event patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html) in the *Amazon EventBridge User Guide*\. - -The following is a summary of all the comparison operators available for Lambda event filtering\. - - -| Comparison operator | Example | Rule syntax | -| --- | --- | --- | -| Null | UserID is null | "UserID": \[ null \] | -| Empty | LastName is empty | "LastName": \[""\] | -| Equals | Name is "Alice" | "Name": \[ "Alice" \] | -| And | Location is "New York" and Day is "Monday" | "Location": \[ "New York" \], "Day": \["Monday"\] | -| Or | PaymentType is "Credit" or "Debit" | "PaymentType": \[ "Credit", "Debit"\] | -| Not | Weather is anything but "Raining" | "Weather": \[ \{ "anything\-but": \[ "Raining" \] \} \] | -| Numeric \(equals\) | Price is 100 | "Price": \[ \{ "numeric": \[ "=", 100 \] \} \] | -| Numeric \(range\) | Price is more than 10, and less than or equal to 20 | "Price": \[ \{ "numeric": \[ ">", 10, "<=", 20 \] \} \] | -| Exists | ProductName exists | "ProductName": \[ \{ "exists": true \} \] | -| Does not exist | ProductName does not exist | "ProductName": \[ \{ "exists": false \} \] | -| Begins with | Region is in the US | "Region": \[ \{"prefix": "us\-" \} \] | - -**Note** -Like EventBridge, for strings, Lambda uses exact character\-by\-character matching without case\-folding or any other string normalization\. For numbers, Lambda also uses string representation\. For example, 300, 300\.0, and 3\.0e2 are not considered equal\. - -## Filtering examples - -Suppose you have a Kinesis event source, and you want your function to handle only events with a specific `partitionKey` \(a metadata property\)\. In addition, you want to process only events with the `Location` field \(a data property\) equal to "Los Angeles"\. In this case, your `FilterCriteria` object would look like this: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"partitionKey\": [ \"1\" ], \"data\": { \"Location\": [ \"Los Angeles\" ] }}" - } - ] -} -``` - -For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. - -``` -{ - "partitionKey": [ "1" ], - "data": { - "Location": [ "Los Angeles" ] - } -} -``` - -The previous example uses the **Equals** comparison operator for both `partitionKey` and `Location`\. - -As another example, suppose that you want to handle only events where the `Temperature` data property is greater than 50 but less than or equal to 60\. In this case, your `FilterCriteria` object would look like this: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"data\": { \"Temperature\": [ {\"numeric\": [ \">\", 50, \"<=\", 60 ] }]}" - } - ] -} -``` - -For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. - -``` -{ - "data": { - "Temperature": [ {"numeric": [ ">", 50, "<=", 60 ] } ] - } -} -``` - -The previous example uses the **Numeric \(range\)** comparison operator for `Temperature`\. - -### Multi\-level filtering - -You can also use event filtering to handle multi\-level JSON filtering\. For example, suppose you receive a DynamoDB stream event with a data object that looks like the following: - -``` -"dynamodb": { - "Keys": { - "Id": { - "N": "101" - } - }, - "NewImage": { - "Message": { - "S": "New item!" - }, - "Id": { - "N": "101" - } - }, - "SequenceNumber": "111", - "SizeBytes": 26, - "StreamViewType": "NEW_AND_OLD_IMAGES" -} -``` - -Suppose you only wanted to handle events where the Key ID value, `N`, is 101\. In this case, your `FilterCriteria` object would look like this: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"dynamodb\": { \"Keys\": { \"Id\": { \"N\": [ "101" ] } } } }" - } - ] -} -``` - -For added clarity, here is the value of the filter's `Pattern` expanded in plain JSON\. - -``` -{ - "dynamodb": { - "Keys": { - "Id": { - "N": [ "101" ] - } - } - } -} -``` - -The previous example uses the **Equals** comparison operator for `N`, which is nested multiple layers within the `dynamodb` data field\. - -## Attaching filter criteria to an event source mapping \(console\) - -Follow these steps to create a new event source mapping with filter criteria using the Lambda console\. - -**To create a new event source mapping with filter criteria \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function to create an event source mapping for\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. For **Trigger configuration**, choose a trigger type that supports event filtering\. These include **SQS**, **DynamoDB**, **Kinesis**, **MSK**, and **MQ**\. - -1. Expand **Additional settings**\. - -1. Under **Filter criteria**, choose **Add**, and then define and enter your filters\. For example, you can enter the following: - - ``` - { "a" : [ 1, 2 ] } - ``` - - This instructs Lambda to process only the records where field `a` is equal to 1 or 2\. - -1. Choose **Add**\. - -When you enter filter criteria using the console, you provide only the filter pattern\. In step 6 of the preceding instructions, `{ "a" : [ 1, 2 ] }` corresponds to the following `FilterCriteria`: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"a\" : [ 1, 2 ] }" - } - ] -} -``` - -After creating your event source mapping in the console, you can see the formatted `FilterCriteria` in the trigger details\. Note that when entering filters using the console, you don't need to provide the `Pattern` key or escape quotes\. - -**Note** -By default, you can have five different filters per event source\. You can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) for up to 10 filters per event source\. The Lambda console lets you add up to 10 filters depending on the current quota for your account\. If you attempt to add more filters than your current quota allows, Lambda throws an error when you try to create the event source\. - -## Attaching filter criteria to an event source mapping \(AWS CLI\) - -Suppose you want an event source mapping to have the following `FilterCriteria`: - -``` -{ - "Filters": [ - { - "Pattern": "{ \"a\" : [ 1, 2 ] }" - } - ] -} -``` - -To create a new event source mapping with these filter criteria using the AWS Command Line Interface \(AWS CLI\), run the following command: - -``` -aws lambda create-event-source-mapping \ - --function-name my-function \ - --event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue \ - --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" -``` - -This [CreateEventSourceMapping](API_CreateEventSourceMapping.md) command creates a new Amazon SQS event source mapping for function `my-function` with the specified `FilterCriteria`\. - -To add these filter criteria to an existing event source mapping, run the following command: - -``` -aws lambda update-event-source-mapping \ - --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ - --filter-criteria "{\"Filters\": [{\"Pattern\": \"{ \"a\" : [ 1, 2 ]}\"}]}" -``` - -Note that to update an event source mapping, you need its UUID\. You can get the UUID from a [ListEventSourceMappings](API_ListEventSourceMappings.md) call\. Lambda also returns the UUID in the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API response\. - -To remove filter criteria from an event source, you can run the following [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) command with an empty `FilterCriteria` object: - -``` -aws lambda update-event-source-mapping \ - --uuid "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" \ - --filter-criteria "{}" -``` - -## Properly filtering Amazon SQS messages - -If an Amazon SQS message doesn't satisfy your filter criteria, Lambda automatically removes the message from the queue\. You don't have to manually delete these messages in Amazon SQS\. - -For Amazon SQS, the message `body` can be any string\. However, this can be problematic if your `FilterCriteria` expect `body` to be in a valid JSON format\. The reverse scenario is also true—if the incoming message `body` is in JSON format but your filter criteria expects `body` to be a plain string, this can lead to unintended behavior\. - -To avoid this issue, ensure that the format of `body` in your `FilterCriteria` matches the expected format of `body` in messages that you receive from your queue\. Before filtering your messages, Lambda automatically evaluates the format of the incoming message `body` and of your filter pattern for `body`\. If there is a mismatch, Lambda drops the message\. The following table summarizes this evaluation: - - -| Incoming message `body` format | Filter pattern `body` format | Resulting action | -| --- | --- | --- | -| Plain string | Plain string | Lambda filters based on your filter criteria\. | -| Plain string | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Plain string | Valid JSON | Lambda drops the message\. | -| Valid JSON | Plain string | Lambda drops the message\. | -| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | - -If you don't include `body` as part of your `FilterCriteria`, Lambda skips this check\. - -## Properly filtering Kinesis and DynamoDB messages - -Once your filter criteria processes an Kinesis or DynamoDB record, the streams iterator advances past this record\. If the record doesn't satisfy your filter criteria, you don't have to manually delete the record from your event source\. After the retention period, Kinesis and DynamoDB automatically delete these old records\. If you want records to be deleted sooner, see [Changing the Data Retention Period](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-extended-retention.html)\. - -To properly filter events from Kinesis and DynamoDB sources, both the data field and your filter criteria for the data field must be in valid JSON format\. \(For Kinesis, the data field is `data`\. For DynamoDB, the data field is `dynamodb`\.\) If either field isn't in a valid JSON format, Lambda drops the message or throws an exception\. The following table summarizes the specific behavior: - - -| Incoming data format \(`data` or `dynamodb`\) | Filter pattern format for data properties | Resulting action | -| --- | --- | --- | -| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | -| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Valid JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | -| Non\-JSON | Valid JSON | Lambda drops the record\. | -| Non\-JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Non\-JSON | Non\-JSON | Lambda throws an exception at the time of the event source mapping creation or update\. The filter pattern for data properties must be in a valid JSON format\. | - -## Properly filtering Amazon Managed Streaming for Apache Kafka, self\-managed Apache Kafka, and Amazon MQ messages - -**Note** -After you attach filter criteria to a Kafka or Amazon MQ event source mapping, it can take up to 15 minutes to apply your filtering rules to events\. - -For [Amazon MQ sources](with-mq.md), the message field is `data`\. For Kafka sources \([Amazon MSK](with-msk.md) and [self\-managed Apache Kafka](with-kafka.md)\), there are two message fields: `key` and `value`\. - -Lambda drops messages that don't match all fields included in the filter\. For Kafka, Lambda commits offsets for matched and unmatched messages after successfully invoking the function\. For Amazon MQ, Lambda acknowledges matched messages after successfully invoking the function and acknowledges unmatched messages when filtering them\. - -Kafka and Amazon MQ messages must be UTF\-8 encoded strings, either plain strings or in JSON format\. That's because Lambda decodes Kafka and Amazon MQ byte arrays into UTF\-8 before applying filter criteria\. If your messages use another encoding, such as UTF\-16 or ASCII, or if the message format doesn't match the `FilterCriteria` format, Lambda processes metadata filters only\. The following table summarizes the specific behavior: - - -| Incoming message format \(`data` or `key` and `value`\) | Filter pattern format for message properties | Resulting action | -| --- | --- | --- | -| Plain string | Plain string | Lambda filters based on your filter criteria\. | -| Plain string | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Plain string | Valid JSON | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Valid JSON | Plain string | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Valid JSON | No filter pattern for data properties | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | -| Valid JSON | Valid JSON | Lambda filters based on your filter criteria\. | -| Non\-UTF\-8 encoded string | JSON, plain string, or no pattern | Lambda filters \(on the other metadata properties only\) based on your filter criteria\. | \ No newline at end of file diff --git a/doc_source/invocation-eventsourcemapping.md b/doc_source/invocation-eventsourcemapping.md deleted file mode 100644 index e4127f5d..00000000 --- a/doc_source/invocation-eventsourcemapping.md +++ /dev/null @@ -1,116 +0,0 @@ -# Lambda event source mappings - -An event source mapping is a Lambda resource that reads from an event source and invokes a Lambda function\. You can use event source mappings to process items from a stream or queue in services that don't invoke Lambda functions directly\. Lambda provides event source mappings for the following services\. - -**Services that Lambda reads events from** -+ [Amazon DynamoDB](with-ddb.md) -+ [Amazon Kinesis](with-kinesis.md) -+ [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) -+ [Self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) - -An event source mapping uses permissions in the function's [execution role](lambda-intro-execution-role.md) to read and manage items in the event source\. Permissions, event structure, settings, and polling behavior vary by event source\. For more information, see the linked topic for the service that you use as an event source\. - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. - -``` -aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --maximum-batching-window-in-seconds 5 --starting-position LATEST \ ---event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 -``` - -You should see the following output: - -``` -{ - "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", - "BatchSize": 500, - "MaximumBatchingWindowInSeconds": 5, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1560209851.963, - "LastProcessingResult": "No records processed", - "State": "Creating", - "StateTransitionReason": "User action", - "DestinationConfig": {}, - "MaximumRecordAgeInSeconds": 604800, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 10000 -} -``` - -Lambda event source mappings process events at least once due to the distributed nature of its pollers\. As a result, your Lambda function may receive duplicate events in rare situations\. Follow [Best practices for working with AWS Lambda functions](best-practices.md) and build idempotent functions to avoid issues related to duplicate events\. - -## Batching behavior - -Event source mappings read items from a target event source\. By default, an event source mapping batches records together into a single payload that Lambda sends to your function\. To fine\-tune batching behavior, you can configure a batching window \(`MaximumBatchingWindowInSeconds`\) and a batch size \(`BatchSize`\)\. A batching window is the maximum amount of time to gather records into a single payload\. A batch size is the maximum number of records in a single batch\. Lambda invokes your function when one of the following three criteria is met: -+ **The batching window reaches its maximum value\.** Batching window behavior varies depending on the specific event source\. - + **For Kinesis, DynamoDB, and Amazon SQS event sources:** The default batching window is 0 seconds\. This means that Lambda sends batches to your function as quickly as possible\. If you configure a `MaximumBatchingWindowInSeconds`, the next batching window begins as soon as the previous function invocation completes\. - + **For Amazon MSK, self\-managed Apache Kafka, and Amazon MQ event sources:** The default batching window is 500 ms\. You can configure `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 seconds in increments of seconds\. A batching window begins as soon as the first record arrives\. -**Note** -Because you can only change `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it\. To restore the default batching window, you must create a new event source mapping\. -+ **The batch size is met\.** The minimum batch size is 1\. The default and maximum batch size depend on the event source\. For details about these values, see the [https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html#SSS-CreateEventSourceMapping-request-BatchSize) specification for the `CreateEventSourceMapping` API operation\. -+ **The payload size reaches [6 MB](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)\.** You cannot modify this limit\. - -The following diagram illustrates these three conditions\. Suppose a batching window begins at `t = 7` seconds\. In the first scenario, the batching window reaches its 40 second maximum at `t = 47` seconds after accumulating 5 records\. In the second scenario, the batch size reaches 10 before the batching window expires, so the batching window ends early\. In the third scenario, the maximum payload size is reached before the batching window expires, so the batching window ends early\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/batching-window.png) - -The following example shows an event source mapping that reads from a Kinesis stream\. If a batch of events fails all processing attempts, the event source mapping sends details about the batch to an SQS queue\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-eventsourcemapping.png) - -The event batch is the event that Lambda sends to the function\. It is a batch of records or messages compiled from the items that the event source mapping reads up until the current batching window expires\. - -For streams, an event source mapping creates an iterator for each shard in the stream and processes items in each shard in order\. You can configure the event source mapping to read only new items that appear in the stream, or to start with older items\. Processed items aren't removed from the stream, and other functions or consumers can process them\. - -By default, if your function returns an error, the event source mapping reprocesses the entire batch until the function succeeds, or the items in the batch expire\. To ensure in\-order processing, the event source mapping pauses processing for the affected shard until the error is resolved\. You can configure the event source mapping to discard old events, restrict the number of retries, or process multiple batches in parallel\. If you process multiple batches in parallel, in\-order processing is still guaranteed for each partition key, but the event source mapping simultaneously processes multiple partition keys in the same shard\. - -You can also configure the event source mapping to send an invocation record to another service when it discards an event batch\. Lambda supports the following [destinations](invocation-async.md#invocation-async-destinations) for event source mappings\. -+ **Amazon SQS** – An SQS queue\. -+ **Amazon SNS** – An SNS topic\. - -The invocation record contains details about the failed event batch in JSON format\. - -The following example shows an invocation record for a Kinesis stream\. - -**Example invocation record** - -``` -{ - "requestContext": { - "requestId": "c9b8fa9f-5a7f-xmpl-af9c-0c604cde93a5", - "functionArn": "arn:aws:lambda:us-east-2:123456789012:function:myfunction", - "condition": "RetryAttemptsExhausted", - "approximateInvokeCount": 1 - }, - "responseContext": { - "statusCode": 200, - "executedVersion": "$LATEST", - "functionError": "Unhandled" - }, - "version": "1.0", - "timestamp": "2019-11-14T00:38:06.021Z", - "KinesisBatchInfo": { - "shardId": "shardId-000000000001", - "startSequenceNumber": "49601189658422359378836298521827638475320189012309704722", - "endSequenceNumber": "49601189658422359378836298522902373528957594348623495186", - "approximateArrivalOfFirstRecord": "2019-11-14T00:38:04.835Z", - "approximateArrivalOfLastRecord": "2019-11-14T00:38:05.580Z", - "batchSize": 500, - "streamArn": "arn:aws:kinesis:us-east-2:123456789012:stream/mystream" - } -} -``` - -Lambda also supports in\-order processing for [FIFO \(first\-in, first\-out\) queues](with-sqs.md), scaling up to the number of active message groups\. For standard queues, items aren't necessarily processed in order\. Lambda scales up to process a standard queue as quickly as possible\. When an error occurs, Lambda returns batches to the queue as individual items and might process them in a different grouping than the original batch\. Occasionally, the event source mapping might receive the same item from the queue twice, even if no function error occurred\. Lambda deletes items from the queue after they're processed successfully\. You can configure the source queue to send items to a dead\-letter queue if Lambda can't process them\. - -For information about services that invoke Lambda functions directly, see [Using AWS Lambda with other services](lambda-services.md)\. \ No newline at end of file diff --git a/doc_source/invocation-images.md b/doc_source/invocation-images.md deleted file mode 100644 index 15f0e0c9..00000000 --- a/doc_source/invocation-images.md +++ /dev/null @@ -1,28 +0,0 @@ -# Invoking functions defined as container images - -For a Lambda function defined as a container image, function behavior during invocation is very similar to a function defined as a \.zip file archive\. The following sections highlight the similarities and differences\. - -**Topics** -+ [Function lifecycle](#invocation-images-lifecycle) -+ [Invoking the function](#invocation-images-update) -+ [Image security](#invocation-images-security) - -## Function lifecycle - -After you upload a new or updated container image, Lambda optimizes the image before the function can process invocations\. The optimization process can take a few seconds\. The function remains in the `Pending` state until the process completes\. The function then transitions to the `Active` state\. While the state is `Pending`, you can invoke the function, but other operations on the function fail\. Invocations that occur while an image update is in progress run the code from the previous image\. - -If a function is not invoked for multiple weeks, Lambda reclaims its optimized version, and the function transitions to the `Inactive` state\. To reactivate the function, you must invoke it\. Lambda rejects the first invocation and the function enters the `Pending` state until Lambda re\-optimizes the image\. The function then returns to the `Active` state\. - -Lambda periodically fetches the associated container image from the Amazon Elastic Container Registry \(Amazon ECR\) repository\. If the corresponding container image no longer exists on Amazon ECR or permissions are revoked, the function enters the `Failed` state, and Lambda returns a failure for any function invocations\. - -You can use the Lambda API to get information about a function's state\. For more information, see [Lambda function states](functions-states.md)\. - -## Invoking the function - -When you invoke the function, Lambda deploys the container image to an execution environment\. Lambda initializes any [extensions](extensions-configuration.md#invocation-extensions-images) and then runs the function’s initialization code \(the code outside the main handler\)\. Note that function initialization duration is included in billed execution time\. - -Lambda then runs the function by calling the code entry point specified in the function configuration \(the ENTRYPOINT and CMD [container image settings](images-create.md#images-parms)\)\. - -## Image security - -When Lambda first downloads the container image from its original source \(Amazon ECR\), the container image is optimized, encrypted, and stored using authenticated convergent encryption methods\. All keys that are required to decrypt customer data are protected using AWS KMS customer managed keys\. To track and audit Lambda's usage of customer managed keys, you can view the [AWS CloudTrail logs](logging-using-cloudtrail.md)\. \ No newline at end of file diff --git a/doc_source/invocation-layers.md b/doc_source/invocation-layers.md deleted file mode 100644 index 3a3efda3..00000000 --- a/doc_source/invocation-layers.md +++ /dev/null @@ -1,259 +0,0 @@ -# Using layers with your Lambda function - -A Lambda layer is a \.zip file archive that can contain additional code or other content\. A layer can contain libraries, a custom runtime, data, or configuration files\. Use layers to reduce deployment package size and to promote code sharing and separation of responsibilities so that you can iterate faster on writing business logic\. - -You can use layers only with Lambda functions [deployed as a \.zip file archive](gettingstarted-package.md#gettingstarted-package-zip)\. For a function [defined as a container image](images-create.md), you can package your preferred runtime and all code dependencies when you create the container image\. For more information, see [ Working with Lambda layers and extensions in container images](http://aws.amazon.com/blogs/compute/working-with-lambda-layers-and-extensions-in-container-images/) on the AWS Compute Blog\. - -**Topics** -+ [Configuring functions to use layers](#invocation-layers-using) -+ [Accessing layer content from your function](#invocation-layers-accessing) -+ [Finding layer information](#configuration-layers-finding) -+ [Adding layer permissions](#invocation-layers-permissions) -+ [Using AWS SAM to add a layer to a function](#invocation-layers-cloudformation) -+ [Sample applications](#invocation-layers-samples) - -## Configuring functions to use layers - -You can add up to five layers to a Lambda function\. The total unzipped size of the function and all layers cannot exceed the unzipped deployment package size quota of 250 MB\. For more information, see [Lambda quotas](gettingstarted-limits.md)\. - -If your functions consume a layer that a different AWS account publishes, your functions can continue to use the layer version after it has been deleted, or after your permission to access the layer is revoked\. However, you cannot create a new function that uses a deleted layer version\. - -**Note** -Make sure that the layers that you add to a function are compatible with the runtime and instruction set architecture of the function\. - -### Configuring layers with the console - -**Adding a layer to a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to configure\. - -1. Under **Layers**, choose **Add a layer** - -1. Under **Choose a layer**, choose a layer source\. - -1. For the **AWS layers** or **Custom layers** layer source: - - 1. Choose a layer from the pull\-down menu\. - - 1. Under **Version**, choose a layer version from the pull\-down menu\. Each layer version entry lists its compatible runtimes and architectures\. - - 1. Choose **Add**\. - -1. For the **Specify an ARN** layer source: - - 1. Enter an ARN in the text box and choose **Verify**\. - - 1. Choose **Add**\. - -The order in which you add the layers is the order in which Lambda later merges the layer content into the execution environment\. You can change the layer merge order using the console\. - -**Update layer order for your function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to configure\. - -1. Under **Layers**, choose **Edit** - -1. Choose one of the layers\. - -1. Choose **Merge earlier** or **Merge later** to adjust the order of the layers\. - -1. Choose **Save**\. - -Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the console to update your functions' layer versions\. - -**Update layer versions for your function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Under **Additional resources**, choose **Layers**\. - -1. Choose the layer to modify\. - -1. Under **Functions using this version**, select the functions you want to modify, then choose **Edit**\. - -1. From **Layer version**, select the layer version to change to\. - -1. Choose **Update functions**\. - -You cannot update functions' layer versions across AWS accounts\. - -### Configuring layers with the API - -To add layers to your function, use the update\-function\-configuration command\. The following example adds two layers: one from the same AWS account as the function, and one from a different account\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3 \ -arn:aws:lambda:us-east-2:111122223333:layer:their-layer:2 -``` - -You should see output similar to the following: - -``` -{ - "FunctionName": "test-layers", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/service-role/lambda-role", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:3", - "CodeSize": 169 - }, - { - "Arn": "arn:aws:lambda:us-east-2:111122223333:layer:their-layer:2", - "CodeSize": 169 - } - ], - "RevisionId": "81cc64f5-5772-449a-b63e-12330476bcc4", - ... -} -``` - -To specify the layer versions to use, you must provide the full Amazon Resource Name \(ARN\) of each layer version\. When you add layers to a function that already has layers, you overwrite the previous list of layers\. Be sure to include all layers every time that you update the layer configuration\. The order in which you add the layers is the order in which Lambda later extracts the layer content into the execution environment\. - - - -To remove all layers, specify an empty list\. - -``` -aws lambda update-function-configuration --function-name my-function --layers [] -``` - -The creator of a layer can delete a version of the layer\. If you're using that layer version in a function, your function continues to run as though the layer version still exists\. However, when you update the layer configuration, you must remove the reference to the deleted version\. - -Layers are versioned, and the content of each layer version is immutable\. The layer owner can release a new layer version to provide updated content\. You can use the API to update the layer versions that your function uses\. - -**Update layer versions for your function** - -To update one or more layer versions for your function, use the update\-function\-configuration command\. Use the `--layers` option with this command to include all of the layer versions for the function, even if you are updating one of the layer versions\. If the function already has layers, the new list overwrites the previous list\. - -The following procedure steps assume that you have packaged the updated layer code into a local file named `layer.zip`\. - -1. \(Optional\) If the new layer version is not published yet, publish the new version\. - - ``` - aws lambda publish-layer-version --layer-name my-layer --description "My layer" --license-info "MIT" \ - --zip-file "fileb://layer.zip" --compatible-runtimes python3.6 python3.7 - ``` - -1. \(Optional\) If the function has more than one layer, get the current layer versions associated with the function\. - - ``` - aws lambda get-function-configuration --function-name my-function --query 'Layers[*].Arn' --output yaml - ``` - -1. Add the new layer version to the function\. In the following example command, the function also has a layer version named `other-layer:5`: - - ``` - aws lambda update-function-configuration --function-name my-function \ - --layers arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2 \ - arn:aws:lambda:us-east-2:123456789012:layer:other-layer:5 - ``` - -## Accessing layer content from your function - -If your Lambda function includes layers, Lambda extracts the layer contents into the `/opt` directory in the function execution environment\. Lambda extracts the layers in the order \(low to high\) listed by the function\. Lambda merges folders with the same name, so if the same file appears in multiple layers, the function uses the version in the last extracted layer\. - -Each [Lambda runtime](lambda-runtimes.md) adds specific `/opt` directory folders to the PATH variable\. Your function code can access the layer content without the need to specify the path\. For more information about path settings in the Lambda execution environment, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. - -## Finding layer information - -To find layers in your AWS account that are compatible with your Lambda function's runtime, use the list\-layers command\. - -``` -aws lambda list-layers --compatible-runtime python3.8 -``` - -You should see output similar to the following: - -``` -{ - "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", - "python3.8", - ] - } - } - ] -} -``` - -To list all layers in your account, you can omit the `--compatible-runtime` option\. The details in the response reflect the latest version of the layer\. - -You can also get the latest version of a layer using the list\-layer\-versions command\. - -``` -aws lambda list-layer-versions --layer-name my-layer --query 'LayerVersions[0].LayerVersionArn' -``` - -## Adding layer permissions - -To use a Lambda function with a layer, you need permission to call the [GetLayerVersion](API_GetLayerVersion.md) API operation on the layer version\. For functions in your AWS account, you can add this permission from your [user policy](access-control-identity-based.md)\. - -To use a layer in another account, the owner of that account must grant your account permission in a [resource\-based policy](access-control-resource-based.md)\. - -For examples, see [Granting layer access to other accounts](access-control-resource-based.md#permissions-resource-xaccountlayer)\. - -## Using AWS SAM to add a layer to a function - -To automate the creation and mapping of layers in your application, use the AWS Serverless Application Model \(AWS SAM\)\. The `AWS::Serverless::LayerVersion` resource type creates a layer version that you can reference from your Lambda function configuration\. - -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - CodeUri: function/. - Description: Call the AWS Lambda API - Timeout: 10 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - Tracing: Active - Layers: - - !Ref libs - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-nodejs-lib - Description: Dependencies for the blank sample app. - ContentUri: lib/. - CompatibleRuntimes: - - nodejs12.x -``` - -When you update your dependencies and deploy, AWS SAM creates a new version of the layer and updates the mapping\. - -## Sample applications - -The GitHub repository for this guide provides blank sample applications that demonstrate the use of layers for dependency management\. -+ **Node\.js** – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) -+ **Python** – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) -+ **Ruby** – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) -+ **Java** – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java) - -For more information about the blank sample app, see [Blank function sample application for AWS Lambda](samples-blank.md)\. For other samples, see [Lambda sample applications](lambda-samples.md)\. diff --git a/doc_source/invocation-retries.md b/doc_source/invocation-retries.md deleted file mode 100644 index 116a32b1..00000000 --- a/doc_source/invocation-retries.md +++ /dev/null @@ -1,43 +0,0 @@ -# Error handling and automatic retries in AWS Lambda - -When you invoke a function, two types of error can occur\. Invocation errors occur when the invocation request is rejected before your function receives it\. Function errors occur when your function's code or [runtime](lambda-runtimes.md) returns an error\. Depending on the type of error, the type of invocation, and the client or service that invokes the function, the retry behavior and the strategy for managing errors varies\. - -Issues with the request, caller, or account can cause invocation errors\. Invocation errors include an error type and status code in the response that indicate the cause of the error\. - -**Common invocation errors** -+ **Request** – The request event is too large or isn't valid JSON, the function doesn't exist, or a parameter value is the wrong type\. -+ **Caller** – The user or service doesn't have permission to invoke the function\. -+ **Account** – The maximum number of function instances are already running, or requests are being made too quickly\. - -Clients such as the AWS CLI and the AWS SDK retry on client timeouts, throttling errors \(429\), and other errors that aren't caused by a bad request\. For a full list of invocation errors, see [Invoke](API_Invoke.md)\. - -Function errors occur when your function code or the runtime that it uses return an error\. - -**Common function errors** -+ **Function** – Your function's code throws an exception or returns an error object\. -+ **Runtime** – The runtime terminated your function because it ran out of time, detected a syntax error, or failed to marshal the response object into JSON\. The function exited with an error code\. - -Unlike invocation errors, function errors don't cause Lambda to return a 400\-series or 500\-series status code\. If the function returns an error, Lambda indicates this by including a header named `X-Amz-Function-Error`, and a JSON\-formatted response with the error message and other details\. For examples of function errors in each language, see the following topics\. -+ [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) -+ [AWS Lambda function errors in Python](python-exceptions.md) -+ [AWS Lambda function errors in Ruby](ruby-exceptions.md) -+ [AWS Lambda function errors in Java](java-exceptions.md) -+ [AWS Lambda function errors in Go](golang-exceptions.md) -+ [AWS Lambda function errors in C\#](csharp-exceptions.md) -+ [AWS Lambda function errors in PowerShell](powershell-exceptions.md) - -When you invoke a function directly, you determine the strategy for handling errors\. You can retry, send the event to a queue for debugging, or ignore the error\. Your function's code might have run completely, partially, or not at all\. If you retry, ensure that your function's code can handle the same event multiple times without causing duplicate transactions or other unwanted side effects\. - -When you invoke a function indirectly, you need to be aware of the retry behavior of the invoker and any service that the request encounters along the way\. This includes the following scenarios\. -+ **Asynchronous invocation** – Lambda retries function errors twice\. If the function doesn't have enough capacity to handle all incoming requests, events might wait in the queue for hours or days to be sent to the function\. You can configure a dead\-letter queue on the function to capture events that weren't successfully processed\. For more information, see [Asynchronous invocation](invocation-async.md)\. -+ **Event source mappings** – Event source mappings that read from streams retry the entire batch of items\. Repeated errors block processing of the affected shard until the error is resolved or the items expire\. To detect stalled shards, you can monitor the [Iterator Age](monitoring-metrics.md) metric\. - - For event source mappings that read from a queue, you determine the length of time between retries and destination for failed events by configuring the visibility timeout and redrive policy on the source queue\. For more information, see [Lambda event source mappings](invocation-eventsourcemapping.md) and the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md)\. -+ **AWS services** – AWS services can invoke your function [synchronously](invocation-sync.md) or asynchronously\. For synchronous invocation, the service decides whether to retry\. For example, Amazon S3 batch operations retries the operation if the Lambda function returns a `TemporaryFailure` response code\. Services that proxy requests from an upstream user or client may have a retry strategy or may relay the error response back to the requestor\. For example, API Gateway always relays the error response back to the requestor\. - - For asynchronous invocation, the behavior is the same as when you invoke the function synchronously\. For more information, see the service\-specific topics under [Using AWS Lambda with other services](lambda-services.md) and the invoking service's documentation\. -+ **Other accounts and clients** – When you grant access to other accounts, you can use [resource\-based policies](access-control-resource-based.md) to restrict the services or resources they can configure to invoke your function\. To protect your function from being overloaded, consider putting an API layer in front of your function with [Amazon API Gateway](services-apigateway.md)\. - -To help you deal with errors in Lambda applications, Lambda integrates with services like Amazon CloudWatch and AWS X\-Ray\. You can use a combination of logs, metrics, alarms, and tracing to quickly detect and identify issues in your function code, API, or other resources that support your application\. For more information, see [Monitoring and troubleshooting Lambda applications](lambda-monitoring.md)\. - -For a sample application that uses a CloudWatch Logs subscription, X\-Ray tracing, and a Lambda function to detect and process errors, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. \ No newline at end of file diff --git a/doc_source/invocation-scaling.md b/doc_source/invocation-scaling.md deleted file mode 100644 index ccec4642..00000000 --- a/doc_source/invocation-scaling.md +++ /dev/null @@ -1,69 +0,0 @@ -# Lambda function scaling - -The first time you invoke your function, AWS Lambda creates an instance of the function and runs its handler method to process the event\. When the function returns a response, it stays active and waits to process additional events\. If you invoke the function again while the first event is being processed, Lambda initializes another instance, and the function processes the two events concurrently\. As more events come in, Lambda routes them to available instances and creates new instances as needed\. When the number of requests decreases, Lambda stops unused instances to free up scaling capacity for other functions\. - -The default regional concurrency quota starts at 1,000 instances\. For more information, or to request an increase on this quota, see [Lambda quotas](gettingstarted-limits.md)\. To allocate capacity on a per\-function basis, you can configure functions with [reserved concurrency](configuration-concurrency.md)\. - -Your functions' *concurrency* is the number of instances that serve requests at a given time\. For an initial burst of traffic, your functions' cumulative concurrency in a Region can reach an initial level of between 500 and 3000, which varies per Region\. Note that the burst concurrency quota is not per\-function; it applies to all your functions in the Region\. - -**Burst concurrency quotas** -+ **3000** – US West \(Oregon\), US East \(N\. Virginia\), Europe \(Ireland\) -+ **1000** – Asia Pacific \(Tokyo\), Europe \(Frankfurt\), US East \(Ohio\) -+ **500** – Other Regions - -After the initial burst, your functions' concurrency can scale by an additional 500 instances each minute\. This continues until there are enough instances to serve all requests, or until a concurrency limit is reached\. When requests come in faster than your function can scale, or when your function is at maximum concurrency, additional requests fail with a throttling error \(429 status code\)\. - -The following example shows a function processing a spike in traffic\. As invocations increase exponentially, the function scales up\. It initializes a new instance for any request that can't be routed to an available instance\. When the burst concurrency limit is reached, the function starts to scale linearly\. If this isn't enough concurrency to serve all requests, additional requests are throttled and should be retried\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling.throttling.png) Throttling possible - -The function continues to scale until the account's concurrency limit for the function's Region is reached\. The function catches up to demand, requests subside, and unused instances of the function are stopped after being idle for some time\. Unused instances are frozen while they're waiting for requests and don't incur any charges\. - -When your function scales up, the first request served by each instance is impacted by the time it takes to load and initialize your code\. If your [initialization code](foundation-progmodel.md) takes a long time, the impact on average and percentile latency can be significant\. To enable your function to scale without fluctuations in latency, use [provisioned concurrency](provisioned-concurrency.md)\. The following example shows a function with provisioned concurrency processing a spike in traffic\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -When you configure a number for provisioned concurrency, Lambda initializes that number of execution environments\. Your function is ready to serve a burst of incoming requests with very low latency\. Note that configuring [provisioned concurrency](provisioned-concurrency.md) incurs charges to your AWS account\. - - When all provisioned concurrency is in use, the function scales up normally to handle any additional requests\. - -Application Auto Scaling takes this a step further by providing autoscaling for provisioned concurrency\. With Application Auto Scaling, you can create a target tracking scaling policy that adjusts provisioned concurrency levels automatically, based on the utilization metric that Lambda emits\. [Use the Application Auto Scaling API](configuration-concurrency.md#configuration-concurrency-api) to register an alias as a scalable target and create a scaling policy\. - -In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -When you invoke your function asynchronously, by using an event source mapping or another AWS service, scaling behavior varies\. For example, event source mappings that read from a stream are limited by the number of shards in the stream\. Scaling capacity that is unused by an event source is available for use by other clients and event sources\. For more information, see the following topics\. -+ [Asynchronous invocation](invocation-async.md) -+ [Lambda event source mappings](invocation-eventsourcemapping.md) -+ [Error handling and automatic retries in AWS Lambda](invocation-retries.md) -+ [Using AWS Lambda with other services](lambda-services.md) - -You can monitor concurrency levels in your account by using the following metrics: - -**Concurrency metrics** -+ `ConcurrentExecutions` -+ `UnreservedConcurrentExecutions` -+ `ProvisionedConcurrentExecutions` -+ `ProvisionedConcurrencyInvocations` -+ `ProvisionedConcurrencySpilloverInvocations` -+ `ProvisionedConcurrencyUtilization` - -For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. \ No newline at end of file diff --git a/doc_source/invocation-sync.md b/doc_source/invocation-sync.md deleted file mode 100644 index 2163926d..00000000 --- a/doc_source/invocation-sync.md +++ /dev/null @@ -1,85 +0,0 @@ -# Synchronous invocation - -When you invoke a function synchronously, Lambda runs the function and waits for a response\. When the function completes, Lambda returns the response from the function's code with additional data, such as the version of the function that was invoked\. To invoke a function synchronously with the AWS CLI, use the `invoke` command\. - -``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{ "key": "value" }' response.json -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the following output: - -``` -{ - "ExecutedVersion": "$LATEST", - "StatusCode": 200 -} -``` - -The following diagram shows clients invoking a Lambda function synchronously\. Lambda sends the events directly to the function and sends the function's response back to the invoker\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/invocation-sync.png) - -The `payload` is a string that contains an event in JSON format\. The name of the file where the AWS CLI writes the response from the function is `response.json`\. If the function returns an object or error, the response is the object or error in JSON format\. If the function exits without error, the response is `null`\. - -The output from the command, which is displayed in the terminal, includes information from headers in the response from Lambda\. This includes the version that processed the event \(useful when you use [aliases](configuration-aliases.md)\), and the status code returned by Lambda\. If Lambda was able to run the function, the status code is 200, even if the function returned an error\. - -**Note** -For functions with a long timeout, your client might be disconnected during synchronous invocation while it waits for a response\. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep\-alive settings\. - -If Lambda isn't able to run the function, the error is displayed in the output\. - -``` -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload value response.json -``` - -You should see the following output: - -``` -An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Unrecognized token 'value': was expecting ('true', 'false' or 'null') - at [Source: (byte[])"value"; line: 1, column: 11] -``` - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -For more information about the `Invoke` API, including a full list of parameters, headers, and errors, see [Invoke](API_Invoke.md)\. - -When you invoke a function directly, you can check the response for errors and retry\. The AWS CLI and AWS SDK also automatically retry on client timeouts, throttling, and service errors\. For more information, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. \ No newline at end of file diff --git a/doc_source/java-context.md b/doc_source/java-context.md deleted file mode 100644 index f5e46aff..00000000 --- a/doc_source/java-context.md +++ /dev/null @@ -1,107 +0,0 @@ -# AWS Lambda context object in Java - -When Lambda runs your function, it passes a context object to the [handler](java-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. - -**Context methods** -+ `getRemainingTimeInMillis()` – Returns the number of milliseconds left before the execution times out\. -+ `getFunctionName()` – Returns the name of the Lambda function\. -+ `getFunctionVersion()` – Returns the [version](configuration-versions.md) of the function\. -+ `getInvokedFunctionArn()` – Returns the Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `getMemoryLimitInMB()` – Returns the amount of memory that's allocated for the function\. -+ `getAwsRequestId()` – Returns the identifier of the invocation request\. -+ `getLogGroupName()` – Returns the log group for the function\. -+ `getLogStreamName()` – Returns the log stream for the function instance\. -+ `getIdentity()` – \(mobile apps\) Returns information about the Amazon Cognito identity that authorized the request\. -+ `getClientContext()` – \(mobile apps\) Returns the client context that's provided to Lambda by the client application\. -+ `getLogger()` – Returns the [logger object](java-logging.md) for the function\. - -The following example shows a function that uses the context object to access the Lambda logger\. - -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** - -``` -package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) -... - -// Handler value: example.Handler -public class Handler implements RequestHandler, String>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(Map event, Context context) - { - LambdaLogger logger = context.getLogger(); - String response = new String("200 OK"); - // log execution details - logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - logger.log("CONTEXT: " + gson.toJson(context)); - // process event - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - return response; - } -} -``` - -The function serializes the context object into JSON and records it in its log stream\. - -**Example log output** - -``` -START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST -... -CONTEXT: -{ - "memoryLimit": 512, - "awsRequestId": "6bc28136-xmpl-4365-b021-0ce6b2e64ab0", - "functionName": "java-console", - ... -} -... -END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 -REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms -``` - -The interface for the context object is available in the [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library\. You can implement this interface to create a context class for testing\. The following example shows a context class that returns dummy values for most properties and a working test logger\. - -**Example [src/test/java/example/TestContext\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/test/java/example/TestContext.java)** - -``` -package example; - -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java); -import [com\.amazonaws\.services\.lambda\.runtime\.CognitoIdentity](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/CognitoIdentity.java); -import [com\.amazonaws\.services\.lambda\.runtime\.ClientContext](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/ClientContext.java); -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) - -public class TestContext implements Context{ - public TestContext() {} - public String getAwsRequestId(){ - return new String("495b12a8-xmpl-4eca-8168-160484189f99"); - } - public String getLogGroupName(){ - return new String("/aws/lambda/my-function"); - } - ... - public LambdaLogger getLogger(){ - return new TestLogger(); - } - -} -``` - -For more information on logging, see [AWS Lambda function logging in Java](java-logging.md)\. - -## Context in sample applications - -The GitHub repository for this guide includes sample applications that demonstrate the use of the context object\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -All of the sample applications have a test context class for unit tests\. The `java-basic` application shows you how to use the context object to get a logger\. It uses SLF4J and Log4J 2 to provide a logger that works for local unit tests\. \ No newline at end of file diff --git a/doc_source/java-exceptions.md b/doc_source/java-exceptions.md deleted file mode 100644 index e4963ecc..00000000 --- a/doc_source/java-exceptions.md +++ /dev/null @@ -1,218 +0,0 @@ -# AWS Lambda function errors in Java - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Syntax](#java-exceptions-syntax) -+ [How it works](#java-exceptions-how) -+ [Creating a function that returns exceptions](#java-exceptions-createfunction) -+ [Using the Lambda console](#java-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#java-exceptions-cli) -+ [Error handling in other AWS services](#java-exceptions-other-services) -+ [Sample applications](#java-exceptions-samples) -+ [What's next?](#java-exceptions-next-up) - -## Syntax - -In the following example, the runtime fails to deserialize the event into an object\. The input is a valid JSON type, but it doesn't match the type expected by the handler method\. - -**Example Lambda runtime error** - -``` -{ - "errorMessage": "An error occurred during JSON parsing", - "errorType": "java.lang.RuntimeException", - "stackTrace": [], - "cause": { - "errorMessage": "com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "java.io.UncheckedIOException", - "stackTrace": [], - "cause": { - "errorMessage": "Can not construct instance of java.lang.Integer from String value '1000,10': not a valid Integer value\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@35fc6dc4; line: 1, column: 1] (through reference chain: java.lang.Object[0])", - "errorType": "com.fasterxml.jackson.databind.exc.InvalidFormatException", - "stackTrace": [ - "com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)", - "com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:907)", - ... - ] - } - } -} -``` - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Creating a function that returns exceptions - -You can create a Lambda function that displays human\-readable error messages to users\. - -**Note** -To test this code, you need to include [InputLengthException\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) in your project src folder\. - -**Example [src/main/java/example/HandlerDivide\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerDivide.java) – Runtime exception** - -``` -import java.util.List; - - // Handler value: example.HandlerDivide - public class HandlerDivide implements RequestHandler, Integer>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public Integer handleRequest(List event, Context context) - { - LambdaLogger logger = context.getLogger(); - // process event - if ( event.size() != 2 ) - { - throw new InputLengthException("Input must be a list that contains 2 numbers."); - } - int numerator = event.get(0); - int denominator = event.get(1); - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - return numerator/denominator; - } - } -``` - -When the function throws `InputLengthException`, the Java runtime serializes it into the following document\. - -**Example error document \(whitespace added\)** - -``` -{ - "errorMessage":"Input must be a list that contains 2 numbers.", - "errorType":"java.lang.InputLengthException", - "stackTrace": [ - "example.HandlerDivide.handleRequest(HandlerDivide.java:23)", - "example.HandlerDivide.handleRequest(HandlerDivide.java:14)" - ] - } -``` - -In this example, [InputLengthException](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/InputLengthException.java) is a `RuntimeException`\. The `RequestHandler` [interface](java-handler.md#java-handler-interfaces) does not allow checked exceptions\. The `RequestStreamHandler` interface supports throwing `IOException` errors\. - -The return statement in the previous example can also throw a runtime exception\. - -``` - return numerator/denominator; -``` - -This code can return an arithmetic error\. - -``` -{"errorMessage":"/ by zero","errorType":"java.lang.ArithmeticException","stackTrace":["example.HandlerDivide.handleRequest(HandlerDivide.java:28)","example.HandlerDivide.handleRequest(HandlerDivide.java:13)"]} -``` - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -``` -{"errorMessage":"Input must contain 2 numbers.","errorType":"java.lang.InputLengthException","stackTrace": ["example.HandlerDivide.handleRequest(HandlerDivide.java:23)","example.HandlerDivide.handleRequest(HandlerDivide.java:14)"]} -``` - -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Java](java-logging.md)\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting Java code in AWS Lambda](java-tracing.md)\. - -## Sample applications - -The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -The `java-basic` function includes a handler \(`HandlerDivide`\) that returns a custom runtime exception\. The `HandlerStream` handler implements the `RequestStreamHandler` and can throw an `IOException` checked exception\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Java](java-logging.md) page\. \ No newline at end of file diff --git a/doc_source/java-handler.md b/doc_source/java-handler.md deleted file mode 100644 index 8a6a2324..00000000 --- a/doc_source/java-handler.md +++ /dev/null @@ -1,177 +0,0 @@ -# AWS Lambda function handler in Java - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -In the following example, a class named `Handler` defines a handler method named `handleRequest`\. The handler method takes an event and context object as input and returns a string\. - -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java)** - -``` -package example; -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) -... - -// Handler value: example.Handler -public class Handler implements RequestHandler, String>{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(Map event, Context context) - { - LambdaLogger logger = context.getLogger(); - String response = new String("200 OK"); - // log execution details - logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - logger.log("CONTEXT: " + gson.toJson(context)); - // process event - logger.log("EVENT: " + gson.toJson(event)); - logger.log("EVENT TYPE: " + event.getClass().toString()); - return response; - } -} -``` - -The [Lambda runtime](lambda-runtimes.md) receives an event as a JSON\-formatted string and converts it into an object\. It passes the event object to your function handler along with a context object that provides details about the invocation and the function\. You tell the runtime which method to invoke by setting the handler parameter on your function's configuration\. - -**Handler formats** -+ `package.Class::method` – Full format\. For example: `example.Handler::handleRequest`\. -+ `package.Class` – Abbreviated format for classes that implement a [handler interface](#java-handler-interfaces)\. For example: `example.Handler`\. - -You can add [initialization code](https://docs.aws.amazon.com/lambda/latest/operatorguide/static-initialization.html) outside of your handler method to reuse resources across multiple invocations\. When the runtime loads your handler, it runs static code and the class constructor\. Resources that are created during initialization stay in memory between invocations, and can be reused by the handler thousands of times\. - -In the following example, the logger and the serializer are created when the function serves its first event\. Subsequent events served by the same function instance are much faster because those resources already exist\. - -**Example [HandlerS3\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerS3.java) – Initialization code** - -``` -public class HandlerS3 implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(S3Event event, Context context) - { - ... - } -``` - -The GitHub repo for this guide provides easy\-to\-deploy sample applications that demonstrate a variety of handler types\. For details, see the [end of this topic](#java-handler-samples)\. - -**Topics** -+ [Choosing input and output types](#java-handler-types) -+ [Handler interfaces](#java-handler-interfaces) -+ [Sample handler code](#java-handler-samples) - -## Choosing input and output types - -You specify the type of object that the event maps to in the handler method's signature\. In the preceding example, the Java runtime deserializes the event into a type that implements the `Map` interface\. String\-to\-string maps work for flat events like the following: - -**Example [Event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/event.json) – Weather data** - -``` -{ - "temperatureK": 281, - "windKmh": -3, - "humidityPct": 0.55, - "pressureHPa": 1020 -} -``` - -However, the value of each field must be a string or number\. If the event includes a field that has an object as a value, the runtime can't deserialize it and returns an error\. - -Choose an input type that works with the event data that your function processes\. You can use a basic type, a generic type, or a well\-defined type\. - -**Input types** -+ `Integer`, `Long`, `Double`, etc\. – The event is a number with no additional formatting—for example, `3.5`\. The runtime converts the value into an object of the specified type\. -+ `String` – The event is a JSON string, including quotes—for example, `"My string."`\. The runtime converts the value \(without quotes\) into a `String` object\. -+ `Type`, `Map` etc\. – The event is a JSON object\. The runtime deserializes it into an object of the specified type or interface\. -+ `List`, `List`, `List`, etc\. – The event is a JSON array\. The runtime deserializes it into an object of the specified type or interface\. -+ `InputStream` – The event is any JSON type\. The runtime passes a byte stream of the document to the handler without modification\. You deserialize the input and write output to an output stream\. -+ Library type – For events sent by AWS services, use the types in the [aws\-lambda\-java\-events](java-package.md) library\. - -If you define your own input type, it should be a deserializable, mutable plain old Java object \(POJO\), with a default constructor and properties for each field in the event\. Keys in the event that don't map to a property as well as properties that aren't included in the event are dropped without error\. - -The output type can be an object or `void`\. The runtime serializes return values into text\. If the output is an object with fields, the runtime serializes it into a JSON document\. If it's a type that wraps a primitive value, the runtime returns a text representation of that value\. - -## Handler interfaces - -The [aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) library defines two interfaces for handler methods\. Use the provided interfaces to simplify handler configuration and validate the handler method signature at compile time\. - -**** -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestHandler.java) -+ [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) - -The `RequestHandler` interface is a generic type that takes two parameters: the input type and the output type\. Both types must be objects\. When you use this interface, the Java runtime deserializes the event into an object with the input type, and serializes the output into text\. Use this interface when the built\-in serialization works with your input and output types\. - -**Example [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Handler interface** - -``` -// Handler value: example.Handler -public class Handler implements RequestHandler, String>{ - @Override - public String handleRequest(Map event, Context context) -``` - -To use your own serialization, implement the `RequestStreamHandler` interface\. With this interface, Lambda passes your handler an input stream and output stream\. The handler reads bytes from the input stream, writes to the output stream, and returns void\. - -The following example uses buffered reader and writer types to work with the input and output streams\. It uses the [Gson](https://github.com/google/gson) library for serialization and deserialization\. - -**Example [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java)** - -``` -import [com\.amazonaws\.services\.lambda\.runtime\.Context](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/Context.java) -import [com\.amazonaws\.services\.lambda\.runtime\.RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) -import [com\.amazonaws\.services\.lambda\.runtime\.LambdaLogger](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/LambdaLogger.java) -... -// Handler value: example.HandlerStream -public class HandlerStream implements RequestStreamHandler { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException - { - LambdaLogger logger = context.getLogger(); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("US-ASCII"))); - PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream, Charset.forName("US-ASCII")))); - try - { - HashMap event = gson.fromJson(reader, HashMap.class); - logger.log("STREAM TYPE: " + inputStream.getClass().toString()); - logger.log("EVENT TYPE: " + event.getClass().toString()); - writer.write(gson.toJson(event)); - if (writer.checkError()) - { - logger.log("WARNING: Writer encountered an error."); - } - } - catch (IllegalStateException | JsonSyntaxException exception) - { - logger.log(exception.toString()); - } - finally - { - reader.close(); - writer.close(); - } - } -} -``` - -## Sample handler code - -The GitHub repository for this guide includes sample applications that demonstrate the use of various handler types and interfaces\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -The `java-events` and `s3-java` applications take an AWS service event as input and return a string\. The `java-basic` application includes several types of handlers: -+ [Handler\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/Handler.java) – Takes a `Map` as input\. -+ [HandlerInteger\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerInteger.java) – Takes an `Integer` as input\. -+ [HandlerList\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerList.java) – Takes a `List` as input\. -+ [HandlerStream\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerStream.java) – Takes an `InputStream` and `OutputStream` as input\. -+ [HandlerString\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerString.java) – Takes a `String` as input\. -+ [HandlerWeatherData\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic/src/main/java/example/HandlerWeatherData.java) – Takes a custom type as input\. - -To test different handler types, just change the handler value in the AWS SAM template\. For detailed instructions, see the sample application's readme file\. diff --git a/doc_source/java-image.md b/doc_source/java-image.md deleted file mode 100644 index afe36a1e..00000000 --- a/doc_source/java-image.md +++ /dev/null @@ -1,65 +0,0 @@ -# Deploy Java Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Java function: -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for Java](#java-image-base) -+ [Using a Java base image](#java-image-instructions) -+ [Java runtime interface clients](#java-image-clients) -+ [Deploy the container image](#java-image-deploy) - -## AWS base images for Java - -AWS provides the following base images for Java: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| 11 | Java 11 | Amazon Linux 2 | [Dockerfile for Java 11 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java11/Dockerfile.java11) | | -| 8\.al2 | Java 8 | Amazon Linux 2 | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8.al2/Dockerfile.java8.al2) | | -| 8 | Java 8 | Amazon Linux | [Dockerfile for Java 8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/java8/Dockerfile.java8) | | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/java](https://gallery.ecr.aws/lambda/java) - -## Using a Java base image - -For instructions on how to use a Java base image, choose the **usage** tab on [Lambda base images for Java](https://gallery.ecr.aws/lambda/java) in the *Amazon ECR repository*\. - -## Java runtime interface clients - -Install the runtime interface client for Java using the Apache Maven package manager\. Add the following to your `pom.xml` file: - -``` - - com.amazonaws - aws-lambda-java-runtime-interface-client - 1.0.0 - -``` - -For package details, see [Lambda RIC](https://search.maven.org/artifact/com.amazonaws/aws-lambda-java-runtime-interface-client) in Maven Central Repository\. - -You can also view the Java client source code in the [AWS Lambda Java Support Libraries](https://github.com/aws/aws-lambda-java-libs) repository on GitHub\. - -After your container image resides in the Amazon ECR container registry, you can [create and run](gettingstarted-images.md) the Lambda function\. - -## Deploy the container image - -For a new function, you deploy the Java image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/java-logging.md b/doc_source/java-logging.md deleted file mode 100644 index 4a43b225..00000000 --- a/doc_source/java-logging.md +++ /dev/null @@ -1,326 +0,0 @@ -# AWS Lambda function logging in Java - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#java-logging-output) -+ [Using the Lambda console](#java-logging-console) -+ [Using the CloudWatch console](#java-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#java-logging-cli) -+ [Deleting logs](#java-logging-delete) -+ [Advanced logging with Log4j 2 and SLF4J](#java-logging-log4j2) -+ [Sample logging code](#java-logging-samples) - -## Creating a function that returns logs - -To output logs from your function code, you can use methods on [java\.lang\.System](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html), or any logging module that writes to `stdout` or `stderr`\. The [aws\-lambda\-java\-core](java-package.md) library provides a logger class named `LambdaLogger` that you can access from the context object\. The logger class supports multiline logs\. - -The following example uses the `LambdaLogger` logger provided by the context object\. - -**Example Handler\.java** - -``` -// Handler value: example.Handler -public class Handler implements RequestHandler{ - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(Object event, Context context) - { - LambdaLogger logger = context.getLogger(); - String response = new String("SUCCESS"); - // log execution details - logger.log("ENVIRONMENT VARIABLES: " + gson.toJson(System.getenv())); - logger.log("CONTEXT: " + gson.toJson(context)); - // process event - logger.log("EVENT: " + gson.toJson(event)); - return response; - } -} -``` - -**Example log format** - -``` -START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST -ENVIRONMENT VARIABLES: -{ - "_HANDLER": "example.Handler", - "AWS_EXECUTION_ENV": "AWS_Lambda_java8", - "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "512", - ... -} -CONTEXT: -{ - "memoryLimit": 512, - "awsRequestId": "6bc28136-xmpl-4365-b021-0ce6b2e64ab0", - "functionName": "java-console", - ... -} -EVENT: -{ - "records": [ - { - "messageId": "19dd0b57-xmpl-4ac1-bd88-01bbb068cb78", - "receiptHandle": "MessageReceiptHandle", - "body": "Hello from SQS!", - ... - } - ] -} -END RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 -REPORT RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Duration: 198.50 ms Billed Duration: 200 ms Memory Size: 512 MB Max Memory Used: 90 MB Init Duration: 524.75 ms -``` - -The Java runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details: - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. - -## Advanced logging with Log4j 2 and SLF4J - -**Note** - AWS Lambda does not include Log4j2 in its managed runtimes or base container images\. These are therefore not affected by the issues described in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. - For cases where a customer function includes an impacted Log4j2 version, we have applied a change to the Lambda Java [managed runtimes](lambda-runtimes.md) and [base container images](java-image.md) that helps to mitigate the issues in CVE\-2021\-44228, CVE\-2021\-45046, and CVE\-2021\-45105\. As a result of this change, customers using Log4J2 may see an additional log entry, similar to "`Transforming org/apache/logging/log4j/core/lookup/JndiLookup (java.net.URLClassLoader@...)`"\. Any log strings that reference the jndi mapper in the Log4J2 output will be replaced with "`Patched JndiLookup::lookup()`"\. - Independent of this change, we strongly encourage all customers whose functions include Log4j2 to update to the latest version\. Specifically, customers using the aws\-lambda\-java\-log4j2 library in their functions should update to version 1\.5\.0 \(or later\), and redeploy their functions\. This version updates the underlying Log4j2 utility dependencies to version 2\.17\.0 \(or later\)\. The updated aws\-lambda\-java\-log4j2 binary is available at the [Maven repository](https://repo1.maven.org/maven2/com/amazonaws/aws-lambda-java-log4j2/) and its source code is available in [Github](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2)\. - -To customize log output, support logging during unit tests, and log AWS SDK calls, use Apache Log4j 2 with SLF4J\. Log4j is a logging library for Java programs that enables you to configure log levels and use appender libraries\. SLF4J is a facade library that lets you change which library you use without changing your function code\. - -To add the request ID to your function's logs, use the appender in the [aws\-lambda\-java\-log4j2](java-package.md) library\. The following example shows a Log4j 2 configuration file that adds a timestamp and request ID to all logs\. - -**Example [src/main/resources/log4j2\.xml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java/src/main/resources/log4j2.xml) – Appender configuration** - -``` - - - - - %d{yyyy-MM-dd HH:mm:ss} %X{AWSRequestId} %-5p %c{1} - %m%n - - - - - - - - - - - -``` - -With this configuration, each line is prepended with the date, time, request ID, log level, and class name\. - -**Example log format with appender** - -``` -START RequestId: 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 Version: $LATEST -2020-03-18 08:52:43 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 INFO Handler - ENVIRONMENT VARIABLES: -{ - "_HANDLER": "example.Handler", - "AWS_EXECUTION_ENV": "AWS_Lambda_java8", - "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "512", - ... -} -2020-03-18 08:52:43 6bc28136-xmpl-4365-b021-0ce6b2e64ab0 INFO Handler - CONTEXT: -{ - "memoryLimit": 512, - "awsRequestId": "6bc28136-xmpl-4365-b021-0ce6b2e64ab0", - "functionName": "java-console", - ... -} -``` - -SLF4J is a facade library for logging in Java code\. In your function code, you use the SLF4J logger factory to retrieve a logger with methods for log levels like `info()` and `warn()`\. In your build configuration, you include the logging library and SLF4J adapter in the classpath\. By changing the libraries in the build configuration, you can change the logger type without changing your function code\. SLF4J is required to capture logs from the SDK for Java\. - -In the following example, the handler class uses SLF4J to retrieve a logger\. - -**Example [src/main/java/example/HandlerS3\.java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/src/main/java/example/HandlerS3.java) – Logging with SLF4J** - -``` -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// Handler value: example.Handler -public class HandlerS3 implements RequestHandler{ - private static final Logger logger = LoggerFactory.getLogger(HandlerS3.class); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - @Override - public String handleRequest(S3Event event, Context context) - { - ... - logger.info("RECORD: " + record); - logger.info("SOURCE BUCKET: " + srcBucket); - logger.info("SOURCE KEY: " + srcKey); - ... - } -} -``` - -The build configuration takes runtime dependencies on the Lambda appender and SLF4J adapter, and implementation dependencies on Log4J 2\. - -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events/build.gradle) – Logging dependencies** - -``` -dependencies { - ... - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - ... -} -``` - -When you run your code locally for tests, the context object with the Lambda logger is not available, and there's no request ID for the Lambda appender to use\. For example test configurations, see the sample applications in the next section\. - -## Sample logging code - -The GitHub repository for this guide includes sample applications that demonstrate the use of various logging configurations\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -The `java-basic` sample application shows a minimal logging configuration that supports logging tests\. The handler code uses the `LambdaLogger` logger provided by the context object\. For tests, the application uses a custom `TestLogger` class that implements the `LambdaLogger` interface with a Log4j 2 logger\. It uses SLF4J as a facade for compatibility with the AWS SDK\. Logging libraries are excluded from build output to keep the deployment package small\. \ No newline at end of file diff --git a/doc_source/java-package-eclipse.md b/doc_source/java-package-eclipse.md deleted file mode 100644 index c0c3a2a5..00000000 --- a/doc_source/java-package-eclipse.md +++ /dev/null @@ -1,104 +0,0 @@ -# Creating a deployment package using Eclipse - -This section shows how to package your Java code into a deployment package using Eclipse IDE and Maven plugin for Eclipse\. - -**Note** -The AWS SDK Eclipse Toolkit provides an Eclipse plugin for you to both create a deployment package and also upload it to create a Lambda function\. If you can use Eclipse IDE as your development environment, this plugin enables you to author Java code, create and upload a deployment package, and create your Lambda function\. For more information, see the [AWS Toolkit for Eclipse Getting Started Guide](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/)\. For an example of using the toolkit for authoring Lambda functions, see [Using Lambda with the AWS toolkit for Eclipse](https://docs.aws.amazon.com/AWSToolkitEclipse/latest/GettingStartedGuide/lambda.html)\. - -**Topics** -+ [Prerequisites](#java-package-eclipse-prereqs) -+ [Create and build a project](#java-package-eclipse-create) - -## Prerequisites - -Install the **Maven** Plugin for Eclipse\. - -1. Start Eclipse\. From the **Help** menu in Eclipse, choose **Install New Software**\. - -1. In the **Install** window, type **http://download\.eclipse\.org/technology/m2e/releases** in the **Work with:** box, and choose **Add**\. - -1. Follow the steps to complete the setup\. - -## Create and build a project - -In this step, you start Eclipse and create a Maven project\. You will add the necessary dependencies, and build the project\. The build will produce a \.jar, which is your deployment package\. - -1. Create a new Maven project in Eclipse\. - - 1. From the **File** menu, choose **New**, and then choose **Project**\. - - 1. In the **New Project** window, choose **Maven Project**\. - - 1. In the **New Maven Project** window, choose **Create a simple project**, and leave other default selections\. - - 1. In the **New Maven Project**, **Configure project** windows, type the following **Artifact** information: - + **Group Id**: doc\-examples - + **Artifact Id**: lambda\-java\-example - + **Version**: 0\.0\.1\-SNAPSHOT - + **Packaging**: jar - + **Name**: lambda\-java\-example - -1. Add the `aws-lambda-java-core` dependency to the `pom.xml` file\. - - It provides definitions of the `RequestHandler`, `RequestStreamHandler`, and `Context` interfaces\. This allows you to compile code that you can use with AWS Lambda\. - - 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Dependency**\. - - 1. In the **Add Dependency** windows, type the following values: - - **Group Id:** com\.amazonaws - - **Artifact Id:** aws\-lambda\-java\-core - - **Version:** 1\.2\.1 -**Note** -If you are following other tutorial topics in this guide, the specific tutorials might require you to add more dependencies\. Make sure to add those dependencies as required\. - -1. Add Java class to the project\. - - 1. Open the context \(right\-click\) menu for the `src/main/java` subdirectory in the project, choose **New**, and then choose **Class**\. - - 1. In the **New Java Class** window, type the following values: - - - + **Package**: **example** - + **Name**: **Hello** - - -**Note** -If you are following other tutorial topics in this guide, the specific tutorials might recommend different package name or class name\. - - 1. Add your Java code\. If you are following other tutorial topics in this guide, add the provided code\. - -1. Build the project\. - - Open the context \(right\-click\) menu for the project in **Package Explorer**, choose **Run As**, and then choose **Maven Build \.\.\.**\. In the **Edit Configuration** window, type **package** in the **Goals** box\. -**Note** -The resulting \.jar, `lambda-java-example-0.0.1-SNAPSHOT.jar`, is not the final standalone \.jar that you can use as your deployment package\. In the next step, you add the Apache `maven-shade-plugin` to create the standalone \.jar\. For more information, go to [Apache Maven Shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/)\. - -1. Add the `maven-shade-plugin` plugin and rebuild\. - - The maven\-shade\-plugin will take artifacts \(jars\) produced by the *package* goal \(produces customer code \.jar\), and created a standalone \.jar that contains the compiled customer code, and the resolved dependencies from the `pom.xml`\. - - 1. Open the context \(right\-click\) menu for the `pom.xml` file, choose **Maven**, and then choose **Add Plugin**\. - - 1. In the **Add Plugin** window, type the following values: - - - + **Group Id:** org\.apache\.maven\.plugins - + **Artifact Id:** maven\-shade\-plugin - + **Version:** 3\.2\.2 - - 1. Now build again\. - - This time we will create the jar as before, and then use the `maven-shade-plugin` to pull in dependencies to make the standalone \.jar\. - - 1. Open the context \(right\-click\) menu for the project, choose **Run As**, and then choose **Maven build \.\.\.**\. - - 1. In the **Edit Configuration** windows, type **package shade:shade** in the **Goals** box\. - - 1. Choose `Run`\. - - You can find the resulting standalone \.jar \(that is, your deployment package\), in the `/target `subdirectory\. - - Open the context \(right\-click\) menu for the `/target` subdirectory, choose **Show In**, choose **System Explorer**, and you will find the `lambda-java-example-0.0.1-SNAPSHOT.jar`\. \ No newline at end of file diff --git a/doc_source/java-package.md b/doc_source/java-package.md deleted file mode 100644 index ac307121..00000000 --- a/doc_source/java-package.md +++ /dev/null @@ -1,336 +0,0 @@ -# Deploy Java Lambda functions with \.zip or JAR file archives - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -This page describes how to create your deployment package as a \.zip file or Jar file, and then use the deployment package to deploy your function code to AWS Lambda using the AWS Command Line Interface \(AWS CLI\)\. - -**Topics** -+ [Prerequisites](#java-package-prereqs) -+ [Tools and libraries](#java-package-libraries) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Tools and libraries - -Lambda provides the following libraries for Java functions: -+ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. -+ [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. -+ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. -+ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. - -These libraries are available through [Maven Central Repository](https://search.maven.org/search?q=g:com.amazonaws)\. Add them to your build definition as follows: - ------- -#### [ Gradle ] - -``` -dependencies { - implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' -} -``` - ------- -#### [ Maven ] - -``` - - - com.amazonaws - aws-lambda-java-core - 1.2.1 - - - com.amazonaws - aws-lambda-java-events - 3.11.0 - - - com.amazonaws - aws-lambda-java-log4j2 - 1.5.1 - - -``` - ------- - -To create a deployment package, compile your function code and dependencies into a single \.zip file or Java Archive \(JAR\) file\. For Gradle, [use the `Zip` build type](#java-package-gradle)\. For Apache Maven, [use the Maven Shade plugin](#java-package-maven)\. - -**Note** -To keep your deployment package size small, package your function's dependencies in layers\. Layers enable you to manage your dependencies independently, can be used by multiple functions, and can be shared with other accounts\. For more information, see [Creating and sharing Lambda layers](configuration-layers.md)\. - -You can upload your deployment package by using the Lambda console, the Lambda API, or AWS Serverless Application Model \(AWS SAM\)\. - -**To upload a deployment package with the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Under **Code source**, choose **Upload from**\. - -1. Upload the deployment package\. - -1. Choose **Save**\. - -**Topics** -+ [Building a deployment package with Gradle](#java-package-gradle) -+ [Building a deployment package with Maven](#java-package-maven) -+ [Uploading a deployment package with the Lambda API](#java-package-cli) -+ [Uploading a deployment package with AWS SAM](#java-package-cloudformation) - -### Building a deployment package with Gradle - -To create a deployment package with your function's code and dependencies, use the `Zip` build type\. - -**Example build\.gradle – Build task** - -``` -task buildZip(type: Zip) { - from compileJava - from processResources - into('lib') { - from configurations.runtimeClasspath - } -} -``` - -This build configuration produces a deployment package in the `build/distributions` directory\. The `compileJava` task compiles your function's classes\. The `processResources` task copies the Java project resources into their target directory, potentially processing then\. The statement `into('lib')` then copies dependency libraries from the build's classpath into a folder named `lib`\. - -**Example build\.gradle – Dependencies** - -``` -dependencies { - implementation platform('software.amazon.awssdk:bom:2.10.73') - implementation 'software.amazon.awssdk:lambda' - implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' - implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' - implementation 'com.google.code.gson:gson:2.8.6' - implementation 'org.apache.logging.log4j:log4j-api:2.17.1' - implementation 'org.apache.logging.log4j:log4j-core:2.17.1' - runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' -} -``` - -Lambda loads JAR files in Unicode alphabetical order\. If multiple JAR files in the `lib` directory contain the same class, the first one is used\. You can use the following shell script to identify duplicate classes: - -**Example test\-zip\.sh** - -``` -mkdir -p expanded -unzip path/to/my/function.zip -d expanded -find ./expanded/lib -name '*.jar' | xargs -n1 zipinfo -1 | grep '.*.class' | sort | uniq -c | sort -``` - -### Building a deployment package with Maven - -To build a deployment package with Maven, use the [Maven Shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/)\. The plugin creates a JAR file that contains the compiled function code and all of its dependencies\. - -**Example pom\.xml – Plugin configuration** - -``` - - org.apache.maven.plugins - maven-shade-plugin - 3.2.2 - - false - - - - package - - shade - - - - -``` - -To build the deployment package, use the `mvn package` command\. - -``` -[INFO] Scanning for projects... -[INFO] -----------------------< com.example:java-maven >----------------------- -[INFO] Building java-maven-function 1.0-SNAPSHOT -[INFO] --------------------------------[ jar ]--------------------------------- -... -[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ java-maven --- -[INFO] Building jar: target/java-maven-1.0-SNAPSHOT.jar -[INFO] -[INFO] --- maven-shade-plugin:3.2.2:shade (default) @ java-maven --- -[INFO] Including com.amazonaws:aws-lambda-java-core:jar:1.2.1 in the shaded jar. -[INFO] Including com.amazonaws:aws-lambda-java-events:jar:3.11.0 in the shaded jar. -[INFO] Including joda-time:joda-time:jar:2.6 in the shaded jar. -[INFO] Including com.google.code.gson:gson:jar:2.8.6 in the shaded jar. -[INFO] Replacing original artifact with shaded artifact. -[INFO] Replacing target/java-maven-1.0-SNAPSHOT.jar with target/java-maven-1.0-SNAPSHOT-shaded.jar -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 8.321 s -[INFO] Finished at: 2020-03-03T09:07:19Z -[INFO] ------------------------------------------------------------------------ -``` - -This command generates a JAR file in the `target` directory\. - -If you use the appender library \(`aws-lambda-java-log4j2`\), you must also configure a transformer for the Maven Shade plugin\. The transformer library combines versions of a cache file that appear in both the appender library and in Log4j\. - -**Example pom\.xml – Plugin configuration with Log4j 2 appender** - -``` - - org.apache.maven.plugins - maven-shade-plugin - 3.2.2 - - false - - - - package - - shade - - - - - - - - - - - - com.github.edwgiz - maven-shade-plugin.log4j2-cachefile-transformer - 2.13.0 - - - -``` - -### Uploading a deployment package with the Lambda API - -To update a function's code with the AWS Command Line Interface \(AWS CLI\) or AWS SDK, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) API operation\. For the AWS CLI, use the `update-function-code` command\. The following command uploads a deployment package named `my-function.zip` in the current directory: - -``` -aws lambda update-function-code --function-name my-function --zip-file fileb://my-function.zip -``` - -You should see the following output: - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "java8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "example.Handler", - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "Active" - }, - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... -} -``` - -If your deployment package is larger than 50 MB, you can't upload it directly\. Upload it to an Amazon Simple Storage Service \(Amazon S3\) bucket and point Lambda to the object\. The following example commands upload a deployment package to an S3 bucket named `my-bucket` and use it to update a function's code: - -``` -aws s3 cp my-function.zip s3://my-bucket -``` - -You should see the following output: - -``` -upload: my-function.zip to s3://my-bucket/my-function -``` - -``` -aws lambda update-function-code --function-name my-function \ - --s3-bucket my-bucket --s3-key my-function.zip -``` - -You should see the following output: - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "java8", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "example.Handler", - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "Active" - }, - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... -} -``` - -You can use this method to upload function packages up to 250 MB \(decompressed\)\. - -### Uploading a deployment package with AWS SAM - -You can use AWS SAM to automate deployments of your function code, configuration, and dependencies\. AWS SAM is an extension of AWS CloudFormation that provides a simplified syntax for defining serverless applications\. The following example template defines a function with a deployment package in the `build/distributions` directory that Gradle uses: - -**Example template\.yml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: build/distributions/java-basic.zip - Handler: example.Handler - Runtime: java8 - Description: Java function - MemorySize: 512 - Timeout: 10 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - - AWSLambdaVPCAccessExecutionRole - Tracing: Active -``` - -To create the function, use the `package` and `deploy` commands\. These commands are customizations to the AWS CLI\. They wrap other commands to upload the deployment package to Amazon S3, rewrite the template with the object URI, and update the function's code\. - -The following example script runs a Gradle build and uploads the deployment package that it creates\. It creates an AWS CloudFormation stack the first time you run it\. If the stack already exists, the script updates it\. - -**Example deploy\.sh** - -``` -#!/bin/bash -set -eo pipefail -aws cloudformation package --template-file template.yml --s3-bucket MY_BUCKET --output-template-file out.yml -aws cloudformation deploy --template-file out.yml --stack-name java-basic --capabilities CAPABILITY_NAMED_IAM -``` - -For a complete working example, see the following sample applications: - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](#java-package) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. \ No newline at end of file diff --git a/doc_source/java-samples.md b/doc_source/java-samples.md deleted file mode 100644 index 2c6eb8b8..00000000 --- a/doc_source/java-samples.md +++ /dev/null @@ -1,11 +0,0 @@ -# Java sample applications for AWS Lambda - -The GitHub repository for this guide provides sample applications that demonstrate the use of Java in AWS Lambda\. Each sample application includes scripts for easy deployment and cleanup, an AWS CloudFormation template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -If you're new to Lambda functions in Java, start with the `java-basic` examples\. To get started with Lambda event sources, see the `java-events` examples\. Both of these example sets show the use of Lambda's Java libraries, environment variables, the AWS SDK, and the AWS X\-Ray SDK\. Each example uses a Lambda layer to package its dependencies separately from the function code, which speeds up deployment times\. These examples require minimal setup and you can deploy them from the command line in less than a minute\. \ No newline at end of file diff --git a/doc_source/java-tracing.md b/doc_source/java-tracing.md deleted file mode 100644 index c57399e3..00000000 --- a/doc_source/java-tracing.md +++ /dev/null @@ -1,188 +0,0 @@ -# Instrumenting Java code in AWS Lambda - -Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. - -To send tracing data to X\-Ray, you can use one of two SDK libraries: -+ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. -+ [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) – An SDK for generating and sending trace data to X\-Ray\. - -Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. - -**Important** -**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. - -**Topics** -+ [Using ADOT to instrument your Java functions](#java-adot) -+ [Using the X\-Ray SDK to instrument your Java functions](#java-xray-sdk) -+ [Activating tracing with the Lambda console](#java-tracing-console) -+ [Activating tracing with the Lambda API](#java-tracing-api) -+ [Activating tracing with AWS CloudFormation](#java-tracing-cloudformation) -+ [Interpreting an X\-Ray trace](#java-tracing-interpretation) -+ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#java-tracing-layers) -+ [X\-Ray tracing in sample applications \(X\-Ray SDK\)](#java-tracing-samples) - -## Using ADOT to instrument your Java functions - -ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. - -For Java runtimes, you can choose between two layers to consume: -+ **AWS managed Lambda layer for ADOT Java \(Auto\-instrumentation Agent\)** – This layer automatically transforms your function code at startup to collect tracing data\. For detailed instructions on how to consume this layer together with the ADOT Java agent, see [AWS Distro for OpenTelemetry Lambda Support for Java \(Auto\-instrumentation Agent\)](https://aws-otel.github.io/docs/getting-started/lambda/lambda-java-auto-instr) in the ADOT documentation\. -+ **AWS managed Lambda layer for ADOT Java** – This layer also provides built\-in instrumentation for Lambda functions, but it requires a few manual code changes to initialize the OTel SDK\. For detailed instructions on how to consume this layer, see [AWS Distro for OpenTelemetry Lambda Support for Java](https://aws-otel.github.io/docs/getting-started/lambda/lambda-java) in the ADOT documentation\. - -## Using the X\-Ray SDK to instrument your Java functions - -To record data about calls that your function makes to other resources and services in your application, you can add the X\-Ray SDK for Java to your build configuration\. The following example shows a Gradle build configuration that includes the libraries that activate automatic instrumentation of AWS SDK for Java 2\.x clients\. - -**Example [build\.gradle](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java/build.gradle) – Tracing dependencies** - -``` -dependencies { - implementation platform('software.amazon.awssdk:bom:2.15.0') - implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.11.0') - ... - implementation 'com.amazonaws:aws-xray-recorder-sdk-core' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' - ... -} -``` - -After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. - -## Activating tracing with the Lambda console - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -## Activating tracing with the Lambda API - -Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Activating tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` - -## Interpreting an X\-Ray trace - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [AWS X\-Ray SDK for Java](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-java.html) in the *AWS X\-Ray Developer Guide*\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -## Storing runtime dependencies in a layer \(X\-Ray SDK\) - -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. - -The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS SDK for Java and X\-Ray SDK for Java\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java/template.yml) – Dependencies layer** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: build/distributions/blank-java.zip - Tracing: Active - Layers: - - !Ref libs - ... - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-java-lib - Description: Dependencies for the blank-java sample app. - ContentUri: build/blank-java-lib.zip - CompatibleRuntimes: - - java8 -``` - -With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. - -Creating a layer for dependencies requires build configuration changes to generate the layer archive prior to deployment\. For a working example, see the [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) sample application on GitHub\. - -## X\-Ray tracing in sample applications \(X\-Ray SDK\) - -The GitHub repository for this guide includes sample applications that demonstrate the use of X\-Ray tracing\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - -All of the sample applications have active tracing enabled for Lambda functions\. For example, the `s3-java` application shows automatic instrumentation of AWS SDK for Java 2\.x clients, segment management for tests, custom subsegments, and the use of Lambda layers to store runtime dependencies\. \ No newline at end of file diff --git a/doc_source/kinesis-tutorial-spec.md b/doc_source/kinesis-tutorial-spec.md deleted file mode 100644 index 250afe05..00000000 --- a/doc_source/kinesis-tutorial-spec.md +++ /dev/null @@ -1,43 +0,0 @@ -# AWS SAM template for a DynamoDB application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the [tutorial application](with-ddb-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Resources: - ProcessDynamoDBStream: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: handler - Runtime: runtime - Policies: AWSLambdaDynamoDBExecutionRole - Events: - Stream: - Type: DynamoDB - Properties: - Stream: !GetAtt DynamoDBTable.StreamArn - BatchSize: 100 - StartingPosition: TRIM_HORIZON - - DynamoDBTable: - Type: AWS::DynamoDB::Table - Properties: - AttributeDefinitions: - - AttributeName: id - AttributeType: S - KeySchema: - - AttributeName: id - KeyType: HASH - ProvisionedThroughput: - ReadCapacityUnits: 5 - WriteCapacityUnits: 5 - StreamSpecification: - StreamViewType: NEW_IMAGE -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/lambda-api-permissions-ref.md b/doc_source/lambda-api-permissions-ref.md deleted file mode 100644 index 2090f07b..00000000 --- a/doc_source/lambda-api-permissions-ref.md +++ /dev/null @@ -1,207 +0,0 @@ -# Resources and conditions for Lambda actions - -You can restrict the scope of a user's permissions by specifying resources and conditions in an AWS Identity and Access Management \(IAM\) policy\. Each action in a policy supports a combination of resource and condition types that varies depending on the behavior of the action\. - -Every IAM policy statement grants permission to an action that's performed on a resource\. When the action doesn't act on a named resource, or when you grant permission to perform the action on all resources, the value of the resource in the policy is a wildcard \(`*`\)\. For many actions, you can restrict the resources that a user can modify by specifying the Amazon Resource Name \(ARN\) of a resource, or an ARN pattern that matches multiple resources\. - -To restrict permissions by resource, specify the resource by ARN\. - -**Lambda resource ARN format** -+ Function – `arn:aws:lambda:us-west-2:123456789012:function:my-function` -+ Function version – `arn:aws:lambda:us-west-2:123456789012:function:my-function:1` -+ Function alias – `arn:aws:lambda:us-west-2:123456789012:function:my-function:TEST` -+ Event source mapping – `arn:aws:lambda:us-west-2:123456789012:event-source-mapping:fa123456-14a1-4fd2-9fec-83de64ad683de6d47` -+ Layer – `arn:aws:lambda:us-west-2:123456789012:layer:my-layer` -+ Layer version – `arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1` - -For example, the following policy allows a user in AWS account `123456789012` to invoke a function named `my-function` in the US West \(Oregon\) AWS Region\. - -**Example invoke function policy** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "Invoke", - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function" - } - ] -} -``` - -This is a special case where the action identifier \(`lambda:InvokeFunction`\) differs from the API operation \([Invoke](API_Invoke.md)\)\. For other actions, the action identifier is the operation name prefixed by `lambda:`\. - -**Topics** -+ [Policy conditions](#authorization-conditions) -+ [Function resource names](#function-resources) -+ [Function actions](#permissions-resources-function) -+ [Event source mapping actions](#permissions-resources-eventsource) -+ [Layer actions](#permissions-resources-layers) - -## Policy conditions - -Conditions are an optional policy element that applies additional logic to determine if an action is allowed\. In addition to common [conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) that all actions support, Lambda defines condition types that you can use to restrict the values of additional parameters on some actions\. - -For example, the `lambda:Principal` condition lets you restrict the service or account that a user can grant invocation access to on a function's [resource\-based policy](access-control-resource-based.md)\. The following policy lets a user grant permission to Amazon Simple Notification Service \(Amazon SNS\) topics to invoke a function named `test`\. - -**Example manage function policy permissions** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "ManageFunctionPolicy", - "Effect": "Allow", - "Action": [ - "lambda:AddPermission", - "lambda:RemovePermission" - ], - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:test:*", - "Condition": { - "StringEquals": { - "lambda:Principal": "sns.amazonaws.com" - } - } - } - ] -} -``` - -The condition requires that the principal is Amazon SNS and not another service or account\. The resource pattern requires that the function name is `test` and includes a version number or alias\. For example, `test:v1`\. - -For more information on resources and conditions for Lambda and other AWS services, see [Actions, resources, and condition keys for AWS services](https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html) in the *Service Authorization Reference*\. - -## Function resource names - -You reference a Lambda function in a policy statement using an Amazon Resource Name \(ARN\)\. The format of a function ARN depends on whether you are referencing the whole function \(unqualified\) or a function [version](configuration-versions.md) or [alias](configuration-aliases.md) \(qualified\)\. - -When making Lambda API calls, users can specify a version or alias by passing a version ARN or alias ARN in the [GetFunction](API_GetFunction.md) `FunctionName` parameter, or by setting a value in the [GetFunction](API_GetFunction.md) `Qualifier` parameter\. Lambda makes authorization decisions by comparing the resource element in the IAM policy with both the `FunctionName` and `Qualifier` passed in API calls\. If there is a mismatch, Lambda denies the request\. - -Whether you are allowing or denying an action on your function, you must use the correct function ARN types in your policy statement to achieve the results that you expect\. For example, if your policy references the unqualified ARN, Lambda accepts requests that reference the unqualified ARN but denies requests that reference a qualified ARN\. - -**Note** -You can't use a wildcard character \(\*\) to match the account ID\. For more information on accepted syntax, see [IAM JSON policy reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in the *IAM User Guide*\. - -**Example allowing invocation of an unqualified ARN** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction" - } - ] -} -``` - -If your policy references a specific qualified ARN, Lambda accepts requests that reference that ARN but denies requests that reference the unqualified ARN or a different qualified ARN, for example, `myFunction:2`\. - -**Example allowing invocation of a specific qualified ARN** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction:1" - } - ] -} -``` - -If your policy references any qualified ARN using `:*`, Lambda accepts any qualified ARN but denies requests that reference the unqualified ARN\. - -**Example allowing invocation of any qualified ARN** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction:*" - } - ] -} -``` - -If your policy references any ARN using `*`, Lambda accepts any qualified or unqualified ARN\. - -**Example allowing invocation of any qualified or unqualified ARN** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myFunction*" - } - ] -} -``` - -## Function actions - -Actions that operate on a function can be restricted to a specific function by function, version, or alias ARN, as described in the following table\. Actions that don't support resource restrictions are granted for all resources \(`*`\)\. - - -**Function actions** - -| Action | Resource | Condition | -| --- | --- | --- | -| [AddPermission](API_AddPermission.md) [RemovePermission](API_RemovePermission.md) | Function Function version Function alias | `lambda:Principal` `aws:ResourceTag/${TagKey}` `lambda:FunctionUrlAuthType` | -| [Invoke](API_Invoke.md) **Permission:** `lambda:InvokeFunction` | Function Function version Function alias | `aws:ResourceTag/${TagKey}` | -| [CreateFunction](API_CreateFunction.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` `aws:ResourceTag/${TagKey}` `aws:RequestTag/${TagKey}` `aws:TagKeys` | -| [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) | Function | `lambda:CodeSigningConfigArn` `lambda:Layer` `lambda:VpcIds` `lambda:SubnetIds` `lambda:SecurityGroupIds` `aws:ResourceTag/${TagKey}` | -| [CreateAlias](API_CreateAlias.md) [DeleteAlias](API_DeleteAlias.md) [DeleteFunction](API_DeleteFunction.md) [DeleteFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionCodeSigningConfig.html) [DeleteFunctionConcurrency](API_DeleteFunctionConcurrency.md) [GetAlias](API_GetAlias.md) [GetFunction](API_GetFunction.md) [GetFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionCodeSigningConfig.html) [GetFunctionConcurrency](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConcurrency.html) [GetFunctionConfiguration](API_GetFunctionConfiguration.md) [GetPolicy](API_GetPolicy.md) [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) [ListAliases](API_ListAliases.md) [ListTags](API_ListTags.md) [ListVersionsByFunction](API_ListVersionsByFunction.md) [PublishVersion](API_PublishVersion.md) [PutFunctionCodeSigningConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutFunctionCodeSigningConfig.html) [PutFunctionConcurrency](API_PutFunctionConcurrency.md) [UpdateAlias](API_UpdateAlias.md) [UpdateFunctionCode](API_UpdateFunctionCode.md) | Function | `aws:ResourceTag/${TagKey}` | -| [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) | Function Function alias | `lambda:FunctionUrlAuthType` `lambda:FunctionArn` | -| [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) | Function | `lambda:FunctionUrlAuthType` | -| [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) | Function alias Function version | `aws:ResourceTag/${TagKey}` | -| [GetAccountSettings](API_GetAccountSettings.md) [ListFunctions](API_ListFunctions.md) | `*` | None | -| [TagResource](API_TagResource.md) | Function | `aws:ResourceTag/${TagKey}` `aws:RequestTag/${TagKey}` `aws:TagKeys` | -| [UntagResource](API_UntagResource.md) | Function | `aws:ResourceTag/${TagKey}` `aws:TagKeys` | - -## Event source mapping actions - -For [event source mappings](invocation-eventsourcemapping.md), you can restrict delete and update permissions to a specific event source\. The `lambda:FunctionArn` condition lets you restrict which functions a user can configure an event source to invoke\. - -For these actions, the resource is the event source mapping, so Lambda provides a condition that lets you restrict permission based on the function that the event source mapping invokes\. - - -**Event source mapping actions** - -| Action | Resource | Condition | -| --- | --- | --- | -| [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) | Event source mapping | `lambda:FunctionArn` | -| [CreateEventSourceMapping](API_CreateEventSourceMapping.md) | `*` | `lambda:FunctionArn` | -| [GetEventSourceMapping](API_GetEventSourceMapping.md) [ListEventSourceMappings](API_ListEventSourceMappings.md) | `*` | None | - -## Layer actions - -Layer actions let you restrict the layers that a user can manage or use with a function\. Actions related to layer use and permissions act on a version of a layer, while `PublishLayerVersion` acts on a layer name\. You can use either with wildcards to restrict the layers that a user can work with by name\. - -**Note** -The [GetLayerVersion](API_GetLayerVersion.md) action also covers [GetLayerVersionByArn](API_GetLayerVersionByArn.md)\. Lambda does not support `GetLayerVersionByArn` as an IAM action\. - - -**Layer actions** - -| Action | Resource | Condition | -| --- | --- | --- | -| [AddLayerVersionPermission](API_AddLayerVersionPermission.md) [RemoveLayerVersionPermission](API_RemoveLayerVersionPermission.md) [GetLayerVersion](API_GetLayerVersion.md) [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) [DeleteLayerVersion](API_DeleteLayerVersion.md) | Layer version | None | -| [ListLayerVersions](API_ListLayerVersions.md) [PublishLayerVersion](API_PublishLayerVersion.md) | Layer | None | -| [ListLayers](API_ListLayers.md) | `*` | None | \ No newline at end of file diff --git a/doc_source/lambda-csharp.md b/doc_source/lambda-csharp.md deleted file mode 100644 index 87364c8d..00000000 --- a/doc_source/lambda-csharp.md +++ /dev/null @@ -1,47 +0,0 @@ -# Building Lambda functions with C\# - -The following sections explain how common programming patterns and core concepts apply when authoring Lambda function code in C\#\. - -AWS Lambda provides the following libraries for C\# functions: -+ **Amazon\.Lambda\.Core** – This library provides a static Lambda logger, serialization interfaces and a context object\. The `Context` object \([AWS Lambda context object in C\#](csharp-context.md)\) provides runtime information about your Lambda function\. -+ **Amazon\.Lambda\.Serialization\.Json ** – This is an implementation of the serialization interface in **Amazon\.Lambda\.Core**\. -+ **Amazon\.Lambda\.Logging\.AspNetCore ** – This provides a library for logging from ASP\.NET\. -+ Event objects \(POCOs\) for several AWS services, including: - + **Amazon\.Lambda\.APIGatewayEvents ** - + **Amazon\.Lambda\.CognitoEvents ** - + **Amazon\.Lambda\.ConfigEvents ** - + **Amazon\.Lambda\.DynamoDBEvents ** - + **Amazon\.Lambda\.KinesisEvents ** - + **Amazon\.Lambda\.S3Events ** - + **Amazon\.Lambda\.SQSEvents ** - + **Amazon\.Lambda\.SNSEvents ** - -These packages are available at [Nuget packages](https://www.nuget.org/packages/)\. - - -**\.NET** - -| Name | Identifier | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | -| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | -| \.NET 5 | `dotnet5.0` | Amazon Linux 2 | x86\_64 | | - -**Note** -For end of support information about \.NET Core 2\.1, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. - -**Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. - -**Topics** -+ [Lambda function handler in C\#](csharp-handler.md) -+ [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) -+ [Deploy \.NET Lambda functions with container images](csharp-image.md) -+ [AWS Lambda context object in C\#](csharp-context.md) -+ [Lambda function logging in C\#](csharp-logging.md) -+ [AWS Lambda function errors in C\#](csharp-exceptions.md) -+ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) -+ [\.NET functions with native AOT compilation](dotnet-native-aot.md) \ No newline at end of file diff --git a/doc_source/lambda-deploy-functions.md b/doc_source/lambda-deploy-functions.md deleted file mode 100644 index 7513748d..00000000 --- a/doc_source/lambda-deploy-functions.md +++ /dev/null @@ -1,31 +0,0 @@ -# Deploying Lambda functions - -You can deploy code to your Lambda function by uploading a zip file archive, or by creating and uploading a container image\. - -## \.zip file archives - -A \.zip file archive includes your application code and its dependencies\. When you author functions using the Lambda console or a toolkit, Lambda automatically creates a \.zip file archive of your code\. - -When you create functions with the Lambda API, command line tools, or the AWS SDKs, you must create a deployment package\. You also must create a deployment package if your function uses a compiled language, or to add dependencies to your function\. To deploy your function's code, you upload the deployment package from Amazon Simple Storage Service \(Amazon S3\) or your local machine\. - -You can upload a \.zip file as your deployment package using the Lambda console, AWS Command Line Interface \(AWS CLI\), or to an Amazon Simple Storage Service \(Amazon S3\) bucket\. - -## Container images - -You can package your code and dependencies as a container image using tools such as the Docker command line interface \(CLI\)\. You can then upload the image to your container registry hosted on Amazon Elastic Container Registry \(Amazon ECR\)\. - -AWS provides a set of open\-source base images that you can use to build the container image for your function code\. You can also use alternative base images from other container registries\. AWS also provides an open\-source runtime client that you add to your alternative base image to make it compatible with the Lambda service\. - -Additionally, AWS provides a runtime interface emulator for you to test your functions locally using tools such as the Docker CLI\. - -**Note** -You create each container image to be compatible with one of the instruction set architectures that Lambda supports\. Lambda provides base images for each of the instruction set architectures and Lambda also provides base images that support both architectures\. -The image that you build for your function must target only one of the architectures\. - -There is no additional charge for packaging and deploying functions as container images\. When a function deployed as a container image is invoked, you pay for invocation requests and execution duration\. You do incur charges related to storing your container images in Amazon ECR\. For more information, see [Amazon ECR pricing](http://aws.amazon.com/ecr/pricing/)\. - -**Topics** -+ [\.zip file archives](#deploying-zip-archives) -+ [Container images](#deploying-containers) -+ [Deploying Lambda functions as \.zip file archives](configuration-function-zip.md) -+ [Deploying Lambda functions as container images](gettingstarted-images.md) \ No newline at end of file diff --git a/doc_source/lambda-edge.md b/doc_source/lambda-edge.md deleted file mode 100644 index 8709e1f3..00000000 --- a/doc_source/lambda-edge.md +++ /dev/null @@ -1,58 +0,0 @@ -# Using AWS Lambda with CloudFront Lambda@Edge - -Lambda@Edge lets you run Node\.js and Python Lambda functions to customize content that CloudFront delivers, executing the functions in AWS locations closer to the viewer\. The functions run in response to CloudFront events, without provisioning or managing servers\. You can use Lambda functions to change CloudFront requests and responses at the following points: -+ After CloudFront receives a request from a viewer \(viewer request\) -+ Before CloudFront forwards the request to the origin \(origin request\) -+ After CloudFront receives the response from the origin \(origin response\) -+ Before CloudFront forwards the response to the viewer \(viewer response\) - -![\[Conceptual graphic that shows how the CloudFront events that can trigger a Lambda function.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/cloudfront-events-that-trigger-lambda-functions.png) - -**Note** -Lambda@Edge supports a limited set of runtimes and features\. For details, see [Requirements and restrictions on Lambda functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-requirements-limits.html) in the Amazon CloudFront developer guide\. - -You can also generate responses to viewers without ever sending the request to the origin\. - -**Example CloudFront message event** - -``` -{ - "Records": [ - { - "cf": { - "config": { - "distributionId": "EDFDVBD6EXAMPLE" - }, - "request": { - "clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334", - "method": "GET", - "uri": "/picture.jpg", - "headers": { - "host": [ - { - "key": "Host", - "value": "d111111abcdef8.cloudfront.net" - } - ], - "user-agent": [ - { - "key": "User-Agent", - "value": "curl/7.51.0" - } - ] - } - } - } - } - ] -} -``` - -With Lambda@Edge, you can build a variety of solutions, for example: -+ Inspect cookies to rewrite URLs to different versions of a site for A/B testing\. -+ Send different objects to your users based on the `User-Agent` header, which contains information about the device that submitted the request\. For example, you can send images in different resolutions to users based on their devices\. -+ Inspect headers or authorized tokens, inserting a corresponding header and allowing access control before forwarding a request to the origin\. -+ Add, delete, and modify headers, and rewrite the URL path to direct users to different objects in the cache\. -+ Generate new HTTP responses to do things like redirect unauthenticated users to login pages, or create and deliver static webpages right from the edge\. For more information, see [Using Lambda functions to generate HTTP responses to viewer and origin requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/http-response-generation.html) in the *Amazon CloudFront Developer Guide*\. - -For more information about using Lambda@Edge, see [Using CloudFront with Lambda@Edge](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-at-the-edge.html)\. \ No newline at end of file diff --git a/doc_source/lambda-extensions.md b/doc_source/lambda-extensions.md deleted file mode 100644 index 9015fe2f..00000000 --- a/doc_source/lambda-extensions.md +++ /dev/null @@ -1,49 +0,0 @@ -# Lambda extensions - -You can use Lambda extensions to augment your Lambda functions\. For example, use Lambda extensions to integrate functions with your preferred monitoring, observability, security, and governance tools\. You can choose from a broad set of tools that [AWS Lambda Partners](http://aws.amazon.com/lambda/partners/) provides, or you can [create your own Lambda extensions](runtimes-extensions-api.md)\. - -Lambda supports external and internal extensions\. An external extension runs as an independent process in the execution environment and continues to run after the function invocation is fully processed\. Because extensions run as separate processes, you can write them in a different language than the function\. All [Lambda runtimes](lambda-runtimes.md) support extensions\. - -An internal extension runs as part of the runtime process\. Your function accesses internal extensions by using wrapper scripts or in\-process mechanisms such as `JAVA_TOOL_OPTIONS`\. For more information, see [Modifying the runtime environment](runtimes-modify.md)\. - -You can add extensions to a function using the Lambda console, the AWS Command Line Interface \(AWS CLI\), or infrastructure as code \(IaC\) services and tools such as AWS CloudFormation, AWS Serverless Application Model \(AWS SAM\), and Terraform\. - -You are charged for the execution time that the extension consumes \(in 1 ms increments\)\. For more pricing information for extensions, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. For pricing information for partner extensions, see those partners' websites\. There is no cost to install your own extensions\. - -**Topics** -+ [Execution environment](#using-extensions-env) -+ [Impact on performance and resources](#using-extensions-reg) -+ [Permissions](#using-extensions-permissions) -+ [Configuring Lambda extensions](extensions-configuration.md) -+ [AWS Lambda extensions partners](extensions-api-partners.md) -+ [Lambda Extensions API](runtimes-extensions-api.md) -+ [Lambda Telemetry API](telemetry-api.md) - -## Execution environment - -Lambda invokes your function in an [execution environment](lambda-runtime-environment.md), which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function and provides lifecycle support for the function's runtime and extensions\. - -The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. - - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. -+ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. - -During the `Init` phase, Lambda extracts layers containing extensions into the `/opt` directory in the execution environment\. Lambda looks for extensions in the `/opt/extensions/` directory, interprets each file as an executable bootstrap for launching the extension, and starts all extensions in parallel\. - -## Impact on performance and resources - -The size of your function's extensions counts towards the deployment package size limit\. For a \.zip file archive, the total unzipped size of the function and all extensions cannot exceed the unzipped deployment package size limit of 250 MB\. - -Extensions can impact the performance of your function because they share function resources such as CPU, memory, and storage\. For example, if an extension performs compute\-intensive operations, you may see your function's execution duration increase\. - -Each extension must complete its initialization before Lambda invokes the function\. Therefore, an extension that consumes significant initialization time can increase the latency of the function invocation\. - -To measure the extra time that the extension takes after the function execution, you can use the `PostRuntimeExtensionsDuration` [function metric](monitoring-metrics.md)\. To measure the increase in memory used, you can use the `MaxMemoryUsed` metric\. To understand the impact of a specific extension, you can run different versions of your functions side by side\. - -## Permissions - -Extensions have access to the same resources as functions\. Because extensions are executed within the same environment as the function, permissions are shared between the function and the extension\. - -For a \.zip file archive, you can create an AWS CloudFormation template to simplify the task of attaching the same extension configuration—including AWS Identity and Access Management \(IAM\) permissions—to multiple functions\. \ No newline at end of file diff --git a/doc_source/lambda-foundation.md b/doc_source/lambda-foundation.md deleted file mode 100644 index 86e5892a..00000000 --- a/doc_source/lambda-foundation.md +++ /dev/null @@ -1,15 +0,0 @@ -# AWS Lambda foundations - -The Lambda function is the foundational principle of Lambda\. You can configure your functions using the Lambda console, Lambda API, AWS CloudFormation or AWS SAM\. You create code for the function and upload the code using a deployment package\. Lambda invokes the function when an event occurs\. Lambda runs multiple instances of your function in parallel, governed by concurrency and scaling limits\. - -**Topics** -+ [Lambda concepts](gettingstarted-concepts.md) -+ [Lambda features](gettingstarted-features.md) -+ [Lambda programming model](foundation-progmodel.md) -+ [Lambda instruction set architectures](foundation-arch.md) -+ [Lambda execution environment](lambda-runtime-environment.md) -+ [VPC networking for Lambda](foundation-networking.md) -+ [Lambda function scaling](invocation-scaling.md) -+ [Lambda deployment packages](gettingstarted-package.md) -+ [Lambda console](foundation-console.md) -+ [Using Lambda with the AWS CLI](gettingstarted-awscli.md) \ No newline at end of file diff --git a/doc_source/lambda-functions.md b/doc_source/lambda-functions.md deleted file mode 100644 index 4957dbd0..00000000 --- a/doc_source/lambda-functions.md +++ /dev/null @@ -1,11 +0,0 @@ -# Configuring AWS Lambda functions - -You can use the AWS Lambda API or console to create functions and configure function settings\. When you create the function, you chose the type of deployment package for the function\. The deployment package type cannot be changed later\. The workflow to create a function is different for a function deployed as a [container image](gettingstarted-images.md) and for a function deployed as a [\.zip file archive](configuration-function-zip.md)\. - -After you create the function, you can configure settings for many [function capabilities and options ](configuration-function-common.md) such as permissions, environment variables, tags, and layers\. - -To keep secrets out of your function code, store them in the function's configuration and read them from the execution environment during initialization\. [Environment variables](configuration-envvars.md) are always encrypted at rest, and can be encrypted client\-side as well\. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources\. - -[Versions and aliases](configuration-versions.md) are secondary resources that you can create to manage function deployment and invocation\. Publish [versions](configuration-versions.md) of your function to store its code and configuration as a separate resource that cannot be changed, and create an [alias](configuration-aliases.md) that points to a specific version\. Then you can configure your clients to invoke a function alias, and update the alias when you want to point the client to a new version, instead of updating the client\. - -As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development\. Use [layers](configuration-layers.md) to manage your function's dependencies independently and keep your deployment package small\. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions\. \ No newline at end of file diff --git a/doc_source/lambda-golang.md b/doc_source/lambda-golang.md deleted file mode 100644 index 0f4db7f5..00000000 --- a/doc_source/lambda-golang.md +++ /dev/null @@ -1,39 +0,0 @@ -# Building Lambda functions with Go - -The following sections explain how common programming patterns and core concepts apply when authoring Lambda function code in [Go](https://golang.org/)\. - - -**Go** - -| Name | Identifier | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | -| Go 1\.x | `go1.x` | Amazon Linux | x86\_64 | | - -**Note** -Runtimes that use the Amazon Linux operating system, such as Go 1\.x, do not support the arm64 architecture\. To use arm64 architecture, you can run Go with the provided\.al2 runtime\. - -Lambda provides the following tools and libraries for the Go runtime: - -**Tools and libraries for Go** -+ [AWS SDK for Go](https://github.com/aws/aws-sdk-go): the official AWS SDK for the Go programming language\. -+ [github\.com/aws/aws\-lambda\-go/lambda](https://github.com/aws/aws-lambda-go/tree/master/lambda): The implementation of the Lambda programming model for Go\. This package is used by AWS Lambda to invoke your [handler](golang-handler.md)\. -+ [github\.com/aws/aws\-lambda\-go/lambdacontext](https://github.com/aws/aws-lambda-go/tree/master/lambdacontext): Helpers for accessing context information from the [context object](golang-context.md)\. -+ [github\.com/aws/aws\-lambda\-go/events](https://github.com/aws/aws-lambda-go/tree/master/events): This library provides type definitions for common event source integrations\. -+ [github\.com/aws/aws\-lambda\-go/cmd/build\-lambda\-zip](https://github.com/aws/aws-lambda-go/tree/master/cmd/build-lambda-zip): This tool can be used to create a \.zip file archive on Windows\. - -For more information, see [aws\-lambda\-go](https://github.com/aws/aws-lambda-go) on GitHub\. - -Lambda provides the following sample applications for the Go runtime: - -**Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. - -**Topics** -+ [AWS Lambda function handler in Go](golang-handler.md) -+ [AWS Lambda context object in Go](golang-context.md) -+ [Deploy Go Lambda functions with \.zip file archives](golang-package.md) -+ [Deploy Go Lambda functions with container images](go-image.md) -+ [AWS Lambda function logging in Go](golang-logging.md) -+ [AWS Lambda function errors in Go](golang-exceptions.md) -+ [Instrumenting Go code in AWS Lambda](golang-tracing.md) -+ [Using environment variables](golang-envvars.md) \ No newline at end of file diff --git a/doc_source/lambda-intro-execution-role.md b/doc_source/lambda-intro-execution-role.md deleted file mode 100644 index ece2e4fd..00000000 --- a/doc_source/lambda-intro-execution-role.md +++ /dev/null @@ -1,237 +0,0 @@ -# Lambda execution role - -A Lambda function's execution role is an AWS Identity and Access Management \(IAM\) role that grants the function permission to access AWS services and resources\. For example, you might create an execution role that has permission to send logs to Amazon CloudWatch and upload trace data to AWS X\-Ray\. - -You provide an execution role when you create a function\. **When you invoke your function, Lambda automatically provides your function with temporary credentials by assuming this role\.** You don't have to call `sts:AssumeRole` in your function code\. - -**To view a function's execution role** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Choose **Configuration**, and then choose **Permissions**\. - -1. Under **Resource summary**, review the services and resources that the function can access\. - -1. Choose a service from the dropdown list to see permissions related to that service\. - -You can add or remove permissions from a function's execution role at any time, or configure your function to use a different role\. Add permissions for any services that your function calls with the AWS SDK, and for services that Lambda uses to enable optional features\. - -When you add permissions to your function, update its code or configuration as well\. This forces running instances of your function, which have outdated credentials, to stop and be replaced\. - -**Topics** -+ [Creating an execution role in the IAM console](#permissions-executionrole-console) -+ [Grant least privilege access to your Lambda execution role](#permissions-executionrole-least-privilege) -+ [Managing roles with the IAM API](#permissions-executionrole-api) -+ [Session duration for temporary security credentials](#permissions-executionrole-session) -+ [AWS managed policies for Lambda features](#permissions-executionrole-features) -+ [Working with Lambda execution environment credentials](#permissions-executionrole-source-function-arn) - -## Creating an execution role in the IAM console - -By default, Lambda creates an execution role with minimal permissions when you [create a function in the Lambda console](getting-started.md#getting-started-create-function)\. You can also create an execution role in the IAM console\. - -**To create an execution role in the IAM console** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Under **Use case**, choose **Lambda**\. - -1. Choose **Next**\. - -1. Select the AWS managed policies **AWSLambdaBasicExecutionRole** and **AWSXRayDaemonWriteAccess**\. - -1. Choose **Next**\. - -1. Enter a **Role name** and then choose **Create role**\. - -For detailed instructions, see [Creating a role for an AWS service \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html#roles-creatingrole-service-console) in the *IAM User Guide*\. - -## Grant least privilege access to your Lambda execution role - -When you first create an IAM role for your Lambda function during the development phase, you might sometimes grant permissions beyond what is required\. Before publishing your function in the production environment, as a best practice, adjust the policy to include only the required permissions\. For more information, see [Apply least\-privilege permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) in the *IAM User Guide*\. - -Use IAM Access Analyzer to help identify the required permissions for the IAM execution role policy\. IAM Access Analyzer reviews your AWS CloudTrail logs over the date range that you specify and generates a policy template with only the permissions that the function used during that time\. You can use the template to create a managed policy with fine\-grained permissions, and then attach it to the IAM role\. That way, you grant only the permissions that the role needs to interact with AWS resources for your specific use case\. - -For more information, see [Generate policies based on access activity](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html) in the *IAM User Guide*\. - -## Managing roles with the IAM API - -To create an execution role with the AWS Command Line Interface \(AWS CLI\), use the create\-role command\. When using this command, you can specify the [ trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#delegation) inline\. A role's trust policy gives the specified principals permission to assume the role\. In the following example, you grant the Lambda service principal permission to assume your role\. Note that requirements for escaping quotes in the JSON string may vary depending on your shell\. - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document '{"Version": "2012-10-17","Statement": [{ "Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, "Action": "sts:AssumeRole"}]}' -``` - -You can also define the trust policy for the role using a separate JSON file\. In the following example, `trust-policy.json` is a file in the current directory\. - -**Example trust\-policy\.json** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] -} -``` - -``` -aws iam create-role --role-name lambda-ex --assume-role-policy-document file://trust-policy.json -``` - -You should see the following output: - -``` -{ - "Role": { - "Path": "/", - "RoleName": "lambda-ex", - "RoleId": "AROAQFOXMPL6TZ6ITKWND", - "Arn": "arn:aws:iam::123456789012:role/lambda-ex", - "CreateDate": "2020-01-17T23:19:12Z", - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - } - } -} -``` - -**Note** -Lambda automatically assumes your execution role when you invoke your function\. You should avoid calling `sts:AssumeRole` manually in your function code\. If your use case requires that the role assumes itself, you must include the role itself as a trusted principal in your role's trust policy\. For more information on how to modify a role trust policy, see [ Modifying a role trust policy \(console\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-managingrole-editing-console.html#roles-managingrole_edit-trust-policy) in the IAM User Guide\. - -To add permissions to the role, use the attach\-policy\-to\-role command\. Start by adding the `AWSLambdaBasicExecutionRole` managed policy\. - -``` -aws iam attach-role-policy --role-name lambda-ex --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole -``` - -## Session duration for temporary security credentials - -Lambda assumes the execution role associated with your function to fetch temporary security credentials which are then available as environment variables during a function's invocation\. If you use these temporary credentials outside of Lambda, such as to create a presigned Amazon S3 URL, you can't control the session duration\. The IAM maximum session duration setting doesn't apply to sessions that are assumed by AWS services such as Lambda\. Use the [sts:AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) action if you need control over session duration\. - -## AWS managed policies for Lambda features - -The following AWS managed policies provide permissions that are required to use Lambda features\. - - -| Change | Description | Date | -| --- | --- | --- | -| **[ AWSLambdaMSKExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole)** – Lambda added the [kafka:DescribeClusterV2](https://docs.aws.amazon.com/MSK/2.0/APIReference/v2-clusters-clusterarn.html#v2-clusters-clusterarnget) permission to this policy\. | `AWSLambdaMSKExecutionRole` grants permissions to read and access records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster, manage elastic network interfaces \(ENIs\), and write to CloudWatch Logs\. | June 17, 2022 | -| **[ AWSLambdaBasicExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaBasicExecutionRole` grants permissions to upload logs to CloudWatch\. | February 14, 2022 | -| **[ AWSLambdaDynamoDBExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaDynamoDBExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaDynamoDBExecutionRole` grants permissions to read records from an Amazon DynamoDB stream and write to CloudWatch Logs\. | February 14, 2022 | -| **[ AWSLambdaKinesisExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaKinesisExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaKinesisExecutionRole` grants permissions to read events from an Amazon Kinesis data stream and write to CloudWatch Logs\. | February 14, 2022 | -| **[ AWSLambdaMSKExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaMSKExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaMSKExecutionRole` grants permissions to read and access records from an Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) cluster, manage elastic network interfaces \(ENIs\), and write to CloudWatch Logs\. | February 14, 2022 | -| **[ AWSLambdaSQSQueueExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaSQSQueueExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaSQSQueueExecutionRole` grants permissions to read a message from an Amazon Simple Queue Service \(Amazon SQS\) queue and write to CloudWatch Logs\. | February 14, 2022 | -| **[ AWSLambdaVPCAccessExecutionRole](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole)** – Lambda started tracking changes to this policy\. | `AWSLambdaVPCAccessExecutionRole` grants permissions to manage ENIs within an Amazon VPC and write to CloudWatch Logs\. | February 14, 2022 | -| **[ AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess)** – Lambda started tracking changes to this policy\. | `AWSXRayDaemonWriteAccess` grants permissions to upload trace data to X\-Ray\. | February 14, 2022 | -| **[ CloudWatchLambdaInsightsExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `CloudWatchLambdaInsightsExecutionRolePolicy` grants permissions to write runtime metrics to CloudWatch Lambda Insights\. | February 14, 2022 | -| **[ AmazonS3ObjectLambdaExecutionRolePolicy](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AmazonS3ObjectLambdaExecutionRolePolicy)** – Lambda started tracking changes to this policy\. | `AmazonS3ObjectLambdaExecutionRolePolicy` grants permissions to interact with Amazon Simple Storage Service \(Amazon S3\) object Lambda and to write to CloudWatch Logs\. | February 14, 2022 | - -For some features, the Lambda console attempts to add missing permissions to your execution role in a customer managed policy\. These policies can become numerous\. To avoid creating extra policies, add the relevant AWS managed policies to your execution role before enabling features\. - -When you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function, Lambda uses the execution role to read event data\. For example, an event source mapping for Kinesis reads events from a data stream and sends them to your function in batches\. You can use event source mappings with the following services: - -**Services that Lambda reads events from** -+ [Amazon DynamoDB](with-ddb.md) -+ [Amazon Kinesis](with-kinesis.md) -+ [Amazon MQ](with-mq.md) -+ [Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](with-msk.md) -+ [Self\-managed Apache Kafka](with-kafka.md) -+ [Amazon Simple Queue Service \(Amazon SQS\)](with-sqs.md) - -In addition to the AWS managed policies, the Lambda console provides templates for creating a custom policy with permissions for additional use cases\. When you create a function in the Lambda console, you can choose to create a new execution role with permissions from one or more templates\. These templates are also applied automatically when you create a function from a blueprint, or when you configure options that require access to other services\. Example templates are available in this guide's [GitHub repository](https://github.com/awsdocs/aws-lambda-developer-guide/tree/master/iam-policies)\. - -## Working with Lambda execution environment credentials - -It's common for your Lambda function code to make API requests to other AWS services\. To make these requests, Lambda generates an ephemeral set of credentials by assuming your function's execution role\. Lambda also automatically injects the source function Amazon Resource Name \(ARN\) into the credentials context used to make the API request from your function code\. - -Lambda injects the source function ARN into the credentials context only if the request is an AWS API request that comes from within your execution environment\. AWS API calls that Lambda makes outside of your execution environment on your behalf using the same execution role don't contain the source function ARN\. Examples of such API calls outside the execution environment include: -+ Calls to AWS Key Management Service \(AWS KMS\) to automatically encrypt and decrypt your environment variables\. -+ Calls to CloudWatch for logging\. - -With the source function ARN in the credentials context, you can verify whether a call to your resource came from a specific Lambda function's code\. To verify this, use the `lambda:SourceFunctionArn` condition key in an IAM identity\-based policy or service control policy \(SCP\)\. - -**Note** -You cannot use the `lambda:SourceFunctionArn` condition key in resource\-based policies\. - -With this condition key in your identity\-based policies or SCPs, you can implement security controls for the API actions that your function code makes to other AWS services\. This has a few key security applications, such as helping you identify the source of a credential leak\. - -**Note** -The `lambda:SourceFunctionArn` condition key is different from the `lambda:FunctionArn` and `aws:SourceArn` condition keys\. The `lambda:FunctionArn` condition key applies only to [event source mappings](invocation-eventsourcemapping.md) and helps define which functions your event source can invoke\. The `aws:SourceArn` condition key applies only to policies where your Lambda function is the target resource, and helps define which other AWS services and resources can invoke that function\. The `lambda:SourceFunctionArn` condition key can apply to any identity\-based policy or SCP to define the specific Lambda functions that have permissions to make specific AWS API calls to other resources\. - -To use `lambda:SourceFunctionArn` in your policy, include it as a condition with any of the [ARN condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_ARN)\. The value of the key must be a valid ARN\. - -For example, suppose your Lambda function code makes an `s3:PutObject` call that targets a specific Amazon S3 bucket\. You might want to allow only one specific Lambda function to have `s3:PutObject` access that bucket\. In this case, your function's execution role should have a policy attached that looks like this: - -**Example policy granting a specific Lambda function access to an Amazon S3 resource** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "ExampleSourceFunctionArn", - "Effect": "Allow", - "Action": "s3:PutObject", - "Resource": "arn:aws:s3:::lambda_bucket/*", - "Condition": { - "ArnEquals": { - "lambda:SourceFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:source_lambda" - } - } - } - ] -} -``` - -This policy allows only `s3:PutObject` access if the source is the Lambda function with ARN `arn:aws:lambda:us-east-1:123456789012:function:source_lambda`\. This policy doesn't allow `s3:PutObject` access to any other calling identity\. This is true even if a different function or entity makes an `s3:PutObject` call with the same execution role\. - -You can also use `lambda:SourceFunctionArn` in [service control policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html)\. For example, suppose you want to restrict access to your bucket to either a single Lambda function's code or to calls from a specific Amazon Virtual Private Cloud \(VPC\)\. The following SCP illustrates this\. - -**Example policy denying access to Amazon S3 under specific conditions** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "s3:*" - ], - "Resource": "arn:aws:s3:::lambda_bucket/*", - "Effect": "Deny", - "Condition": { - "StringNotEqualsIfExists": { - "aws:SourceVpc": [ - "vpc-12345678" - ] - }, - "ArnNotEqualsIfExists": { - "lambda:SourceFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:source_lambda" - } - } - } - ] -} -``` - -This policy denies all S3 actions unless they come from a specific Lambda function with ARN `arn:aws:lambda:*:123456789012:function:source_lambda`, or unless they come from the specified VPC\. The `StringNotEqualsIfExists` operator tells IAM to process this condition only if the `aws:SourceVpc` key is present in the request\. Similarly, IAM considers the `ArnNotEqualsIfExists` operator only if the `lambda:SourceFunctionArn` exists\. \ No newline at end of file diff --git a/doc_source/lambda-invocation.md b/doc_source/lambda-invocation.md deleted file mode 100644 index 146972ef..00000000 --- a/doc_source/lambda-invocation.md +++ /dev/null @@ -1,23 +0,0 @@ -# Invoking Lambda functions - -You can invoke Lambda functions directly using [the Lambda console](getting-started.md#get-started-invoke-manually), a [function URL](lambda-urls.md) HTTP\(S\) endpoint, the Lambda API, an AWS SDK, the AWS Command Line Interface \(AWS CLI\), and AWS toolkits\. You can also configure other AWS services to invoke your function, or you can configure Lambda to read from a stream or queue and invoke your function\. - -When you invoke a function, you can choose to invoke it synchronously or asynchronously\. With [synchronous invocation](invocation-sync.md), you wait for the function to process the event and return a response\. With [asynchronous](invocation-async.md) invocation, Lambda queues the event for processing and returns a response immediately\. For asynchronous invocation, Lambda handles retries and can send invocation records to a [destination](invocation-async.md#invocation-async-destinations)\. - -To use your function to process data automatically, add one or more triggers\. A trigger is a Lambda resource or a resource in another service that you configure to invoke your function in response to lifecycle events, external requests, or on a schedule\. Your function can have multiple triggers\. Each trigger acts as a client invoking your function independently\. Each event that Lambda passes to your function has data from only one client or trigger\. - -To process items from a stream or queue, you can create an [event source mapping](invocation-eventsourcemapping.md)\. An event source mapping is a resource in Lambda that reads items from an Amazon Simple Queue Service \(Amazon SQS\) queue, an Amazon Kinesis stream, or an Amazon DynamoDB stream, and sends them to your function in batches\. Each event that your function processes can contain hundreds or thousands of items\. - -Other AWS services and resources invoke your function directly\. For example, you can configure Amazon EventBridge \(CloudWatch Events\) to invoke your function on a timer, or you can configure Amazon Simple Storage Service \(Amazon S3\) to invoke your function when an object is created\. Each service varies in the method that it uses to invoke your function, the structure of the event, and how you configure it\. For more information, see [Using AWS Lambda with other services](lambda-services.md)\. - -Depending on who invokes your function and how it's invoked, scaling behavior and the types of errors that occur can vary\. When you invoke a function synchronously, you receive errors in the response and can retry\. When you invoke asynchronously, use an event source mapping, or configure another service to invoke your function, the retry requirements and the way that your function scales to handle large numbers of events can vary\. For more information, see [Lambda function scaling](invocation-scaling.md) and [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. - -**Topics** -+ [Synchronous invocation](invocation-sync.md) -+ [Asynchronous invocation](invocation-async.md) -+ [Lambda event source mappings](invocation-eventsourcemapping.md) -+ [Lambda event filtering](invocation-eventfiltering.md) -+ [Lambda function states](functions-states.md) -+ [Error handling and automatic retries in AWS Lambda](invocation-retries.md) -+ [Testing Lambda functions in the console](testing-functions.md) -+ [Invoking functions defined as container images](invocation-images.md) \ No newline at end of file diff --git a/doc_source/lambda-java.md b/doc_source/lambda-java.md deleted file mode 100644 index 3e34e0f7..00000000 --- a/doc_source/lambda-java.md +++ /dev/null @@ -1,83 +0,0 @@ -# Building Lambda functions with Java - -You can run Java code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Java that run your code to process events\. Your code runs in an Amazon Linux environment that includes AWS credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. - -Lambda supports the following Java runtimes\. - - -**Java** - -| Name | Identifier | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | -| Java 11 | `java11` | Amazon Linux 2 | x86\_64, arm64 | | -| Java 8 | `java8.al2` | Amazon Linux 2 | x86\_64, arm64 | | -| Java 8 | `java8` | Amazon Linux | x86\_64 | | - -Lambda provides the following libraries for Java functions: -+ [com\.amazonaws:aws\-lambda\-java\-core](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-core) \(required\) – Defines handler method interfaces and the context object that the runtime passes to the handler\. If you define your own input types, this is the only library that you need\. -+ [com\.amazonaws:aws\-lambda\-java\-events](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-events) – Input types for events from services that invoke Lambda functions\. -+ [com\.amazonaws:aws\-lambda\-java\-log4j2](https://github.com/aws/aws-lambda-java-libs/tree/master/aws-lambda-java-log4j2) – An appender library for Apache Log4j 2 that you can use to add the request ID for the current invocation to your [function logs](java-logging.md)\. -+ [AWS SDK for Java 2\.0](https://github.com/aws/aws-sdk-java-v2) – The official AWS SDK for the Java programming language\. - -Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -You can add permissions to the role later, or swap it out for a different role that's specific to a single function\. - -**To create a Java function** - -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. - -1. Choose **Create function**\. - -1. Configure the following settings: - + **Name** – **my\-function**\. - + **Runtime** – **Java 11**\. - + **Role** – **Choose an existing role**\. - + **Existing role** – **lambda\-role**\. - -1. Choose **Create function**\. - -1. To configure a test event, choose **Test**\. - -1. For **Event name**, enter **test**\. - -1. Choose **Save changes**\. - -1. To invoke the function, choose **Test**\. - -The console creates a Lambda function with a handler class named `Hello`\. Since Java is a compiled language, you can't view or edit the source code in the Lambda console, but you can modify its configuration, invoke it, and configure triggers\. - -**Note** -To get started with application development in your local environment, deploy one of the [sample applications](java-samples.md) available in this guide's GitHub repository\. - -The `Hello` class has a function named `handleRequest` that takes an event object and a context object\. This is the [handler function](java-handler.md) that Lambda calls when the function is invoked\. The Java function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `example.Hello::handleRequest`\. - -To update the function's code, you create a deployment package, which is a \.zip file archive that contains your function code\. As your function development progresses, you will want to store your function code in source control, add libraries, and automate deployments\. Start by [creating a deployment package](java-package.md) and updating your code at the command line\. - -The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](java-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. - -Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](java-logging.md) during invocation\. If your function [returns an error](java-exceptions.md), Lambda formats the error and returns it to the invoker\. - -**Topics** -+ [AWS Lambda function handler in Java](java-handler.md) -+ [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) -+ [Deploy Java Lambda functions with container images](java-image.md) -+ [AWS Lambda context object in Java](java-context.md) -+ [AWS Lambda function logging in Java](java-logging.md) -+ [AWS Lambda function errors in Java](java-exceptions.md) -+ [Instrumenting Java code in AWS Lambda](java-tracing.md) -+ [Creating a deployment package using Eclipse](java-package-eclipse.md) -+ [Java sample applications for AWS Lambda](java-samples.md) \ No newline at end of file diff --git a/doc_source/lambda-managing.md b/doc_source/lambda-managing.md deleted file mode 100644 index 41d90511..00000000 --- a/doc_source/lambda-managing.md +++ /dev/null @@ -1,9 +0,0 @@ -# Managing AWS Lambda functions - -[Configuring AWS Lambda functions](lambda-functions.md) describes the how to configure the core capabilities and options for a function\. Lambda also provides advanced features such as concurrency control, network access, database interworking, file systems, and code signing\. - -[Concurrency](configuration-concurrency.md) is the number of instances of your function that are active\. Lambda provides two types of concurrency controls: reserved concurrency and provisioned concurrency\. - -To use your Lambda function with AWS resources in an Amazon VPC, configure it with security groups and subnets to [create a VPC connection](configuration-vpc.md)\. Connecting your function to a VPC lets you access resources in a private subnet such as relational databases and caches\. You can also [create a database proxy](configuration-database.md) for MySQL and Aurora DB instances\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. - -To use [code signing](configuration-codesigning.md) with your Lambda function, configure it with a code\-signing configuration\. When a user attempts to deploy a code package, Lambda checks that the code package has a valid signature from a trusted publisher\. The code\-signing configuration includes a set of signing profiles, which define the trusted publishers for this function\. \ No newline at end of file diff --git a/doc_source/lambda-monitoring.md b/doc_source/lambda-monitoring.md deleted file mode 100644 index 94bdeada..00000000 --- a/doc_source/lambda-monitoring.md +++ /dev/null @@ -1,15 +0,0 @@ -# Monitoring and troubleshooting Lambda applications - -AWS Lambda integrates with other AWS services to help you monitor and troubleshoot your Lambda functions\. Lambda automatically monitors Lambda functions on your behalf and reports metrics through Amazon CloudWatch\. To help you monitor your code when it runs, Lambda automatically tracks the number of requests, the invocation duration per request, and the number of requests that result in an error\. - -You can use other AWS services to troubleshoot your Lambda functions\. This section describes how to use these AWS services to monitor, trace, debug, and troubleshoot your Lambda functions and applications\. - -For more information about monitoring Lambda applications, see [Monitoring and observability](https://docs.aws.amazon.com/lambda/latest/operatorguide/monitoring-observability.html) in the *Lambda operator guide*\. - -**Topics** -+ [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md) -+ [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md) -+ [Working with Lambda function metrics](monitoring-metrics.md) -+ [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md) -+ [Using CodeGuru Profiler with your Lambda function](monitoring-code-profiler.md) -+ [Example workflows using other AWS services](monitoring-servicemap.md) \ No newline at end of file diff --git a/doc_source/lambda-nodejs.md b/doc_source/lambda-nodejs.md deleted file mode 100644 index b9ec227f..00000000 --- a/doc_source/lambda-nodejs.md +++ /dev/null @@ -1,99 +0,0 @@ -# Building Lambda functions with Node\.js - -You can run JavaScript code with Node\.js in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Node\.js that run your code to process events\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. - -Lambda supports the following Node\.js runtimes\. - - -**Node\.js** - -| Name | Identifier | SDK | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | --- | -| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | - -Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -You can add permissions to the role later, or swap it out for a different role that's specific to a single function\. - -**To create a Node\.js function** - -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. - -1. Choose **Create function**\. - -1. Configure the following settings: - + **Name** – **my\-function**\. - + **Runtime** – **Node\.js 16\.x**\. - + **Role** – **Choose an existing role**\. - + **Existing role** – **lambda\-role**\. - -1. Choose **Create function**\. - -1. To configure a test event, choose **Test**\. - -1. For **Event name**, enter **test**\. - -1. Choose **Save changes**\. - -1. To invoke the function, choose **Test**\. - -The console creates a Lambda function with a single source file named `index.js`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. - -**Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. - -The `index.js` file exports a function named `handler` that takes an event object and a context object\. This is the [handler function](nodejs-handler.md) that Lambda calls when the function is invoked\. The Node\.js function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `index.handler`\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](nodejs-package.md) to upload your code to the Lambda function\. - -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -[rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -[efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -[list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -[error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. - -The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](nodejs-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. - -Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](nodejs-logging.md) during invocation\. If your function [returns an error](nodejs-exceptions.md), Lambda formats the error and returns it to the invoker\. - -## Node\.js initialization - -Node\.js has a unique event loop model that causes its initialization behavior to be different from other runtimes\. Specifically, Node\.js uses a non\-blocking I/O model that supports asynchronous operations\. This model allows Node\.js to perform efficiently for most workloads\. For example, if a Node\.js function makes a network call, that request may be designated as an asynchronous operation and placed into a callback queue\. The function may continue to process other operations within the main call stack without getting blocked by waiting for the network call to return\. Once the network call is returned, its callback is executed and then removed from the callback queue\. - - Some initialization tasks may run asynchronously\. These asynchronous tasks are not guaranteed to complete execution prior to an invocation\. For example, code that makes a network call to fetch a parameter from AWS Parameter Store may not be complete by the time Lambda executes the handler function\. As a result, the variable may be null during an invocation\. To avoid this, ensure that variables and other asynchronous code are fully initialized before continuing with the rest of the function’s core business logic\. - -### Designating a function handler as an ES module - -Starting with Node 14, you can guarantee completion of asynchronous initialization code prior to handler invocations by designating your code as an ES module, and using top\-level await\. Packages are designated as CommonJS modules by default, meaning you must first designate your function code as an ES module to use top\-level await\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. - -In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. - -For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. - -**Topics** -+ [Node\.js initialization](#nodejs-initialization) -+ [AWS Lambda function handler in Node\.js](nodejs-handler.md) -+ [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) -+ [Deploy Node\.js Lambda functions with container images](nodejs-image.md) -+ [AWS Lambda context object in Node\.js](nodejs-context.md) -+ [AWS Lambda function logging in Node\.js](nodejs-logging.md) -+ [AWS Lambda function errors in Node\.js](nodejs-exceptions.md) -+ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-permissions.md b/doc_source/lambda-permissions.md deleted file mode 100644 index 3a72c391..00000000 --- a/doc_source/lambda-permissions.md +++ /dev/null @@ -1,23 +0,0 @@ -# Lambda permissions - -You can use AWS Identity and Access Management \(IAM\) to manage access to the Lambda API and resources such as functions and layers\. For users and applications in your account that use Lambda, you can create IAM policies that apply to IAM users, groups, or roles\. - -Every Lambda function has an IAM role called an [execution role](lambda-intro-execution-role.md)\. In this role, you can attach a policy that defines the permissions that your function needs to access other AWS services and resources\. At a minimum, your function needs access to Amazon CloudWatch Logs for log streaming\. If your function calls other service APIs with the AWS SDK, you must include the necessary permissions in the execution role's policy\. Lambda also uses the execution role to get permission to read from event sources when you use an [event source mapping](invocation-eventsourcemapping.md) to invoke your function\. - -To give other accounts and AWS services permission to use your Lambda resources, use a [resource\-based policy](access-control-resource-based.md)\. Lambda resources include functions, versions, aliases, and layer versions\. When a user tries to access a Lambda resource, Lambda considers both the user's [identity\-based policies](access-control-identity-based.md) and the resource's resource\-based policy\. When an AWS service such as Amazon Simple Storage Service \(Amazon S3\) calls your Lambda function, Lambda considers only the resource\-based policy\. - -To manage permissions for users and applications in your account, we recommend using an [AWS managed policy](access-control-identity-based.md)\. You can use these managed policies as\-is, or as a starting point for writing your own more restrictive policies\. Policies can restrict user permissions by the resource that an action affects, and by additional optional conditions\. For more information, see [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md)\. - -If your Lambda functions contain calls to other AWS resources, you might also want to restrict which functions can access those resources\. To do this, include the `lambda:SourceFunctionArn` condition key in a resource\-based policy for the target resource\. For more information, see [Working with Lambda execution environment credentials](lambda-intro-execution-role.md#permissions-executionrole-source-function-arn)\. - -For more information about IAM, see the *[IAM User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)*\. - -For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *AWS Lambda Operator Guide*\. - -**Topics** -+ [Lambda execution role](lambda-intro-execution-role.md) -+ [Identity\-based IAM policies for Lambda](access-control-identity-based.md) -+ [Attribute\-based access control for Lambda](attribute-based-access-control.md) -+ [Using resource\-based policies for Lambda](access-control-resource-based.md) -+ [Resources and conditions for Lambda actions](lambda-api-permissions-ref.md) -+ [Using permissions boundaries for AWS Lambda applications](permissions-boundary.md) \ No newline at end of file diff --git a/doc_source/lambda-powershell.md b/doc_source/lambda-powershell.md deleted file mode 100644 index 9dd46192..00000000 --- a/doc_source/lambda-powershell.md +++ /dev/null @@ -1,27 +0,0 @@ -# Building Lambda functions with PowerShell - -The following sections explain how common programming patterns and core concepts apply when you author Lambda function code in PowerShell\. - - -**\.NET** - -| Name | Identifier | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | -| \.NET Core 3\.1 | `dotnetcore3.1` | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | -| \.NET 6 | `dotnet6` | Amazon Linux 2 | x86\_64, arm64 | | -| \.NET 5 | `dotnet5.0` | Amazon Linux 2 | x86\_64 | | - -Lambda provides the following sample applications for the PowerShell runtime: -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. - -Before you get started, you must first set up a PowerShell development environment\. For instructions on how to do this, see [Setting Up a PowerShell Development Environment](powershell-devenv.md)\. - -To learn about how to use the AWSLambdaPSCore module to download sample PowerShell projects from templates, create PowerShell deployment packages, and deploy PowerShell functions to the AWS Cloud, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. - -**Topics** -+ [Setting Up a PowerShell Development Environment](powershell-devenv.md) -+ [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) -+ [AWS Lambda function handler in PowerShell](powershell-handler.md) -+ [AWS Lambda context object in PowerShell](powershell-context.md) -+ [AWS Lambda function logging in PowerShell](powershell-logging.md) -+ [AWS Lambda function errors in PowerShell](powershell-exceptions.md) \ No newline at end of file diff --git a/doc_source/lambda-python.md b/doc_source/lambda-python.md deleted file mode 100644 index be0003b1..00000000 --- a/doc_source/lambda-python.md +++ /dev/null @@ -1,58 +0,0 @@ -# Building Lambda functions with Python - -You can run Python code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Python that run your code to process events\. Your code runs in an environment that includes the SDK for Python \(Boto3\), with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. - -Lambda supports the following Python runtimes\. - - -**Python** - -| Name | Identifier | SDK | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | --- | -| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | -| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | -| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | | - -The runtime information in this table undergoes continuous updates\. For more information on using AWS SDKs in Lambda, see [Managing AWS SDKs in Lambda functions](https://docs.aws.amazon.com/lambda/latest/operatorguide/sdks-functions.html)\. - -**To create a Python function** - -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. - -1. Choose **Create function**\. - -1. Configure the following settings: - + **Name** – **my\-function**\. - + **Runtime** – **Python 3\.9**\. - + **Role** – **Choose an existing role**\. - + **Existing role** – **lambda\-role**\. - -1. Choose **Create function**\. - -1. To configure a test event, choose **Test**\. - -1. For **Event name**, enter **test**\. - -1. Choose **Save changes**\. - -1. To invoke the function, choose **Test**\. - -The console creates a Lambda function with a single source file named `lambda_function`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. - -**Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. - -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. - -Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](python-logging.md) during invocation\. If your function [returns an error](python-exceptions.md), Lambda formats the error and returns it to the invoker\. - -**Topics** -+ [Lambda function handler in Python](python-handler.md) -+ [Deploy Python Lambda functions with \.zip file archives](python-package.md) -+ [Deploy Python Lambda functions with container images](python-image.md) -+ [AWS Lambda context object in Python](python-context.md) -+ [AWS Lambda function logging in Python](python-logging.md) -+ [AWS Lambda function errors in Python](python-exceptions.md) -+ [Instrumenting Python code in AWS Lambda](python-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-releases.md b/doc_source/lambda-releases.md deleted file mode 100644 index 7d87e73a..00000000 --- a/doc_source/lambda-releases.md +++ /dev/null @@ -1,116 +0,0 @@ -# AWS Lambda releases - -The following table describes the important changes to the *AWS Lambda Developer Guide* since May 2018\. For notification about updates to this documentation, subscribe to the [RSS feed](https://docs.aws.amazon.com/lambda/latest/dg/lambda-updates.rss)\. - -| Change | Description | Date | -| --- |--- |--- | -| [lambda:SourceFunctionArn condition key](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | For an AWS resource, the `lambda:SourceFunctionArn` condition key filters access to the resource by the ARN of a Lambda function\. For details, see [ Working with Lambda execution environment credentials](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html?icmpid=docs_lambda_rss#permissions-executionrole-source-function-arn)\. | July 1, 2022 | -| [Node\.js 16 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 16\. Node\.js 16 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 11, 2022 | -| [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss) | Lambda now supports function URLs, which are dedicated HTTP\(S\) endpoints for Lambda functions\. For details, see [Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html?icmpid=docs_lambda_rss)\. | April 6, 2022 | -| [Shared test events in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss) | Lambda now supports sharing test events with other IAM users in the same AWS account\. For details, see [Testing Lambda functions in the console](https://docs.aws.amazon.com/lambda/latest/dg/testing-functions.html?icmpid=docs_lambda_rss)\. | March 16, 2022 | -| [PrincipalOrgId in resource\-based policies](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html?icmpid=docs_lambda_rss) | Lambda now supports granting permissions to an organization in AWS Organizations\. For details, see [Using resource\-based policies for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html?icmpid=docs_lambda_rss)\. | March 11, 2022 | -| [\.NET 6 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for \.NET 6\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | February 23, 2022 | -| [Event filtering for Kinesis, DynamoDB, and Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html?icmpid=docs_lambda_rss) | Lambda now supports event filtering for Kinesis, DynamoDB, and Amazon SQS event sources\. For details, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html?icmpid=docs_lambda_rss)\. | November 24, 2021 | -| [mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports mTLS authentication for Amazon MSK and self\-managed Apache Kafka event sources\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | November 19, 2021 | -| [Lambda on Graviton2](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss) | Lambda now supports Graviton2 for functions using arm64 architecture\. For details, see [Lambda instruction set architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html?icmpid=docs_lambda_rss)\. | September 29, 2021 | -| [Python 3\.9 runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Python 3\.9\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 16, 2021 | -| [New runtime versions for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtime versions are available for Node\.js, Python, and Java\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | July 21, 2021 | -| [Support for RabbitMQ as an event source on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ for RabbitMQ as an event source\. Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | July 7, 2021 | -| [SASL/PLAIN authentication for self\-managed Kafka on Lambda](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss) | SASL/PLAIN is now a supported authentication mechanism for self\-managed Kafka event sources on Lambda Customers already using SASL/PLAIN on their self\-managed Kafka cluster can now easily use Lambda to build consumer applications without having to modify the way they authenticate\. For details, see [Using Lambda with self\-managed Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html?icmpid=docs_lambda_rss)\. | June 29, 2021 | -| [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | General availability for Lambda extensions\. Use extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | May 24, 2021 | -| [New Lambda console experience](#lambda-releases) | The Lambda console has been redesigned to improve performance and consistency\. | March 2, 2021 | -| [Node\.js 14 runtime](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | Lambda now supports a new runtime for Node\.js 14\. Node\.js 14 uses Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | January 27, 2021 | -| [Lambda container images](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html?icmpid=docs_lambda_rss) | Lambda now supports functions defined as container images\. You can combine the flexibility of container tooling with the agility and operational simplicity of Lambda to build applications\. For details, see [ Using container images with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html?icmpid=docs_lambda_rss)\. | December 1, 2020 | -| [ Code signing for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss) | Lambda now supports code signing\. Administrators can configure Lambda functions to accept only signed code on deployment\. Lambda checks the signatures to ensure that the code is not altered or tampered\. Additionally, Lambda ensures that the code is signed by trusted developers before accepting the deployment\. For details, see [Configuring code signing for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html?icmpid=docs_lambda_rss)\. | November 23, 2020 | -| [Preview: Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss) | Lambda now supports the Runtime Logs API\. Lambda extensions can use the Logs API to subscribe to log streams in the execution environment\. For details, see [Lambda Runtime Logs API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-logs-api.html?icmpid=docs_lambda_rss)\. | November 12, 2020 | -| [New event source to for Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MQ as an event source\. Use a Lambda function to process records from your Amazon MQ message broker\. For details, see [Using Lambda with Amazon MQ](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html?icmpid=docs_lambda_rss)\. | November 5, 2020 | -| [Preview: Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss) | Use Lambda extensions to augment your Lambda functions\. You can use extensions provided by Lambda Partners, or you can create your own Lambda extensions\. For details, see [Lambda Extensions API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html?icmpid=docs_lambda_rss)\. | October 8, 2020 | -| [Support for Java 8 and custom runtimes on AL2](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | Lambda now supports Java 8 and custom runtimes on Amazon Linux 2\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | August 12, 2020 | -| [New event source for Amazon Managed Streaming for Apache Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss) | Lambda now supports Amazon MSK as an event source\. Use a Lambda function with Amazon MSK to process records in a Kafka topic\. For details, see [Using Lambda with Amazon MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html?icmpid=docs_lambda_rss)\. | August 11, 2020 | -| [IAM condition keys for Amazon VPC settings](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | You can now use Lambda\-specific condition keys for VPC settings\. For example, you can require that all functions in your organization are connected to a VPC\. You can also specify the subnets and security groups that the function's users can and can't use\. For details, see [Configuring VPC for IAM functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | August 10, 2020 | -| [Concurrency settings for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now use the following concurrency settings for Kinesis consumers with enhanced fan\-out \(HTTP/2 streams\): ParallelizationFactor, MaximumRetryAttempts, MaximumRecordAgeInSeconds, DestinationConfig, and BisectBatchOnFunctionError\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | July 7, 2020 | -| [Batch window for Kinesis HTTP/2 stream consumers](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can now configure a batch window \(MaximumBatchingWindowInSeconds\) for HTTP/2 streams\. Lambda reads records from the stream until it has gathered a full batch, or until the batch window expires\. For details, see [Using AWS Lambda with Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | June 18, 2020 | -| [Support for Amazon EFS file systems](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss) | You can now connect an Amazon EFS file system to your Lambda functions for shared network file access\. For details, see [Configuring file system access for Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html?icmpid=docs_lambda_rss)\. | June 16, 2020 | -| [AWS CDK sample applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | The Lambda console now includes sample applications that use the AWS Cloud Development Kit \(AWS CDK\) for TypeScript\. The AWS CDK is a framework that enables you to define your application resources in TypeScript, Python, Java, or \.NET\. For a tutorial on creating applications, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | June 1, 2020 | -| [Support for \.NET Core 3\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 3\.1\.0 runtime\. For details, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/csharp-package-cli.html?icmpid=docs_lambda_rss)\. | March 31, 2020 | -| [Support for API Gateway HTTP APIs](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss) | Updated and expanded documentation for using Lambda with API Gateway, including support for HTTP APIs\. Added a sample application that creates an API and function with AWS CloudFormation\. For details, see [Using Lambda with Amazon API Gateway](https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html?icmpid=docs_lambda_rss)\. | March 23, 2020 | -| [Ruby 2\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | A new runtime is available for Ruby 2\.7, ruby2\.7, which is the first Ruby runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | February 19, 2020 | -| [Concurrency metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | Lambda now reports the `ConcurrentExecutions` metric for all functions, aliases, and versions\. You can view a graph for this metric on the monitoring page for your function\. Previously, `ConcurrentExecutions` was only reported at the account level and for functions that use reserved concurrency\. For details, see [AWS Lambda function metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | February 18, 2020 | -| [Update to function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | Function states are now enforced for all functions by default\. When you connect a function to a VPC, Lambda creates shared elastic network interfaces\. This enables your function to scale up without creating additional network interfaces\. During this time, you can't perform additional operations on the function, including updating its configuration and publishing versions\. In some cases, invocation is also impacted\. Details about a function's current state are available from the Lambda API\.This update is being released in phases\. For details, see [Updated Lambda states lifecycle for VPC networking](http://aws.amazon.com/blogs/compute/coming-soon-updated-lambda-states-lifecycle-for-vpc-networking/) on the AWS Compute Blog\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 24, 2020 | -| [Updates to function configuration API output](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) | Added reason codes to [StateReasonCode](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html?icmpid=docs_lambda_rss) \(InvalidSubnet, InvalidSecurityGroup\) and LastUpdateStatusReasonCode \(SubnetOutOfIPAddresses, InvalidSubnet, InvalidSecurityGroup\) for functions that connect to a VPC\. For more information about states, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | January 20, 2020 | -| [Provisioned concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss) | You can now allocate provisioned concurrency for a function version or alias\. Provisioned concurrency enables a function to scale without fluctuations in latency\. For details, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | -| [Create a database proxy](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss) | You can now use the Lambda console to create a database proxy for a Lambda function\. A database proxy enables a function to reach high concurrency levels without exhausting database connections\. For details, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html?icmpid=docs_lambda_rss)\. | December 3, 2019 | -| [Percentiles support for the duration metric](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss) | You can now filter the duration metric based on percentiles\. For details, see [AWS Lambda metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html?icmpid=docs_lambda_rss)\. | November 26, 2019 | -| [Increased concurrency for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | A new option for [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings enables you to process more than one batch at a time from each shard\. When you increase the number of concurrent batches per shard, your function's concurrency can be up to 10 times the number of shards in your stream\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | -| [Function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss) | When you create or update a function, it enters a pending state while Lambda provisions resources to support it\. If you connect your function to a VPC, Lambda can create a shared elastic network interface right away, instead of creating network interfaces when your function is invoked\. This results in better performance for VPC\-connected functions, but might require an update to your automation\. For details, see [AWS Lambda function states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | -| [Error handling options for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors) | New configuration options are available for asynchronous invocation\. You can configure Lambda to limit retries and set a maximum event age\. For details, see [Configuring error handling for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-errors)\. | November 25, 2019 | -| [Error handling for stream event sources](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss) | New configuration options are available for event source mappings that read from streams\. You can configure [DynamoDB stream](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Kinesis stream](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings to limit retries and set a maximum record age\. When errors occur, you can configure the event source mapping to split batches before retrying, and to send invocation records for failed batches to a queue or topic\. For details, see [Lambda event source mapping](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html?icmpid=docs_lambda_rss)\. | November 25, 2019 | -| [Destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations) | You can now configure Lambda to send records of asynchronous invocations to another service\. Invocation records contain details about the event, context, and function response\. You can send invocation records to an SQS queue, SNS topic, Lambda function, or EventBridge event bus\. For details, see [Configuring destinations for asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html?icmpid=docs_lambda_rss#invocation-async-destinations)\. | November 25, 2019 | -| [New runtimes for Node\.js, Python, and Java](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss) | New runtimes are available for Node\.js 12, Python 3\.8, and Java 11\. For details, see [Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | -| [FIFO queue support for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss) | You can now create an event source mapping that reads from a first\-in, first\-out \(FIFO\) queue\. Previously, only standard queues were supported\. For details, see [Using Lambda with Amazon SQS](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html?icmpid=docs_lambda_rss)\. | November 18, 2019 | -| [Create applications in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | Application creation in the Lambda console is now generally available\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 31, 2019 | -| [Create applications in the Lambda console \(beta\)](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss) | You can now create a Lambda application with an integrated continuous delivery pipeline in the Lambda console\. The console provides sample applications that you can use as a starting point for your own project\. Choose between AWS CodeCommit and GitHub for source control\. Each time you push changes to your repository, the included pipeline builds and deploys them automatically\. For instructions, see [Creating an application with continuous delivery in the Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/applications-tutorial.html?icmpid=docs_lambda_rss)\. | October 3, 2019 | -| [Performance improvements for VPC\-connected functions](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss) | Lambda now uses a new type of elastic network interface that is shared by all functions in a virtual private cloud \(VPC\) subnet\. When you connect a function to a VPC, Lambda creates a network interface for each combination of security group and subnet that you choose\. When the shared network interfaces are available, the function no longer needs to create additional network interfaces as it scales up\. This dramatically improves startup times\. For details, see [Configuring a Lambda function to access resources in a VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html?icmpid=docs_lambda_rss)\. | September 3, 2019 | -| [Stream batch settings](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) | You can now configure a batch window for [Amazon DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html?icmpid=docs_lambda_rss) and [Amazon Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) event source mappings\. Configure a batch window of up to five minutes to buffer incoming records until a full batch is available\. This reduces the number of times that your function is invoked when the stream is less active\. | August 29, 2019 | -| [CloudWatch Logs Insights integration](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss) | The monitoring page in the Lambda console now includes reports from Amazon CloudWatch Logs Insights\. For details, see [Monitoring functions in the AWS Lambda console](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-access-metrics.html?icmpid=docs_lambda_rss)\. | June 18, 2019 | -| [Amazon Linux 2018\.03](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss) | The Lambda execution environment is being updated to use Amazon Linux 2018\.03\. For details, see [Execution environment](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html?icmpid=docs_lambda_rss)\. | May 21, 2019 | -| [Node\.js 10](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss) | A new runtime is available for Node\.js 10, nodejs10\.x\. This runtime uses Node\.js 10\.15 and will be updated with the latest point release of Node\.js 10 periodically\. Node\.js 10 is also the first runtime to use Amazon Linux 2\. For details, see [Building Lambda functions with Node\.js](https://docs.aws.amazon.com/lambda/latest/dg/programming-model.html?icmpid=docs_lambda_rss)\. | May 13, 2019 | -| [GetLayerVersionByArn API](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | Use the [GetLayerVersionByArn](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) API to download layer version information with the version ARN as input\. Compared to GetLayerVersion, GetLayerVersionByArn lets you use the ARN directly instead of parsing it to get the layer name and version number\. | April 25, 2019 | -| [Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Ruby 2\.5 with a new runtime\. For details, see [Building Lambda functions with Ruby](https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss) | With Lambda layers, you can package and deploy libraries, custom runtimes, and other dependencies separately from your function code\. Share your layers with your other accounts or the whole world\. For details, see [Lambda layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Custom runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss) | Build a custom runtime to run Lambda functions in your favorite programming language\. For details, see [Custom Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Application Load Balancer triggers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss) | Elastic Load Balancing now supports Lambda functions as a target for Application Load Balancers\. For details, see [Using Lambda with application load balancers](https://docs.aws.amazon.com/lambda/latest/dg/services-alb.html?icmpid=docs_lambda_rss)\. | November 29, 2018 | -| [Use Kinesis HTTP/2 stream consumers as a trigger](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss) | You can use Kinesis HTTP/2 data stream consumers to send events to AWS Lambda\. Stream consumers have dedicated read throughput from each shard in your data stream and use HTTP/2 to minimize latency\. For details, see [Using Lambda with Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | -| [Python 3\.7](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Python 3\.7 with a new runtime\. For more information, see [Building Lambda functions with Python](https://docs.aws.amazon.com/lambda/latest/dg/lambda-python.html?icmpid=docs_lambda_rss)\. | November 19, 2018 | -| [Payload limit increase for asynchronous function invocation](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html?icmpid=docs_lambda_rss) | The maximum payload size for asynchronous invocations increased from 128 KB to 256 KB, which matches the maximum message size from an Amazon SNS trigger\. For details, see [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | November 16, 2018 | -| [AWS GovCloud \(US\-East\) Region](https://docs.aws.amazon.com/lambda/latest/dg/lambda-releases.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the AWS GovCloud \(US\-East\) Region\. | November 12, 2018 | -| [Moved AWS SAM topics to a separate Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/?icmpid=docs_lambda_rss) | A number of topics were focused on building serverless applications using the AWS Serverless Application Model \(AWS SAM\)\. These topics have been moved to [AWS Serverless Application Model developer guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. | October 25, 2018 | -| [View Lambda applications in the console](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) | You can view the status of your Lambda applications on the [Applications](https://docs.aws.amazon.com/lambda/latest/dg/applications-console.html?icmpid=docs_lambda_rss) page in the Lambda console\. This page shows the status of the AWS CloudFormation stack\. It includes links to pages where you can view more information about the resources in the stack\. You can also view aggregate metrics for the application and create custom monitoring dashboards\. | October 11, 2018 | -| [Function execution timeout limit](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss) | To allow for long\-running functions, the maximum configurable execution timeout increased from 5 minutes to 15 minutes\. For details, see [Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html?icmpid=docs_lambda_rss)\. | October 10, 2018 | -| [Support for PowerShell Core language in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the PowerShell Core language\. For more information, see [Programming model for authoring Lambda functions in PowerShell](https://docs.aws.amazon.com/lambda/latest/dg/powershell-programming-model.html?icmpid=docs_lambda_rss)\. | September 11, 2018 | -| [Support for \.NET Core 2\.1\.0 runtime in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss) | AWS Lambda now supports the \.NET Core 2\.1\.0 runtime\. For more information, see [\.NET Core CLI](https://docs.aws.amazon.com/lambda/latest/dg/lambda-dotnet-coreclr-deployment-package.html?icmpid=docs_lambda_rss)\. | July 9, 2018 | -| [Updates now available over RSS](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | You can now subscribe to an RSS feed to follow releases for this guide\. | July 5, 2018 | -| [Support for Amazon SQS as event source](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss) | AWS Lambda now supports Amazon Simple Queue Service \(Amazon SQS\) as an event source\. For more information, see [Invoking Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html?icmpid=docs_lambda_rss)\. | June 28, 2018 | -| [China \(Ningxia\) Region](https://docs.aws.amazon.com/lambda/latest/dg/history.html?icmpid=docs_lambda_rss) | AWS Lambda is now available in the China \(Ningxia\) Region\. For more information about Lambda Regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html?icmpid=docs_lambda_rss) in the *AWS General Reference*\. | June 28, 2018 | - -## Earlier updates - -The following table describes the important changes in each release of the *AWS Lambda Developer Guide* before June 2018\. - - -| Change | Description | Date | -| --- | --- | --- | -| Runtime support for Node\.js runtime 8\.10 | AWS Lambda now supports Node\.js runtime version 8\.10\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 2, 2018 | -| Function and alias revision IDs | AWS Lambda now supports revision IDs on your function versions and aliases\. You can use these IDs to track and apply conditional updates when you are updating your function version or alias resources\. | January 25, 2018 | -| Runtime support for Go and \.NET 2\.0 | AWS Lambda has added runtime support for Go and \.NET 2\.0\. For more information, see [Building Lambda functions with Go](lambda-golang.md) and [Building Lambda functions with C\#](lambda-csharp.md)\. | January 15, 2018 | -| Console Redesign | AWS Lambda has introduced a new Lambda console to simplify your experience and added a Cloud9 Code Editor to enhance your ability debug and revise your function code\. For more information, see [Edit code using the console editor](foundation-console.md#code-editor)\. | November 30,2017 | -| Setting Concurrency Limits on Individual Functions | AWS Lambda now supports setting concurrency limits on individual functions\. For more information, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. | November 30,2017 | -| Shifting Traffic with Aliases | AWS Lambda now supports shifting traffic with aliases\. For more information, see [Rolling deployments for Lambda functions](lambda-rolling-deployments.md)\. | November 28, 2017 | -| Gradual Code Deployment | AWS Lambda now supports safely deploying new versions of your Lambda function by leveraging Code Deploy\. For more information, see [ Gradual code deployment](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/automating-updates-to-serverless-apps.html)\. | November 28, 2017 | -| China \(Beijing\) Region | AWS Lambda is now available in the China \(Beijing\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 9, 2017 | -| Introducing SAM Local | AWS Lambda introduces SAM Local \(now known as SAM CLI\), a AWS CLI tool that provides an environment for you to develop, test, and analyze your serverless applications locally before uploading them to the Lambda runtime\. For more information, see [ Testing and debugging serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-test-and-debug.html)\. | August 11, 2017 | -| Canada \(Central\) Region | AWS Lambda is now available in the Canada \(Central\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 22, 2017 | -| South America \(São Paulo\) Region | AWS Lambda is now available in the South America \(São Paulo\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 6, 2017 | -| AWS Lambda support for AWS X\-Ray\. | Lambda introduces support for X\-Ray, which allows you to detect, analyze, and optimize performance issues with your Lambda applications\. For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. | April 19, 2017 | -| Asia Pacific \(Mumbai\) Region | AWS Lambda is now available in the Asia Pacific \(Mumbai\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 28, 2017 | -| AWS Lambda now supports Node\.js runtime v6\.10 | AWS Lambda added support for Node\.js runtime v6\.10\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | March 22, 2017 | -| Europe \(London\) Region | AWS Lambda is now available in the Europe \(London\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | February 1, 2017 | -| AWS Lambda support for the \.NET runtime, Lambda@Edge \(Preview\), Dead Letter Queues and automated deployment of serverless applications\. | AWS Lambda added support for C\#\. For more information, see [Building Lambda functions with C\#](lambda-csharp.md)\. Lambda@Edge allows you to run Lambda functions at the AWS Edge locations in response to CloudFront events\. For more information, see [Using AWS Lambda with CloudFront Lambda@Edge](lambda-edge.md)\. | December 3, 2016 | -| AWS Lambda adds Amazon Lex as a supported event source\. | Using Lambda and Amazon Lex, you can quickly build chat bots for various services like Slack and Facebook\. For more information, see [Using AWS Lambda with Amazon Lex](services-lex.md)\. | November 30, 2016 | -| US West \(N\. California\) Region | AWS Lambda is now available in the US West \(N\. California\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | November 21, 2016 | -| Introduced the AWS SAM for creating and deploying Lambda\-based applications and using environment variables for Lambda function configuration settings\. | AWS SAM: You can now use the AWS SAM to define the syntax for expressing resources within a serverless application\. In order to deploy your application, simply specify the resources you need as part of your application, along with their associated permissions policies in a AWS CloudFormation template file \(written in either JSON or YAML\), package your deployment artifacts, and deploy the template\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. Environment variables: You can use environment variables to specify configuration settings for your Lambda function outside of your function code\. For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. | November 18, 2016 | -| Asia Pacific \(Seoul\) Region | AWS Lambda is now available in the Asia Pacific \(Seoul\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | August 29, 2016 | -| Asia Pacific \(Sydney\) Region | Lambda is now available in the Asia Pacific \(Sydney\) Region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | June 23, 2016 | -| Updates to the Lambda console | The Lambda console has been updated to simplify the role\-creation process\. For more information, see [Create a Lambda function with the console](getting-started.md#getting-started-create-function)\. | June 23, 2016 | -| AWS Lambda now supports Node\.js runtime v4\.3 | AWS Lambda added support for Node\.js runtime v4\.3\. For more information, see [Building Lambda functions with Node\.js](lambda-nodejs.md)\. | April 07, 2016 | -| Europe \(Frankfurt\) region | Lambda is now available in the Europe \(Frankfurt\) region\. For more information about Lambda regions and endpoints, see [Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html#lambda_region) in the *AWS General Reference*\. | March 14, 2016 | -| VPC support | You can now configure a Lambda function to access resources in your VPC\. For more information, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. | February 11, 2016 | -| Lambda runtime has been updated\. | The [execution environment](lambda-runtimes.md) has been updated\. | November 4, 2015 | -| Versioning support, Python for developing code for Lambdafunctions, scheduled events, and increase in execution time | You can now develop your Lambda function code using Python\. For more information, see [Building Lambda functions with Python](lambda-python.md)\. Versioning: You can maintain one or more versions of your Lambda function\. Versioning allows you to control which Lambda function version is executed in different environments \(for example, development, testing, or production\)\. For more information, see [Lambda function versions](configuration-versions.md)\. Scheduled events: You can also set up Lambda to invoke your code on a regular, scheduled basis using the Lambda console\. You can specify a fixed rate \(number of hours, days, or weeks\) or you can specify a cron expression\. For an example, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. Increase in execution time: You can now set up your Lambda functions to run for up to five minutes allowing longer running functions such as large volume data ingestion and processing jobs\. | October 08, 2015 | -| Support for DynamoDB Streams | DynamoDB Streams is now generally available and you can use it in all the regions where DynamoDB is available\. You can enable DynamoDB Streams for your table and use a Lambda function as a trigger for the table\. Triggers are custom actions you take in response to updates made to the DynamoDB table\. For an example walkthrough, see [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md)\. | July 14, 2015 | -| Lambda now supports invoking Lambda functions with REST\-compatible clients\. | Until now, to invoke your Lambda function from your web, mobile, or IoT application you needed the AWS SDKs \(for example, AWS SDK for Java, AWS SDK for Android, or AWS SDK for iOS\)\. Now, Lambda supports invoking a Lambda function with REST\-compatible clients through a customized API that you can create using Amazon API Gateway\. You can send requests to your Lambda function endpoint URL\. You can configure security on the endpoint to allow open access, leverage AWS Identity and Access Management \(IAM\) to authorize access, or use API keys to meter access to your Lambda functions by others\. For an example Getting Started exercise, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. For more information about the Amazon API Gateway, see [https://aws\.amazon\.com/api\-gateway/](https://aws.amazon.com/api-gateway/)\. | July 09, 2015 | -| The Lambda console now provides blueprints to easily create Lambda functions and test them\. | Lambda console provides a set of *blueprints*\. Each blueprint provides a sample event source configuration and sample code for your Lambda function that you can use to easily create Lambda\-based applications\. All of the Lambda Getting Started exercises now use the blueprints\. For more information, see [Getting started with Lambda](getting-started.md)\. | July 09, 2015 | -| Lambda now supports Java to author your Lambda functions\. | You can now author Lambda code in Java\. For more information, see [Building Lambda functions with Java](lambda-java.md)\. | June 15, 2015 | -| Lambda now supports specifying an Amazon S3 object as the function \.zip when creating or updating a Lambda function\. | You can upload a Lambda function deployment package \(\.zip file\) to an Amazon S3 bucket in the same region where you want to create a Lambda function\. Then, you can specify the bucket name and object key name when you create or update a Lambda function\. | May 28, 2015 | -| Lambda now generally available with added support for mobile backends | Lambda is now generally available for production use\. The release also introduces new features that make it easier to build mobile, tablet, and Internet of Things \(IoT\) backends using Lambda that scale automatically without provisioning or managing infrastructure\. Lambda now supports both real\-time \(synchronous\) and asynchronous events\. Additional features include easier event source configuration and management\. The permission model and the programming model have been simplified by the introduction of resource policies for your Lambda functions\. The documentation has been updated accordingly\. For information, see the following topics: [Getting started with Lambda](getting-started.md) [AWS Lambda](https://aws.amazon.com/lambda/) | April 9, 2015 | -| Preview release | Preview release of the *AWS Lambda Developer Guide*\. | November 13, 2014 | \ No newline at end of file diff --git a/doc_source/lambda-rolling-deployments.md b/doc_source/lambda-rolling-deployments.md deleted file mode 100644 index 1a30e336..00000000 --- a/doc_source/lambda-rolling-deployments.md +++ /dev/null @@ -1,53 +0,0 @@ -# Rolling deployments for Lambda functions - -Use rolling deployments to control the risks associated with introducing new versions of your Lambda function\. In a rolling deployment, the system automatically deploys the new version of the function and gradually sends an increasing amount of traffic to the new version\. The amount of traffic and rate of increase are parameters that you can configure\. - -You configure a rolling deployment by using AWS CodeDeploy and AWS SAM\. CodeDeploy is a service that automates application deployments to Amazon computing platforms such as Amazon EC2 and AWS Lambda\. For more information, see [What is CodeDeploy?](https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html)\. By using CodeDeploy to deploy your Lambda function, you can easily monitor the status of the deployment and initiate a rollback if you detect any issues\. - -AWS SAM is an open\-source framework for building serverless applications\. You create an AWS SAM template \(in YAML format\) to specify the configuration of the components required for the rolling deployment\. AWS SAM uses the template to create and configure the components\. For more information, see [What is the AWS SAM?](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html)\. - -In a rolling deployment, AWS SAM performs these tasks: -+ It configures your Lambda function and creates an alias\. - - The alias routing configuration is the underlying capability that implements the rolling deployment\. -+ It creates a CodeDeploy application and deployment group\. - - The deployment group manages the rolling deployment and the rollback \(if needed\)\. -+ It detects when you create a new version of your Lambda function\. -+ It triggers CodeDeploy to start the deployment of the new version\. - - - -## Example AWS SAM Lambda template - -The following example shows an [AWS SAM template](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) for a simple rolling deployment\. - -``` -AWSTemplateFormatVersion : '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: A sample SAM template for deploying Lambda functions. - -Resources: -# Details about the myDateTimeFunction Lambda function - myDateTimeFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: myDateTimeFunction.handler - Runtime: nodejs12.x -# Creates an alias named "live" for the function, and automatically publishes when you update the function. - AutoPublishAlias: live - DeploymentPreference: -# Specifies the deployment configuration - Type: Linear10PercentEvery2Minutes -``` - -This template defines a Lambda function named `myDateTimeFunction` with the following properties\. - -**AutoPublishAlias ** -The `AutoPublishAlias` property creates an alias named `live`\. In addition, the AWS SAM framework automatically detects when you save new code for the function\. The framework then publishes a new function version and updates the `live` alias to point to the new version\. - -**DeploymentPreference** -The `DeploymentPreference` property determines the rate at which the CodeDeploy application shifts traffic from the original version of the Lambda function to the new version\. The value `Linear10PercentEvery2Minutes` shifts an additional ten percent of the traffic to the new version every two minutes\. -For a list of the predefined deployment configurations, see [Deployment configurations](https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations.html)\. - -For a detailed tutorial on how to use CodeDeploy with Lambda functions, see [Deploy an updated Lambda function with CodeDeploy](https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorial-lambda-sam.html)\. \ No newline at end of file diff --git a/doc_source/lambda-ruby.md b/doc_source/lambda-ruby.md deleted file mode 100644 index 114e8f80..00000000 --- a/doc_source/lambda-ruby.md +++ /dev/null @@ -1,81 +0,0 @@ -# Building Lambda functions with Ruby - -You can run Ruby code in AWS Lambda\. Lambda provides [runtimes](lambda-runtimes.md) for Ruby that run your code to process events\. Your code runs in an environment that includes the AWS SDK for Ruby, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. - -Lambda supports the following Ruby runtimes\. - - -**Ruby** - -| Name | Identifier | SDK | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | --- | -| Ruby 2\.7 | `ruby2.7` | 3\.1\.0 | Amazon Linux 2 | x86\_64, arm64 | | - -**Note** -For end of support information about Ruby 2\.5, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. - -Lambda functions use an [execution role](lambda-intro-execution-role.md) to get permission to write logs to Amazon CloudWatch Logs, and to access other services and resources\. If you don't already have an execution role for function development, create one\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -You can add permissions to the role later, or swap it out for a different role that's specific to a single function\. - -**To create a Ruby function** - -1. Open the [Lambda console](https://console.aws.amazon.com/lambda)\. - -1. Choose **Create function**\. - -1. Configure the following settings: - + **Name** – **my\-function**\. - + **Runtime** – **Ruby 2\.7**\. - + **Role** – **Choose an existing role**\. - + **Existing role** – **lambda\-role**\. - -1. Choose **Create function**\. - -1. To configure a test event, choose **Test**\. - -1. For **Event name**, enter **test**\. - -1. Choose **Save changes**\. - -1. To invoke the function, choose **Test**\. - -The console creates a Lambda function with a single source file named `lambda_function.rb`\. You can edit this file and add more files in the built\-in [code editor](foundation-console.md#code-editor)\. To save your changes, choose **Save**\. Then, to run your code, choose **Test**\. - -**Note** -The Lambda console uses AWS Cloud9 to provide an integrated development environment in the browser\. You can also use AWS Cloud9 to develop Lambda functions in your own environment\. For more information, see [Working with Lambda Functions](https://docs.aws.amazon.com/cloud9/latest/user-guide/lambda-functions.html) in the AWS Cloud9 user guide\. - -The `lambda_function.rb` file exports a function named `lambda_handler` that takes an event object and a context object\. This is the [handler function](ruby-handler.md) that Lambda calls when the function is invoked\. The Ruby function runtime gets invocation events from Lambda and passes them to the handler\. In the function configuration, the handler value is `lambda_function.lambda_handler`\. - -When you save your function code, the Lambda console creates a \.zip file archive deployment package\. When you develop your function code outside of the console \(using an IDE\) you need to [create a deployment package](ruby-package.md) to upload your code to the Lambda function\. - -**Note** -To get started with application development in your local environment, deploy one of the sample applications available in this guide's GitHub repository\. -[blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -[Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. - -The function runtime passes a context object to the handler, in addition to the invocation event\. The [context object](ruby-context.md) contains additional information about the invocation, the function, and the execution environment\. More information is available from environment variables\. - -Your Lambda function comes with a CloudWatch Logs log group\. The function runtime sends details about each invocation to CloudWatch Logs\. It relays any [logs that your function outputs](ruby-logging.md) during invocation\. If your function [returns an error](ruby-exceptions.md), Lambda formats the error and returns it to the invoker\. - -**Topics** -+ [AWS Lambda function handler in Ruby](ruby-handler.md) -+ [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) -+ [Deploy Ruby Lambda functions with container images](ruby-image.md) -+ [AWS Lambda context object in Ruby](ruby-context.md) -+ [AWS Lambda function logging in Ruby](ruby-logging.md) -+ [AWS Lambda function errors in Ruby](ruby-exceptions.md) -+ [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-runtime-environment.md b/doc_source/lambda-runtime-environment.md deleted file mode 100644 index ef7860e0..00000000 --- a/doc_source/lambda-runtime-environment.md +++ /dev/null @@ -1,71 +0,0 @@ -# Lambda execution environment - - Lambda invokes your function in an execution environment, which provides a secure and isolated runtime environment\. The execution environment manages the resources required to run your function\. The execution environment also provides lifecycle support for the function's runtime and any [external extensions](lambda-extensions.md) associated with your function\. - -The function's runtime communicates with Lambda using the [Runtime API](runtimes-api.md)\. Extensions communicate with Lambda using the [Extensions API](runtimes-extensions-api.md)\. Extensions can also receive log messages and other telemetry from the function by using the [Telemetry API](telemetry-api.md)\. - - - -![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) - -When you create your Lambda function, you specify configuration information, such as the amount of memory available and the maximum execution time allowed for your function\. Lambda uses this information to set up the execution environment\. - -The function's runtime and each external extension are processes that run within the execution environment\. Permissions, resources, credentials, and environment variables are shared between the function and the extensions\. - -**Topics** -+ [Lambda execution environment lifecycle](#runtimes-lifecycle) - -## Lambda execution environment lifecycle - -The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. - - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. -+ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. - -![\[The Init phase is followed by one or more function invocations. When there are no invocation requests, Lambda initiates the SHutdown phase.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Successful-Invokes.png) - -Each phase starts with an event that Lambda sends to the runtime and to all registered extensions\. The runtime and each extension indicate completion by sending a `Next` API request\. Lambda freezes the execution environment when the runtime and each extension have completed and there are no pending events\. - -**Topics** -+ [Init phase](#runtimes-lifecycle-ib) -+ [Invoke phase](#runtimes-lifecycle-invoke) -+ [Shutdown phase](#runtimes-lifecycle-shutdown) - -### Init phase - -In the `Init` phase, Lambda performs three tasks: -+ Start all extensions \(`Extension init`\) -+ Bootstrap the runtime \(`Runtime init`\) -+ Run the function's static code \(`Function init`\) - -The `Init` phase ends when the runtime and all extensions signal that they are ready by sending a `Next` API request\. The `Init` phase is limited to 10 seconds\. If all three tasks do not complete within 10 seconds, Lambda retries the `Init` phase at the time of the first function invocation\. - -### Invoke phase - -When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension\. - -The function's timeout setting limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished executing\. - -The invoke phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. - -If the Lambda function crashes or times out during the `Invoke` phase, Lambda resets the execution environment\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime\. Then Lambda sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If another `Invoke` event results in this execution environment being reused, Lambda initializes the runtime and extensions as part of the next invocation\. - -**Note** -The Lambda reset does not clear the `/tmp` directory content prior to the next init phase\. This behavior is consistent with the regular shutdown phase\. - -![\[This is my image.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) - -### Shutdown phase - -When Lambda is about to shut down the runtime, it sends a `Shutdown` event to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is a response to a `Next` API request\. - -**Duration**: The entire `Shutdown` phase is capped at 2 seconds\. If the runtime or any extension does not respond, Lambda terminates it via a signal \(`SIGKILL`\)\. - -After the function and all extensions have completed, Lambda maintains the execution environment for some time in anticipation of another function invocation\. In effect, Lambda freezes the execution environment\. When the function is invoked again, Lambda thaws the environment for reuse\. Reusing the execution environment has the following implications: -+ Objects declared outside of the function's handler method remain initialized, providing additional optimization when the function is invoked again\. For example, if your Lambda function establishes a database connection, instead of reestablishing the connection, the original connection is used in subsequent invocations\. We recommend adding logic in your code to check if a connection exists before creating a new one\. -+ Each execution environment provides between 512 MB and 10,240 MB, in 1\-MB increments, of disk space in the `/tmp` directory\. The directory content remains when the execution environment is frozen, providing a transient cache that can be used for multiple invocations\. You can add extra code to check if the cache has the data that you stored\. For more information on deployment size limits, see [Lambda quotas](gettingstarted-limits.md)\. -+ Background processes or callbacks that were initiated by your Lambda function and did not complete when the function ended resume if Lambda reuses the execution environment\. Make sure that any background processes or callbacks in your code are complete before the code exits\. - -When you write your function code, do not assume that Lambda automatically reuses the execution environment for subsequent function invocations\. Other factors may dictate a need for Lambda to create a new execution environment, which can lead to unexpected results, such as database connection failures\. \ No newline at end of file diff --git a/doc_source/lambda-runtimes.md b/doc_source/lambda-runtimes.md deleted file mode 100644 index 2cfa24e0..00000000 --- a/doc_source/lambda-runtimes.md +++ /dev/null @@ -1,94 +0,0 @@ -# Lambda runtimes - -Lambda supports multiple languages through the use of [runtimes](gettingstarted-concepts.md#gettingstarted-concepts-runtime)\. For a [function defined as a container image](gettingstarted-images.md), you choose a runtime and the Linux distribution when you [create the container image](images-create.md)\. To change the runtime, you create a new container image\. - -When you use a \.zip file archive for the deployment package, you choose a runtime when you create the function\. To change the runtime, you can [update your function's configuration](configuration-function-zip.md)\. The runtime is paired with one of the Amazon Linux distributions\. The underlying execution environment provides additional libraries and [environment variables](configuration-envvars.md) that you can access from your function code\. - -**Amazon Linux 2** -+ Image – Custom -+ Linux kernel – 4\.14 - -**Amazon Linux** -+ Image – [amzn\-ami\-hvm\-2018\.03\.0\.20220802\.0\-x86\_64\-gp2](https://console.aws.amazon.com/ec2/v2/home#Images:visibility=public-images;search=amzn-ami-hvm-2018.03.0.20220802.0-x86_64-gp2) -+ Linux kernel – 4\.14 - -Lambda invokes your function in an [execution environment](lambda-runtime-environment.md)\. The execution environment provides a secure and isolated runtime environment that manages the resources required to run your function\. Lambda re\-uses the execution environment from a previous invocation if one is available, or it can create a new execution environment\. - -A runtime can support a single version of a language, multiple versions of a language, or multiple languages\. Runtimes specific to a language or framework version are [deprecated](#runtime-support-policy) when the version reaches end of life\. - -To use other languages in Lambda, you can implement a [custom runtime](runtimes-custom.md)\. The Lambda execution environment provides a [runtime interface](runtimes-api.md) for getting invocation events and sending responses\. You can deploy a custom runtime alongside your function code, or in a [layer](configuration-layers.md)\. - -**Note** -For new regions, Lambda will not support runtimes that are set to be deprecated within the next six months\. - - -**Supported Runtimes** - -| Name | Identifier | SDK | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | --- | -| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | -| Python 3\.9 | `python3.9` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | -| Python 3\.8 | `python3.8` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux 2 | x86\_64, arm64 | | -| Python 3\.7 | `python3.7` | boto3\-1\.20\.32 botocore\-1\.23\.32 | Amazon Linux | x86\_64 | | -| Java 11 | `java11` | | Amazon Linux 2 | x86\_64, arm64 | | -| Java 8 | `java8.al2` | | Amazon Linux 2 | x86\_64, arm64 | | -| Java 8 | `java8` | | Amazon Linux | x86\_64 | | -| \.NET Core 3\.1 | `dotnetcore3.1` | | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | -| \.NET 6 | `dotnet6` | | Amazon Linux 2 | x86\_64, arm64 | | -| \.NET 5 | `dotnet5.0` | | Amazon Linux 2 | x86\_64 | | -| Go 1\.x | `go1.x` | | Amazon Linux | x86\_64 | | -| Ruby 2\.7 | `ruby2.7` | 3\.1\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Custom Runtime | `provided.al2` | | Amazon Linux 2 | x86\_64, arm64 | | -| Custom Runtime | `provided` | | Amazon Linux | x86\_64 | | - -## Runtime deprecation policy - -[Lambda runtimes](#lambda-runtimes) for \.zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates\. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime\. - -Deprecation \(end of support\) for a runtime occurs in two phases\. - -Phase 1 \- Lambda no longer applies security patches or other updates to the runtime\. You can no longer **create** functions that use the runtime, but you can continue to update existing functions\. This includes updating the runtime version, and rolling back to the previous runtime version\. Note that functions that use a deprecated runtime are no longer eligible for technical support\. - -Phase 2 \- you can no longer **create or update** functions that use the runtime\. To update a function, you need to migrate it to a supported runtime version\. After you migrate the function to a supported runtime version, you cannot rollback the function to the previous runtime\. Phase 2 starts at least 30 days after the start of Phase 1\. - -Lambda does not block invocations of functions that use deprecated runtime versions\. Function invocations continue indefinitely after the runtime version reaches end of support\. However, AWS strongly recommends that you migrate functions to a supported runtime version so that you continue to receive security patches and remain eligible for technical support\. - -In the table below, each phase starts at midnight \(Pacific time zone\) on the specified date\. The following runtimes have reached end of support: - - -**Deprecated runtimes** - -| Name | Identifier | Operating system | Deprecation Phase 1 | Deprecation Phase 2 | -| --- | --- | --- | --- | --- | -| Python 3\.6 | python3\.6 | Amazon Linux | Jul 18, 2022 | Aug 29, 2022 | -| Python 2\.7 | python2\.7 | Amazon Linux | Jul 15, 2021 | May 30, 2022 | -| \.NET Core 2\.1 | dotnetcore2\.1 | Amazon Linux | Jan 5, 2022 | Apr 13, 2022 | -| Ruby 2\.5 | ruby2\.5 | Amazon Linux | Jul 30, 2021 | Mar 31, 2022 | -| Node\.js 10 | nodejs10\.x | Amazon Linux 2 | Jul 30, 2021 | Feb 14, 2022 | -| Node\.js 8\.10 | nodejs8\.10 | Amazon Linux | | Mar 6, 2020 | -| Node\.js 4\.3 | nodejs4\.3 | Amazon Linux | | Mar 5, 2020 | -| Node\.js 6\.10 | nodejs6\.10 | Amazon Linux | | Aug 12, 2019 | -| \.NET Core 1\.0 | dotnetcore1\.0 | Amazon Linux | | Jul 30, 2019 | -| \.NET Core 2\.0 | dotnetcore2\.0 | Amazon Linux | | May 30, 2019 | -| Node\.js 4\.3 edge | nodejs4\.3\-edge | Amazon Linux | | Apr 30, 2019 | -| Node\.js 0\.10 | nodejs | Amazon Linux | | Oct 31, 2016 | - -In almost all cases, the end\-of\-life date of a language version or operating system is known well in advance\. Lambda notifies you by email if you have functions using a runtime that is scheduled for end of support in the next 60 days\. In rare cases, advance notice of support ending might not be possible\. For example, security issues that require a backwards\-incompatible update, or a runtime component that doesn't provide a long\-term support \(LTS\) schedule\. - -**Language and framework support policies** -+ **Node\.js** – [github\.com](https://github.com/nodejs/Release#release-schedule) -+ **Python** – [devguide\.python\.org](https://devguide.python.org/#status-of-python-branches) -+ **Ruby** – [www\.ruby\-lang\.org](https://www.ruby-lang.org/en/downloads/branches/) -+ **Java** – [www\.oracle\.com](https://www.oracle.com/java/technologies/java-se-support-roadmap.html) and [Corretto FAQs](http://aws.amazon.com/corretto/faqs/) -+ **Go** – [golang\.org](https://golang.org/doc/devel/release.html) -+ **\.NET Core** – [dotnet\.microsoft\.com](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) - -**Topics** -+ [Runtime deprecation policy](#runtime-support-policy) -+ [Modifying the runtime environment](runtimes-modify.md) -+ [Custom AWS Lambda runtimes](runtimes-custom.md) -+ [AWS Lambda runtime API](runtimes-api.md) -+ [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md) -+ [Using AVX2 vectorization in Lambda](runtimes-avx2.md) \ No newline at end of file diff --git a/doc_source/lambda-samples.md b/doc_source/lambda-samples.md deleted file mode 100644 index 700c9879..00000000 --- a/doc_source/lambda-samples.md +++ /dev/null @@ -1,66 +0,0 @@ -# Lambda sample applications - -The GitHub repository for this guide includes sample applications that demonstrate the use of various languages and AWS services\. Each sample application includes scripts for easy deployment and cleanup, an AWS SAM template, and supporting resources\. - ------- -#### [ Node\.js ] - -**Sample Lambda applications in Node\.js** -+ [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) – A Node\.js function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [nodejs\-apig](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with a public API endpoint that processes an event from API Gateway and returns an HTTP response\. -+ [rds\-mysql](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/rds-mysql) – A function that relays queries to a MySQL for RDS Database\. This sample includes a private VPC and database instance configured with a password in AWS Secrets Manager\. -+ [efs\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/efs-nodejs) – A function that uses an Amazon EFS file system in a Amazon VPC\. This sample includes a VPC, file system, mount targets, and access point configured for use with Lambda\. -+ [list\-manager](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager) – A function processes events from an Amazon Kinesis data stream and update aggregate lists in Amazon DynamoDB\. The function stores a record of each event in a MySQL for RDS Database in a private VPC\. This sample includes a private VPC with a VPC endpoint for DynamoDB and a database instance\. -+ [error\-processor](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor) – A Node\.js function generates errors for a specified percentage of requests\. A CloudWatch Logs subscription invokes a second function when an error is recorded\. The processor function uses the AWS SDK to gather details about the request and stores them in an Amazon S3 bucket\. - ------- -#### [ Python ] - -**Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. - ------- -#### [ Ruby ] - -**Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. - ------- -#### [ Java ] - -**Sample Lambda applications in Java** -+ [java\-basic](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-basic) – A collection of minimal Java functions with unit tests and variable logging configuration\. -+ [java\-events](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/java-events) – A collection of Java functions that contain skeleton code for how to handle events from various services such as Amazon API Gateway, Amazon SQS, and Amazon Kinesis\. These functions use the latest version of the [aws\-lambda\-java\-events](java-package.md) library \(3\.0\.0 and newer\)\. These examples do not require the AWS SDK as a dependency\. -+ [s3\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/s3-java) – A Java function that processes notification events from Amazon S3 and uses the Java Class Library \(JCL\) to create thumbnails from uploaded image files\. -+ [Use API Gateway to invoke a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/example_cross_LambdaAPIGateway_section.html) – A Java function that scans a Amazon DynamoDB table that contains employee information\. It then uses Amazon Simple Notification Service to send a text message to employees celebrating their work anniversaries\. This example uses API Gateway to invoke the function\. - ------- -#### [ Go ] - -Lambda provides the following sample applications for the Go runtime: - -**Sample Lambda applications in Go** -+ [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go) – A Go function that shows the use of Lambda's Go libraries, logging, environment variables, and the AWS SDK\. - ------- -#### [ C\# ] - -**Sample Lambda applications in C\#** -+ [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp) – A C\# function that shows the use of Lambda's \.NET libraries, logging, environment variables, AWS X\-Ray tracing, unit tests, and the AWS SDK\. -+ [ec2\-spot](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/ec2-spot) – A function that manages spot instance requests in Amazon EC2\. - ------- -#### [ PowerShell ] - -Lambda provides the following sample applications for the PowerShell runtime: -+ [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell) – A PowerShell function that shows the use of logging, environment variables, and the AWS SDK\. - ------- - -To deploy a sample application, follow the instructions in its README file\. To learn more about the architecture and use cases of an application, read the topics in this chapter\. - -**Topics** -+ [Blank function sample application for AWS Lambda](samples-blank.md) -+ [Error processor sample application for AWS Lambda](samples-errorprocessor.md) -+ [List manager sample application for AWS Lambda](samples-listmanager.md) \ No newline at end of file diff --git a/doc_source/lambda-security.md b/doc_source/lambda-security.md deleted file mode 100644 index 9cebf5f4..00000000 --- a/doc_source/lambda-security.md +++ /dev/null @@ -1,19 +0,0 @@ -# Security in AWS Lambda - -Cloud security at AWS is the highest priority\. As an AWS customer, you benefit from a data center and network architecture that is built to meet the requirements of the most security\-sensitive organizations\. - -Security is a shared responsibility between AWS and you\. The [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/) describes this as security *of* the cloud and security *in* the cloud: -+ **Security of the cloud** – AWS is responsible for protecting the infrastructure that runs AWS services in the AWS Cloud\. AWS also provides you with services that you can use securely\. Third\-party auditors regularly test and verify the effectiveness of our security as part of the [AWS compliance programs](http://aws.amazon.com/compliance/programs/)\. To learn about the compliance programs that apply to AWS Lambda, see [AWS Services in Scope by Compliance Program](http://aws.amazon.com/compliance/services-in-scope/)\. -+ **Security in the cloud** – Your responsibility is determined by the AWS service that you use\. You are also responsible for other factors including the sensitivity of your data, your company’s requirements, and applicable laws and regulations\. - -This documentation helps you understand how to apply the shared responsibility model when using Lambda\. The following topics show you how to configure Lambda to meet your security and compliance objectives\. You also learn how to use other AWS services that help you to monitor and secure your Lambda resources\. - -For more information about applying security principles to Lambda applications, see [Security](https://docs.aws.amazon.com/lambda/latest/operatorguide/security-ops.html) in the *Lambda operator guide*\. - -**Topics** -+ [Data protection in AWS Lambda](security-dataprotection.md) -+ [Identity and access management for Lambda](security-iam.md) -+ [Compliance validation for AWS Lambda](security-compliance.md) -+ [Resilience in AWS Lambda](security-resilience.md) -+ [Infrastructure security in AWS Lambda](security-infrastructure.md) -+ [Configuration and vulnerability analysis in AWS Lambda](security-configuration.md) \ No newline at end of file diff --git a/doc_source/lambda-services.md b/doc_source/lambda-services.md deleted file mode 100644 index a69e0a4b..00000000 --- a/doc_source/lambda-services.md +++ /dev/null @@ -1,75 +0,0 @@ -# Using AWS Lambda with other services - -AWS Lambda integrates with other AWS services to invoke functions or take other actions\. These are some common use cases: -+ Invoke a function in response to resource lifecycle events, such as with Amazon Simple Storage Service \(Amazon S3\)\. For more information, see [Using AWS Lambda with Amazon S3](with-s3.md)\. -+ Respond to incoming HTTP requests\. For more information, see [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md)\. -+ Consume events from a queue\. For more information, see [Using Lambda with Amazon SQS](with-sqs.md)\. -+ Run a function on a schedule\. For more information, see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. - -Depending on which service you're using with Lambda, the invocation generally works in one of two ways\. An event drives the invocation or Lambda polls a queue or data stream and invokes the function in response to activity in the queue or data stream\. Lambda integrates with Amazon Elastic File System and AWS X\-Ray in a way that doesn't involve invoking functions\. - -For more information, see [Event\-driven invocation](#event-driven-invocation) and [Lambda polling](#lambda-polling)\. Or, look up the service that you want to work with in the following section to find a link to information about using that service with Lambda\. - -## Listing of services and links to more information - -Find the service that you want to work with in the following table, to determine which method of invocation you should use\. Follow the link from the service name to find information about how to set up the integration between the services\. These topics also include example events that you can use to test your function\. - -**Tip** -Entries in this table are alphabetical by service name, excluding the "Amazon" or "AWS" prefix\. You can also use your browser's search functionality to find your service in the list\. - - -**** - -| Service | Method of invocation | -| --- | --- | -| [Amazon Alexa](services-alexa.md) | Event\-driven; synchronous invocation | -| [Amazon Managed Streaming for Apache Kafka](with-msk.md) | Lambda polling | -| [Self\-managed Apache Kafka](with-kafka.md) | Lambda polling | -| [Amazon API Gateway](services-apigateway.md) | Event\-driven; synchronous invocation | -| [AWS CloudFormation](services-cloudformation.md) | Event\-driven; asynchronous invocation | -| [Amazon CloudFront \(Lambda@Edge\)](lambda-edge.md) | Event\-driven; synchronous invocation | -| [Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md) | Event\-driven; asynchronous invocation | -| [Amazon CloudWatch Logs](services-cloudwatchlogs.md) | Event\-driven; asynchronous invocation | -| [AWS CodeCommit](services-codecommit.md) | Event\-driven; asynchronous invocation | -| [AWS CodePipeline](services-codepipeline.md) | Event\-driven; asynchronous invocation | -| [Amazon Cognito](services-cognito.md) | Event\-driven; synchronous invocation | -| [AWS Config](services-config.md) | Event\-driven; asynchronous invocation | -| [Amazon Connect](services-connect.md) | Event\-driven; synchronous invocation | -| [Amazon DynamoDB](with-ddb.md) | Lambda polling | -| [Amazon Elastic File System](services-efs.md) | Special integration | -| [Elastic Load Balancing \(Application Load Balancer\)](services-alb.md) | Event\-driven; synchronous invocation | -| [AWS IoT](services-iot.md) | Event\-driven; asynchronous invocation | -| [AWS IoT Events](services-iotevents.md) | Event\-driven; asynchronous invocation | -| [Amazon Kinesis](with-kinesis.md) | Lambda polling | -| [Amazon Kinesis Data Firehose](services-kinesisfirehose.md) | Event\-driven; synchronous invocation | -| [Amazon Lex](services-lex.md) | Event\-driven; synchronous invocation | -| [Amazon MQ](with-mq.md) | Lambda polling | -| [Amazon Simple Email Service](services-ses.md) | Event\-driven; asynchronous invocation | -| [Amazon Simple Notification Service](with-sns.md) | Event\-driven; asynchronous invocation | -| [Amazon Simple Queue Service](with-sqs.md) | Lambda polling | -| [Amazon Simple Storage Service \(Amazon S3\)](with-s3.md) | Event\-driven; asynchronous invocation | -| [Amazon Simple Storage Service Batch](services-s3-batch.md) | Event\-driven; synchronous invocation | -| [Secrets Manager](with-secrets-manager.md) | Event\-driven; synchronous invocation | -| [AWS X\-Ray](services-xray.md) | Special integration | - -## Event\-driven invocation - -Some services generate events that can invoke your Lambda function\. For more information about designing these types of architectures , see [Event driven architectures](https://docs.aws.amazon.com/lambda/latest/operatorguide/event-driven-architectures.html) in the *Lambda operator guide*\. - -When you implement an event\-driven architecture, you grant the event\-generating service permission to invoke your function in the function's [resource\-based policy](access-control-resource-based.md)\. Then you configure that service to generate events that invoke your function\. - -The events are data structured in JSON format\. The JSON structure varies depending on the service that generates it and the event type, but they all contain the data that the function needs to process the event\. - -Lambda converts the event document into an object and passes it to your [function handler](gettingstarted-concepts.md)\. For compiled languages, Lambda provides definitions for event types in a library\. For more information, see the topic about building functions with your language: [Building Lambda functions with C\#](lambda-csharp.md), [Building Lambda functions with Go](lambda-golang.md), [Building Lambda functions with Java](lambda-java.md), or [Building Lambda functions with PowerShell](lambda-powershell.md)\. - -Depending on the service, the event\-driven invocation can be synchronous or asynchronous\. -+ For synchronous invocation, the service that generates the event waits for the response from your function\. That service defines the data that the function needs to return in the response\. The service controls the error strategy, such as whether to retry on errors\. For more information, see [Synchronous invocation](invocation-sync.md)\. -+ For asynchronous invocation, Lambda queues the event before passing it to your function\. When Lambda queues the event, it immediately sends a success response to the service that generated the event\. After the function processes the event, Lambda doesn’t return a response to the event\-generating service\. For more information, see [Asynchronous invocation](invocation-async.md)\. - -For more information about how Lambda manages error handling for synchronously and asychronously invoked functions, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. - -## Lambda polling - -For services that generate a queue or data stream, you set up an [event source mapping](invocation-eventsourcemapping.md) in Lambda to have Lambda poll the queue or a data stream\. - -When you implement a Lambda polling architecture, you grant Lambda permission to access the other service in the function's [execution role](lambda-intro-execution-role.md)\. Lambda reads data from the other service, creates an event, and invokes your function\. \ No newline at end of file diff --git a/doc_source/lambda-settingup.md b/doc_source/lambda-settingup.md deleted file mode 100644 index 74d81bd2..00000000 --- a/doc_source/lambda-settingup.md +++ /dev/null @@ -1,70 +0,0 @@ -# Prerequisites - -To use AWS Lambda, you need an AWS account\. If you plan to configure and use Lambda functions from the command line, set up the AWS CLI\. You can set up other development and build tools as required for the environment and language that you are planning to use\. - -**Topics** -+ [AWS Account](#lambda-settingup-account) -+ [AWS CLI](#lambda-settingup-awscli) -+ [AWS SAM](#lambda-settingup-awssam) -+ [AWS SAM CLI](#lambda-settingup-samcli) -+ [Tools for container images](#lambda-settingup-docker) -+ [Code authoring tools](#lambda-settingup-author) - -## AWS Account - -To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) - -As a best practice, create an AWS Identity and Access Management \(IAM\) user with administrator permissions, and then use that IAM user for all work that does not require root credentials\. Create a password for console access, and create access keys to use command line tools\. For instructions, see [Creating your first IAM admin user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-admin-group.html) in the *IAM User Guide*\. - -## AWS CLI - -If you plan to configure and use Lambda functions from the command line, install the AWS Command Line Interface \(AWS CLI\)\. Tutorials in this guide use the AWS CLI, which has commands for all Lambda API operations\. Some functionality is not available in the Lambda console and can be accessed only with the AWS CLI or the AWS SDKs\. - -To set up the AWS CLI, see the following topics in the *AWS Command Line Interface User Guide*\. -+ [Installing, updating, and uninstalling the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) -+ [Configuring the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -To verify that the AWS CLI is configured correctly, run the `list-functions` command to see a list of your Lambda functions in the current AWS Region\. - -``` -aws lambda list-functions -``` - -## AWS SAM - -The AWS Serverless Application Model \(AWS SAM\) is an extension for the AWS CloudFormation template language that lets you define serverless applications at a higher level\. AWS SAM abstracts away common tasks such as function role creation, making it easier to write templates\. AWS SAM is supported directly by AWS CloudFormation, and includes additional functionality through the AWS CLI and AWS SAM CLI\. - -For more information about AWS SAM templates, see the [AWS SAM specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) in the *AWS Serverless Application Model Developer Guide*\. - -## AWS SAM CLI - -The AWS SAM CLI is a separate command line tool that you can use to manage and test AWS SAM applications\. In addition to commands for uploading artifacts and launching AWS CloudFormation stacks that are also available in the AWS CLI, the AWS SAM CLI provides commands for validating templates and running applications locally in a Docker container\. You can use the AWS SAM CLI to build functions deployed as \.zip file archives or container images\. - -To set up the AWS SAM CLI, see [Installing the AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) in the *AWS Serverless Application Model Developer Guide*\. - -## Tools for container images - -To create and test functions deployed as container images, you can use native container tools such as the Docker CLI\. - -To set up the Docker CLI, see [Get Docker](https://docs.docker.com/get-docker) on the Docker Docs website\. For an introduction to using Docker with AWS, see [Getting started with Amazon ECR using the AWS CLI](https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html) in the *Amazon Elastic Container Registry User Guide*\. - -## Code authoring tools - -You can author your Lambda function code in the languages that Lambda supports\. For a list of supported languages, see [Lambda runtimes](lambda-runtimes.md)\. There are tools for authoring code, such as the Lambda console, Eclipse integrated development environment \(IDE\), and Visual Studio IDE\. But the available tools and options depend on: -+ The language that you use to write your Lambda function code\. -+ The libraries that you use in your code\. The Lambda runtimes provide some of the libraries, and you must upload any additional libraries that you use\. - -The following table lists the languages that Lambda supports, and the tools and options that you can use with them\. - - -**** - -| Language | Tools and options for authoring code | -| --- | --- | -| Node\.js | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| Java | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| C\# | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| Python | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| Ruby | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| Go | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | -| PowerShell | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/lambda-settingup.html) | \ No newline at end of file diff --git a/doc_source/lambda-stepfunctions.md b/doc_source/lambda-stepfunctions.md deleted file mode 100644 index 2119a930..00000000 --- a/doc_source/lambda-stepfunctions.md +++ /dev/null @@ -1,8 +0,0 @@ -# Orchestrating functions with Step Functions - -AWS Step Functions is an orchestration service that lets you connect Lambda functions together into serverless workflows, called state machines\. Use Step Functions to orchestrate serverless applications workflows \(for example, a store checkout process\), build long\-running workflows for IT automation and human\-approval use cases, or create high\-volume short\-duration workflows for streaming data processing and ingestion\. - -**Topics** -+ [State machine application patterns](stepfunctions-patterns.md) -+ [Managing state machines in the Lambda console](stepfunctions-lc.md) -+ [Orchestration examples with Step Functions](services-stepfunctions.md) \ No newline at end of file diff --git a/doc_source/lambda-troubleshooting.md b/doc_source/lambda-troubleshooting.md deleted file mode 100644 index 927c5b35..00000000 --- a/doc_source/lambda-troubleshooting.md +++ /dev/null @@ -1,14 +0,0 @@ -# Troubleshooting issues in Lambda - -The following topics provide troubleshooting advice for errors and issues that you might encounter when using the Lambda API, console, or tools\. If you find an issue that is not listed here, you can use the **Feedback** button on this page to report it\. - -For more troubleshooting advice and answers to common support questions, visit the [AWS Knowledge Center](https://aws.amazon.com/premiumsupport/knowledge-center/#AWS_Lambda)\. - -For more information about debugging and troubleshooting Lambda applications, see [Debugging](https://docs.aws.amazon.com/lambda/latest/operatorguide/debugging-ops.html) in the *Lambda operator guide*\. - -**Topics** -+ [Troubleshoot deployment issues in Lambda](troubleshooting-deployment.md) -+ [Troubleshoot invocation issues in Lambda](troubleshooting-invocation.md) -+ [Troubleshoot execution issues in Lambda](troubleshooting-execution.md) -+ [Troubleshoot networking issues in Lambda](troubleshooting-networking.md) -+ [Troubleshoot container image issues in Lambda](troubleshooting-images.md) \ No newline at end of file diff --git a/doc_source/lambda-typescript.md b/doc_source/lambda-typescript.md deleted file mode 100644 index 6b47c5c8..00000000 --- a/doc_source/lambda-typescript.md +++ /dev/null @@ -1,58 +0,0 @@ -# Building Lambda functions with TypeScript - -You can use the Node\.js runtime to run TypeScript code in AWS Lambda\. Because Node\.js doesn't run TypeScript code natively, you must first transpile your TypeScript code into JavaScript\. Then, use the JavaScript files to deploy your function code to Lambda\. Your code runs in an environment that includes the AWS SDK for JavaScript, with credentials from an AWS Identity and Access Management \(IAM\) role that you manage\. - -Lambda supports the following Node\.js runtimes\. - - -**Node\.js** - -| Name | Identifier | SDK | Operating system | Architectures | Deprecation | -| --- | --- | --- | --- | --- | --- | -| Node\.js 16 | `nodejs16.x` | 2\.1083\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 14 | `nodejs14.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | | -| Node\.js 12 | `nodejs12.x` | 2\.1055\.0 | Amazon Linux 2 | x86\_64, arm64 | Mar 31, 2023 | - -## Setting up a TypeScript development environment - -Use a local integrated development environment \(IDE\), text editor, or [AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-typescript.html) to write your TypeScript function code\. You can’t create TypeScript code on the Lambda console\. - -To transpile your TypeScript code, set up a compiler such as [esbuild](https://esbuild.github.io/) or Microsoft's TypeScript compiler \(`tsc`\) , which is bundled with the [TypeScript distribution](https://www.typescriptlang.org/download)\. You can use the [AWS Serverless Application Model \(AWS SAM\)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started.html) or the [AWS Cloud Development Kit \(AWS CDK\)](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) to simplify building and deploying TypeScript code\. Both tools use esbuild to transpile TypeScript code into JavaScript\. - -When using esbuild, consider the following: -+ There are several [TypeScript caveats](https://esbuild.github.io/content-types/#typescript-caveats)\. -+ You must configure your TypeScript transpilation settings to match the Node\.js runtime that you plan to use\. For more information, see [Target](https://esbuild.github.io/api/#target) in the esbuild documentation\. For an example of a **tsconfig\.json** file that demonstrates how to target a specific Node\.js version supported by Lambda, refer to the [TypeScript GitHub repository](https://github.com/tsconfig/bases/blob/main/bases/node14.json)\. -+ esbuild doesn’t perform type checks\. To check types, use the `tsc` compiler\. Run `tsc -noEmit` or add a `"noEmit"` parameter to your **tsconfig\.json** file, as shown in the following example\. This configures `tsc` to not emit JavaScript files\. After checking types, use esbuild to convert the TypeScript files into JavaScript\. - -**Example tsconfig\.json** - -``` - { - "compilerOptions": { - "target": "es2020", - "strict": true, - "preserveConstEnums": true, - "noEmit": true, - "sourceMap": false, - "module":"commonjs", - "moduleResolution":"node", - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - }, - "exclude": ["node_modules", "**/*.test.ts"] -} -``` - -**Topics** -+ [Setting up a TypeScript development environment](#typescript-dev) -+ [AWS Lambda function handler in TypeScript](typescript-handler.md) -+ [Deploy transpiled TypeScript code in Lambda with \.zip file archives](typescript-package.md) -+ [Deploy transpiled TypeScript code in Lambda with container images](typescript-image.md) -+ [AWS Lambda function errors in TypeScript](typescript-exceptions.md) - -The following topics about the Node\.js runtime are also relevant for TypeScript: -+ [AWS Lambda context object in Node\.js](nodejs-context.md) -+ [AWS Lambda function logging in Node\.js](nodejs-logging.md) -+ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) \ No newline at end of file diff --git a/doc_source/lambda-urls.md b/doc_source/lambda-urls.md deleted file mode 100644 index 8b485ad7..00000000 --- a/doc_source/lambda-urls.md +++ /dev/null @@ -1,23 +0,0 @@ -# Lambda function URLs - -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: - -``` -https://.lambda-url..on.aws -``` - -Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After you configure a function URL for your function, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. - -**Note** -You can access your function URL through the public Internet only\. While Lambda functions do support AWS PrivateLink, function URLs do not\. - -Lambda function URLs use [resource\-based policies](access-control-resource-based.md) for security and access control\. Function URLs also support cross\-origin resource sharing \(CORS\) configuration options\. - -You can apply function URLs to any function alias, or to the `$LATEST` unpublished function version\. You can't add a function URL to any other function version\. - -**Topics** -+ [Creating and managing Lambda function URLs](urls-configuration.md) -+ [Security and auth model for Lambda function URLs](urls-auth.md) -+ [Invoking Lambda function URLs](urls-invocation.md) -+ [Monitoring Lambda function URLs](urls-monitoring.md) -+ [Tutorial: Creating a Lambda function with a function URL](urls-tutorial.md) \ No newline at end of file diff --git a/doc_source/logging-using-cloudtrail.md b/doc_source/logging-using-cloudtrail.md deleted file mode 100644 index f45fd6a2..00000000 --- a/doc_source/logging-using-cloudtrail.md +++ /dev/null @@ -1,165 +0,0 @@ -# Logging Lambda API calls with CloudTrail - -Lambda is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Lambda\. CloudTrail captures API calls for Lambda as events\. The calls captured include calls from the Lambda console and code calls to the Lambda API operations\. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon Simple Storage Service \(Amazon S3\) bucket, including events for Lambda\. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in **Event history**\. Using the information collected by CloudTrail, you can determine the request that was made to Lambda, the IP address from which the request was made, who made the request, when it was made, and additional details\. - -For more information about CloudTrail, including how to configure and enable it, see the [AWS CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)\. - -## Lambda information in CloudTrail - -CloudTrail is enabled on your AWS account when you create the account\. When supported event activity occurs in Lambda, that activity is recorded in a CloudTrail event along with other AWS service events in **Event history**\. You can view, search, and download recent events in your AWS account\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. - -For an ongoing record of events in your AWS account, including events for Lambda, you create a *trail*\. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket\. By default, when you create a trail in the console, the trail applies to all AWS Regions\. The trail logs events from all Regions in the AWS partition and delivers the log files to the S3 bucket that you specify\. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs\. - -For more information, see the following topics in the *AWS CloudTrail User Guide*: -+ [Overview for creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html) -+ [CloudTrail supported services and integrations](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-aws-service-specific-topics.html#cloudtrail-aws-service-specific-topics-integrations) -+ [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting_notifications_top_level.html) -+ [Receiving CloudTrail log files from multiple regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) and [Receiving CloudTrail log files from multiple accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html) - -Every log entry contains information about who generated the request\. The user identity information in the log helps you determine whether the request was made with root or AWS Identity and Access Management \(IAM\) user credentials, with temporary security credentials for a role or federated user, or by another AWS service\. For more information, see the **userIdentity** field in the [CloudTrail event reference](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html)\. - -You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically\. By default, your log files are encrypted by using Amazon S3 server\-side encryption \(SSE\)\. - -You can choose to have CloudTrail publish Amazon Simple Notification Service \(Amazon SNS\) notifications when new log files are delivered if you want to take quick action upon log file delivery\. For more information, see [Configuring Amazon SNS notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/configure-sns-notifications-for-cloudtrail.html)\. - -You can also aggregate Lambda log files from multiple Regions and multiple AWS accounts into a single S3 bucket\. For more information, see [Working with CloudTrail log files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-working-with-log-files.html)\. - -### List of supported Lambda API actions - -Lambda supports logging the following actions as events in CloudTrail log files\. - -**Note** -In the CloudTrail log file, the `eventName` might include date and version information, but it is still referring to the same public API\. For example the, `GetFunction` action might appear as `"GetFunction20150331"`\. To see the `eventName` for a particular action, view a log file entry in your event history\. For more information, see [Viewing events with CloudTrail event history](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html) in the *AWS CloudTrail User Guide*\. -+ [AddLayerVersionPermission](API_AddLayerVersionPermission.md) -+ [AddPermission](API_AddPermission.md) -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [CreateFunction](API_CreateFunction.md) - - \(The `Environment` and `ZipFile` parameters are omitted from the CloudTrail logs for `CreateFunction`\.\) -+ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) -+ [DeleteFunction](API_DeleteFunction.md) -+ [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [GetFunction](API_GetFunction.md) -+ [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [GetLayerVersionPolicy](API_GetLayerVersionPolicy.md) -+ [GetPolicy](API_GetPolicy.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [ListFunctions](API_ListFunctions.md) -+ [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) -+ [PublishLayerVersion](API_PublishLayerVersion.md) - - \(The `ZipFile` parameter is omitted from the CloudTrail logs for `PublishLayerVersion`\.\) -+ [RemovePermission](API_RemovePermission.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) - - \(The `ZipFile` parameter is omitted from the CloudTrail logs for `UpdateFunctionCode`\.\) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) - - \(The `Environment` parameter is omitted from the CloudTrail logs for `UpdateFunctionConfiguration`\.\) -+ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) - -## Understanding Lambda log file entries - -CloudTrail log files contain one or more log entries where each entry is made up of multiple JSON\-formatted events\. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on\. The log entries are not guaranteed to be in any particular order\. That is, they are not an ordered stack trace of the public API calls\. - -The following example shows CloudTrail log entries for the `GetFunction` and `DeleteFunction` actions\. - -**Note** -The `eventName` might include date and version information, such as `"GetFunction20150331"`, but it is still referring to the same public API\. - -``` -{ - "Records": [ - { - "eventVersion": "1.03", - "userIdentity": { - "type": "IAMUser", - "principalId": "A1B2C3D4E5F6G7EXAMPLE", - "arn": "arn:aws:iam::999999999999:user/myUserName", - "accountId": "999999999999", - "accessKeyId": "AKIAIOSFODNN7EXAMPLE", - "userName": "myUserName" - }, - "eventTime": "2015-03-18T19:03:36Z", - "eventSource": "lambda.amazonaws.com", - "eventName": "GetFunction", - "awsRegion": "us-east-1", - "sourceIPAddress": "127.0.0.1", - "userAgent": "Python-httplib2/0.8 (gzip)", - "errorCode": "AccessDenied", - "errorMessage": "User: arn:aws:iam::999999999999:user/myUserName is not authorized to perform: lambda:GetFunction on resource: arn:aws:lambda:us-west-2:999999999999:function:other-acct-function", - "requestParameters": null, - "responseElements": null, - "requestID": "7aebcd0f-cda1-11e4-aaa2-e356da31e4ff", - "eventID": "e92a3e85-8ecd-4d23-8074-843aabfe89bf", - "eventType": "AwsApiCall", - "recipientAccountId": "999999999999" - }, - { - "eventVersion": "1.03", - "userIdentity": { - "type": "IAMUser", - "principalId": "A1B2C3D4E5F6G7EXAMPLE", - "arn": "arn:aws:iam::999999999999:user/myUserName", - "accountId": "999999999999", - "accessKeyId": "AKIAIOSFODNN7EXAMPLE", - "userName": "myUserName" - }, - "eventTime": "2015-03-18T19:04:42Z", - "eventSource": "lambda.amazonaws.com", - "eventName": "DeleteFunction", - "awsRegion": "us-east-1", - "sourceIPAddress": "127.0.0.1", - "userAgent": "Python-httplib2/0.8 (gzip)", - "requestParameters": { - "functionName": "basic-node-task" - }, - "responseElements": null, - "requestID": "a2198ecc-cda1-11e4-aaa2-e356da31e4ff", - "eventID": "20b84ce5-730f-482e-b2b2-e8fcc87ceb22", - "eventType": "AwsApiCall", - "recipientAccountId": "999999999999" - } - ] -} -``` - -## Using CloudTrail to track function invocations - -CloudTrail also logs data events\. You can turn on data event logging so that you log an event every time Lambda functions are invoked\. This helps you understand what identities are invoking the functions and the frequency of their invocations\. For more information on this option, see [Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)\. - -**Note** -CloudTrail logs only authenticated and authorized requests\. CloudTrail does not log requests that fail authentication \(credentials are missing or the provided credentials are not valid\) or requests with credentials that are not authorized to invoke the function\. - -### Using CloudTrail to troubleshoot disabled event sources - -One data event that can be encountered is a `LambdaESMDisabled` event\. There are five general categories of error that are associated with this event: - -**`RESOURCE_NOT_FOUND`** -The resource specified in the request does not exist\. - -**`FUNCTION_NOT_FOUND`** -The function attached to the event source does not exist\. - -**`REGION_NAME_NOT_VALID`** -A Region name provided to the event source or function is invalid\. - -**`AUTHORIZATION_ERROR`** -Permissions have not been set, or are misconfigured\. - -**`FUNCTION_IN_FAILED_STATE`** -The function code does not compile, has encountered an unrecoverable exception, or a bad deployment has occurred\. - -These errors are included in the CloudTrail event message within the `serviceEventDetails` entity\. - -**Example `serviceEventDetails` entity** - -``` - "serviceEventDetails":{ - "ESMDisableReason":"Lambda Function not found" -} -``` \ No newline at end of file diff --git a/doc_source/monitoring-cloudwatchlogs.md b/doc_source/monitoring-cloudwatchlogs.md deleted file mode 100644 index 605fd9d1..00000000 --- a/doc_source/monitoring-cloudwatchlogs.md +++ /dev/null @@ -1,57 +0,0 @@ -# Accessing Amazon CloudWatch logs for AWS Lambda - -AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch\. To help you troubleshoot failures in a function, after you set up permissions, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs\. - -You can insert logging statements into your code to help you validate that your code is working as expected\. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/**\. - -You can view logs for Lambda functions using the Lambda console, the CloudWatch console, the AWS Command Line Interface \(AWS CLI\), or the CloudWatch API\. This page describes how to view logs using the Lambda console\. - -**Note** -It may take 5 to 10 minutes for logs to show up after a function invocation\. - -**Topics** -+ [Prerequisites](#monitoring-cloudwatchlogs-prereqs) -+ [Pricing](#monitoring-cloudwatchlogs-pricing) -+ [Using the Lambda console](#monitoring-cloudwatchlogs-console) -+ [Using the AWS CLI](#monitoring-cloudwatchlogs-cli) -+ [What's next?](#monitoring-cloudwatchlogs-next-up) - -## Prerequisites - -Your [execution role](lambda-intro-execution-role.md) needs permission to upload logs to CloudWatch Logs\. You can add CloudWatch Logs permissions using the `AWSLambdaBasicExecutionRole` AWS managed policy provided by Lambda\. To add this policy to your role, run the following command: - -``` -aws iam attach-role-policy --role-name your-role --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole -``` - -For more information, see [AWS managed policies for Lambda features](lambda-intro-execution-role.md#permissions-executionrole-features)\. - -## Pricing - -There is no additional charge for using Lambda logs; however, standard CloudWatch Logs charges apply\. For more information, see [CloudWatch pricing\.](https://aws.amazon.com/cloudwatch/pricing/) - -## Using the Lambda console - -**To view logs using the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Monitor**\. - -1. Choose **View logs in CloudWatch**\. - -## Using the AWS CLI - -To debug and validate that your code is working as expected, you can output logs with the standard logging functionality for your programming language\. The Lambda runtime uploads your function's log output to CloudWatch Logs\. For language\-specific instructions, see the following topics: -+ [AWS Lambda function logging in Node\.js](nodejs-logging.md) -+ [AWS Lambda function logging in Python](python-logging.md) -+ [AWS Lambda function logging in Ruby](ruby-logging.md) -+ [AWS Lambda function logging in Java](java-logging.md) -+ [AWS Lambda function logging in Go](golang-logging.md) -+ [Lambda function logging in C\#](csharp-logging.md) -+ [AWS Lambda function logging in PowerShell](powershell-logging.md) - -## What's next? -+ Learn more about log groups and accessing them through the CloudWatch console in [Monitoring system, application, and custom log files](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatchLogs.html) in the *Amazon CloudWatch User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-code-profiler.md b/doc_source/monitoring-code-profiler.md deleted file mode 100644 index e0409175..00000000 --- a/doc_source/monitoring-code-profiler.md +++ /dev/null @@ -1,50 +0,0 @@ -# Using CodeGuru Profiler with your Lambda function - -You can use Amazon CodeGuru Profiler to gain insights into runtime performance of your Lambda functions\. This page describes how to activate CodeGuru Profiler from the Lambda console\. - -**Topics** -+ [Supported runtimes](#monitoring-code-profiler-runtimes) -+ [Activating CodeGuru Profiler from the Lambda console](#monitoring-code-profiler-activate-console) -+ [What happens when you activate CodeGuru Profiler from the Lambda console?](#monitoring-code-profiler-what-happens-activate) -+ [What's next?](#monitoring-code-profiler-next-up) - -## Supported runtimes - -You can activate CodeGuru Profiler from the Lambda console if your function's runtime is Python3\.8, Python3\.9, Java 8 with Amazon Linux 2, or Java 11\. For additional runtime versions, you can activate CodeGuru Profiler manually\. -+ For Java runtimes, see [ Profiling your Java applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html)\. -+ For Python runtimes, see [ Profiling your Python applications that run on AWS Lambda](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda.html)\. - -## Activating CodeGuru Profiler from the Lambda console - -This section describes how to activate CodeGuru Profiler from the Lambda console\. - -**To activate CodeGuru Profiler from the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose your function\. - -1. Choose the **Configuration** tab\. - -1. On the **Monitoring and operations tools** pane, choose **Edit**\. - -1. Under **Amazon CodeGuru Profiler**, turn on **Code profiling**\. - -1. Choose **Save**\. - -After activation, CodeGuru automatically creates a profiler group with the name `aws-lambda-`\. You can change the name from the CodeGuru console\. - -## What happens when you activate CodeGuru Profiler from the Lambda console? - -When you activate CodeGuru Profiler from the console, Lambda automatically does the following on your behalf: -+ Lambda adds a CodeGuru Profiler layer to your function\. For more details, see [ Use AWS Lambda layers](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/python-lambda-layers.html) in the *Amazon CodeGuru Profiler User Guide*\. -+ Lambda also adds environment variables to your function\. The exact value varies based on the runtime\. -**Environment variables** -[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/lambda/latest/dg/monitoring-code-profiler.html) -+ Lambda adds the `AmazonCodeGuruProfilerAgentAccess` policy to your function's execution role\. - -**Note** -When you deactivate CodeGuru Profiler from the console, Lambda automatically removes the CodeGuru Profiler layer and environment variables from your function\. However, Lambda does not remove the `AmazonCodeGuruProfilerAgentAccess` policy from your execution role\. - -## What's next? -+ Learn more about the data collected by your profiler group in [Working with visualizations](https://docs.aws.amazon.com/codeguru/latest/profiler-ug/working-with-visualizations.html) in the *Amazon CodeGuru Profiler User Guide*\. \ No newline at end of file diff --git a/doc_source/monitoring-functions-access-metrics.md b/doc_source/monitoring-functions-access-metrics.md deleted file mode 100644 index 69ecea60..00000000 --- a/doc_source/monitoring-functions-access-metrics.md +++ /dev/null @@ -1,80 +0,0 @@ -# Monitoring functions on the Lambda console - -Lambda monitors functions on your behalf and sends metrics to Amazon CloudWatch\. The Lambda console creates monitoring graphs for these metrics and shows them on the **Monitoring** page for each Lambda function\. - -This page describes the basics of using the Lambda console to view function metrics, including total requests, duration, and error rates\. - -## Pricing - -CloudWatch has a perpetual free tier\. Beyond the free tier threshold, CloudWatch charges for metrics, dashboards, alarms, logs, and insights\. For more information, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. - -## Using the Lambda console - -You can monitor your Lambda functions and applications on the Lambda console\. - -**To monitor a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose the **Monitor** tab\. - -## Types of monitoring graphs - -The following section describes the monitoring graphs on the Lambda console\. - -**Lambda monitoring graphs** -+ **Invocations** – The number of times that the function was invoked\. -+ **Duration** – The average, minimum, and maximum amount of time your function code spends processing an event\. -+ **Error count and success rate \(%\)** – The number of errors and the percentage of invocations that completed without error\. -+ **Throttles** – The number of times that an invocation failed due to concurrency limits\. -+ **IteratorAge** – For stream event sources, the age of the last item in the batch when Lambda received it and invoked the function\. -+ **Async delivery failures** – The number of errors that occurred when Lambda attempted to write to a destination or dead\-letter queue\. -+ **Concurrent executions** – The number of function instances that are processing events\. - -## Viewing graphs on the Lambda console - -The following section describes how to view CloudWatch monitoring graphs on the Lambda console, and open the CloudWatch metrics dashboard\. - -**To view monitoring graphs for a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose the **Monitor** tab\. - -1. On the **Metrics**, **Logs**, or **Traces** tab, choose from the predefined time ranges, or choose a custom time range\. - -1. To see the definition of a graph in CloudWatch, choose the three vertical dots \(**Widget actions**\), and then choose **View in metrics** to open the **Metrics** dashboard on the CloudWatch console\. - -![\[An example monitoring definition on the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-definition.png) - -## Viewing queries on the CloudWatch Logs console - -The following section describes how to view and add reports from CloudWatch Logs Insights to a custom dashboard on the CloudWatch Logs console\. - -**To view reports for a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose the **Monitor** tab\. - -1. Choose **View logs in CloudWatch**\. - -1. Choose **View in Logs Insights**\. - -1. Choose from the predefined time ranges, or choose a custom time range\. - -1. Choose **Run query**\. - -1. \(Optional\) Choose **Save**\. - -![\[The CloudWatch Logs Insights reports on the CloudWatch dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/console-monitoring-insights.png) - -## What's next? -+ Learn about the metrics that Lambda records and sends to CloudWatch in [Working with Lambda function metrics](monitoring-metrics.md)\. -+ Learn how to use CloudWatch Lambda Insights to collect and aggregate Lambda function runtime performance metrics and logs in [Using Lambda Insights in Amazon CloudWatch](monitoring-insights.md)\. \ No newline at end of file diff --git a/doc_source/monitoring-insights.md b/doc_source/monitoring-insights.md deleted file mode 100644 index c42a1f61..00000000 --- a/doc_source/monitoring-insights.md +++ /dev/null @@ -1,137 +0,0 @@ -# Using Lambda Insights in Amazon CloudWatch - -Amazon CloudWatch Lambda Insights collects and aggregates Lambda function runtime performance metrics and logs for your serverless applications\. This page describes how to enable and use Lambda Insights to diagnose issues with your Lambda functions\. - -**Topics** -+ [How Lambda Insights monitors serverless applications](#monitoring-insights-how) -+ [Pricing](#monitoring-insights-pricing) -+ [Supported runtimes](#monitoring-insights-runtimes) -+ [Enabling Lambda Insights in the Lambda console](#monitoring-insights-enabling-console) -+ [Enabling Lambda Insights programmatically](#monitoring-insights-enabling-programmatically) -+ [Using the Lambda Insights dashboard](#monitoring-insights-multifunction) -+ [Example workflow to detect function anomalies](#monitoring-insights-anomalies) -+ [Example workflow using queries to troubleshoot a function](#monitoring-insights-queries) -+ [What's next?](#monitoring-console-next-up) - -## How Lambda Insights monitors serverless applications - -CloudWatch Lambda Insights is a monitoring and troubleshooting solution for serverless applications running on AWS Lambda\. The solution collects, aggregates, and summarizes system\-level metrics including CPU time, memory, disk and network usage\. It also collects, aggregates, and summarizes diagnostic information such as cold starts and Lambda worker shutdowns to help you isolate issues with your Lambda functions and resolve them quickly\. - -Lambda Insights uses a new CloudWatch Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html), which is provided as a [Lambda layer](configuration-layers.md)\. When you enable this extension on a Lambda function for a supported runtime, it collects system\-level metrics and emits a single performance log event for every invocation of that Lambda function\. CloudWatch uses embedded metric formatting to extract metrics from the log events\. For more information, see [Using AWS Lambda extensions](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html)\. - -The Lambda Insights layer extends the `CreateLogStream` and `PutLogEvents` for the `/aws/lambda-insights/` log group\. - -## Pricing - -When you enable Lambda Insights for your Lambda function, Lambda Insights reports 8 metrics per function and every function invocation sends about 1KB of log data to CloudWatch\. You only pay for the metrics and logs reported for your function by Lambda Insights\. There are no minimum fees or mandatory service usage policies\. You do not pay for Lambda Insights if the function is not invoked\. For a pricing example, see [Amazon CloudWatch pricing](http://aws.amazon.com/cloudwatch/pricing/)\. - -## Supported runtimes - -You can use Lambda Insights with any of the runtimes that support [Lambda extensions](runtimes-extensions-api.md)\. - -## Enabling Lambda Insights in the Lambda console - -You can enable Lambda Insights enhanced monitoring on new and existing Lambda functions\. When you enable Lambda Insights on a function in the Lambda console for a supported runtime, Lambda adds the Lambda Insights [extension](https://docs.aws.amazon.com/lambda/latest/dg/lambda-extensions.html) as a layer to your function, and verifies or attempts to attach the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. - -**To enable Lambda Insights in the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose your function\. - -1. Choose the **Configuration** tab\. - -1. On the **Monitoring tools** pane, choose **Edit**\. - -1. Under **Lambda Insights**, turn on **Enhanced monitoring**\. - -1. Choose **Save**\. - -## Enabling Lambda Insights programmatically - -You can also enable Lambda Insights using the AWS Command Line Interface \(AWS CLI\), AWS Serverless Application Model \(SAM\) CLI, AWS CloudFormation, or the AWS Cloud Development Kit \(AWS CDK\)\. When you enable Lambda Insights programmatically on a function for a supported runtime, CloudWatch attaches the [https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy$jsonEditor) policy to your function’s [execution role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)\. - -For more information, see [Getting started with Lambda Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-Getting-Started.html) in the *Amazon CloudWatch User Guide*\. - -## Using the Lambda Insights dashboard - -The Lambda Insights dashboard has two views in the CloudWatch console: the multi\-function overview and the single\-function view\. The multi\-function overview aggregates the runtime metrics for the Lambda functions in the current AWS account and Region\. The single\-function view shows the available runtime metrics for a single Lambda function\. - -You can use the Lambda Insights dashboard multi\-function overview in the CloudWatch console to identify over\- and under\-utilized Lambda functions\. You can use the Lambda Insights dashboard single\-function view in the CloudWatch console to troubleshoot individual requests\. - -**To view the runtime metrics for all functions** - -1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. - -1. Choose from the predefined time ranges, or choose a custom time range\. - -1. \(Optional\) Choose **Add to dashboard** to add the widgets to your CloudWatch dashboard\. -![\[The multi-function overview on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-multifunction-view.png) - -**To view the runtime metrics of a single function** - -1. Open the [Single\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) page in the CloudWatch console\. - -1. Choose from the predefined time ranges, or choose a custom time range\. - -1. \(Optional\) Choose **Add to dashboard** to add the widgets to your CloudWatch dashboard\. -![\[The single-function view on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambainsights-singlefunction-view.png) - -For more information, see [Creating and working with widgets on CloudWatch dashboards](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-and-work-with-widgets.html)\. - -## Example workflow to detect function anomalies - -You can use the multi\-function overview on the Lambda Insights dashboard to identify and detect compute memory anomalies with your function\. For example, if the multi\-function overview indicates that a function is using a large amount of memory, you can view detailed memory utilization metrics in the **Memory Usage** pane\. You can then go to the Metrics dashboard to enable anomaly detection or create an alarm\. - -**To enable anomaly detection for a function** - -1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. - -1. Under **Function summary**, choose your function's name\. - - The single\-function view opens with the function runtime metrics\. -![\[The function summary pane on the Lambda Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-function-summary.png) - -1. On the **Memory Usage** pane, choose the three vertical dots, and then choose **View in metrics** to open the **Metrics** dashboard\. -![\[The menu on the Memory Usage pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-memory-usage.png) - -1. On the **Graphed metrics** tab, in the **Actions** column, choose the first icon to enable anomaly detection for the function\. -![\[The Graphed metrics tab of the Memory Usage pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-graphed-metrics.png) - -For more information, see [Using CloudWatch Anomaly Detection](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html)\. - -## Example workflow using queries to troubleshoot a function - -You can use the single\-function view on the Lambda Insights dashboard to identify the root cause of a spike in function duration\. For example, if the multi\-function overview indicates a large increase in function duration, you can pause on or choose each function in the **Duration** pane to determine which function is causing the increase\. You can then go to the single\-function view and review the **Application logs** to determine the root cause\. - -**To run queries on a function** - -1. Open the [Multi\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:performance) page in the CloudWatch console\. - -1. In the **Duration** pane, choose your function to filter the duration metrics\. -![\[A function chosen in the Duration pane.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-choose-function.png) - -1. Open the [Single\-function](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) page\. - -1. Choose the **Filter metrics by function name** dropdown list, and then choose your function\. - -1. To view the **Most recent 1000 application logs**, choose the **Application logs** tab\. - -1. Review the **Timestamp** and **Message** to identify the invocation request that you want to troubleshoot\. -![\[The Most recent 1000 application logs.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-application-logs.png) - -1. To show the **Most recent 1000 invocations**, choose the **Invocations** tab\. - -1. Select the **Timestamp** or **Message** for the invocation request that you want to troubleshoot\. -![\[Selecting a recent invocation request.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-invocations-function-select.png) - -1. Choose the **View logs** dropdown list, and then choose **View performance logs**\. - - An autogenerated query for your function opens in the **Logs Insights** dashboard\. - -1. Choose **Run query** to generate a **Logs** message for the invocation request\. -![\[Querying the selected function in the Logs Insights dashboard.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-query.png) - -## What's next? -+ Learn how to create a CloudWatch Logs dashboard in [Create a Dashboard](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create_dashboard.html) in the *Amazon CloudWatch User Guide*\. -+ Learn how to add queries to a CloudWatch Logs dashboard in [Add Query to Dashboard or Export Query Results](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_ExportQueryResults.html) in the *Amazon CloudWatch User Guide*\. diff --git a/doc_source/monitoring-metrics.md b/doc_source/monitoring-metrics.md deleted file mode 100644 index 26641f70..00000000 --- a/doc_source/monitoring-metrics.md +++ /dev/null @@ -1,75 +0,0 @@ -# Working with Lambda function metrics - -When your AWS Lambda function finishes processing an event, Lambda sends metrics about the invocation to Amazon CloudWatch\. There is no charge for these metrics\. - -On the CloudWatch console, you can build graphs and dashboards with these metrics\. You can set alarms to respond to changes in utilization, performance, or error rates\. Lambda sends metric data to CloudWatch in 1\-minute intervals\. If you want more immediate insight into your Lambda function, you can create high\-resolution [custom metrics](https://docs.aws.amazon.com/lambda/latest/operatorguide/custom-metrics.html)\. Charges apply for custom metrics and CloudWatch Alarms\. For more information, see [CloudWatch pricing\.](https://aws.amazon.com/cloudwatch/pricing/)\. - -This page describes the Lambda function invocation, performance, and concurrency metrics available on the CloudWatch console\. - -**Topics** -+ [Viewing metrics on the CloudWatch console](#monitoring-metrics-console) -+ [Types of metrics](#monitoring-metrics-types) - -## Viewing metrics on the CloudWatch console - -You can use the CloudWatch console to filter and sort function metrics by function name, alias, or version\. - -**To view metrics on the CloudWatch console** - -1. Open the [Metrics page](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#metricsV2:graph=~();namespace=~'AWS*2fLambda) \(`AWS/Lambda` namespace\) of the CloudWatch console\. - -1. Choose a dimension\. - + **By Function Name** \(`FunctionName`\) – View aggregate metrics for all versions and aliases of a function\. - + **By Resource** \(`Resource`\) – View metrics for a version or alias of a function\. - + **By Executed Version** \(`ExecutedVersion`\) – View metrics for a combination of alias and version\. Use the `ExecutedVersion` dimension to compare error rates for two versions of a function that are both targets of a [weighted alias](configuration-aliases.md)\. - + **Across All Functions** \(none\) – View aggregate metrics for all functions in the current AWS Region\. - -1. Choose metrics to add them to the graph\. - -By default, graphs use the `Sum` statistic for all metrics\. To choose a different statistic and customize the graph, use the options on the **Graphed metrics** tab\. - -**Note** -The timestamp on a metric reflects when the function was invoked\. Depending on the duration of the invocation, this can be several minutes before the metric is emitted\. For example, if your function has a 10\-minute timeout, look more than 10 minutes in the past for accurate metrics\. - -For more information about CloudWatch, see the [https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/)\. - -## Types of metrics - -The following section describes the types of metrics available on the CloudWatch console\. - -### Using invocation metrics - -Invocation metrics are binary indicators of the outcome of an invocation\. For example, if the function returns an error, Lambda sends the `Errors` metric with a value of 1\. To get a count of the number of function errors that occurred each minute, view the `Sum` of the `Errors` metric with a period of 1 minute\. - -View the following metrics with the `Sum` statistic\. - -**Invocation metrics** -+ `Invocations` – The number of times that your function code is invoked, including successful invocations and invocations that result in a function error\. Invocations aren't recorded if the invocation request is throttled or otherwise results in an invocation error\. This equals the number of requests billed\. -+ `Errors` – The number of invocations that result in a function error\. Function errors include exceptions that your code throws and exceptions that the Lambda runtime throws\. The runtime returns errors for issues such as timeouts and configuration errors\. To calculate the error rate, divide the value of `Errors` by the value of `Invocations`\. Note that the timestamp on an error metric reflects when the function was invoked, not when the error occurred\. -+ `DeadLetterErrors` – For [asynchronous invocation](invocation-async.md), the number of times that Lambda attempts to send an event to a dead\-letter queue but fails\. Dead\-letter errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `DestinationDeliveryFailures` – For asynchronous invocation, the number of times that Lambda attempts to send an event to a [destination](gettingstarted-features.md#gettingstarted-features-destinations) but fails\. Delivery errors can occur due to permissions errors, misconfigured resources, or size limits\. -+ `Throttles` – The number of invocation requests that are throttled\. When all function instances are processing requests and no concurrency is available to scale up, Lambda rejects additional requests with a `TooManyRequestsException` error\. Throttled requests and other invocation errors don't count as `Invocations` or `Errors`\. -+ `ProvisionedConcurrencyInvocations` – The number of times that your function code is invoked on [provisioned concurrency](configuration-concurrency.md)\. -+ `ProvisionedConcurrencySpilloverInvocations` – The number of times that your function code is invoked on standard concurrency when all provisioned concurrency is in use\. - -### Using performance metrics - -Performance metrics provide performance details about a single invocation\. For example, the `Duration` metric indicates the amount of time in milliseconds that your function spends processing an event\. To get a sense of how fast your function processes events, view these metrics with the `Average` or `Max` statistic\. - -**Performance metrics** -+ `Duration` – The amount of time that your function code spends processing an event\. The billed duration for an invocation is the value of `Duration` rounded up to the nearest millisecond\. -+ `PostRuntimeExtensionsDuration` – The cumulative amount of time that the runtime spends running code for extensions after the function code has completed\. -+ `IteratorAge` – For [event source mappings](invocation-eventsourcemapping.md) that read from streams, the age of the last record in the event\. The age is the amount of time between when a stream receives the record and when the event source mapping sends the event to the function\. -+ `OffsetLag` – For self\-managed Apache Kafka and Amazon Managed Streaming for Apache Kafka \(Amazon MSK\) event sources, the difference in offset between the last record written to a topic and the last record that your Lambda function's consumer group processed\. Though a Kafka topic can have multiple partitions, this metric measures the offset lag at the topic level\. - -`Duration` also supports [percentile statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Percentiles)\. Use percentiles to exclude outlier values that skew average and maximum statistics\. For example, the p95 statistic shows the maximum duration of 95 percent of invocations, excluding the slowest 5 percent\. - -### Using concurrency metrics - -Lambda reports concurrency metrics as an aggregate count of the number of instances processing events across a function, version, alias, or AWS Region\. To see how close you are to hitting concurrency limits, view these metrics with the `Max` statistic\. - -**Concurrency metrics** -+ `ConcurrentExecutions` – The number of function instances that are processing events\. If this number reaches your [concurrent executions quota](gettingstarted-limits.md) for the Region, or the [reserved concurrency limit](configuration-concurrency.md) that you configured on the function, Lambda throttles additional invocation requests\. -+ `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on [provisioned concurrency](configuration-concurrency.md)\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. -+ `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, `.5` indicates that 50 percent of allocated provisioned concurrency is in use\. -+ `UnreservedConcurrentExecutions` – For a Region, the number of events that functions without reserved concurrency are processing\. \ No newline at end of file diff --git a/doc_source/monitoring-servicemap.md b/doc_source/monitoring-servicemap.md deleted file mode 100644 index a757edae..00000000 --- a/doc_source/monitoring-servicemap.md +++ /dev/null @@ -1,107 +0,0 @@ -# Example workflows using other AWS services - -AWS Lambda integrates with other AWS services to help you monitor, trace, debug, and troubleshoot your Lambda functions\. This page shows workflows you can use with AWS X\-Ray, AWS Trusted Advisor and CloudWatch ServiceLens to trace and troubleshoot your Lambda functions\. - -**Topics** -+ [Prerequisites](#monitoring-troubleshooting-prereqs) -+ [Pricing](#monitoring-troubleshooting-pricing) -+ [Example AWS X\-Ray workflow to view a service map](#monitoring-servicemap-example) -+ [Example AWS X\-Ray workflow to view trace details](#monitoring-tracing-example) -+ [Example AWS Trusted Advisor workflow to view recommendations](#monitoring-ta-example) -+ [What's next?](#monitoring-troubleshooting-next-up) - -## Prerequisites - -The following section describes the steps to using AWS X\-Ray and Trusted Advisor to troubleshoot your Lambda functions\. - -### Using AWS X\-Ray - -AWS X\-Ray needs to be enabled on the Lambda console to complete the AWS X\-Ray workflows on this page\. If your execution role does not have the required permissions, the Lambda console will attempt to add them to your execution role\. - -**To enable AWS X\-Ray on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose your function\. - -1. Choose the **Configuration** tab\. - -1. On the **Monitoring tools** pane, choose **Edit**\. - -1. Under **AWS X\-Ray**, turn on **Active tracing**\. - -1. Choose **Save**\. - -### Using AWS Trusted Advisor - -AWS Trusted Advisor inspects your AWS environment and makes recommendations on ways you can save money, improve system availability and performance, and help close security gaps\. You can use Trusted Advisor checks to evaluate the Lambda functions and applications in your AWS account\. The checks provide recommended steps to take and resources for more information\. -+ For more information on AWS support plans for Trusted Advisor checks, see [Support plans](https://console.aws.amazon.com/support/plans/home?#/)\. -+ For more information about the checks for Lambda, see [AWS Trusted Advisor best practice checklist](http://aws.amazon.com/premiumsupport/technology/trusted-advisor/best-practice-checklist/)\. -+ For more information on how to use the Trusted Advisor console, see [Get started with AWS Trusted Advisor](https://docs.aws.amazon.com/awssupport/latest/user/get-started-with-aws-trusted-advisor.html)\. -+ For instructions on how to allow and deny console access to Trusted Advisor, see [IAM policy examples](https://docs.aws.amazon.com/awssupport/latest/user/security-trusted-advisor.html#iam-policy-examples-trusted-advisor)\. - -## Pricing -+ With AWS X\-Ray you pay only for what you use, based on the number of traces recorded, retrieved, and scanned\. For more information, see [AWS X\-Ray Pricing](http://aws.amazon.com/xray/pricing/)\. -+ Trusted Advisor cost optimization checks are included with AWS Business and Enterprise support subscriptions\. For more information, see [AWS Trusted Advisor Pricing](http://aws.amazon.com/premiumsupport/pricing/)\. - -## Example AWS X\-Ray workflow to view a service map - -If you've enabled AWS X\-Ray, you can view a ServiceLens service map on the CloudWatch console\. A service map displays your service endpoints and resources as nodes and highlights the traffic, latency, and errors for each node and its connections\. - -You can choose a node to see detailed insights about the correlated metrics, logs, and traces associated with that part of the service\. This enables you to investigate problems and their effect on an application\. - -**To view service map and traces using the CloudWatch console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Monitoring**\. - -1. Choose **View traces in X\-Ray**\. - -1. Choose **Service map**\. - -1. Choose from the predefined time ranges, or choose a custom time range\. - -1. To troubleshoot requests, choose a filter\. - -## Example AWS X\-Ray workflow to view trace details - -If you've enabled AWS X\-Ray, you can use the single\-function view on the CloudWatch Lambda Insights dashboard to show the distributed trace data of a function invocation error\. For example, if the application logs message shows an error, you can open the ServiceLens traces view to see the distributed trace data and the other services handling the transaction\. - -**To view trace details of a function** - -1. Open the [single\-function view](https://console.aws.amazon.com/cloudwatch/home#lambda-insights:functions) in the CloudWatch console\. - -1. Choose the **Application logs** tab\. - -1. Use the **Timestamp** or **Message** to identify the invocation request that you want to troubleshoot\. - -1. To show the **Most recent 1000 invocations**, choose the **Invocations** tab\. -![\[Sorting the most recent 1000 invocations by request ID.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambainsights-invocations-request-id.png) - -1. Choose the **Request ID** column to sort entries in ascending alphabetical order\. - -1. In the **Trace** column, choose **View**\. - - The **Trace details** page opens in the ServiceLens traces view\. -![\[Function trace details in the ServiceLens traces view.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/lambdainsights-trace-details.png) - -## Example AWS Trusted Advisor workflow to view recommendations - -Trusted Advisor checks Lambda functions in all AWS Regions to identify functions with the highest potential cost savings, and deliver actionable recommendations for optimization\. It analyzes your Lambda usage data such as function execution time, billed duration, memory used, memory configured, timeout configuration and errors\. - -For example, the *Lambda Functions with High Error Rate* check recommends that you use AWS X\-Ray or CloudWatch to detect errors with your Lambda functions\. - -**To check for functions with high error rates** - -1. Open the [Trusted Advisor](https://console.aws.amazon.com/trustedadvisor) console\. - -1. Choose the **Cost Optimization** category\. - -1. Scroll down to **AWS Lambda Functions with High Error Rates**\. Expand the section to see the results and the recommended actions\. - -## What's next? -+ Learn more about how to integrate traces, metrics, logs, and alarms in [Using ServiceLens to Monitor the Health of Your Applications](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ServiceLens.html)\. -+ Learn more about how to get a list of Trusted Advisor checks in [Using Trusted Advisor as a web service](https://docs.aws.amazon.com/awssupport/latest/user/trustedadvisor.html)\. \ No newline at end of file diff --git a/doc_source/nodejs-context.md b/doc_source/nodejs-context.md deleted file mode 100644 index 7a1e562f..00000000 --- a/doc_source/nodejs-context.md +++ /dev/null @@ -1,43 +0,0 @@ -# AWS Lambda context object in Node\.js - -When Lambda runs your function, it passes a context object to the [handler](nodejs-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. - -**Context methods** -+ `getRemainingTimeInMillis()` – Returns the number of milliseconds left before the execution times out\. - -**Context properties** -+ `functionName` – The name of the Lambda function\. -+ `functionVersion` – The [version](configuration-versions.md) of the function\. -+ `invokedFunctionArn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `memoryLimitInMB` – The amount of memory that's allocated for the function\. -+ `awsRequestId` – The identifier of the invocation request\. -+ `logGroupName` – The log group for the function\. -+ `logStreamName` – The log stream for the function instance\. -+ `identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. - + `cognitoIdentityId` – The authenticated Amazon Cognito identity\. - + `cognitoIdentityPoolId` – The Amazon Cognito identity pool that authorized the invocation\. -+ `clientContext` – \(mobile apps\) Client context that's provided to Lambda by the client application\. - + `client.installation_id` - + `client.app_title` - + `client.app_version_name` - + `client.app_version_code` - + `client.app_package_name` - + `env.platform_version` - + `env.platform` - + `env.make` - + `env.model` - + `env.locale` - + `Custom` – Custom values that are set by the client application\. -+ `callbackWaitsForEmptyEventLoop` – Set to false to send the response right away when the [callback](nodejs-handler.md#nodejs-handler-sync) runs, instead of waiting for the Node\.js event loop to be empty\. If this is false, any outstanding events continue to run during the next invocation\. - -The following example function logs context information and returns the location of the logs\. - -**Example index\.js file** - -``` -exports.handler = async function(event, context) { - console.log('Remaining time: ', context.getRemainingTimeInMillis()) - console.log('Function name: ', context.functionName) - return context.logStreamName -} -``` \ No newline at end of file diff --git a/doc_source/nodejs-exceptions.md b/doc_source/nodejs-exceptions.md deleted file mode 100644 index 80e0f49e..00000000 --- a/doc_source/nodejs-exceptions.md +++ /dev/null @@ -1,139 +0,0 @@ -# AWS Lambda function errors in Node\.js - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the Node\.js runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Syntax](#nodejs-exceptions-syntax) -+ [How it works](#nodejs-exceptions-how) -+ [Using the Lambda console](#nodejs-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-exceptions-cli) -+ [Error handling in other AWS services](#nodejs-exceptions-other-services) -+ [What's next?](#python-exceptions-next-up) - -## Syntax - -**Example index\.js file – Reference error** - -``` -exports.handler = async function() { - return x + 10 - } -``` - -This code results in a reference error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. - -``` -{ - "errorType": "ReferenceError", - "errorMessage": "x is not defined", - "trace": [ - "ReferenceError: x is not defined", - " at Runtime.exports.handler (/var/task/index.js:2:3)", - " at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)", - " at process._tickCallback (internal/process/next_tick.js:68:7)" - ] - } -``` - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -``` -{"errorType":"ReferenceError","errorMessage":"x is not defined","trace":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]} -``` - -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Node\.js](nodejs-logging.md)\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md)\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Node\.js](nodejs-logging.md) page\. \ No newline at end of file diff --git a/doc_source/nodejs-handler.md b/doc_source/nodejs-handler.md deleted file mode 100644 index 5cf5123d..00000000 --- a/doc_source/nodejs-handler.md +++ /dev/null @@ -1,109 +0,0 @@ -# AWS Lambda function handler in Node\.js - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -The following example function logs the contents of the event object and returns the location of the logs\. - -**Example index\.js** - -``` -exports.handler = async function(event, context) { - console.log("EVENT: \n" + JSON.stringify(event, null, 2)) - return context.logStreamName -} -``` - -When you configure a function, the value of the handler setting is the file name and the name of the exported handler method, separated by a dot\. The default in the console and for examples in this guide is `index.handler`\. This indicates the `handler` method that's exported from the `index.js` file\. - -The runtime passes three arguments to the handler method\. The first argument is the `event` object, which contains information from the invoker\. The invoker passes this information as a JSON\-formatted string when it calls [Invoke](API_Invoke.md), and the runtime converts it to an object\. When an AWS service invokes your function, the event structure [varies by service](lambda-services.md)\. - -The second argument is the [context object](nodejs-context.md), which contains information about the invocation, function, and execution environment\. In the preceding example, the function gets the name of the [log stream](nodejs-logging.md) from the context object and returns it to the invoker\. - -The third argument, `callback`, is a function that you can call in [non\-async handlers](#nodejs-handler-sync) to send a response\. The callback function takes two arguments: an `Error` and a response\. When you call it, Lambda waits for the event loop to be empty and then returns the response or error to the invoker\. The response object must be compatible with `JSON.stringify`\. - -For asynchronous function handlers, you return a response, error, or promise to the runtime instead of using `callback`\. - -If your function has additional dependencies, [use npm to include them in your deployment package](nodejs-package.md#nodejs-package-dependencies)\. - -## Async handlers - -For async handlers, you can use `return` and `throw` to send a response or error, respectively\. Functions must use the `async` keyword to use these methods to return a response or error\. - -If your code performs an asynchronous task, return a promise to make sure that it finishes running\. When you resolve or reject the promise, Lambda sends the response or error to the invoker\. - -**Example index\.js file – HTTP request with async handler and promises** - -``` -const https = require('https') -let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" - -exports.handler = async function(event) { - const promise = new Promise(function(resolve, reject) { - https.get(url, (res) => { - resolve(res.statusCode) - }).on('error', (e) => { - reject(Error(e)) - }) - }) - return promise -} -``` - -For libraries that return a promise, you can return that promise directly to the runtime\. - -**Example index\.js file – AWS SDK with async handler and promises** - -``` -const AWS = require('aws-sdk') -const s3 = new AWS.S3() - -exports.handler = async function(event) { - return s3.listBuckets().promise() -} -``` - -### Using Node\.js modules and top\-level await - -You can designate your function code as an ES module, allowing you to use `await` at the top level of the file, outside the scope of your function handler\. This guarantees completion of asynchronous initialization code prior to handler invocations, maximizing the effectiveness of [provisioned concurrency](provisioned-concurrency.md) in reducing cold start latency\. You can do this in two ways: specifying the `type` as `module` in the function's `package.json` file, or by using the \.mjs file name extension\. - -In the first scenario, your function code treats all \.js files as ES modules, while in the second scenario, only the file you specify with \.mjs is an ES module\. You can mix ES modules and CommonJS modules by naming them \.mjs and \.cjs respectively, as \.mjs files are always ES modules and \.cjs files are always CommonJS modules\. - -For more information and an example, see [Using Node\.js ES Modules and Top\-Level Await in AWS Lambda](https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda)\. - -## Non\-async handlers - -The following example function checks a URL and returns the status code to the invoker\. - -**Example index\.js file – HTTP request with callback** - -``` -const https = require('https') -let url = "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" - -exports.handler = function(event, context, callback) { - https.get(url, (res) => { - callback(null, res.statusCode) - }).on('error', (e) => { - callback(Error(e)) - }) -} -``` - -For non\-async handlers, function execution continues until the [event loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/) is empty or the function times out\. The response isn't sent to the invoker until all event loop tasks are finished\. If the function times out, an error is returned instead\. You can configure the runtime to send the response immediately by setting [context\.callbackWaitsForEmptyEventLoop](nodejs-context.md) to false\. - -In the following example, the response from Amazon S3 is returned to the invoker as soon as it's available\. The timeout running on the event loop is frozen, and it continues running the next time the function is invoked\. - -**Example index\.js file – callbackWaitsForEmptyEventLoop** - -``` -const AWS = require('aws-sdk') -const s3 = new AWS.S3() - -exports.handler = function(event, context, callback) { - context.callbackWaitsForEmptyEventLoop = false - s3.listBuckets(null, callback) - setTimeout(function () { - console.log('Timeout complete.') - }, 5000) -} -``` \ No newline at end of file diff --git a/doc_source/nodejs-image.md b/doc_source/nodejs-image.md deleted file mode 100644 index cc7bb781..00000000 --- a/doc_source/nodejs-image.md +++ /dev/null @@ -1,59 +0,0 @@ -# Deploy Node\.js Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Node\.js function: -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for Node\.js](#nodejs-image-base) -+ [Using a Node\.js base image](#nodejs-image-instructions) -+ [Node\.js runtime interface clients](#nodejs-image-clients) -+ [Deploy the container image](#nodejs-image-deploy) - -## AWS base images for Node\.js - -AWS provides the following base images for Node\.js: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| 16 | Node\.js 16 | Amazon Linux 2 | [Dockerfile for Node\.js 16 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs16.x/Dockerfile.nodejs16.x) | | -| 14 | Node\.js 14 | Amazon Linux 2 | [Dockerfile for Node\.js 14 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs14.x/Dockerfile.nodejs14.x) | | -| 12 | Node\.js 12 | Amazon Linux 2 | [Dockerfile for Node\.js 12 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/nodejs12.x/Dockerfile.nodejs12.x) | Mar 31, 2023 | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/nodejs](https://gallery.ecr.aws/lambda/nodejs) - -## Using a Node\.js base image - -For instructions on how to use a Node\.js base image, choose the **usage** tab on [AWS Lambda base images for Node\.js](https://gallery.ecr.aws/lambda/nodejs) in the *Amazon ECR repository*\. - -## Node\.js runtime interface clients - -Install the runtime interface client for Node\.js using the npm package manager: - -``` -npm install aws-lambda-ric -``` - -For package details, see [Lambda RIC](http://npmjs.com/package/aws-lambda-ric) on the npm website\. - -You can also download the [Node\.js runtime interface client](https://github.com/aws/aws-lambda-nodejs-runtime-interface-client) from GitHub\. - -## Deploy the container image - -For a new function, you deploy the Node\.js image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/nodejs-logging.md b/doc_source/nodejs-logging.md deleted file mode 100644 index 288813ad..00000000 --- a/doc_source/nodejs-logging.md +++ /dev/null @@ -1,197 +0,0 @@ -# AWS Lambda function logging in Node\.js - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#node-logging-output) -+ [Using the Lambda console](#nodejs-logging-console) -+ [Using the CloudWatch console](#nodejs-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#nodejs-logging-cli) -+ [Deleting logs](#nodejs-logging-delete) - -## Creating a function that returns logs - - To output logs from your function code, you can use methods on the [console object](https://developer.mozilla.org/en-US/docs/Web/API/Console), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. - -**Example index\.js file – Logging** - -``` -exports.handler = async function(event, context) { - console.log("ENVIRONMENT VARIABLES\n" + JSON.stringify(process.env, null, 2)) - console.info("EVENT\n" + JSON.stringify(event, null, 2)) - console.warn("Event not processed.") - return context.logStreamName -} -``` - -**Example log format** - -``` -START RequestId: c793869b-ee49-115b-a5b6-4fd21e8dedac Version: $LATEST -2019-06-07T19:11:20.562Z c793869b-ee49-115b-a5b6-4fd21e8dedac INFO ENVIRONMENT VARIABLES -{ - "AWS_LAMBDA_FUNCTION_VERSION": "$LATEST", - "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/my-function", - "AWS_LAMBDA_LOG_STREAM_NAME": "2019/06/07/[$LATEST]e6f4a0c4241adcd70c262d34c0bbc85c", - "AWS_EXECUTION_ENV": "AWS_Lambda_nodejs12.x", - "AWS_LAMBDA_FUNCTION_NAME": "my-function", - "PATH": "/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin", - "NODE_PATH": "/opt/nodejs/node10/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules", - ... -} -2019-06-07T19:11:20.563Z c793869b-ee49-115b-a5b6-4fd21e8dedac INFO EVENT -{ - "key": "value" -} -2019-06-07T19:11:20.564Z c793869b-ee49-115b-a5b6-4fd21e8dedac WARN Event not processed. -END RequestId: c793869b-ee49-115b-a5b6-4fd21e8dedac -REPORT RequestId: c793869b-ee49-115b-a5b6-4fd21e8dedac Duration: 128.83 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 74 MB Init Duration: 166.62 ms XRAY TraceId: 1-5d9d007f-0a8c7fd02xmpl480aed55ef0 SegmentId: 3d752xmpl1bbe37e Sampled: true -``` - -The Node\.js runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. It adds a timestamp, request ID, and log level to each entry logged by the function\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -You can view logs in the Lambda console, in the CloudWatch Logs console, or from the command line\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/nodejs-package.md b/doc_source/nodejs-package.md deleted file mode 100644 index 0ff1e4e3..00000000 --- a/doc_source/nodejs-package.md +++ /dev/null @@ -1,131 +0,0 @@ -# Deploy Node\.js Lambda functions with \.zip file archives - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. - - For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. - -**Topics** -+ [Prerequisites](#node-package-prereqs) -+ [Updating a function with no dependencies](#nodejs-package-codeonly) -+ [Updating a function with additional dependencies](#nodejs-package-dependencies) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Updating a function with no dependencies - -To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. - -**To update a Node\.js function with no dependencies** - -1. Create a \.zip file archive\. - - ``` - zip function.zip index.js - ``` - -1. To upload the package, use the `update-function-code` command\. - - ``` - aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip - ``` - - You should see the following 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", - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "Active" - }, - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... - } - ``` - -## Updating a function with additional dependencies - -If your function depends on libraries other than the AWS SDK for JavaScript, use [npm](https://www.npmjs.com/) to include them in your deployment package\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. If any of the libraries use native code, [use an Amazon Linux environment](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) to create the deployment package\. - -You can add the SDK for JavaScript to the deployment package if you need a newer version than the one [included on the runtime](lambda-nodejs.md), or to ensure that the version doesn't change in the future\. - -If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. - -For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. - -As an alternative, you can create the deployment package using an Amazon EC2 instance that provides an Amazon Linux environment\. For instructions, see [Using Packages and Native nodejs Modules in AWS](http://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/) in the AWS compute blog\. - -**To update a Node\.js function with dependencies** - -1. Open a command line terminal or shell\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. - -1. Create a folder for the deployment package\. The following steps assume that the folder is named `my-function`\. - -1. Install libraries in the node\_modules directory using the `npm install` command\. - - ``` - npm install aws-xray-sdk - ``` - - This creates a folder structure that's similar to the following: - - ``` - ~/my-function - ├── index.js - └── node_modules - ├── async - ├── async-listener - ├── atomic-batcher - ├── aws-sdk - ├── aws-xray-sdk - ├── aws-xray-sdk-core - ``` - -1. Create a \.zip file that contains the contents of your project folder\. Use the `r` \(recursive\) option to ensure that zip compresses the subfolders\. - - ``` - zip -r function.zip . - ``` - -1. Upload the package using the `update-function-code` command\. - - ``` - aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs12.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "index.handler", - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "Active" - }, - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... - } - ``` - -In addition to code and libraries, your deployment package can also contain executable files and other resources\. For more information, see [Running Arbitrary Executables in AWS Lambda](http://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/) in the AWS Compute Blog\. \ No newline at end of file diff --git a/doc_source/nodejs-tracing.md b/doc_source/nodejs-tracing.md deleted file mode 100644 index 60fae7f4..00000000 --- a/doc_source/nodejs-tracing.md +++ /dev/null @@ -1,209 +0,0 @@ -# Instrumenting Node\.js code in AWS Lambda - -Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. - -To send tracing data to X\-Ray, you can use one of two SDK libraries: -+ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. -+ [AWS X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) – An SDK for generating and sending trace data to X\-Ray\. - -Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. - -**Important** -**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. - -**Topics** -+ [Using ADOT to instrument your Node\.js functions](#nodejs-adot) -+ [Using the X\-Ray SDK to instrument your Node\.js functions](#nodejs-xray-sdk) -+ [Activating tracing with the Lambda console](#nodejs-tracing-console) -+ [Activating tracing with the Lambda API](#nodejs-tracing-api) -+ [Activating tracing with AWS CloudFormation](#nodejs-tracing-cloudformation) -+ [Interpreting an X\-Ray trace](#nodejs-tracing-interpretation) -+ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#nodejs-tracing-layers) - -## Using ADOT to instrument your Node\.js functions - -ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. - -For Node\.js runtimes, you can add the **AWS managed Lambda layer for ADOT Javascript** to automatically instrument your functions\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for JavaScript](https://aws-otel.github.io/docs/getting-started/lambda/lambda-js) in the ADOT documentation\. - -## Using the X\-Ray SDK to instrument your Node\.js functions - -To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Node\.js\. To get the SDK, add the `aws-xray-sdk-core` package to your application's dependencies\. - -**Example [blank\-nodejs/package\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/package.json)** - -``` -{ - "name": "blank-nodejs", - "version": "1.0.0", - "private": true, - "devDependencies": { - "aws-sdk": "2.631.0", - "jest": "25.4.0" - }, - "dependencies": { - "aws-xray-sdk-core": "1.1.2" - }, - "scripts": { - "test": "jest" - } -} -``` - -To instrument AWS SDK clients, wrap the `aws-sdk` library with the `captureAWS` method\. - -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Tracing an AWS SDK client** - -``` -const AWSXRay = require('aws-xray-sdk-core') -const AWS = AWSXRay.captureAWS(require('aws-sdk')) - -// Create client outside of handler to reuse -const lambda = new AWS.Lambda() - -// Handler -exports.handler = async function(event, context) { - event.Records.forEach(record => { - ... -``` - -The Lambda runtime sets some environment variables to configure the X\-Ray SDK\. For example, Lambda sets `AWS_XRAY_CONTEXT_MISSING` to `LOG_ERROR` to avoid throwing runtime errors from the X\-Ray SDK\. To set a custom context missing strategy, override the environment variable in your function configuration to have no value, and then you can set the context missing strategy programmatically\. - -**Example initialization code** - -``` -const AWSXRay = require('aws-xray-sdk-core'); - -// Configure the context missing strategy to do nothing -AWSXRay.setContextMissingStrategy(() => {}); -``` - -For more information, see [Using AWS Lambda environment variables](configuration-envvars.md)\. - -After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. - -## Activating tracing with the Lambda console - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -## Activating tracing with the Lambda API - -Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Activating tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` - -## Interpreting an X\-Ray trace - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Node\.js](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs.html) in the *AWS X\-Ray Developer Guide*\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -## Storing runtime dependencies in a layer \(X\-Ray SDK\) - -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. - -The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS X\-Ray SDK for Node\.js\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependencies layer** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: function/. - Tracing: Active - Layers: - - !Ref libs - ... - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-nodejs-lib - Description: Dependencies for the blank sample app. - ContentUri: lib/. - CompatibleRuntimes: - - nodejs12.x -``` - -With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. - -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) sample application\. \ No newline at end of file diff --git a/doc_source/permissions-boundary.md b/doc_source/permissions-boundary.md deleted file mode 100644 index 9ba5075b..00000000 --- a/doc_source/permissions-boundary.md +++ /dev/null @@ -1,60 +0,0 @@ -# Using permissions boundaries for AWS Lambda applications - -When you [create an application](applications-tutorial.md) in the AWS Lambda console, Lambda applies a *permissions boundary* to the application's IAM roles\. The permissions boundary limits the scope of the [execution role](lambda-intro-execution-role.md) that the application's template creates for each of its functions, and any roles that you add to the template\. The permissions boundary prevents users with write access to the application's Git repository from escalating the application's permissions beyond the scope of its own resources\. - -The application templates in the Lambda console include a global property that applies a permissions boundary to all functions that they create\. - -``` -Globals: - Function: - PermissionsBoundary: !Sub 'arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${AppId}-${AWS::Region}-PermissionsBoundary' -``` - -The boundary limits the permissions of the functions' roles\. You can add permissions to a function's execution role in the template, but that permission is only effective if it's also allowed by the permissions boundary\. The role that AWS CloudFormation assumes to deploy the application enforces the use of the permissions boundary\. That role only has permission to create and pass roles that have the application's permissions boundary attached\. - -By default, an application's permissions boundary enables functions to perform actions on the resources in the application\. For example, if the application includes an Amazon DynamoDB table, the boundary allows access to any API action that can be restricted to operate on specific tables with resource\-level permissions\. You can only use actions that don't support resource\-level permissions if they're specifically permitted in the boundary\. These include Amazon CloudWatch Logs and AWS X\-Ray API actions for logging and tracing\. - -**Example permissions boundary** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "*" - ], - "Resource": [ - "arn:aws:lambda:us-east-2:123456789012:function:my-app-getAllItemsFunction-*", - "arn:aws:lambda:us-east-2:123456789012:function:my-app-getByIdFunction-*", - "arn:aws:lambda:us-east-2:123456789012:function:my-app-putItemFunction-*", - "arn:aws:dynamodb:us-east-1:123456789012:table/my-app-SampleTable-*" - ], - "Effect": "Allow", - "Sid": "StackResources" - }, - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:DescribeLogGroups", - "logs:PutLogEvents", - "xray:Put*" - ], - "Resource": "*", - "Effect": "Allow", - "Sid": "StaticPermissions" - }, - ... - ] -} -``` - -To access other resources or API actions, you or an administrator must expand the permissions boundary to include those resources\. You might also need to update the execution role or deployment role of an application to allow the use of additional actions\. -+ **Permissions boundary** – Extend the application's permissions boundary when you add resources to your application, or the execution role needs access to more actions\. In IAM, add resources to the boundary to allow the use of API actions that support resource\-level permissions on that resource's type\. For actions that don't support resource\-level permissions, add them in a statement that isn't scoped to any resource\. -+ **Execution role** – Extend a function's execution role when it needs to use additional actions\. In the application template, add policies to the execution role\. The intersection of permissions in the boundary and execution role is granted to the function\. -+ **Deployment role** – Extend the application's deployment role when it needs additional permissions to create or configure resources\. In IAM, add policies to the application's deployment role\. The deployment role needs the same user permissions that you need to deploy or update an application in AWS CloudFormation\. - -For a tutorial that walks through adding resources to an application and extending its permissions, see [Creating an application with continuous delivery in the Lambda console](applications-tutorial.md)\. - -For more information, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the IAM User Guide\. \ No newline at end of file diff --git a/doc_source/powershell-context.md b/doc_source/powershell-context.md deleted file mode 100644 index bbcc3dca..00000000 --- a/doc_source/powershell-context.md +++ /dev/null @@ -1,26 +0,0 @@ -# AWS Lambda context object in PowerShell - -When Lambda runs your function, it passes context information by making a `$LambdaContext` variable available to the [handler](powershell-handler.md)\. This variable provides methods and properties with information about the invocation, function, and execution environment\. - -**Context properties** -+ `FunctionName` – The name of the Lambda function\. -+ `FunctionVersion` – The [version](configuration-versions.md) of the function\. -+ `InvokedFunctionArn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `MemoryLimitInMB` – The amount of memory that's allocated for the function\. -+ `AwsRequestId` – The identifier of the invocation request\. -+ `LogGroupName` – The log group for the function\. -+ `LogStreamName` – The log stream for the function instance\. -+ `RemainingTime` – The number of milliseconds left before the execution times out\. -+ `Identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. -+ `ClientContext` – \(mobile apps\) Client context that's provided to Lambda by the client application\. -+ `Logger` – The [logger object](powershell-logging.md) for the function\. - -The following PowerShell code snippet shows a simple handler function that prints some of the context information\. - -``` -#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} -Write-Host 'Function name:' $LambdaContext.FunctionName -Write-Host 'Remaining milliseconds:' $LambdaContext.RemainingTime.TotalMilliseconds -Write-Host 'Log group name:' $LambdaContext.LogGroupName -Write-Host 'Log stream name:' $LambdaContext.LogStreamName -``` \ No newline at end of file diff --git a/doc_source/powershell-devenv.md b/doc_source/powershell-devenv.md deleted file mode 100644 index 4bac0a7f..00000000 --- a/doc_source/powershell-devenv.md +++ /dev/null @@ -1,9 +0,0 @@ -# Setting Up a PowerShell Development Environment - -Lambda provides a set of tools and libraries for the PowerShell runtime\. For installation instructions, see [Lambda tools for PowerShell](https://github.com/aws/aws-lambda-dotnet/tree/master/PowerShell) on GitHub\. - -The AWSLambdaPSCore module includes the following cmdlets to help author and publish PowerShell Lambda functions: -+ **Get\-AWSPowerShellLambdaTemplate** – Returns a list of getting started templates\. -+ **New\-AWSPowerShellLambda** – Creates an initial PowerShell script based on a template\. -+ **Publish\-AWSPowerShellLambda** – Publishes a given PowerShell script to Lambda\. -+ **New\-AWSPowerShellLambdaPackage** – Creates a Lambda deployment package that you can use in a CI/CD system for deployment\. \ No newline at end of file diff --git a/doc_source/powershell-exceptions.md b/doc_source/powershell-exceptions.md deleted file mode 100644 index 5c45022e..00000000 --- a/doc_source/powershell-exceptions.md +++ /dev/null @@ -1,159 +0,0 @@ -# AWS Lambda function errors in PowerShell - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the PowerShell runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Syntax](#powershell-exceptions-syntax) -+ [How it works](#powershell-exceptions-how) -+ [Using the Lambda console](#powershell-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-exceptions-cli) -+ [Error handling in other AWS services](#powershell-exceptions-other-services) -+ [What's next?](#powershell-exceptions-next-up) - -## Syntax - -Consider the following PowerShell script example statement: - -``` -throw 'The Account is not found' -``` - -When you invoke this Lambda function, it throws a terminating error, and AWS Lambda returns the following error message: - -``` -{ - "errorMessage": "The Account is not found", - "errorType": "RuntimeException" -} -``` - -Note the `errorType` is `RuntimeException`, which is the default exception thrown by PowerShell\. You can use custom error types by throwing the error like this: - -``` -throw @{'Exception'='AccountNotFound';'Message'='The Account is not found'} -``` - -The error message is serialized with `errorType` set to `AccountNotFound`: - -``` -{ - "errorMessage": "The Account is not found", - "errorType": "AccountNotFound" -} -``` - -If you don't need an error message, you can throw a string in the format of an error code\. The error code format requires that the string starts with a character and only contain letters and digits afterwards, with no spaces or symbols\. - -For example, if your Lambda function contains the following: - -``` -throw 'AccountNotFound' -``` - -The error is serialized like this: - -``` -{ - "errorMessage": "AccountNotFound", - "errorType": "AccountNotFound" -} -``` - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in PowerShell](powershell-logging.md)\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Using AWS Lambda with AWS X\-Ray](services-xray.md)\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in PowerShell](powershell-logging.md) page\. \ No newline at end of file diff --git a/doc_source/powershell-handler.md b/doc_source/powershell-handler.md deleted file mode 100644 index 819a900c..00000000 --- a/doc_source/powershell-handler.md +++ /dev/null @@ -1,32 +0,0 @@ -# AWS Lambda function handler in PowerShell - -When a Lambda function is invoked, the Lambda handler invokes the PowerShell script\. - -When the PowerShell script is invoked, the following variables are predefined: -+ *$LambdaInput* – A PSObject that contains the input to the handler\. This input can be event data \(published by an event source\) or custom input that you provide, such as a string or any custom data object\. -+ *$LambdaContext* – An Amazon\.Lambda\.Core\.ILambdaContext object that you can use to access information about the current invocation—such as the name of the current function, the memory limit, execution time remaining, and logging\. - -For example, consider the following PowerShell example code\. - -``` -#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} -Write-Host 'Function Name:' $LambdaContext.FunctionName -``` - -This script returns the FunctionName property that's obtained from the $LambdaContext variable\. - -**Note** -You're required to use the `#Requires` statement within your PowerShell scripts to indicate the modules that your scripts depend on\. This statement performs two important tasks\. 1\) It communicates to other developers which modules the script uses, and 2\) it identifies the dependent modules that AWS PowerShell tools need to package with the script, as part of the deployment\. For more information about the `#Requires` statement in PowerShell, see [ About requires](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-6)\. For more information about PowerShell deployment packages, see [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md)\. -When your PowerShell Lambda function uses the AWS PowerShell cmdlets, be sure to set a `#Requires` statement that references the `AWSPowerShell.NetCore` module, which supports PowerShell Core—and not the `AWSPowerShell` module, which only supports Windows PowerShell\. Also, be sure to use version 3\.3\.270\.0 or newer of `AWSPowerShell.NetCore` which optimizes the cmdlet import process\. If you use an older version, you'll experience longer cold starts\. For more information, see [AWS Tools for PowerShell](http://aws.amazon.com/powershell/?track=sdk)\. - -## Returning data - -Some Lambda invocations are meant to return data back to their caller\. For example, if an invocation was in response to a web request coming from API Gateway, then our Lambda function needs to return back the response\. For PowerShell Lambda, the last object that's added to the PowerShell pipeline is the return data from the Lambda invocation\. If the object is a string, the data is returned as is\. Otherwise the object is converted to JSON by using the `ConvertTo-Json` cmdlet\. - -For example, consider the following PowerShell statement, which adds `$PSVersionTable` to the PowerShell pipeline: - -``` -$PSVersionTable -``` - -After the PowerShell script is finished, the last object in the PowerShell pipeline is the return data for the Lambda function\. `$PSVersionTable` is a PowerShell global variable that also provides information about the running environment\. \ No newline at end of file diff --git a/doc_source/powershell-logging.md b/doc_source/powershell-logging.md deleted file mode 100644 index 1d1ccb74..00000000 --- a/doc_source/powershell-logging.md +++ /dev/null @@ -1,207 +0,0 @@ -# AWS Lambda function logging in PowerShell - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#powershell-logging-output) -+ [Using the Lambda console](#powershell-logging-console) -+ [Using the CloudWatch console](#powershell-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#powershell-logging-cli) -+ [Deleting logs](#powershell-logging-delete) - -## Creating a function that returns logs - - To output logs from your function code, you can use cmdlets on [Microsoft\.PowerShell\.Utility ](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility), or any logging module that writes to `stdout` or `stderr`\. The following example uses `Write-Host`\. - -**Example [function/Handler\.ps1](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell/function/Handler.ps1) – Logging** - -``` -#Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} -Write-Host `## Environment variables -Write-Host AWS_LAMBDA_FUNCTION_VERSION=$Env:AWS_LAMBDA_FUNCTION_VERSION -Write-Host AWS_LAMBDA_LOG_GROUP_NAME=$Env:AWS_LAMBDA_LOG_GROUP_NAME -Write-Host AWS_LAMBDA_LOG_STREAM_NAME=$Env:AWS_LAMBDA_LOG_STREAM_NAME -Write-Host AWS_EXECUTION_ENV=$Env:AWS_EXECUTION_ENV -Write-Host AWS_LAMBDA_FUNCTION_NAME=$Env:AWS_LAMBDA_FUNCTION_NAME -Write-Host PATH=$Env:PATH -Write-Host `## Event -Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 3) -``` - -**Example log format** - -``` -START RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed Version: $LATEST -Importing module ./Modules/AWSPowerShell.NetCore/3.3.618.0/AWSPowerShell.NetCore.psd1 -[Information] - ## Environment variables -[Information] - AWS_LAMBDA_FUNCTION_VERSION=$LATEST -[Information] - AWS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/blank-powershell-function-18CIXMPLHFAJJ -[Information] - AWS_LAMBDA_LOG_STREAM_NAME=2020/04/01/[$LATEST]53c5xmpl52d64ed3a744724d9c201089 -[Information] - AWS_EXECUTION_ENV=AWS_Lambda_dotnet6_powershell_1.0.0 -[Information] - AWS_LAMBDA_FUNCTION_NAME=blank-powershell-function-18CIXMPLHFAJJ -[Information] - PATH=/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin -[Information] - ## Event -[Information] - -{ - "Records": [ - { - "messageId": "19dd0b57-b21e-4ac1-bd88-01bbb068cb78", - "receiptHandle": "MessageReceiptHandle", - "body": "Hello from SQS!", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1523232000000", - "SenderId": "123456789012", - "ApproximateFirstReceiveTimestamp": "1523232000001" - }, - ... -END RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed -REPORT RequestId: 56639408-xmpl-435f-9041-ac47ae25ceed Duration: 3906.38 ms Billed Duration: 4000 ms Memory Size: 512 MB Max Memory Used: 367 MB Init Duration: 5960.19 ms -XRAY TraceId: 1-5e843da6-733cxmple7d0c3c020510040 SegmentId: 3913xmpl20999446 Sampled: true -``` - -The \.NET runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/powershell-package.md b/doc_source/powershell-package.md deleted file mode 100644 index ba401214..00000000 --- a/doc_source/powershell-package.md +++ /dev/null @@ -1,74 +0,0 @@ -# Deploy PowerShell Lambda functions with \.zip file archives - -A deployment package for the PowerShell runtime contains your PowerShell script, PowerShell modules that are required for your PowerShell script, and the assemblies needed to host PowerShell Core\. - -## Creating the Lambda function - -To get started writing and invoking a PowerShell script with Lambda, you can use the `New-AWSPowerShellLambda` cmdlet to create a starter script based on a template\. You can use the `Publish-AWSPowerShellLambda` cmdlet to deploy your script to Lambda\. Then you can test your script either through the command line or the Lambda console\. - -To create a new PowerShell script, upload it, and test it, do the following: - -1. To view the list of available templates, run the following command: - - ``` - PS C:\> Get-AWSPowerShellLambdaTemplate - - Template Description - -------- ----------- - Basic Bare bones script - CodeCommitTrigger Script to process AWS CodeCommit Triggers - ... - ``` - -1. To create a sample script based on the `Basic` template, run the following command: - - ``` - New-AWSPowerShellLambda -ScriptName MyFirstPSScript -Template Basic - ``` - - A new file named `MyFirstPSScript.ps1` is created in a new subdirectory of the current directory\. The name of the directory is based on the `-ScriptName` parameter\. You can use the `-Directory` parameter to choose an alternative directory\. - - You can see that the new file has the following contents: - - ``` - # PowerShell script file to run as a Lambda function - # - # When executing in Lambda the following variables are predefined. - # $LambdaInput - A PSObject that contains the Lambda function input data. - # $LambdaContext - An Amazon.Lambda.Core.ILambdaContext object that contains information about the currently running Lambda environment. - # - # The last item in the PowerShell pipeline is returned as the result of the Lambda function. - # - # To include PowerShell modules with your Lambda function, like the AWSPowerShell.NetCore module, add a "#Requires" statement - # indicating the module and version. - - #Requires -Modules @{ModuleName='AWSPowerShell.NetCore';ModuleVersion='3.3.618.0'} - - # Uncomment to send the input to CloudWatch Logs - # Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5) - ``` - -1. To see how log messages from your PowerShell script are sent to Amazon CloudWatch Logs, uncomment the `Write-Host` line of the sample script\. - - To demonstrate how you can return data back from your Lambda functions, add a new line at the end of the script with `$PSVersionTable`\. This adds the `$PSVersionTable` to the PowerShell pipeline\. After the PowerShell script is complete, the last object in the PowerShell pipeline is the return data for the Lambda function\. `$PSVersionTable` is a PowerShell global variable that also provides information about the running environment\. - - After making these changes, the last two lines of the sample script look like this: - - ``` - Write-Host (ConvertTo-Json -InputObject $LambdaInput -Compress -Depth 5) - $PSVersionTable - ``` - -1. After editing the `MyFirstPSScript.ps1` file, change the directory to the script's location\. Then run the following command to publish the script to Lambda: - - ``` - Publish-AWSPowerShellLambda -ScriptPath .\MyFirstPSScript.ps1 -Name MyFirstPSScript -Region us-east-2 - ``` - - Note that the `-Name` parameter specifies the Lambda function name, which appears in the Lambda console\. You can use this function to invoke your script manually\. - -1. Invoke your function using the AWS Command Line Interface \(AWS CLI\) `invoke` command\. - - ``` - > aws lambda invoke --function-name MyFirstPSScript out - ``` \ No newline at end of file diff --git a/doc_source/provisioned-concurrency.md b/doc_source/provisioned-concurrency.md deleted file mode 100644 index 8308edff..00000000 --- a/doc_source/provisioned-concurrency.md +++ /dev/null @@ -1,195 +0,0 @@ -# Managing Lambda provisioned concurrency - -There are two types of concurrency controls available: -+ Reserved concurrency – Reserved concurrency guarantees the maximum number of concurrent instances for the function\. When a function has reserved concurrency, no other function can use that concurrency\. There is no charge for configuring reserved concurrency for a function\. -+ Provisioned concurrency – Provisioned concurrency initializes a requested number of execution environments so that they are prepared to respond immediately to your function's invocations\. Note that configuring provisioned concurrency incurs charges to your AWS account\. - -This topic details how to manage and configure provisioned concurrency\. If you want to configure reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. - -When Lambda allocates an instance of your function, the runtime loads your function's code and runs initialization code that you define outside of the handler\. If your code and dependencies are large, or you create SDK clients during initialization, this process can take some time\. When your function has not been used for some time, needs to scale up, or when you update a function, Lambda creates new execution environments\. This causes the portion of requests that are served by new instances to have higher latency than the rest, otherwise known as a cold start\. - -By allocating provisioned concurrency before an increase in invocations, you can ensure that all requests are served by initialized instances with low latency\. Lambda functions configured with provisioned concurrency run with consistent start\-up latency, making them ideal for building interactive mobile or web backends, latency sensitive microservices, and synchronously invoked APIs\. - -**Note** -Provisioned concurrency counts towards a function's reserved concurrency and [Regional quotas](gettingstarted-limits.md)\. If the amount of provisioned concurrency on a function's versions and aliases adds up to the function's reserved concurrency, all invocations run on provisioned concurrency\. This configuration also has the effect of throttling the unpublished version of the function \($LATEST\), which prevents it from executing\. You can't allocate more provisioned concurrency than reserved concurrency for a function\. - -Lambda also integrates with Application Auto Scaling, allowing you to manage provisioned concurrency on a schedule or based on utilization\. - -**Topics** -+ [Configuring provisioned concurrency](#configuring-provisioned-concurrency) -+ [Optimizing latency with provisioned concurrency](#optimizing-latency) -+ [Managing provisioned concurrency with Application Auto Scaling](#managing-provisioned-concurency) - -## Configuring provisioned concurrency - -To manage provisioned concurrency settings for a version or alias, use the Lambda console\. You can configure provisioned concurrency on a version of a function, or on an alias\. - - Each version of a function can only have one provisioned concurrency configuration\. This can be directly on the version itself, or on an alias that points to the version\. Two aliases can't allocate provisioned concurrency for the same version\. - - If you change the version that an alias points to, Lambda deallocates the provisioned concurrency from the old version and allocates it to the new version\. You can add a routing configuration to an alias that has provisioned concurrency\. For more information, see [Lambda function aliases](configuration-aliases.md)\. Note that you can't manage provisioned concurrency settings on the alias while the routing configuration is in place\. - -**Note** - Provisioned Concurrency is not supported on the unpublished version of the function \($LATEST\)\. Ensure your client application is not pointing to $LATEST before configuring provisioned concurrency\. - -**To allocate provisioned concurrency for an alias or version** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Concurrency**\. - -1. Under **Provisioned concurrency configurations**, choose **Add configuration**\. - -1. Choose an alias or version\. - -1. Enter the amount of provisioned concurrency to allocate\. - -1. Choose **Save**\. - -You can also configure provisioned concurrency using the Lambda API with the following operations: -+ [PutProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_PutProvisionedConcurrencyConfig.html) -+ [GetProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetProvisionedConcurrencyConfig.html) -+ [ListProvisionedConcurrencyConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListProvisionedConcurrencyConfigs.html) -+ [DeleteProvisionedConcurrencyConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteProvisionedConcurrencyConfig.html) - -To allocate provisioned concurrency for a function, use `put-provisioned-concurrency-config`\. The following command allocates a concurrency of 100 for the `BLUE` alias of a function named `my-function`: - -``` -aws lambda put-provisioned-concurrency-config --function-name my-function \ ---qualifier BLUE --provisioned-concurrent-executions 100 -``` - -You should see the following output: - -``` -{ - "Requested ProvisionedConcurrentExecutions": 100, - "Allocated ProvisionedConcurrentExecutions": 0, - "Status": "IN_PROGRESS", - "LastModified": "2019-11-21T19:32:12+0000" -} -``` - -To view your account's concurrency quotas in a Region, use `get-account-settings`\. - -``` -aws lambda get-account-settings -``` - -You should see the following output: - -``` -{ - "AccountLimit": { - "TotalCodeSize": 80530636800, - "CodeSizeUnzipped": 262144000, - "CodeSizeZipped": 52428800, - "ConcurrentExecutions": 1000, - "UnreservedConcurrentExecutions": 900 - }, - "AccountUsage": { - "TotalCodeSize": 174913095, - "FunctionCount": 52 - } -} -``` - -You can manage provisioned concurrency for all aliases and versions from the function configuration page\. The list of provisioned concurrency configurations shows the allocation progress of each configuration\. Provisioned concurrency settings are also available on the configuration page for each version and alias\. - -Lambda emits the following metrics for provisioned concurrency: - -**Provisioned concurrency metrics** -+ `ProvisionedConcurrentExecutions` – The number of function instances that are processing events on provisioned concurrency\. For each invocation of an alias or version with provisioned concurrency, Lambda emits the current count\. -+ `ProvisionedConcurrencyInvocations` – The number of times your function code is executed on provisioned concurrency\. -+ `ProvisionedConcurrencySpilloverInvocations` – The number of times your function code is executed on standard concurrency when all provisioned concurrency is in use\. -+ `ProvisionedConcurrencyUtilization` – For a version or alias, the value of `ProvisionedConcurrentExecutions` divided by the total amount of provisioned concurrency allocated\. For example, \.5 indicates that 50 percent of allocated provisioned concurrency is in use\. - -For more details, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -## Optimizing latency with provisioned concurrency - -Provisioned concurrency does not come online immediately after you configure it\. Lambda starts allocating provisioned concurrency after a minute or two of preparation\. Similar to how functions [scale under load](invocation-scaling.md), up to 3000 instances of the function can be initialized at once, depending on the Region\. After the initial burst, instances are allocated at a steady rate of 500 per minute until the request is fulfilled\. When you request provisioned concurrency for multiple functions or versions of a function in the same Region, scaling quotas apply across all requests\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - -To optimize latency, you can customize the initialization behavior for functions that use provisioned concurrency\. You can run initialization code for provisioned concurrency instances without impacting latency, because the initialization code runs at allocation time\. However, the initialization code for an on\-demand instance directly impacts the latency of the first invocation\. For an on\-demand instance, you may choose to defer initialization for a specific capability until the function needs that capability\. - -To determine the type of initialization, check the value of AWS\_LAMBDA\_INITIALIZATION\_TYPE\. Lambda sets this environment variable to `provisioned-concurrency` or `on-demand`\. The value of AWS\_LAMBDA\_INITIALIZATION\_TYPE is immutable and does not change over the lifetime of the execution environment\. - -If you use the \.NET 3\.1 runtime, you can configure the AWS\_LAMBDA\_DOTNET\_PREJIT environment variable to improve the latency for functions that use provisioned concurrency\. The \.NET runtime lazily compiles and initializes each library that your code calls for the first time\. As a result, the first invocation of a Lambda function can take longer than subsequent invocations\. When you set AWS\_LAMBDA\_DOTNET\_PREJIT to `ProvisionedConcurrency`, Lambda performs ahead\-of\-time JIT compilation for common system dependencies\. Lambda performs this initialization optimization for provisioned concurrency instances only, which results in faster performance for the first invocation\. If you set the environment variable to `Always`, Lambda performs ahead\-of\-time JIT compilation for every initialization\. If you set the environment variable to `Never`, ahead\-of\-time JIT compilation is disabled\. The default value for AWS\_LAMBDA\_DOTNET\_PREJIT is `ProvisionedConcurrency`\. - -For provisioned concurrency instances, your function's [initialization code](foundation-progmodel.md) runs during allocation and every few hours, as running instances of your function are recycled\. You can see the initialization time in logs and [traces](services-xray.md) after an instance processes a request\. However, initialization is billed even if the instance never processes a request\. Provisioned concurrency runs continually and is billed separately from initialization and invocation costs\. For details, see [AWS Lambda pricing](https://aws.amazon.com/lambda/pricing/)\. - -For more information on optimizing functions using provisioned concurrency, see the [Lambda Operator Guide\.](https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html) - -## Managing provisioned concurrency with Application Auto Scaling - -Application Auto Scaling allows you to manage provisioned concurrency on a schedule or based on utilization\. Use a target tracking scaling policy if want your function to maintain a specified utilization percentage, and scheduled scaling to increase provisioned concurrency in anticipation of peak traffic\. - -### Target tracking - - With target tracking, Application Auto Scaling creates and manages the CloudWatch alarms that trigger a scaling policy and calculates the scaling adjustment based on a metric and target value that you define\. This is ideal for applications that don’t have a scheduled time of increased traffic, but have certain traffic patterns\. - -To increase provisioned concurrency automatically as needed, use the `RegisterScalableTarget` and `PutScalingPolicy` Application Auto Scaling API operations to register a target and create a scaling policy: - -1. Register a function's alias as a scaling target\. The following example registers the BLUE alias of a function named `my-function`: - - ``` - aws application-autoscaling register-scalable-target --service-namespace lambda \ - --resource-id function:my-function:BLUE --min-capacity 1 --max-capacity 100 \ - --scalable-dimension lambda:function:ProvisionedConcurrency - ``` - -1. Apply a scaling policy to the target\. The following example configures Application Auto Scaling to adjust the provisioned concurrency configuration for an alias to keep utilization near 70 percent\. - - ``` - aws application-autoscaling put-scaling-policy --service-namespace lambda \ - --scalable-dimension lambda:function:ProvisionedConcurrency --resource-id function:my-function:BLUE \ - --policy-name my-policy --policy-type TargetTrackingScaling \ - --target-tracking-scaling-policy-configuration '{ "TargetValue": 0.7, "PredefinedMetricSpecification": { "PredefinedMetricType": "LambdaProvisionedConcurrencyUtilization" }}' - ``` - - You should see the following output: - - ``` - { - "PolicyARN": "arn:aws:autoscaling:us-east-2:123456789012:scalingPolicy:12266dbb-1524-xmpl-a64e-9a0a34b996fa:resource/lambda/function:my-function:BLUE:policyName/my-policy", - "Alarms": [ - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmHigh-aed0e274-xmpl-40fe-8cba-2e78f000c0a7" - }, - { - "AlarmName": "TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66", - "AlarmARN": "arn:aws:cloudwatch:us-east-2:123456789012:alarm:TargetTracking-function:my-function:BLUE-AlarmLow-7e1a928e-xmpl-4d2b-8c01-782321bc6f66" - } - ] - } - ``` - -Application Auto Scaling creates two alarms in CloudWatch\. The first alarm triggers when the utilization of provisioned concurrency consistently exceeds 70 percent\. When this happens, Application Auto Scaling allocates more provisioned concurrency to reduce utilization\. The second alarm triggers when utilization is consistently less than 63 percent \(90 percent of the 70 percent target\)\. When this happens, Application Auto Scaling reduces the alias's provisioned concurrency\. - -In the following example, a function scales between a minimum and maximum amount of provisioned concurrency based on utilization\. When the number of open requests increases, Application Auto Scaling increases provisioned concurrency in large steps until it reaches the configured maximum\. The function continues to scale on standard concurrency until utilization starts to drop\. When utilization is consistently low, Application Auto Scaling decreases provisioned concurrency in smaller periodic steps\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned-auto.png) - -**Legend** -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.instances.png) Function instances -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.open.png) Open requests -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.provisioned.png) Provisioned concurrency -+ ![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/features-scaling-provisioned.standard.png) Standard concurrency - - Both of these alarms use the *average* statistic by default\. Functions that have traffic patterns of quick bursts may not trigger your provisioned concurrency to scale up\. For example, if your Lambda function executes quickly \(20–100 ms\) and your traffic pattern comes in quick bursts, this may cause incoming requests to exceed your allocated provisioned concurrency during the burst, but if the burst doesn’t last 3 minutes, auto scaling will not trigger\. Additionally, if CloudWatch doesn’t get three data points that hit the target average, the auto scaling policy will not trigger\. - -For more information on target tracking scaling policies, see [Target tracking scaling policies for Application Auto Scaling](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html)\. - -### Scheduled scaling - - Scaling based on a schedule allows you to set your own scaling schedule according to predictable load changes\. For more information and examples, see [Scheduling AWS Lambda Provisioned Concurrency for recurring peak usage](https://aws.amazon.com/blogs/compute/scheduling-aws-lambda-provisioned-concurrency-for-recurring-peak-usage/)\. \ No newline at end of file diff --git a/doc_source/python-context.md b/doc_source/python-context.md deleted file mode 100644 index db7e05fd..00000000 --- a/doc_source/python-context.md +++ /dev/null @@ -1,46 +0,0 @@ -# AWS Lambda context object in Python - -When Lambda runs your function, it passes a context object to the [handler](python-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. For more information on how the context object is passed to the function handler, see [Lambda function handler in Python](python-handler.md)\. - -**Context methods** -+ `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. - -**Context properties** -+ `function_name` – The name of the Lambda function\. -+ `function_version` – The [version](configuration-versions.md) of the function\. -+ `invoked_function_arn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `memory_limit_in_mb` – The amount of memory that's allocated for the function\. -+ `aws_request_id` – The identifier of the invocation request\. -+ `log_group_name` – The log group for the function\. -+ `log_stream_name` – The log stream for the function instance\. -+ `identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. - + `cognito_identity_id` – The authenticated Amazon Cognito identity\. - + `cognito_identity_pool_id` – The Amazon Cognito identity pool that authorized the invocation\. -+ `client_context` – \(mobile apps\) Client context that's provided to Lambda by the client application\. - + `client.installation_id` - + `client.app_title` - + `client.app_version_name` - + `client.app_version_code` - + `client.app_package_name` - + `custom` – A `dict` of custom values set by the mobile client application\. - + `env` – A `dict` of environment information provided by the AWS SDK\. - -The following example shows a handler function that logs context information\. - -**Example handler\.py** - -``` -import time - -def lambda_handler(event, context): - print("Lambda function ARN:", context.invoked_function_arn) - print("CloudWatch log stream name:", context.log_stream_name) - print("CloudWatch log group name:", context.log_group_name) - print("Lambda Request ID:", context.aws_request_id) - print("Lambda function memory limits in MB:", context.memory_limit_in_mb) - # We have added a 1 second delay so you can see the time remaining in get_remaining_time_in_millis. - time.sleep(1) - print("Lambda time remaining in MS:", context.get_remaining_time_in_millis()) -``` - -In addition to the options listed above, you can also use the AWS X\-Ray SDK for [Instrumenting Python code in AWS Lambda](python-tracing.md) to identify critical code paths, trace their performance and capture the data for analysis\. \ No newline at end of file diff --git a/doc_source/python-exceptions.md b/doc_source/python-exceptions.md deleted file mode 100644 index eff25240..00000000 --- a/doc_source/python-exceptions.md +++ /dev/null @@ -1,161 +0,0 @@ -# AWS Lambda function errors in Python - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the Python runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [How it works](#python-exceptions-how) -+ [Using the Lambda console](#python-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#python-exceptions-cli) -+ [Error handling in other AWS services](#python-exceptions-other-services) -+ [Error examples](#python-exceptions-examples) -+ [Sample applications](#python-exceptions-samples) -+ [What's next?](#python-exceptions-next-up) - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -``` -{"errorMessage": "'action'", "errorType": "KeyError", "stackTrace": [" File \"/var/task/lambda_function.py\", line 36, in lambda_handler\n result = ACTIONS[event['action']](event['number'])\n"]} -``` - -Lambda also records up to 256 KB of the error object in the function's logs\. For more information, see [AWS Lambda function logging in Python](python-logging.md)\. - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting Python code in AWS Lambda](python-tracing.md)\. - -## Error examples - -The following section shows common errors you may receive when creating, updating, or invoking your function using the Python [Lambda runtimes](lambda-runtimes.md)\. - -**Example Runtime exception – ImportError** - -``` -{ - "errorMessage": "Unable to import module 'lambda_function': Cannot import name '_imaging' from 'PIL' (/var/task/PIL/__init__.py)", - "errorType": "Runtime.ImportModuleError" -} -``` - -This error is a result of using the AWS Command Line Interface \(AWS CLI\) to upload a deployment package that contains a C or C\+\+ library\. For example, the [Pillow \(PIL\)](https://pypi.org/project/Pillow/), [numpy](https://pypi.org/project/numpy/), or [pandas](https://pypi.org/project/pandas/) library\. - -We recommend using the AWS SAM CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create your deployment package\. Using the AWS SAM CLI with this option creates a Docker container with a Lambda\-like environment that is compatible with Lambda\. - -**Example JSON serialization error – Runtime\.MarshalError** - -``` -{ - "errorMessage": "Unable to marshal response: Object of type AttributeError is not JSON serializable", - "errorType": "Runtime.MarshalError" -} -``` - -This error can be the result of the base64\-encoding mechanism you are using in your function code\. For example: - -``` -import base64 -encrypted_data = base64.b64encode(payload_enc).decode("utf-8") -``` - -This error can also be the result of not specifying your \.zip file as a binary file when you created or updated your function\. We recommend using the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) command option to upload your deployment package \(\.zip file\)\. - -``` -aws lambda create-function --function-name my-function --zip-file fileb://my-deployment-package.zip --handler lambda_function.lambda_handler --runtime python3.8 --role arn:aws:iam::your-account-id:role/lambda-ex -``` - -## Sample applications - -The GitHub repository for this guide includes sample applications that demonstrate the use of the errors\. Each sample application includes scripts for easy deployment and cleanup, an AWS Serverless Application Model \(AWS SAM\) template, and supporting resources\. - -**Sample Lambda applications in Python** -+ [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) – A Python function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Python](python-logging.md) page\. \ No newline at end of file diff --git a/doc_source/python-handler.md b/doc_source/python-handler.md deleted file mode 100644 index 9e791118..00000000 --- a/doc_source/python-handler.md +++ /dev/null @@ -1,143 +0,0 @@ -# Lambda function handler in Python - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -You can use the following general syntax when creating a function handler in Python: - -``` -def handler_name(event, context): - ... - return some_value -``` - -## Naming - -The Lambda function handler name specified at the time that you create a Lambda function is derived from: -+ The name of the file in which the Lambda handler function is located\. -+ The name of the Python handler function\. - -A function handler can be any name; however, the default name in the Lambda console is `lambda_function.lambda_handler`\. This function handler name reflects the function name \(`lambda_handler`\) and the file where the handler code is stored \(`lambda_function.py`\)\. - -To change the function handler name in the Lambda console, on the **Runtime settings** pane, choose **Edit**\. - -![\[A function handler name in the Lambda console.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/python-console-handler.png) - -## How it works - -When Lambda invokes your function handler, the [Lambda runtime](lambda-runtimes.md) passes two arguments to the function handler: -+ The first argument is the [event object](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-event)\. An event is a JSON\-formatted document that contains data for a Lambda function to process\. The [Lambda runtime](lambda-runtimes.md) converts the event to an object and passes it to your function code\. It is usually of the Python `dict` type\. It can also be `list`, `str`, `int`, `float`, or the `NoneType` type\. - - The event object contains information from the invoking service\. When you invoke a function, you determine the structure and contents of the event\. When an AWS service invokes your function, the service defines the event structure\. For more information about events from AWS services, see [Using AWS Lambda with other services](lambda-services.md)\. -+ The second argument is the [context object](python-context.md)\. A context object is passed to your function by Lambda at runtime\. This object provides methods and properties that provide information about the invocation, function, and runtime environment\. - -## Returning a value - -Optionally, a handler can return a value\. What happens to the returned value depends on the [invocation type](lambda-invocation.md) and the [service](lambda-services.md) that invoked the function\. For example: -+ If you use the `RequestResponse` invocation type, such as [Synchronous invocation](invocation-sync.md), AWS Lambda returns the result of the Python function call to the client invoking the Lambda function \(in the HTTP response to the invocation request, serialized into JSON\)\. For example, AWS Lambda console uses the `RequestResponse` invocation type, so when you invoke the function on the console, the console will display the returned value\. -+ If the handler returns objects that can't be serialized by `json.dumps`, the runtime returns an error\. -+ If the handler returns `None`, as Python functions without a `return` statement implicitly do, the runtime returns `null`\. -+ If you use the `Event` invocation type \(an [asynchronous invocation](invocation-async.md)\), the value is discarded\. - -**Note** -In Python 3\.9 and later releases, Lambda includes the requestId of the invocation in the error response\. - -## Examples - -The following section shows examples of Python functions you can use with Lambda\. If you use the Lambda console to author your function, you do not need to attach a [\.zip archive file](python-package.md) to run the functions in this section\. These functions use standard Python libraries which are included with the Lambda runtime you selected\. For more information, see [Lambda deployment packages](gettingstarted-package.md)\. - -### Returning a message - -The following example shows a function called `lambda_handler` that uses the `python3.8` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input of a first and last name, and returns a message that contains data from the event it received as input\. - -``` -def lambda_handler(event, context): - message = 'Hello {} {}!'.format(event['first_name'], event['last_name']) - return { - 'message' : message - } -``` - -You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): - -``` -{ - "first_name": "John", - "last_name": "Smith" -} -``` - -The response shows the event data passed as input: - -``` -{ - "message": "Hello John Smith!" -} -``` - -### Parsing a response - -The following example shows a function called `lambda_handler` that uses the `python3.8` [Lambda runtime](lambda-runtimes.md)\. The function uses event data passed by Lambda at runtime\. It parses the [environment variable](configuration-envvars.md) in `AWS_REGION` returned in the JSON response\. - -``` -import os -import json - -def lambda_handler(event, context): - json_region = os.environ['AWS_REGION'] - return { - "statusCode": 200, - "headers": { - "Content-Type": "application/json" - }, - "body": json.dumps({ - "Region ": json_region - }) - } -``` - -You can use any event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): - -``` -{ - "key1": "value1", - "key2": "value2", - "key3": "value3" -} -``` - -Lambda runtimes set several environment variables during initialization\. For more information on the environment variables returned in the response at runtime, see [Using AWS Lambda environment variables](configuration-envvars.md)\. - -The function in this example depends on a successful response \(in `200`\) from the Invoke API\. For more information on the Invoke API status, see the [Invoke](API_Invoke.md) Response Syntax\. - -### Returning a calculation - -The following example [ Lambda Python function code on GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) shows a function called `lambda_handler` that uses the `python3.6` [Lambda runtime](lambda-runtimes.md)\. The function accepts user input and returns a calculation to the user\. - -``` -import logging - -logger = logging.getLogger() -logger.setLevel(logging.INFO) - -def lambda_handler(event, context): - ... - result = None - action = event.get('action') - if action == 'increment': - result = event.get('number', 0) + 1 - logger.info('Calculated result of %s', result) - else: - logger.error("%s is not a valid action.", action) - - response = {'result': result} - return response -``` - -You can use the following event data to [invoke the function](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually): - -``` -{ - "action": "increment", - "number": 3 -} -``` \ No newline at end of file diff --git a/doc_source/python-image.md b/doc_source/python-image.md deleted file mode 100644 index eee3c4f4..00000000 --- a/doc_source/python-image.md +++ /dev/null @@ -1,102 +0,0 @@ -# Deploy Python Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Python function: -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for Python](#python-image-base) -+ [Create a Python image from an AWS base image](#python-image-create) -+ [Create a Python image from an alternative base image](#python-image-create-alt) -+ [Python runtime interface clients](#python-image-clients) -+ [Deploy the container image](#python-image-deploy) - -## AWS base images for Python - -AWS provides the following base images for Python: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| 3\.9 | Python 3\.9 | Amazon Linux 2 | [Dockerfile for Python 3\.9 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.9/Dockerfile.python3.9) | | -| 3\.8 | Python 3\.8 | Amazon Linux 2 | [Dockerfile for Python 3\.8 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.8/Dockerfile.python3.8) | | -| 3\.7 | Python 3\.7 | Amazon Linux | [Dockerfile for Python 3\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/python3.7/Dockerfile.python3.7) | | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/python](https://gallery.ecr.aws/lambda/python) - -## Create a Python image from an AWS base image - -When you build a container image for Python using an AWS base image, you only need to copy the python app to the container and install any dependencies\. - -If your function has dependencies, your local Python environment must match the version in the base image that you specify in the Dockerfile\. - -**To build and deploy a Python function with the `python:3.8` base image\.** - -1. On your local machine, create a project directory for your new function\. - -1. In your project directory, add a file named `app.py` containing your function code\. The following example shows a simple Python handler\. - - ``` - import sys - def handler(event, context): - return 'Hello from AWS Lambda using Python' + sys.version + '!' - ``` - -1. In your project directory, add a file named `requirements.txt`\. List each required library as a separate line in this file\. Leave the file empty if there are no dependencies\. - -1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. - - ``` - FROM public.ecr.aws/lambda/python:3.8 - - # Install the function's dependencies using file requirements.txt - # from your project folder. - - COPY requirements.txt . - RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" - - # Copy function code - COPY app.py ${LAMBDA_TASK_ROOT} - - # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) - CMD [ "app.handler" ] - ``` - -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. - -## Create a Python image from an alternative base image - -When you use an alternative base image, you need to install the [Python runtime interface client](#python-image-clients) - -For an example of how to create a Python image from an Alpine base image, see [Container image support for Lambda](http://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) on the AWS Blog\. - -## Python runtime interface clients - -Install the [runtime interface client](runtimes-images.md#runtimes-api-client) for Python using the pip package manager: - -``` -pip install awslambdaric -``` - -For package details, see [Lambda RIC](https://pypi.org/project/awslambdaric) on the Python Package Index \(PyPI\) website\. - -You can also download the [Python runtime interface client](https://github.com/aws/aws-lambda-python-runtime-interface-client/) from GitHub\. - -## Deploy the container image - -For a new function, you deploy the Python image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/python-logging.md b/doc_source/python-logging.md deleted file mode 100644 index cfb9045d..00000000 --- a/doc_source/python-logging.md +++ /dev/null @@ -1,220 +0,0 @@ -# AWS Lambda function logging in Python - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#python-logging-output) -+ [Using the Lambda console](#python-logging-console) -+ [Using the CloudWatch console](#python-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#python-logging-cli) -+ [Deleting logs](#python-logging-delete) -+ [Logging library](#python-logging-lib) - -## Creating a function that returns logs - - To output logs from your function code, you can use the [`print` method](https://docs.python.org/3/library/functions.html#print), or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. - -**Example lambda\_function\.py** - -``` -import os - -def lambda_handler(event, context): - print('## ENVIRONMENT VARIABLES') - print(os.environ) - print('## EVENT') - print(event) -``` - -**Example log format** - -``` -START RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Version: $LATEST -## ENVIRONMENT VARIABLES -environ({'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/my-function', 'AWS_LAMBDA_LOG_STREAM_NAME': '2020/01/31/[$LATEST]3893xmpl7fac4485b47bb75b671a283c', 'AWS_LAMBDA_FUNCTION_NAME': 'my-function', ...}) -## EVENT -{'key': 'value'} -END RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 -REPORT RequestId: 8f507cfc-xmpl-4697-b07a-ac58fc914c95 Duration: 15.74 ms Billed Duration: 16 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 130.49 ms -XRAY TraceId: 1-5e34a614-10bdxmplf1fb44f07bc535a1 SegmentId: 07f5xmpl2d1f6f85 Sampled: true -``` - -The Python runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. - -## Logging library - -For more detailed logs, use the [logging library](https://docs.python.org/3/library/logging.html)\. - -``` -import os -import logging -logger = logging.getLogger() -logger.setLevel(logging.INFO) - -def lambda_handler(event, context): - logger.info('## ENVIRONMENT VARIABLES') - logger.info(os.environ) - logger.info('## EVENT') - logger.info(event) -``` - -The output from `logger` includes the log level, timestamp, and request ID\. - -``` -START RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Version: $LATEST -[INFO] 2020-01-31T22:12:58.534Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 ## ENVIRONMENT VARIABLES - -[INFO] 2020-01-31T22:12:58.534Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 environ({'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/my-function', 'AWS_LAMBDA_LOG_STREAM_NAME': '2020/01/31/[$LATEST]1bbe51xmplb34a2788dbaa7433b0aa4d', 'AWS_LAMBDA_FUNCTION_NAME': 'my-function', ...}) - -[INFO] 2020-01-31T22:12:58.535Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 ## EVENT - -[INFO] 2020-01-31T22:12:58.535Z 1c8df7d3-xmpl-46da-9778-518e6eca8125 {'key': 'value'} - -END RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 -REPORT RequestId: 1c8df7d3-xmpl-46da-9778-518e6eca8125 Duration: 2.75 ms Billed Duration: 3 ms Memory Size: 128 MB Max Memory Used: 56 MB Init Duration: 113.51 ms -XRAY TraceId: 1-5e34a66a-474xmpl7c2534a87870b4370 SegmentId: 073cxmpl3e442861 Sampled: true -``` \ No newline at end of file diff --git a/doc_source/python-package.md b/doc_source/python-package.md deleted file mode 100644 index 53275a61..00000000 --- a/doc_source/python-package.md +++ /dev/null @@ -1,215 +0,0 @@ -# Deploy Python Lambda functions with \.zip file archives - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. - - For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. - -**Note** -A python package may contain initialization code in the \_\_init\_\_\.py file\. Prior to Python 3\.9, Lambda did not run the \_\_init\_\_\.py code for packages in the function handler’s directory or parent directories\. In Python 3\.9 and later releases, Lambda runs the init code for packages in these directories during initialization\. -Note that Lambda runs the init code only when the execution environment is first initialized, not for each function invocation in that initialized environment\. - -**Topics** -+ [Prerequisites](#python-package-prereqs) -+ [What is a runtime dependency?](#python-package-dependencies) -+ [Deployment package with no dependencies](#python-package-create-package-no-dependency) -+ [Deployment package with dependencies](#python-package-create-package-with-dependency) -+ [Using a virtual environment](#python-package-update-venv) -+ [Deploy your \.zip file to the function](#python-package-upload-code) - -## Prerequisites - -You need the AWS Command Line Interface \(AWS CLI\) to call service API operations\. To install the AWS CLI, see [Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) in the AWS Command Line Interface User Guide\. - -## What is a runtime dependency? - -A [deployment package](gettingstarted-package.md) is required to create or update a Lambda function with or without runtime dependencies\. The deployment package acts as the source bundle to run your function's code and dependencies \(if applicable\) on Lambda\. - -A dependency can be any package, module or other assembly dependency that is not included with the [Lambda runtime](lambda-runtimes.md) environment for your function's code\. - -The following describes a Lambda function without runtime dependencies: -+ If your function's code is in Python 3\.8 or later, and it depends only on standard Python math and logging libraries, you don't need to include the libraries in your \.zip file\. These libraries are included with the Python runtime\. -+ If your function's code depends on the [AWS SDK for Python \(Boto3\)](http://aws.amazon.com/sdk-for-python/), you don't need to include the boto3 library in your \.zip file\. These libraries are included with Python3\.8 and later runtimes\. - -Note: Lambda periodically updates the Boto3 libraries to enable the latest set of features and security updates\. To have full control of the dependencies your function uses, package all of your dependencies with your deployment package\. - -## Deployment package with no dependencies - -Create the \.zip file for your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-math-function` project directory\. For example, on macOS: - - ``` - mkdir my-math-function - ``` - -1. Navigate to the `my-math-function` project directory\. - - ``` - cd my-math-function - ``` - -1. Copy the contents of the [sample Python code from GitHub](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/python/example_code/lambda/lambda_handler_basic.py) and save it in a new file named `lambda_function.py`\. Your directory structure should look like this: - - ``` - my-math-function$ - | lambda_function.py - ``` - -1. Add the `lambda_function.py` file to the root of the \.zip file\. - - ``` - zip my-deployment-package.zip lambda_function.py - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: lambda_function.py (deflated 50%) - ``` - -## Deployment package with dependencies - -Create the \.zip file for your deployment package\. - -**To create the deployment package** - -1. Open a command prompt and create a `my-sourcecode-function` project directory\. For example, on macOS: - - ``` - mkdir my-sourcecode-function - ``` - -1. Navigate to the `my-sourcecode-function` project directory\. - - ``` - cd my-sourcecode-function - ``` - -1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: - - ``` - import requests - def lambda_handler(event, context): - response = requests.get("https://www.example.com/") - print(response.text) - return response.text - ``` - - Your directory structure should look like this: - - ``` - my-sourcecode-function$ - | lambda_function.py - ``` - -1. Install the requests library to a new `package` directory\. - - ``` - pip install --target ./package requests - ``` - -1. Create a deployment package with the installed library at the root\. - - ``` - cd package - zip -r ../my-deployment-package.zip . - ``` - - This generates a `my-deployment-package.zip` file in your project directory\. The command produces the following output: - - ``` - adding: chardet/ (stored 0%) - adding: chardet/enums.py (deflated 58%) - ... - ``` - -1. Add the `lambda_function.py` file to the root of the zip file\. - - ``` - cd .. - zip my-deployment-package.zip lambda_function.py - ``` - -## Using a virtual environment - -**To update a Python function using a virtual environment** - -1. Activate the virtual environment\. For example: - - ``` - ~/my-function$ source myvenv/bin/activate - ``` - -1. Install libraries with pip\. - - ``` - (myvenv) ~/my-function$ pip install requests - ``` - -1. Deactivate the virtual environment\. - - ``` - (myvenv) ~/my-function$ deactivate - ``` - -1. Create a deployment package with the installed libraries at the root\. - - ``` - ~/my-function$cd myvenv/lib/python3.8/site-packages - zip -r ../../../../my-deployment-package.zip . - ``` - - The last command saves the deployment package to the root of the `my-function` directory\. -**Tip** -A library may appear in `site-packages` or `dist-packages` and the first folder `lib` or `lib64`\. You can use the `pip show` command to locate a specific package\. - -1. Add function code files to the root of your deployment package\. - - ``` - ~/my-function/myvenv/lib/python3.8/site-packages$ cd ../../../../ - ~/my-function$ zip -g my-deployment-package.zip lambda_function.py - ``` - - After you complete this step, you should have the following directory structure: - - ``` - my-deployment-package.zip$ - │ lambda_function.py - │ __pycache__ - │ certifi/ - │ certifi-2020.6.20.dist-info/ - │ chardet/ - │ chardet-3.0.4.dist-info/ - ... - ``` - -## Deploy your \.zip file to the function - -To deploy the new code to your function, you upload the new \.zip file deployment package\. You can use the [Lambda console](configuration-function-zip.md#configuration-function-update) to upload a \.zip file to the function, or you can use the [UpdateFunctionCode](API_UpdateFunctionCode.md) CLI command\. - -The following example uploads a file named my\-deployment\-package\.zip\. Use the [fileb://](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html#cli-usage-parameters-file-binary) file prefix to upload the binary \.zip file to Lambda\. - -``` -~/my-function$ aws lambda update-function-code --function-name MyLambdaFunction --zip-file fileb://my-deployment-package.zip - { - "FunctionName": "mylambdafunction", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:mylambdafunction", - "Runtime": "python3.9", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "lambda_function.lambda_handler", - "CodeSize": 5912988, - "CodeSha256": "A2P0NUWq1J+LtSbkuP8tm9uNYqs1TAa3M76ptmZCw5g=", - "Version": "$LATEST", - "RevisionId": "5afdc7dc-2fcb-4ca8-8f24-947939ca707f", - ... - } -``` \ No newline at end of file diff --git a/doc_source/python-tracing.md b/doc_source/python-tracing.md deleted file mode 100644 index 99d9b228..00000000 --- a/doc_source/python-tracing.md +++ /dev/null @@ -1,187 +0,0 @@ -# Instrumenting Python code in AWS Lambda - -Lambda integrates with AWS X\-Ray to help you trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, which may include Lambda functions and other AWS services\. - -To send tracing data to X\-Ray, you can use one of two SDK libraries: -+ [AWS Distro for OpenTelemetry \(ADOT\)](http://aws.amazon.com/otel) – A secure, production\-ready, AWS\-supported distribution of the OpenTelemetry \(OTel\) SDK\. -+ [AWS X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) – An SDK for generating and sending trace data to X\-Ray\. - -Both ADOT and the X\-Ray SDK offer ways to send your telemetry data to the X\-Ray service\. You can then use X\-Ray to view, filter, and gain insights into your application's performance metrics to identify issues and opportunities for optimization\. - -**Important** -**ADOT is the preferred method for instrumenting your Lambda functions**\. We recommend using ADOT for all new applications\. However, due to the flexibility OpenTelemetry offers, your Lambda function invocations may experience cold start latency increases\. If you're optimizing for low\-latency and also do not require OpenTelemetry's advanced capabilities such as telemetry correlation and dynamically configurable backend destinations, you may want to use the AWS X\-Ray SDK over ADOT\. - -**Topics** -+ [Using ADOT to instrument your Python functions](#python-adot) -+ [Using the X\-Ray SDK to instrument your Python functions](#python-xray-sdk) -+ [Activating tracing with the Lambda console](#python-tracing-console) -+ [Activating tracing with the Lambda API](#python-tracing-api) -+ [Activating tracing with AWS CloudFormation](#python-tracing-cloudformation) -+ [Interpreting an X\-Ray trace](#python-tracing-interpretation) -+ [Storing runtime dependencies in a layer \(X\-Ray SDK\)](#python-tracing-layers) - -## Using ADOT to instrument your Python functions - -ADOT provides fully managed Lambda [layers](gettingstarted-concepts.md#gettingstarted-concepts-layer) that package everything you need to collect telemetry data using the OTel SDK\. By consuming this layer, you can instrument your Lambda functions without having to modify any function code\. You can also configure your layer to do custom initialization of OTel\. For more information, see [Custom configuration for the ADOT Collector on Lambda](https://aws-otel.github.io/docs/getting-started/lambda#custom-configuration-for-the-adot-collector-on-lambda) in the ADOT documentation\. - -For Python runtimes, you can add the **AWS managed Lambda layer for ADOT Python** to automatically instrument your functions\. This layer works for both arm64 and x86\_64 architectures\. For detailed instructions on how to add this layer, see [AWS Distro for OpenTelemetry Lambda Support for Python](https://aws-otel.github.io/docs/getting-started/lambda/lambda-python) in the ADOT documentation\. - -## Using the X\-Ray SDK to instrument your Python functions - -To record details about calls that your Lambda function makes to other resources in your application, you can also use the AWS X\-Ray SDK for Python\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. - -**Example [requirements\.txt](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/requirements.txt)** - -``` -jsonpickle==1.3 -aws-xray-sdk==2.4.3 -``` - -In your function code, you can instrument AWS SDK clients by patching the `boto3` library with the `aws_xray_sdk.core` module\. - -**Example [function – Tracing an AWS SDK client](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/function/lambda_function.py)** - -``` -import boto3 -from aws_xray_sdk.core import xray_recorder -from aws_xray_sdk.core import patch_all - -logger = logging.getLogger() -logger.setLevel(logging.INFO) -patch_all() - -client = boto3.client('lambda') -client.get_account_settings() - -def lambda_handler(event, context): - logger.info('## ENVIRONMENT VARIABLES\r' + jsonpickle.encode(dict(**os.environ))) - ... -``` - -After you add the correct dependencies and make the necessary code changes, activate tracing in your function's configuration via the Lambda console or the API\. - -## Activating tracing with the Lambda console - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -## Activating tracing with the Lambda API - -Configure tracing on your Lambda function with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Activating tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` - -## Interpreting an X\-Ray trace - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see the [AWS X\-Ray SDK for Python](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python.html) in the *AWS X\-Ray Developer Guide*\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -## Storing runtime dependencies in a layer \(X\-Ray SDK\) - -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. - -The following example shows an `AWS::Serverless::LayerVersion` resource that stores the AWS X\-Ray SDK for Python\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python/template.yml) – Dependencies layer** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: function/. - Tracing: Active - Layers: - - !Ref libs - ... - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-python-lib - Description: Dependencies for the blank-python sample app. - ContentUri: package/. - CompatibleRuntimes: - - python3.8 -``` - -With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. - -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python) sample application\. \ No newline at end of file diff --git a/doc_source/ruby-context.md b/doc_source/ruby-context.md deleted file mode 100644 index 33bd952b..00000000 --- a/doc_source/ruby-context.md +++ /dev/null @@ -1,18 +0,0 @@ -# AWS Lambda context object in Ruby - -When Lambda runs your function, it passes a context object to the [handler](ruby-handler.md)\. This object provides methods and properties that provide information about the invocation, function, and execution environment\. - -**Context methods** -+ `get_remaining_time_in_millis` – Returns the number of milliseconds left before the execution times out\. - -**Context properties** -+ `function_name` – The name of the Lambda function\. -+ `function_version` – The [version](configuration-versions.md) of the function\. -+ `invoked_function_arn` – The Amazon Resource Name \(ARN\) that's used to invoke the function\. Indicates if the invoker specified a version number or alias\. -+ `memory_limit_in_mb` – The amount of memory that's allocated for the function\. -+ `aws_request_id` – The identifier of the invocation request\. -+ `log_group_name` – The log group for the function\. -+ `log_stream_name` – The log stream for the function instance\. -+ `deadline_ms`– The date that the execution times out, in Unix time milliseconds\. -+ `identity` – \(mobile apps\) Information about the Amazon Cognito identity that authorized the request\. -+ `client_context`– \(mobile apps\) Client context that's provided to Lambda by the client application\. \ No newline at end of file diff --git a/doc_source/ruby-exceptions.md b/doc_source/ruby-exceptions.md deleted file mode 100644 index f2b16ff5..00000000 --- a/doc_source/ruby-exceptions.md +++ /dev/null @@ -1,146 +0,0 @@ -# AWS Lambda function errors in Ruby - -When your code raises an error, Lambda generates a JSON representation of the error\. This error document appears in the invocation log and, for synchronous invocations, in the output\. - -This page describes how to view Lambda function invocation errors for the Ruby runtime using the Lambda console and the AWS CLI\. - -**Topics** -+ [Syntax](#ruby-exceptions-syntax) -+ [How it works](#ruby-exceptions-how) -+ [Using the Lambda console](#ruby-exceptions-console) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-exceptions-cli) -+ [Error handling in other AWS services](#ruby-exceptions-other-services) -+ [Sample applications](#ruby-exceptions-samples) -+ [What's next?](#ruby-exceptions-next-up) - -## Syntax - -**Example function\.rb** - -``` -def handler(event:, context:) - puts "Processing event..." - [1, 2, 3].first("two") - "Success" -end -``` - -This code results in a type error\. Lambda catches the error and generates a JSON document with fields for the error message, the type, and the stack trace\. - -``` -{ - "errorMessage": "no implicit conversion of String into Integer", - "errorType": "Function", - "stackTrace": [ - "/var/task/function.rb:3:in `first'", - "/var/task/function.rb:3:in `handler'" - ] -} -``` - -## How it works - -When you invoke a Lambda function, Lambda receives the invocation request and validates the permissions in your execution role, verifies that the event document is a valid JSON document, and checks parameter values\. - -If the request passes validation, Lambda sends the request to a function instance\. The [Lambda runtime](lambda-runtimes.md) environment converts the event document into an object, and passes it to your function handler\. - -If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error\. The client or service that invoked the Lambda function can handle the error programmatically, or pass it along to an end user\. The correct error handling behavior depends on the type of application, the audience, and the source of the error\. - -The following list describes the range of status codes you can receive from Lambda\. - -**`2xx`** -A `2xx` series error with a `X-Amz-Function-Error` header in the response indicates a Lambda runtime or function error\. A `2xx` series status code indicates that Lambda accepted the request, but instead of an error code, Lambda indicates the error by including the `X-Amz-Function-Error` header in the response\. - -**`4xx`** -A `4xx` series error indicates an error that the invoking client or service can fix by modifying the request, requesting permission, or by retrying the request\. `4xx` series errors other than `429` generally indicate an error with the request\. - -**`5xx`** -A `5xx` series error indicates an issue with Lambda, or an issue with the function's configuration or resources\. `5xx` series errors can indicate a temporary condition that can be resolved without any action by the user\. These issues can't be addressed by the invoking client or service, but a Lambda function's owner may be able to fix the issue\. - -For a complete list of invocation errors, see [InvokeFunction errors](API_Invoke.md#API_Invoke_Errors)\. - -## Using the Lambda console - -You can invoke your function on the Lambda console by configuring a test event and viewing the output\. The output is captured in the function's execution logs and, when [active tracing](services-xray.md) is enabled, in AWS X\-Ray\. - -**To invoke a function on the Lambda console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the function to test, and choose **Test**\. - -1. Under **Test event**, select **New event**\. - -1. Select a **Template**\. - -1. For **Name**, enter a name for the test\. In the text entry box, enter the JSON test event\. - -1. Choose **Save changes**\. - -1. Choose **Test**\. - -The Lambda console invokes your function [synchronously](invocation-sync.md) and displays the result\. To see the response, logs, and other information, expand the **Details** section\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -When you invoke a Lambda function in the AWS CLI, the AWS CLI splits the response into two documents\. The AWS CLI response is displayed in your command prompt\. If an error has occurred, the response contains a `FunctionError` field\. The invocation response or error returned by the function is written to an output file\. For example, `output.json` or `output.txt`\. - -The following [invoke](https://docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html) command example demonstrates how to invoke a function and write the invocation response to an `output.txt` file\. - -``` -aws lambda invoke \ - --function-name my-function \ - --cli-binary-format raw-in-base64-out \ - --payload '{"key1": "value1", "key2": "value2", "key3": "value3"}' output.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -You should see the AWS CLI response in your command prompt: - -``` -{ - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" -} -``` - -You should see the function invocation response in the `output.txt` file\. In the same command prompt, you can also view the output in your command prompt using: - -``` -cat output.txt -``` - -You should see the invocation response in your command prompt\. - -``` -{"errorMessage":"no implicit conversion of String into Integer","errorType":"Function","stackTrace":["/var/task/function.rb:3:in `first'","/var/task/function.rb:3:in `handler'"]} -``` - -## Error handling in other AWS services - -When another AWS service invokes your function, the service chooses the invocation type and retry behavior\. AWS services can invoke your function on a schedule, in response to a lifecycle event on a resource, or to serve a request from a user\. Some services invoke functions asynchronously and let Lambda handle errors, while others retry or pass errors back to the user\. - -For example, API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a `500` error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502 error code\. To customize the error response, you must catch errors in your code and format a response in the required format\. - -We recommend using AWS X\-Ray to determine the source of an error and its cause\. X\-Ray allows you to find out which component encountered an error, and see details about the errors\. The following example shows a function error that resulted in a `502` response from API Gateway\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -For more information, see [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md)\. - -## Sample applications - -The following sample code is available for the Ruby runtime\. - -**Sample Lambda applications in Ruby** -+ [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) – A Ruby function that shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. -+ [Ruby Code Samples for AWS Lambda](https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-ruby-example_code-lambda.html) – Code samples written in Ruby that demonstrate how to interact with AWS Lambda\. - -## What's next? -+ Learn how to show logging events for your Lambda function on the [AWS Lambda function logging in Ruby](ruby-logging.md) page\. \ No newline at end of file diff --git a/doc_source/ruby-handler.md b/doc_source/ruby-handler.md deleted file mode 100644 index bf0fdb00..00000000 --- a/doc_source/ruby-handler.md +++ /dev/null @@ -1,39 +0,0 @@ -# AWS Lambda function handler in Ruby - -The Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -In the following example, the file `function.rb` defines a handler method named `handler`\. The handler function takes two objects as input and returns a JSON document\. - -**Example function\.rb** - -``` -require 'json' - -def handler(event:, context:) - { event: JSON.generate(event), context: JSON.generate(context.inspect) } -end -``` - -In your function configuration, the `handler` setting tells Lambda where to find the handler\. For the preceding example, the correct value for this setting is **function\.handler**\. It includes two names separated by a dot: the name of the file and the name of the handler method\. - -You can also define your handler method in a class\. The following example defines a handler method named `process` on a class named `Handler` in a module named `LambdaFunctions`\. - -**Example source\.rb** - -``` -module LambdaFunctions - class Handler - def self.process(event:,context:) - "Hello!" - end - end -end -``` - -In this case, the handler setting is **source\.LambdaFunctions::Handler\.process**\. - -The two objects that the handler accepts are the invocation event and context\. The event is a Ruby object that contains the payload that's provided by the invoker\. If the payload is a JSON document, the event object is a Ruby hash\. Otherwise, it's a string\. The [context object](ruby-context.md) has methods and properties that provide information about the invocation, the function, and the execution environment\. - -The function handler is executed every time your Lambda function is invoked\. Static code outside of the handler is executed once per instance of the function\. If your handler uses resources like SDK clients and database connections, you can create them outside of the handler method to reuse them for multiple invocations\. - -Each instance of your function can process multiple invocation events, but it only processes one event at a time\. The number of instances processing an event at any given time is your function's *concurrency*\. For more information about the Lambda execution environment, see [Lambda execution environment](lambda-runtime-environment.md)\. \ No newline at end of file diff --git a/doc_source/ruby-image.md b/doc_source/ruby-image.md deleted file mode 100644 index 802fb8eb..00000000 --- a/doc_source/ruby-image.md +++ /dev/null @@ -1,99 +0,0 @@ -# Deploy Ruby Lambda functions with container images - -You can deploy your Lambda function code as a [container image](images-create.md)\. AWS provides the following resources to help you build a container image for your Ruby function: -+ AWS base images for Lambda - - These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. -+ Open\-source runtime interface clients \(RIC\) - - If you use a community or private enterprise base image, you must add a [Runtime interface client](runtimes-images.md#runtimes-api-client) to the base image to make it compatible with Lambda\. -+ Open\-source runtime interface emulator \(RIE\) - - Lambda provides a runtime interface emulator for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image](images-test.md) locally\. - -The workflow for a function defined as a container image includes these steps: - -1. Build your container image using the resources listed in this topic\. - -1. Upload the image to your [Amazon ECR container registry](images-create.md#images-upload)\. - -1. [Create](gettingstarted-images.md#configuration-images-create) the Lambda function or [update the function code](gettingstarted-images.md#configuration-images-update) to deploy the image to an existing function\. - -**Topics** -+ [AWS base images for Ruby](#ruby-image-base) -+ [Using a Ruby base image](#ruby-image-instructions) -+ [Ruby runtime interface clients](#ruby-image-clients) -+ [Create a Ruby image from an AWS base image](#ruby-image-create) -+ [Deploy the container image](#ruby-image-deploy) - -## AWS base images for Ruby - -AWS provides the following base images for Ruby: - - -| Tags | Runtime | Operating system | Dockerfile | Deprecation | -| --- | --- | --- | --- | --- | -| 2\.7 | Ruby 2\.7 | Amazon Linux 2 | [Dockerfile for Ruby 2\.7 on GitHub](https://github.com/aws/aws-lambda-base-images/blob/ruby2.7/Dockerfile.ruby2.7) | | - -Amazon ECR repository: [gallery\.ecr\.aws/lambda/ruby](https://gallery.ecr.aws/lambda/ruby) - -## Using a Ruby base image - -For instructions on how to use a Ruby base image, choose the **usage** tab on [AWS Lambda base images for Ruby](https://gallery.ecr.aws/lambda/ruby) in the *Amazon ECR repository*\. - -## Ruby runtime interface clients - -Install the runtime interface client for Ruby using the RubyGems\.org package manager: - -``` -gem install aws_lambda_ric -``` - -For package details, see [Lambda RIC](https://rubygems.org/gems/aws_lambda_ric) on [RubyGems\.org](https://rubygems.org/pages/about)\. - -You can also download the [Ruby runtime interface client](https://github.com/aws/aws-lambda-ruby-runtime-interface-client) from GitHub\. - -## Create a Ruby image from an AWS base image - -When you build a container image for Ruby using an AWS base image, you only need to copy the ruby app to the container and install any dependencies\. - -**To build and deploy a Ruby function with the `ruby:2.7` base image\.** - -1. On your local machine, create a project directory for your new function\. - -1. In your project directory, add a file named `app.rb` containing your function code\. The following example shows a simple Ruby handler\. - - ``` - module LambdaFunction - class Handler - def self.process(event:,context:) - "Hello from Ruby 2.7 container image!" - end - end - end - ``` - -1. Use a text editor to create a Dockerfile in your project directory\. The following example shows the Dockerfile for the handler that you created in the previous step\. Install any dependencies under the $\{LAMBDA\_TASK\_ROOT\} directory alongside the function handler to ensure that the Lambda runtime can locate them when the function is invoked\. - - ``` - FROM public.ecr.aws/lambda/ruby:2.7 - - # Copy function code - COPY app.rb ${LAMBDA_TASK_ROOT} - - # Copy dependency management file - COPY Gemfile ${LAMBDA_TASK_ROOT} - - # Install dependencies under LAMBDA_TASK_ROOT - ENV GEM_HOME=${LAMBDA_TASK_ROOT} - RUN bundle install - - # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) - CMD [ "app.LambdaFunction::Handler.process" ] - ``` - -1. To create the container image, follow steps 4 through 7 in [Create an image from an AWS base image for Lambda](images-create.md#images-create-from-base)\. - -## Deploy the container image - -For a new function, you deploy the Ruby image when you [create the function](gettingstarted-images.md#configuration-images-create)\. For an existing function, if you rebuild the container image, you need to redeploy the image by [updating the function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/ruby-logging.md b/doc_source/ruby-logging.md deleted file mode 100644 index 4a0ecdfa..00000000 --- a/doc_source/ruby-logging.md +++ /dev/null @@ -1,219 +0,0 @@ -# AWS Lambda function logging in Ruby - -AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch\. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function\. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code\. - -This page describes how to produce log output from your Lambda function's code, or access logs using the AWS Command Line Interface, the Lambda console, or the CloudWatch console\. - -**Topics** -+ [Creating a function that returns logs](#ruby-logging-output) -+ [Using the Lambda console](#ruby-logging-console) -+ [Using the CloudWatch console](#ruby-logging-cwconsole) -+ [Using the AWS Command Line Interface \(AWS CLI\)](#ruby-logging-cli) -+ [Deleting logs](#ruby-logging-delete) - -## Creating a function that returns logs - - To output logs from your function code, you can use `puts` statements, or any logging library that writes to `stdout` or `stderr`\. The following example logs the values of environment variables and the event object\. - -**Example lambda\_function\.rb** - -``` -# lambda_function.rb - -def handler(event:, context:) - puts "## ENVIRONMENT VARIABLES" - puts ENV.to_a - puts "## EVENT" - puts event.to_a -end -``` - -For more detailed logs, use the [logger library](https://ruby-doc.org/stdlib-2.7.0/libdoc/logger/rdoc/index.html)\. - -``` -# lambda_function.rb - -require 'logger' - -def handler(event:, context:) - logger = Logger.new($stdout) - logger.info('## ENVIRONMENT VARIABLES') - logger.info(ENV.to_a) - logger.info('## EVENT') - logger.info(event) - event.to_a -end -``` - -The output from `logger` includes the timestamp, process ID, log level, and request ID\. - -``` -I, [2019-10-26T10:04:01.689856 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- : ## EVENT -I, [2019-10-26T10:04:01.689874 #8] INFO 6573a3a0-2fb1-4e78-a582-2c769282e0bd -- : {"key1"=>"value1", "key2"=>"value2", "key3"=>"value3"} -``` - -**Example log format** - -``` -START RequestId: 50aba555-99c8-4b21-8358-644ee996a05f Version: $LATEST -## ENVIRONMENT VARIABLES -AWS_LAMBDA_FUNCTION_VERSION -$LATEST -AWS_LAMBDA_LOG_GROUP_NAME -/aws/lambda/my-function -AWS_LAMBDA_LOG_STREAM_NAME -2020/01/31/[$LATEST]3f34xmpl069f4018b4a773bcfe8ed3f9 -AWS_EXECUTION_ENV -AWS_Lambda_ruby2.5 -... -## EVENT -key -value -END RequestId: 50aba555-xmpl-4b21-8358-644ee996a05f -REPORT RequestId: 50aba555-xmpl-4b21-8358-644ee996a05f Duration: 12.96 ms Billed Duration: 13 ms Memory Size: 128 MB Max Memory Used: 48 MB Init Duration: 117.86 ms -XRAY TraceId: 1-5e34a246-2a04xmpl0fa44eb60ea08c5f SegmentId: 454xmpl46ca1c7d3 Sampled: true -``` - -The Ruby runtime logs the `START`, `END`, and `REPORT` lines for each invocation\. The report line provides the following details\. - -**Report Log** -+ **RequestId** – The unique request ID for the invocation\. -+ **Duration** – The amount of time that your function's handler method spent processing the event\. -+ **Billed Duration** – The amount of time billed for the invocation\. -+ **Memory Size** – The amount of memory allocated to the function\. -+ **Max Memory Used** – The amount of memory used by the function\. -+ **Init Duration** – For the first request served, the amount of time it took the runtime to load the function and run code outside of the handler method\. -+ **XRAY TraceId** – For traced requests, the [AWS X\-Ray trace ID](services-xray.md)\. -+ **SegmentId** – For traced requests, the X\-Ray segment ID\. -+ **Sampled** – For traced requests, the sampling result\. - -## Using the Lambda console - -You can use the Lambda console to view log output after you invoke a Lambda function\. For more information, see [Accessing Amazon CloudWatch logs for AWS Lambda](monitoring-cloudwatchlogs.md)\. - -## Using the CloudWatch console - -You can use the Amazon CloudWatch console to view logs for all Lambda function invocations\. - -**To view logs on the CloudWatch console** - -1. Open the [Log groups page](https://console.aws.amazon.com/cloudwatch/home?#logs:) on the CloudWatch console\. - -1. Choose the log group for your function \(**/aws/lambda/*your\-function\-name***\)\. - -1. Choose a log stream\. - -Each log stream corresponds to an [instance of your function](lambda-runtime-environment.md)\. A log stream appears when you update your Lambda function, and when additional instances are created to handle multiple concurrent invocations\. To find logs for a specific invocation, we recommend instrumenting your function with AWS X\-Ray\. X\-Ray records details about the request and the log stream in the trace\. - -To use a sample application that correlates logs and traces with X\-Ray, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -## Using the AWS Command Line Interface \(AWS CLI\) - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -You can use the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) to retrieve logs for an invocation using the `--log-type` command option\. The response contains a `LogResult` field that contains up to 4 KB of base64\-encoded logs from the invocation\. - -**Example retrieve a log ID** -The following example shows how to retrieve a *log ID* from the `LogResult` field for a function named `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "LogResult": "U1RBUlQgUmVxdWVzdElkOiA4N2QwNDRiOC1mMTU0LTExZTgtOGNkYS0yOTc0YzVlNGZiMjEgVmVyc2lvb...", - "ExecutedVersion": "$LATEST" -} -``` - -**Example decode the logs** -In the same command prompt, use the `base64` utility to decode the logs\. The following example shows how to retrieve base64\-encoded logs for `my-function`\. - -``` -aws lambda invoke --function-name my-function out --log-type Tail \ ---query 'LogResult' --output text | base64 -d -``` -You should see the following output: - -``` -START RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Version: $LATEST -"AWS_SESSION_TOKEN": "AgoJb3JpZ2luX2VjELj...", "_X_AMZN_TRACE_ID": "Root=1-5d02e5ca-f5792818b6fe8368e5b51d50;Parent=191db58857df8395;Sampled=0"",ask/lib:/opt/lib", -END RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 -REPORT RequestId: 57f231fb-1730-4395-85cb-4f71bd2b87b8 Duration: 79.67 ms Billed Duration: 80 ms Memory Size: 128 MB Max Memory Used: 73 MB -``` -The `base64` utility is available on Linux, macOS, and [Ubuntu on Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. macOS users may need to use `base64 -D`\. - -**Example get\-logs\.sh script** -In the same command prompt, use the following script to download the last five log events\. The script uses `sed` to remove quotes from the output file, and sleeps for 15 seconds to allow time for the logs to become available\. The output includes the response from Lambda and the output from the `get-log-events` command\. -Copy the contents of the following code sample and save in your Lambda project directory as `get-logs.sh`\. -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -``` -#!/bin/bash -aws lambda invoke --function-name my-function --cli-binary-format raw-in-base64-out --payload '{"key": "value"}' out -sed -i'' -e 's/"//g' out -sleep 15 -aws logs get-log-events --log-group-name /aws/lambda/my-function --log-stream-name stream1 --limit 5 -``` - -**Example macOS and Linux \(only\)** -In the same command prompt, macOS and Linux users may need to run the following command to ensure the script is executable\. - -``` -chmod -R 755 get-logs.sh -``` - -**Example retrieve the last five log events** -In the same command prompt, run the following script to get the last five log events\. - -``` -./get-logs.sh -``` -You should see the following output: - -``` -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -{ - "events": [ - { - "timestamp": 1559763003171, - "message": "START RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf Version: $LATEST\n", - "ingestionTime": 1559763003309 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tENVIRONMENT VARIABLES\r{\r \"AWS_LAMBDA_FUNCTION_VERSION\": \"$LATEST\",\r ...", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003173, - "message": "2019-06-05T19:30:03.173Z\t4ce9340a-b765-490f-ad8a-02ab3415e2bf\tINFO\tEVENT\r{\r \"key\": \"value\"\r}\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "END RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\n", - "ingestionTime": 1559763018353 - }, - { - "timestamp": 1559763003218, - "message": "REPORT RequestId: 4ce9340a-b765-490f-ad8a-02ab3415e2bf\tDuration: 26.73 ms\tBilled Duration: 27 ms \tMemory Size: 128 MB\tMax Memory Used: 75 MB\t\n", - "ingestionTime": 1559763018353 - } - ], - "nextForwardToken": "f/34783877304859518393868359594929986069206639495374241795", - "nextBackwardToken": "b/34783877303811383369537420289090800615709599058929582080" -} -``` - -## Deleting logs - -Log groups aren't deleted automatically when you delete a function\. To avoid storing logs indefinitely, delete the log group, or [configure a retention period](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#SettingLogRetention) after which logs are deleted automatically\. \ No newline at end of file diff --git a/doc_source/ruby-package.md b/doc_source/ruby-package.md deleted file mode 100644 index 1ce93c9a..00000000 --- a/doc_source/ruby-package.md +++ /dev/null @@ -1,136 +0,0 @@ -# Deploy Ruby Lambda functions with \.zip file archives - -Your AWS Lambda function's code consists of scripts or compiled programs and their dependencies\. You use a *deployment package* to deploy your function code to Lambda\. Lambda supports two types of deployment packages: container images and \.zip file archives\. - -To create the deployment package for a \.zip file archive, you can use a built\-in \.zip file archive utility or any other \.zip file utility \(such as [7zip](https://www.7-zip.org/download.html)\) for your command line tool\. Note the following requirements for using a \.zip file as your deployment package: -+ The \.zip file contains your function's code and any dependencies used to run your function's code \(if applicable\) on Lambda\. If your function depends only on standard libraries, or AWS SDK libraries, you don't need to include these libraries in your \.zip file\. These libraries are included with the supported [Lambda runtime](lambda-runtimes.md) environments\. -+ If the \.zip file is larger than 50 MB, we recommend uploading it to your function from an Amazon Simple Storage Service \(Amazon S3\) bucket\. -+ If your deployment package contains native libraries, you can build the deployment package with AWS Serverless Application Model \(AWS SAM\)\. You can use the AWS SAM CLI `sam build` command with the `--use-container` to create your deployment package\. This option builds a deployment package inside a Docker image that is compatible with the Lambda execution environment\. - - For more information, see [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html) in the *AWS Serverless Application Model Developer Guide*\. -+ You need to build the deployment package to be compatible with this [instruction set architecture](foundation-arch.md) of the function\. -+ Lambda uses POSIX file permissions, so you may need to [ set permissions for the deployment package folder](http://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/) before you create the \.zip file archive\. - -**Topics** -+ [Prerequisites](#ruby-package-prereqs) -+ [Tools and libraries](#ruby-package-libraries) -+ [Updating a function with no dependencies](#ruby-package-codeonly) -+ [Updating a function with additional dependencies](#ruby-package-dependencies) - -## Prerequisites - -The AWS CLI is an open\-source tool that enables you to interact with AWS services using commands in your command line shell\. To complete the steps in this section, you must have the following: -+ [AWS CLI – Install version 2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -+ [AWS CLI – Quick configuration with `aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) - -## Tools and libraries - -Lambda provides the following tools and libraries for the Ruby runtime: - -**Tools and libraries for Ruby** -+ [AWS SDK for Ruby](https://github.com/aws/aws-sdk-ruby): the official AWS SDK for the Ruby programming language\. - -## Updating a function with no dependencies - -To update a function by using the Lambda API, use the [UpdateFunctionCode](API_UpdateFunctionCode.md) operation\. Create an archive that contains your function code, and upload it using the AWS Command Line Interface \(AWS CLI\)\. - -**To update a Ruby function with no dependencies** - -1. Create a \.zip file archive\. - - ``` - zip function.zip function.rb - ``` - -1. To upload the package, use the `update-function-code` command\. - - ``` - aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", - "Runtime": "ruby2.5", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "function.handler", - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "Active" - }, - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... - } - ``` - -## Updating a function with additional dependencies - -If your function depends on libraries other than the AWS SDK for Ruby, install them to a local directory with [Bundler](https://bundler.io/), and include them in your deployment package\. - -**To update a Ruby function with dependencies** - -1. Install libraries in the vendor directory using the `bundle` command\. - - ``` - bundle config set --local path 'vendor/bundle' \ - bundle install - ``` - - You should see the following output: - - ``` - Fetching gem metadata from https://rubygems.org/.............. - Resolving dependencies... - Fetching aws-eventstream 1.0.1 - Installing aws-eventstream 1.0.1 - ... - ``` - - This installs the gems in the project directory instead of the system location, and sets `vendor/bundle` as the default path for future installations\. To later install gems globally, use `bundle config set --local system 'true'`\. - -1. Create a \.zip file archive\. - - ``` - zip -r function.zip function.rb vendor - ``` - - You should see the following output: - - ``` - adding: function.rb (deflated 37%) - adding: vendor/ (stored 0%) - adding: vendor/bundle/ (stored 0%) - adding: vendor/bundle/ruby/ (stored 0%) - adding: vendor/bundle/ruby/2.7.0/ (stored 0%) - adding: vendor/bundle/ruby/2.7.0/build_info/ (stored 0%) - adding: vendor/bundle/ruby/2.7.0/cache/ (stored 0%) - adding: vendor/bundle/ruby/2.7.0/cache/aws-eventstream-1.0.1.gem (deflated 36%) - ... - ``` - -1. Update the function code\. - - ``` - aws lambda update-function-code --function-name my-function --zip-file fileb://function.zip - ``` - - You should see the following output: - - ``` - { - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", - "Runtime": "ruby2.5", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "function.handler", - "CodeSize": 300, - "CodeSha256": "Qf0hMc1I2di6YFMi9aXm3JtGTmcDbjniEuiYonYptAk=", - "Version": "$LATEST", - "RevisionId": "983ed1e3-ca8e-434b-8dc1-7d72ebadd83d", - ... - } - ``` \ No newline at end of file diff --git a/doc_source/ruby-tracing.md b/doc_source/ruby-tracing.md deleted file mode 100644 index cde7383d..00000000 --- a/doc_source/ruby-tracing.md +++ /dev/null @@ -1,175 +0,0 @@ -# Instrumenting Ruby code in AWS Lambda - -Lambda integrates with AWS X\-Ray to enable you to trace, debug, and optimize Lambda applications\. You can use X\-Ray to trace a request as it traverses resources in your application, from the frontend API to storage and database on the backend\. By simply adding the X\-Ray SDK library to your build configuration, you can record errors and latency for any call that your function makes to an AWS service\. - -After you've configured active tracing, you can observe specific requests through your application\. The [ X\-Ray service graph](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-servicegraph) shows information about your application and all its components\. The following example from the [error processor](samples-errorprocessor.md) sample application shows an application with two functions\. The primary function processes events and sometimes returns errors\. The second function at the top processes errors that appear in the first's log group and uses the AWS SDK to call X\-Ray, Amazon Simple Storage Service \(Amazon S3\), and Amazon CloudWatch Logs\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-servicemap.png) - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can instrument your handler code to record metadata and trace downstream calls\. To record detail about calls that your handler makes to other resources and services, use the X\-Ray SDK for Ruby\. To get the SDK, add the `aws-xray-sdk` package to your application's dependencies\. - -**Example [blank\-ruby/function/Gemfile](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/Gemfile)** - -``` -# Gemfile -source 'https://rubygems.org' - -gem 'aws-xray-sdk', '0.11.4' -gem 'aws-sdk-lambda', '1.39.0' -gem 'test-unit', '3.3.5' -``` - -To instrument AWS SDK clients, require the `aws-xray-sdk/lambda` module after creating a client in initialization code\. - -**Example [blank\-ruby/function/lambda\_function\.rb](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/function/lambda_function.rb) – Tracing an AWS SDK client** - -``` -# lambda_function.rb -require 'logger' -require 'json' -require 'aws-sdk-lambda' -$client = Aws::Lambda::Client.new() -$client.get_account_settings() - -require 'aws-xray-sdk/lambda' - -def lambda_handler(event:, context:) - logger = Logger.new($stdout) - ... -``` - -When using active tracing, Lambda records 2 segments per trace, which creates two nodes on the service graph\. The following image highlights these two nodes for the primary function from the error processor example above\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/xray-servicemap-function.png) - -The first node on the left represents the Lambda service, which receives the invocation request\. The second node represents your specific Lambda function\. The following example shows a trace with these two segments\. Both are named **my\-function**, but one has an origin of `AWS::Lambda` and the other has origin `AWS::Lambda::Function`\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/nodejs-xray-timeline.png) - -This example expands the function segment to show its three subsegments: -+ **Initialization** – Represents time spent loading your function and running [initialization code](foundation-progmodel.md)\. This subsegment only appears for the first event that each instance of your function processes\. -+ **Invocation** – Represents the time spent running your handler code\. -+ **Overhead** – Represents the time the Lambda runtime spends preparing to handle the next event\. - -You can also instrument HTTP clients, record SQL queries, and create custom subsegments with annotations and metadata\. For more information, see [The X\-Ray SDK for Ruby](https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-ruby.html) in the AWS X\-Ray Developer Guide\. - -**Topics** -+ [Enabling active tracing with the Lambda API](#ruby-tracing-api) -+ [Enabling active tracing with AWS CloudFormation](#ruby-tracing-cloudformation) -+ [Storing runtime dependencies in a layer](#ruby-tracing-layers) - -## Enabling active tracing with the Lambda API - -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Enabling active tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` - -## Storing runtime dependencies in a layer - -If you use the X\-Ray SDK to instrument AWS SDK clients your function code, your deployment package can become quite large\. To avoid uploading runtime dependencies every time you update your function code, package the X\-Ray SDK in a [Lambda layer](configuration-layers.md)\. - -The following example shows an `AWS::Serverless::LayerVersion` resource that stores X\-Ray SDK for Ruby\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby/template.yml) – Dependencies layer** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - CodeUri: function/. - Tracing: Active - Layers: - - !Ref libs - ... - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-ruby-lib - Description: Dependencies for the blank-ruby sample app. - ContentUri: lib/. - CompatibleRuntimes: - - ruby2.5 -``` - -With this configuration, you update the library layer only if you change your runtime dependencies\. Since the function deployment package contains only your code, this can help reduce upload times\. - -Creating a layer for dependencies requires build changes to generate the layer archive prior to deployment\. For a working example, see the [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby) sample application\. \ No newline at end of file diff --git a/doc_source/runtimes-api.md b/doc_source/runtimes-api.md deleted file mode 100644 index 69cc6f2d..00000000 --- a/doc_source/runtimes-api.md +++ /dev/null @@ -1,192 +0,0 @@ -# AWS Lambda runtime API - -AWS Lambda provides an HTTP API for [custom runtimes](runtimes-custom.md) to receive invocation events from Lambda and send response data back within the Lambda [execution environment](lambda-runtimes.md)\. - -![\[Architecture diagram of the execution environment.\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) - -The OpenAPI specification for the runtime API version **2018\-06\-01** is available in [runtime\-api\.zip](samples/runtime-api.zip) - -To create an API request URL, runtimes get the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable, add the API version, and add the desired resource path\. - -**Example Request** - -``` -curl "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next" -``` - -**Topics** -+ [Next invocation](#runtimes-api-next) -+ [Invocation response](#runtimes-api-response) -+ [Initialization error](#runtimes-api-initerror) -+ [Invocation error](#runtimes-api-invokeerror) - -## Next invocation - -**Path** – `/runtime/invocation/next` - -**Method** – **GET** - -The runtime sends this message to Lambda to request an invocation event\. The response body contains the payload from the invocation, which is a JSON document that contains event data from the function trigger\. The response headers contain additional data about the invocation\. - -**Response headers** -+ `Lambda-Runtime-Aws-Request-Id` – The request ID, which identifies the request that triggered the function invocation\. - - For example, `8476a536-e9f4-11e8-9739-2dfe598c3fcd`\. -+ `Lambda-Runtime-Deadline-Ms` – The date that the function times out in Unix time milliseconds\. - - For example, `1542409706888`\. -+ `Lambda-Runtime-Invoked-Function-Arn` – The ARN of the Lambda function, version, or alias that's specified in the invocation\. - - For example, `arn:aws:lambda:us-east-2:123456789012:function:custom-runtime`\. -+ `Lambda-Runtime-Trace-Id` – The [AWS X\-Ray tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader)\. - - For example, `Root=1-5bef4de7-ad49b0e87f6ef6c87fc2e700;Parent=9a9197af755a6419;Sampled=1`\. -+ `Lambda-Runtime-Client-Context` – For invocations from the AWS Mobile SDK, data about the client application and device\. -+ `Lambda-Runtime-Cognito-Identity` – For invocations from the AWS Mobile SDK, data about the Amazon Cognito identity provider\. - -Do not set a timeout on the `GET` request as the response may be delayed\. Between when Lambda bootstraps the runtime and when the runtime has an event to return, the runtime process may be frozen for several seconds\. - -The request ID tracks the invocation within Lambda\. Use it to specify the invocation when you send the response\. - -The tracing header contains the trace ID, parent ID, and sampling decision\. If the request is sampled, the request was sampled by Lambda or an upstream service\. The runtime should set the `_X_AMZN_TRACE_ID` with the value of the header\. The X\-Ray SDK reads this to get the IDs and determine whether to trace the request\. - -## Invocation response - -**Path** – `/runtime/invocation/AwsRequestId/response` - -**Method** – **POST** - -After the function has run to completion, the runtime sends an invocation response to Lambda\. For synchronous invocations, Lambda sends the response to the client\. - -**Example success request** - -``` -REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 -curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "SUCCESS" -``` - -## Initialization error - -If the function returns an error or the runtime encounters an error during initialization, the runtime uses this method to report the error to Lambda\. - -**Path** – `/runtime/init/error` - -**Method** – **POST** - -**Headers** - -`Lambda-Runtime-Function-Error-Type` – Error type that the runtime encountered\. Required: no\. - -This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Runtime\.NoSuchHandler -+ Runtime\.APIKeyNotFound -+ Runtime\.ConfigInvalid -+ Runtime\.UnknownReason - -**Body parameters** - -`ErrorRequest` – Information about the error\. Required: no\. - -This field is a JSON object with the following structure: - -``` -{ - errorMessage: string (text description of the error), - errorType: string, - stackTrace: array of strings -} -``` - -Note that Lambda accepts any value for `errorType`\. - -The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. - -**Example Function error** - -``` -{ - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException", - "stackTrace": [ ] -} -``` - -**Response body parameters** -+ `StatusResponse` – String\. Status information, sent with 202 response codes\. -+ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. - -**Response codes** -+ 202 – Accepted -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Runtime should exit promptly\. - -**Example initialization error request** - -``` -ERROR="{\"errorMessage\" : \"Failed to load function.\", \"errorType\" : \"InvalidFunctionException\"}" -curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/init/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" -``` - -## Invocation error - -If the function returns an error or the runtime encounters an error, the runtime uses this method to report the error to Lambda\. - -**Path** – `/runtime/invocation/AwsRequestId/error` - -**Method** – **POST** - -**Headers** - -`Lambda-Runtime-Function-Error-Type` – Error type that the runtime encountered\. Required: no\. - -This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Runtime\.NoSuchHandler -+ Runtime\.APIKeyNotFound -+ Runtime\.ConfigInvalid -+ Runtime\.UnknownReason - -**Body parameters** - -`ErrorRequest` – Information about the error\. Required: no\. - -This field is a JSON object with the following structure: - -``` -{ - errorMessage: string (text description of the error), - errorType: string, - stackTrace: array of strings -} -``` - -Note that Lambda accepts any value for `errorType`\. - -The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. - -**Example Function error** - -``` -{ - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException", - "stackTrace": [ ] -} -``` - -**Response body parameters** -+ `StatusResponse` – String\. Status information, sent with 202 response codes\. -+ `ErrorResponse` – Additional error information, sent with the error response codes\. ErrorResponse contains an error type and an error message\. - -**Response codes** -+ 202 – Accepted -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Runtime should exit promptly\. - -**Example error request** - -``` -REQUEST_ID=156cb537-e2d4-11e8-9b34-d36013741fb9 -ERROR="{\"errorMessage\" : \"Error parsing event data.\", \"errorType\" : \"InvalidEventDataException\"}" -curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/error" -d "$ERROR" --header "Lambda-Runtime-Function-Error-Type: Unhandled" -``` \ No newline at end of file diff --git a/doc_source/runtimes-avx2.md b/doc_source/runtimes-avx2.md deleted file mode 100644 index b68b7491..00000000 --- a/doc_source/runtimes-avx2.md +++ /dev/null @@ -1,65 +0,0 @@ -# Using AVX2 vectorization in Lambda - -Advanced Vector Extensions 2 \(AVX2\) is a vectorization extension to the Intel x86 instruction set that can perform single instruction multiple data \(SIMD\) instructions over vectors of 256 bits\. For vectorizable algorithms with [highly parallelizable](https://en.wikipedia.org/wiki/Massively_parallel) operation, using AVX2 can enhance CPU performance, resulting in lower latencies and higher throughput\. Use the AVX2 instruction set for compute\-intensive workloads such as machine learning inferencing, multimedia processing, scientific simulations, and financial modeling applications\. - -**Note** -Lambda arm64 uses NEON SIMD architecture and does not support the x86 AVX2 extensions\. - -To use AVX2 with your Lambda function, make sure that your function code is accessing AVX2\-optimized code\. For some languages, you can install the AVX2\-supported version of libraries and packages\. For other languages, you can recompile your code and dependencies with the appropriate compiler flags set \(if the compiler supports auto\-vectorization\)\. You can also compile your code with third\-party libraries that use AVX2 to optimize math operations\. For example, Intel Math Kernel Library \(Intel MKL\), OpenBLAS \(Basic Linear Algebra Subprograms\), and AMD BLAS\-like Library Instantiation Software \(BLIS\)\. Auto\-vectorized languages, such as Java, automatically use AVX2 for computations\. - -You can create new Lambda workloads or move existing AVX2\-enabled workloads to Lambda at no additional cost\. - -For more information about AVX2, see [Advanced Vector Extensions 2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) in Wikipedia\. - -## Compiling from source - -If your Lambda function uses a C or C\+\+ library to perform compute\-intensive vectorizable operations, you can set the appropriate compiler flags and recompile the function code\. Then, the compiler automatically vectorizes your code\. - -For the `gcc` or `clang` compiler, add `-march=haswell` to the command or set `-mavx2` as a command option\. - -``` -~ gcc -march=haswell main.c -or -~ gcc -mavx2 main.c - -~ clang -march=haswell main.c -or -~ clang -mavx2 main.c -``` - -To use a specific library, follow instructions in the library's documentation to compile and build the library\. For example, to build TensorFlow from source, you can follow the [ installation instructions](https://www.tensorflow.org/install/source) on the TensorFlow website\. Make sure to use the `-march=haswell` compile option\. - -## Enabling AVX2 for Intel MKL - -Intel MKL is a library of optimized math operations that implicitly use AVX2 instructions when the compute platform supports them\. Frameworks such as PyTorch [build with Intel MKL by default](https://software.intel.com/content/www/us/en/develop/articles/getting-started-with-intel-optimization-of-pytorch.html), so you don't need to enable AVX2\. - -Some libraries, such as TensorFlow, provide options in their build process to specify Intel MKL optimization\. For example, with TensorFlow, use the `--config=mkl` option\. - -You can also build popular scientific Python libraries, such as SciPy and NumPy, with Intel MKL\. For instructions on building these libraries with Intel MKL, see [Numpy/Scipy with Intel MKL and Intel Compilers](https://software.intel.com/content/www/us/en/develop/articles/numpyscipy-with-intel-mkl.html) on the Intel website\. - -For more information about Intel MKL and similar libraries, see [Math Kernel Library](https://en.wikipedia.org/wiki/Math_Kernel_Library) in Wikipedia, the [OpenBLAS website](https://www.openblas.net/), and the [AMD BLIS repository](https://github.com/amd/blis) on GitHub\. - -## AVX2 support in other languages - -If you don't use C or C\+\+ libraries and don't build with Intel MKL, you can still get some AVX2 performance improvement for your applications\. Note that the actual improvement depends on the compiler or interpreter's ability to utilize the AVX2 capabilities on your code\. - - - -Python -Python users generally use SciPy and NumPy libraries for compute\-intensive workloads\. You can compile these libraries to enable AVX2, or you can use the Intel MKL\-enabled versions of the libraries\. - -Node -For compute\-intensive workloads, use AVX2\-enabled or Intel MKL\-enabled versions of the libraries that you need\. - -Java -Java's JIT compiler can auto\-vectorize your code to run with AVX2 instructions\. For information about detecting vectorized code, see the [Code vectorization in the JVM](https://cr.openjdk.java.net/~vlivanov/talks/2019_CodeOne_MTE_Vectors.pdf) presentation on the OpenJDK website\. - -Go -The standard Go compiler doesn't currently support auto\-vectorization, but you can use [gccgo](https://golang.org/doc/install/gccgo), the GCC compiler for Go\. Set the `-mavx2` option: - -``` -gcc -o avx2 -mavx2 -Wall main.c -``` - -Intrinsics -It's possible to use [intrinsic functions](https://en.wikipedia.org/wiki/Intrinsic_function) in many languages to manually vectorize your code to use AVX2\. However, we don't recommend this approach\. Manually writing vectorized code takes significant effort\. Also, debugging and maintaining such code is more difficult than using code that depends on auto\-vectorization\. \ No newline at end of file diff --git a/doc_source/runtimes-custom.md b/doc_source/runtimes-custom.md deleted file mode 100644 index 06960cfd..00000000 --- a/doc_source/runtimes-custom.md +++ /dev/null @@ -1,72 +0,0 @@ -# Custom AWS Lambda runtimes - -You can implement an AWS Lambda runtime in any programming language\. A runtime is a program that runs a Lambda function's handler method when the function is invoked\. You can include a runtime in your function's deployment package in the form of an executable file named `bootstrap`\. - -A runtime is responsible for running the function's setup code, reading the handler name from an environment variable, and reading invocation events from the Lambda runtime API\. The runtime passes the event data to the function handler, and posts the response from the handler back to Lambda\. - -Your custom runtime runs in the standard Lambda [execution environment](lambda-runtimes.md)\. It can be a shell script, a script in a language that's included in Amazon Linux, or a binary executable file that's compiled in Amazon Linux\. - -To get started with custom runtimes, see [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md)\. You can also explore a custom runtime implemented in C\+\+ at [awslabs/aws\-lambda\-cpp](https://github.com/awslabs/aws-lambda-cpp) on GitHub\. - -**Topics** -+ [Using a custom runtime](#runtimes-custom-use) -+ [Building a custom runtime](#runtimes-custom-build) - -## Using a custom runtime - -To use a custom runtime, set your function's runtime to `provided`\. The runtime can be included in your function's deployment package, or in a [layer](configuration-layers.md)\. - -**Example function\.zip** - -``` -. -├── bootstrap -├── function.sh -``` - -If there's a file named `bootstrap` in your deployment package, Lambda runs that file\. If not, Lambda looks for a runtime in the function's layers\. If the bootstrap file isn't found or isn't executable, your function returns an error upon invocation\. - -## Building a custom runtime - -A custom runtime's entry point is an executable file named `bootstrap`\. The bootstrap file can be the runtime, or it can invoke another file that creates the runtime\. The following example uses a bundled version of Node\.js to run a JavaScript runtime in a separate file named `runtime.js`\. - -**Example bootstrap** - -``` -#!/bin/sh -cd $LAMBDA_TASK_ROOT -./node-v11.1.0-linux-x64/bin/node runtime.js -``` - -Your runtime code is responsible for completing some initialization tasks\. Then it processes invocation events in a loop until it's terminated\. The initialization tasks run once [per instance of the function](lambda-runtime-environment.md) to prepare the environment to handle invocations\. - -**Initialization tasks** -+ **Retrieve settings** – Read environment variables to get details about the function and environment\. - + `_HANDLER` – The location to the handler, from the function's configuration\. The standard format is `file.method`, where `file` is the name of the file without an extension, and `method` is the name of a method or function that's defined in the file\. - + `LAMBDA_TASK_ROOT` – The directory that contains the function code\. - + `AWS_LAMBDA_RUNTIME_API` – The host and port of the runtime API\. - - See [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime) for a full list of available variables\. -+ **Initialize the function** – Load the handler file and run any global or static code that it contains\. Functions should create static resources like SDK clients and database connections once, and reuse them for multiple invocations\. -+ **Handle errors** – If an error occurs, call the [initialization error](runtimes-api.md#runtimes-api-initerror) API and exit immediately\. - -Initialization counts towards billed execution time and timeout\. When an execution triggers the initialization of a new instance of your function, you can see the initialization time in the logs and [AWS X\-Ray trace](services-xray.md)\. - -**Example log** - -``` -REPORT RequestId: f8ac1208... Init Duration: 48.26 ms Duration: 237.17 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 26 MB -``` - -While it runs, a runtime uses the [Lambda runtime interface](runtimes-api.md) to manage incoming events and report errors\. After completing initialization tasks, the runtime processes incoming events in a loop\. In your runtime code, perform the following steps in order\. - -**Processing tasks** -+ **Get an event** – Call the [next invocation](runtimes-api.md#runtimes-api-next) API to get the next event\. The response body contains the event data\. Response headers contain the request ID and other information\. -+ **Propagate the tracing header** – Get the X\-Ray tracing header from the `Lambda-Runtime-Trace-Id` header in the API response\. Set the `_X_AMZN_TRACE_ID` environment variable locally with the same value\. The X\-Ray SDK uses this value to connect trace data between services\. -+ **Create a context object** – Create an object with context information from environment variables and headers in the API response\. -+ **Invoke the function handler** – Pass the event and context object to the handler\. -+ **Handle the response** – Call the [invocation response](runtimes-api.md#runtimes-api-response) API to post the response from the handler\. -+ **Handle errors** – If an error occurs, call the [invocation error](runtimes-api.md#runtimes-api-invokeerror) API\. -+ **Cleanup** – Release unused resources, send data to other services, or perform additional tasks before getting the next event\. - -You can include the runtime in your function's deployment package, or distribute the runtime separately in a function layer\. For an example walkthrough, see [Tutorial – Publishing a custom runtime](runtimes-walkthrough.md)\. \ No newline at end of file diff --git a/doc_source/runtimes-extensions-api.md b/doc_source/runtimes-extensions-api.md deleted file mode 100644 index c09138da..00000000 --- a/doc_source/runtimes-extensions-api.md +++ /dev/null @@ -1,380 +0,0 @@ -# Lambda Extensions API - -Lambda function authors use extensions to integrate Lambda with their preferred tools for monitoring, observability, security, and governance\. Function authors can use extensions from AWS, [AWS Partners](extensions-api-partners.md), and open\-source projects\. For more information on using extensions, see [Introducing AWS Lambda Extensions](http://aws.amazon.com/blogs/aws/getting-started-with-using-your-favorite-operational-tools-on-aws-lambda-extensions-are-now-generally-available/) on the AWS Compute Blog\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-concept-diagram.png) - -As an extension author, you can use the Lambda Extensions API to integrate deeply into the Lambda [execution environment](lambda-runtime-environment.md)\. Your extension can register for function and execution environment lifecycle events\. In response to these events, you can start new processes, run logic, and control and participate in all phases of the Lambda lifecycle: initialization, invocation, and shutdown\. In addition, you can use the [Runtime Logs API](runtimes-logs-api.md) to receive a stream of logs\. - -An extension runs as an independent process in the execution environment and can continue to run after the function invocation is fully processed\. Because extensions run as processes, you can write them in a different language than the function\. We recommend that you implement extensions using a compiled language\. In this case, the extension is a self\-contained binary that is compatible with supported runtimes\. All [Lambda runtimes](lambda-runtimes.md) support extensions\. If you use a non\-compiled language, ensure that you include a compatible runtime in the extension\. - -Lambda also supports *internal extensions*\. An internal extension runs as a separate thread in the runtime process\. The runtime starts and stops the internal extension\. An alternative way to integrate with the Lambda environment is to use language\-specific [environment variables and wrapper scripts](runtimes-modify.md)\. You can use these to configure the runtime environment and modify the startup behavior of the runtime process\. - -You can add extensions to a function in two ways\. For a function deployed as a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip), you deploy your extension as a [layer](configuration-layers.md)\. For a function defined as a container image, you add [the extensions](extensions-configuration.md#invocation-extensions-images) to your container image\. - -**Note** -For example extensions and wrapper scripts, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. - -**Topics** -+ [Lambda execution environment lifecycle](#runtimes-extensions-api-lifecycle) -+ [Extensions API reference](#runtimes-extensions-registration-api) - -## Lambda execution environment lifecycle - -The lifecycle of the execution environment includes the following phases: -+ `Init`: In this phase, Lambda creates or unfreezes an execution environment with the configured resources, downloads the code for the function and all layers, initializes any extensions, initializes the runtime, and then runs the function’s initialization code \(the code outside the main handler\)\. The `Init` phase happens either during the first invocation, or in advance of function invocations if you have enabled [provisioned concurrency](provisioned-concurrency.md)\. - - The `Init` phase is split into three sub\-phases: `Extension init`, `Runtime init`, and `Function init`\. These sub\-phases ensure that all extensions and the runtime complete their setup tasks before the function code runs\. -+ `Invoke`: In this phase, Lambda invokes the function handler\. After the function runs to completion, Lambda prepares to handle another function invocation\. -+ `Shutdown`: This phase is triggered if the Lambda function does not receive any invocations for a period of time\. In the `Shutdown` phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment\. Lambda sends a `Shutdown` event to each extension, which tells the extension that the environment is about to be shut down\. - -Each phase starts with an event from Lambda to the runtime and to all registered extensions\. The runtime and each extension signal completion by sending a `Next` API request\. Lambda freezes the execution environment when each process has completed and there are no pending events\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Full-Sequence.png) - - - -**Topics** -+ [Init phase](#runtimes-extensions-api-reg) -+ [Invoke phase](#runtimes-lifecycle-invoke) -+ [Shutdown phase](#runtimes-lifecycle-shutdown) -+ [Permissions and configuration](#runtimes-extensions-registration-api-e) -+ [Failure handling](#runtimes-extensions-api-failure) -+ [Troubleshooting extensions](#runtimes-extensions-api-trbl) - -### Init phase - -During the `Extension init` phase, each extension needs to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. - -You can register up to 10 extensions for a function\. This limit is enforced through the `Register` API call\. - -After each extension registers, Lambda starts the `Runtime init` phase\. The runtime process calls `functionInit` to start the `Function init` phase\. - -The `Init` phase completes after the runtime and each registered extension indicate completion by sending a `Next` API request\. - -**Note** -Extensions can complete their initialization at any point in the `Init` phase\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Init-Phase.png) - -### Invoke phase - -When a Lambda function is invoked in response to a `Next` API request, Lambda sends an `Invoke` event to the runtime and to each extension that is registered for the `Invoke` event\. - -During the invocation, external extensions run in parallel with the function\. They also continue running after the function has completed\. This enables you to capture diagnostic information or to send logs, metrics, and traces to a location of your choice\. - -After receiving the function response from the runtime, Lambda returns the response to the client, even if extensions are still running\. - -The `Invoke` phase ends after the runtime and all extensions signal that they are done by sending a `Next` API request\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Invoke-Phase.png) - -**Event payload**: The event sent to the runtime \(and the Lambda function\) carries the entire request, headers \(such as `RequestId`\), and payload\. The event sent to each extension contains metadata that describes the event content\. This lifecycle event includes the type of the event, the time that the function times out \(`deadlineMs`\), the `requestId`, the invoked function's Amazon Resource Name \(ARN\), and tracing headers\. - -Extensions that want to access the function event body can use an in\-runtime SDK that communicates with the extension\. Function developers use the in\-runtime SDK to send the payload to the extension when the function is invoked\. - -Here is an example payload: - -``` -{ - "eventType": "INVOKE", - "deadlineMs": 676051, - "requestId": "3da1f2dc-3222-475e-9205-e2e6c6318895", - "invokedFunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:ExtensionTest", - "tracing": { - "type": "X-Amzn-Trace-Id", - "value": "Root=1-5f35ae12-0c0fec141ab77a00bc047aa2;Parent=2be948a625588e32;Sampled=1" - } - } -``` - -**Duration limit**: The function's timeout setting limits the duration of the entire `Invoke` phase\. For example, if you set the function timeout as 360 seconds, the function and all extensions need to complete within 360 seconds\. Note that there is no independent post\-invoke phase\. The duration is the sum of all invocation time \(runtime \+ extensions\) and is not calculated until the function and all extensions have finished running\. - -**Performance impact and extension overhead**: Extensions can impact function performance\. As an extension author, you have control over the performance impact of your extension\. For example, if your extension performs compute\-intensive operations, the function's duration increases because the extension and the function code share the same CPU resources\. In addition, if your extension performs extensive operations after the function invocation completes, the function duration increases because the `Invoke` phase continues until all extensions signal that they are completed\. - -**Note** -Lambda allocates CPU power in proportion to the function's memory setting\. You might see increased execution and initialization duration at lower memory settings because the function and extension processes are competing for the same CPU resources\. To reduce the execution and initialization duration, try increasing the memory setting\. - -To help identify the performance impact introduced by extensions on the `Invoke` phase, Lambda outputs the `PostRuntimeExtensionsDuration` metric\. This metric measures the cumulative time spent between the runtime `Next` API request and the last extension `Next` API request\. To measure the increase in memory used, use the `MaxMemoryUsed` metric\. For more information about function metrics, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -Function developers can run different versions of their functions side by side to understand the impact of a specific extension\. We recommend that extension authors publish expected resource consumption to make it easier for function developers to choose a suitable extension\. - -### Shutdown phase - -When Lambda is about to shut down the runtime, it sends a `Shutdown` to each registered external extension\. Extensions can use this time for final cleanup tasks\. The `Shutdown` event is sent in response to a `Next` API request\. - -**Duration limit**: The maximum duration of the `Shutdown` phase depends on the configuration of registered extensions: -+ 0 ms – A function with no registered extensions -+ 500 ms – A function with a registered internal extension -+ 2,000 ms – A function with one or more registered external extensions - -For a function with external extensions, Lambda reserves up to 300 ms \(500 ms for a runtime with an internal extension\) for the runtime process to perform a graceful shutdown\. Lambda allocates the remainder of the 2,000 ms limit for external extensions to shut down\. - -If the runtime or an extension does not respond to the `Shutdown` event within the limit, Lambda ends the process using a `SIGKILL` signal\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Shutdown-Phase.png) - -**Event payload**: The `Shutdown` event contains the reason for the shutdown and the time remaining in milliseconds\. - - The `shutdownReason` includes the following values: -+ SPINDOWN – Normal shutdown -+ TIMEOUT – Duration limit timed out -+ FAILURE – Error condition, such as an `out-of-memory` event - -``` -{ - "eventType": "SHUTDOWN", - "shutdownReason": "reason for shutdown", - "deadlineMs": "the time and date that the function times out in Unix time milliseconds" -} -``` - -### Permissions and configuration - -Extensions run in the same execution environment as the Lambda function\. Extensions also share resources with the function, such as CPU, memory, and `/tmp` disk storage\. In addition, extensions use the same AWS Identity and Access Management \(IAM\) role and security context as the function\. - -**File system and network access permissions**: Extensions run in the same file system and network name namespace as the function runtime\. This means that extensions need to be compatible with the associated operating system\. If an extension requires any additional outbound network traffic rules, you must apply these rules to the function configuration\. - -**Note** -Because the function code directory is read\-only, extensions cannot modify the function code\. - -**Environment variables**: Extensions can access the function's [environment variables](configuration-envvars.md), except for the following variables that are specific to the runtime process: -+ `AWS_EXECUTION_ENV` -+ `AWS_LAMBDA_LOG_GROUP_NAME` -+ `AWS_LAMBDA_LOG_STREAM_NAME` -+ `AWS_XRAY_CONTEXT_MISSING` -+ `AWS_XRAY_DAEMON_ADDRESS` -+ `LAMBDA_RUNTIME_DIR` -+ `LAMBDA_TASK_ROOT` -+ `_AWS_XRAY_DAEMON_ADDRESS` -+ `_AWS_XRAY_DAEMON_PORT` -+ `_HANDLER` - -### Failure handling - -**Initialization failures**: If an extension fails, Lambda restarts the execution environment to enforce consistent behavior and to encourage fail fast for extensions\. Also, for some customers, the extensions must meet mission\-critical needs such as logging, security, governance, and telemetry collection\. - -**Invoke failures** \(such as out of memory, function timeout\): Because extensions share resources with the runtime, memory exhaustion affects them\. When the runtime fails, all extensions and the runtime itself participate in the `Shutdown` phase\. In addition, the runtime is restarted—either automatically as part of the current invocation, or via a deferred re\-initialization mechanism\. - -If there is a failure \(such as a function timeout or runtime error\) during `Invoke`, the Lambda service performs a reset\. The reset behaves like a `Shutdown` event\. First, Lambda shuts down the runtime, then it sends a `Shutdown` event to each registered external extension\. The event includes the reason for the shutdown\. If this environment is used for a new invocation, the extension and runtime are re\-initialized as part of the next invocation\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/Overview-Invoke-with-Error.png) - -**Extension logs**: Lambda sends the log output of extensions to CloudWatch Logs\. Lambda also generates an additional log event for each extension during `Init`\. The log event records the name and registration preference \(event, config\) on success, or the failure reason on failure\. - -### Troubleshooting extensions -+ If a `Register` request fails, make sure that the `Lambda-Extension-Name` header in the `Register` API call contains the full file name of the extension\. -+ If the `Register` request fails for an internal extension, make sure that the request does not register for the `Shutdown` event\. - -## Extensions API reference - -The OpenAPI specification for the extensions API version **2020\-01\-01** is available here: [extensions\-api\.zip](samples/extensions-api.zip) - -You can retrieve the value of the API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send a `Register` request, use the prefix `2020-01-01/` before each API path\. For example: - -``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register -``` - -**Topics** -+ [Register](#extensions-registration-api-a) -+ [Next](#extensions-api-next) -+ [Init error](#runtimes-extensions-init-error) -+ [Exit error](#runtimes-extensions-exit-error) - -### Register - -During `Extension init`, all extensions need to register with Lambda to receive events\. Lambda uses the full file name of the extension to validate that the extension has completed the bootstrap sequence\. Therefore, each `Register` API call must include the `Lambda-Extension-Name` header with the full file name of the extension\. - -Internal extensions are started and stopped by the runtime process, so they are not permitted to register for the `Shutdown` event\. - -**Path** – `/extension/register` - -**Method** – **POST** - -**Headers** -+ `Lambda-Extension-Name` – The full file name of the extension\. Required: yes\. Type: string\. -+ `Lambda-Extension-Accept-Feature` – Use this to specify optional Extensions features during registration\. Required: no\. Type: comma separated string\. Features available to specify using this setting: - + `accountId` – If specified, the Extension registration response will contain the account ID associated with the Lambda function that you're registering the Extension for\. - -**Body parameters ** - -`events` – Array of the events to register for\. Required: no\. Type: array of strings\. Valid strings: `INVOKE`, `SHUTDOWN`\. - -**Response headers** -+ `Lambda-Extension-Identifier` – Generated unique agent identifier \(UUID string\) that is required for all subsequent requests\. - -**Response codes** -+ 200 – Response body contains the function name, function version, and handler name\. -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - -**Example request body** - -``` -{ - 'events': [ 'INVOKE', 'SHUTDOWN'] -} -``` - -**Example response body** - -``` -{ - "functionName": "helloWorld", - "functionVersion": "$LATEST", - "handler": "lambda_function.lambda_handler" -} -``` - -**Example response body with optional accountId feature** - -``` -{ - "functionName": "helloWorld", - "functionVersion": "$LATEST", - "handler": "lambda_function.lambda_handler", - "accountId": "123456789012" -} -``` - -### Next - -Extensions send a `Next` API request to receive the next event, which can be an `Invoke` event or a `Shutdown` event\. The response body contains the payload, which is a JSON document that contains event data\. - -The extension sends a `Next` API request to signal that it is ready to receive new events\. This is a blocking call\. - -Do not set a timeout on the GET call, as the extension can be suspended for a period of time until there is an event to return\. - -**Path** – `/extension/event/next` - -**Method** – **GET** - -**Parameters** - -`Lambda-Extension-Identifier` – Unique identifier for extension \(UUID string\)\. Required: yes\. Type: UUID string\. - -**Response header** -+ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. - -**Response codes** -+ 200 – Response contains information about the next event \(`EventInvoke` or `EventShutdown`\)\. -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - -### Init error - -The extension uses this method to report an initialization error to Lambda\. Call it when the extension fails to initialize after it has registered\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. - -**Path** – `/extension/init/error` - -**Method** – **POST** - -**Headers** - -`Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. - -`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. - -This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Extension\.NoSuchHandler -+ Extension\.APIKeyNotFound -+ Extension\.ConfigInvalid -+ Extension\.UnknownReason - -**Body parameters** - -`ErrorRequest` – Information about the error\. Required: no\. - -This field is a JSON object with the following structure: - -``` -{ - errorMessage: string (text description of the error), - errorType: string, - stackTrace: array of strings -} -``` - -Note that Lambda accepts any value for `errorType`\. - -The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. - -**Example Function error** - -``` -{ - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException", - "stackTrace": [ ] -} -``` - -**Response body** -+ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. - -**Response codes** -+ 202 – Accepted -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - -### Exit error - -The extension uses this method to report an error to Lambda before exiting\. Call it when you encounter an unexpected failure\. After Lambda receives the error, no further API calls succeed\. The extension should exit after it receives the response from Lambda\. - -**Path** – `/extension/exit/error` - -**Method** – **POST** - -**Headers** - -`Lambda-Extension-Identifier` – Unique identifier for extension\. Required: yes\. Type: UUID string\. - -`Lambda-Extension-Function-Error-Type` – Error type that the extension encountered\. Required: yes\. - -This header consists of a string value\. Lambda accepts any string, but we recommend a format of \. For example: -+ Extension\.NoSuchHandler -+ Extension\.APIKeyNotFound -+ Extension\.ConfigInvalid -+ Extension\.UnknownReason - -**Body parameters** - -`ErrorRequest` – Information about the error\. Required: no\. - -This field is a JSON object with the following structure: - -``` -{ - errorMessage: string (text description of the error), - errorType: string, - stackTrace: array of strings -} -``` - -Note that Lambda accepts any value for `errorType`\. - -The following example shows a Lambda function error message in which the function could not parse the event data provided in the invocation\. - -**Example Function error** - -``` -{ - "errorMessage" : "Error parsing event data.", - "errorType" : "InvalidEventDataException", - "stackTrace": [ ] -} -``` - -**Response body** -+ `Lambda-Extension-Identifier` – Unique agent identifier \(UUID string\)\. - -**Response codes** -+ 202 – Accepted -+ 400 – Bad Request -+ 403 – Forbidden -+ 500 – Container error\. Non\-recoverable state\. Extension should exit promptly\. - - \ No newline at end of file diff --git a/doc_source/runtimes-images.md b/doc_source/runtimes-images.md deleted file mode 100644 index 7cd507e9..00000000 --- a/doc_source/runtimes-images.md +++ /dev/null @@ -1,56 +0,0 @@ -# Base images for Lambda - -AWS provides a set of open\-source base images that you can use\. You can also use a preferred community or private base image\. Lambda provides client software that you add to your preferred base image to make it compatible with the Lambda service\. - -**Note** -Each base image is compatible with one or more of the instruction set architectures that Lambda supports\. You need to build the function image for only one architecture\. Lambda does not support multi\-architecture images\. - -**Topics** -+ [AWS base images for Lambda](#runtimes-images-lp) -+ [Base images for custom runtimes](#runtimes-images-custom) -+ [Runtime interface clients](#runtimes-api-client) -+ [Runtime interface emulator](#runtimes-test-emulator) - -## AWS base images for Lambda - -You can use one of the AWS base images for Lambda to build the container image for your function code\. The base images are preloaded with a language runtime and other components required to run a container image on Lambda\. You add your function code and dependencies to the base image and then package it as a container image\. - -AWS will maintain and regularly update these images\. In addition, AWS will release AWS base images when any new managed runtime becomes available\. - -Lambda provides base images for the following runtimes: -+ [Node\.js](nodejs-image.md) -+ [Python](python-image.md) -+ [Java](java-image.md) -+ [\.NET](csharp-image.md) -+ [Go](go-image.md) -+ [Ruby](ruby-image.md) - -## Base images for custom runtimes - -AWS provides base images that contain the required Lambda components and the Amazon Linux or Amazon Linux2 operating system\. You can add your preferred runtime, dependencies and code to these images\. - - -| Tags | Runtime | Operating system | -| --- | --- | --- | -| al2 | provided\.al2 | Amazon Linux 2 | -| alami | provided | Amazon Linux | - -Amazon ECR Public Gallery: [gallery\.ecr\.aws/lambda/provided](https://gallery.ecr.aws/lambda/provided) - -## Runtime interface clients - -The runtime interface client in your container image manages the interaction between Lambda and your function code\. The [Runtime API](runtimes-api.md), along with the [ Extensions API](runtimes-extensions-api.md), defines a simple HTTP interface for runtimes to receive invocation events from Lambda and respond with success or failure indications\. - -Each of the AWS base images for Lambda include a runtime interface client\. If you choose one of the base images for custom runtimes or an alternative base image, you need to add the appropriate runtime interface client\. - -For your convenience, Lambda provides an open source runtime interface client for each of the supported Lambda runtimes: -+ [Node\.js](nodejs-image.md#nodejs-image-clients) -+ [Python](python-image.md#python-image-clients) -+ [Java](java-image.md#java-image-clients) -+ [\.NET](csharp-image.md#csharp-image-clients) -+ [Go](go-image.md#go-image-clients) -+ [Ruby](ruby-image.md#ruby-image-clients) - -## Runtime interface emulator - -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The AWS base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the [Runtime interface emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie) from the AWS GitHub repository\. diff --git a/doc_source/runtimes-logs-api.md b/doc_source/runtimes-logs-api.md deleted file mode 100644 index 02953e21..00000000 --- a/doc_source/runtimes-logs-api.md +++ /dev/null @@ -1,332 +0,0 @@ -# Lambda Logs API - -**Important** -The Lambda Telemetry API supersedes the Lambda Logs API\. **While the Logs API remains fully functional, we recommend using only the Telemetry API going forward\.** You can subscribe your extension to a telemetry stream using either the Telemetry API or the Logs API\. After subscribing using one of these APIs, any attempt to subscribe using the other API returns an error\. - -Lambda automatically captures runtime logs and streams them to Amazon CloudWatch\. This log stream contains the logs that your function code and extensions generate, and also the logs that Lambda generates as part of the function invocation\. - -[Lambda extensions](runtimes-extensions-api.md) can use the Lambda Runtime Logs API to subscribe to log streams directly from within the Lambda [execution environment](lambda-runtime-environment.md)\. Lambda streams the logs to the extension, and the extension can then process, filter, and send the logs to any preferred destination\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/logs-api-concept-diagram.png) - -The Logs API allows extensions to subscribe to three different logs streams: -+ Function logs that the Lambda function generates and writes to `stdout` or `stderr`\. -+ Extension logs that extension code generates\. -+ Lambda platform logs, which record events and errors related to invocations and extensions\. - -**Note** -Lambda sends all logs to CloudWatch, even when an extension subscribes to one or more of the log streams\. - -**Topics** -+ [Subscribing to receive logs](#runtimes-logs-api-subscribing) -+ [Memory usage](#runtimes-logs-api-memory) -+ [Destination protocols](#runtimes-logs-api-dest) -+ [Buffering configuration](#runtimes-logs-api-buffering) -+ [Example subscription](#runtimes-logs-api-subs-example) -+ [Sample code for Logs API](#runtimes-logs-api-samples) -+ [Logs API reference](#runtimes-logs-api-ref) -+ [Log messages](#runtimes-logs-api-msg) - -## Subscribing to receive logs - -A Lambda extension can subscribe to receive logs by sending a subscription request to the Logs API\. - -To subscribe to receive logs, you need the extension identifier \(`Lambda-Extension-Identifier`\)\. First [register the extension](runtimes-extensions-api.md#extensions-registration-api-a) to receive the extension identifier\. Then subscribe to the Logs API during [initialization](lambda-runtime-environment.md#runtimes-lifecycle-ib)\. After the initialization phase completes, Lambda does not process subscription requests\. - -**Note** -Logs API subscription is idempotent\. Duplicate subscribe requests do not result in duplicate subscriptions\. - -## Memory usage - -Memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store the logs\. To help optimize memory usage, you can adjust the [buffering configuration](#runtimes-logs-api-buffering)\. Buffer memory usage counts towards overall memory consumption in the execution environment\. - -## Destination protocols - -You can choose one of the following protocols to receive the logs: - -1. **HTTP** \(recommended\) – Lambda delivers logs to a local HTTP endpoint \(`http://sandbox.localdomain:${PORT}/${PATH}`\) as an array of records in JSON format\. The `$PATH` parameter is optional\. Note that only HTTP is supported, not HTTPS\. You can choose to receive logs through PUT or POST\. - -1. **TCP** – Lambda delivers logs to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. - -We recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge when it delivers logs to the application layer\. Therefore, you might lose logs if your extension crashes\. HTTP does not share this limitation\. - -We also recommend setting up the local HTTP listener or the TCP port before subscribing to receive logs\. During setup, note the following: -+ Lambda sends logs only to destinations that are inside the execution environment\. -+ Lambda retries the attempt to send the logs \(with backoff\) if there is no listener, or if the POST or PUT request results in an error\. If the log subscriber crashes, it continues to receive logs after Lambda restarts the execution environment\. -+ Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. - -## Buffering configuration - -Lambda can buffer logs and deliver them to the subscriber\. You can configure this behavior in the subscription request by specifying the following optional fields\. Note that Lambda uses the default value for any field that you do not specify\. -+ **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. Default: 1,000\. Minimum: 25\. Maximum: 30,000\. -+ **maxBytes** – The maximum size \(in bytes\) of the logs to buffer in memory\. Default: 262,144\. Minimum: 262,144\. Maximum: 1,048,576\. -+ **maxItems** – The maximum number of events to buffer in memory\. Default: 10,000\. Minimum: 1,000\. Maximum: 10,000\. - -During buffering configuration, note the following points: -+ Lambda flushes the logs if any of the input streams are closed, for example, if the runtime crashes\. -+ Each subscriber can specify a different buffering configuration in their subscription request\. -+ Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2*maxBytes+metadata`, where `maxBytes` is configured in the subscribe request\. For example, Lambda adds the following metadata bytes to each record: - - ``` - { - "time": "2020-08-20T12:31:32.123Z", - "type": "function", - "record": "Hello World" - } - ``` -+ If the subscriber cannot process incoming logs quickly enough, Lambda might drop logs to keep memory utilization bounded\. To indicate the number of dropped records, Lambda sends a `platform.logsDropped` log\. - -## Example subscription - -The following example shows a request to subscribe to the platform and function logs\. - -``` -PUT http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs HTTP/1.1 -{ "schemaVersion": "2020-08-15", - "types": [ - "platform", - "function" - ], - "buffering": { - "maxItems": 1000, - "maxBytes": 262144, - "timeoutMs": 100 - }, - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080/lambda_logs" - } -} -``` - -If the request succeeds, the subscriber receives an HTTP 200 success response\. - -``` -HTTP/1.1 200 OK -"OK" -``` - -## Sample code for Logs API - -For sample code showing how to send logs to a custom destination, see [Using AWS Lambda extensions to send logs to custom destinations](http://aws.amazon.com/blogs/compute/using-aws-lambda-extensions-to-send-logs-to-custom-destinations/) on the AWS Compute Blog\. - -For Python and Go code examples showing how to develop a basic Lambda extension and subscribe to the Logs API, see [AWS Lambda Extensions](https://github.com/aws-samples/aws-lambda-extensions) on the AWS Samples GitHub repository\. For more information about building a Lambda extension, see [Lambda Extensions API](runtimes-extensions-api.md)\. - -## Logs API reference - -You can retrieve the Logs API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, use the prefix `2020-08-15/` before the API path\. For example: - -``` -http://${AWS_LAMBDA_RUNTIME_API}/2020-08-15/logs -``` - -The OpenAPI specification for the Logs API version **2020\-08\-15** is available here: [logs\-api\-request\.zip](samples/logs-api-request.zip) - -### Subscribe - -To subscribe to one or more of the log streams available in the Lambda execution environment, extensions send a Subscribe API request\. - -**Path** – `/logs` - -**Method** – **PUT** - -**Body parameters** - -`destination` – See [Destination protocols](#runtimes-logs-api-dest)\. Required: yes\. Type: strings\. - -`buffering` – See [Buffering configuration](#runtimes-logs-api-buffering)\. Required: no\. Type: strings\. - -`types` – An array of the types of logs to receive\. Required: yes\. Type: array of strings\. Valid values: "platform", "function", "extension"\. - -`schemaVersion` – Required: no\. Default value: "2020\-08\-15"\. Set to "2021\-03\-18" for the extension to receive [`platform.runtimeDone`](#runtimes-logs-api-ref-done) messages\. - -****Response parameters**** - -The OpenAPI specifications for the subscription responses version **2020\-08\-15** are available for the HTTP and TCP protocols: -+ HTTP: [logs\-api\-http\-response\.zip](samples/logs-api-http-response.zip) -+ TCP: [logs\-api\-tcp\-response\.zip](samples/logs-api-tcp-response.zip) - -****Response codes**** -+ 200 – Request completed successfully -+ 202 – Request accepted\. Response to a subscription request during local testing\. -+ 4XX – Bad Request -+ 500 – Service error - -If the request succeeds, the subscriber receives an HTTP 200 success response\. - -``` -HTTP/1.1 200 OK -"OK" -``` - -If the request fails, the subscriber receives an error response\. For example: - -``` -HTTP/1.1 400 OK -{ - "errorType": "Logs.ValidationError", - "errorMessage": URI port is not provided; types should not be empty" -} -``` - -## Log messages - -The Logs API allows extensions to subscribe to three different logs streams: -+ Function – Logs that the Lambda function generates and writes to `stdout` or `stderr`\. -+ Extension – Logs that extension code generates\. -+ Platform – Logs that the runtime platform generates, which record events and errors related to invocations and extensions\. - -**Topics** -+ [Function logs](#runtimes-logs-api-msg-function) -+ [Extension logs](#runtimes-logs-api-msg-extension) -+ [Platform logs](#runtimes-logs-api-msg-platform) - -### Function logs - -The Lambda function and internal extensions generate function logs and write them to `stdout` or `stderr`\. - -The following example shows the format of a function log message\. \{ "time": "2020\-08\-20T12:31:32\.123Z", "type": "function", "record": "ERROR encountered\. Stack trace:\\n\\my\-function \(line 10\)\\n" \} - -### Extension logs - -Extensions can generate extension logs\. The log format is the same as for a function log\. - -### Platform logs - -Lambda generates log messages for platform events such as `platform.start`, `platform.end`, and `platform.fault`\. - -Optionally, you can subscribe to the **2021\-03\-18** version of the Logs API schema, which includes the `platform.runtimeDone` log message\. - -#### Example platform log messages - -The following example shows the platform start and platform end logs\. These logs indicate the invocation start time and invocation end time for the invocation that the requestId specifies\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.start", - "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} -} -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.end", - "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56"} -} -``` - -The platform report log includes metrics about the invocation that the requestId specifies\. The `initDurationMs` field is included in the log only if the invocation included a cold start\. If AWS X\-Ray tracing is active, the log includes X\-Ray metadata\. The following example shows a platform report log for an invocation that included a cold start\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.report", - "record": {"requestId": "6f7f0961f83442118a7af6fe80b88d56", - "metrics": {"durationMs": 101.51, - "billedDurationMs": 300, - "memorySizeMB": 512, - "maxMemoryUsedMB": 33, - "initDurationMs": 116.67 - } - } -} -``` - -The platform fault log captures runtime or execution environment errors\. The following example shows a platform fault log message\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.fault", - "record": "RequestId: d783b35e-a91d-4251-af17-035953428a2c Process exited before completing request" -} -``` - -Lambda generates a platform extension log when an extension registers with the extensions API\. The following example shows a platform extension message\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.extension", - "record": {"name": "Foo.bar", - "state": "Ready", - "events": ["INVOKE", "SHUTDOWN"] - } -} -``` - -Lambda generates a platform logs subscription log when an extension subscribes to the logs API\. The following example shows a logs subscription message\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.logsSubscription", - "record": {"name": "Foo.bar", - "state": "Subscribed", - "types": ["function", "platform"], - } -} -``` - -Lambda generates a platform logs dropped log when an extension is not able to process the number of logs that it is receiving\. The following example shows a `platform.logsDropped` log message\. - -``` -{ - "time": "2020-08-20T12:31:32.123Z", - "type": "platform.logsDropped", - "record": {"reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs.", - "droppedRecords": 123, - "droppedBytes" 12345 - } -} -``` - -#### Platform `runtimeDone` messages - -If you set the schema version to "2021\-03\-18" in the subscribe request, Lambda sends a `platform.runtimeDone` message after the function invocation completes either successfully or with an error\. The extension can use this message to stop all the telemetry collection for this function invocation\. - -The OpenAPI specification for the Log event type in schema version **2021\-03\-18** is available here: [schema\-2021\-03\-18\.zip](samples/schema-2021-03-18.zip) - -Lambda generates the `platform.runtimeDone` log message when the runtime sends a `Next` or `Error` runtime API request\. The `platform.runtimeDone` log informs consumers of the Logs API that the function invocation completes\. Extensions can use this information to decide when to send all the telemetry collected during that invocation\. - -##### Examples - -Lambda sends the `platform.runtimeDone` message after the runtime sends the NEXT request when the function invocation completes\. The following examples show messages for each of the status values: success, failure, and timeout\. - -**Example success message** - -``` -{ - "time": "2021-02-04T20:00:05.123Z", - "type": "platform.runtimeDone", - "record": { - "requestId":"6f7f0961f83442118a7af6fe80b88", - "status": "success" - } -} -``` - -**Example failure message** - -``` -{ - "time": "2021-02-04T20:00:05.123Z", - "type": "platform.runtimeDone", - "record": { - "requestId":"6f7f0961f83442118a7af6fe80b88", - "status": "failure" - } -} -``` - -**Example timeout message** - -``` -{ - "time": "2021-02-04T20:00:05.123Z", - "type": "platform.runtimeDone", - "record": { - "requestId":"6f7f0961f83442118a7af6fe80b88", - "status": "timeout" - } -} -``` \ No newline at end of file diff --git a/doc_source/runtimes-modify.md b/doc_source/runtimes-modify.md deleted file mode 100644 index cd2f7d25..00000000 --- a/doc_source/runtimes-modify.md +++ /dev/null @@ -1,248 +0,0 @@ -# Modifying the runtime environment - -You can use [internal extensions](lambda-extensions.md) to modify the runtime process\. Internal extensions are not separate processes—they run as part of the runtime process\. - -Lambda provides language\-specific [environment variables](configuration-envvars.md) that you can set to add options and tools to the runtime\. Lambda also provides [wrapper scripts](#runtime-wrapper), which allow Lambda to delegate the runtime startup to your script\. You can create a wrapper script to customize the runtime startup behavior\. - -## Language\-specific environment variables - -Lambda supports configuration\-only ways to enable code to be pre\-loaded during function initialization through the following language\-specific environment variables: -+ `JAVA_TOOL_OPTIONS` – On Java, Lambda supports this environment variable to set additional command\-line variables in Lambda\. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the `agentlib` or `javaagent` options\. -+ `NODE_OPTIONS` – On Node\.js 10x and above, Lambda supports this environment variable\. -+ `DOTNET_STARTUP_HOOKS` – On \.NET Core 3\.1 and above, this environment variable specifies a path to an assembly \(dll\) that Lambda can use\. - -Using language\-specific environment variables is the preferred way to set startup properties\. - -### Example: Intercept Lambda invokes with `javaagent` - -The Java virtual machine \(JVM\) tries to locate the class that was specified with the `javaagent` parameter to the JVM, and invoke its `premain` method before the application's entry point\. - -The following example uses [Byte Buddy](https://bytebuddy.net/), a library for creating and modifying Java classes during the runtime of a Java application without the help of a compiler\. Byte Buddy offers an additional API for generating Java agents\. In this example, the `Agent` class intercepts every call of the `handleRequest` method made to the [RequestStreamHandler](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-core/src/main/java/com/amazonaws/services/lambda/runtime/RequestStreamHandler.java) class\. This class is used internally in the runtime to wrap the handler invocations\. - -``` -import com.amazonaws.services.lambda.runtime.RequestStreamHandler; -import net.bytebuddy.agent.builder.AgentBuilder; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.matcher.ElementMatchers; - -import java.lang.instrument.Instrumentation; - -public class Agent { - - public static void premain(String agentArgs, Instrumentation inst) { - new AgentBuilder.Default() - .with(new AgentBuilder.InitializationStrategy.SelfInjection.Eager()) - .type(ElementMatchers.isSubTypeOf(RequestStreamHandler.class)) - .transform((builder, typeDescription, classLoader, module) -> builder - .method(ElementMatchers.nameContains("handleRequest")) - .intercept(Advice.to(TimerAdvice.class))) - .installOn(inst); - } -} -``` - -The agent in the preceding example uses the `TimerAdvice` method\. `TimerAdvice` measures how many milliseconds are spent with the method call and logs the method time and details, such as name and passed arguments\. - -``` -import static net.bytebuddy.asm.Advice.AllArguments; -import static net.bytebuddy.asm.Advice.Enter; -import static net.bytebuddy.asm.Advice.OnMethodEnter; -import static net.bytebuddy.asm.Advice.OnMethodExit; -import static net.bytebuddy.asm.Advice.Origin; - -public class TimerAdvice { - - @OnMethodEnter - static long enter() { - return System.currentTimeMillis(); - } - - @OnMethodExit - static void exit(@Origin String method, @Enter long start, @AllArguments Object[] args) { - StringBuilder sb = new StringBuilder(); - for (Object arg : args) { - sb.append(arg); - sb.append(", "); - } - System.out.println(method + " method with args: " + sb.toString() + " took " + (System.currentTimeMillis() - start) + " milliseconds "); - } -} -``` - -The `TimerAdvice` method above has the following dependencies\. - -``` -*'com.amazonaws'*, *name*: *'aws-lambda-java-core'*, *version*: *'1.2.1'* -*'net.bytebuddy'*, *name*: *'byte-buddy-dep'*, *version*: *'1.10.14'* -*'net.bytebuddy'*, *name*: *'byte-buddy-agent'*, *version*: *'1.10.14'* -``` - -After you create a layer that contains the agent JAR, you can pass the JAR name to the runtime's JVM by setting an environment variable\. - -``` -JAVA_TOOL_OPTIONS=-javaagent:"/opt/ExampleAgent-0.0.jar" -``` - -After invoking the function with `{key=lambdaInput}`, you can find the following line in the logs: - -``` -public java.lang.Object lambdainternal.EventHandlerLoader$PojoMethodRequestHandler.handleRequest - (java.lang.Object,com.amazonaws.services.lambda.runtime.Context) method with args: - {key=lambdaInput}, lambdainternal.api.LambdaContext@4d9d1b69, took 106 milliseconds -``` - -### Example: Adding a shutdown hook to the JVM runtime process - -When an extension is registered during a `Shutdown` event, the runtime process gets up to 500 ms to handle graceful shutdown\. You can hook into the runtime process, and when the JVM begins its shutdown process, it starts all registered hooks\. To register a shutdown hook, you must [register as an extension](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. You do not need to explicitly register for the `Shutdown` event, as that is automatically sent to the runtime\. - -``` -import java.lang.instrument.Instrumentation; - -public class Agent { - - public static void premain(String agentArgs, Instrumentation inst) { -// Register the extension. -// ... - -// Register the shutdown hook - addShutdownHook(); - } - - private static void addShutdownHook() { -// Shutdown hooks get up to 500 ms to handle graceful shutdown before the runtime is terminated. -// -// You can use this time to egress any remaining telemetry, close open database connections, etc. - Runtime.getRuntime().addShutdownHook(new Thread(() -> { -// Inside the shutdown hook's thread we can perform any remaining task which needs to be done. - })); - } - -} -``` - -### Example: Retrieving the InvokedFunctionArn - -``` - @OnMethodEnter - static long enter() { - String invokedFunctionArn = null; - for (Object arg : args) { - if (arg instanceof Context) { - Context context = (Context) arg; - invokedFunctionArn = context.getInvokedFunctionArn(); - } - } - } -``` - -## Wrapper scripts - -You can create a *wrapper script* to customize the runtime startup behavior of your Lambda function\. A wrapper script enables you to set configuration parameters that cannot be set through language\-specific environment variables\. - -**Note** -Invocations may fail if the wrapper script does not successfully start the runtime process\. - -The following [Lambda runtimes](lambda-runtimes.md) support wrapper scripts: -+ Node\.js 14\.x -+ Node\.js 12\.x -+ Node\.js 10\.x -+ Python 3\.9 -+ Python 3\.8 -+ Ruby 2\.7 -+ Java 11 -+ Java 8 \(`java8.al2`\) -+ \.NET 6 -+ \.NET 5 -+ \.NET Core 3\.1 - -When you use a wrapper script for your function, Lambda starts the runtime using your script\. Lambda sends to your script the path to the interpreter and all of the original arguments for the standard runtime startup\. Your script can extend or transform the startup behavior of the program\. For example, the script can inject and alter arguments, set environment variables, or capture metrics, errors, and other diagnostic information\. - -You specify the script by setting the value of the `AWS_LAMBDA_EXEC_WRAPPER` environment variable as the file system path of an executable binary or script\. - -### Example: Create and use a wrapper script with Python 3\.8 - -In the following example, you create a wrapper script to start the Python interpreter with the `-X importtime` option\. When you run the function, Lambda generates a log entry to show the duration of the import time for each import\. - -**To create and use a wrapper script with Python 3\.8** - -1. To create the wrapper script, paste the following code into a file named `importtime_wrapper`: - - ``` - #!/bin/bash - - # the path to the interpreter and all of the originally intended arguments - args=("$@") - - # the extra options to pass to the interpreter - extra_args=("-X" "importtime") - - # insert the extra options - args=("${args[@]:0:$#-1}" "${extra_args[@]}" "${args[@]: -1}") - - # start the runtime with the extra options - exec "${args[@]}" - ``` - -1. To give the script executable permissions, enter `chmod +x importtime_wrapper` from the command line\. - -1. Deploy the script as a [Lambda layer](configuration-layers.md)\. - -1. Create a function using the Lambda console\. - - 1. Open the [Lambda console](https://console.aws.amazon.com/lambda/home)\. - - 1. Choose **Create function**\. - - 1. Under **Basic information**, for **Function name**, enter **wrapper\-test\-function**\. - - 1. For **Runtime**, choose **Python 3\.8**\. - - 1. Choose **Create function**\. - -1. Add the layer to your function\. - - 1. Choose your function, and then choose **Code** if it is not already selected\. - - 1. Choose **Add a layer**\. - - 1. Under **Choose a layer**, choose the **Name** and **Version** of the compatible layer that you created earlier\. - - 1. Choose **Add**\. - -1. Add the code and the environment variable to your function\. - - 1. In the function [code editor](foundation-console.md#code-editor), paste the following function code: - - ``` - import json - - def lambda_handler(event, context): - # TODO implement - return { - 'statusCode': 200, - 'body': json.dumps('Hello from Lambda!') - } - ``` - - 1. Choose **Save**\. - - 1. Under **Environment variables**, choose **Edit**\. - - 1. Choose **Add environment variable**\. - - 1. For **Key**, enter `AWS_LAMBDA_EXEC_WRAPPER`\. - - 1. For **Value**, enter `/opt/importtime_wrapper`\. - - 1. Choose **Save**\. - -1. To run the function, choose **Test**\. - - Because your wrapper script started the Python interpreter with the `-X importtime` option, the logs show the time required for each import\. For example: - - ``` - ... - 2020-06-30T18:48:46.780+01:00 import time: 213 | 213 | simplejson - 2020-06-30T18:48:46.780+01:00 import time: 50 | 263 | simplejson.raw_json - ... - ``` \ No newline at end of file diff --git a/doc_source/runtimes-walkthrough.md b/doc_source/runtimes-walkthrough.md deleted file mode 100644 index 7b10e1fc..00000000 --- a/doc_source/runtimes-walkthrough.md +++ /dev/null @@ -1,297 +0,0 @@ -# Tutorial – Publishing a custom runtime - -In this tutorial, you create a Lambda function with a custom runtime\. You start by including the runtime in the function's deployment package\. Then you migrate it to a layer that you manage independently from the function\. Finally, you share the runtime layer with the world by updating its resource\-based permissions policy\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -You need an IAM role to create a Lambda function\. The role needs permission to send logs to CloudWatch Logs and access the AWS services that your function uses\. If you don't have a role for function development, create one now\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-role**\. - - The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -## Create a function - -Create a Lambda function with a custom runtime\. This example includes two files, a runtime `bootstrap` file, and a function handler\. Both are implemented in Bash\. - -The runtime loads a function script from the deployment package\. It uses two variables to locate the script\. `LAMBDA_TASK_ROOT` tells it where the package was extracted, and `_HANDLER` includes the name of the script\. - -**Example bootstrap** - -``` -#!/bin/sh - -set -euo pipefail - -# Initialization - load function handler -source $LAMBDA_TASK_ROOT/"$(echo $_HANDLER | cut -d. -f1).sh" - -# Processing -while true -do - HEADERS="$(mktemp)" - # Get an event. The HTTP request will block until one is received - EVENT_DATA=$(curl -sS -LD "$HEADERS" -X GET "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next") - - # Extract request ID by scraping response headers received above - REQUEST_ID=$(grep -Fi Lambda-Runtime-Aws-Request-Id "$HEADERS" | tr -d '[:space:]' | cut -d: -f2) - - # Run the handler function from the script - RESPONSE=$($(echo "$_HANDLER" | cut -d. -f2) "$EVENT_DATA") - - # Send the response - curl -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "$RESPONSE" -done -``` - -After loading the script, the runtime processes events in a loop\. It uses the runtime API to retrieve an invocation event from Lambda, passes the event to the handler, and posts the response back to Lambda\. To get the request ID, the runtime saves the headers from the API response to a temporary file, and reads the `Lambda-Runtime-Aws-Request-Id` header from the file\. - -**Note** -Runtimes have additional responsibilities, including error handling, and providing context information to the handler\. For details, see [Building a custom runtime](runtimes-custom.md#runtimes-custom-build)\. - -The script defines a handler function that takes event data, logs it to `stderr`, and returns it\. - -**Example function\.sh** - -``` -function handler () { - EVENT_DATA=$1 - echo "$EVENT_DATA" 1>&2; - RESPONSE="Echoing request: '$EVENT_DATA'" - - echo $RESPONSE -} -``` - -Save both files in a project directory named `runtime-tutorial`\. - -``` -runtime-tutorial -├ bootstrap -└ function.sh -``` - -Make the files executable and add them to a \.zip file archive\. - -``` -runtime-tutorial$ chmod 755 function.sh bootstrap -runtime-tutorial$ zip function.zip function.sh bootstrap - adding: function.sh (deflated 24%) - adding: bootstrap (deflated 39%) -``` - -Create a function named `bash-runtime`\. - -``` -runtime-tutorial$ aws lambda create-function --function-name bash-runtime \ ---zip-file fileb://function.zip --handler function.handler --runtime provided \ ---role arn:aws:iam::123456789012:role/lambda-role -{ - "FunctionName": "bash-runtime", - "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:bash-runtime", - "Runtime": "provided", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Handler": "function.handler", - "CodeSha256": "mv/xRv84LPCxdpcbKvmwuuFzwo7sLwUO1VxcUv3wKlM=", - "Version": "$LATEST", - "TracingConfig": { - "Mode": "PassThrough" - }, - "RevisionId": "2e1d51b0-6144-4763-8e5c-7d5672a01713", - ... -} -``` - -Invoke the function and verify the response\. - -``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -runtime-tutorial$ cat response.txt -Echoing request: '{"text":"Hello"}' -``` - -## Create a layer - -To separate the runtime code from the function code, create a layer that only contains the runtime\. Layers let you develop your function's dependencies independently, and can reduce storage usage when you use the same layer with multiple functions\. - -Create a layer archive that contains the `bootstrap` file\. - -``` -runtime-tutorial$ zip runtime.zip bootstrap - adding: bootstrap (deflated 39%) -``` - -Create a layer with the `publish-layer-version` command\. - -``` -runtime-tutorial$ aws lambda publish-layer-version --layer-name bash-runtime --zip-file fileb://runtime.zip - { - "Content": { - "Location": "https://awslambda-us-west-2-layers.s3.us-west-2.amazonaws.com/snapshots/123456789012/bash-runtime-018c209b...", - "CodeSha256": "bXVLhHi+D3H1QbDARUVPrDwlC7bssPxySQqt1QZqusE=", - "CodeSize": 584, - "UncompressedCodeSize": 0 - }, - "LayerArn": "arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime", - "LayerVersionArn": "arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:1", - "Description": "", - "CreatedDate": "2018-11-28T07:49:14.476+0000", - "Version": 1 -} -``` - -This creates the first version of the layer\. - -## Update the function - -To use the runtime layer with the function, configure the function to use the layer, and remove the runtime code from the function\. - -Update the function configuration to pull in the layer\. - -``` -runtime-tutorial$ aws lambda update-function-configuration --function-name bash-runtime \ ---layers arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:1 -{ - "FunctionName": "bash-runtime", - "Layers": [ - { - "Arn": "arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:1", - "CodeSize": 584, - "UncompressedCodeSize": 679 - } - ] - ... -} -``` - -This adds the runtime to the function in the `/opt` directory\. Lambda uses this runtime, but only if you remove it from the function's deployment package\. Update the function code to only include the handler script\. - -``` -runtime-tutorial$ zip function-only.zip function.sh - adding: function.sh (deflated 24%) -runtime-tutorial$ aws lambda update-function-code --function-name bash-runtime --zip-file fileb://function-only.zip -{ - "FunctionName": "bash-runtime", - "CodeSize": 270, - "Layers": [ - { - "Arn": "arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:7", - "CodeSize": 584, - "UncompressedCodeSize": 679 - } - ] - ... -} -``` - -Invoke the function to verify that it works with the runtime layer\. - -``` -runtime-tutorial$ aws lambda invoke --function-name bash-runtime --payload '{"text":"Hello"}' response.txt --cli-binary-format raw-in-base64-out -{ - "StatusCode": 200, - "ExecutedVersion": "$LATEST" -} -runtime-tutorial$ cat response.txt -Echoing request: '{"text":"Hello"}' -``` - -## Update the runtime - -To log information about the execution environment, update the runtime script to output environment variables\. - -**Example bootstrap** - -``` -#!/bin/sh - -set -euo pipefail - -echo "## Environment variables:" -env - -# Initialization - load function handler -source $LAMBDA_TASK_ROOT/"$(echo $_HANDLER | cut -d. -f1).sh" -... -``` - -Create a second version of the layer with the new code\. - -``` -runtime-tutorial$ zip runtime.zip bootstrap -updating: bootstrap (deflated 39%) -runtime-tutorial$ aws lambda publish-layer-version --layer-name bash-runtime --zip-file fileb://runtime.zip -``` - -Configure the function to use the new version of the layer\. - -``` -runtime-tutorial$ aws lambda update-function-configuration --function-name bash-runtime \ ---layers arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:2 -``` - -## Share the layer - -Add a permission statement to your runtime layer to share it with other accounts\. - -``` -runtime-tutorial$ aws lambda add-layer-version-permission --layer-name bash-runtime --version-number 2 \ ---principal "*" --statement-id publish --action lambda:GetLayerVersion -{ - "Statement": "{\"Sid\":\"publish\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:layer:bash-runtime:2\"}", - "RevisionId": "9d5fe08e-2a1e-4981-b783-37ab551247ff" -} -``` - -You can add multiple statements that each grant permission to a single account, accounts in an organization, or all accounts\. - -## Clean up - -Delete each version of the layer\. - -``` -runtime-tutorial$ aws lambda delete-layer-version --layer-name bash-runtime --version-number 1 -runtime-tutorial$ aws lambda delete-layer-version --layer-name bash-runtime --version-number 2 -``` - -Because the function holds a reference to version 2 of the layer, it still exists in Lambda\. The function continues to work, but functions can no longer be configured to use the deleted version\. If you then modify the list of layers on the function, you must specify a new version or omit the deleted layer\. - -Delete the tutorial function with the `delete-function` command\. - -``` -runtime-tutorial$ aws lambda delete-function --function-name bash-runtime -``` \ No newline at end of file diff --git a/doc_source/samples-blank.md b/doc_source/samples-blank.md deleted file mode 100644 index 62588858..00000000 --- a/doc_source/samples-blank.md +++ /dev/null @@ -1,236 +0,0 @@ -# Blank function sample application for AWS Lambda - -The blank function sample application is a starter application that demonstrates common operations in Lambda with a function that calls the Lambda API\. It shows the use of logging, environment variables, AWS X\-Ray tracing, layers, unit tests and the AWS SDK\. Explore this application to learn about building Lambda functions in your programming language, or use it as a starting point for your own projects\. - -Variants of this sample application are available for the following languages: - -**Variants** -+ Node\.js – [blank\-nodejs](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs)\. -+ Python – [blank\-python](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-python)\. -+ Ruby – [blank\-ruby](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-ruby)\. -+ Java – [blank\-java](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-java)\. -+ Go – [blank\-go](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-go)\. -+ C\# – [blank\-csharp](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-csharp)\. -+ PowerShell – [blank\-powershell](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-powershell)\. - -The examples in this topic highlight code from the Node\.js version, but the details are generally applicable to all variants\. - -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. Follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs) to download, configure, and deploy it in your account\. - -**Topics** -+ [Architecture and handler code](#samples-blank-architecture) -+ [Deployment automation with AWS CloudFormation and the AWS CLI](#samples-blank-automation) -+ [Instrumentation with the AWS X\-Ray](#samples-blank-instrumentation) -+ [Dependency management with layers](#samples-blank-dependencies) - -## Architecture and handler code - -The sample application consists of function code, an AWS CloudFormation template, and supporting resources\. When you deploy the sample, you use the following AWS services: -+ AWS Lambda – Runs function code, sends logs to CloudWatch Logs, and sends trace data to X\-Ray\. The function also calls the Lambda API to get details about the account's quotas and usage in the current Region\. -+ [AWS X\-Ray](https://aws.amazon.com/xray) – Collects trace data, indexes traces for search, and generates a service map\. -+ [Amazon CloudWatch](https://aws.amazon.com/cloudwatch) – Stores logs and metrics\. -+ [AWS Identity and Access Management \(IAM\)](https://aws.amazon.com/iam) – Grants permission\. -+ [Amazon Simple Storage Service \(Amazon S3\)](https://aws.amazon.com/s3) – Stores the function's deployment package during deployment\. -+ [AWS CloudFormation](https://aws.amazon.com/cloudformation) – Creates application resources and deploys function code\. - -Standard charges apply for each service\. For more information, see [AWS Pricing](https://aws.amazon.com/pricing)\. - -The function code shows a basic workflow for processing an event\. The handler takes an Amazon Simple Queue Service \(Amazon SQS\) event as input and iterates through the records that it contains, logging the contents of each message\. It logs the contents of the event, the context object, and environment variables\. Then it makes a call with the AWS SDK and passes the response back to the Lambda runtime\. - -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Handler code** - -``` -// Handler -exports.handler = async function(event, context) { - event.Records.forEach(record => { - console.log(record.body) - }) - console.log('## ENVIRONMENT VARIABLES: ' + serialize(process.env)) - console.log('## CONTEXT: ' + serialize(context)) - console.log('## EVENT: ' + serialize(event)) - - return getAccountSettings() -} - -// Use SDK client -var getAccountSettings = function(){ - return lambda.getAccountSettings().promise() -} - -var serialize = function(object) { - return JSON.stringify(object, null, 2) -} -``` - -The input/output types for the handler and support for asynchronous programming vary per runtime\. In this example, the handler method is `async`, so in Node\.js this means that it must return a promise back to the runtime\. The Lambda runtime waits for the promise to be resolved and returns the response to the invoker\. If the function code or AWS SDK client return an error, the runtime formats the error into a JSON document and returns that\. - -The sample application doesn't include an Amazon SQS queue to send events, but uses an event from Amazon SQS \([event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/event.json)\) to illustrate how events are processed\. To add an Amazon SQS queue to your application, see [Using Lambda with Amazon SQS](with-sqs.md)\. - -## Deployment automation with AWS CloudFormation and the AWS CLI - -The sample application's resources are defined in an AWS CloudFormation template and deployed with the AWS CLI\. The project includes simple shell scripts that automate the process of setting up, deploying, invoking, and tearing down the application\. - -The application template uses an AWS Serverless Application Model \(AWS SAM\) resource type to define the model\. AWS SAM simplifies template authoring for serverless applications by automating the definition of execution roles, APIs, and other resources\. - -The template defines the resources in the application *stack*\. This includes the function, its execution role, and a Lambda layer that provides the function's library dependencies\. The stack does not include the bucket that the AWS CLI uses during deployment or the CloudWatch Logs log group\. - -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/blank-nodejs/template.yml) – Serverless resources** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that calls the Lambda API. -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - CodeUri: function/. - Description: Call the AWS Lambda API - Timeout: 10 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - Tracing: Active - Layers: - - !Ref libs - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-nodejs-lib - Description: Dependencies for the blank sample app. - ContentUri: lib/. - CompatibleRuntimes: - - nodejs12.x -``` - -When you deploy the application, AWS CloudFormation applies the AWS SAM transform to the template to generate an AWS CloudFormation template with standard types such as `AWS::Lambda::Function` and `AWS::IAM::Role`\. - -**Example processed template** - -``` -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "An AWS Lambda application that calls the Lambda API.", - "Resources": { - "function": { - "Type": "[AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html)", - "Properties": { - "Layers": [ - { - "Ref": "libs32xmpl61b2" - } - ], - "TracingConfig": { - "Mode": "Active" - }, - "Code": { - "S3Bucket": "lambda-artifacts-6b000xmpl1e9bf2a", - "S3Key": "3d3axmpl473d249d039d2d7a37512db3" - }, - "Description": "Call the AWS Lambda API", - "Tags": [ - { - "Value": "SAM", - "Key": "lambda:createdBy" - } - ], -``` - -In this example, the `Code` property specifies an object in an Amazon S3 bucket\. This corresponds to the local path in the `CodeUri` property in the project template: - -``` - CodeUri: function/. -``` - -To upload the project files to Amazon S3, the deployment script uses commands in the AWS CLI\. The `cloudformation package` command preprocesses the template, uploads artifacts, and replaces local paths with Amazon S3 object locations\. The `cloudformation deploy` command deploys the processed template with a AWS CloudFormation change set\. - -**Example [blank\-nodejs/3\-deploy\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/3-deploy.sh) – Package and deploy** - -``` -#!/bin/bash -set -eo pipefail -ARTIFACT_BUCKET=$(cat bucket-name.txt) -aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml -aws cloudformation deploy --template-file out.yml --stack-name blank-nodejs --capabilities CAPABILITY_NAMED_IAM -``` - -The first time you run this script, it creates a AWS CloudFormation stack named `blank-nodejs`\. If you make changes to the function code or template, you can run it again to update the stack\. - -The cleanup script \([blank\-nodejs/5\-cleanup\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/5-cleanup.sh)\) deletes the stack and optionally deletes the deployment bucket and function logs\. - -## Instrumentation with the AWS X\-Ray - -The sample function is configured for tracing with [AWS X\-Ray](https://console.aws.amazon.com/xray/home)\. With the tracing mode set to active, Lambda records timing information for a subset of invocations and sends it to X\-Ray\. X\-Ray processes the data to generate a *service map* that shows a client node and two service nodes\. - -The first service node \(`AWS::Lambda`\) represents the Lambda service, which validates the invocation request and sends it to the function\. The second node, `AWS::Lambda::Function`, represents the function itself\. - -To record additional detail, the sample function uses the X\-Ray SDK\. With minimal changes to the function code, the X\-Ray SDK records details about calls made with the AWS SDK to AWS services\. - -**Example [blank\-nodejs/function/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/function/index.js) – Instrumentation** - -``` -const AWSXRay = require('aws-xray-sdk-core') -const AWS = AWSXRay.captureAWS(require('aws-sdk')) - -// Create client outside of handler to reuse -const lambda = new AWS.Lambda() -``` - -Instrumenting the AWS SDK client adds an additional node to the service map and more detail in traces\. In this example, the service map shows the sample function calling the Lambda API to get details about storage and concurrency usage in the current Region\. - -The trace shows timing details for the invocation, with subsegments for function initialization, invocation, and overhead\. The invocation subsegment has a subsegment for the AWS SDK call to the `GetAccountSettings` API operation\. - -You can include the X\-Ray SDK and other libraries in your function's deployment package, or deploy them separately in a Lambda layer\. For Node\.js, Ruby, and Python, the Lambda runtime includes the AWS SDK in the execution environment\. - -## Dependency management with layers - -You can install libraries locally and include them in the deployment package that you upload to Lambda, but this has its drawbacks\. Larger file sizes cause increased deployment times and can prevent you from testing changes to your function code in the Lambda console\. To keep the deployment package small and avoid uploading dependencies that haven't changed, the sample app creates a [Lambda layer](configuration-layers.md) and associates it with the function\. - -**Example [blank\-nodejs/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Dependency layer** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - CodeUri: function/. - Description: Call the AWS Lambda API - Timeout: 10 - # Function's execution role - Policies: - - AWSLambdaBasicExecutionRole - - AWSLambda_ReadOnlyAccess - - AWSXrayWriteOnlyAccess - Tracing: Active - Layers: - - !Ref libs - libs: - Type: [AWS::Serverless::LayerVersion](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-layerversion.html) - Properties: - LayerName: blank-nodejs-lib - Description: Dependencies for the blank sample app. - ContentUri: lib/. - CompatibleRuntimes: - - nodejs12.x -``` - -The `2-build-layer.sh` script installs the function's dependencies with npm and places them in a folder with the [structure required by the Lambda runtime](configuration-layers.md#configuration-layers-path)\. - -**Example [2\-build\-layer\.sh](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/2-build-layer.sh) – Preparing the layer** - -``` -#!/bin/bash -set -eo pipefail -mkdir -p lib/nodejs -rm -rf node_modules lib/nodejs/node_modules -npm install --production -mv node_modules lib/nodejs/ -``` - -The first time that you deploy the sample application, the AWS CLI packages the layer separately from the function code and deploys both\. For subsequent deployments, the layer archive is only uploaded if the contents of the `lib` folder have changed\. \ No newline at end of file diff --git a/doc_source/samples-errorprocessor.md b/doc_source/samples-errorprocessor.md deleted file mode 100644 index efac9def..00000000 --- a/doc_source/samples-errorprocessor.md +++ /dev/null @@ -1,87 +0,0 @@ -# Error processor sample application for AWS Lambda - -The Error Processor sample application demonstrates the use of AWS Lambda to handle events from an [Amazon CloudWatch Logs subscription](services-cloudwatchlogs.md)\. CloudWatch Logs lets you invoke a Lambda function when a log entry matches a pattern\. The subscription in this application monitors the log group of a function for entries that contain the word `ERROR`\. It invokes a processor Lambda function in response\. The processor function retrieves the full log stream and trace data for the request that caused the error, and stores them for later use\. - -Function code is available in the following files: -+ Random error – [random\-error/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/random-error/index.js) -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/processor/index.js) - -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor)\. - -**Topics** -+ [Architecture and event structure](#sample-errorprocessor-architecture) -+ [Instrumentation with AWS X\-Ray](#sample-errorprocessor-instrumentation) -+ [AWS CloudFormation template and additional resources](#sample-errorprocessor-template) - -## Architecture and event structure - -The sample application uses the following AWS services\. -+ AWS Lambda – Runs function code, sends logs to CloudWatch Logs, and sends trace data to X\-Ray\. -+ Amazon CloudWatch Logs – Collects logs, and invokes a function when a log entry matches a filter pattern\. -+ AWS X\-Ray – Collects trace data, indexes traces for search, and generates a service map\. -+ Amazon Simple Storage Service \(Amazon S3\) – Stores deployment artifacts and application output\. - -Standard charges apply for each service\. - -A Lambda function in the application generates errors randomly\. When CloudWatch Logs detects the word `ERROR` in the function's logs, it sends an event to the processor function for processing\. - -**Example CloudWatch Logs message event** - -``` -{ - "awslogs": { - "data": "H4sIAAAAAAAAAHWQT0/DMAzFv0vEkbLYcdJkt4qVXmCDteIAm1DbZKjS+kdpB0Jo350MhsQFyVLsZ+unl/fJWjeO5asrPgbH5..." - } -} -``` - -When it's decoded, the data contains details about the log event\. The function uses these details to identify the log stream, and parses the log message to get the ID of the request that caused the error\. - -**Example decoded CloudWatch Logs event data** - -``` -{ - "messageType": "DATA_MESSAGE", - "owner": "123456789012", - "logGroup": "/aws/lambda/lambda-error-processor-randomerror-1GD4SSDNACNP4", - "logStream": "2019/04/04/[$LATEST]63311769a9d742f19cedf8d2e38995b9", - "subscriptionFilters": [ - "lambda-error-processor-subscription-15OPDVQ59CG07" - ], - "logEvents": [ - { - "id": "34664632210239891980253245280462376874059932423703429141", - "timestamp": 1554415868243, - "message": "2019-04-04T22:11:08.243Z\t1d2c1444-efd1-43ec-b16e-8fb2d37508b8\tERROR\n" - } - ] -} -``` - -The processor function uses information from the CloudWatch Logs event to download the full log stream and X\-Ray trace for a request that caused an error\. It stores both in an Amazon S3 bucket\. To allow the log stream and trace time to finalize, the function waits for a short period of time before accessing the data\. - -## Instrumentation with AWS X\-Ray - -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. - -The two Node\.js functions are configured for active tracing in the template, and are instrumented with the AWS X\-Ray SDK for Node\.js in code\. With active tracing, Lambda tags adds a tracing header to incoming requests and sends a trace with timing details to X\-Ray\. Additionally, the random error function uses the X\-Ray SDK to record the request ID and user information in annotations\. The annotations are attached to the trace, and you can use them to locate the trace for a specific request\. - -The processor function gets the request ID from the CloudWatch Logs event, and uses the AWS SDK for JavaScript to search X\-Ray for that request\. It uses AWS SDK clients, which are instrumented with the X\-Ray SDK, to download the trace and log stream\. Then it stores them in the output bucket\. The X\-Ray SDK records these calls, and they appear as subsegments in the trace\. - -## AWS CloudFormation template and additional resources - -The application is implemented in two Node\.js modules and deployed with an AWS CloudFormation template and shell scripts\. The template creates the processor function, the random error function, and the following supporting resources\. -+ Execution role – An IAM role that grants the functions permission to access other AWS services\. -+ Primer function – An additional function that invokes the random error function to create a log group\. -+ Custom resource – An AWS CloudFormation custom resource that invokes the primer function during deployment to ensure that the log group exists\. -+ CloudWatch Logs subscription – A subscription for the log stream that triggers the processor function when the word ERROR is logged\. -+ Resource\-based policy – A permission statement on the processor function that allows CloudWatch Logs to invoke it\. -+ Amazon S3 bucket – A storage location for output from the processor function\. - -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) on GitHub\. - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-errorprocessor-stack.png) - -To work around a limitation of Lambda's integration with AWS CloudFormation, the template creates an additional function that runs during deployments\. All Lambda functions come with a CloudWatch Logs log group that stores output from function executions\. However, the log group isn't created until the function is invoked for the first time\. - -To create the subscription, which depends on the existence of the log group, the application uses a third Lambda function to invoke the random error function\. The template includes the code for the primer function inline\. An AWS CloudFormation custom resource invokes it during deployment\. `DependsOn` properties ensure that the log stream and resource\-based policy are created prior to the subscription\. \ No newline at end of file diff --git a/doc_source/samples-listmanager.md b/doc_source/samples-listmanager.md deleted file mode 100644 index bcff6ee1..00000000 --- a/doc_source/samples-listmanager.md +++ /dev/null @@ -1,115 +0,0 @@ -# List manager sample application for AWS Lambda - -The list manager sample application demonstrates the use of AWS Lambda to process records in an Amazon Kinesis data stream\. A Lambda event source mapping reads records from the stream in batches and invokes a Lambda function\. The function uses information from the records to update documents in Amazon DynamoDB and stores the records it processes in Amazon Relational Database Service \(Amazon RDS\)\. - -Clients send records to a Kinesis stream, which stores them and makes them available for processing\. The Kinesis stream is used like a queue to buffer records until they can be processed\. Unlike an Amazon SQS queue, records in a Kinesis stream are not deleted after they are processed, so multiple consumers can process the same data\. Records in Kinesis are also processed in order, where queue items can be delivered out of order\. Records are deleted from the stream after 7 days\. - -In addition to the function that processes events, the application includes a second function for performing administrative tasks on the database\. Function code is available in the following files: -+ Processor – [processor/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/processor/index.js) -+ Database admin – [dbadmin/index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/dbadmin/index.js) - -You can deploy the sample in a few minutes with the AWS CLI and AWS CloudFormation\. To download, configure, and deploy it in your account, follow the instructions in the [README](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager)\. - -**Topics** -+ [Architecture and event structure](#samples-listmanager-architecture) -+ [Instrumentation with AWS X\-Ray](#samples-listmanager-instrumentation) -+ [AWS CloudFormation templates and additional resources](#samples-listmanager-template) - -## Architecture and event structure - -The sample application uses the following AWS services: -+ Kinesis – Receives events from clients and stores them temporarily for processing\. -+ AWS Lambda – Reads from the Kinesis stream and sends events to the function's handler code\. -+ DynamoDB – Stores lists generated by the application\. -+ Amazon RDS – Stores a copy of processed records in a relational database\. -+ AWS Secrets Manager – Stores the database password\. -+ Amazon VPC – Provides a private local network for communication between the function and database\. - -**Pricing** -Standard charges apply for each service\. - -The application processes JSON documents from clients that contain information necessary to update a list\. It supports two types of list: tally and ranking\. A *tally* contains values that are added to the current value for key if it exists\. Each entry processed for a user increases the value of a key in the specified table\. - -The following example shows a document that increases the `xp` \(experience points\) value for a user's `stats` list\. - -**Example record – Tally type** - -``` -{ - "title": "stats", - "user": "bill", - "type": "tally", - "entries": { - "xp": 83 - } -} -``` - -A *ranking* contains a list of entries where the value is the order in which they are ranked\. A ranking can be updated with different values that overwrite the current value, instead of incrementing it\. The following example shows a ranking of favorite movies: - -**Example record – Ranking type** - -``` -{ - "title": "favorite movies", - "user": "mike", - "type": "rank", - "entries": { - "blade runner": 1, - "the empire strikes back": 2, - "alien": 3 - } -} -``` - -A Lambda [event source mapping](invocation-eventsourcemapping.md) read records from the stream in batches and invokes the processor function\. The event that the function handler received contains an array of objects that each contain details about a record, such as when it was received, details about the stream, and an encoded representation of the original record document\. - -**Example [events/kinesis\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/events/kinesis.json) – Record** - -``` -{ - "Records": [ - { - "kinesis": { - "kinesisSchemaVersion": "1.0", - "partitionKey": "0", - "sequenceNumber": "49598630142999655949899443842509554952738656579378741250", - "data": "eyJ0aXRsZSI6ICJmYXZvcml0ZSBtb3ZpZXMiLCAidXNlciI6ICJyZGx5c2N0IiwgInR5cGUiOiAicmFuayIsICJlbnRyaWVzIjogeyJibGFkZSBydW5uZXIiOiAyLCAidGhlIGVtcGlyZSBzdHJpa2VzIGJhY2siOiAzLCAiYWxpZW4iOiAxfX0=", - "approximateArrivalTimestamp": 1570667770.615 - }, - "eventSource": "aws:kinesis", - "eventVersion": "1.0", - "eventID": "shardId-000000000000:49598630142999655949899443842509554952738656579378741250", - "eventName": "aws:kinesis:record", - "invokeIdentityArn": "arn:aws:iam::123456789012:role/list-manager-processorRole-7FYXMPLH7IUS", - "awsRegion": "us-east-2", - "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/list-manager-stream-87B3XMPLF1AZ" - }, - ... -``` - -When it's decoded, the data contains a record\. The function uses the record to update the user's list and an aggregate list that stores accumulated values across all users\. It also stores a copy of the event in the application's database\. - -## Instrumentation with AWS X\-Ray - -The application uses [AWS X\-Ray](services-xray.md) to trace function invocations and the calls that functions make to AWS services\. X\-Ray uses the trace data that it receives from functions to create a service map that helps you identify errors\. - -The Node\.js function is configured for active tracing in the template, and is instrumented with the AWS X\-Ray SDK for Node\.js in code\. The X\-Ray SDK records a subsegment for each call made with an AWS SDK or MySQL client\. - -The function uses the AWS SDK for JavaScript in Node\.js to read and write to two tables for each record\. The primary table stores the current state of each combination of list name and user\. The aggregate table stores lists that combine data from multiple users\. - -## AWS CloudFormation templates and additional resources - -The application is implemented in Node\.js modules and deployed with an AWS CloudFormation template and shell scripts\. The application template creates two functions, a Kinesis stream, DynamoDB tables and the following supporting resources\. - -**Application resources** -+ Execution role – An IAM role that grants the functions permission to access other AWS services\. -+ Lambda event source mapping – Reads records from the data stream and invokes the function\. - -View the [application template](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml) on GitHub\. - -A second template, [template\-vpcrds\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/list-manager/template.yml), creates the Amazon VPC and database resources\. While it is possible to create all of the resources in one template, separating them makes it easier to clean up the application and allows the database to be reused with multiple applications\. - -**Infrastructure resources** -+ VPC – A virtual private cloud network with private subnets, a route table, and a VPC endpoint that allows the function to communicate with DynamoDB without an internet connection\. -+ Database – An Amazon RDS database instance and a subnet group that connects it to the VPC\. \ No newline at end of file diff --git a/doc_source/sdk-general-information-section.md b/doc_source/sdk-general-information-section.md deleted file mode 100644 index 40d3ebcc..00000000 --- a/doc_source/sdk-general-information-section.md +++ /dev/null @@ -1,23 +0,0 @@ -# Using Lambda with an AWS SDK - -AWS software development kits \(SDKs\) are available for many popular programming languages\. Each SDK provides an API, code examples, and documentation that make it easier for developers to build applications in their preferred language\. - - -| SDK documentation | Code examples | -| --- | --- | -| [AWS SDK for C\+\+](https://docs.aws.amazon.com/sdk-for-cpp) | [AWS SDK for C\+\+ code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp) | -| [AWS SDK for Go](https://docs.aws.amazon.com/sdk-for-go) | [AWS SDK for Go code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2) | -| [AWS SDK for Java](https://docs.aws.amazon.com/sdk-for-java) | [AWS SDK for Java code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javav2) | -| [AWS SDK for JavaScript](https://docs.aws.amazon.com/sdk-for-javascript) | [AWS SDK for JavaScript code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/javascriptv3) | -| [AWS SDK for Kotlin](https://docs.aws.amazon.com/sdk-for-kotlin) | [AWS SDK for Kotlin code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/kotlin) | -| [AWS SDK for \.NET](https://docs.aws.amazon.com/sdk-for-net) | [AWS SDK for \.NET code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv3) | -| [AWS SDK for PHP](https://docs.aws.amazon.com/sdk-for-php) | [AWS SDK for PHP code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/php) | -| [AWS SDK for Python \(Boto3\)](https://docs.aws.amazon.com/pythonsdk) | [AWS SDK for Python \(Boto3\) code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python) | -| [AWS SDK for Ruby](https://docs.aws.amazon.com/sdk-for-ruby) | [AWS SDK for Ruby code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/ruby) | -| [AWS SDK for Rust](https://docs.aws.amazon.com/sdk-for-rust) | [AWS SDK for Rust code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rust_dev_preview) | -| [AWS SDK for Swift](https://docs.aws.amazon.com/sdk-for-swift) | [AWS SDK for Swift code examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/swift) | - -For examples specific to Lambda, see [Code examples for Lambda using AWS SDKs](service_code_examples.md)\. - -**Example availability** -Can't find what you need? Request a code example by using the **Provide feedback** link at the bottom of this page\. \ No newline at end of file diff --git a/doc_source/security-compliance.md b/doc_source/security-compliance.md deleted file mode 100644 index bf7e3550..00000000 --- a/doc_source/security-compliance.md +++ /dev/null @@ -1,14 +0,0 @@ -# Compliance validation for AWS Lambda - -Third\-party auditors assess the security and compliance of AWS Lambda as part of multiple AWS compliance programs\. These include SOC, PCI, FedRAMP, HIPAA, and others\. - -For a list of AWS services in scope of specific compliance programs, see [AWS services in scope by compliance program](http://aws.amazon.com/compliance/services-in-scope/)\. For general information, see [AWS compliance programs](http://aws.amazon.com/compliance/programs/)\. - -You can download third\-party audit reports using AWS Artifact\. For more information, see [Downloading reports in AWS artifact](https://docs.aws.amazon.com/artifact/latest/ug/downloading-documents.html)\. - -Your compliance responsibility when using Lambda is determined by the sensitivity of your data, your company's compliance objectives, and applicable laws and regulations\. AWS provides the following resources to help with compliance: -+ [Security and compliance quick start guides](http://aws.amazon.com/quickstart/?awsf.quickstart-homepage-filter=categories%23security-identity-compliance) – These deployment guides discuss architectural considerations and provide steps for deploying security\- and compliance\-focused baseline environments on AWS\. -+ [Architecting for HIPAA security and compliance whitepaper ](https://d0.awsstatic.com/whitepapers/compliance/AWS_HIPAA_Compliance_Whitepaper.pdf) – This whitepaper describes how companies can use AWS to create HIPAA\-compliant applications\. -+ [AWS compliance resources](http://aws.amazon.com/compliance/resources/) – This collection of workbooks and guides might apply to your industry and location\. -+ [AWS Config](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) – This AWS service assesses how well your resource configurations comply with internal practices, industry guidelines, and regulations\. -+ [AWS Security Hub](https://docs.aws.amazon.com/securityhub/latest/userguide/what-is-securityhub.html) – This AWS service provides a comprehensive view of your security state within AWS that helps you check your compliance with security industry standards and best practices\. \ No newline at end of file diff --git a/doc_source/security-configuration.md b/doc_source/security-configuration.md deleted file mode 100644 index 3abaed8c..00000000 --- a/doc_source/security-configuration.md +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration and vulnerability analysis in AWS Lambda - -AWS Lambda provides [runtimes](lambda-runtimes.md) that run your function code in an Amazon Linux–based execution environment\. Lambda is responsible for keeping software in the runtime and execution environment up to date, releasing new runtimes for new languages and frameworks, and deprecating runtimes when the underlying software is no longer supported\. - -If you use additional libraries with your function, you're responsible for updating the libraries\. You can include additional libraries in the [deployment package](images-create.md), or in [layers](configuration-layers.md) that you attach to your function\. You can also build [custom runtimes](runtimes-custom.md) and use layers to share them with other accounts\. - -Lambda deprecates runtimes when the software on the runtime or its execution environment reaches end of life\. When Lambda deprecates a runtime, you're responsible for migrating your functions to a supported runtime for the same language or framework\. For details, see [Runtime deprecation policy](lambda-runtimes.md#runtime-support-policy)\. \ No newline at end of file diff --git a/doc_source/security-dataprotection.md b/doc_source/security-dataprotection.md deleted file mode 100644 index f64307f8..00000000 --- a/doc_source/security-dataprotection.md +++ /dev/null @@ -1,35 +0,0 @@ -# Data protection in AWS Lambda - -The AWS [shared responsibility model](http://aws.amazon.com/compliance/shared-responsibility-model/) applies to data protection in AWS Lambda\. As described in this model, AWS is responsible for protecting the global infrastructure that runs all of the AWS Cloud\. You are responsible for maintaining control over your content that is hosted on this infrastructure\. This content includes the security configuration and management tasks for the AWS services that you use\. For more information about data privacy, see the [Data Privacy FAQ](http://aws.amazon.com/compliance/data-privacy-faq)\. For information about data protection in Europe, see the [AWS Shared Responsibility Model and GDPR](http://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) blog post on the *AWS Security Blog*\. - -For data protection purposes, we recommend that you protect AWS account credentials and set up individual user accounts with AWS Identity and Access Management \(IAM\)\. That way each user is given only the permissions necessary to fulfill their job duties\. We also recommend that you secure your data in the following ways: -+ Use multi\-factor authentication \(MFA\) with each account\. -+ Use SSL/TLS to communicate with AWS resources\. We recommend TLS 1\.2 or later\. -+ Set up API and user activity logging with AWS CloudTrail\. -+ Use AWS encryption solutions, along with all default security controls within AWS services\. -+ Use advanced managed security services such as Amazon Macie, which assists in discovering and securing personal data that is stored in Amazon S3\. -+ If you require FIPS 140\-2 validated cryptographic modules when accessing AWS through a command line interface or an API, use a FIPS endpoint\. For more information about the available FIPS endpoints, see [Federal Information Processing Standard \(FIPS\) 140\-2](http://aws.amazon.com/compliance/fips/)\. - -We strongly recommend that you never put confidential or sensitive information, such as your customers' email addresses, into tags or free\-form fields such as a **Name** field\. This includes when you work with Lambda or other AWS services using the console, API, AWS CLI, or AWS SDKs\. Any data that you enter into tags or free\-form fields used for names may be used for billing or diagnostic logs\. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server\. - -**Topics** -+ [Encryption in transit](#security-privacy-intransit) -+ [Encryption at rest](#security-privacy-atrest) - -## Encryption in transit - -Lambda API endpoints only support secure connections over HTTPS\. When you manage Lambda resources with the AWS Management Console,AWS SDK, or the Lambda API, all communication is encrypted with Transport Layer Security \(TLS\)\. For a full list of API endpoints, see [AWS Regions and endpoints](https://docs.aws.amazon.com/general/latest/gr/rande.html) in the AWS General Reference\. - -When you [connect your function to a file system](configuration-filesystem.md), Lambda uses encryption in transit for all connections\. For more information, see [Data encryption in Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/encryption.html) in the *Amazon Elastic File System User Guide*\. - -When you use [environment variables](configuration-envvars.md), you can enable console encryption helpers to use client\-side encryption to protect the environment variables in transit\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. - -## Encryption at rest - -You can use [environment variables](configuration-envvars.md) to store secrets securely for use with Lambda functions\. Lambda always encrypts environment variables at rest\. By default, Lambda uses an AWS KMS key that Lambda creates in your account to encrypt your environment variables\. This AWS managed key is named `aws/lambda`\. - -On a per\-function basis, you can optionally configure Lambda to use a customer managed key instead of the default AWS managed key to encrypt your environment variables\. For more information, see [Securing environment variables](configuration-envvars.md#configuration-envvars-encryption)\. - -Lambda always encrypts files that you upload to Lambda, including [deployment packages](images-create.md) and [layer archives](configuration-layers.md)\. - -Amazon CloudWatch Logs and AWS X\-Ray also encrypt data by default, and can be configured to use a customer managed key\. For details, see [Encrypt log data in CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) and [Data protection in AWS X\-Ray](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-encryption.html)\. \ No newline at end of file diff --git a/doc_source/security-iam.md b/doc_source/security-iam.md deleted file mode 100644 index bddfe611..00000000 --- a/doc_source/security-iam.md +++ /dev/null @@ -1,98 +0,0 @@ -# Identity and access management for Lambda - -AWS Identity and Access Management \(IAM\) is an AWS service that helps an administrator securely control access to AWS resources\. IAM administrators control who can be *authenticated* \(signed in\) and *authorized* \(have permissions\) to use Lambda resources\. IAM is an AWS service that you can use with no additional charge\. - -**Topics** -+ [Audience](#security_iam_audience) -+ [Authenticating with identities](#security_iam_authentication) -+ [Managing access using policies](#security_iam_access-manage) -+ [How AWS Lambda works with IAM](security_iam_service-with-iam.md) -+ [AWS Lambda identity\-based policy examples](security_iam_id-based-policy-examples.md) -+ [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md) - -## Audience - -How you use AWS Identity and Access Management \(IAM\) differs, depending on the work that you do in Lambda\. - -**Service user** – If you use the Lambda service to do your job, then your administrator provides you with the credentials and permissions that you need\. As you use more Lambda features to do your work, you might need additional permissions\. Understanding how access is managed can help you request the right permissions from your administrator\. If you cannot access a feature in Lambda, see [Troubleshooting AWS Lambda identity and access](security_iam_troubleshoot.md)\. - -**Service administrator** – If you're in charge of Lambda resources at your company, you probably have full access to Lambda\. It's your job to determine which Lambda features and resources your service users should access\. You must then submit requests to your IAM administrator to change the permissions of your service users\. Review the information on this page to understand the basic concepts of IAM\. To learn more about how your company can use IAM with Lambda, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. - -**IAM administrator** – If you're an IAM administrator, you might want to learn details about how you can write policies to manage access to Lambda\. To view example Lambda identity\-based policies that you can use in IAM, see [AWS Lambda identity\-based policy examples](security_iam_id-based-policy-examples.md)\. - -## Authenticating with identities - -Authentication is how you sign in to AWS using your identity credentials\. For more information about signing in using the AWS Management Console, see [Signing in to the AWS Management Console as an IAM user or root user](https://docs.aws.amazon.com/IAM/latest/UserGuide/console.html) in the *IAM User Guide*\. - -You must be *authenticated* \(signed in to AWS\) as the AWS account root user, an IAM user, or by assuming an IAM role\. You can also use your company's single sign\-on authentication or even sign in using Google or Facebook\. In these cases, your administrator previously set up identity federation using IAM roles\. When you access AWS using credentials from another company, you are assuming a role indirectly\. - -To sign in directly to the [AWS Management Console](https://console.aws.amazon.com/), use your password with your root user email address or your IAM user name\. You can access AWS programmatically using your root user or IAM users access keys\. AWS provides SDK and command line tools to cryptographically sign your request using your credentials\. If you don't use AWS tools, you must sign the request yourself\. Do this using *Signature Version 4*, a protocol for authenticating inbound API requests\. For more information about authenticating requests, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) in the *AWS General Reference*\. - -Regardless of the authentication method that you use, you might also be required to provide additional security information\. For example, AWS recommends that you use multi\-factor authentication \(MFA\) to increase the security of your account\. To learn more, see [Using multi\-factor authentication \(MFA\) in AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html) in the *IAM User Guide*\. - -### AWS account root user - - When you create an AWS account, you begin with one sign\-in identity that has complete access to all AWS services and resources in the account\. This identity is called the AWS account *root user* and is accessed by signing in with the email address and password that you used to create the account\. We strongly recommend that you do not use the root user for your everyday tasks\. Safeguard your root user credentials and use them to perform the tasks that only the root user can perform\. For the complete list of tasks that require you to sign in as the root user, see [Tasks that require root user credentials](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root) in the *AWS General Reference*\. - -### IAM users and groups - -An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity within your AWS account that has specific permissions for a single person or application\. An IAM user can have long\-term credentials such as a user name and password or a set of access keys\. To learn how to generate access keys, see [Managing access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) in the *IAM User Guide*\. When you generate access keys for an IAM user, make sure you view and securely save the key pair\. You cannot recover the secret access key in the future\. Instead, you must generate a new access key pair\. - -An [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) is an identity that specifies a collection of IAM users\. You can't sign in as a group\. You can use groups to specify permissions for multiple users at a time\. Groups make permissions easier to manage for large sets of users\. For example, you could have a group named *IAMAdmins* and give that group permissions to administer IAM resources\. - -Users are different from roles\. A user is uniquely associated with one person or application, but a role is intended to be assumable by anyone who needs it\. Users have permanent long\-term credentials, but roles provide temporary credentials\. To learn more, see [When to create an IAM user \(instead of a role\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose) in the *IAM User Guide*\. - -### IAM roles - -An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity within your AWS account that has specific permissions\. It is similar to an IAM user, but is not associated with a specific person\. You can temporarily assume an IAM role in the AWS Management Console by [switching roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)\. You can assume a role by calling an AWS CLI or AWS API operation or by using a custom URL\. For more information about methods for using roles, see [Using IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the *IAM User Guide*\. - -IAM roles with temporary credentials are useful in the following situations: -+ **Temporary IAM user permissions** – An IAM user can assume an IAM role to temporarily take on different permissions for a specific task\. -+ **Federated user access** – Instead of creating an IAM user, you can use existing identities from AWS Directory Service, your enterprise user directory, a web identity provider, or the IAM Identity Center identity store\. These identities are known as *federated identities*\. To assign permissions to federated identities, you can create a role and define permissions for the role\. When an external identity authenticates, the identity is associated with the role and is granted the permissions that are defined by it\. If you use IAM Identity Center, you configure a permission set\. IAM Identity Center correlates the permission set to a role in IAM to control what your identities can access after they authenticate\. For more information about identity federation, see [ Creating a role for a third\-party Identity Provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp.html) in the *IAM User Guide*\. For more information about IAM Identity Center, see [ What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *AWS IAM Identity Center \(successor to AWS Single Sign\-On\) User Guide*\. -+ **Cross\-account access** – You can use an IAM role to allow someone \(a trusted principal\) in a different account to access resources in your account\. Roles are the primary way to grant cross\-account access\. However, with some AWS services, you can attach a policy directly to a resource \(instead of using a role as a proxy\)\. To learn the difference between roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. -+ **Cross\-service access** – Some AWS services use features in other AWS services\. For example, when you make a call in a service, it's common for that service to run applications in Amazon EC2 or store objects in Amazon S3\. A service might do this using the calling principal's permissions, using a service role, or using a service\-linked role\. - + **Principal permissions** – When you use an IAM user or role to perform actions in AWS, you are considered a principal\. Policies grant permissions to a principal\. When you use some services, you might perform an action that then triggers another action in a different service\. In this case, you must have permissions to perform both actions\. To see whether an action requires additional dependent actions in a policy, see [Actions, Resources, and Condition Keys for AWS Lambda](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html) in the *Service Authorization Reference*\. - + **Service role** – A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf\. An IAM administrator can create, modify, and delete a service role from within IAM\. For more information, see [Creating a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*\. - + **Service\-linked role** – A service\-linked role is a type of service role that is linked to an AWS service\. The service can assume the role to perform an action on your behalf\. Service\-linked roles appear in your IAM account and are owned by the service\. An IAM administrator can view, but not edit the permissions for service\-linked roles\. -+ **Applications running on Amazon EC2** – You can use an IAM role to manage temporary credentials for applications that are running on an EC2 instance and making AWS CLI or AWS API requests\. This is preferable to storing access keys within the EC2 instance\. To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance\. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials\. For more information, see [Using an IAM role to grant permissions to applications running on Amazon EC2 instances](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) in the *IAM User Guide*\. - -To learn whether to use IAM roles or IAM users, see [When to create an IAM role \(instead of a user\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html#id_which-to-choose_role) in the *IAM User Guide*\. - -## Managing access using policies - -You control access in AWS by creating policies and attaching them to AWS identities or resources\. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions\. AWS evaluates these policies when a principal \(user, root user, or role session\) makes a request\. Permissions in the policies determine whether the request is allowed or denied\. Most policies are stored in AWS as JSON documents\. For more information about the structure and contents of JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*\. - -Administrators can use AWS JSON policies to specify who has access to what\. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**\. - -Every IAM entity \(user or role\) starts with no permissions\. By default, users can do nothing, not even change their own password\. To give a user permission to do something, an administrator must attach a permissions policy to a user\. Or the administrator can add the user to a group that has the intended permissions\. When an administrator gives permissions to a group, all users in that group are granted those permissions\. - -IAM policies define permissions for an action regardless of the method that you use to perform the operation\. For example, suppose that you have a policy that allows the `iam:GetRole` action\. A user with that policy can get role information from the AWS Management Console, the AWS CLI, or the AWS API\. - -### Identity\-based policies - -Identity\-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role\. These policies control what actions users and roles can perform, on which resources, and under what conditions\. To learn how to create an identity\-based policy, see [Creating IAM policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*\. - -Identity\-based policies can be further categorized as *inline policies* or *managed policies*\. Inline policies are embedded directly into a single user, group, or role\. Managed policies are standalone policies that you can attach to multiple users, groups, and roles in your AWS account\. Managed policies include AWS managed policies and customer managed policies\. To learn how to choose between a managed policy or an inline policy, see [Choosing between managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#choosing-managed-or-inline) in the *IAM User Guide*\. - -### Resource\-based policies - -Resource\-based policies are JSON policy documents that you attach to a resource\. Examples of resource\-based policies are IAM *role trust policies* and Amazon S3 *bucket policies*\. In services that support resource\-based policies, service administrators can use them to control access to a specific resource\. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions\. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource\-based policy\. Principals can include accounts, users, roles, federated users, or AWS services\. - -Resource\-based policies are inline policies that are located in that service\. You can't use AWS managed policies from IAM in a resource\-based policy\. - -### Access control lists \(ACLs\) - -Access control lists \(ACLs\) control which principals \(account members, users, or roles\) have permissions to access a resource\. ACLs are similar to resource\-based policies, although they do not use the JSON policy document format\. - -Amazon S3, AWS WAF, and Amazon VPC are examples of services that support ACLs\. To learn more about ACLs, see [Access control list \(ACL\) overview](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) in the *Amazon Simple Storage Service Developer Guide*\. - -### Other policy types - -AWS supports additional, less\-common policy types\. These policy types can set the maximum permissions granted to you by the more common policy types\. -+ **Permissions boundaries** – A permissions boundary is an advanced feature in which you set the maximum permissions that an identity\-based policy can grant to an IAM entity \(IAM user or role\)\. You can set a permissions boundary for an entity\. The resulting permissions are the intersection of entity's identity\-based policies and its permissions boundaries\. Resource\-based policies that specify the user or role in the `Principal` field are not limited by the permissions boundary\. An explicit deny in any of these policies overrides the allow\. For more information about permissions boundaries, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*\. -+ **Service control policies \(SCPs\)** – SCPs are JSON policies that specify the maximum permissions for an organization or organizational unit \(OU\) in AWS Organizations\. AWS Organizations is a service for grouping and centrally managing multiple AWS accounts that your business owns\. If you enable all features in an organization, then you can apply service control policies \(SCPs\) to any or all of your accounts\. The SCP limits permissions for entities in member accounts, including each AWS account root user\. For more information about Organizations and SCPs, see [How SCPs work](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html) in the *AWS Organizations User Guide*\. -+ **Session policies** – Session policies are advanced policies that you pass as a parameter when you programmatically create a temporary session for a role or federated user\. The resulting session's permissions are the intersection of the user or role's identity\-based policies and the session policies\. Permissions can also come from a resource\-based policy\. An explicit deny in any of these policies overrides the allow\. For more information, see [Session policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*\. - -### Multiple policy types - -When multiple types of policies apply to a request, the resulting permissions are more complicated to understand\. To learn how AWS determines whether to allow a request when multiple policy types are involved, see [Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/security-infrastructure.md b/doc_source/security-infrastructure.md deleted file mode 100644 index 0484b839..00000000 --- a/doc_source/security-infrastructure.md +++ /dev/null @@ -1,7 +0,0 @@ -# Infrastructure security in AWS Lambda - -As a managed service, AWS Lambda is protected by the AWS global network security procedures that are described in the [ Best Practices for Security, Identity, and Compliance](http://aws.amazon.com/architecture/security-identity-compliance/)\. - -You use AWS published API calls to access Lambda through the network\. Clients must support Transport Layer Security \(TLS\) 1\.0 or later\. We recommend TLS 1\.2 or later\. Clients must also support cipher suites with perfect forward secrecy \(PFS\) such as Ephemeral Diffie\-Hellman \(DHE\) or Elliptic Curve Ephemeral Diffie\-Hellman \(ECDHE\)\. Most modern systems such as Java 7 and later support these modes\. - -Additionally, requests must be signed by using an access key ID and a secret access key that is associated with an IAM principal\. Or you can use the [AWS Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html) \(AWS STS\) to generate temporary security credentials to sign requests\. \ No newline at end of file diff --git a/doc_source/security-resilience.md b/doc_source/security-resilience.md deleted file mode 100644 index 4e9450c7..00000000 --- a/doc_source/security-resilience.md +++ /dev/null @@ -1,13 +0,0 @@ -# Resilience in AWS Lambda - -The AWS global infrastructure is built around AWS Regions and Availability Zones\. AWS Regions provide multiple physically separated and isolated Availability Zones, which are connected with low\-latency, high\-throughput, and highly redundant networking\. With Availability Zones, you can design and operate applications and databases that automatically fail over between Availability Zones without interruption\. Availability Zones are more highly available, fault tolerant, and scalable than traditional single or multiple data center infrastructures\. - -For more information about AWS Regions and Availability Zones, see [AWS global infrastructure](http://aws.amazon.com/about-aws/global-infrastructure/)\. - -In addition to the AWS global infrastructure, Lambda offers several features to help support your data resiliency and backup needs\. -+ **Versioning** – You can use versioning in Lambda to save your function's code and configuration as you develop it\. Together with aliases, you can use versioning to perform blue/green and rolling deployments\. For details, see [Lambda function versions](configuration-versions.md)\. -+ **Scaling** – When your function receives a request while it's processing a previous request, Lambda launches another instance of your function to handle the increased load\. Lambda automatically scales to handle 1,000 concurrent executions per Region, a [quota](gettingstarted-limits.md) that can be increased if needed\. For details, see [Lambda function scaling](invocation-scaling.md)\. -+ **High availability** – Lambda runs your function in multiple Availability Zones to ensure that it is available to process events in case of a service interruption in a single zone\. If you configure your function to connect to a virtual private cloud \(VPC\) in your account, specify subnets in multiple Availability Zones to ensure high availability\. For details, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. -+ **Reserved concurrency** – To make sure that your function can always scale to handle additional requests, you can reserve concurrency for it\. Setting reserved concurrency for a function ensures that it can scale to, but not exceed, a specified number of concurrent invocations\. This ensures that you don't lose requests due to other functions consuming all of the available concurrency\. For details, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. -+ **Retries** – For asynchronous invocations and a subset of invocations triggered by other services, Lambda automatically retries on error with delays between retries\. Other clients and AWS services that invoke functions synchronously are responsible for performing retries\. For details, see [Error handling and automatic retries in AWS Lambda](invocation-retries.md)\. -+ **Dead\-letter queue** – For asynchronous invocations, you can configure Lambda to send requests to a dead\-letter queue if all retries fail\. A dead\-letter queue is an Amazon SNS topic or Amazon SQS queue that receives events for troubleshooting or reprocessing\. For details, see [Dead\-letter queues](invocation-async.md#invocation-dlq)\. \ No newline at end of file diff --git a/doc_source/security_iam_id-based-policy-examples.md b/doc_source/security_iam_id-based-policy-examples.md deleted file mode 100644 index c64bbf4b..00000000 --- a/doc_source/security_iam_id-based-policy-examples.md +++ /dev/null @@ -1,66 +0,0 @@ -# AWS Lambda identity\-based policy examples - -By default, IAM users and roles don't have permission to create or modify Lambda resources\. They also can't perform tasks using the AWS Management Console, AWS CLI, or AWS API\. An IAM administrator must create IAM policies that grant users and roles permission to perform specific API operations on the specified resources they need\. The administrator must then attach those policies to the IAM users or groups that require those permissions\. - -To learn how to create an IAM identity\-based policy using these example JSON policy documents, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html#access_policies_create-json-editor) in the *IAM User Guide*\. - -**Topics** -+ [Policy best practices](#security_iam_service-with-iam-policy-best-practices) -+ [Using the Lambda console](#security_iam_id-based-policy-examples-console) -+ [Allow users to view their own permissions](#security_iam_id-based-policy-examples-view-own-permissions) - -## Policy best practices - -Identity\-based policies determine whether someone can create, access, or delete Lambda resources in your account\. These actions can incur costs for your AWS account\. When you create or edit identity\-based policies, follow these guidelines and recommendations: -+ **Get started with AWS managed policies and move toward least\-privilege permissions** – To get started granting permissions to your users and workloads, use the *AWS managed policies* that grant permissions for many common use cases\. They are available in your AWS account\. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases\. For more information, see [AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies) or [AWS managed policies for job functions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html) in the *IAM User Guide*\. -+ **Apply least\-privilege permissions** – When you set permissions with IAM policies, grant only the permissions required to perform a task\. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as *least\-privilege permissions*\. For more information about using IAM to apply permissions, see [ Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*\. -+ **Use conditions in IAM policies to further restrict access** – You can add a condition to your policies to limit access to actions and resources\. For example, you can write a policy condition to specify that all requests must be sent using SSL\. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation\. For more information, see [ IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*\. -+ **Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions** – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language \(JSON\) and IAM best practices\. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies\. For more information, see [IAM Access Analyzer policy validation](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html) in the *IAM User Guide*\. -+ **Require multi\-factor authentication \(MFA\)** – If you have a scenario that requires IAM users or root users in your account, turn on MFA for additional security\. To require MFA when API operations are called, add MFA conditions to your policies\. For more information, see [ Configuring MFA\-protected API access](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html) in the *IAM User Guide*\. - -For more information about best practices in IAM, see [Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM User Guide*\. - -## Using the Lambda console - -To access the AWS Lambda console, you must have a minimum set of permissions\. These permissions must allow you to list and view details about the Lambda resources in your AWS account\. If you create an identity\-based policy that is more restrictive than the minimum required permissions, the console won't function as intended for entities \(IAM users or roles\) with that policy\. - -For an example policy that grants minimal access for function development, see [Function development](access-control-identity-based.md#permissions-user-function)\. In addition to Lambda APIs, the Lambda console uses other services to display trigger configuration and let you add new triggers\. If your users use Lambda with other services, they need access to those services as well\. For details on configuring other services with Lambda, see [Using AWS Lambda with other services](lambda-services.md)\. - -## Allow users to view their own permissions - -This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity\. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "ViewOwnUserInfo", - "Effect": "Allow", - "Action": [ - "iam:GetUserPolicy", - "iam:ListGroupsForUser", - "iam:ListAttachedUserPolicies", - "iam:ListUserPolicies", - "iam:GetUser" - ], - "Resource": ["arn:aws:iam::*:user/${aws:username}"] - }, - { - "Sid": "NavigateInConsole", - "Effect": "Allow", - "Action": [ - "iam:GetGroupPolicy", - "iam:GetPolicyVersion", - "iam:GetPolicy", - "iam:ListAttachedGroupPolicies", - "iam:ListGroupPolicies", - "iam:ListPolicyVersions", - "iam:ListPolicies", - "iam:ListUsers" - ], - "Resource": "*" - } - ] -} -``` \ No newline at end of file diff --git a/doc_source/security_iam_service-with-iam.md b/doc_source/security_iam_service-with-iam.md deleted file mode 100644 index 842650e0..00000000 --- a/doc_source/security_iam_service-with-iam.md +++ /dev/null @@ -1,5 +0,0 @@ -# How AWS Lambda works with IAM - -Before you use IAM to manage access to Lambda, you should understand what IAM features are available to use with Lambda\. To get a high\-level view of how Lambda and other AWS services work with IAM, see [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*\. - -For an overview of permissions, policies, and roles as they are used by Lambda, see [Lambda permissions](lambda-permissions.md)\. \ No newline at end of file diff --git a/doc_source/security_iam_troubleshoot.md b/doc_source/security_iam_troubleshoot.md deleted file mode 100644 index 89e509bf..00000000 --- a/doc_source/security_iam_troubleshoot.md +++ /dev/null @@ -1,89 +0,0 @@ -# Troubleshooting AWS Lambda identity and access - -Use the following information to help you diagnose and fix common issues that you might encounter when working with Lambda and IAM\. - -**Topics** -+ [I am not authorized to perform an action in Lambda](#security_iam_troubleshoot-no-permissions) -+ [I am not authorized to perform iam:PassRole](#security_iam_troubleshoot-passrole) -+ [I want to view my access keys](#security_iam_troubleshoot-access-keys) -+ [I'm an administrator and want to allow others to access Lambda](#security_iam_troubleshoot-admin-delegate) -+ [I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated](#security_iam_troubleshoot-admin-deprecation) -+ [I want to allow people outside of my AWS account to access my Lambda resources](#security_iam_troubleshoot-cross-account-access) - -## I am not authorized to perform an action in Lambda - -If the AWS Management Console tells you that you're not authorized to perform an action, then you must contact your administrator for assistance\. Your administrator is the person that provided you with your user name and password\. - -The following example error occurs when the `mateojackson` IAM user tries to use the console to view details about a function but does not have `lambda:GetFunction` permissions\. - -``` -User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: lambda:GetFunction on resource: my-function -``` - -In this case, Mateo asks his administrator to update his policies to allow him to access the `my-function` resource using the `lambda:GetFunction` action\. - -## I am not authorized to perform iam:PassRole - -If you receive an error that you're not authorized to perform the `iam:PassRole` action, your policies must be updated to allow you to pass a role to Lambda\. - -Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service\-linked role\. To do this, you must have permissions to pass the role to the service\. - -The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Lambda\. However, the action requires the service to have permissions that are granted by a service role\. Mary does not have permissions to pass the role to the service\. - -``` -User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole -``` - -In this case, Mary's policies must be updated to allow her to perform the `iam:PassRole` action\. - -If you need help, contact your AWS administrator\. Your administrator is the person who provided you with your sign\-in credentials\. - -## I want to view my access keys - -After you create your IAM user access keys, you can view your access key ID at any time\. However, you can't view your secret access key again\. If you lose your secret key, you must create a new access key pair\. - -Access keys consist of two parts: an access key ID \(for example, `AKIAIOSFODNN7EXAMPLE`\) and a secret access key \(for example, `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`\)\. Like a user name and password, you must use both the access key ID and secret access key together to authenticate your requests\. Manage your access keys as securely as you do your user name and password\. - -**Important** - Do not provide your access keys to a third party, even to help [find your canonical user ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId)\. By doing this, you might give someone permanent access to your account\. - -When you create an access key pair, you are prompted to save the access key ID and secret access key in a secure location\. The secret access key is available only at the time you create it\. If you lose your secret access key, you must add new access keys to your IAM user\. You can have a maximum of two access keys\. If you already have two, you must delete one key pair before creating a new one\. To view instructions, see [Managing access keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey) in the *IAM User Guide*\. - -## I'm an administrator and want to allow others to access Lambda - -To allow others to access Lambda, you must create an IAM entity \(user or role\) for the person or application that needs access\. They will use the credentials for that entity to access AWS\. You must then attach a policy to the entity that grants them the correct permissions in Lambda\. - -To get started right away, see [Creating your first IAM delegated user and group](https://docs.aws.amazon.com/IAM/latest/UserGuide/getting-started_create-delegated-user.html) in the *IAM User Guide*\. - -## I'm an administrator and want to migrate from AWS managed policies for Lambda that will be deprecated - -After March 1, 2021, the AWS managed policies **AWSLambdaReadOnlyAccess** and **AWSLambdaFullAccess** will be deprecated and can no longer be attached to new IAM users\. For more information about policy deprecations, see [Deprecated AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-deprecated.html) in the *IAM User Guide*\. - -Lambda has introduced two new AWS managed policies: -+ The **AWSLambda\_ReadOnlyAccess** policy grants read\-only access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaReadOnlyAccess**\. -+ The **AWSLambda\_FullAccess** policy grants full access to Lambda, Lambda console features, and other related AWS services\. This policy was created by scoping down the previous policy **AWSLambdaFullAccess**\. - - - -### Using the AWS managed policies - -We recommend using the newly launched managed policies to grant users, groups, and roles access to Lambda; however, review the permissions granted in the policies to ensure they meet your requirements\. -+ To review the permissions of the **AWSLambda\_ReadOnlyAccess** policy, see the [AWSLambda\_ReadOnlyAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_ReadOnlyAccess$jsonEditor) policy page in the IAM console\. -+ To review the permissions of the **AWSLambda\_FullAccess** policy, see the [AWSLambda\_FullAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSLambda_FullAccess$jsonEditor) policy page in the IAM console\. - -After reviewing the permissions, you can attach the policies to an IAM identity \(groups, users, or roles\)\. For instructions about attaching an AWS managed policy, see [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html) in the *IAM User Guide*\. - -### Using customer managed policies - -If you need more fine\-grained access control or would like to add permissions, you can create your own [customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#customer-managed-policies)\. For more information, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. - -## I want to allow people outside of my AWS account to access my Lambda resources - -You can create a role that users in other accounts or people outside of your organization can use to access your resources\. You can specify who is trusted to assume the role\. For services that support resource\-based policies or access control lists \(ACLs\), you can use those policies to grant people access to your resources\. - -To learn more, consult the following: -+ To learn whether Lambda supports these features, see [How AWS Lambda works with IAM](security_iam_service-with-iam.md)\. -+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*\. -+ To learn how to provide access to your resources to third\-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*\. -+ To learn how to provide access through identity federation, see [Providing access to externally authenticated users \(identity federation\)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*\. -+ To learn the difference between using roles and resource\-based policies for cross\-account access, see [How IAM roles differ from resource\-based policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) in the *IAM User Guide*\. \ No newline at end of file diff --git a/doc_source/service_code_examples.md b/doc_source/service_code_examples.md deleted file mode 100644 index 2a10d86c..00000000 --- a/doc_source/service_code_examples.md +++ /dev/null @@ -1,37 +0,0 @@ -# Code examples for Lambda using AWS SDKs - -The following code examples show how to use Lambda with an AWS software development kit \(SDK\)\. - -The examples are divided into the following categories: - -**Actions** -Code excerpts that show you how to call individual service functions\. - -**Scenarios** -Code examples that show you how to accomplish a specific task by calling multiple functions within the same service\. - -**Cross\-service examples** -Sample applications that work across multiple AWS services\. - -For a complete list of AWS SDK developer guides and code examples, see [Using Lambda with an AWS SDK](sdk-general-information-section.md)\. This topic also includes information about getting started and details about previous SDK versions\. - -**Contents** -+ [Actions](service_code_examples_actions.md) - + [Create a function](example_lambda_CreateFunction_section.md) - + [Delete a function](example_lambda_DeleteFunction_section.md) - + [Get a function](example_lambda_GetFunction_section.md) - + [Invoke a function](example_lambda_Invoke_section.md) - + [List functions](example_lambda_ListFunctions_section.md) - + [Update function code](example_lambda_UpdateFunctionCode_section.md) - + [Update function configuration](example_lambda_UpdateFunctionConfiguration_section.md) -+ [Scenarios](service_code_examples_scenarios.md) - + [Get started with functions](example_lambda_Scenario_GettingStartedFunctions_section.md) -+ [Cross\-service examples](service_code_examples_cross-service_examples.md) - + [Create a REST API to track COVID\-19 data](example_cross_ApiGatewayDataTracker_section.md) - + [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) - + [Create a messenger application](example_cross_StepFunctionsMessenger_section.md) - + [Create a websocket chat application](example_cross_ApiGatewayWebsocketChat_section.md) - + [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) - + [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) - + [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) - + [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_actions.md b/doc_source/service_code_examples_actions.md deleted file mode 100644 index 2e76c5e5..00000000 --- a/doc_source/service_code_examples_actions.md +++ /dev/null @@ -1,14 +0,0 @@ -# Actions for Lambda using AWS SDKs - -The following code examples demonstrate how to perform individual Lambda actions with AWS SDKs\. These excerpts call the Lambda API and are not intended to be run in isolation\. Each example includes a link to GitHub, where you can find instructions on how to set up and run the code in context\. - - The following examples include only the most commonly used actions\. For a complete list, see the [AWS Lambda API Reference](https://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html)\. - -**Topics** -+ [Create a function](example_lambda_CreateFunction_section.md) -+ [Delete a function](example_lambda_DeleteFunction_section.md) -+ [Get a function](example_lambda_GetFunction_section.md) -+ [Invoke a function](example_lambda_Invoke_section.md) -+ [List functions](example_lambda_ListFunctions_section.md) -+ [Update function code](example_lambda_UpdateFunctionCode_section.md) -+ [Update function configuration](example_lambda_UpdateFunctionConfiguration_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_cross-service_examples.md b/doc_source/service_code_examples_cross-service_examples.md deleted file mode 100644 index c604cd2a..00000000 --- a/doc_source/service_code_examples_cross-service_examples.md +++ /dev/null @@ -1,13 +0,0 @@ -# Cross\-service examples for Lambda using AWS SDKs - -The following sample applications use AWS SDKs to combine Lambda with other AWS services\. Each example includes a link to GitHub, where you can find instructions on how to set up and run the application\. - -**Topics** -+ [Create a REST API to track COVID\-19 data](example_cross_ApiGatewayDataTracker_section.md) -+ [Create a lending library REST API](example_cross_AuroraRestLendingLibrary_section.md) -+ [Create a messenger application](example_cross_StepFunctionsMessenger_section.md) -+ [Create a websocket chat application](example_cross_ApiGatewayWebsocketChat_section.md) -+ [Invoke a Lambda function from a browser](example_cross_LambdaForBrowser_section.md) -+ [Use API Gateway to invoke a Lambda function](example_cross_LambdaAPIGateway_section.md) -+ [Use Step Functions to invoke Lambda functions](example_cross_ServerlessWorkflows_section.md) -+ [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md) \ No newline at end of file diff --git a/doc_source/service_code_examples_scenarios.md b/doc_source/service_code_examples_scenarios.md deleted file mode 100644 index d95ea6b0..00000000 --- a/doc_source/service_code_examples_scenarios.md +++ /dev/null @@ -1,6 +0,0 @@ -# Scenarios for Lambda using AWS SDKs - -The following code examples show you how to implement common scenarios in Lambda with AWS SDKs\. These scenarios show you how to accomplish specific tasks by calling multiple functions within Lambda\. Each scenario includes a link to GitHub, where you can find instructions on how to set up and run the code\. - -**Topics** -+ [Get started with functions](example_lambda_Scenario_GettingStartedFunctions_section.md) \ No newline at end of file diff --git a/doc_source/services-alb.md b/doc_source/services-alb.md deleted file mode 100644 index aff96143..00000000 --- a/doc_source/services-alb.md +++ /dev/null @@ -1,74 +0,0 @@ -# Using AWS Lambda with an Application Load Balancer - -You can use a Lambda function to process requests from an Application Load Balancer\. Elastic Load Balancing supports Lambda functions as a target for an Application Load Balancer\. Use load balancer rules to route HTTP requests to a function, based on path or header values\. Process the request and return an HTTP response from your Lambda function\. - -Elastic Load Balancing invokes your Lambda function synchronously with an event that contains the request body and metadata\. - -**Example Application Load Balancer request event** - -``` -{ - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/lambda-279XGJDqGZ5rsrHC2Fjr/49e9d65c45c6791a" - } - }, - "httpMethod": "GET", - "path": "/lambda", - "queryStringParameters": { - "query": "1234ABCD" - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8", - "accept-encoding": "gzip", - "accept-language": "en-US,en;q=0.9", - "connection": "keep-alive", - "host": "lambda-alb-123578498.us-east-2.elb.amazonaws.com", - "upgrade-insecure-requests": "1", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", - "x-amzn-trace-id": "Root=1-5c536348-3d683b8b04734faae651f476", - "x-forwarded-for": "72.12.164.125", - "x-forwarded-port": "80", - "x-forwarded-proto": "http", - "x-imforwards": "20" - }, - "body": "", - "isBase64Encoded": false -} -``` - -Your function processes the event and returns a response document to the load balancer in JSON\. Elastic Load Balancing converts the document to an HTTP success or error response and returns it to the user\. - -**Example response document format** - -``` -{ - "statusCode": 200, - "statusDescription": "200 OK", - "isBase64Encoded": false, - "headers": { - "Content-Type": "text/html" - }, - "body": "

Hello from Lambda!

" -} -``` - -To configure an Application Load Balancer as a function trigger, grant Elastic Load Balancing permission to run the function, create a target group that routes requests to the function, and add a rule to the load balancer that sends requests to the target group\. - -Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. - -``` -aws lambda add-permission --function-name alb-function \ ---statement-id load-balancer --action "lambda:InvokeFunction" \ ---principal elasticloadbalancing.amazonaws.com -``` - -You should see the following output: - -``` -{ - "Statement": "{\"Sid\":\"load-balancer\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"elasticloadbalancing.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:alb-function\"}" -} -``` - -For instructions on configuring the Application Load Balancer listener and target group, see [Lambda functions as a target](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/lambda-functions.html) in the *User Guide for Application Load Balancers*\. diff --git a/doc_source/services-alexa.md b/doc_source/services-alexa.md deleted file mode 100644 index 855ce6b5..00000000 --- a/doc_source/services-alexa.md +++ /dev/null @@ -1,33 +0,0 @@ -# Using AWS Lambda with Alexa - -You can use Lambda functions to build services that give new skills to Alexa, the Voice assistant on Amazon Echo\. The Alexa Skills Kit provides the APIs, tools, and documentation to create these new skills, powered by your own services running as Lambda functions\. Amazon Echo users can access these new skills by asking Alexa questions or making requests\. - -The Alexa Skills Kit is available on GitHub\. -+ [Alexa Skills Kit SDK for Java](https://github.com/alexa/alexa-skills-kit-sdk-for-java) -+ [Alexa Skills Kit SDK for Node\.js ](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs) -+ [Alexa Skills Kit SDK for Python](https://github.com/alexa/alexa-skills-kit-sdk-for-python) - -**Example Alexa smart home event** - -``` -{ - "header": { - "payloadVersion": "1", - "namespace": "Control", - "name": "SwitchOnOffRequest" - }, - "payload": { - "switchControlAction": "TURN_ON", - "appliance": { - "additionalApplianceDetails": { - "key2": "value2", - "key1": "value1" - }, - "applianceId": "sampleId" - }, - "accessToken": "sampleAccessToken" - } -} -``` - -For more information, see [ Host a custom skill as an AWS Lambda Function](https://developer.amazon.com/docs/alexa/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html) in the *Build Skills with the Alexa Skills Kit* guide\. \ No newline at end of file diff --git a/doc_source/services-apigateway-blueprint.md b/doc_source/services-apigateway-blueprint.md deleted file mode 100644 index 2ae4edde..00000000 --- a/doc_source/services-apigateway-blueprint.md +++ /dev/null @@ -1,77 +0,0 @@ -# Create a simple microservice using Lambda and API Gateway - -In this tutorial you will use the Lambda console to create a Lambda function, and an Amazon API Gateway endpoint to trigger that function\. You will be able to call the endpoint with any method \(`GET`, `POST`, `PATCH`, etc\.\) to trigger your Lambda function\. When the endpoint is called, the entire request will be passed through to your Lambda function\. Your function action will depend on the method you call your endpoint with: -+ DELETE: delete an item from a DynamoDB table -+ GET: scan table and return all items -+ POST: Create an item -+ PUT: Update an item - -## Create an API using Amazon API Gateway - -Follow the steps in this section to create a new Lambda function and an API Gateway endpoint to trigger it: - -**To create an API** - -1. Sign in to the AWS Management Console and open the AWS Lambda console\. - -1. Choose **Create Lambda function**\. - -1. Choose **Use a blueprint**\. - -1. Enter **microservice** in the search bar\. Choose the **microservice\-http\-endpoint** blueprint\. - -1. Configure your function with the following settings\. - + **Name** – **lambda\-microservice**\. - + **Role** – **Create a new role from AWS policy templates**\. - + **Role name** – **lambda\-apigateway\-role**\. - + **Policy templates** – **Simple microservice permissions**\. - + **API** – **Create an API**\. - + **API Type** – **HTTP API**\. - + **Security** – **Open**\. - - Choose **Create function**\. - -When you complete the wizard and create your function, Lambda creates a proxy resource named `lambda-microservice` under the API name you selected\. For more information about proxy resources, see [Configure proxy integration for a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html)\. - -A proxy resource has an `AWS_PROXY` integration type and a catch\-all method `ANY`\. The `AWS_PROXY` integration type applies a default mapping template to pass through the entire request to the Lambda function and transforms the output from the Lambda function to HTTP responses\. The `ANY` method defines the same integration setup for all the supported methods, including `GET`, `POST`, `PATCH`, `DELETE `and others\. - -## Test sending an HTTP request - -In this step, you will use the console to test the Lambda function\. In addition, you can run a `curl` command to test the end\-to\-end experience\. That is, [send an HTTP request](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) to your API method and have Amazon API Gateway invoke your Lambda function\. In order to complete the steps, make sure you have created a DynamoDB table and named it "MyTable"\. For more information, see [Create a DynamoDB table with a stream enabled](with-ddb-example.md#with-ddb-create-buckets)\. - -**To test the API** - -1. With your `lambda-microservice` function still open in the Lambda console, choose the **Test** tab\. - -1. Choose **New event**\. - -1. Choose the **Hello World** template\. - -1. In **Name**, enter a name for the test event\. - -1. In the text entry panel, replace the existing text with the following: - - ``` - { - "httpMethod": "GET", - "queryStringParameters": { - "TableName": "MyTable" - } - } - ``` - - This `GET` command scans your DynamoDB table and returns all items found\. - -1. After entering the text above choose **Test**\. - -Verify that the test succeeded\. In the function response, you should see the following: - -``` -{ - "statusCode": "200", - "body": "{\"Items\":[],\"Count\":0,\"ScannedCount\":0}", - "headers": { - "Content-Type": "application/json" - } -} -``` \ No newline at end of file diff --git a/doc_source/services-apigateway-code.md b/doc_source/services-apigateway-code.md deleted file mode 100644 index ec13c87c..00000000 --- a/doc_source/services-apigateway-code.md +++ /dev/null @@ -1,146 +0,0 @@ -# Sample function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js](#services-apigateway-code-nodejs) -+ [Python 3](#services-apigateway-code-python) -+ [Go](#services-apigateway-code-go) - -## Node\.js - -The following example processes messages from API Gateway, and manages DynamoDB documents based on the request method\. - -**Example index\.js** - -``` -console.log('Loading function'); - -var AWS = require('aws-sdk'); -var dynamo = new AWS.DynamoDB.DocumentClient(); - -/** - * Provide an event that contains the following keys: - * - * - operation: one of the operations in the switch statement below - * - tableName: required for operations that interact with DynamoDB - * - payload: a parameter to pass to the operation being performed - */ -exports.handler = function(event, context, callback) { - //console.log('Received event:', JSON.stringify(event, null, 2)); - - var operation = event.operation; - - if (event.tableName) { - event.payload.TableName = event.tableName; - } - - switch (operation) { - case 'create': - dynamo.put(event.payload, callback); - break; - case 'read': - dynamo.get(event.payload, callback); - break; - case 'update': - dynamo.update(event.payload, callback); - break; - case 'delete': - dynamo.delete(event.payload, callback); - break; - case 'list': - dynamo.scan(event.payload, callback); - break; - case 'echo': - callback(null, "Success"); - break; - case 'ping': - callback(null, "pong"); - break; - default: - callback(`Unknown operation: ${operation}`); - } -}; -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Python 3 - -The following example processes messages from API Gateway, and manages DynamoDB documents based on the request method\. - -**Example LambdaFunctionOverHttps\.py** - -``` -from __future__ import print_function - -import boto3 -import json - -print('Loading function') - - -def handler(event, context): - '''Provide an event that contains the following keys: - - - operation: one of the operations in the operations dict below - - tableName: required for operations that interact with DynamoDB - - payload: a parameter to pass to the operation being performed - ''' - #print("Received event: " + json.dumps(event, indent=2)) - - operation = event['operation'] - - if 'tableName' in event: - dynamo = boto3.resource('dynamodb').Table(event['tableName']) - - operations = { - 'create': lambda x: dynamo.put_item(**x), - 'read': lambda x: dynamo.get_item(**x), - 'update': lambda x: dynamo.update_item(**x), - 'delete': lambda x: dynamo.delete_item(**x), - 'list': lambda x: dynamo.scan(**x), - 'echo': lambda x: x, - 'ping': lambda x: 'pong' - } - - if operation in operations: - return operations[operation](event.get('payload')) - else: - raise ValueError('Unrecognized operation "{}"'.format(operation)) -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. - -## Go - -The following example processes messages from API Gateway, and logs information about the request\. - -**Example LambdaFunctionOverHttps\.go** - -``` -import ( - "context" - "fmt" - "github.com/aws/aws-lambda-go/events" - runtime "github.com/aws/aws-lambda-go/lambda" -) - -func main() { - runtime.Start(handleRequest) -} - -func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { - fmt.Printf("Processing request data for request %s.\n", request.RequestContext.RequestID) - fmt.Printf("Body size = %d.\n", len(request.Body)) - - fmt.Println("Headers:") - for key, value := range request.Headers { - fmt.Printf(" %s: %s\n", key, value) - } - - return events.APIGatewayProxyResponse{Body: request.Body, StatusCode: 200}, nil -} -``` - -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/services-apigateway-template.md b/doc_source/services-apigateway-template.md deleted file mode 100644 index a7fffa3b..00000000 --- a/doc_source/services-apigateway-template.md +++ /dev/null @@ -1,25 +0,0 @@ -# AWS SAM template for an API Gateway application - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](services-apigateway-tutorial.md)\. Copy the text below to a file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Resources: - LambdaFunctionOverHttps: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - Policies: AmazonDynamoDBFullAccess - Events: - HttpPost: - Type: Api - Properties: - Path: '/DynamoDBOperations/DynamoDBManager' - Method: post -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/services-apigateway-tutorial.md b/doc_source/services-apigateway-tutorial.md deleted file mode 100644 index 6f64ed33..00000000 --- a/doc_source/services-apigateway-tutorial.md +++ /dev/null @@ -1,494 +0,0 @@ -# Tutorial: Using Lambda with API Gateway - -In this tutorial, you use Amazon API Gateway to create a REST API and a resource \(`DynamoDBManager`\)\. You define one method \(`POST`\) on the resource, and create a Lambda function \(`LambdaFunctionOverHttps`\) that backs the `POST` method\. That way, when you call the API through an HTTPS endpoint, API Gateway invokes the Lambda function\. - -The `POST` method that you define on the `DynamoDBManager` resource supports the following Amazon DynamoDB operations: -+ Create, update, and delete an item\. -+ Read an item\. -+ Scan an item\. -+ Other operations \(echo, ping\), not related to DynamoDB, that you can use for testing\. - -Using API Gateway with Lambda also provides advanced capabilities, such as: -+ **Full request passthrough** – Using the Lambda proxy \(`AWS_PROXY`\) integration type, a Lambda function can receive an entire HTTP request \(instead of just the request body\) and set the HTTP response \(instead of just the response body\)\. -+ **Catch\-all methods** – Using the `ANY` catch\-all method, you can map all methods of an API resource to a single Lambda function with a single mapping\. -+ **Catch\-all resources** – Using a greedy path variable \(`{proxy+}`\), you can map all sub\-paths of a resource to a Lambda function without any additional configuration\. - -For more information about these API Gateway features, see [Set up a proxy integration with a proxy resource](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html) in the *API Gateway Developer Guide*\. - -**Topics** -+ [Prerequisites](#services-apigateway-tutorial-prereqs) -+ [Create an execution role](#services-apigateway-tutorial-role) -+ [Create the function](#services-apigateway-tutorial-function) -+ [Test the function](#services-apigateway-tutorial-test) -+ [Create a REST API using API Gateway](#services-apigateway-tutorial-api) -+ [Create a DynamoDB table](#services-apigateway-tutorial-table) -+ [Test the setup](#services-apigateway-tutorial-test-setup) -+ [Clean up your resources](#cleanup) - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create an execution role - -Create an [execution role](lambda-intro-execution-role.md)\. This AWS Identity and Access Management \(IAM\) role uses a custom policy to give your Lambda function permission to access the required AWS resources\. Note that you must first create the policy and then create the execution role\. - -**To create a custom policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. - -1. Choose **Create Policy**\. - -1. Choose the **JSON** tab, and then paste the following custom policy into the JSON editor\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "Stmt1428341300017", - "Action": [ - "dynamodb:DeleteItem", - "dynamodb:GetItem", - "dynamodb:PutItem", - "dynamodb:Query", - "dynamodb:Scan", - "dynamodb:UpdateItem" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Sid": "", - "Resource": "*", - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow" - } - ] - } - ``` - - This policy includes permissions for your function to access DynamoDB and Amazon CloudWatch Logs\. - -1. Choose **Next: Tags**\. - -1. Choose **Next: Review**\. - -1. Under **Review policy**, for the policy **Name**, enter **lambda\-apigateway\-policy**\. - -1. Choose **Create policy**\. - -**To create an execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Choose **Create role**\. - -1. For the type of trusted entity, choose **AWS service**\. - -1. For the use case, choose **Lambda**\. - -1. Choose **Next**\. - -1. In the policy search box, enter **lambda\-apigateway\-policy**\. - -1. In the search results, select the policy that you created \(`lambda-apigateway-policy`\), and then choose **Next**\. - -1. Under **Role details**, for the **Role name**, enter **lambda\-apigateway\-role**\. - -1. Choose **Create role**\. - -1. On the **Roles** page, choose the name of your role \(`lambda-apigateway-role`\)\. - -1. On the **Summary** page, copy the **Role ARN**\. You need this later in the tutorial\. - - - -## Create the function - -The following code example receives an API Gateway event input and processes the messages that this input contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - ------- -#### [ Node\.js ] - -**Example index\.js** - -``` -console.log('Loading function'); - -var AWS = require('aws-sdk'); -var dynamo = new AWS.DynamoDB.DocumentClient(); - -/** - * Provide an event that contains the following keys: - * - * - operation: one of the operations in the switch statement below - * - tableName: required for operations that interact with DynamoDB - * - payload: a parameter to pass to the operation being performed - */ -exports.handler = function(event, context, callback) { - //console.log('Received event:', JSON.stringify(event, null, 2)); - - var operation = event.operation; - - if (event.tableName) { - event.payload.TableName = event.tableName; - } - - switch (operation) { - case 'create': - dynamo.put(event.payload, callback); - break; - case 'read': - dynamo.get(event.payload, callback); - break; - case 'update': - dynamo.update(event.payload, callback); - break; - case 'delete': - dynamo.delete(event.payload, callback); - break; - case 'list': - dynamo.scan(event.payload, callback); - break; - case 'echo': - callback(null, "Success"); - break; - case 'ping': - callback(null, "pong"); - break; - default: - callback(`Unknown operation: ${operation}`); - } -}; -``` - -**To create the function** - -1. Save the code example as a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. - - ``` - aws lambda create-function --function-name LambdaFunctionOverHttps \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role - ``` - ------- -#### [ Python 3 ] - -**Example LambdaFunctionOverHttps\.py** - -``` -from __future__ import print_function - -import boto3 -import json - -print('Loading function') - - -def handler(event, context): - '''Provide an event that contains the following keys: - - - operation: one of the operations in the operations dict below - - tableName: required for operations that interact with DynamoDB - - payload: a parameter to pass to the operation being performed - ''' - #print("Received event: " + json.dumps(event, indent=2)) - - operation = event['operation'] - - if 'tableName' in event: - dynamo = boto3.resource('dynamodb').Table(event['tableName']) - - operations = { - 'create': lambda x: dynamo.put_item(**x), - 'read': lambda x: dynamo.get_item(**x), - 'update': lambda x: dynamo.update_item(**x), - 'delete': lambda x: dynamo.delete_item(**x), - 'list': lambda x: dynamo.scan(**x), - 'echo': lambda x: x, - 'ping': lambda x: 'pong' - } - - if operation in operations: - return operations[operation](event.get('payload')) - else: - raise ValueError('Unrecognized operation "{}"'.format(operation)) -``` - -**To create the function** - -1. Save the code example as a file named `LambdaFunctionOverHttps.py`\. - -1. Create a deployment package\. - - ``` - zip function.zip LambdaFunctionOverHttps.py - ``` - -1. Create a Lambda function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. For the `role` parameter, enter the execution role's Amazon Resource Name \(ARN\), which you copied earlier\. - - ``` - aws lambda create-function --function-name LambdaFunctionOverHttps \ - --zip-file fileb://function.zip --handler LambdaFunctionOverHttps.handler --runtime python3.8 \ - --role arn:aws:iam::123456789012:role/service-role/lambda-apigateway-role - ``` - ------- - -## Test the function - -Test the Lambda function manually using the following sample event data\. You can invoke the function using the `invoke` AWS CLI command or by [using the Lambda console](configuration-function-common.md#configuration-common-test)\. - -**To test the Lambda function \(AWS CLI\)** - -1. Save the following JSON as a file named `input.txt`\. - - ``` - { - "operation": "echo", - "payload": { - "somekey1": "somevalue1", - "somekey2": "somevalue2" - } - } - ``` - -1. Run the following `invoke` AWS CLI command\. - - ``` - aws lambda invoke --function-name LambdaFunctionOverHttps \ - --payload file://input.txt outputfile.txt --cli-binary-format raw-in-base64-out - ``` - - The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -1. Verify the output in the file `outputfile.txt`\. - -## Create a REST API using API Gateway - -In this section, you create an API Gateway REST API \(`DynamoDBOperations`\) with one resource \(`DynamoDBManager`\) and one method \(`POST`\)\. You associate the `POST` method with your Lambda function\. Then, you test the setup\. - -When your API method receives an HTTP request, API Gateway invokes your Lambda function\. - -### Create the API - -In the following steps, you create the `DynamoDBOperations` REST API using the API Gateway console\. - -**To create the API** - -1. Open the [API Gateway console](https://console.aws.amazon.com/apigateway)\. - -1. Choose **Create API**\. - -1. In the **REST API** box, choose **Build**\. - -1. Under **Create new API**, choose **New API**\. - -1. Under **Settings**, do the following: - - 1. For **API name**, enter **DynamoDBOperations**\. - - 1. For **Endpoint Type**, choose **Regional**\. - -1. Choose **Create API**\. - -### Create a resource in the API - -In the following steps, you create a resource named `DynamoDBManager` in your REST API\. - -**To create the resource** - -1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that the root \(`/`\) level is highlighted\. Then, choose **Actions**, **Create Resource**\. - -1. Under **New child resource**, do the following: - - 1. For **Resource Name**, enter **DynamoDBManager**\. - - 1. Keep **Resource Path** set to `/dynamodbmanager`\. - -1. Choose **Create Resource**\. - -### Create a POST method on the resource - -In the following steps, you create a `POST` method on the `DynamoDBManager` resource that you created in the previous section\. - -**To create the method** - -1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), in the **Resources** tree of your API, make sure that `/dynamodbmanager` is highlighted\. Then, choose **Actions**, **Create Method**\. - -1. In the small dropdown menu that appears under `/dynamodbmanager`, choose `POST`, and then choose the check mark icon\. - -1. In the method's **Setup** pane, do the following: - - 1. For **Integration type**, choose **Lambda Function**\. - - 1. For **Lambda Region**, choose the same AWS Region as your Lambda function\. - - 1. For **Lambda Function**, enter the name of your function \(**LambdaFunctionOverHttps**\)\. - - 1. Select **Use Default Timeout**\. - - 1. Choose **Save**\. - -1. In the **Add Permission to Lambda Function** dialog box, choose **OK**\. - -## Create a DynamoDB table - -Create the DynamoDB table that your Lambda function uses\. - -**To create the DynamoDB table** - -1. Open the [Tables page](https://console.aws.amazon.com/dynamodbv2#tables) of the DynamoDB console\. - -1. Choose **Create table**\. - -1. Under **Table details**, do the following: - - 1. For **Table name**, enter **lambda\-apigateway**\. - - 1. For **Partition key**, enter **id**, and keep the data type set as **String**\. - -1. Under **Settings**, keep the **Default settings**\. - -1. Choose **Create table**\. - -## Test the setup - -You're now ready to test the setup\. You can send requests to your `POST` method directly from the API Gateway console\. In this step, you use a `create` operation followed by an `update` operation\. - -**To create an item in your DynamoDB table** - -Your Lambda function can use the `create` operation to create an item in your DynamoDB table\. - -1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), choose the name of your REST API \(`DynamoDBOperations`\)\. - -1. In the **Resources** tree, under `/dynamodbmanager`, choose your `POST` method\. - -1. In the **Method Execution** pane, in the **Client** box, choose **Test**\. - -1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. For **Request Body**, paste the following JSON: - - ``` - { - "operation": "create", - "tableName": "lambda-apigateway", - "payload": { - "Item": { - "id": "1234ABCD", - "number": 5 - } - } - } - ``` - -1. Choose **Test**\. - -The test results should show status `200`, indicating that the `create` operation was successful\. To confirm, you can check that your DynamoDB table now contains an item with `"id": "1234ABCD"` and `"number": "5"`\. - -**To update the item in your DynamoDB table** - -You can also update items in the table using the `update` operation\. - -1. In the [API Gateway console](https://console.aws.amazon.com/apigateway), return to your POST method's **Method Test** pane\. - -1. In the **Method Test** pane, keep **Query Strings** and **Headers** empty\. In **Request Body**, paste the following JSON: - - ``` - { - "operation": "update", - "tableName": "lambda-apigateway", - "payload": { - "Key": { - "id": "1234ABCD" - }, - "AttributeUpdates": { - "number": { - "Value": 10 - } - } - } - } - ``` - -1. Choose **Test**\. - -The test results should show status `200`, indicating that the `update` operation was successful\. To confirm, you can check that your DynamoDB table now contains an updated item with `"id": "1234ABCD"` and `"number": "10"`\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the API** - -1. Open the [APIs page](https://console.aws.amazon.com/apigateway/main/apis) of the API Gateway console\. - -1. Select the API you created\. - -1. Choose **Actions**, **Delete**\. - -1. Choose **Delete**\. - -**To delete the DynamoDB table** - -1. Open the [Tables page](https://console.aws.amazon.com/dynamodb/home#tables:) of the DynamoDB console\. - -1. Select the table you created\. - -1. Choose **Delete**\. - -1. Enter **delete** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-apigateway.md b/doc_source/services-apigateway.md deleted file mode 100644 index 0f68c728..00000000 --- a/doc_source/services-apigateway.md +++ /dev/null @@ -1,315 +0,0 @@ -# Using AWS Lambda with Amazon API Gateway - -You can create a web API with an HTTP endpoint for your Lambda function by using Amazon API Gateway\. API Gateway provides tools for creating and documenting web APIs that route HTTP requests to Lambda functions\. You can secure access to your API with authentication and authorization controls\. Your APIs can serve traffic over the internet or can be accessible only within your VPC\. - -Resources in your API define one or more methods, such as GET or POST\. Methods have an integration that routes requests to a Lambda function or another integration type\. You can define each resource and method individually, or use special resource and method types to match all requests that fit a pattern\. A *proxy resource* catches all paths beneath a resource\. The `ANY` method catches all HTTP methods\. - -**Topics** -+ [Adding an endpoint to your Lambda function](#apigateway-add) -+ [Proxy integration](#apigateway-proxy) -+ [Event format](#apigateway-example-event) -+ [Response format](#apigateway-types-transforms) -+ [Permissions](#apigateway-permissions) -+ [Handling errors with an API Gateway API](#services-apigateway-errors) -+ [Choosing an API type](#services-apigateway-apitypes) -+ [Sample applications](#services-apigateway-samples) -+ [Tutorial: Using Lambda with API Gateway](services-apigateway-tutorial.md) -+ [Sample function code](services-apigateway-code.md) -+ [Create a simple microservice using Lambda and API Gateway](services-apigateway-blueprint.md) -+ [AWS SAM template for an API Gateway application](services-apigateway-template.md) - -## Adding an endpoint to your Lambda function - -**To add a public endpoint to your Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Select **API Gateway**\. - -1. Choose **Create an API** or **Use an existing API**\. - - 1. **New API:** For **API type**, choose **HTTP API**\. For more information, see [API types](#services-apigateway-apitypes)\. - - 1. **Existing API:** Select the API from the dropdown menu or enter the API ID \(for example, r3pmxmplak\)\. - -1. For **Security**, choose **Open**\. - -1. Choose **Add**\. - -## Proxy integration - -API Gateway APIs are comprised of stages, resources, methods, and integrations\. The stage and resource determine the path of the endpoint: - -**API path format** -+ `/prod/` – The `prod` stage and root resource\. -+ `/prod/user` – The `prod` stage and `user` resource\. -+ `/dev/{proxy+}` – Any route in the `dev` stage\. -+ `/` – \(HTTP APIs\) The default stage and root resource\. - -A Lambda integration maps a path and HTTP method combination to a Lambda function\. You can configure API Gateway to pass the body of the HTTP request as\-is \(custom integration\), or to encapsulate the request body in a document that includes all of the request information including headers, resource, path, and method\. - -## Event format - -Amazon API Gateway invokes your function [synchronously](invocation-sync.md) with an event that contains a JSON representation of the HTTP request\. For a custom integration, the event is the body of the request\. For a proxy integration, the event has a defined structure\. The following example shows a proxy event from an API Gateway REST API\. - -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event.json) API Gateway proxy event \(REST API\)** - -``` -{ - "resource": "/", - "path": "/", - "httpMethod": "GET", - "requestContext": { - "resourcePath": "/", - "httpMethod": "GET", - "path": "/Prod/", - ... - }, - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "accept-encoding": "gzip, deflate, br", - "Host": "70ixmpl4fl.execute-api.us-east-2.amazonaws.com", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36", - "X-Amzn-Trace-Id": "Root=1-5e66d96f-7491f09xmpl79d18acf3d050", - ... - }, - "multiValueHeaders": { - "accept": [ - "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" - ], - "accept-encoding": [ - "gzip, deflate, br" - ], - ... - }, - "queryStringParameters": null, - "multiValueQueryStringParameters": null, - "pathParameters": null, - "stageVariables": null, - "body": null, - "isBase64Encoded": false - } -``` - -## Response format - -API Gateway waits for a response from your function and relays the result to the caller\. For a custom integration, you define an integration response and a method response to convert the output from the function to an HTTP response\. For a proxy integration, the function must respond with a representation of the response in a specific format\. - -The following example shows a response object from a Node\.js function\. The response object represents a successful HTTP response that contains a JSON document\. - -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Proxy integration response object \(Node\.js\)** - -``` -var response = { - "statusCode": 200, - "headers": { - "Content-Type": "application/json" - }, - "isBase64Encoded": false, - "multiValueHeaders": { - "X-Custom-Header": ["My value", "My other value"], - }, - "body": "{\n \"TotalCodeSize\": 104330022,\n \"FunctionCount\": 26\n}" - } -``` - -The Lambda runtime serializes the response object into JSON and sends it to the API\. The API parses the response and uses it to create an HTTP response, which it then sends to the client that made the original request\. - -**Example HTTP response** - -``` -< HTTP/1.1 200 OK - < Content-Type: application/json - < Content-Length: 55 - < Connection: keep-alive - < x-amzn-RequestId: 32998fea-xmpl-4268-8c72-16138d629356 - < X-Custom-Header: My value - < X-Custom-Header: My other value - < X-Amzn-Trace-Id: Root=1-5e6aa925-ccecxmplbae116148e52f036 - < - { - "TotalCodeSize": 104330022, - "FunctionCount": 26 - } -``` - -## Permissions - -Amazon API Gateway gets permission to invoke your function from the function's [resource\-based policy](access-control-resource-based.md)\. You can grant invoke permission to an entire API, or grant limited access to a stage, resource, or method\. - -When you add an API to your function by using the Lambda console, using the API Gateway console, or in an AWS SAM template, the function's resource\-based policy is updated automatically\. The following is an example function policy\. - -**Example function policy** - -``` -{ - "Version": "2012-10-17", - "Id": "default", - "Statement": [ - { - "Sid": "nodejs-apig-functiongetEndpointPermissionProd-BWDBXMPLXE2F", - "Effect": "Allow", - "Principal": { - "Service": "apigateway.amazonaws.com" - }, - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:111122223333:function:nodejs-apig-function-1G3MXMPLXVXYI", - "Condition": { - "StringEquals": { - "aws:SourceAccount": "111122223333" - }, - "ArnLike": { - "aws:SourceArn": "arn:aws:execute-api:us-east-2:111122223333:ktyvxmpls1/*/GET/" - } - } - } - ] -} -``` - -You can manage function policy permissions manually with the following API operations: -+ [AddPermission](API_AddPermission.md) -+ [RemovePermission](API_RemovePermission.md) -+ [GetPolicy](API_GetPolicy.md) - -To grant invocation permission to an existing API, use the `add-permission` command\. - -``` -aws lambda add-permission --function-name my-function \ ---statement-id apigateway-get --action lambda:InvokeFunction \ ---principal apigateway.amazonaws.com \ ---source-arn "arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET/" -``` - -You should see the following output: - -``` -{ - "Statement": "{\"Sid\":\"apigateway-test-2\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"apigateway.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function\",\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:execute-api:us-east-2:123456789012:mnh1xmpli7/default/GET\"}}}" -} -``` - -**Note** -If your function and API are in different regions, the region identifier in the source ARN must match the region of the function, not the region of the API\. When API Gateway invokes a function, it uses a resource ARN that is based on the ARN of the API, but modified to match the function's region\. - -The source ARN in this example grants permission to an integration on the GET method of the root resource in the default stage of an API, with ID `mnh1xmpli7`\. You can use an asterisk in the source ARN to grant permissions to multiple stages, methods, or resources\. - -**Resource patterns** -+ `mnh1xmpli7/*/GET/*` – GET method on all resources in all stages\. -+ `mnh1xmpli7/prod/ANY/user` – ANY method on the `user` resource in the `prod` stage\. -+ `mnh1xmpli7/*/*/*` – Any method on all resources in all stages\. - -For details on viewing the policy and removing statements, see [Cleaning up resource\-based policies](access-control-resource-based.md#permissions-resource-cleanup)\. - -## Handling errors with an API Gateway API - -API Gateway treats all invocation and function errors as internal errors\. If the Lambda API rejects the invocation request, API Gateway returns a 500 error code\. If the function runs but returns an error, or returns a response in the wrong format, API Gateway returns a 502\. In both cases, the body of the response from API Gateway is `{"message": "Internal server error"}`\. - -**Note** -API Gateway does not retry any Lambda invocations\. If Lambda returns an error, API Gateway returns an error response to the client\. - -The following example shows an X\-Ray trace map for a request that resulted in a function error and a 502 from API Gateway\. The client receives the generic error message\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-502.png) - -To customize the error response, you must catch errors in your code and format a response in the required format\. - -**Example [index\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/function/index.js) – Error formatting** - -``` -var formatError = function(error){ - var response = { - "statusCode": error.statusCode, - "headers": { - "Content-Type": "text/plain", - "x-amzn-ErrorType": error.code - }, - "isBase64Encoded": false, - "body": error.code + ": " + error.message - } - return response -} -``` - -API Gateway converts this response into an HTTP error with a custom status code and body\. In the trace map, the function node is green because it handled the error\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/tracemap-apig-404.png) - -## Choosing an API type - -API Gateway supports three types of APIs that invoke Lambda functions: -+ **HTTP API** – A lightweight, low\-latency RESTful API\. -+ **REST API** – A customizable, feature\-rich RESTful API\. -+ **WebSocket API** – A web API that maintains persistent connections with clients for full\-duplex communication\. - -HTTP APIs and REST APIs are both RESTful APIs that process HTTP requests and return responses\. HTTP APIs are newer and are built with the API Gateway version 2 API\. The following features are new for HTTP APIs: - -**HTTP API features** -+ **Automatic deployments** – When you modify routes or integrations, changes deploy automatically to stages that have automatic deployment enabled\. -+ **Default stage** – You can create a default stage \(`$default`\) to serve requests at the root path of your API's URL\. For named stages, you must include the stage name at the beginning of the path\. -+ **CORS configuration** – You can configure your API to add CORS headers to outgoing responses, instead of adding them manually in your function code\. - -REST APIs are the classic RESTful APIs that API Gateway has supported since launch\. REST APIs currently have more customization, integration, and management features\. - -**REST API features** -+ **Integration types** – REST APIs support custom Lambda integrations\. With a custom integration, you can send just the body of the request to the function, or apply a transform template to the request body before sending it to the function\. -+ **Access control** – REST APIs support more options for authentication and authorization\. -+ **Monitoring and tracing** – REST APIs support AWS X\-Ray tracing and additional logging options\. - -For a detailed comparison, see [Choosing between HTTP APIs and REST APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html) in the *API Gateway Developer Guide*\. - -WebSocket APIs also use the API Gateway version 2 API and support a similar feature set\. Use a WebSocket API for applications that benefit from a persistent connection between the client and API\. WebSocket APIs provide full\-duplex communication, which means that both the client and the API can send messages continuously without waiting for a response\. - -HTTP APIs support a simplified event format \(version 2\.0\)\. The following example shows an event from an HTTP API\. - -**Example [event\-v2\.json](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig/event-v2.json) – API Gateway proxy event \(HTTP API\)** - -``` -{ - "version": "2.0", - "routeKey": "ANY /nodejs-apig-function-1G3XMPLZXVXYI", - "rawPath": "/default/nodejs-apig-function-1G3XMPLZXVXYI", - "rawQueryString": "", - "cookies": [ - "s_fid=7AABXMPL1AFD9BBF-0643XMPL09956DE2", - "regStatus=pre-register" - ], - "headers": { - "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", - "accept-encoding": "gzip, deflate, br", - ... - }, - "requestContext": { - "accountId": "123456789012", - "apiId": "r3pmxmplak", - "domainName": "r3pmxmplak.execute-api.us-east-2.amazonaws.com", - "domainPrefix": "r3pmxmplak", - "http": { - "method": "GET", - "path": "/default/nodejs-apig-function-1G3XMPLZXVXYI", - "protocol": "HTTP/1.1", - "sourceIp": "205.255.255.176", - "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36" - }, - "requestId": "JKJaXmPLvHcESHA=", - "routeKey": "ANY /nodejs-apig-function-1G3XMPLZXVXYI", - "stage": "default", - "time": "10/Mar/2020:05:16:23 +0000", - "timeEpoch": 1583817383220 - }, - "isBase64Encoded": true -} -``` - -For more information, see [AWS Lambda integrations](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html) in the API Gateway Developer Guide\. - -## Sample applications - -The GitHub repository for this guide provides the following sample application for API Gateway\. -+ [API Gateway with Node\.js](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/nodejs-apig) – A function with an AWS SAM template that creates a REST API that has AWS X\-Ray tracing enabled\. It includes scripts for deploying, invoking the function, testing the API, and cleanup\. - -Lambda also provides [blueprints](gettingstarted-features.md#gettingstarted-features-blueprints) and [templates](gettingstarted-features.md#gettingstarted-features-templates) that you can use to create an API Gateway application in the Lambda console\. \ No newline at end of file diff --git a/doc_source/services-cloudformation.md b/doc_source/services-cloudformation.md deleted file mode 100644 index 5a68656f..00000000 --- a/doc_source/services-cloudformation.md +++ /dev/null @@ -1,102 +0,0 @@ -# Using AWS Lambda with AWS CloudFormation - -In an AWS CloudFormation template, you can specify a Lambda function as the target of a custom resource\. Use custom resources to process parameters, retrieve configuration values, or call other AWS services during stack lifecycle events\. - -The following example invokes a function that's defined elsewhere in the template\. - -**Example – Custom resource definition** - -``` -Resources: - primerinvoke: - Type: [AWS::CloudFormation::CustomResource](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html) - Version: "1.0" - Properties: - ServiceToken: !GetAtt primer.Arn - FunctionName: !Ref randomerror -``` - -The service token is the Amazon Resource Name \(ARN\) of the function that AWS CloudFormation invokes when you create, update, or delete the stack\. You can also include additional properties like `FunctionName`, which AWS CloudFormation passes to your function as is\. - -AWS CloudFormation invokes your Lambda function [asynchronously](invocation-async.md) with an event that includes a callback URL\. - -**Example – AWS CloudFormation message event** - -``` -{ - "RequestType": "Create", - "ServiceToken": "arn:aws:lambda:us-east-2:123456789012:function:lambda-error-processor-primer-14ROR2T3JKU66", - "ResponseURL": "https://cloudformation-custom-resource-response-useast2.s3-us-east-2.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-east-2%3A123456789012%3Astack/lambda-error-processor/1134083a-2608-1e91-9897-022501a2c456%7Cprimerinvoke%7C5d478078-13e9-baf0-464a-7ef285ecc786?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=1555451971&Signature=28UijZePE5I4dvukKQqM%2F9Rf1o4%3D", - "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/lambda-error-processor/1134083a-2608-1e91-9897-022501a2c456", - "RequestId": "5d478078-13e9-baf0-464a-7ef285ecc786", - "LogicalResourceId": "primerinvoke", - "ResourceType": "AWS::CloudFormation::CustomResource", - "ResourceProperties": { - "ServiceToken": "arn:aws:lambda:us-east-2:123456789012:function:lambda-error-processor-primer-14ROR2T3JKU66", - "FunctionName": "lambda-error-processor-randomerror-ZWUC391MQAJK" - } -} -``` - -The function is responsible for returning a response to the callback URL that indicates success or failure\. For the full response syntax, see [Custom resource response objects](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html)\. - -**Example – AWS CloudFormation custom resource response** - -``` -{ - "Status": "SUCCESS", - "PhysicalResourceId": "2019/04/18/[$LATEST]b3d1bfc65f19ec610654e4d9b9de47a0", - "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/lambda-error-processor/1134083a-2608-1e91-9897-022501a2c456", - "RequestId": "5d478078-13e9-baf0-464a-7ef285ecc786", - "LogicalResourceId": "primerinvoke" -} -``` - -AWS CloudFormation provides a library called `cfn-response` that handles sending the response\. If you define your function within a template, you can require the library by name\. AWS CloudFormation then adds the library to the deployment package that it creates for the function\. - -The following example function invokes a second function\. If the call succeeds, the function sends a success response to AWS CloudFormation, and the stack update continues\. The template uses the [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) resource type provided by AWS Serverless Application Model\. - -**Example [error\-processor/template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/error-processor/template.yml) – Custom resource function** - -``` -Transform: 'AWS::Serverless-2016-10-31' -Resources: - primer: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - InlineCode: | - var aws = require('aws-sdk'); - var response = require('cfn-response'); - exports.handler = function(event, context) { - // For Delete requests, immediately send a SUCCESS response. - if (event.RequestType == "Delete") { - response.send(event, context, "SUCCESS"); - return; - } - var responseStatus = "FAILED"; - var responseData = {}; - var functionName = event.ResourceProperties.FunctionName - var lambda = new aws.Lambda(); - lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) { - if (err) { - responseData = {Error: "Invoke call failed"}; - console.log(responseData.Error + ":\n", err); - } - else responseStatus = "SUCCESS"; - response.send(event, context, responseStatus, responseData); - }); - }; - Description: Invoke a function to create a log stream. - MemorySize: 128 - Timeout: 8 - Role: !GetAtt role.Arn - Tracing: Active -``` - -If the function that the custom resource invokes isn't defined in a template, you can get the source code for `cfn-response` from [cfn\-response module](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html) in the AWS CloudFormation User Guide\. - -For a sample application that uses a custom resource to ensure that a function's log group is created before another resource that depends on it, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. - -For more information about custom resources, see [Custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) in the *AWS CloudFormation User Guide*\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-expressions.md b/doc_source/services-cloudwatchevents-expressions.md deleted file mode 100644 index 62a4d36a..00000000 --- a/doc_source/services-cloudwatchevents-expressions.md +++ /dev/null @@ -1,42 +0,0 @@ -# Schedule expressions using rate or cron - -AWS Lambda supports standard rate and cron expressions for frequencies of up to once per minute\. EventBridge \(CloudWatch Events\) rate expressions have the following format\. - -``` -rate(Value Unit) -``` - -Where *Value* is a positive integer and *Unit* can be minute\(s\), hour\(s\), or day\(s\)\. For a singular value the unit must be singular \(for example, `rate(1 day)`\), otherwise plural \(for example, `rate(5 days)`\)\. - - -**Rate expression examples** - -| Frequency | Expression | -| --- | --- | -| Every 5 minutes | `rate(5 minutes)` | -| Every hour | `rate(1 hour)` | -| Every seven days | `rate(7 days)` | - -Cron expressions have the following format\. - -``` -cron(Minutes Hours Day-of-month Month Day-of-week Year) -``` - - -**Cron expression examples** - -| Frequency | Expression | -| --- | --- | -| 10:15 AM \(UTC\) every day | `cron(15 10 * * ? *)` | -| 6:00 PM Monday through Friday | `cron(0 18 ? * MON-FRI *)` | -| 8:00 AM on the first day of the month | `cron(0 8 1 * ? *)` | -| Every 10 min on weekdays | `cron(0/10 * ? * MON-FRI *)` | -| Every 5 minutes between 8:00 AM and 5:55 PM weekdays | `cron(0/5 8-17 ? * MON-FRI *)` | -| 9:00 AM on the first Monday of each month | `cron(0 9 ? * 2#1 *)` | - -Note the following: -+ If you are using the Lambda console, do not include the `cron` prefix in your expression\. -+ One of the day\-of\-month or day\-of\-week values must be a question mark \(`?`\)\. - -For more information, see [Schedule expressions for rules](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schedule-expressions.html) in the *EventBridge User Guide*\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents-tutorial.md b/doc_source/services-cloudwatchevents-tutorial.md deleted file mode 100644 index 4bbb1202..00000000 --- a/doc_source/services-cloudwatchevents-tutorial.md +++ /dev/null @@ -1,170 +0,0 @@ -# Tutorial: Using AWS Lambda with scheduled events - -In this tutorial, you do the following: -+ Create a Lambda function using the **lambda\-canary** blueprint\. You configure the Lambda function to run every minute\. Note that if the function returns an error, Lambda logs error metrics to Amazon CloudWatch\. -+ Configure a CloudWatch alarm on the `Errors` metric of your Lambda function to post a message to your Amazon SNS topic when AWS Lambda emits error metrics to CloudWatch\. You subscribe to the Amazon SNS topics to get email notification\. In this tutorial, you do the following to set this up: - + Create an Amazon SNS topic\. - + Subscribe to the topic so you can get email notifications when a new message is posted to the topic\. - + In Amazon CloudWatch, set an alarm on the `Errors` metric of your Lambda function to publish a message to your SNS topic when errors occur\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -## Create a Lambda function - -1. Sign in to the AWS Management Console and open the AWS Lambda console at [https://console\.aws\.amazon\.com/lambda/](https://console.aws.amazon.com/lambda/)\. - -1. Choose **Create function**\. - -1. Choose **Use a blueprint**\. - -1. Enter **canary** in the search bar\. Choose the **lambda\-canary** blueprint, and then choose **Configure**\. - -1. Configure the following settings\. - + **Name** – **lambda\-canary**\. - + **Role** – **Create a new role from AWS policy templates**\. - + **Role name** – **lambda\-apigateway\-role**\. - + **Policy templates** – **Simple microservice permissions**\. - + **Rule** – **Create a new rule**\. - + **Rule name** – **CheckWebsiteScheduledEvent**\. - + **Rule description** – **CheckWebsiteScheduledEvent trigger**\. - + **Rule type** – **Schedule expression**\. - + **Schedule expression** – **rate\(1 minute\)**\. - + **Environment variables** - + **site** – **https://docs\.aws\.amazon\.com/lambda/latest/dg/welcome\.html**\. - + **expected** – **What is AWS Lambda?**\. - -1. Choose **Create function**\. - -EventBridge \(CloudWatch Events\) emits an event every minute, based on the schedule expression\. The event triggers the Lambda function, which verifies that the expected string appears in the specified page\. For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. - -## Test the Lambda function - -Test the function with a sample event provided by the Lambda console\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the **lambda\-canary** function\. - -1. Choose **Test**\. - -1. Create a new event using the **CloudWatch** event template\. - -1. Choose **Create event**\. - -1. Choose **Invoke**\. - -The output from the function execution is shown at the top of the page\. - -## Create an Amazon SNS topic and subscribe to it - -Create an Amazon Simple Notification Service \(Amazon SNS\) topic to receive notifications when the canary function returns an error\. - -**To create a topic** - -1. Open the [Amazon SNS console](https://console.aws.amazon.com/sns/home)\. - -1. Choose **Create topic**\. - -1. Create a topic with the following settings\. - + **Name** – **lambda\-canary\-notifications**\. - + **Display name** – **Canary**\. - -1. Choose **Create subscription**\. - -1. Create a subscription with the following settings\. - + **Protocol** – **Email**\. - + **Endpoint** – Your email address\. - -Amazon SNS sends an email from `Canary `, reflecting the friendly name of the topic\. Use the link in the email to confirm your address\. - -## Configure an alarm - -Configure an alarm in Amazon CloudWatch that monitors the Lambda function and sends a notification when it fails\. - -**To create an alarm** - -1. Open the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. - -1. Choose **Alarms**\. - -1. Choose **Create alarm**\. - -1. Choose **Alarms**\. - -1. Create an alarm with the following settings\. - + **Metrics** – **lambda\-canary Errors**\. - - Search for **lambda canary errors** to find the metric\. - + Statistic – **Sum**\. - - Choose the statistic from the drop\-down menu above the preview graph\. - + **Name** – **lambda\-canary\-alarm**\. - + **Description** – **Lambda canary alarm**\. - + Threshold – **Whenever Errors is >=****1**\. - + **Send notification to** – **lambda\-canary\-notifications**\. - - - -## Test the alarm - -Update the function configuration to cause the function to return an error, which triggers the alarm\. - -**To trigger an alarm** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the **lambda\-canary** function\. - -1. Scroll down\. Under **Environment variables**, choose **Edit**\. - -1. Set **expected** to **404**\. - -1. Choose **Save**\. - -Wait a minute, and then check your email for a message from Amazon SNS\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the CloudWatch alarm** - -1. Open the [Alarms page](https://console.aws.amazon.com/cloudwatch/home#alarms:) of the CloudWatch console\. - -1. Select the alarm you created\. - -1. Choose **Actions**, **Delete**\. - -1. Choose **Delete**\. - -**To delete the Amazon SNS subscription** - -1. Open the [Subscriptions page](https://console.aws.amazon.com/sns/home#subscriptions:) of the Amazon SNS console\. - -1. Select the subscription you created\. - -1. Choose **Delete**, **Delete**\. - -**To delete the Amazon SNS topic** - -1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. - -1. Select the topic you created\. - -1. Choose **Delete**\. - -1. Enter **delete me** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-cloudwatchevents.md b/doc_source/services-cloudwatchevents.md deleted file mode 100644 index 85e0862f..00000000 --- a/doc_source/services-cloudwatchevents.md +++ /dev/null @@ -1,79 +0,0 @@ -# Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\) - -**Note** -Amazon EventBridge is the preferred way to manage your events\. CloudWatch Events and EventBridge are the same underlying service and API, but EventBridge provides more features\. Changes you make in either CloudWatch Events or EventBridge will appear in each console\. For more information, see the [Amazon EventBridge documentation](https://docs.aws.amazon.com/eventbridge/index.html)\. - -EventBridge \(CloudWatch Events\) helps you to respond to state changes in your AWS resources\. For more information about EventBridge, see [What is Amazon EventBridge?](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html) in the *Amazon EventBridge User Guide*\. - -When your resources change state, they automatically send events into an event stream\. With EventBridge \(CloudWatch Events\), you can create rules that match selected events in the stream and route them to your AWS Lambda function to take action\. For example, you can automatically invoke an AWS Lambda function to log the state of an [EC2 instance](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogEC2InstanceState.html) or [AutoScaling group](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/LogASGroupState.html)\. - -EventBridge \(CloudWatch Events\) invokes your function asynchronously with an event document that wraps the event from its source\. The following example shows an event that originated from a database snapshot in Amazon Relational Database Service\. - -**Example EventBridge \(CloudWatch Events\) event** - -``` -{ - "version": "0", - "id": "fe8d3c65-xmpl-c5c3-2c87-81584709a377", - "detail-type": "RDS DB Instance Event", - "source": "aws.rds", - "account": "123456789012", - "time": "2020-04-28T07:20:20Z", - "region": "us-east-2", - "resources": [ - "arn:aws:rds:us-east-2:123456789012:db:rdz6xmpliljlb1" - ], - "detail": { - "EventCategories": [ - "backup" - ], - "SourceType": "DB_INSTANCE", - "SourceArn": "arn:aws:rds:us-east-2:123456789012:db:rdz6xmpliljlb1", - "Date": "2020-04-28T07:20:20.112Z", - "Message": "Finished DB Instance backup", - "SourceIdentifier": "rdz6xmpliljlb1" - } -} -``` - -You can also create a Lambda function and direct AWS Lambda to invoke it on a regular schedule\. You can specify a fixed rate \(for example, invoke a Lambda function every hour or 15 minutes\), or you can specify a Cron expression\. - -**Example EventBridge \(CloudWatch Events\) message event** - -``` -{ - "version": "0", - "account": "123456789012", - "region": "us-east-2", - "detail": {}, - "detail-type": "Scheduled Event", - "source": "aws.events", - "time": "2019-03-01T01:23:45Z", - "id": "cdc73f9d-aea9-11e3-9d5a-835b769c0d9c", - "resources": [ - "arn:aws:events:us-east-2:123456789012:rule/my-schedule" - ] -} -``` - -**To configure EventBridge \(CloudWatch Events\) to invoke your function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function - -1. Under **Function overview**, choose **Add trigger**\. - -1. Set the trigger type to **EventBridge \(CloudWatch Events\)**\. - -1. For **Rule**, choose **Create a new rule**\. - -1. Configure the remaining options and choose **Add**\. - -For more information on expressions schedules, see [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md)\. - -Each AWS account can have up to 100 unique event sources of the **EventBridge \(CloudWatch Events\)\- Schedule** source type\. Each of these can be the event source for up to five Lambda functions\. That is, you can have up to 500 Lambda functions that can be executing on a schedule in your AWS account\. - -**Topics** -+ [Tutorial: Using AWS Lambda with scheduled events](services-cloudwatchevents-tutorial.md) -+ [Schedule expressions using rate or cron](services-cloudwatchevents-expressions.md) \ No newline at end of file diff --git a/doc_source/services-cloudwatchlogs.md b/doc_source/services-cloudwatchlogs.md deleted file mode 100644 index cf435ee5..00000000 --- a/doc_source/services-cloudwatchlogs.md +++ /dev/null @@ -1,40 +0,0 @@ -# Using Lambda with CloudWatch Logs - -You can use a Lambda function to monitor and analyze logs from an Amazon CloudWatch Logs log stream\. Create [subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html) for one or more log streams to invoke a function when logs are created or match an optional pattern\. Use the function to send a notification or persist the log to a database or storage\. - -CloudWatch Logs invokes your function asynchronously with an event that contains log data\. The value of the data field is a Base64\-encoded \.gzip file archive\. - -**Example CloudWatch Logs message event** - -``` -{ - "awslogs": { - "data": "ewogICAgIm1lc3NhZ2VUeXBlIjogIkRBVEFfTUVTU0FHRSIsCiAgICAib3duZXIiOiAiMTIzNDU2Nzg5MDEyIiwKICAgICJsb2dHcm91cCI6I..." - } -} -``` - -When decoded and decompressed, the log data is a JSON document with the following structure: - -**Example CloudWatch Logs message data \(decoded\)** - -``` -{ - "messageType": "DATA_MESSAGE", - "owner": "123456789012", - "logGroup": "/aws/lambda/echo-nodejs", - "logStream": "2019/03/13/[$LATEST]94fa867e5374431291a7fc14e2f56ae7", - "subscriptionFilters": [ - "LambdaStream_cloudwatchlogs-node" - ], - "logEvents": [ - { - "id": "34622316099697884706540976068822859012661220141643892546", - "timestamp": 1552518348220, - "message": "REPORT RequestId: 6234bffe-149a-b642-81ff-2e8e376d8aff\tDuration: 46.84 ms\tBilled Duration: 47 ms \tMemory Size: 192 MB\tMax Memory Used: 72 MB\t\n" - } - ] -} -``` - -For a sample application that uses CloudWatch Logs as a trigger, see [Error processor sample application for AWS Lambda](samples-errorprocessor.md)\. \ No newline at end of file diff --git a/doc_source/services-codecommit.md b/doc_source/services-codecommit.md deleted file mode 100644 index 2373fd8b..00000000 --- a/doc_source/services-codecommit.md +++ /dev/null @@ -1,36 +0,0 @@ -# Using AWS Lambda with AWS CodeCommit - -You can create a trigger for an AWS CodeCommit repository so that events in the repository will invoke a Lambda function\. For example, you can invoke a Lambda function when a branch or tag is created or when a push is made to an existing branch\. - -**Example AWS CodeCommit message event** - -``` -{ - "Records": [ - { - "awsRegion": "us-east-2", - "codecommit": { - "references": [ - { - "commit": "5e493c6f3067653f3d04eca608b4901eb227078", - "ref": "refs/heads/master" - } - ] - }, - "eventId": "31ade2c7-f889-47c5-a937-1cf99e2790e9", - "eventName": "ReferenceChanges", - "eventPartNumber": 1, - "eventSource": "aws:codecommit", - "eventSourceARN": "arn:aws:codecommit:us-east-2:123456789012:lambda-pipeline-repo", - "eventTime": "2019-03-12T20:58:25.400+0000", - "eventTotalParts": 1, - "eventTriggerConfigId": "0d17d6a4-efeb-46f3-b3ab-a63741badeb8", - "eventTriggerName": "index.handler", - "eventVersion": "1.0", - "userIdentityARN": "arn:aws:iam::123456789012:user/intern" - } - ] -} -``` - -For more information, see [Manage triggers for an AWS CodeCommit repository](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify.html)\. \ No newline at end of file diff --git a/doc_source/services-codepipeline.md b/doc_source/services-codepipeline.md deleted file mode 100644 index 366fc952..00000000 --- a/doc_source/services-codepipeline.md +++ /dev/null @@ -1,96 +0,0 @@ -# Using AWS Lambda with AWS CodePipeline - -AWS CodePipeline is a service that enables you to create continuous delivery pipelines for applications that run on AWS\. You can create a pipeline to deploy your Lambda application\. You can also configure a pipeline to invoke a Lambda function to perform a task when the pipeline runs\. When you [create a Lambda application](deploying-lambda-apps.md) in the Lambda console, Lambda creates a pipeline that includes source, build, and deploy stages\. - -CodePipeline invokes your function asynchronously with an event that contains details about the job\. The following example shows an event from a pipeline that invoked a function named `my-function`\. - -**Example CodePipeline event** - -``` -{ - "CodePipeline.job": { - "id": "c0d76431-b0e7-xmpl-97e3-e8ee786eb6f6", - "accountId": "123456789012", - "data": { - "actionConfiguration": { - "configuration": { - "FunctionName": "my-function", - "UserParameters": "{\"KEY\": \"VALUE\"}" - } - }, - "inputArtifacts": [ - { - "name": "my-pipeline-SourceArtifact", - "revision": "e0c7xmpl2308ca3071aa7bab414de234ab52eea", - "location": { - "type": "S3", - "s3Location": { - "bucketName": "us-west-2-123456789012-my-pipeline", - "objectKey": "my-pipeline/test-api-2/TdOSFRV" - } - } - } - ], - "outputArtifacts": [ - { - "name": "invokeOutput", - "revision": null, - "location": { - "type": "S3", - "s3Location": { - "bucketName": "us-west-2-123456789012-my-pipeline", - "objectKey": "my-pipeline/invokeOutp/D0YHsJn" - } - } - } - ], - "artifactCredentials": { - "accessKeyId": "AKIAIOSFODNN7EXAMPLE", - "secretAccessKey": "6CGtmAa3lzWtV7a...", - "sessionToken": "IQoJb3JpZ2luX2VjEA...", - "expirationTime": 1575493418000 - } - } - } -} -``` - -To complete the job, the function must call the CodePipeline API to signal success or failure\. The following example Node\.js function uses the `PutJobSuccessResult` operation to signal success\. It gets the job ID for the API call from the event object\. - -**Example index\.js** - -``` -var AWS = require('aws-sdk') -var codepipeline = new AWS.CodePipeline() - -exports.handler = async (event) => { - console.log(JSON.stringify(event, null, 2)) - var jobId = event["CodePipeline.job"].id - var params = { - jobId: jobId - } - return codepipeline.putJobSuccessResult(params).promise() -} -``` - -For asynchronous invocation, Lambda queues the message and [retries](invocation-retries.md) if your function returns an error\. Configure your function with a [destination](invocation-async.md#invocation-async-destinations) to retain events that your function could not process\. - -For a tutorial on how to configure a pipeline to invoke a Lambda function, see [Invoke an AWS Lambda function in a pipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html) in the *AWS CodePipeline User Guide*\. - -You can use AWS CodePipeline to create a continuous delivery pipeline for your Lambda application\. CodePipeline combines source control, build, and deployment resources to create a pipeline that runs whenever you make a change to your application's source code\. - -For an alternate method of creating a pipeline with AWS Serverless Application Model and AWS CloudFormation, watch [Automate your serverless application deployments](https://www.youtube.com/watch?v=0o3urdBeoII) on the Amazon Web Services YouTube channel\. - -## Permissions - -To invoke a function, a CodePipeline pipeline needs permission to use the following API operations: -+ [ListFunctions](API_ListFunctions.md) -+ [InvokeFunction](API_Invoke.md) - -The default [pipeline service role](https://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-custom-role.html) includes these permissions\. - -To complete a job, the function needs the following permissions in its [execution role](lambda-intro-execution-role.md)\. -+ `codepipeline:PutJobSuccessResult` -+ `codepipeline:PutJobFailureResult` - -These permissions are included in the [AWSCodePipelineCustomActionAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSCodePipelineCustomActionAccess) managed policy\. \ No newline at end of file diff --git a/doc_source/services-cognito.md b/doc_source/services-cognito.md deleted file mode 100644 index 3625525c..00000000 --- a/doc_source/services-cognito.md +++ /dev/null @@ -1,30 +0,0 @@ -# Using AWS Lambda with Amazon Cognito - -The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito\. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized\. To learn more and walk through an example, see [Introducing Amazon Cognito Events: Sync Triggers](http://aws.amazon.com/blogs/mobile/introducing-amazon-cognito-events-sync-triggers/) in the Mobile Development blog\. - -**Example Amazon Cognito message event** - -``` -{ - "datasetName": "datasetName", - "eventType": "SyncTrigger", - "region": "us-east-1", - "identityId": "identityId", - "datasetRecords": { - "SampleKey2": { - "newValue": "newValue2", - "oldValue": "oldValue2", - "op": "replace" - }, - "SampleKey1": { - "newValue": "newValue1", - "oldValue": "oldValue1", - "op": "replace" - } - }, - "identityPoolId": "identityPoolId", - "version": 2 -} -``` - -You configure event source mapping using Amazon Cognito event subscription configuration\. For information about event source mapping and a sample event, see [Amazon Cognito events](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-events.html) in the *Amazon Cognito Developer Guide*\. \ No newline at end of file diff --git a/doc_source/services-config.md b/doc_source/services-config.md deleted file mode 100644 index 3a9e0933..00000000 --- a/doc_source/services-config.md +++ /dev/null @@ -1,22 +0,0 @@ -# Using AWS Lambda with AWS Config - -You can use AWS Lambda functions to evaluate whether your AWS resource configurations comply with your custom Config rules\. As resources are created, deleted, or changed, AWS Config records these changes and sends the information to your Lambda functions\. Your Lambda functions then evaluate the changes and report results to AWS Config\. You can then use AWS Config to assess overall resource compliance: you can learn which resources are noncompliant and which configuration attributes are the cause of noncompliance\. - -**Example AWS Config message event** - -``` -{ - "invokingEvent": "{\"configurationItem\":{\"configurationItemCaptureTime\":\"2016-02-17T01:36:34.043Z\",\"awsAccountId\":\"000000000000\",\"configurationItemStatus\":\"OK\",\"resourceId\":\"i-00000000\",\"ARN\":\"arn:aws:ec2:us-east-1:000000000000:instance/i-00000000\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"us-east-1a\",\"resourceType\":\"AWS::EC2::Instance\",\"tags\":{\"Foo\":\"Bar\"},\"relationships\":[{\"resourceId\":\"eipalloc-00000000\",\"resourceType\":\"AWS::EC2::EIP\",\"name\":\"Is attached to ElasticIp\"}],\"configuration\":{\"foo\":\"bar\"}},\"messageType\":\"ConfigurationItemChangeNotification\"}", - "ruleParameters": "{\"myParameterKey\":\"myParameterValue\"}", - "resultToken": "myResultToken", - "eventLeftScope": false, - "executionRoleArn": "arn:aws:iam::111122223333:role/config-role", - "configRuleArn": "arn:aws:config:us-east-1:111122223333:config-rule/config-rule-0123456", - "configRuleName": "change-triggered-config-rule", - "configRuleId": "config-rule-0123456", - "accountId": "111122223333", - "version": "1.0" -} -``` - -For more information, see [Evaluating resources with AWS Config rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html)\. \ No newline at end of file diff --git a/doc_source/services-connect.md b/doc_source/services-connect.md deleted file mode 100644 index ca2777ef..00000000 --- a/doc_source/services-connect.md +++ /dev/null @@ -1,41 +0,0 @@ -# Using Lambda with Amazon Connect - -You can use a Lambda function to process requests from Amazon Connect\. - -Amazon Connect invokes your Lambda function synchronously with an event that contains the request body and metadata\. - -**Example Amazon Connect request event** - -``` -{ - "Details": { - "ContactData": { - "Attributes": {}, - "Channel": "VOICE", - "ContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", - "CustomerEndpoint": { - "Address": "+1234567890", - "Type": "TELEPHONE_NUMBER" - }, - "InitialContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", - "InitiationMethod": "INBOUND | OUTBOUND | TRANSFER | CALLBACK", - "InstanceARN": "arn:aws:connect:aws-region:1234567890:instance/c8c0e68d-2200-4265-82c0-XXXXXXXXXX", - "PreviousContactId": "4a573372-1f28-4e26-b97b-XXXXXXXXXXX", - "Queue": { - "ARN": "arn:aws:connect:eu-west-2:111111111111:instance/cccccccc-bbbb-dddd-eeee-ffffffffffff/queue/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - "Name": "PasswordReset" - }, - "SystemEndpoint": { - "Address": "+1234567890", - "Type": "TELEPHONE_NUMBER" - } - }, - "Parameters": { - "sentAttributeKey": "sentAttributeValue" - } - }, - "Name": "ContactFlowEvent" -} -``` - -For information about how to use Amazon Connect with Lambda, see [ Invoke Lambda functions](https://docs.aws.amazon.com/connect/latest/adminguide/connect-lambda-functions.html) in the *Amazon Connect administrator guide*\. \ No newline at end of file diff --git a/doc_source/services-ec2.md b/doc_source/services-ec2.md deleted file mode 100644 index fe6edcfc..00000000 --- a/doc_source/services-ec2.md +++ /dev/null @@ -1,62 +0,0 @@ -# Using AWS Lambda with Amazon EC2 - -You can use AWS Lambda to process lifecycle events from Amazon Elastic Compute Cloud and manage Amazon EC2 resources\. Amazon EC2 sends events to Amazon EventBridge \(CloudWatch Events\) for lifecycle events such as when an instance changes state, when an Amazon Elastic Block Store volume snapshot completes, or when a spot instance is scheduled to be terminated\. You configure EventBridge \(CloudWatch Events\) to forward those events to a Lambda function for processing\. - -EventBridge \(CloudWatch Events\) invokes your Lambda function asynchronously with the event document from Amazon EC2\. - -**Example instance lifecycle event** - -``` -{ - "version": "0", - "id": "b6ba298a-7732-2226-xmpl-976312c1a050", - "detail-type": "EC2 Instance State-change Notification", - "source": "aws.ec2", - "account": "111122223333", - "time": "2019-10-02T17:59:30Z", - "region": "us-east-2", - "resources": [ - "arn:aws:ec2:us-east-2:111122223333:instance/i-0c314xmplcd5b8173" - ], - "detail": { - "instance-id": "i-0c314xmplcd5b8173", - "state": "running" - } -} -``` - -For details on configuring events in EventBridge \(CloudWatch Events\), see [Using AWS Lambda with Amazon EventBridge \(CloudWatch Events\)](services-cloudwatchevents.md)\. For an example function that processes Amazon EBS snapshot notifications, see [Amazon EventBridge \(CloudWatch Events\) for Amazon EBS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-cloud-watch-events.html) in the Amazon EC2 User Guide for Linux Instances\. - -You can also use the AWS SDK to manage instances and other resources with the Amazon EC2 API\. - -## Permissions - -To process lifecycle events from Amazon EC2, EventBridge \(CloudWatch Events\) needs permission to invoke your function\. This permission comes from the function's [resource\-based policy](access-control-resource-based.md)\. If you use the EventBridge \(CloudWatch Events\) console to configure an event trigger, the console updates the resource\-based policy on your behalf\. Otherwise, add a statement like the following: - -**Example resource\-based policy statement for Amazon EC2 lifecycle notifications** - -``` -{ - "Sid": "ec2-events", - "Effect": "Allow", - "Principal": { - "Service": "events.amazonaws.com" - }, - "Action": "lambda:InvokeFunction", - "Resource": "arn:aws:lambda:us-east-2:12456789012:function:my-function", - "Condition": { - "ArnLike": { - "AWS:SourceArn": "arn:aws:events:us-east-2:12456789012:rule/*" - } - } -} -``` - -To add a statement, use the `add-permission` AWS CLI command\. - -``` -aws lambda add-permission --action lambda:InvokeFunction --statement-id ec2-events \ ---principal events.amazonaws.com --function-name my-function --source-arn 'arn:aws:events:us-east-2:12456789012:rule/*' -``` - -If your function uses the AWS SDK to manage Amazon EC2 resources, add Amazon EC2 permissions to the function's [execution role](lambda-intro-execution-role.md)\. \ No newline at end of file diff --git a/doc_source/services-efs.md b/doc_source/services-efs.md deleted file mode 100644 index 3c8a288b..00000000 --- a/doc_source/services-efs.md +++ /dev/null @@ -1,47 +0,0 @@ -# Using Amazon EFS with Lambda - -Lambda integrates with Amazon Elastic File System \(Amazon EFS\) to support secure, shared file system access for Lambda applications\. You can configure functions to mount a file system during initialization with the NFS protocol over the local network within a VPC\. Lambda manages the connection and encrypts all traffic to and from the file system\. - -The file system and the Lambda function must be in the same region\. A Lambda function in one account can mount a file system in a different account\. For this scenario, you configure VPC peering between the function VPC and the file system VPC\. - -**Note** -To configure a function to connect to a file system, see [Configuring file system access for Lambda functions](configuration-filesystem.md)\. - -Amazon EFS supports [file locking](https://docs.aws.amazon.com/efs/latest/ug/how-it-works.html#consistency) to prevent corruption if multiple functions try to write to the same file system at the same time\. Locking in Amazon EFS follows the NFS v4\.1 protocol for advisory locking, and enables your applications to use both whole file and byte range locks\. - -Amazon EFS provides options to customize your file system based on your application's need to maintain high performance at scale\. There are three primary factors to consider: the number of connections, throughput \(in MiB per second\), and IOPS\. - -**Quotas** -For detail on file system quotas and limits, see [Quotas for Amazon EFS file systems](https://docs.aws.amazon.com/efs/latest/ug/limits.html#limits-fs-specific) in the *Amazon Elastic File System User Guide*\. - -To avoid issues with scaling, throughput, and IOPS, monitor the [metrics](https://docs.aws.amazon.com/efs/latest/ug/monitoring-cloudwatch.html) that Amazon EFS sends to Amazon CloudWatch\. For an overview of monitoring in Amazon EFS, see [Monitoring Amazon EFS](https://docs.aws.amazon.com/efs/latest/ug/monitoring_overview.html) in the *Amazon Elastic File System User Guide*\. - -**Topics** -+ [Connections](#services-efs-connections) -+ [Throughput](#services-efs-throughput) -+ [IOPS](#services-efs-iops) - -## Connections - -Amazon EFS supports up to 25,000 connections per file system\. During initialization, each instance of a function creates a single connection to its file system that persists across invocations\. This means that you can reach 25,000 concurrency across one or more functions connected to a file system\. To limit the number of connections a function creates, use [reserved concurrency](configuration-concurrency.md)\. - -However, when you make changes to your function's code or configuration at scale, there is a temporary increase in the number of function instances beyond the current concurrency\. Lambda provisions new instances to handle new requests and there is some delay before old instances close their connections to the file system\. To avoid hitting the maximum connections limit during a deployment, use [rolling deployments](lambda-rolling-deployments.md)\. With rolling deployments, you gradually shift traffic to the new version each time you make a change\. - -If you connect to the same file system from other services such as Amazon EC2, you should also be aware of the scaling behavior of connections in Amazon EFS\. A file system supports the creation of up to 3,000 connections in a burst, after which it supports 500 new connections per minute\. This matches [burst scaling](invocation-scaling.md) behavior in Lambda, which applies across all functions in a Region\. But if you are creating connections outside of Lambda, your functions may not be able to scale at full speed\. - -To monitor and trigger an alarm on connections, use the `ClientConnections` metric\. - -## Throughput - -At scale, it is also possible to exceed the maximum *throughput* for a file system\. In *bursting mode* \(the default\), a file system has a low baseline throughput that scales linearly with its size\. To allow for bursts of activity, the file system is granted burst credits that allow it to use 100 MiB/s or more of throughput\. Credits accumulate continually and are expended with every read and write operation\. If the file system runs out of credits, it throttles read and write operations beyond the baseline throughput, which can cause invocations to time out\. - -**Note** -If you use [provisioned concurrency](configuration-concurrency.md), your function can consume burst credits even when idle\. With provisioned concurrency, Lambda initializes instances of your function before it is invoked, and recycles instances every few hours\. If you use files on an attached file system during initialization, this activity can use all of your burst credits\. - -To monitor and trigger an alarm on throughput, use the `BurstCreditBalance` metric\. It should increase when your function's concurrency is low and decrease when it is high\. If it always decreases or does not accumulate enough during low activity to cover peak traffic, you may need to limit your function's concurrency or enable [provisioned throughput](https://docs.aws.amazon.com/efs/latest/ug/performance.html#throughput-modes)\. - -## IOPS - -Input/output operations per second \(IOPS\) is a measurement of the number of read and write operations processed by the file system\. In general purpose mode, IOPS is limited in favor of lower latency, which is beneficial for most applications\. - -To monitor and alarm on IOPS in general purpose mode, use the `PercentIOLimit` metric\. If this metric reaches 100%, your function can time out waiting for read and write operations to complete\. \ No newline at end of file diff --git a/doc_source/services-elasticache-tutorial.md b/doc_source/services-elasticache-tutorial.md deleted file mode 100644 index 3c163558..00000000 --- a/doc_source/services-elasticache-tutorial.md +++ /dev/null @@ -1,174 +0,0 @@ -# Tutorial: Configuring a Lambda function to access Amazon ElastiCache in an Amazon VPC - -In this tutorial, you do the following: -+ Create an Amazon ElastiCache cluster in your default Amazon Virtual Private Cloud\. For more information about Amazon ElastiCache, see [Amazon ElastiCache](https://aws.amazon.com/elasticache/)\. -+ Create a Lambda function to access the ElastiCache cluster\. When you create the Lambda function, you provide subnet IDs in your Amazon VPC and a VPC security group to allow the Lambda function to access resources in your VPC\. For illustration in this tutorial, the Lambda function generates a UUID, writes it to the cache, and retrieves it from the cache\. -+ Invoke the Lambda function and verify that it accessed the ElastiCache cluster in your VPC\. - -For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – Lambda\. - + **Permissions** – **AWSLambdaVPCAccessExecutionRole**\. - + **Role name** – **lambda\-vpc\-role**\. - -The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\. - -## Create an ElastiCache cluster - -Create an ElastiCache cluster in your default VPC\. - -1. Run the following AWS CLI command to create a Memcached cluster\. - - ``` - aws elasticache create-cache-cluster --cache-cluster-id ClusterForLambdaTest --cache-node-type cache.t3.medium --engine memcached --num-cache-nodes 1 --security-group-ids sg-0123a1b123456c1de - ``` - - You can look up the default VPC security group in the VPC console under **Security Groups**\. Your example Lambda function will add and retrieve an item from this cluster\. - -1. Write down the configuration endpoint for the cache cluster that you launched\. You can get this from the Amazon ElastiCache console\. You will specify this value in your Lambda function code in the next section\. - -## Create a deployment package - -The following example Python code reads and writes an item to your ElastiCache cluster\. - -**Example app\.py** - -``` -from __future__ import print_function -import time -import uuid -import sys -import socket -import elasticache_auto_discovery -from pymemcache.client.hash import HashClient - -#elasticache settings -elasticache_config_endpoint = "your-elasticache-cluster-endpoint:port" -nodes = elasticache_auto_discovery.discover(elasticache_config_endpoint) -nodes = map(lambda x: (x[1], int(x[2])), nodes) -memcache_client = HashClient(nodes) - -def handler(event, context): - """ - This function puts into memcache and get from it. - Memcache is hosted using elasticache - """ - - #Create a random UUID... this will be the sample element we add to the cache. - uuid_inserted = uuid.uuid4().hex - #Put the UUID to the cache. - memcache_client.set('uuid', uuid_inserted) - #Get item (UUID) from the cache. - uuid_obtained = memcache_client.get('uuid') - if uuid_obtained.decode("utf-8") == uuid_inserted: - # this print should go to the CloudWatch Logs and Lambda console. - print ("Success: Fetched value %s from memcache" %(uuid_inserted)) - else: - raise Exception("Value is not the same as we put :(. Expected %s got %s" %(uuid_inserted, uuid_obtained)) - - return "Fetched value from memcache: " + uuid_obtained.decode("utf-8") -``` - -**Dependencies** -+ [pymemcache](https://pypi.python.org/pypi/pymemcache) – The Lambda function code uses this library to create a `HashClient` object to set and get items from memcache\. -+ [elasticache\-auto\-discovery](https://pypi.python.org/pypi/elasticache-auto-discovery) – The Lambda function uses this library to get the nodes in your Amazon ElastiCache cluster\. - -Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. - -## Create the Lambda function - -Create the Lambda function with the `create-function` command\. - -``` -aws lambda create-function --function-name AccessMemCache --timeout 30 --memory-size 1024 \ ---zip-file fileb://function.zip --handler app.handler --runtime python3.8 \ ---role arn:aws:iam::123456789012:role/lambda-vpc-role \ ---vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb -``` - -You can find the subnet IDs and the default security group ID of your VPC from the VPC console\. - -## Test the Lambda function - -In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it generates a UUID and writes it to the ElastiCache cluster that you specified in your Lambda code\. The Lambda function then retrieves the item from the cache\. - -1. Invoke the Lambda function with the `invoke` command\. - - ``` - aws lambda invoke --function-name AccessMemCache output.txt - ``` - -1. Verify that the Lambda function executed successfully as follows: - + Review the output\.txt file\. - + Review the results in the AWS Lambda console\. - + Verify the results in CloudWatch Logs\. - -Now that you have created a Lambda function that accesses an ElastiCache cluster in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the ElastiCache cluster** - -1. Open the [Memcached page](https://console.aws.amazon.com/elasticache/home#memcached:) of the ElastiCache console\. - -1. Select the cluster you created\. - -1. Choose **Actions**, **Delete**\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-iot.md b/doc_source/services-iot.md deleted file mode 100644 index 366582cc..00000000 --- a/doc_source/services-iot.md +++ /dev/null @@ -1,38 +0,0 @@ -# Using AWS Lambda with AWS IoT - -AWS IoT provides secure communication between internet\-connected devices \(such as sensors\) and the AWS Cloud\. This makes it possible for you to collect, store, and analyze telemetry data from multiple devices\. - -You can create AWS IoT rules for your devices to interact with AWS services\. The AWS IoT [Rules Engine](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules.html) provides a SQL\-based language to select data from message payloads and send the data to other services, such as Amazon S3, Amazon DynamoDB, and AWS Lambda\. You define a rule to invoke a Lambda function when you want to invoke another AWS service or a third\-party service\. - -When an incoming IoT message triggers the rule, AWS IoT invokes your Lambda function [asynchronously](invocation-async.md) and passes data from the IoT message to the function\. - -The following example shows a moisture reading from a greenhouse sensor\. The **row** and **pos** values identify the location of the sensor\. This example event is based on the greenhouse type in the [AWS IoT Rules tutorials](https://docs.aws.amazon.com/iot/latest/developerguide/iot-rules-tutorial.html)\. - -**Example AWS IoT message event** - -``` -{ - "row" : "10", - "pos" : "23", - "moisture" : "75" -} -``` - -For asynchronous invocation, Lambda queues the message and [retries](invocation-retries.md) if your function returns an error\. Configure your function with a [destination](invocation-async.md#invocation-async-destinations) to retain events that your function could not process\. - -You need to grant permission for the AWS IoT service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. - -``` -aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iot.amazonaws.com -``` - -You should see the following output: - -``` -{ - "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iot.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" -} -``` - -For more information about how to use Lambda with AWS IoT, see [Creating an AWS Lambda rule](https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html)\. \ No newline at end of file diff --git a/doc_source/services-iotevents.md b/doc_source/services-iotevents.md deleted file mode 100644 index 95c70582..00000000 --- a/doc_source/services-iotevents.md +++ /dev/null @@ -1,64 +0,0 @@ -# Using AWS Lambda with AWS IoT Events - -AWS IoT Events monitors the inputs from multiple IoT sensors and applications to recognize event patterns\. Then it takes appropriate actions when events occur\. AWS IoT Events receives its inputs as JSON payloads from many sources\. AWS IoT Events supports simple events \(where each input triggers an event\) and complex events \(where multiple inputs must occur to trigger the event\)\. - -To use AWS IoT Events, you define a detector model, which is a state\-machine model of your equipment or process\. In addition to states, you define inputs and events for the model\. You also define the actions to take when an event occurs\. Use a Lambda function for an action when you want to invoke another AWS service \(such as Amazon Connect\), or take actions in an external application \(such as your enterprise resource planning \(ERP\) application\)\. - -When the event occurs, AWS IoT Events invokes your Lambda function asynchronously\. It provides information about the detector model and the event that triggered the action\. The following example message event is based on the definitions in the AWS IoT Events [simple step\-by\-step example](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-simple-example.html)\. - -**Example AWS IoT Events message event** - -``` -{ - "event: ":{ - "eventName": "myChargedEvent", - "eventTime": 1567797571647, - "payload":{ - "detector":{ - "detectorModelName": "AWS_IoTEvents_Hello_World1567793458261", - "detectorModelVersion": "4", - "keyValue": "100009" - }, - "eventTriggerDetails":{ - "triggerType": "Message", - "inputName": "AWS_IoTEvents_HelloWorld_VoltageInput", - "messageId": "64c75a34-068b-4a1d-ae58-c16215dc4efd" - }, - "actionExecutionId": "49f0f32f-1209-38a7-8a76-d6ca49dd0bc4", - "state":{ - "variables": {}, - "stateName": "Charged", - "timers": {} - } - } - } -} -``` - -The event that is passed into the Lambda function includes the following fields: -+ `eventName` – The name for this event in the detector model\. -+ `eventTime` – The time that the event occurred\. -+ `detector` – The name and version of the detector model\. -+ `eventTriggerDetails` – A description of the input that triggered the event\. -+ `actionExecutionId` – The unique execution identifier of the action\. -+ `state` – The state of the detector model when the event occurred\. - + `stateName` – The name of the state in the detector model\. - + `timers` – Any timers that are set in this state\. - + `variables` – Any variable values that are set in this state\. - -You need to grant permission for the AWS IoT Events service to invoke your Lambda function\. Use the `add-permission` command to add a permission statement to your function's resource\-based policy\. - -``` -aws lambda add-permission --function-name my-function \ ---statement-id iot-events --action "lambda:InvokeFunction" --principal iotevents.amazonaws.com -``` - -You should see the following output: - -``` -{ - "Statement": "{\"Sid\":\"iot-events\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"iotevents.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-west-2:123456789012:function:my-function\"}" -} -``` - -For more information about using Lambda with AWS IoT Events, see [Using AWS IoT Events with other services](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-with-others.html)\. \ No newline at end of file diff --git a/doc_source/services-kinesisfirehose.md b/doc_source/services-kinesisfirehose.md deleted file mode 100644 index bc313be8..00000000 --- a/doc_source/services-kinesisfirehose.md +++ /dev/null @@ -1,41 +0,0 @@ -# Using AWS Lambda with Amazon Kinesis Data Firehose - -Amazon Kinesis Data Firehose captures, transforms, and loads streaming data into downstream services such as Kinesis Data Analytics or Amazon S3\. You can write Lambda functions to request additional, customized processing of the data before it is sent downstream\. - -**Example Amazon Kinesis Data Firehose message event** - -``` -{ - "invocationId": "invoked123", - "deliveryStreamArn": "aws:lambda:events", - "region": "us-west-2", - "records": [ - { - "data": "SGVsbG8gV29ybGQ=", - "recordId": "record1", - "approximateArrivalTimestamp": 1510772160000, - "kinesisRecordMetadata": { - "shardId": "shardId-000000000000", - "partitionKey": "4d1ad2b9-24f8-4b9d-a088-76e9947c317a", - "approximateArrivalTimestamp": "2012-04-23T18:25:43.511Z", - "sequenceNumber": "49546986683135544286507457936321625675700192471156785154", - "subsequenceNumber": "" - } - }, - { - "data": "SGVsbG8gV29ybGQ=", - "recordId": "record2", - "approximateArrivalTimestamp": 151077216000, - "kinesisRecordMetadata": { - "shardId": "shardId-000000000001", - "partitionKey": "4d1ad2b9-24f8-4b9d-a088-76e9947c318a", - "approximateArrivalTimestamp": "2012-04-23T19:25:43.511Z", - "sequenceNumber": "49546986683135544286507457936321625675700192471156785155", - "subsequenceNumber": "" - } - } - ] -} -``` - -For more information, see [Amazon Kinesis Data Firehose data transformation ](https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html) in the Kinesis Data Firehose Developer Guide\. \ No newline at end of file diff --git a/doc_source/services-lex.md b/doc_source/services-lex.md deleted file mode 100644 index c633196e..00000000 --- a/doc_source/services-lex.md +++ /dev/null @@ -1,140 +0,0 @@ -# Using AWS Lambda with Amazon Lex - -You can use Amazon Lex to integrate a conversation bot into your application\. The Amazon Lex bot provides a conversational interface with your users\. Amazon Lex provides prebuilt integration with Lambda, which enables you to use a Lambda function with your Amazon Lex bot\. - -When you configure an Amazon Lex bot, you can specify a Lambda function to perform validation, fulfillment, or both\. For validation, Amazon Lex invokes the Lambda function after each response from the user\. The Lambda function can validate the response and provide corrective feedback to the user, if necessary\. For fulfillment, Amazon Lex invokes the Lambda function to fulfill the user request after the bot successfully collects all of the required information and receives confirmation from the user\. - -You can [manage the concurrency](configuration-concurrency.md) of your Lambda function to control the maximum number of simultaneous bot conversations that you serve\. The Amazon Lex API returns an HTTP 429 status code \(Too Many Requests\) if the function is at maximum concurrency\. - -The API returns an HTTP 424 status code \(Dependency Failed Exception\) if the Lambda function throws an exception\. - -The Amazon Lex bot invokes your Lambda function [synchronously](invocation-sync.md)\. The event parameter contains information about the bot and the value of each slot in the dialog\. The `invocationSource` parameter indicates whether the Lambda function should validate the inputs \(DialogCodeHook\) or fulfill the intent \(FulfillmentCodeHook\)\. - -**Example Amazon Lex message event** - -``` -{ - "messageVersion": "1.0", - "invocationSource": "FulfillmentCodeHook", - "userId": "ABCD1234", - "sessionAttributes": { - "key1": "value1", - "key2": "value2", - }, - "bot": { - "name": "OrderFlowers", - "alias": "prod", - "version": "1" - }, - "outputDialogMode": "Text", - "currentIntent": { - "name": "OrderFlowers", - "slots": { - "FlowerType": "lilies", - "PickupDate": "2030-11-08", - "PickupTime": "10:00" - }, - "confirmationStatus": "Confirmed" - } -} -``` - -Amazon Lex expects a response from a Lambda function in the following format\. The `dialogAction` field is required\. The `sessionAttributes` and the `recentIntentSummaryView` fields are optional\. - -**Example Amazon Lex message event** - -``` -{ - "sessionAttributes": { - "key1": "value1", - "key2": "value2" - ... - }, - "recentIntentSummaryView": [ - { - "intentName": "Name", - "checkpointLabel": "Label", - "slots": { - "slot name": "value", - "slot name": "value" - }, - "confirmationStatus": "None, Confirmed, or Denied (intent confirmation, if configured)", - "dialogActionType": "ElicitIntent, ElicitSlot, ConfirmIntent, Delegate, or Close", - "fulfillmentState": "Fulfilled or Failed", - "slotToElicit": "Next slot to elicit - } - ], - "dialogAction": { - "type": "Close", - "fulfillmentState": "Fulfilled", - "message": { - "contentType": "PlainText", - "content": "Thanks, your pizza has been ordered." - }, - "responseCard": { - "version": integer-value, - "contentType": "application/vnd.amazonaws.card.generic", - "genericAttachments": [ - { - "title":"card-title", - "subTitle":"card-sub-title", - "imageUrl":"URL of the image to be shown", - "attachmentLinkUrl":"URL of the attachment to be associated with the card", - "buttons":[ - { - "text":"button-text", - "value":"Value sent to server on button click" - } - ] - } - ] - } - } -} -``` - -Note that the additional fields required for `dialogAction` vary based on the value of the `type` field\. For more information about the event and response fields, see [Lambda event and response format](https://docs.aws.amazon.com/lex/latest/dg/lambda-input-response-format.html) in the *Amazon Lex Developer Guide*\. For an example tutorial that shows how to use Lambda with Amazon Lex, see [Exercise 1: Create Amazon Lex bot using a blueprint](https://docs.aws.amazon.com/lex/latest/dg/gs-bp.html) in the *Amazon Lex Developer Guide*\. - -## Roles and permissions - -You need to configure a service\-linked role as your function's [execution role](lambda-intro-execution-role.md)\. Amazon Lex defines the service\-linked role with predefined permissions\. When you create an Amazon Lex bot using the console, the service\-linked role is created automatically\. To create a service\-linked role with the AWS CLI, use the `create-service-linked-role` command\. - -``` -aws iam create-service-linked-role --aws-service-name lex.amazonaws.com -``` - -This command creates the following role\. - -``` -{ - "Role": { - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lex.amazonaws.com" - } - } - ] - }, - "RoleName": "AWSServiceRoleForLexBots", - "Path": "/aws-service-role/lex.amazonaws.com/", - "Arn": "arn:aws:iam::account-id:role/aws-service-role/lex.amazonaws.com/AWSServiceRoleForLexBots" -} -``` - - If your Lambda function uses other AWS services, you need to add the corresponding permissions to the service\-linked role\. - -You use a resource\-based permissions policy to allow the Amazon Lex intent to invoke your Lambda function\. If you use the Amazon Lex console, the permissions policy is created automatically\. From the AWS CLI, use the Lambda `add-permission` command to set the permission\. The following example sets permission for the `OrderFlowers` intent\. - -``` -aws lambda add-permission \ - --function-name OrderFlowersCodeHook \ - --statement-id LexGettingStarted-OrderFlowersBot \ - --action lambda:InvokeFunction \ - --principal lex.amazonaws.com \ - --source-arn "arn:aws:lex:us-east-1:123456789012 ID:intent:OrderFlowers:*" -``` \ No newline at end of file diff --git a/doc_source/services-rds-tutorial.md b/doc_source/services-rds-tutorial.md deleted file mode 100644 index ac8f2379..00000000 --- a/doc_source/services-rds-tutorial.md +++ /dev/null @@ -1,213 +0,0 @@ -# Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC - -In this tutorial, you do the following: -+ Launch an Amazon RDS MySQL database engine instance in your default Amazon VPC\. In the MySQL instance, you create a database \(ExampleDB\) with a sample table \(Employee\) in it\. For more information about Amazon RDS, see [Amazon RDS](https://aws.amazon.com/rds)\. -+ Create a Lambda function to access the ExampleDB database, create a table \(Employee\), add a few records, and retrieve the records from the table\. -+ Invoke the Lambda function and verify the query results\. This is how you verify that your Lambda function was able to access the RDS MySQL instance in the VPC\. - -For details on using Lambda with Amazon VPC, see [Configuring a Lambda function to access resources in a VPC](configuration-vpc.md)\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – Lambda\. - + **Permissions** – **AWSLambdaVPCAccessExecutionRole**\. - + **Role name** – **lambda\-vpc\-role**\. - -The **AWSLambdaVPCAccessExecutionRole** has the permissions that the function needs to manage network connections to a VPC\. - -## Create an Amazon RDS database instance - -In this tutorial, the example Lambda function creates a table \(Employee\), inserts a few records, and then retrieves the records\. The table that the Lambda function creates has the following schema: - -``` -Employee(EmpID, Name) -``` - -Where `EmpID` is the primary key\. Now, you need to add a few records to this table\. - -First, you launch an RDS MySQL instance in your default VPC with ExampleDB database\. If you already have an RDS MySQL instance running in your default VPC, skip this step\. - -You can launch an RDS MySQL instance using one of the following methods: -+ Follow the instructions at [Creating a MySQL DB instance and connecting to a database on a MySQL DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.MySQL.html) in the *Amazon RDS User Guide*\. -+ Use the following AWS CLI command: - - ``` - aws rds create-db-instance --db-name ExampleDB --engine MySQL \ - --db-instance-identifier MySQLForLambdaTest --backup-retention-period 3 \ - --db-instance-class db.t2.micro --allocated-storage 5 --no-publicly-accessible \ - --master-username username --master-user-password password - ``` - -Write down the database name, user name, and password\. You also need the host address \(endpoint\) of the DB instance, which you can get from the RDS console\. You might need to wait until the instance status is available and the Endpoint value appears in the console\. - -## Create a deployment package - -The following example Python code runs a SELECT query against the Employee table in the MySQL RDS instance that you created in the VPC\. The code creates a table in the ExampleDB database, adds sample records, and retrieves those records\. - -The following method for handling database credentials is for illustrative purposes only\. In a production environment, we recommend using AWS Secrets Manager instead of environment variables to store database credentials\. For more information, see [Configuring database access for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-database.html)\. - -**Example app\.py** - -``` -import sys -import logging -import rds_config -import pymysql -#rds settings -rds_host = "rds-instance-endpoint" -name = rds_config.db_username -password = rds_config.db_password -db_name = rds_config.db_name - -logger = logging.getLogger() -logger.setLevel(logging.INFO) - -try: - conn = pymysql.connect(host=rds_host, user=name, passwd=password, db=db_name, connect_timeout=5) -except pymysql.MySQLError as e: - logger.error("ERROR: Unexpected error: Could not connect to MySQL instance.") - logger.error(e) - sys.exit() - -logger.info("SUCCESS: Connection to RDS MySQL instance succeeded") -def handler(event, context): - """ - This function fetches content from MySQL RDS instance - """ - - item_count = 0 - - with conn.cursor() as cur: - cur.execute("create table Employee ( EmpID int NOT NULL, Name varchar(255) NOT NULL, PRIMARY KEY (EmpID))") - cur.execute('insert into Employee (EmpID, Name) values(1, "Joe")') - cur.execute('insert into Employee (EmpID, Name) values(2, "Bob")') - cur.execute('insert into Employee (EmpID, Name) values(3, "Mary")') - conn.commit() - cur.execute("select * from Employee") - for row in cur: - item_count += 1 - logger.info(row) - #print(row) - conn.commit() - - return "Added %d items from RDS MySQL table" %(item_count) -``` - -Executing `pymysql.connect()` outside of the handler allows your function to re\-use the database connection for better performance\. - -A second file contains connection information for the function\. - -**Example rds\_config\.py** - -``` -#config file containing credentials for RDS MySQL instance -db_username = "username" -db_password = "password" -db_name = "ExampleDB" -``` - -A deployment package is a \.zip file containing your Lambda function code and dependencies\. The sample function code has the following dependencies: - -**Dependencies** -+ `pymysql` – The Lambda function code uses this library to access your MySQL instance \(see [PyMySQL](https://pypi.python.org/pypi/PyMySQL)\) \. - -**To create a deployment package** -+ Install dependencies with Pip and create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. - -## Create the Lambda function - -Create the Lambda function with the `create-function` command\. You can find the subnet IDs and security group ID for your default VPC in the [Amazon VPC console](https://console.aws.amazon.com/vpc)\. - -``` -aws lambda create-function --function-name CreateTableAddRecordsAndRead --runtime python3.8 \ ---zip-file fileb://app.zip --handler app.handler \ ---role arn:aws:iam::123456789012:role/lambda-vpc-role \ ---vpc-config SubnetIds=subnet-0532bb6758ce7c71f,subnet-d6b7fda068036e11f,SecurityGroupIds=sg-0897d5f549934c2fb -``` - -## Test the Lambda function - -In this step, you invoke the Lambda function manually using the `invoke` command\. When the Lambda function runs, it runs the SELECT query against the Employee table in the RDS MySQL instance and prints the results, which also go to the CloudWatch Logs\. - -1. Invoke the Lambda function with the `invoke` command\. - - ``` - aws lambda invoke --function-name CreateTableAddRecordsAndRead output.txt - ``` - -1. Verify that the Lambda function executed successfully as follows: - + Review the output\.txt file\. - + Review the results in the AWS Lambda console\. - + Verify the results in CloudWatch Logs\. - -Now that you have created a Lambda function that accesses a database in your VPC, you can have the function invoked in response to events\. For information about configuring event sources and examples, see [Using AWS Lambda with other services](lambda-services.md)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the MySQL DB instance** - -1. Open the [Databases page](https://console.aws.amazon.com/rds/home#databases:) of the Amazon RDS console\. - -1. Select the database you created\. - -1. Choose **Actions**, **Delete**\. - -1. Clear the **Create final snapshot** check box\. - -1. Enter **delete me** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/services-rds.md b/doc_source/services-rds.md deleted file mode 100644 index 8917eda2..00000000 --- a/doc_source/services-rds.md +++ /dev/null @@ -1,41 +0,0 @@ -# Using AWS Lambda with Amazon RDS - -You can use AWS Lambda to process event notifications from an Amazon Relational Database Service \(Amazon RDS\) database\. Amazon RDS sends notifications to an Amazon Simple Notification Service \(Amazon SNS\) topic, which you can configure to invoke a Lambda function\. Amazon SNS wraps the message from Amazon RDS in its own event document and sends it to your function\. - -**Example Amazon RDS message in an Amazon SNS event** - -``` -{ - "Records": [ - { - "EventVersion": "1.0", - "EventSubscriptionArn": "arn:aws:sns:us-east-2:123456789012:rds-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "EventSource": "aws:sns", - "Sns": { - "SignatureVersion": "1", - "Timestamp": "2019-01-02T12:45:07.000Z", - "Signature": "tcc6faL2yUC6dgZdmrwh1Y4cGa/ebXEkAi6RibDsvpi+tE/1+82j...65r==", - "SigningCertUrl": "https://sns.us-east-2.amazonaws.com/SimpleNotificationService-ac565b8b1a6c5d002d285f9598aa1d9b.pem", - "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e", - "Message": "{\"Event Source\":\"db-instance\",\"Event Time\":\"2019-01-02 12:45:06.000\",\"Identifier Link\":\"https://console.aws.amazon.com/rds/home?region=eu-west-1#dbinstance:id=dbinstanceid\",\"Source ID\":\"dbinstanceid\",\"Event ID\":\"http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Events.html#RDS-EVENT-0002\",\"Event Message\":\"Finished DB Instance backup\"}", - "MessageAttributes": {}, - "Type": "Notification", - "UnsubscribeUrl": "https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:123456789012:test-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "TopicArn":"arn:aws:sns:us-east-2:123456789012:sns-lambda", - "Subject": "RDS Notification Message" - } - } - ] - } -``` - -**Topics** -+ [Tutorial: Configuring a Lambda function to access Amazon RDS in an Amazon VPC](services-rds-tutorial.md) -+ [Configuring the function](#configuration) - -## Configuring the function - -The following section shows additional configurations and topics we recommend as part of this tutorial\. -+ If too many function instances run concurrently, one or more instances may fail to obtain a database connection\. You can use reserved concurrency to limit the maximum concurrency of the function\. Set the reserved concurrency to be less than the number of database connections\. Reserved concurrency also reserves those instances for this function, which may not be ideal\. If you are invoking the Lambda functions from your application, we recommend you write code that limits the number of concurrent instances\. For more information, see [Managing concurrency for a Lambda function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)\. -+ For more information on configuring an Amazon RDS database to send notifications, see [Using Amazon RDS event notifications](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html)\. -+ For more information on using Amazon SNS as trigger, see [Using AWS Lambda with Amazon SNS](with-sns.md)\. \ No newline at end of file diff --git a/doc_source/services-s3-batch.md b/doc_source/services-s3-batch.md deleted file mode 100644 index e2c416f4..00000000 --- a/doc_source/services-s3-batch.md +++ /dev/null @@ -1,68 +0,0 @@ -# Using AWS Lambda with Amazon S3 batch operations - -You can use Amazon S3 batch operations to invoke a Lambda function on a large set of Amazon S3 objects\. Amazon S3 tracks the progress of batch operations, sends notifications, and stores a completion report that shows the status of each action\. - -To run a batch operation, you create an Amazon S3 [batch operations job](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html)\. When you create the job, you provide a manifest \(the list of objects\) and configure the action to perform on those objects\. - -When the batch job starts, Amazon S3 invokes the Lambda function [synchronously](invocation-sync.md) for each object in the manifest\. The event parameter includes the names of the bucket and the object\. - -The following example shows the event that Amazon S3 sends to the Lambda function for an object that is named **customerImage1\.jpg** in the **examplebucket** bucket\. - -**Example Amazon S3 batch request event** - -``` -{ -"invocationSchemaVersion": "1.0", - "invocationId": "YXNkbGZqYWRmaiBhc2RmdW9hZHNmZGpmaGFzbGtkaGZza2RmaAo", - "job": { - "id": "f3cc4f60-61f6-4a2b-8a21-d07600c373ce" - }, - "tasks": [ - { - "taskId": "dGFza2lkZ29lc2hlcmUK", - "s3Key": "customerImage1.jpg", - "s3VersionId": "1", - "s3BucketArn": "arn:aws:s3:us-east-1:0123456788:examplebucket" - } - ] -} -``` - -Your Lambda function must return a JSON object with the fields as shown in the following example\. You can copy the `invocationId` and `taskId` from the event parameter\. You can return a string in the `resultString`\. Amazon S3 saves the `resultString` values in the completion report\. - -**Example Amazon S3 batch request response** - -``` -{ - "invocationSchemaVersion": "1.0", - "treatMissingKeysAs" : "PermanentFailure", - "invocationId" : "YXNkbGZqYWRmaiBhc2RmdW9hZHNmZGpmaGFzbGtkaGZza2RmaAo", - "results": [ - { - "taskId": "dGFza2lkZ29lc2hlcmUK", - "resultCode": "Succeeded", - "resultString": "[\"Alice\", \"Bob\"]" - } - ] -} -``` - -## Invoking Lambda functions from Amazon S3 batch operations - -You can invoke the Lambda function with an unqualified or qualified function ARN\. If you want to use the same function version for the entire batch job, configure a specific function version in the `FunctionARN` parameter when you create your job\. If you configure an alias or the $LATEST qualifier, the batch job immediately starts calling the new version of the function if the alias or $LATEST is updated during the job execution\. - -Note that you can't reuse an existing Amazon S3 event\-based function for batch operations\. This is because the Amazon S3 batch operation passes a different event parameter to the Lambda function and expects a return message with a specific JSON structure\. - -In the [resource\-based policy](access-control-resource-based.md) that you create for the Amazon S3 batch job, ensure that you set permission for the job to invoke your Lambda function\. - -In the execution role for the function, set a [trust policy for Amazon S3 to assume the role when it runs your function](https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-iam-role-policies.html)\. - -If your function uses the AWS SDK to manage Amazon S3 resources, you need to add Amazon S3 permissions in the execution role\. - -When the job runs, Amazon S3 starts multiple function instances to process the Amazon S3 objects in parallel, up to the [concurrency limit](invocation-scaling.md) of the function\. Amazon S3 limits the initial ramp\-up of instances to avoid excess cost for smaller jobs\. - -If the Lambda function returns a `TemporaryFailure` response code, Amazon S3 retries the operation\. - -For more information about Amazon S3 batch operations, see [Performing batch operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops.html) in the *Amazon S3 Developer Guide*\. - -For an example of how to use a Lambda function in Amazon S3 batch operations, see [Invoking a Lambda function from Amazon S3 batch operations](https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-invoke-lambda.html) in the *Amazon S3 Developer Guide*\. diff --git a/doc_source/services-s3-object-lambda.md b/doc_source/services-s3-object-lambda.md deleted file mode 100644 index 05e5e156..00000000 --- a/doc_source/services-s3-object-lambda.md +++ /dev/null @@ -1,9 +0,0 @@ -# Transforming S3 Objects with S3 Object Lambda - -With S3 Object Lambda you can add your own code to Amazon S3 GET, HEAD, and LIST requests to modify and process data before it is returned to an application\. You can use custom code to modify the data returned by standard S3 GET, HEAD, or LIST requests to filter rows, dynamically resize images, redact confidential data, and more\. Powered by AWS Lambda functions, your code runs on infrastructure that is fully managed by AWS, eliminating the need to create and store derivative copies of your data or to run proxies, all with no changes required to applications\. - -For more information, see [Transforming objects with S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html)\. - -**Tutorials** -+ [Transforming data for your application with Amazon S3 Object Lambda](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-uppercase.html) -+ [Detecting and redacting PII data with Amazon S3 Object Lambda and Amazon Comprehend](https://docs.aws.amazon.com/AmazonS3/latest/userguide/tutorial-s3-object-lambda-redact-pii.html) \ No newline at end of file diff --git a/doc_source/services-ses.md b/doc_source/services-ses.md deleted file mode 100644 index 9b08ce31..00000000 --- a/doc_source/services-ses.md +++ /dev/null @@ -1,107 +0,0 @@ -# Using AWS Lambda with Amazon SES - -When you use Amazon SES to receive messages, you can configure Amazon SES to call your Lambda function when messages arrive\. The service can then invoke your Lambda function by passing in the incoming email event, which in reality is an Amazon SES message in an Amazon SNS event, as a parameter\. - -**Example Amazon SES message event** - -``` -{ - "Records": [ - { - "eventVersion": "1.0", - "ses": { - "mail": { - "commonHeaders": { - "from": [ - "Jane Doe " - ], - "to": [ - "johndoe@example.com" - ], - "returnPath": "janedoe@example.com", - "messageId": "<0123456789example.com>", - "date": "Wed, 7 Oct 2015 12:34:56 -0700", - "subject": "Test Subject" - }, - "source": "janedoe@example.com", - "timestamp": "1970-01-01T00:00:00.000Z", - "destination": [ - "johndoe@example.com" - ], - "headers": [ - { - "name": "Return-Path", - "value": "" - }, - { - "name": "Received", - "value": "from mailer.example.com (mailer.example.com [203.0.113.1]) by inbound-smtp.us-west-2.amazonaws.com with SMTP id o3vrnil0e2ic for johndoe@example.com; Wed, 07 Oct 2015 12:34:56 +0000 (UTC)" - }, - { - "name": "DKIM-Signature", - "value": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=example; h=mime-version:from:date:message-id:subject:to:content-type; bh=jX3F0bCAI7sIbkHyy3mLYO28ieDQz2R0P8HwQkklFj4=; b=sQwJ+LMe9RjkesGu+vqU56asvMhrLRRYrWCbV" - }, - { - "name": "MIME-Version", - "value": "1.0" - }, - { - "name": "From", - "value": "Jane Doe " - }, - { - "name": "Date", - "value": "Wed, 7 Oct 2015 12:34:56 -0700" - }, - { - "name": "Message-ID", - "value": "<0123456789example.com>" - }, - { - "name": "Subject", - "value": "Test Subject" - }, - { - "name": "To", - "value": "johndoe@example.com" - }, - { - "name": "Content-Type", - "value": "text/plain; charset=UTF-8" - } - ], - "headersTruncated": false, - "messageId": "o3vrnil0e2ic28tr" - }, - "receipt": { - "recipients": [ - "johndoe@example.com" - ], - "timestamp": "1970-01-01T00:00:00.000Z", - "spamVerdict": { - "status": "PASS" - }, - "dkimVerdict": { - "status": "PASS" - }, - "processingTimeMillis": 574, - "action": { - "type": "Lambda", - "invocationType": "Event", - "functionArn": "arn:aws:lambda:us-west-2:111122223333:function:Example" - }, - "spfVerdict": { - "status": "PASS" - }, - "virusVerdict": { - "status": "PASS" - } - } - }, - "eventSource": "aws:ses" - } - ] -} -``` - -For more information, see [Lambda action](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda.html) in the *Amazon SES Developer Guide*\. \ No newline at end of file diff --git a/doc_source/services-stepfunctions.md b/doc_source/services-stepfunctions.md deleted file mode 100644 index 78802d24..00000000 --- a/doc_source/services-stepfunctions.md +++ /dev/null @@ -1,195 +0,0 @@ -# Orchestration examples with Step Functions - -All work in your Step Functions state machine is done by [https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html)\. A `Task` performs work by using an activity, a Lambda function, or by passing parameters to the API actions of other [Supported AWS Service Integrations for Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html)\. - -**Topics** -+ [Configuring a Lambda function as a task](#services-stepfunctions-task) -+ [Configuring a state machine as an event source](#services-stepfunctions-setup) -+ [Handling function and service errors](#services-stepfunctions-exceptions) -+ [AWS CloudFormation and AWS SAM](#services-stepfunctions-cloudformation) - -## Configuring a Lambda function as a task - -Step Functions can invoke Lambda functions directly from a `Task` state in an [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) definition\. - -``` -... - "MyStateName":{ - "Type":"Task", - "Resource":"arn:aws:lambda:us-west-2:01234567890:function:my_lambda_function", - "End":true - ... -``` - -You can create a `Task` state that invokes your Lambda function with the input to the state machine or any JSON document\. - -**Example [event\.json](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/sample-apps/error-processor/event.json) – Input to [random\-error function](samples-errorprocessor.md)** - -``` -{ - "max-depth": 10, - "current-depth": 0, - "error-rate": 0.05 -} -``` - -## Configuring a state machine as an event source - -You can create a Step Functions state machine that invokes a Lambda function\. The following example shows a `Task` state that invokes version `1` of a function named `my-function` with an event payload that has three keys\. When the function returns a successful response, the state machine continues to the next task\. - -**Example state machine** - -``` -... -"Invoke": { - "Type": "Task", - "Resource": "arn:aws:states:::lambda:invoke", - "Parameters": { - "FunctionName": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", - "Payload": { - "max-depth": 10, - "current-depth": 0, - "error-rate": 0.05 - } - }, - "Next": "NEXT_STATE", - "TimeoutSeconds": 25 -} -``` - -**Permissions** -Your state machine needs permission to call the Lambda API to invoke a function\. To grant it permission, add the AWS managed policy [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) or a function\-scoped inline policy to its role\. For more information, see [How AWS Step Functions Works with IAM](https://docs.aws.amazon.com/step-functions/latest/dg/procedure-create-iam-role.html) in the *AWS Step Functions Developer Guide*\. - -The `FunctionName` and `Payload` parameters map to parameters in the [Invoke](API_Invoke.md) API operation\. In addition to these, you can also specify the `InvocationType` and `ClientContext` parameters\. For example, to invoke the function asynchronously and continue to the next state without waiting for a result, you can set `InvocationType` to `Event`: - -``` -"InvocationType": "Event" -``` - -Instead of hard\-coding the event payload in the state machine definition, you can use the input from the state machine execution\. The following example uses the input specified when you run the state machine as the event payload: - -``` -"Payload.$": "$" -``` - -You can also invoke a function asynchronously and wait for it to make a callback with the AWS SDK\. To do this, set the state's resource to `arn:aws:states:::lambda:invoke.waitForTaskToken`\. - -For more information, see [Invoke Lambda with Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html) in the *AWS Step Functions Developer Guide*\. - -## Handling function and service errors - -When your function or the Lambda service returns an error, you can retry the invocation or continue to a different state based on the error type\. - -The following example shows an invoke task that retries on `5XX` series Lambda API exceptions \(`ServiceException`\), throttles \(`TooManyRequestsException`\), runtime errors \(`Lambda.Unknown`\), and a function\-defined error named `function.MaxDepthError`\. It also catches an error named `function.DoublesRolledError` and continues to a state named `CaughtException` when it occurs\. - -**Example catch and retry pattern** - -``` -... -"Invoke": { - "Type": "Task", - "Resource": "arn:aws:states:::lambda:invoke", - "Retry": [ - { - "ErrorEquals": [ - "function.MaxDepthError", - "Lambda.TooManyRequestsException", - "Lambda.ServiceException", - "Lambda.Unknown" - ], - "MaxAttempts": 5 - } - ], - "Catch": [ - { - "ErrorEquals": [ "function.DoublesRolledError" ], - "Next": "CaughtException" - } - ], - "Parameters": { - "FunctionName": "arn:aws:lambda:us-east-2:123456789012:function:my-function:1", - ... -``` - -To catch or retry function errors, create a custom error type\. The name of the error type must match the `errorType` in the formatted error response that Lambda returns when you throw an error\. - -For more information on error handling in Step Functions, see [Handling Error Conditions Using a Step Functions State Machine](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-handling-error-conditions.html) in the *AWS Step Functions Developer Guide*\. - -## AWS CloudFormation and AWS SAM - -You can define state machines using a AWS CloudFormation template with AWS Serverless Application Model \(AWS SAM\)\. Using AWS SAM, you can define the state machine inline in the template or in a separate file\. The following example shows a state machine that invokes a Lambda function that handles errors\. It refers to a function resource defined in the same template \(not shown\)\. - -**Example branching pattern in template\.yml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: 'AWS::Serverless-2016-10-31' -Description: An AWS Lambda application that uses AWS Step Functions. -Resources: - statemachine: - Type: AWS::Serverless::StateMachine - Properties: - DefinitionSubstitutions: - FunctionArn: !GetAtt function.Arn - Payload: | - { - "max-depth": 5, - "current-depth": 0, - "error-rate": 0.2 - } - Definition: - StartAt: Invoke - States: - Invoke: - Type: Task - Resource: arn:aws:states:::lambda:invoke - Parameters: - FunctionName: "${FunctionArn}" - Payload: "${Payload}" - InvocationType: Event - Retry: - - ErrorEquals: - - function.MaxDepthError - - function.MaxDepthError - - Lambda.TooManyRequestsException - - Lambda.ServiceException - - Lambda.Unknown - IntervalSeconds: 1 - MaxAttempts: 5 - Catch: - - ErrorEquals: - - function.DoublesRolledError - Next: CaughtException - - ErrorEquals: - - States.ALL - Next: UncaughtException - Next: Success - CaughtException: - Type: Pass - Result: The function returned an error. - End: true - UncaughtException: - Type: Pass - Result: Invocation failed. - End: true - Success: - Type: Pass - Result: Invocation succeeded! - End: true - Events: - scheduled: - Type: Schedule - Properties: - Description: Run every minute - Schedule: rate(1 minute) - Type: STANDARD - Policies: - - AWSLambdaRole - ... -``` - -This creates a state machine with the following structure: - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/services-stepfunctions-statemachine.png) - -For more information, see [AWS::Serverless::StateMachine](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/services-xray.md b/doc_source/services-xray.md deleted file mode 100644 index 418050a1..00000000 --- a/doc_source/services-xray.md +++ /dev/null @@ -1,130 +0,0 @@ -# Using AWS Lambda with AWS X\-Ray - -You can use AWS X\-Ray to visualize the components of your application, identify performance bottlenecks, and troubleshoot requests that resulted in an error\. Your Lambda functions send trace data to X\-Ray, and X\-Ray processes the data to generate a service map and searchable trace summaries\. - -If you've enabled X\-Ray tracing in a service that invokes your function, Lambda sends traces to X\-Ray automatically\. The upstream service, such as Amazon API Gateway, or an application hosted on Amazon EC2 that is instrumented with the X\-Ray SDK, samples incoming requests and adds a tracing header that tells Lambda to send traces or not\. - -**Note** -X\-Ray tracing is currently not supported for Lambda functions with Amazon Managed Streaming for Apache Kafka \(Amazon MSK\), self\-managed Apache Kafka, or Amazon MQ with ActiveMQ and RabbitMQ event source mappings\. - -To toggle active tracing on your Lambda function with the console, follow these steps: - -**To turn on active tracing** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Choose **Configuration** and then choose **Monitoring and operations tools**\. - -1. Choose **Edit**\. - -1. Under **X\-Ray**, toggle on **Active tracing**\. - -1. Choose **Save**\. - -**Pricing** -You can use X\-Ray tracing for free each month up to a certain limit as part of the AWS Free Tier\. Beyond that threshold, X\-Ray charges for trace storage and retrieval\. For more information, see [AWS X\-Ray pricing](http://aws.amazon.com/xray/pricing/)\. - -Your function needs permission to upload trace data to X\-Ray\. When you activate tracing in the Lambda console, Lambda adds the required permissions to your function's [execution role](lambda-intro-execution-role.md)\. Otherwise, add the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) policy to the execution role\. - -X\-Ray doesn't trace all requests to your application\. X\-Ray applies a sampling algorithm to ensure that tracing is efficient, while still providing a representative sample of all requests\. The sampling rate is 1 request per second and 5 percent of additional requests\. - -**Note** -You cannot configure the X\-Ray sampling rate for your functions\. - -In X\-Ray, a *trace* records information about a request that is processed by one or more *services*\. Services record *segments* that contain layers of *subsegments*\. Lambda records a segment for the Lambda service that handles the invocation request, and one for the work done by the function\. The function segment comes with subsegments for `Initialization`, `Invocation` and `Overhead`\. For more information see [ Lambda execution environment lifecycle](lambda-runtime-environment.md)\. - -The `Initialization` subsegment represents the init phase of the Lambda execution environment lifecycle\. During this phase, Lambda creates or unfreezes an execution environment with the resources you have configured, downloads the function code and all layers, initializes extensions, initializes the runtime, and runs the function's initialization code\. - -The `Invocation` subsegment represents the invoke phase where Lambda invokes the function handler\. This begins with runtime and extension registration and it ends when the runtime is ready to send the response\. - -The `Overhead` subsegment represents the phase that occurs between the time when the runtime sends the response and the signal for the next invoke\. During this time, the runtime finishes all tasks related to an invoke and prepares to freeze the sandbox\. - - - -**Note** -If your Lambda function uses [provisioned concurrency](provisioned-concurrency.md), your X\-Ray trace might display a function initialization with a very long duration\. -Provisioned concurrency initializes function instances in advance, to reduce lag at the time of invocation\. Over time, provisioned concurrency refreshes these instances by creating new instances to replace the old ones\. For workloads with steady traffic, the new instances are initialized well in advance of their first invocation\. The time gap gets recorded in the X\-Ray trace as the initialization duration\. - -**Important** -In Lambda, you can use the X\-Ray SDK to extend the `Invocation` subsegment with additional subsegments for downstream calls, annotations, and metadata\. You can't access the function segment directly or record work done outside of the handler invocation scope\. - -See the following topics for a language\-specific introduction to tracing in Lambda: -+ [Instrumenting Node\.js code in AWS Lambda](nodejs-tracing.md) -+ [Instrumenting Python code in AWS Lambda](python-tracing.md) -+ [Instrumenting Ruby code in AWS Lambda](ruby-tracing.md) -+ [Instrumenting Java code in AWS Lambda](java-tracing.md) -+ [Instrumenting Go code in AWS Lambda](golang-tracing.md) -+ [Instrumenting C\# code in AWS Lambda](csharp-tracing.md) - -For a full list of services that support active instrumentation, see [Supported AWS services](https://docs.aws.amazon.com/xray/latest/devguide/xray-usage.html#xray-usage-codechanges) in the AWS X\-Ray Developer Guide\. - -**Topics** -+ [Execution role permissions](#services-xray-permissions) -+ [The AWS X\-Ray daemon](#services-xray-daemon) -+ [Enabling active tracing with the Lambda API](#services-xray-api) -+ [Enabling active tracing with AWS CloudFormation](#services-xray-cloudformation) - -## Execution role permissions - -Lambda needs the following permissions to send trace data to X\-Ray\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. -+ [xray:PutTraceSegments](https://docs.aws.amazon.com/xray/latest/api/API_PutTraceSegments.html) -+ [xray:PutTelemetryRecords](https://docs.aws.amazon.com/xray/latest/api/API_PutTelemetryRecords.html) - -These permissions are included in the [AWSXRayDaemonWriteAccess](https://console.aws.amazon.com/iam/home?#/policies/arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess) managed policy\. - -## The AWS X\-Ray daemon - -Instead of sending trace data directly to the X\-Ray API, the X\-Ray SDK uses a daemon process\. The AWS X\-Ray daemon is an application that runs in the Lambda environment and listens for UDP traffic that contains segments and subsegments\. It buffers incoming data and writes it to X\-Ray in batches, reducing the processing and memory overhead required to trace invocations\. - -The Lambda runtime allows the daemon to up to 3 percent of your function's configured memory or 16 MB, whichever is greater\. If your function runs out of memory during invocation, the runtime terminates the daemon process first to free up memory\. - -The daemon process is fully managed by Lambda and cannot be configured by the user\. All segments generated by function invocations are recorded in the same account as the Lambda function\. The daemon cannot be configured to redirect them to any other account\. - -For more information, see [The X\-Ray daemon](https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html) in the X\-Ray Developer Guide\. - -## Enabling active tracing with the Lambda API - -To manage tracing configuration with the AWS CLI or AWS SDK, use the following API operations: -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [GetFunctionConfiguration](API_GetFunctionConfiguration.md) -+ [CreateFunction](API_CreateFunction.md) - -The following example AWS CLI command enables active tracing on a function named **my\-function**\. - -``` -aws lambda update-function-configuration --function-name my-function \ ---tracing-config Mode=Active -``` - -Tracing mode is part of the version\-specific configuration when you publish a version of your function\. You can't change the tracing mode on a published version\. - -## Enabling active tracing with AWS CloudFormation - -To activate tracing on an `AWS::Lambda::Function` resource in an AWS CloudFormation template, use the `TracingConfig` property\. - -**Example [function\-inline\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/blob/master/templates/function-inline.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Lambda::Function](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html) - Properties: - TracingConfig: - Mode: Active - ... -``` - -For an AWS Serverless Application Model \(AWS SAM\) `AWS::Serverless::Function` resource, use the `Tracing` property\. - -**Example [template\.yml](https://github.com/awsdocs/aws-lambda-developer-guide/tree/main/sample-apps/blank-nodejs/template.yml) – Tracing configuration** - -``` -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Tracing: Active - ... -``` \ No newline at end of file diff --git a/doc_source/stepfunctions-lc.md b/doc_source/stepfunctions-lc.md deleted file mode 100644 index c40dbb4b..00000000 --- a/doc_source/stepfunctions-lc.md +++ /dev/null @@ -1,63 +0,0 @@ -# Managing state machines in the Lambda console - -You can use the Lambda console to view details about your Step Functions state machines and the Lambda functions that they use\. - -**Topics** -+ [Viewing state machine details](#stepfunctions-configure) -+ [Editing a state machine](#stepfunctions-edit) -+ [Running a state machine](#stepfunctions-run) - -## Viewing state machine details - -The Lambda console displays a list of your state machines in the current AWS Region that contain at least one workflow step that invokes a Lambda function\. - -Choose a state machine to view a graphical representation of the workflow\. Steps highlighted in blue represent Lambda functions\. Use the graph controls to zoom in, zoom out, and center the graph\. - -**Note** -When a Lambda function is [dynamically referenced with JsonPath](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html) in the state machine definition, the function details cannot be shown in the Lambda console\. Instead, the function name is listed as a **Dynamic reference**, and the corresponding steps in the graph are grayed out\. - -**To view state machine details** - -1. Open the Lambda console [Step Functions state machines page](https://console.aws.amazon.com/lambda/home#/stepfunctions)\. - -1. Choose a state machine\. - - The Lambda console opens the **Details** page\. - -For more information, see [Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) in the *AWS Step Functions Developer Guide*\. - -## Editing a state machine - -When you want to edit a state machine, Lambda opens the **Edit definition** page of the Step Functions console\. - -**To edit a state machine** - -1. Open the Lambda console [Step Functions state machine page](https://console.aws.amazon.com/lambda/home#/functions)\. - -1. Choose a state machine\. - -1. Choose **Edit**\. - - The Step Functions console opens the **Edit definition** page\. - -1. Edit the state machine and choose **Save**\. - -For more information about editing state machines, see [Step Functions state machine language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) in the *AWS Step Functions Developer Guide*\. - -## Running a state machine - -When you want to run a state machine, Lambda opens the **New execution** page of the Step Functions console\. - -**To run a state machine** - -1. Open the Lambda console [Step Functions state machines page](https://console.aws.amazon.com/lambda/home#/stepfunctions)\. - -1. Choose a state machine\. - -1. Choose **Execute**\. - - The Step Functions console opens the **New execution** page\. - -1. \(Optional\) Edit the state machine and choose **Start execution**\. - -For more information about running state machines, see [Step Functions state machine execution concepts](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-executions.html) in the *AWS Step Functions Developer Guide*\. \ No newline at end of file diff --git a/doc_source/stepfunctions-patterns.md b/doc_source/stepfunctions-patterns.md deleted file mode 100644 index a38cdde0..00000000 --- a/doc_source/stepfunctions-patterns.md +++ /dev/null @@ -1,143 +0,0 @@ -# State machine application patterns - -In Step Functions, you orchestrate your resources using state machines, which are defined using a JSON\-based, structured language called [Amazon States Language](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)\. - -**Topics** -+ [State machine components](#statemachine-components) -+ [State machine application patterns](#stepfunctions-application-patterns) -+ [Applying patterns to state machines](#stepfunctions-patterns-state-machines) -+ [Example branching application pattern](#statemachine-example) - -## State machine components - -State machines contain elements called [states](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-states.html) that make up your workflow\. The logic of each state determines which state comes next, what data to pass along, and when to terminate the workflow\. A state is referred to by its name, which can be any string, but which must be unique within the scope of the entire state machine\. - -To create a state machine that uses Lambda, you need the following components: - -1. An AWS Identity and Access Management \(IAM\) role for Lambda with one or more permissions policies \(such as [AWSLambdaRole](https://console.aws.amazon.com/iam/home#/policies/arn:aws:iam::aws:policy/service-role/AWSLambdaRole) service permissions\)\. - -1. One or more Lambda functions \(with the IAM role attached\) for your specific runtime\. - -1. A state machine authored in Amazon States Language\. - -## State machine application patterns - -You can create complex orchestrations for state machines using application patterns such as: -+ **Catch and retry** – Handle errors using sophisticated catch\-and\-retry functionality\. -+ **Branching** – Design your workflow to choose different branches based on Lambda function output\. -+ **Chaining** – Connect functions into a series of steps, with the output of one step providing the input to the next step\. -+ **Parallelism** – Run functions in parallel, or use dynamic parallelism to invoke a function for every member of any array\. - -## Applying patterns to state machines - -The following shows how you can apply these application patterns to a state machine within an Amazon States Language definition\. - -**Catch and Retry** -A `Catch` field and a `Retry` field add catch\-and\-retry logic to a state machine\. [Catch](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html#error-handling-fallback-states) \(`"Type": "Catch"`\) is an array of objects that define a fallback state\. [Retry](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html#error-handling-retrying-after-an-error) \(`"Type": "Retry"`\) is an array of objects that define a retry policy if the state encounters runtime errors\. - -**Branching** -A `Choice` state adds branching logic to a state machine\. [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) \(`"Type": "Choice"`\) is an array of rules that determine which state the state machine transitions to next\. - -**Chaining** -A "Chaining" pattern describes multiple Lambda functions connected together in a state machine\. You can use chaining to create reusable workflow invocations from a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-nested-workflows.html) \(`"Type": "Task"`\) state of a state machine\. - -**Parallelism** -A `Parallel` state adds parallelism logic to a state machine\. You can use a [Parallel](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-parallel-state.html) state \(`"Type": "Parallel"`\) to create parallel branches of invocation in your state machine\. - -**Dynamic parallelism** -A `Map` state adds dynamic "for\-each" loop logic to a state machine\. You can use a [Map](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html) state \(`"Type": "Map"`\) to run a set of steps for each element of an input array in a state machine\. While the `Parallel` state invokes multiple branches of steps using the same input, a `Map` state invokes the same steps for multiple entries of the array\. - -In addition to application patterns, Step Functions supports various [service integration patterns](https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html), including the ability to pause a workflow for human approval, or to call a legacy system or other third party\. - -## Example branching application pattern - -In the following example, the `WhichCoat` state machine defined in the Amazon States Language \(ASL\) definition shows a branching application pattern with a [Choice](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html) state \(`"Type": "Choice"`\)\. If the condition of one of the three `Choice` states is met, the Lambda function is invoked as a [Task](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html): - -1. The `WearHeavyCoat` state invokes the `wear_heavy_coat` Lambda function and returns a message\. - -1. The `WearLightJacket` state invokes the `wear_light_jacket` Lambda function and returns a message\. - -1. The `None` state invokes the `no_jacket` Lambda function and returns a message\. - -The `WhichCoat` state machine has the following structure: - -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/sample-stepfunctions-wearcoat.png) - -**Example Amazon States Language definition** -The following Amazon States Language definition of the `WhichCoat` state machine uses a `Variable` [context object](https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html) called `Weather`\. If one of the three conditions in `StringEquals` is met, the Lambda function defined in the [`Resource` field's Amazon Resource Name \(ARN\)](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#amazon-states-language-task-state-specifying-resource-arns) is invoked\. - -``` -{ - "Comment":"Coat Indicator State Machine", - "StartAt":"WhichCoat", - "States":{ - "WhichCoat":{ - "Type":"Choice", - "Choices":[ - { - "Variable":"$.Weather", - "StringEquals":"FREEZING", - "Next":"WearHeavyCoat" - }, - { - "Variable":"$.Weather", - "StringEquals":"COOL", - "Next":"WearLightJacket" - }, - { - "Variable":"$.Weather", - "StringEquals":"WARM", - "Next":"None" - } - ] - }, - "WearHeavyCoat":{ - "Type":"Task", - "Resource":"arn:aws:lambda:us-west-2:01234567890:function:wear_heavy_coat", - "End":true - }, - "WearLightJacket":{ - "Type":"Task", - "Resource":"arn:aws:lambda:us-west-2:01234567890:function:wear_light_jacket", - "End":true - }, - "None":{ - "Type":"Task", - "Resource":"arn:aws:lambda:us-west-2:01234567890:function:no_coat", - "End":true - } - } - } -``` - - -**Example Python function** -The following Lambda function in Python \(`wear_heavy_coat`\) can be invoked for the state machine defined in the previous example\. If the `WhichCoat` state machine equals a string value of `FREEZING`, the `wear_heavy_coat` function is invoked from Lambda, and the user receives the message that corresponds with the function: "You should wear a heavy coat today\." - -``` -from __future__ import print_function - -import datetime - - -def wear_heavy_coat(message, context): - print(message) - - response = {} - response['Weather'] = message['Weather'] - response['Timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S") - response['Message'] = 'You should wear a heavy coat today.' - - return response -``` - -**Example invocation data** -The following input data runs the `WearHeavyCoat` state that invokes the `wear_heavy_coat` Lambda function, when the `Weather` variable is equal to a string value of `FREEZING`\. - -``` -{ - "Weather":"FREEZING" -} -``` - -For more information, see [Creating a Step Functions State Machine That Uses Lambda](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-creating-lambda-state-machine.html) in the *AWS Step Functions Developer Guide*\. \ No newline at end of file diff --git a/doc_source/telemetry-api-reference.md b/doc_source/telemetry-api-reference.md deleted file mode 100644 index 08b50056..00000000 --- a/doc_source/telemetry-api-reference.md +++ /dev/null @@ -1,126 +0,0 @@ -# Lambda Telemetry API reference - -Use the Lambda Telemetry API endpoint to subscribe extensions to telemetry streams\. You can retrieve the Telemetry API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, append the API version \(`2022-07-01/`\) and `telemetry/`\. For example: - -``` -http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry/ -``` - -**Note** -We will update this section with the OpenAPI Specification \(OAS\) definition of the latest version of the Telemetry API for HTTP and TCP protocols in the coming weeks\. - -**Topics** -+ [Subscribe](#telemetry-subscribe-api) - -## Subscribe - -To subscribe to a telemetry stream, a Lambda extension can send a Subscribe API request\. -+ **Path** – `/telemetry` -+ **Method** – `PUT` -+ **Headers** - + `Content-Type`: `application/json` -+ **Request body parameters** - + **schemaVersion** - + Required: Yes - + Type: String - + Valid values: `"2022-07-01"` - + **destination** – The configuration settings that define the telemetry event destination and the protocol for event delivery\. - + Required: Yes - + Type: Object - - ``` - { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080" - } - ``` - + **protocol** – The protocol that Lambda uses to send telemetry data\. - + Required: Yes - + Type: String - + Valid values: `"HTTP"`\|`"TCP"` - + **URI** – The URI to send telemetry data to\. - + Required: Yes - + Type: String - + For more information, see [Specifying a destination protocol](telemetry-api.md#telemetry-api-destination)\. - + **types** – The types of telemetry that you want the extension to subscribe to\. - + Required: Yes - + Type: Array of strings - + Valid values: `"platform"`\|`"function"`\|`"extension"` - + **buffering** – The configuration settings for event buffering\. - + Required: No - + Type: Object - - ``` - { - "buffering": { - "maxItems": 1000, - "maxBytes": 256*1024, - "timeoutMs": 100 - } - } - ``` - + **maxItems** – The maximum number of events to buffer in memory\. - + Required: No - + Type: Integer - + Default: 1,000 - + Minimum: 25 - + Maximum: 30,000 - + **maxBytes** – The maximum volume of telemetry \(in bytes\) to buffer in memory\. - + Required: No - + Type: Integer - + Default: 262,144 - + Minimum: 262,144 - + Maximum: 1,048,576 - + **timeoutMs** – The maximum time \(in milliseconds\) to buffer a batch\. - + Required: No - + Type: Integer - + Default: 10,000 - + Minimum: 1,000 - + Maximum: 10,000 - + For more information, see [Configuring memory usage and buffering](telemetry-api.md#telemetry-api-buffering)\. - -### Example Subscribe API request - -``` -PUT http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry HTTP/1.1 -{ - "schemaVersion": "2022-07-01", - "types": [ - "platform", - "function", - "extension" - ], - "buffering": { - "maxItems": 1000, - "maxBytes": 256*1024, - "timeoutMs": 100 - }, - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080" - } -} -``` - -If the Subscribe request succeeds, the extension receives an HTTP 200 success response: - -``` -HTTP/1.1 200 OK -"OK" -``` - -If the Subscribe request fails, the extension receives an error response\. For example: - -``` -HTTP/1.1 400 OK -{ - "errorType": "ValidationError", - "errorMessage": "URI port is not provided; types should not be empty" -} -``` - -Here are some additional response codes that the extension can receive: -+ 200 – Request completed successfully -+ 202 – Request accepted\. Subscription request response in local testing environment -+ 400 – Bad request -+ 500 – Service error \ No newline at end of file diff --git a/doc_source/telemetry-api.md b/doc_source/telemetry-api.md deleted file mode 100644 index b45d5092..00000000 --- a/doc_source/telemetry-api.md +++ /dev/null @@ -1,263 +0,0 @@ -# Lambda Telemetry API - -Using the Lambda Telemetry API, your extensions can directly receive telemetry data from Lambda\. During function initialization and invocation, Lambda automatically captures telemetry, such as logs, platform metrics, and platform traces\. With Telemetry API, extensions can get this telemetry data directly from Lambda in near real time\. - -You can subscribe your Lambda extensions to telemetry streams directly from within the Lambda execution environment\. After subscribing, Lambda automatically streams all telemetry data to your extensions\. You can then process, filter, and deliver that data to your preferred destination, such as an Amazon Simple Storage Service \(Amazon S3\) bucket or a third\-party observability tools provider\. - -The following diagram shows how the Extensions API and Telemetry API connect extensions to Lambda from within the execution environment\. The Runtime API also connects your runtime and function to Lambda\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-concept-diagram.png) - -**Important** -The Lambda Telemetry API supersedes the Lambda Logs API\. **While the Logs API remains fully functional, we recommend using only the Telemetry API going forward\.** You can subscribe your extension to a telemetry stream using either the Telemetry API or the Logs API\. After subscribing using one of these APIs, any attempt to subscribe using the other API returns an error\. - -Extensions can use the Telemetry API to subscribe to three different telemetry streams: -+ **Platform telemetry** – Logs, metrics, and traces, which describe events and errors related to the execution environment runtime lifecycle, extension lifecycle, and function invocations\. -+ **Function logs** – Custom logs that the Lambda function code generates\. -+ **Extension logs** – Custom logs that the Lambda extension code generates\. - -**Note** -Lambda sends logs and metrics to CloudWatch, and traces to X\-Ray \(if you've activated tracing\), even if an extension subscribes to telemetry streams\. - -**Topics** -+ [Creating extensions using the Telemetry API](#telemetry-api-creating-extensions) -+ [Registering your extension](#telemetry-api-registration) -+ [Creating a telemetry listener](#telemetry-api-listener) -+ [Specifying a destination protocol](#telemetry-api-destination) -+ [Configuring memory usage and buffering](#telemetry-api-buffering) -+ [Sending a subscription request to the Telemetry API](#telemetry-api-subscription) -+ [Inbound Telemetry API messages](#telemetry-api-messages) -+ [Lambda Telemetry API reference](telemetry-api-reference.md) -+ [Lambda Telemetry API `Event` schema reference](telemetry-schema-reference.md) -+ [Converting Lambda Telemetry API `Event` objects to OpenTelemetry Spans](telemetry-otel-spans.md) -+ [Lambda Logs API](runtimes-logs-api.md) - -## Creating extensions using the Telemetry API - -Lambda extensions run as independent processes in the execution environment, and can continue to run after the function invocation completes\. Because extensions are separate processes, you can write them in a language different from the function code\. We recommend implementing extensions using a compiled language such as Golang or Rust\. This way, the extension is a self\-contained binary that can be compatible with any supported runtime\. - -The following diagram illustrates a four\-step process to create an extension that receives and processes telemetry data using the Telemetry API\. - -![\[\]](http://docs.aws.amazon.com/lambda/latest/dg/images/telemetry-api-creation-steps.png) - -Here is each step in more detail: - -1. Register your extension using the [Lambda Extensions API](runtimes-extensions-api.md)\. This provides you with a `Lambda-Extension-Identifier`, which you'll need in the following steps\. For more information about how to register your extension, see [Registering your extension](#telemetry-api-registration)\. - -1. Create a telemetry listener\. This can be a basic HTTP or TCP server\. Lambda uses the URI of the telemetry listener to send telemetry data to your extension\. For more information, see [Creating a telemetry listener](#telemetry-api-listener)\. - -1. Using the Subscribe API in the Telemetry API, subscribe your extension to your desired telemetry streams\. You'll need the URI of your telemetry listener for this step\. For more information, see [Sending a subscription request to the Telemetry API](#telemetry-api-subscription)\. - -1. Get telemetry data from Lambda via the telemetry listener\. You can do any custom processing of this data, such as dispatching the data to Amazon S3 or to an external observability service\. - -**Note** -A Lambda function's execution environment can start and stop multiple times as part of its [lifecycle](runtimes-extensions-api.md#runtimes-extensions-api-lifecycle)\. In general, your extension code runs during function invocations, and also up to 2 seconds during the shutdown phase\. We recommend batching the telemetry as it arrives to your listener, and using the `Invoke` and `Shutdown` lifecycle events to dispatch each batch to their desired destinations\. - -## Registering your extension - -Before you can subscribe to receive telemetry data, you must register your Lambda extension\. Registration occurs during the [extension initialization phase](runtimes-extensions-api.md#runtimes-extensions-api-reg)\. The following example shows an HTTP request to register an extension\. - -``` -POST http://${AWS_LAMBDA_RUNTIME_API}/2020-01-01/extension/register - Lambda-Extension-Name: lambda_extension_name -{ - 'events': [ 'INVOKE', 'SHUTDOWN'] -} -``` - -If the request succeeds, the subscriber receives an HTTP 200 success response\. The response header contains the `Lambda-Extension-Identifier`\. The response body contains other properties of the function\. - -``` -HTTP/1.1 200 OK -Lambda-Extension-Identifier: a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 -{ - "functionName": "lambda_function", - "functionVersion": "$LATEST", - "handler": "lambda_handler", - "accountId": "123456789012" -} -``` - -For more information, see the [Extensions API reference](runtimes-extensions-api.md#runtimes-extensions-registration-api)\. - -## Creating a telemetry listener - -Your Lambda extension must have a listener that handles incoming requests from the Telemetry API\. The following code shows an example telemetry listener implementation in Golang: - -``` -// Starts the server in a goroutine where the log events will be sent -func (s *TelemetryApiListener) Start() (string, error) { - address := listenOnAddress() - l.Info("[listener:Start] Starting on address", address) - s.httpServer = &http.Server{Addr: address} - http.HandleFunc("/", s.http_handler) - go func() { - err := s.httpServer.ListenAndServe() - if err != http.ErrServerClosed { - l.Error("[listener:goroutine] Unexpected stop on Http Server:", err) - s.Shutdown() - } else { - l.Info("[listener:goroutine] Http Server closed:", err) - } - }() - return fmt.Sprintf("http://%s/", address), nil -} - -// http_handler handles the requests coming from the Telemetry API. -// Everytime Telemetry API sends log events, this function will read them from the response body -// and put into a synchronous queue to be dispatched later. -// Logging or printing besides the error cases below is not recommended if you have subscribed to -// receive extension logs. Otherwise, logging here will cause Telemetry API to send new logs for -// the printed lines which may create an infinite loop. -func (s *TelemetryApiListener) http_handler(w http.ResponseWriter, r *http.Request) { - body, err := ioutil.ReadAll(r.Body) - if err != nil { - l.Error("[listener:http_handler] Error reading body:", err) - return - } - - // Parse and put the log messages into the queue - var slice []interface{} - _ = json.Unmarshal(body, &slice) - - for _, el := range slice { - s.LogEventsQueue.Put(el) - } - - l.Info("[listener:http_handler] logEvents received:", len(slice), " LogEventsQueue length:", s.LogEventsQueue.Len()) - slice = nil -} -``` - -## Specifying a destination protocol - -When you subscribe to receive telemetry using the Telemetry API, you can specify a destination protocol in addition to the destination URI: - -``` -{ - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080" - } -} -``` - -Lambda accepts two protocols for receiving telemetry: -+ **HTTP \(recommended\)** – Lambda delivers telemetry to a local HTTP endpoint \(`http://sandbox.localdomain:${PORT}/${PATH}`\) as an array of records in JSON format\. The `$PATH` parameter is optional\. Lambda supports only HTTP, not HTTPS\. Lambda delivers telemetry through POST requests\. -+ **TCP** – Lambda delivers telemetry to a TCP port in [Newline delimited JSON \(NDJSON\) format](https://github.com/ndjson/ndjson-spec)\. - -**Note** -We strongly recommend using HTTP rather than TCP\. With TCP, the Lambda platform cannot acknowledge when it delivers telemetry to the application layer\. Therefore, if your extension crashes, you might lose telemetry\. HTTP does not have this limitation\. - -Before subscribing to receive telemetry, set up the local HTTP listener or TCP port\. During setup, note the following: -+ Lambda sends telemetry only to destinations that are inside the execution environment\. -+ Lambda retries the attempt to send telemetry \(with backoff\) if there is no listener, or if the POST request results in an error\. If the telemetry listener crashes, then it continues to receive telemetry after Lambda restarts the execution environment\. -+ Lambda reserves port 9001\. There are no other port number restrictions or recommendations\. - -## Configuring memory usage and buffering - -An execution environment's memory usage increases linearly as the number of subscribers increases\. Subscriptions consume memory resources because each subscription opens a new memory buffer to store telemetry data\. Buffer memory usage counts towards overall memory consumption in the execution environment\. - -When you subscribe to receive telemetry using the Telemetry API, you can buffer telemetry data and deliver it to subscribers in batches\. To help optimize memory usage, you can specify a buffering configuration: - -``` -{ - "buffering": { - "maxBytes": 256*1024, - "maxItems": 1000, - "timeoutMs": 100 - } -} -``` - - -**Buffering configuration settings** - -| Parameter | Description | Defaults and limits | -| --- | --- | --- | -| `maxBytes` | The maximum volume of telemetry \(in bytes\) to buffer in memory\. | Default: 262,144 Minimum: 262,144 Maximum: 1,048,576 | -| `maxItems` | The maximum number of events to buffer in memory\. | Default: 10,000 Minimum: 1,000 Maximum: 10,000 | -| `timeoutMs` | The maximum time \(in milliseconds\) to buffer a batch\. | Default: 1,000 Minimum: 25 Maximum: 30,000 | - -When configuring buffering, note the following points: -+ If any of the input streams are closed, then Lambda flushes the logs\. This can happen if, for example, the runtime crashes\. -+ Each subscriber can specify a different buffering configuration in their subscription request\. -+ Consider the buffer size that you need for reading the data\. Expect to receive payloads as large as `2 * maxBytes + metadataBytes`, where `maxBytes` is part of your buffering configuration\. To get an idea of how much `metadataBytes` you should account for, review the following metadata\. Lambda adds metadata similar to this to each record: - - ``` - { - "time": "2022-08-20T12:31:32.123Z", - "type": "function", - "record": "Hello World" - } - ``` -+ If the subscriber cannot process incoming telemetry fast enough, Lambda might drop records to keep memory utilization bounded\. When this occurs, Lambda sends a `platform.logsDropped` event\. - -## Sending a subscription request to the Telemetry API - -Lambda extensions can subscribe to receive telemetry data by sending a subscription request to the Telemetry API\. The subscription request should contain information about the types of events that you want the extension to subscribe to\. In addition, the request can contain [delivery destination information](#telemetry-api-destination) and a [buffering configuration](#telemetry-api-buffering)\. - -Before sending a subscription request, you must have an extension ID \(`Lambda-Extension-Identifier`\)\. When you [register your extension with the Extensions API](#telemetry-api-registration), you obtain an extension ID from the API response\. - -Subscription occurs during the [extension initialization phase](runtimes-extensions-api.md#runtimes-extensions-api-reg)\. The following example shows an HTTP request to subscribe to all three telemetry streams: platform telemetry, function logs, and extension logs\. - -``` -PUT http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry HTTP/1.1 -{ - "schemaVersion": "2022-07-01", - "types": [ - "platform", - "function", - "extension" - ], - "buffering": { - "maxItems": 1000, - "maxBytes": 256*1024, - "timeoutMs": 100 - }, - "destination": { - "protocol": "HTTP", - "URI": "http://sandbox.localdomain:8080" - } -} -``` - -If the request succeeds, then the subscriber receives an HTTP 200 success response\. - -``` -HTTP/1.1 200 OK -"OK" -``` - -## Inbound Telemetry API messages - -After subscribing using the Telemetry API, an extension automatically starts to receive telemetry from Lambda via POST requests to the telemetry listener\. Each POST request body contains an array of `Event` objects\. `Event` is a JSON object with the following schema: - -``` -{ - time: String, - type: String, - record: Object -} -``` -+ The `time` property defines when the Lambda platform generated the event\. This isn't the same as when the event actually occurred\. The string value of `time` is a timestamp in ISO 8601 format\. -+ The `type` property defines the event type\. The following table describes all possible values\. -+ The `record` property defines a JSON object that contains the telemetry data\. The schema of this JSON object depends on the `type`\. - -The following table summarizes all types of `Event` objects, and links to the [Telemetry API `Event` schema reference](telemetry-schema-reference.md) for each event type\. - - -**Telemetry API message types** - -| Category | Event type | Description | Event record schema | -| --- | --- | --- | --- | -| Platform event | `platform.initStart` | Function initialization started\. | [`platform.initStart`](telemetry-schema-reference.md#platform-initStart) schema | -| Platform event | `platform.initRuntimeDone` | Function initialization completed\. | [`platform.initRuntimeDone`](telemetry-schema-reference.md#platform-initRuntimeDone) schema | -| Platform event | `platform.initReport` | A report of function initialization\. | [`platform.initReport`](telemetry-schema-reference.md#platform-initReport) schema | -| Platform event | `platform.start` | Function invocation started\. | [`platform.start`](telemetry-schema-reference.md#platform-start) schema | -| Platform event | `platform.runtimeDone` | The runtime finished processing an event with either success or failure\. | [`platform.runtimeDone`](telemetry-schema-reference.md#platform-runtimeDone) schema | -| Platform event | `platform.report` | A report of function invocation\. | [`platform.report`](telemetry-schema-reference.md#platform-report) schema | -| Platform event | `platform.telemetrySubscription` | The extension subscribed to the Telemetry API\. | [`platform.telemetrySubscription`](telemetry-schema-reference.md#platform-telemetrySubscription) schema | -| Platform event | `platform.logsDropped` | Lambda dropped log entries\. | [`platform.logsDropped`](telemetry-schema-reference.md#platform-logsDropped) schema | -| Function logs | `function` | A log line from function code\. | [`function`](telemetry-schema-reference.md#telemetry-api-function) schema | -| Extension logs | `extension` | A log line from extension code\. | [`extension`](telemetry-schema-reference.md#telemetry-api-extension) schema | \ No newline at end of file diff --git a/doc_source/telemetry-otel-spans.md b/doc_source/telemetry-otel-spans.md deleted file mode 100644 index 02478bb6..00000000 --- a/doc_source/telemetry-otel-spans.md +++ /dev/null @@ -1,98 +0,0 @@ -# Converting Lambda Telemetry API `Event` objects to OpenTelemetry Spans - -The AWS Lambda Telemetry API schema is semantically compatible with OpenTelemetry \(OTel\)\. This means that you can convert your AWS Lambda Telemetry API `Event` objects to OpenTelemetry \(OTel\) Spans\. When converting, you shouldn't map a single `Event` object to a single OTel Span\. Instead, you should present all three events related to a lifecycle phase in a single OTel Span\. For example, the `start`, `runtimeDone`, and `runtimeReport` events represent a single function invocation\. Present all three of these events as a single OTel Span\. - -You can convert your events using Span Events or Child \(nested\) Spans\. The tables on this page describe the mappings between Telemetry API schema properties and OTel Span properties for both approaches\. For more information about OTel Spans, see [Span](https://opentelemetry.io/docs/reference/specification/trace/api/#span) on the **Tracing API** page of the OpenTelemetry Docs website\. - -**Topics** -+ [Map to OTel Spans with Span Events](#telemetry-otel-span-events) -+ [Map to OTel Spans with Child Spans](#telemetry-otel-child-spans) - -## Map to OTel Spans with Span Events - -In the following tables, `e` represents the event coming from the telemetry source\. - - -**Mapping the `*Start` events** - -| OpenTelemetry | Lambda Telemetry API schema | -| --- | --- | -| `Span.Name` | Your extension generates this value based on the `type` field\. | -| `Span.StartTime` | Use `e.time`\. | -| `Span.EndTime` | N/A, because the event hasn't completed yet\. | -| `Span.Kind` | Set to `Server`\. | -| `Span.Status` | Set to `Unset`\. | -| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | -| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | -| `Span.SpanId` | Use `e.tracing.spanId` if available\. Otherwise, generate a new `SpanId`\. | -| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | -| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | -| `Span.Attributes` | Your extension can add any custom values here\. | - - -**Mapping the `*RuntimeDone` events** - -| OpenTelemetry | Lambda Telemetry API schema | -| --- | --- | -| `Span.Name` | Your extension generates the value based on the `type` field\. | -| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | -| `Span.EndTime` | N/A, because the event hasn't completed yet\. | -| `Span.Kind` | Set to `Server`\. | -| `Span.Status` | If `e.status` doesn't equal `success`, then set to `Error`\. Otherwise, set to `Ok`\. | -| `Span.Events[]` | Use `e.spans[]`\. | -| `Span.Events[i].Name` | Use `e.spans[i].name`\. | -| `Span.Events[i].Time` | Use `e.spans[i].start`\. | -| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | -| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | -| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | -| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | -| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | -| `Span.Attributes` | Your extension can add any custom values here\. | - - -**Mapping the `*Report` events** - -| OpenTelemetry | Lambda Telemetry API schema | -| --- | --- | -| `Span.Name` | Your extension generates the value based on the `type` field\. | -| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | -| `Span.EndTime` | Use `e.time`\. | -| `Span.Kind` | Set to `Server`\. | -| `Span.Status` | Use the same value as the `*RuntimeDone` event\. | -| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | -| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | -| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | -| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | -| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | -| `Span.Attributes` | Your extension can add any custom values here\. | - -## Map to OTel Spans with Child Spans - -The following table describes how to convert Lambda Telemetry API events into OTel Spans with Child \(nested\) Spans for `*RuntimeDone` Spans\. For `*Start` and `*Report` mappings, refer to the tables in [Map to OTel Spans with Span Events](#telemetry-otel-span-events), as they're the same for Child Spans\. In this table, `e` represents the event coming from the telemetry source\. - - -**Mapping the `*RuntimeDone` events** - -| OpenTelemetry | Lambda Telemetry API schema | -| --- | --- | -| `Span.Name` | Your extension generates the value based on the `type` field\. | -| `Span.StartTime` | Use `e.time` from the matching `*Start` event\. Alternatively, use `e.time - e.metrics.durationMs`\. | -| `Span.EndTime` | N/A, because the event hasn't completed yet\. | -| `Span.Kind` | Set to `Server`\. | -| `Span.Status` | If `e.status` doesn't equal `success`, then set to `Error`\. Otherwise, set to `Ok`\. | -| `Span.TraceId` | Parse the AWS X\-Ray header found in `e.tracing.value`, then use the `TraceId` value\. | -| `Span.ParentId` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Parent` value\. | -| `Span.SpanId` | Use the same `SpanId` from the `*Start` event\. If unavailable, then use `e.tracing.spanId`, or generate a new `SpanId`\. | -| `Span.SpanContext.TraceState` | N/A for an X\-Ray trace context\. | -| `Span.SpanContext.TraceFlags` | Parse the X\-Ray header found in `e.tracing.value`, then use the `Sampled` value\. | -| `Span.Attributes` | Your extension can add any custom values here\. | -| `ChildSpan[i].Name` | Use `e.spans[i].name`\. | -| `ChildSpan[i].StartTime` | Use `e.spans[i].start`\. | -| `ChildSpan[i].EndTime` | Use `e.spans[i].start + e.spans[i].durations`\. | -| `ChildSpan[i].Kind` | Same as parent `Span.Kind`\. | -| `ChildSpan[i].Status` | Same as parent `Span.Status`\. | -| `ChildSpan[i].TraceId` | Same as parent `Span.TraceId`\. | -| `ChildSpan[i].ParentId` | Use parent `Span.SpanId`\. | -| `ChildSpan[i].SpanId` | Generate a new `SpanId`\. | -| `ChildSpan[i].SpanContext.TraceState` | N/A for an X\-Ray trace context\. | -| `ChildSpan[i].SpanContext.TraceFlags` | Same as parent `Span.SpanContext.TraceFlags`\. | \ No newline at end of file diff --git a/doc_source/telemetry-schema-reference.md b/doc_source/telemetry-schema-reference.md deleted file mode 100644 index 57b38cda..00000000 --- a/doc_source/telemetry-schema-reference.md +++ /dev/null @@ -1,556 +0,0 @@ -# Lambda Telemetry API `Event` schema reference - -Use the Lambda Telemetry API endpoint to subscribe extensions to telemetry streams\. You can retrieve the Telemetry API endpoint from the `AWS_LAMBDA_RUNTIME_API` environment variable\. To send an API request, append the API version \(`2022-07-01/`\) and `telemetry/`\. For example: - -``` -http://${AWS_LAMBDA_RUNTIME_API}/2022-07-01/telemetry/ -``` - -**Note** -We will update this section with the OpenAPI Specification \(OAS\) definition of the latest version of the Telemetry API for HTTP and TCP protocols in the coming weeks\. - -The following table is a summary of all the types of `Event` objects that the Telemetry API supports\. - - -**Telemetry API message types** - -| Category | Event type | Description | Event record schema | -| --- | --- | --- | --- | -| Platform event | `platform.initStart` | Function initialization started\. | [`platform.initStart`](#platform-initStart) schema | -| Platform event | `platform.initRuntimeDone` | Function initialization completed\. | [`platform.initRuntimeDone`](#platform-initRuntimeDone) schema | -| Platform event | `platform.initReport` | A report of function initialization\. | [`platform.initReport`](#platform-initReport) schema | -| Platform event | `platform.start` | Function invocation started\. | [`platform.start`](#platform-start) schema | -| Platform event | `platform.runtimeDone` | The runtime finished processing an event with either success or failure\. | [`platform.runtimeDone`](#platform-runtimeDone) schema | -| Platform event | `platform.report` | A report of function invocation\. | [`platform.report`](#platform-report) schema | -| Platform event | `platform.telemetrySubscription` | The extension subscribed to the Telemetry API\. | [`platform.telemetrySubscription`](#platform-telemetrySubscription) schema | -| Platform event | `platform.logsDropped` | Lambda dropped log entries\. | [`platform.logsDropped`](#platform-logsDropped) schema | -| Function logs | `function` | A log line from function code\. | [`function`](#telemetry-api-function) schema | -| Extension logs | `extension` | A log line from extension code\. | [`extension`](#telemetry-api-extension) schema | - -**Contents** -+ [Telemetry API `Event` object types](#telemetry-api-events) - + [`platform.initStart`](#platform-initStart) - + [`platform.initRuntimeDone`](#platform-initRuntimeDone) - + [`platform.initReport`](#platform-initReport) - + [`platform.start`](#platform-start) - + [`platform.runtimeDone`](#platform-runtimeDone) - + [`platform.report`](#platform-report) - + [`platform.extension`](#platform-extension) - + [`platform.telemetrySubscription`](#platform-telemetrySubscription) - + [`platform.logsDropped`](#platform-logsDropped) - + [`function`](#telemetry-api-function) - + [`extension`](#telemetry-api-extension) -+ [Shared object types](#telemetry-api-objects) - + [`InitPhase`](#InitPhase) - + [`InitReportMetrics`](#InitReportMetrics) - + [`InitType`](#InitType) - + [`ReportMetrics`](#ReportMetrics) - + [`RuntimeDoneMetrics`](#RuntimeDoneMetrics) - + [Span](#Span) - + [`Status`](#Status) - + [`TraceContext`](#TraceContext) - + [`TracingType`](#TracingType) - -## Telemetry API `Event` object types - -This section details the types of `Event` objects that the Lambda Telemetry API supports\. In the event descriptions, a question mark \(`?`\) indicates that the attribute may not be present in the object\. - -### `platform.initStart` - -A `platform.initStart` event indicates that the function initialization phase has started\. A `platform.initStart` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.initStart -- record: PlatformInitStart -``` - -The `PlatformInitStart` object has the following attributes: -+ **initializationType** – ``InitType`` object -+ **phase** – ``InitPhase`` object -+ **runtimeArn?** – `String` -+ **runtimeVersion?** – `String` - -The following is an example `Event` of type `platform.initStart`: - -``` -{ - "time": "2022-10-12T00:00:15.064Z", - "type": "platform.initStart", - "record": { - "initializationType": "on-demand", - "phase": "init", - "runtimeVersion": "nodejs-14.v3", - "runtimeVersionArn": "arn" - } -} -``` - -### `platform.initRuntimeDone` - -A `platform.initRuntimeDone` event indicates that the function initialization phase has completed\. A `platform.initRuntimeDone` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.initRuntimeDone -- record: PlatformInitRuntimeDone -``` - -The `PlatformInitRuntimeDone` object has the following attributes: -+ **initializationType** – ``InitType`` object -+ **phase** – ``InitPhase`` object -+ **status** – ``Status`` object -+ **spans?** – List of [Span](#Span) objects - -The following is an example `Event` of type `platform.initRuntimeDone`: - -``` -{ - "time": "2022-10-12T00:01:15.000Z", - "type": "platform.initRuntimeDone", - "record": { - "initializationType": "on-demand" - "status": "success", - "spans": [ - { - "name": "someTimeSpan", - "start": "2022-06-02T12:02:33.913Z", - "durationMs": 70.5 - } - ] - } -} -``` - -### `platform.initReport` - -A `platform.initReport` event contains an overall report of the function initialization phase\. A `platform.initReport` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.initReport -- record: PlatformInitReport -``` - -The `PlatformInitReport` object has the following attributes: -+ **initializationType** – ``InitType`` object -+ **phase** – ``InitPhase`` object -+ **metrics** – ``InitReportMetrics`` object -+ **spans?** – List of [Span](#Span) objects - -The following is an example `Event` of type `platform.initReport`: - -``` -{ - "time": "2022-10-12T00:01:15.000Z", - "type": "platform.initReport", - "record": { - "initializationType": "on-demand", - "phase": "init", - "metrics": { - "durationMs": 125.33 - }, - "spans": [ - { - "name": "someTimeSpan", - "start": "2022-06-02T12:02:33.913Z", - "durationMs": 90.1 - } - ] - } -} -``` - -### `platform.start` - -A `platform.start` event indicates that the function invocation phase has started\. A `platform.start` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.start -- record: PlatformStart -``` - -The `PlatformStart` object has the following attributes: -+ **requestId** – `String` -+ **version?** – `String` -+ **tracing?** – ``TraceContext`` - -The following is an example `Event` of type `platform.start`: - -``` -{ - "time": "2022-10-12T00:00:15.064Z", - "type": "platform.initStart", - "record": { - "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", - "version": "$LATEST", - "tracing": { - "spanId": "54565fb41ac79632", - "type": "X-Amzn-Trace-Id", - "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" - } - } -} -``` - -### `platform.runtimeDone` - -A `platform.runtimeDone` event indicates that the function invocation phase has completed\. A `platform.runtimeDone` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.runtimeDone -- record: PlatformRuntimeDone -``` - -The `PlatformRuntimeDone` object has the following attributes: -+ **metrics?** – ``RuntimeDoneMetrics`` object -+ **requestId** – `String` -+ **status** – ``Status`` object -+ **spans?** – List of [Span](#Span) objects -+ **tracing?** – ``TraceContext`` object - -The following is an example `Event` of type `platform.runtimeDone`: - -``` -{ - "time": "2022-10-12T00:01:15.000Z", - "type": "platform.runtimeDone", - "record": { - "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", - "status": "success", - "tracing": { - "spanId": "54565fb41ac79632", - "type": "X-Amzn-Trace-Id", - "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" - }, - "spans": [ - { - "name": "someTimeSpan", - "start": "2022-08-02T12:01:23:521Z", - "durationMs": 80.0 - } - ], - "metrics": { - "durationMs": 140.0, - "producedBytes": 16 - } - } -} -``` - -### `platform.report` - -A `platform.report` event contains an overall report of the function initialization phase\. A `platform.report` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.report -- record: PlatformReport -``` - -The `PlatformReport` object has the following attributes: -+ **metrics** – ``ReportMetrics`` object -+ **requestId** – `String` -+ **spans?** – List of [Span](#Span) objects -+ **status** – ``Status`` object -+ **tracing?** – ``TraceContext`` object - -The following is an example `Event` of type `platform.report`: - -``` -{ - "time": "2022-10-12T00:01:15.000Z", - "type": "platform.report", - "record": { - "metrics": { - "billedDurationMs": 694, - "durationMs": 693.92, - "initDurationMs": 397.68, - "maxMemoryUsedMB": 84, - "memorySizeMB": 128 - }, - "requestId": "6d68ca91-49c9-448d-89b8-7ca3e6dc66aa", - } -} -``` - -### `platform.extension` - -An `extension` event contains logs from the extension code\. An `extension` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = extension -- record: {} -``` - -The `PlatformExtension` object has the following attributes: -+ **events** – List of `String` -+ **name** – `String` -+ **state** – `String` - -The following is an example `Event` of type `platform.extension`: - -``` -{ - "time": "2022-10-12T00:02:15.000Z", - "type": "platform.extension", - "record": { - "events": [ "INVOKE", "SHUTDOWN" ], - "name": "my-telemetry-extension", - "state": "Ready" - } -} -``` - -### `platform.telemetrySubscription` - -A `platform.telemetrySubscription` event contains information about an extension subscription\. A `platform.telemetrySubscription` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.telemetrySubscription -- record: PlatformTelemetrySubscription -``` - -The `PlatformTelemetrySubscription` object has the following attributes: -+ **name** – `String` -+ **state** – `String` -+ **types** – List of `String` - -The following is an example `Event` of type `platform.telemetrySubscription`: - -``` -{ - "time": "2022-10-12T00:02:35.000Z", - "type": "platform.telemetrySubscription", - "record": { - "name": "my-telemetry-extension", - "state": "Subscribed", - "types": [ "platform", "function" ] - } -} -``` - -### `platform.logsDropped` - -A `platform.logsDropped` event contains information about dropped events\. Lambda emits the `platform.logsDropped` event when an extension can't process one or more events\. A `platform.logsDropped` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = platform.logsDropped -- record: PlatformLogsDropped -``` - -The `PlatformLogsDropped` object has the following attributes: -+ **droppedBytes** – `Integer` -+ **droppedRecords** – `Integer` -+ **reason** – `String` - -The following is an example `Event` of type `platform.logsDropped`: - -``` -{ - "time": "2022-10-12T00:02:35.000Z", - "type": "platform.logsDropped", - "record": { - "droppedBytes": 12345, - "droppedRecords": 123, - "reason": "Consumer seems to have fallen behind as it has not acknowledged receipt of logs." - } -} -``` - -### `function` - -A `function` event contains logs from the function code\. A `function` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = function -- record: {} -``` - -The following is an example `Event` of type `function`: - -``` -{ - "time": "2022-10-12T00:03:50.000Z", - "type": "function", - "record": "[INFO] Hello world, I am a function!" -} -``` - -### `extension` - -A `extension` event contains logs from the extension code\. A `extension` `Event` object has the following shape: - -``` -Event: Object -- time: String -- type: String = extension -- record: {} -``` - -The following is an example `Event` of type `extension`: - -``` -{ - "time": "2022-10-12T00:03:50.000Z", - "type": "extension", - "record": "[INFO] Hello world, I am an extension!" -} -``` - -## Shared object types - -This section details the types of shared objects that the Lambda Telemetry API supports\. - -### `InitPhase` - -A string enum that describes the phase when the initialization step occurs\. In most cases, Lambda runs the function initialization code during the `init` phase\. However, in some error cases, Lambda may re\-run the function initialization code during the `invoke` phase\. \(This is called a *suppressed init*\.\) -+ **Type** – `String` -+ **Valid values** – `init`\|`invoke` - -### `InitReportMetrics` - -An object that contains metrics about an initialization phase\. -+ **Type** – `Object` - -An `InitReportMetrics` object has the following shape: - -``` -InitReportMetrics: Object -- durationMs: Double -``` - -The following is an example `InitReportMetrics` object: - -``` -{ - "durationMs": 247.88 -} -``` - -### `InitType` - -A string enum that describes how Lambda initialized the environment\. -+ **Type** – `String` -+ **Valid values** – `on-demand`\|`provisioned-concurrency` - -### `ReportMetrics` - -An object that contains metrics about a completed phase\. -+ **Type** – `Object` - -A `ReportMetrics` object has the following shape: - -``` -ReportMetrics: Object -- billedDurationMs: Integer -- durationMs: Double -- initDurationMs?: Double -- maxMemoryUsedMB: Integer -- memorySizeMB: Integer -- restoreDurationMs?: Double -``` - -The following is an example `ReportMetrics` object: - -``` -{ - "billedDurationMs": 694, - "durationMs": 693.92, - "initDurationMs": 397.68, - "maxMemoryUsedMB": 84, - "memorySizeMB": 128 -} -``` - -### `RuntimeDoneMetrics` - -An object that contains metrics about an invocation phase\. -+ **Type** – `Object` - -A `RuntimeDoneMetrics` object has the following shape: - -``` -RuntimeDoneMetrics: Object -- durationMs: Double -- producedBytes?: Integer -``` - -The following is an example `RuntimeDoneMetrics` object: - -``` -{ - "durationMs": 200.0, - "producedBytes": 15 -} -``` - -### Span - -An object that contains details about a span\. A span represents a unit of work or operation in a trace\. For more information about spans, see [Span](https://opentelemetry.io/docs/reference/specification/trace/api/#span) on the **Tracing API** page of the OpenTelemetry Docs website\. - -Lambda supports the following two spans for the `platform.RuntimeDone` event: -+ The `responseLatency` span describes how long it took your Lambda function to start sending the response\. -+ The `responseDuration` span describes how long it took your Lambda function to finish sending the entire response\. - -The following is an example `responseLatency` span object: - -``` -{ - "name": "responseLatency", - "start": "2022-08-02T12:01:23.521Z", - "durationMs": 23.02 - } -``` - -### `Status` - -An object that describes the status of an initialization or invocation phase\. If the status is either `failure` or `error`, then the `Status` object also contains an `errorType` field describing the error\. -+ **Type** – `Object` -+ **Valid status values** – `success`\|`failure`\|`error` - -### `TraceContext` - -An object that describes the properties of a trace\. -+ **Type** – `Object` - -A `TraceContext` object has the following shape: - -``` -TraceContext: Object -- spanId?: String -- type: TracingType enum -- value: String -``` - -The following is an example `TraceContext` object: - -``` -{ - "spanId": "073a49012f3c312e", - "type": "X-Amzn-Trace-Id", - "value": "Root=1-62e900b2-710d76f009d6e7785905449a;Parent=0efbd19962d95b05;Sampled=1" -} -``` - -### `TracingType` - -A string enum that describes the type of tracing in a ``TraceContext`` object\. -+ **Type** – `String` -+ **Valid values** – `X-Amzn-Trace-Id` \ No newline at end of file diff --git a/doc_source/testing-functions.md b/doc_source/testing-functions.md deleted file mode 100644 index fc2a5e51..00000000 --- a/doc_source/testing-functions.md +++ /dev/null @@ -1,98 +0,0 @@ -# Testing Lambda functions in the console - -You can test your Lambda function in the console by invoking your function with a test event\. A *test event* is a JSON input to your function\. If your function doesn't require input, the event can be an empty document `({})`\. - -## Private test events - -Private test events are available only to the event creator, and they require no additional permissions to use\. You can create and save up to 10 private test events per function\. - -**To create a private test event** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function that you want to test\. - -1. Choose the **Test** tab\. - -1. Under **Test event**, do the following: - - 1. Choose a **Template**\. - - 1. Enter a **Name** for the test\. - - 1. In the text entry box, enter the JSON test event\. - - 1. Under **Event sharing settings**, choose **Private**\. - -1. Choose **Save changes**\. - -You can also create new test events on the **Code** tab\. From there, choose **Test**, **Configure test event**\. - -## Shareable test events - -Shareable test events are test events that you can share with other AWS Identity and Access Management \(IAM\) users in the same AWS account\. You can edit other users' shareable test events and invoke your function with them\. - -Lambda saves shareable test events as schemas in an [Amazon EventBridge \(CloudWatch Events\) schema registry](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-schema-registry.html) named `lambda-testevent-schemas`\. As Lambda utilizes this registry to store and call shareable test events you create, we recommend that you do not edit this registry or create a registry using the `lambda-testevent-schemas` name\. - -To see, share, and edit shareable test events, you must have permissions for all of the following [EventBridge \(CloudWatch Events\) schema registry API operations](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/operations.html): -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#CreateRegistry](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#CreateRegistry) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#CreateSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#CreateSchema) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DeleteSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DeleteSchema) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-version-schemaversion.html#DeleteSchemaVersion](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-version-schemaversion.html#DeleteSchemaVersion) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#DescribeRegistry](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname.html#DescribeRegistry) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DescribeSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#DescribeSchema) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discover.html#GetDiscoveredSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-discover.html#GetDiscoveredSchema) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-versions.html#ListSchemaVersions](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname-versions.html#ListSchemaVersions) -+ [https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#UpdateSchema](https://docs.aws.amazon.com/eventbridge/latest/schema-reference/v1-registries-name-registryname-schemas-name-schemaname.html#UpdateSchema) - -Note that saving edits made to a shareable test event overwrites that event\. - -If you cannot create, edit, or see shareable test events, check that your account has the required permissions for these operations\. If you have the required permissions but still cannot access shareable test events, check for any [resource\-based policies](access-control-resource-based.md) that might limit access to the EventBridge \(CloudWatch Events\) registry\. - -**To create a shareable test event** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function that you want to test\. - -1. Choose the **Test** tab\. - -1. Under **Test event**, do the following: - - 1. Choose a **Template**\. - - 1. Enter a **Name** for the test\. - - 1. In the text entry box, enter the JSON test event\. - - 1. Under **Event sharing settings**, choose **Shareable**\. - -1. Choose **Save changes**\. - -## Invoking functions with test events - -When you run a test event in the console, Lambda synchronously invokes your function with the test event\. The function runtime converts the JSON document into an object and passes it to your code's handler method for processing\. - -**To test a function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function that you want to test\. - -1. Choose the **Test** tab\. - -1. Under **Test event**, choose **Saved event**, and then choose the saved event that you want to use\. - -1. Choose **Test**\. - -1. To review the test results, under **Execution result**, expand **Details**\. - -To invoke your function without saving your test event, choose **Test** before saving\. This creates an unsaved test event that Lambda preserves for the duration of the session\. - -You can also access your saved and unsaved test events on the **Code** tab\. From there, choose **Test**, and then choose your test event\. - -## Deleting shareable test event schemas - -When you delete shareable test events, Lambda removes them from the `lambda-testevent-schemas` registry\. If you remove the last shareable test event from the registry, Lambda deletes the registry\. - -If you delete the function, Lambda does not delete any associated shareable test event schemas\. You must clean up these resources manually from the [EventBridge \(CloudWatch Events\) console](https://console.aws.amazon.com/events)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-deployment.md b/doc_source/troubleshooting-deployment.md deleted file mode 100644 index 6d52c04f..00000000 --- a/doc_source/troubleshooting-deployment.md +++ /dev/null @@ -1,115 +0,0 @@ -# Troubleshoot deployment issues in Lambda - -When you update your function, Lambda deploys the change by launching new instances of the function with the updated code or settings\. Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools\. - -When you deploy updates to your function directly with the Lambda API or with a client such as the AWS CLI, you can see errors from Lambda directly in the output\. If you use services like AWS CloudFormation, AWS CodeDeploy, or AWS CodePipeline, look for the response from Lambda in the logs or event stream for that service\. - -## General: Permission is denied / Cannot load such file - -**Error:** *EACCES: permission denied, open '/var/task/index\.js'* - -**Error:** *cannot load such file \-\- function* - -**Error:** *\[Errno 13\] Permission denied: '/var/task/function\.py'* - -The Lambda runtime needs permission to read the files in your deployment package\. You can use the `chmod` command to change the file mode\. The following example commands make all files and folders in the current directory readable by any user\. - -``` -chmod -R o+rX . -``` - -## General: Error occurs when calling the UpdateFunctionCode - -**Error:** *An error occurred \(RequestEntityTooLargeException\) when calling the UpdateFunctionCode operation* - -When you upload a deployment package or layer archive directly to Lambda, the size of the ZIP file is limited to 50 MB\. To upload a larger file, store it in Amazon S3 and use the S3Bucket and S3Key parameters\. - -**Note** -When you upload a file directly with the AWS CLI, AWS SDK, or otherwise, the binary ZIP file is converted to base64, which increases its size by about 30%\. To allow for this, and the size of other parameters in the request, the actual request size limit that Lambda applies is larger\. Due to this, the 50 MB limit is approximate\. - -## Amazon S3: Error Code PermanentRedirect\. - -**Error:** *Error occurred while GetObject\. S3 Error Code: PermanentRedirect\. S3 Error Message: The bucket is in this region: us\-east\-2\. Please use this region to retry the request* - -When you upload a function's deployment package from an Amazon S3 bucket, the bucket must be in the same Region as the function\. This issue can occur when you specify an Amazon S3 object in a call to [UpdateFunctionCode](API_UpdateFunctionCode.md), or use the package and deploy commands in the AWS CLI or AWS SAM CLI\. Create a deployment artifact bucket for each Region where you develop applications\. - -## General: Cannot find, cannot load, unable to import, class not found, no such file or directory - -**Error:** *Cannot find module 'function'* - -**Error:** *cannot load such file \-\- function* - -**Error:** *Unable to import module 'function'* - -**Error:** *Class not found: function\.Handler* - -**Error:** *fork/exec /var/task/function: no such file or directory* - -**Error:** *Unable to load type 'Function\.Handler' from assembly 'Function'\.* - -The name of the file or class in your function's handler configuration doesn't match your code\. See the following entry for more information\. - -## General: Undefined method handler - -**Error:** *index\.handler is undefined or not exported* - -**Error:** *Handler 'handler' missing on module 'function'* - -**Error:** *undefined method `handler' for \#* - -**Error:** *No public method named handleRequest with appropriate method signature found on class function\.Handler* - -**Error:** *Unable to find method 'handleRequest' in type 'Function\.Handler' from assembly 'Function'* - -The name of the handler method in your function's handler configuration doesn't match your code\. Each runtime defines a naming convention for handlers, such as *filename*\.*methodname*\. The handler is the method in your function's code that the runtime runs when your function is invoked\. - -For some languages, Lambda provides a library with an interface that expects a handler method to have a specific name\. For details about handler naming for each language, see the following topics\. -+ [Building Lambda functions with Node\.js](lambda-nodejs.md) -+ [Building Lambda functions with Python](lambda-python.md) -+ [Building Lambda functions with Ruby](lambda-ruby.md) -+ [Building Lambda functions with Java](lambda-java.md) -+ [Building Lambda functions with Go](lambda-golang.md) -+ [Building Lambda functions with C\#](lambda-csharp.md) -+ [Building Lambda functions with PowerShell](lambda-powershell.md) - -## Lambda: InvalidParameterValueException or RequestEntityTooLargeException - -**Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided exceeded the 4KB limit\. String measured: \{"A1":"uSFeY5cyPiPn7AtnX5BsM\.\.\.* - -**Error:** *RequestEntityTooLargeException: Request must be smaller than 5120 bytes for the UpdateFunctionConfiguration operation* - -The maximum size of the variables object that is stored in the function's configuration must not exceed 4096 bytes\. This includes key names, values, quotes, commas, and brackets\. The total size of the HTTP request body is also limited\. - -``` -{ - "FunctionName": "my-function", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "Runtime": "nodejs16.x", - "Role": "arn:aws:iam::123456789012:role/lambda-role", - "Environment": { - "Variables": { - "BUCKET": "my-bucket", - "KEY": "file.txt" - } - }, - ... -} -``` - -In this example, the object is 39 characters and takes up 39 bytes when it's stored \(without white space\) as the string `{"BUCKET":"my-bucket","KEY":"file.txt"}`\. Standard ASCII characters in environment variable values use one byte each\. Extended ASCII and Unicode characters can use between 2 bytes and 4 bytes per character\. - -## Lambda: InvalidParameterValueException - -**Error:** *InvalidParameterValueException: Lambda was unable to configure your environment variables because the environment variables you have provided contains reserved keys that are currently not supported for modification\.* - -Lambda reserves some environment variable keys for internal use\. For example, `AWS_REGION` is used by the runtime to determine the current Region and cannot be overridden\. Other variables, like `PATH`, are used by the runtime but can be extended in your function configuration\. For a full list, see [Defined runtime environment variables](configuration-envvars.md#configuration-envvars-runtime)\. - -## Lambda: Concurrency and memory quotas - -**Error:*** Specified ConcurrentExecutions for function decreases account's UnreservedConcurrentExecution below its minimum value* - -**Error:*** 'MemorySize' value failed to satisfy constraint: Member must have value less than or equal to 3008* - -These errors occur when you exceed the concurrency or memory [quotas](gettingstarted-limits.md) for your account\. New AWS accounts have reduced concurrency and memory quotas\. AWS raises these quotas automatically based on your usage\. To resolve these errors, you can [request a quota increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)\. -+ **Concurrency:** You might get an error if you try to create a function using reserved or provisioned concurrency, or if your per\-function concurrency request \([PutFunctionConcurrency](API_PutFunctionConcurrency.md)\) exceeds your account's concurrency quota\. -+ **Memory:** Errors occur if the amount of memory allocated to the function exceeds your account's memory quota\. \ No newline at end of file diff --git a/doc_source/troubleshooting-execution.md b/doc_source/troubleshooting-execution.md deleted file mode 100644 index 95910dcb..00000000 --- a/doc_source/troubleshooting-execution.md +++ /dev/null @@ -1,89 +0,0 @@ -# Troubleshoot execution issues in Lambda - -When the Lambda runtime runs your function code, the event might be processed on an instance of the function that's been processing events for some time, or it might require a new instance to be initialized\. Errors can occur during function initialization, when your handler code processes the event, or when your function returns \(or fails to return\) a response\. - -Function execution errors can be caused by issues with your code, function configuration, downstream resources, or permissions\. If you invoke your function directly, you see function errors in the response from Lambda\. If you invoke your function asynchronously, with an event source mapping, or through another service, you might find errors in logs, a dead\-letter queue, or an on\-failure destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. - -When your function code or the Lambda runtime return an error, the status code in the response from Lambda is 200 OK\. The presence of an error in the response is indicated by a header named `X-Amz-Function-Error`\. 400 and 500\-series status codes are reserved for [invocation errors](troubleshooting-invocation.md)\. - -## Lambda: Execution takes too long - -**Issue:** *Function execution takes too long\.* - -If your code takes much longer to run in Lambda than on your local machine, it may be constrained by the memory or processing power available to the function\. [Configure the function with additional memory](configuration-function-common.md) to increase both memory and CPU\. - -## Lambda: Logs or traces don't appear - -**Issue:** *Logs don't appear in CloudWatch Logs\.* - -**Issue:** *Traces don't appear in AWS X\-Ray\.* - -Your function needs permission to call CloudWatch Logs and X\-Ray\. Update its [execution role](lambda-intro-execution-role.md) to grant it permission\. Add the following managed policies to enable logs and tracing\. -+ **AWSLambdaBasicExecutionRole** -+ **AWSXRayDaemonWriteAccess** - -When you add permissions to your function, update its code or configuration as well\. This forces running instances of your function, which have outdated credentials, to stop and be replaced\. - -**Note** -It may take 5 to 10 minutes for logs to show up after a function invocation\. - -## Lambda: The function returns before execution finishes - -**Issue: \(Node\.js\)** *Function returns before code finishes executing* - -Many libraries, including the AWS SDK, operate asynchronously\. When you make a network call or perform another operation that requires waiting for a response, libraries return an object called a promise that tracks the progress of the operation in the background\. - -To wait for the promise to resolve into a response, use the `await` keyword\. This blocks your handler code from executing until the promise is resolved into an object that contains the response\. If you don't need to use the data from the response in your code, you can return the promise directly to the runtime\. - -Some libraries don't return promises but can be wrapped in code that does\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. - -## AWS SDK: Versions and updates - -**Issue:** *The AWS SDK included on the runtime is not the latest version* - -**Issue:** *The AWS SDK included on the runtime updates automatically* - -Runtimes for scripting languages include the AWS SDK and are periodically updated to the latest version\. The current version for each runtime is listed on [runtimes page](lambda-runtimes.md)\. To use a newer version of the AWS SDK, or to lock your functions to a specific version, you can bundle the library with your function code, or [create a Lambda layer](configuration-layers.md)\. For details on creating a deployment package with dependencies, see the following topics: - ------- -#### [ Node\.js ] - -[Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md) - ------- -#### [ Python ] - - [Deploy Python Lambda functions with \.zip file archives](python-package.md) - ------- -#### [ Ruby ] - - [Deploy Ruby Lambda functions with \.zip file archives](ruby-package.md) - ------- -#### [ Java ] - - [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md) - ------- -#### [ Go ] - - [Deploy Go Lambda functions with \.zip file archives](golang-package.md) - ------- -#### [ C\# ] - - [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md) - ------- -#### [ PowerShell ] - - [Deploy PowerShell Lambda functions with \.zip file archives](powershell-package.md) - ------- - -## Python: Libraries load incorrectly - -**Issue:** \(Python\) *Some libraries don't load correctly from the deployment package* - -Libraries with extension modules written in C or C\+\+ must be compiled in an environment with the same processor architecture as Lambda \(Amazon Linux\)\. For more information, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-images.md b/doc_source/troubleshooting-images.md deleted file mode 100644 index 6aa11bd3..00000000 --- a/doc_source/troubleshooting-images.md +++ /dev/null @@ -1,55 +0,0 @@ -# Troubleshoot container image issues in Lambda - -## Container: CodeArtifactUserException errors related to the code artifact\. - -**Issue:** *CodeArtifactUserPendingException error message* - -The CodeArtifact is pending optimization\. The function transitions to active state when Lambda completes the optimization\. HTTP response code 409\. - -**Issue:** *CodeArtifactUserDeletedException error message* - -The CodeArtifact is scheduled to be deleted\. HTTP response code 409\. - -**Issue:** *CodeArtifactUserFailedException error message* - -Lambda failed to optimize the code\. You need to correct the code and upload it again\. HTTP response code 409\. - -## Container: ManifestKeyCustomerException errors related to the code manifest key\. - -**Issue:** *KMSAccessDeniedException error message* - -You do not have permissions to access the key to decrypt the manifest\. HTTP response code 502\. - -**Issue:** *TooManyRequestsException error message* - -The client is being throttled\. The current request rate exceeds the KMS subscription rate\. HTTP response code 429\. - -**Issue:** *KMSNotFoundException error message* - -Lambda cannot find the key to decrypt the manifest\. HTTP response code 502\. - -**Issue:** *KMSDisabledException error message* - -The key to decrypt the manifest is disabled\. HTTP response code 502\. - -**Issue:** *KMSInvalidStateException error message* - -The key is in a state \(such as pending deletion or unavailable\) such that Lambda cannot use the key to decrypt the manifest\. HTTP response code 502\. - -## Container: Error occurs on runtime InvalidEntrypoint - -**Issue:** *You receive a Runtime\.ExitError error message, or an error message with `"errorType": "Runtime.InvalidEntrypoint"`\.* - -Verify that the ENTRYPOINT to your container image includes the absolute path as the location\. Also verify that the image does not contain a symlink as the ENTRYPOINT\. - -## Lambda: System provisioning additional capacity - -**Error:** *“Error: We currently do not have sufficient capacity in the region you requested\. Our system will be working on provisioning additional capacity\.* - -Retry the function invocation\. If the retry fails, validate that the files required to run the function code can be read by any user\. Lambda defines a default Linux user with least\-privileged permissions\. You need to verify that your application code does not rely on files that are restricted by other Linux users for execution\. - -## CloudFormation: ENTRYPOINT is being overridden with a null or empty value - -**Error:** *You are using an AWS CloudFormation template, and your container ENTRYPOINT is being overridden with a null or empty value\.* - -Review the `ImageConfig` resource in the AWS CloudFormation template\. If you declare an `ImageConfig` resource in your template, you must provide non\-empty values for all three of the properties\. \ No newline at end of file diff --git a/doc_source/troubleshooting-invocation.md b/doc_source/troubleshooting-invocation.md deleted file mode 100644 index 94a8dc72..00000000 --- a/doc_source/troubleshooting-invocation.md +++ /dev/null @@ -1,116 +0,0 @@ -# Troubleshoot invocation issues in Lambda - -When you invoke a Lambda function, Lambda validates the request and checks for scaling capacity before sending the event to your function or, for asynchronous invocation, to the event queue\. Invocation errors can be caused by issues with request parameters, event structure, function settings, user permissions, resource permissions, or limits\. - -If you invoke your function directly, you see any invocation errors in the response from Lambda\. If you invoke your function asynchronously with an event source mapping or through another service, you might find errors in logs, a dead\-letter queue, or a failed\-event destination\. Error handling options and retry behavior vary depending on how you invoke your function and on the type of error\. - -For a list of error types that the `Invoke` operation can return, see [Invoke](API_Invoke.md)\. - -## IAM: lambda:InvokeFunction not authorized - -**Error:** *User: arn:aws:iam::123456789012:user/developer is not authorized to perform: lambda:InvokeFunction on resource: my\-function* - -Your AWS Identity and Access Management \(IAM\) user, or the role that you assume, must have permission to invoke a function\. This requirement also applies to Lambda functions and other compute resources that invoke functions\. Add the AWS managed policy **AWSLambdaRole** to your IAM user, or add a custom policy that allows the `lambda:InvokeFunction` action on the target function\. - -**Note** -Unlike other Lambda API operations, the name of the IAM action \(`lambda:InvokeFunction`\) doesn't match the name of the API operation \(`Invoke`\) for invoking a function\. - -For more information, see [Lambda permissions](lambda-permissions.md)\. - -## Lambda: Operation cannot be performed ResourceConflictException - -**Error:** *ResourceConflictException: The operation cannot be performed at this time\. The function is currently in the following state: Pending* - -When you connect a function to a virtual private cloud \(VPC\) at the time of creation, the function enters a `Pending` state while Lambda creates elastic network interfaces\. During this time, you can't invoke or modify your function\. If you connect your function to a VPC after creation, you can invoke it while the update is pending, but you can't modify its code or configuration\. - -For more information, see [Lambda function states](functions-states.md)\. - -## Lambda: Function is stuck in Pending - -**Error:** *A function is stuck in the `Pending` state for several minutes\.* - -If a function is stuck in the `Pending` state for more than six minutes, call one of the following API operations to unblock it: -+ [UpdateFunctionCode](API_UpdateFunctionCode.md) -+ [UpdateFunctionConfiguration](API_UpdateFunctionConfiguration.md) -+ [PublishVersion](API_PublishVersion.md) - -Lambda cancels the pending operation and puts the function into the `Failed` state\. You can then delete the function and recreate it, or attempt another update\. - -## Lambda: One function is using all concurrency - -**Issue:** *One function is using all of the available concurrency, causing other functions to be throttled\.* - -To divide your AWS account's available concurrency in an AWS Region into pools, use [reserved concurrency](configuration-concurrency.md)\. Reserved concurrency ensures that a function can always scale to its assigned concurrency, and that it doesn't scale beyond its assigned concurrency\. - -## General: Cannot invoke function with other accounts or services - -**Issue:** *You can invoke your function directly, but it doesn't run when another service or account invokes it\.* - -You grant [other services](lambda-services.md) and accounts permission to invoke a function in the function's [resource\-based policy](access-control-resource-based.md)\. If the invoker is in another account, that user must also have [permission to invoke functions](access-control-identity-based.md)\. - -## General: Function invocation is looping - -**Issue:** *Function is invoked continuously in a loop\.* - -This typically occurs when your function manages resources in the same AWS service that triggers it\. For example, it's possible to create a function that stores an object in an Amazon Simple Storage Service \(Amazon S3\) bucket that's configured with a [notification that invokes the function again](with-s3.md)\. To stop the function from running, on the [function configuration page](configuration-function-common.md), choose **Throttle**\. Then, identify the code path or configuration error that caused the recursive invocation\. - -## Lambda: Alias routing with provisioned concurrency - -**Issue:** *Provisioned concurrency spillover invocations during alias routing\.* - -Lambda uses a simple probabilistic model to distribute the traffic between the two function versions\. At low traffic levels, you might see a high variance between the configured and actual percentage of traffic on each version\. If your function uses provisioned concurrency, you can avoid [spillover invocations](monitoring-metrics.md#monitoring-metrics-invocation) by configuring a higher number of provisioned concurrency instances during the time that alias routing is active\. - -## Lambda: Cold starts with provisioned concurrency - -**Issue:** *You see cold starts after enabling provisioned concurrency\.* - -When the number of concurrent executions on a function is less than or equal to the [configured level of provisioned concurrency](provisioned-concurrency.md), there shouldn't be any cold starts\. To help you confirm if provisioned concurrency is operating normally, do the following: -+ [Check that provisioned concurrency is enabled](provisioned-concurrency.md) on the function version or alias\. -**Note** -Provisioned concurrency is not configurable on the [$LATEST version](gettingstarted-images.md#configuration-images-latest)\. -+ Ensure that your triggers invoke the correct function version or alias\. For example, if you're using Amazon API Gateway, check that API Gateway invokes the function version or alias with provisioned concurrency, not $LATEST\. To confirm that provisioned concurrency is being used, you can check the [ProvisionedConcurrencyInvocations Amazon CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that the function is processing invocations on initialized execution environments\. -+ Determine whether your function concurrency exceeds the configured level of provisioned concurrency by checking the [ProvisionedConcurrencySpilloverInvocations CloudWatch metric](monitoring-metrics.md#monitoring-metrics-invocation)\. A non\-zero value indicates that all provisioned concurrency is in use and some invocation occurred with a cold start\. -+ Check your [invocation frequency](gettingstarted-limits.md) \(requests per second\)\. Functions with provisioned concurrency have a maximum rate of 10 requests per second per provisioned concurrency\. For example, a function configured with 100 provisioned concurrency can handle 1,000 requests per second\. If the invocation rate exceeds 1,000 requests per second, some cold starts can occur\. - -**Note** -There is a known issue in which the first invocation on an initialized execution environment reports a non\-zero **Init Duration** metric in CloudWatch Logs, even though no cold start has occurred\. We're developing a fix to correct the reporting to CloudWatch Logs\. - -## Lambda: Latency variability with provisioned concurrency - -**Issue:** *You see latency variability on the first invocation after enabling provisioned concurrency\.* - -Depending on your function's runtime and memory configuration, it's possible to see some latency variability on the first invocation on an initialized execution environment\. For example, \.NET and other JIT runtimes can lazily load resources on the first invocation, leading to some latency variability \(typically tens of milliseconds\)\. This variability is more apparent on 128\-MiB functions\. You mitigate this by increasing the function's configured memory\. - -## Lambda: Cold starts with new versions - -**Issue:** *You see cold starts while deploying new versions of your function\.* - -When you update a function alias, Lambda automatically shifts provisioned concurrency to the new version based on the weights configured on the alias\. - -**Error:** *KMSDisabledException: Lambda was unable to decrypt the environment variables because the KMS key used is disabled\. Please check the function's KMS key settings\.* - -This error can occur if your AWS Key Management Service \(AWS KMS\) key is disabled, or if the grant that allows Lambda to use the key is revoked\. If the grant is missing, configure the function to use a different key\. Then, reassign the custom key to recreate the grant\. - -## EFS: Function could not mount the EFS file system - -**Error:** *EFSMountFailureException: The function could not mount the EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\.* - -The mount request to the function's [file system](configuration-filesystem.md) was rejected\. Check the function's permissions, and confirm that its file system and access point exist and are ready for use\. - -## EFS: Function could not connect to the EFS file system - -**Error:** *EFSMountConnectivityException: The function couldn't connect to the Amazon EFS file system with access point arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\. Check your network configuration and try again\.* - -The function couldn't establish a connection to the function's [file system](configuration-filesystem.md) with the NFS protocol \(TCP port 2049\)\. Check the [security group and routing configuration](https://docs.aws.amazon.com/efs/latest/ug/network-access.html) for the VPC's subnets\. - -## EFS: Function could not mount the EFS file system due to timeout - -**Error:** *EFSMountTimeoutException: The function could not mount the EFS file system with access point \{arn:aws:elasticfilesystem:us\-east\-2:123456789012:access\-point/fsap\-015cxmplb72b405fd\} due to mount time out\.* - -The function could connect to the function's [file system](configuration-filesystem.md), but the mount operation timed out\. Try again after a short time and consider limiting the function's [concurrency](configuration-concurrency.md) to reduce load on the file system\. - -## Lambda: Lambda detected an IO process that was taking too long - -*EFSIOException: This function instance was stopped because Lambda detected an IO process that was taking too long\.* - -A previous invocation timed out and Lambda couldn't terminate the function handler\. This issue can occur when an attached file system runs out of burst credits and the baseline throughput is insufficient\. To increase throughput, you can increase the size of the file system or use provisioned throughput\. For more information, see [Throughput](services-efs.md#services-efs-throughput)\. \ No newline at end of file diff --git a/doc_source/troubleshooting-networking.md b/doc_source/troubleshooting-networking.md deleted file mode 100644 index 8ae59be7..00000000 --- a/doc_source/troubleshooting-networking.md +++ /dev/null @@ -1,31 +0,0 @@ -# Troubleshoot networking issues in Lambda - -By default, Lambda runs your functions in an internal virtual private cloud \(VPC\) with connectivity to AWS services and the internet\. To access local network resources, you can [configure your function to connect to a VPC in your account](configuration-vpc.md)\. When you use this feature, you manage the function's internet access and network connectivity with Amazon Virtual Private Cloud \(Amazon VPC\) resources\. - -Network connectivity errors can result from issues with your VPC's routing configuration, security group rules, AWS Identity and Access Management \(IAM\) role permissions, or network address translation \(NAT\), or from the availability of resources such as IP addresses or network interfaces\. Depending on the issue, you might see a specific error or timeout if a request can't reach its destination\. - -## VPC: Function loses internet access or times out - -**Issue:** *Your Lambda function loses internet access after connecting to a VPC\.* - -**Error:** *Error: connect ETIMEDOUT 176\.32\.98\.189:443* - -**Error:** *Error: Task timed out after 10\.00 seconds* - -**Error:** *ReadTimeoutError: Read timed out\. \(read timeout=15\)* - -When you connect a function to a VPC, all outbound requests go through the VPC\. To connect to the internet, configure your VPC to send outbound traffic from the function's subnet to a NAT gateway in a public subnet\. For more information and sample VPC configurations, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -If some of your TCP connections are timing out, this may be due to packet fragmentation\. Lambda functions cannot handle incoming fragmented TCP requests, since Lambda does not support IP fragmentation for TCP or ICMP\. - -## VPC: Function needs access to AWS services without using the internet - -**Issue:** *Your Lambda function needs access to AWS services without using the internet\.* - -To connect a function to AWS services from a private subnet with no internet access, use VPC endpoints\. For a sample AWS CloudFormation template with VPC endpoints for Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB \(DynamoDB\), see [Sample VPC configurations](configuration-vpc.md#vpc-samples)\. - -## VPC: Elastic network interface limit reached - -**Error:** *ENILimitReachedException: The elastic network interface limit was reached for the function's VPC\.* - -When you connect a Lambda function to a VPC, Lambda creates an elastic network interface for each combination of subnet and security group attached to the function\. The default service quota is 250 network interfaces per VPC\. To request a quota increase, use the [Service Quotas console](https://console.aws.amazon.com/servicequotas/home/services/lambda/quotas/L-9FEE3D26)\. \ No newline at end of file diff --git a/doc_source/typescript-exceptions.md b/doc_source/typescript-exceptions.md deleted file mode 100644 index 4ec551de..00000000 --- a/doc_source/typescript-exceptions.md +++ /dev/null @@ -1,90 +0,0 @@ -# AWS Lambda function errors in TypeScript - -If an exception occurs in TypeScript code that's transpiled into JavaScript, use source map files to determine where the error occurred\. Source map files allow debuggers to map compiled JavaScript files to the TypeScript source code\. - -For example, the following code results in an error: - -``` -export const handler = async (event: unknown): Promise => { - throw new Error('Some exception'); -}; -``` - -AWS Lambda catches the error and generates a JSON document\. However, this JSON document refers to the compiled JavaScript file \(**app\.js**\), not the TypeScript source file\. - -``` -{ - "errorType": "Error", - "errorMessage": "Some exception", - "stack": [ - "Error: Some exception", - " at Runtime.p [as handler] (/var/task/app.js:1:491)", - " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" - ] -} -``` - -**To get an error response that maps to your TypeScript source file** -**Note** -The following steps aren't valid for Lambda@Edge functions because Lambda@Edge doesn't support environment variables\. - -1. Generate a source map file with esbuild or another TypeScript compiler\. Example: - - ``` - esbuild app.ts —sourcemap —outfile=output.js - ``` - -1. Add the source map to your deployment\. - -1. Turn on source maps for the Node\.js runtime by adding `--enable-source-maps` to your `NODE_OPTIONS`\. - -**Example for the AWS Serverless Application Model \(AWS SAM\)** - -``` -Globals: - Function: - Environment: - Variables: - NODE_OPTIONS: '--enable-source-maps' -``` -Make sure that the esbuild properties in your **template\.yaml** file include `Sourcemap: true`\. Example: - -``` -Metadata: # Manage esbuild properties - BuildMethod: esbuild - BuildProperties: - Minify: true - Target: "es2020" - Sourcemap: true - EntryPoints: - - app.ts -``` - -**Example for the AWS Cloud Development Kit \(AWS CDK\)** -To use a source map with an AWS CDK application, add the following code to the file that contains the [NodejsFunction construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html)\. - -``` -const helloFunction = new NodejsFunction(this, 'function',{ - bundling: { - minify: true, - sourceMap: true - }, - environment:{ - NODE_OPTIONS: '--enable-source-maps', - } -}); -``` - -When you use a source map in your code, you get an error response similar to the following\. This response shows that the error happened at line 2, column 11 in the **app\.ts** file\. - -``` -{ - "errorType": "Error", - "errorMessage": "Some exception", - "stack": [ - "Error: Some exception", - " at Runtime.p (/private/var/folders/3c/0d4wz7dn2y75bw_hxdwc0h6w0000gr/T/tmpfmxb4ziy/app.ts:2:11)", - " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" - ] -} -``` \ No newline at end of file diff --git a/doc_source/typescript-handler.md b/doc_source/typescript-handler.md deleted file mode 100644 index b0328acf..00000000 --- a/doc_source/typescript-handler.md +++ /dev/null @@ -1,99 +0,0 @@ -# AWS Lambda function handler in TypeScript - -The AWS Lambda function *handler* is the method in your function code that processes events\. When your function is invoked, Lambda runs the handler method\. When the handler exits or returns a response, it becomes available to handle another event\. - -The Node\.js runtime passes three arguments to the handler method: -+ The `event` object: Contains information from the invoker\. -+ The [context object](nodejs-context.md): Contains information about the invocation, function, and execution environment\. -+ The third argument, `callback`, is a function that you can call in non\-async handlers to send a response\. For async handlers, you return a response, error, or promise to the runtime instead of using `callback`\. - -## Non\-async handlers - -For non\-async handlers, the runtime passes the event object, the [context object](nodejs-context.md), and the callback function to the handler method\. The response object in the callback function must be compatible with `JSON.stringify`\. - -**Example TypeScript function – synchronous** - -``` -import { Context, APIGatewayProxyCallback, APIGatewayEvent } from 'aws-lambda'; - -export const lambdaHandler = (event: APIGatewayEvent, context: Context, callback: APIGatewayProxyCallback): void => { - console.log(`Event: ${JSON.stringify(event, null, 2)}`); - console.log(`Context: ${JSON.stringify(context, null, 2)}`); - callback(null, { - statusCode: 200, - body: JSON.stringify({ - message: 'hello world', - }), - }); -}; -``` - -## Async handlers - -For async handlers, you can use `return` and `throw` to send a response or error, respectively\. Functions must use the `async` keyword to use these methods to return a response or error\. - -If your code performs an asynchronous task, return a promise to make sure that it finishes running\. When you resolve or reject the promise, Lambda sends the response or error to the invoker\. - -**Example TypeScript function – asynchronous** - -``` -import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; - -export const lambdaHandler = async (event: APIGatewayEvent, context: Context): Promise => { - console.log(`Event: ${JSON.stringify(event, null, 2)}`); - console.log(`Context: ${JSON.stringify(context, null, 2)}`); - return { - statusCode: 200, - body: JSON.stringify({ - message: 'hello world', - }), - }; -}; -``` - -## Using types for the event object - -We recommend that you don’t use the [any](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#any) type for the handler arguments and return type because you lose the ability to check types\. Instead, generate an event using the [sam local generate\-event](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-local-generate-event.html) AWS Serverless Application Model CLI command, or use an open\-source definition from the [@types/aws\-lambda package](https://www.npmjs.com/package/@types/aws-lambda)\. - -**Generating an event using the sam local generate\-event command** - -1. Generate an Amazon Simple Storage Service \(Amazon S3\) proxy event\. - - ``` - sam local generate-event s3 put >> S3PutEvent.json - ``` - -1. Use the [quicktype utility](https://quicktype.io/typescript) to generate type definitions from the **S3PutEvent\.json** file\. - - ``` - npm install -g quicktype - quicktype S3PutEvent.json -o S3PutEvent.ts - ``` - -1. Use the generated types in your code\. - - ``` - import { S3PutEvent } from './S3PutEvent'; - - export const lambdaHandler = async (event: S3PutEvent): Promise => { - event.Records.map((record) => console.log(record.s3.object.key)); - }; - ``` - -**Generating an event using an open\-source definition from the @types/aws\-lambda package** - -1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) package as a development dependency\. - - ``` - npm install -D @types/aws-lambda - ``` - -1. Use the types in your code\. - - ``` - import { S3Event } from "aws-lambda"; - - export const lambdaHandler = async (event: S3Event): Promise => { - event.Records.map((record) => console.log(record.s3.object.key)); - }; - ``` \ No newline at end of file diff --git a/doc_source/typescript-image.md b/doc_source/typescript-image.md deleted file mode 100644 index 58f40877..00000000 --- a/doc_source/typescript-image.md +++ /dev/null @@ -1,109 +0,0 @@ -# Deploy transpiled TypeScript code in Lambda with container images - -You can deploy your TypeScript code to an AWS Lambda function as a Node\.js [container image](images-create.md)\. AWS provides [base images](nodejs-image.md#nodejs-image-base) for Node\.js to help you build the container image\. These base images are preloaded with a language runtime and other components that are required to run the image on Lambda\. AWS provides a Dockerfile for each of the base images to help with building your container image\. - -If you use a community or private enterprise base image, you must [add the Node\.js runtime interface client \(RIC\)](nodejs-image.md#nodejs-image-clients) to the base image to make it compatible with Lambda\. For more information, see [Creating images from alternative base images](images-create.md#images-create-from-alt)\. - -Lambda provides a runtime interface emulator \(RIE\) for you to test your function locally\. The base images for Lambda and base images for custom runtimes include the RIE\. For other base images, you can download the RIE for [testing your image locally](images-test.md)\. - -## Using a Node\.js base image to build and package TypeScript function code - -**Prerequisites** - -To complete the steps in this section, you must have the following: -+ [AWS Command Line Interface \(AWS CLI\) version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) -+ Docker - - The following instructions use Docker CLI commands to create the container image\. To install Docker, see [Get Docker](https://docs.docker.com/get-docker) on the Docker website\. -+ Node\.js 14\.x or later - -**To create an image from an AWS base image for Lambda** - -1. On your local machine, create a project directory for your new function\. - -1. Create a new Node\.js project with `npm` or a package manager of your choice\. - - ``` - npm init - ``` - -1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) and [esbuild](https://esbuild.github.io/) packages as development dependencies\. - - ``` - npm install -D @types/aws-lambda esbuild - ``` - -1. Add a [build script](https://esbuild.github.io/getting-started/#build-scripts) to the **package\.json** file\. - - ``` - "scripts": { - "build": "esbuild index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js" - } - ``` - -1. Create a new file called **index\.ts**\. Add the following sample code to the new file\. This is the code for the Lambda function\. The function returns a `hello world` message\. - - ``` - import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; - - export const handler = async (event: APIGatewayEvent, context: Context): Promise => { - console.log(`Event: ${JSON.stringify(event, null, 2)}`); - console.log(`Context: ${JSON.stringify(context, null, 2)}`); - return { - statusCode: 200, - body: JSON.stringify({ - message: 'hello world', - }), - }; - }; - ``` - -1. Create a new Dockerfile with the following configuration: - + Set the `FROM` property to the URI of the base image\. - + Set the `CMD` argument to specify the Lambda function handler\. -**Example Dockerfile** - - The following Dockerfile uses a multi\-stage build\. The first step transpiles the TypeScript code into JavaScript\. The second step produces a container image that contains only JavaScript files and production dependencies\. - - ``` - FROM public.ecr.aws/lambda/nodejs:16 as builder - WORKDIR /usr/app - COPY package.json index.ts ./ - RUN npm install - RUN npm run build - - - FROM public.ecr.aws/lambda/nodejs:16 - WORKDIR ${LAMBDA_TASK_ROOT} - COPY --from=builder /usr/app/dist/* ./ - CMD ["index.handler"] - ``` - -1. Build your image\. - - ``` - docker build -t hello-world . - ``` - -1. Authenticate the Docker CLI to your Amazon Elastic Container Registry \(Amazon ECR\) registry\. - - ``` - aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com - ``` - -1. Create a repository in Amazon ECR using the `create-repository` command\. - - ``` - aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE - ``` - -1. Tag your image to match your repository name, and deploy the image to Amazon ECR using the `docker push` command\. - - ``` - docker tag hello-world:latest 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest - ``` - -1. [Create and test](gettingstarted-images.md#configuration-images-create) the Lambda function\. - -To update the function code, you must create a new image version and store the image in the Amazon ECR repository\. For more information, see [Updating function code](gettingstarted-images.md#configuration-images-update)\. \ No newline at end of file diff --git a/doc_source/typescript-package.md b/doc_source/typescript-package.md deleted file mode 100644 index 52dd0f53..00000000 --- a/doc_source/typescript-package.md +++ /dev/null @@ -1,249 +0,0 @@ -# Deploy transpiled TypeScript code in Lambda with \.zip file archives - -Before you can deploy TypeScript code to AWS Lambda, you need to transpile it into JavaScript\. This page explains three ways to build and deploy TypeScript code to Lambda: -+ [Using the AWS Serverless Application Model \(AWS SAM\)](#aws-sam-ts) -+ [Using the AWS Cloud Development Kit \(AWS CDK\)](#aws-cdk-ts) -+ [Using the AWS Command Line Interface \(AWS CLI\) and esbuild](#aws-cli-ts) - -The AWS SAM and AWS CDK simplify building and deploying TypeScript functions\. The [AWS SAM template specification](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification.html) provides a simple and clean syntax to describe the Lambda functions, APIs, permissions, configurations, and events that make up your serverless application\. The [AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/home.html) lets you build reliable, scalable, cost\-effective applications in the cloud with the considerable expressive power of a programming language\. The AWS CDK is intended for moderately to highly experienced AWS users\. Both the AWS CDK and the AWS SAM use esbuild to transpile TypeScript code into JavaScript\. - -## Using the AWS SAM to deploy TypeScript code to Lambda - -Follow the steps below to download, build, and deploy a sample Hello World TypeScript application using the AWS SAM\. This application implements a basic API backend\. It consists of an Amazon API Gateway endpoint and a Lambda function\. When you send a GET request to the API Gateway endpoint, the Lambda function is invoked\. The function returns a `hello world` message\. - -**Note** -The AWS SAM uses esbuild to create Node\.js Lambda functions from TypeScript code\. esbuild support is currently in public preview\. During public preview, esbuild support may be subject to backwards incompatible changes\. - -**Prerequisites** - -To complete the steps in this section, you must have the following: -+ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) -+ [AWS SAM CLI version 1\.39 or later](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) -+ Node\.js 14\.x or later - -**Deploy a sample AWS SAM application** - -1. Initialize the application using the Hello World TypeScript template\. - - ``` - sam init --app-template hello-world-typescript --name sam-app --package-type Zip --runtime nodejs16.x - ``` - -1. \(Optional\) The sample application includes configurations for commonly used tools, such as [ESLlint](https://eslint.org/) for code linting and [Jest](https://jestjs.io/) for unit testing\. To run lint and test commands: - - ``` - cd sam-app/hello-world - npm install - npm run lint - npm run test - ``` - -1. Build the app\. The `--beta-features` option is required because esbuild support is in public preview\. - - ``` - cd sam-app - sam build --beta-features - ``` - -1. Deploy the app\. - - ``` - sam deploy --guided - ``` - -1. Follow the on\-screen prompts\. To accept the default options provided in the interactive experience, respond with `Enter`\. - -1. The output shows the endpoint for the REST API\. Open the endpoint in a browser to test the function\. You should see this response: - - ``` - {"message":"hello world"} - ``` - -1. This is a public API endpoint that is accessible over the internet\. We recommend that you delete the endpoint after testing\. - - ``` - sam delete - ``` - -## Using the AWS CDK to deploy TypeScript code to Lambda - -Follow the steps below to build and deploy a sample TypeScript application using the AWS CDK\. This application implements a basic API backend\. It consists of an API Gateway endpoint and a Lambda function\. When you send a GET request to the API Gateway endpoint, the Lambda function is invoked\. The function returns a `hello world` message\. - -**Prerequisites** - -To complete the steps in this section, you must have the following: -+ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) -+ [AWS CDK version 2](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites) -+ Node\.js 14\.x or later - -**Deploy a sample AWS CDK application** - -1. Create a project directory for your new application\. - - ``` - mkdir hello-world - cd hello-world - ``` - -1. Initialize the app\. - - ``` - cdk init app --language typescript - ``` - -1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) package as a development dependency\. - - ``` - npm install -D @types/aws-lambda - ``` - -1. Open the **lib** directory\. You should see a file called **hello\-world\-stack\.ts**\. Create two new files in this directory: **hello\-world\.function\.ts** and **hello\-world\.ts**\. - -1. Open **hello\-world\.function\.ts** and add the following code to the file\. This is the code for the Lambda function\. - - ``` - import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; - - export const handler = async (event: APIGatewayEvent, context: Context): Promise => { - console.log(`Event: ${JSON.stringify(event, null, 2)}`); - console.log(`Context: ${JSON.stringify(context, null, 2)}`); - return { - statusCode: 200, - body: JSON.stringify({ - message: 'hello world', - }), - }; - }; - ``` - -1. Open **hello\-world\.ts** and add the following code to the file\. This contains the [NodejsFunction construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html), which creates the Lambda function, and the [LambdaRestApi construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.LambdaRestApi.html), which creates the REST API\. - - ``` - import { Construct } from 'constructs'; - import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs'; - import { LambdaRestApi } from 'aws-cdk-lib/aws-apigateway'; - - export class HelloWorld extends Construct { - constructor(scope: Construct, id: string) { - super(scope, id); - const helloFunction = new NodejsFunction(this, 'function'); - new LambdaRestApi(this, 'apigw', { - handler: helloFunction, - }); - } - } - ``` - - The `NodejsFunction` construct assumes the following by default: - + Your function handler is called `handler`\. - + The \.ts file that contains the function code \(**hello\-world\.function\.ts**\) is in the same directory as the \.ts file that contains the construct \(**hello\-world\.ts**\)\. The construct uses the construct's ID \("hello\-world"\) and the name of the Lambda handler file \("function"\) to find the function code\. For example, if your function code is in a file called **hello\-world\.my\-function\.ts**, the **hello\-world\.ts** file must reference the function code like this: - - ``` - const helloFunction = new NodejsFunction(this, 'my-function'); - ``` - - You can change this behavior and configure other esbuild parameters\. For more information, see [Configuring esbuild](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html#configuring-esbuild) in the AWS CDK API reference\. - -1. Open **hello\-world\-stack\.ts**\. This is the code that defines your [AWS CDK stack](https://docs.aws.amazon.com/cdk/v2/guide/stacks.html)\. Replace the code with the following: - - ``` - import { Stack, StackProps } from 'aws-cdk-lib'; - import { Construct } from 'constructs'; - import { HelloWorld } from './hello-world'; - - export class HelloWorldStack extends Stack { - constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - new HelloWorld(this, 'hello-world'); - } - } - ``` - -1. Deploy your application\. - - ``` - cdk deploy - ``` - -1. The AWS CDK builds and packages the Lambda function using esbuild, and then deploys the function to the Lambda runtime\. The output shows the endpoint for the REST API\. Open the endpoint in a browser to test the function\. You should see this response: - - ``` - {"message":"hello world"} - ``` - - This is a public API endpoint that is accessible over the internet\. We recommend that you delete the endpoint after testing\. - -## Using the AWS CLI and esbuild to deploy TypeScript code to Lambda - -The following example demonstrates how to transpile and deploy TypeScript code to Lambda using esbuild and the AWS CLI\. esbuild produces one JavaScript file with all dependencies\. This is the only file that you need to add to the \.zip archive\. - -**Prerequisites** - -To complete the steps in this section, you must have the following: -+ [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) -+ Node\.js 14\.x or later -+ An [execution role](lambda-intro-execution-role.md) for the Lambda function - -**Deploy a sample function** - -1. On your local machine, create a project directory for your new function\. - -1. Create a new Node\.js project with npm or a package manager of your choice\. - - ``` - npm init - ``` - -1. Add the [@types/aws\-lambda](https://www.npmjs.com/package/@types/aws-lambda) and [esbuild](https://esbuild.github.io/) packages as development dependencies\. - - ``` - npm install -D @types/aws-lambda esbuild - ``` - -1. Create a new file called **index\.ts**\. Add the following code to the new file\. This is the code for the Lambda function\. The function returns a `hello world` message\. The function doesn’t create any API Gateway resources\. - - ``` - import { Context, APIGatewayProxyResult, APIGatewayEvent } from 'aws-lambda'; - - export const handler = async (event: APIGatewayEvent, context: Context): Promise => { - console.log(`Event: ${JSON.stringify(event, null, 2)}`); - console.log(`Context: ${JSON.stringify(context, null, 2)}`); - return { - statusCode: 200, - body: JSON.stringify({ - message: 'hello world', - }), - }; - }; - ``` - -1. Add a build script to the **package\.json** file\. This configures esbuild to automatically create the \.zip deployment package\. For more information, see [Build scripts](https://esbuild.github.io/getting-started/#build-scripts) in the esbuild documentation\. - - ``` - "scripts": { - "prebuild": "rm -rf dist", - "build": "esbuild index.ts --bundle --minify --sourcemap --platform=node --target=es2020 --outfile=dist/index.js", - "postbuild": "cd dist && zip -r index.zip index.js*" - }, - ``` - -1. Build the package\. - - ``` - npm run build - ``` - -1. Create a Lambda function using the \.zip deployment package\. Replace the highlighted text with the Amazon Resource Name \(ARN\) of your [execution role](lambda-intro-execution-role.md)\. - - ``` - aws lambda create-function --function-name hello-world --runtime "nodejs16.x" --role arn:aws:iam::123456789012:role/lambda-ex --zip-file "fileb://dist/index.zip" --handler index.handler - ``` - -1. [Run a test event](testing-functions.md) to confirm that the function returns the following response\. If you want to invoke this function using API Gateway, [create and configure a REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-create-api.html)\. - - ``` - { - "statusCode": 200, - "body": "{\"message\":\"hello world\"}" - } - ``` diff --git a/doc_source/urls-auth.md b/doc_source/urls-auth.md deleted file mode 100644 index c2b1e4f1..00000000 --- a/doc_source/urls-auth.md +++ /dev/null @@ -1,238 +0,0 @@ -# Security and auth model for Lambda function URLs - -You can control access to your Lambda function URLs using the `AuthType` parameter combined with [resource\-based policies](access-control-resource-based.md) attached to your specific function\. The configuration of these two components determines who can invoke or perform other administrative actions on your function URL\. - -The `AuthType` parameter determines how Lambda authenticates or authorizes requests to your function URL\. When you configure your function URL, you must specify one of the following `AuthType` options: -+ `AWS_IAM` – Lambda uses AWS Identity and Access Management \(IAM\) to authenticate and authorize requests based on the IAM principal's identity policy and the function's resource\-based policy\. Choose this option if you want only authenticated IAM users and roles to invoke your function via the function URL\. -+ `NONE` – Lambda doesn't perform any authentication before invoking your function\. However, your function's resource\-based policy is always in effect and must grant public access before your function URL can receive requests\. Choose this option to allow public, unauthenticated access to your function URL\. - -In addition to `AuthType`, you can also use resource\-based policies to grant permissions to other AWS accounts to invoke your function\. For more information, see [Using resource\-based policies for Lambda](access-control-resource-based.md)\. - -For additional insights into security, you can use AWS Identity and Access Management Access Analyzer to get a comprehensive analysis of external access to your function URL\. IAM Access Analyzer also monitors for new or updated permissions on your Lambda functions to help you identify permissions that grant public and cross\-account access\. IAM Access Analyzer is free to use for any AWS customer\. To get started with IAM Access Analyzer, see [Using AWS IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html)\. - -This page contains examples of resource\-based policies for both auth types, and also how to create these policies using the [AddPermission](API_AddPermission.md) API operation or the Lambda console\. For information on how to invoke your function URL after you've set up permissions, see [Invoking Lambda function URLs](urls-invocation.md)\. - -**Topics** -+ [Using the `AWS_IAM` auth type](#urls-auth-iam) -+ [Using the `NONE` auth type](#urls-auth-none) -+ [Governance and access control](#urls-governance) - -## Using the `AWS_IAM` auth type - -If you choose the `AWS_IAM` auth type, users who need to invoke your Lambda function URL must have the `lambda:InvokeFunctionUrl` permission\. Depending on who makes the invocation request, you may have to grant this permission using a resource\-based policy\. - -If the principal making the request is in the same AWS account as the function URL, then the principal must **either** have `lambda:InvokeFunctionUrl` permissions in their [identity\-based policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html), **or** have permissions granted to them in the function's resource\-based policy\. In other words, a resource\-based policy is optional if the user already has `lambda:InvokeFunctionUrl` permissions in their identity\-based policy\. Policy evaluation follows the rules outlined in [Determining whether a request is allowed or denied within an account](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)\. - -If the principal making the request is in a different account, then the principal must have **both** an identity\-based policy that gives them `lambda:InvokeFunctionUrl` permissions **and** permissions granted to them in a resource\-based policy on the function that they are trying to invoke\. In these cross\-account cases, policy evaluation follows the rules outlined in [Determining whether a cross\-account request is allowed](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic-cross-account.html#policy-eval-cross-account)\. - -For an example cross\-account interaction, the following resource\-based policy allows the `example` role in AWS account `444455556666` to invoke the function URL associated with function `my-function`: - -**Example function URL cross\-account invoke policy** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::444455556666:role/example" - }, - "Action": "lambda:InvokeFunctionUrl", - "Resource": "arn:aws:lambda:us-east-1:123456789012:function:my-function", - "Condition": { - "StringEquals": { - "lambda:FunctionUrlAuthType": "AWS_IAM" - } - } - } - ] -} -``` - -You can create this policy statement through the console by following these steps: - -**To grant URL invocation permissions to another account \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function that you want to grant URL invocation permissions for\. - -1. Choose the **Configuration** tab, and then choose **Permissions**\. - -1. Under **Resource\-based policy**, choose **Add permissions**\. - -1. Choose **Function URL**\. - -1. For **Auth type**, choose **AWS\_IAM**\. - -1. \(Optional\) For **Statement ID**, enter a statement ID for your policy statement\. - -1. For **Principal**, enter the Amazon Resource Name \(ARN\) of the IAM user or role that you want to grant permissions to\. For example: **arn:aws:iam::444455556666:role/example**\. - -1. Choose **Save**\. - -Alternatively, you can create this policy statement using the following [add\-permission](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/add-permission.html) AWS Command Line Interface \(AWS CLI\) command: - -``` -aws lambda add-permission --function-name my-function \ ---statement-id example0-cross-account-statement \ ---action lambda:InvokeFunctionUrl \ ---principal arn:aws:iam::444455556666:role/example \ ---function-url-auth-type AWS_IAM -``` - -In the previous example, the `lambda:FunctionUrlAuthType` condition key value is `AWS_IAM`\. This policy only allows access when your function URL's auth type is also `AWS_IAM`\. - -## Using the `NONE` auth type - -**Important** -When your function URL auth type is `NONE` and you have a resource\-based policy that grants public access, any unauthenticated user with your function URL can invoke your function\. - -In some cases, you may want your function URL to be public\. For example, you might want to serve requests made directly from a web browser\. To allow public access to your function URL, choose the `NONE` auth type\. - -If you choose the `NONE` auth type, Lambda doesn't use IAM to authenticate requests to your function URL\. However, users must still have `lambda:InvokeFunctionUrl` permissions in order to successfully invoke your function URL\. You can grant `lambda:InvokeFunctionUrl` permissions using the following resource\-based policy: - -**Example function URL invoke policy for all unauthenticated principals** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": "*", - "Action": "lambda:InvokeFunctionUrl", - "Resource": "arn:aws:lambda:us-east-1:123456789012:function:my-function", - "Condition": { - "StringEquals": { - "lambda:FunctionUrlAuthType": "NONE" - } - } - } - ] -} -``` - -**Note** -When you create a function URL with auth type `NONE` via the console or AWS Serverless Application Model \(AWS SAM\), Lambda automatically creates the preceding resource\-based policy statement for you\. If the policy already exists, or the user or role creating the application doesn't have the appropriate permissions, then Lambda won't create it for you\. If you're using the AWS CLI, AWS CloudFormation, or the Lambda API directly, you must add `lambda:InvokeFunctionUrl` permissions yourself\. This makes your function public\. -In addition, if you delete your function URL with auth type `NONE`, Lambda doesn't automatically delete the associated resource\-based policy\. If you want to delete this policy, you must manually do so\. - -In this statement, the `lambda:FunctionUrlAuthType` condition key value is `NONE`\. This policy statement allows access only when your function URL's auth type is also `NONE`\. - -If a function's resource\-based policy doesn't grant `lambda:invokeFunctionUrl` permissions, then users will get a 403 Forbidden error code when they try to invoke your function URL, even if the function URL uses the `NONE` auth type\. - -## Governance and access control - -In addition to function URL invocation permissions, you can also control access on actions used to configure function URLs\. Lambda supports the following IAM policy actions for function URLs: -+ `lambda:InvokeFunctionUrl` – Invoke a Lambda function using the function URL\. -+ `lambda:CreateFunctionUrlConfig` – Create a function URL and set its `AuthType`\. -+ `lambda:UpdateFunctionUrlConfig` – Update a function URL configuration and its `AuthType`\. -+ `lambda:GetFunctionUrlConfig` – View the details of a function URL\. -+ `lambda:ListFunctionUrlConfigs` – List function URL configurations\. -+ `lambda:DeleteFunctionUrlConfig` – Delete a function URL\. - -**Note** -The Lambda console supports adding permissions only for `lambda:InvokeFunctionUrl`\. For all other actions, you must add permissions using the Lambda API or AWS CLI\. - -To allow or deny function URL access to other AWS entities, include these actions in IAM policies\. For example, the following policy grants the `example` role in AWS account `444455556666` permissions to update the function URL for function **my\-function** in account `123456789012`\. - -**Example cross\-account function URL policy** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::444455556666:role/example" - }, - "Action": "lambda:UpdateFunctionUrlConfig", - "Resource": "arn:aws:lambda:us-east-2:123456789012:function:my-function" - } - ] -} -``` - -### Condition keys - -For fine\-grained access control over your function URLs, use a condition key\. Lambda supports one additional condition key for function URLs: `FunctionUrlAuthType`\. The `FunctionUrlAuthType` key defines an enum value describing the auth type that your function URL uses\. The value can be either `AWS_IAM` or `NONE`\. - -You can use this condition key in policies associated with your function\. For example, you might want to restrict who can make configuration changes to your function URLs\. To deny all `UpdateFunctionUrlConfig` requests to any function with URL auth type `NONE`, you can define the following policy: - -**Example function URL policy with explicit deny** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Deny", - "Principal": "*", - "Action":[ - "lambda:UpdateFunctionUrlConfig" - ], - "Resource": "arn:aws:lambda:us-east-1:123456789012:function:*", - "Condition": { - "StringEquals": { - "lambda:FunctionUrlAuthType": "NONE" - } - } - } - ] -} -``` - -To grant the `example` role in AWS account `444455556666` permissions to make `CreateFunctionUrlConfig` and `UpdateFunctionUrlConfig` requests on functions with URL auth type `AWS_IAM`, you can define the following policy: - -**Example function URL policy with explicit allow** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::444455556666:role/example" - }, - "Action":[ - "lambda:CreateFunctionUrlConfig", - "lambda:UpdateFunctionUrlConfig" - ], - "Resource": "arn:aws:lambda:us-east-1:123456789012:function:*", - "Condition": { - "StringEquals": { - "lambda:FunctionUrlAuthType": "AWS_IAM" - } - } - } - ] -} -``` - -You can also use this condition key in a [service control policy](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) \(SCP\)\. Use SCPs to manage permissions across an entire organization in AWS Organizations\. For example, to deny users from creating or updating function URLs that use anything other than the `AWS_IAM` auth type, use the following service control policy: - -**Example function URL SCP with explicit deny** - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Deny", - "Action":[ - "lambda:CreateFunctionUrlConfig", - "lambda:UpdateFunctionUrlConfig" - ], - "Resource": "arn:aws:lambda:*:123456789012:function:*", - "Condition": { - "StringNotEquals": { - "lambda:FunctionUrlAuthType": "AWS_IAM" - } - } - } - ] -} -``` \ No newline at end of file diff --git a/doc_source/urls-configuration.md b/doc_source/urls-configuration.md deleted file mode 100644 index c73629bd..00000000 --- a/doc_source/urls-configuration.md +++ /dev/null @@ -1,217 +0,0 @@ -# Creating and managing Lambda function URLs - -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: - -``` -https://.lambda-url..on.aws -``` - -**Topics** -+ [Creating a function URL \(console\)](#create-url-console) -+ [Creating a function URL \(AWS CLI\)](#create-url-cli) -+ [Adding a function URL to a CloudFormation template](#urls-cfn) -+ [Cross\-origin resource sharing \(CORS\)](#urls-cors) -+ [Throttling function URLs](#urls-throttling) -+ [Deactivating function URLs](#urls-deactivating) -+ [Deleting function URLs](#w831aac55c21c37) - -## Creating a function URL \(console\) - -Follow these steps to create a function URL using the console\. - -### To create a function URL for an existing function \(console\) - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function that you want to create the function URL for\. - -1. Choose the **Configuration** tab, and then choose **Function URL**\. - -1. Choose **Create function URL**\. - -1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. - -1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**, and then configure the CORS settings for your function URL\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. - -1. Choose **Save**\. - -This creates a function URL for the `$LATEST` unpublished version of your function\. The function URL appears in the **Function overview** section of the console\. - -### To create a function URL for an existing alias \(console\) - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function with the alias that you want to create the function URL for\. - -1. Choose the **Aliases** tab, and then choose the name of the alias that you want to create the function URL for\. - -1. Choose the **Configuration** tab, and then choose **Function URL**\. - -1. Choose **Create function URL**\. - -1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. - -1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**, and then configure the CORS settings for your function URL\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. - -1. Choose **Save**\. - -This creates a function URL for your function alias\. The function URL appears in the console's **Function overview** section for your alias\. - -### To create a new function with a function URL \(console\) - -**To create a new function with a function URL \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter a name for your function, such as **my\-function**\. - - 1. For **Runtime**, choose the language runtime that you prefer, such as **Node\.js 14\.x**\. - - 1. For **Architecture**, choose either **x86\_64** or **arm64**\. - - 1. Expand **Permissions**, then choose whether to create a new execution role or use an existing one\. - -1. Expand **Advanced settings**, and then select **Function URL**\. - -1. For **Auth type**, choose **AWS\_IAM** or **NONE**\. For more information about function URL authentication, see [Security and auth model](urls-auth.md)\. - -1. \(Optional\) Select **Configure cross\-origin resource sharing \(CORS\)**\. By selecting this option during function creation, your function URL allows requests from all origins by default\. You can edit the CORS settings for your function URL after creating the function\. For more information about CORS, see [Cross\-origin resource sharing \(CORS\)](#urls-cors)\. - -1. Choose **Create function**\. - -This creates a new function with a function URL for the `$LATEST` unpublished version of the function\. The function URL appears in the **Function overview** section of the console\. - -## Creating a function URL \(AWS CLI\) - -To create a function URL for an existing Lambda function using the AWS Command Line Interface \(AWS CLI\), run the following command: - -``` -aws lambda create-function-url-config \ - --function-name my-function \ - --qualifier prod \ // optional - --auth-type AWS_IAM - --cors-config {AllowOrigins="https://example.com"} // optional -``` - -This adds a function URL to the **prod** qualifier for the function **my\-function**\. For more information about these configuration parameters, see [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) in the API reference\. - -**Note** -To create a function URL via the AWS CLI, the function must already exist\. - -## Adding a function URL to a CloudFormation template - -To add an `AWS::Lambda::Url` resource to your AWS CloudFormation template, use the following syntax: - -### JSON - -``` -{ - "Type" : "AWS::Lambda::Url", - "Properties" : { - "AuthType" : String, - "Cors" : Cors, - "Qualifier" : String, - "TargetFunctionArn" : String - } -} -``` - -### YAML - -``` -Type: AWS::Lambda::Url -Properties: - AuthType: String - Cors: - Cors - Qualifier: String - TargetFunctionArn: String -``` - -### Parameters -+ \(Required\) `AuthType` – Defines the type of authentication for your function URL\. Possible values are either `AWS_IAM` or `NONE`\. To restrict access to authenticated IAM users only, set to `AWS_IAM`\. To bypass IAM authentication and allow any user to make requests to your function, set to `NONE`\. -+ \(Optional\) `Cors` – Defines the [CORS settings](#urls-cors) for your function URL\. To add `Cors` to your `AWS::Lambda::Url` resource in CloudFormation, use the following syntax\. - - -**Example AWS::Lambda::Url\.Cors \(JSON\)** - - ``` - { - "AllowCredentials" : Boolean, - "AllowHeaders" : [ String, ... ], - "AllowMethods" : [ String, ... ], - "AllowOrigins" : [ String, ... ], - "ExposeHeaders" : [ String, ... ], - "MaxAge" : Integer - } - ``` -**Example AWS::Lambda::Url\.Cors \(YAML\)** - - ``` - AllowCredentials: Boolean - AllowHeaders: - - String - AllowMethods: - - String - AllowOrigins: - - String - ExposeHeaders: - - String - MaxAge: Integer - ``` -+ \(Optional\) `Qualifier` – The alias name\. -+ \(Required\) `TargetFunctionArn` – The name or Amazon Resource Name \(ARN\) of the Lambda function\. Valid name formats include the following: - + **Function name** – `my-function` - + **Function ARN** – `arn:aws:lambda:us-west-2:123456789012:function:my-function` - + **Partial ARN** – `123456789012:function:my-function` - -## Cross\-origin resource sharing \(CORS\) - -To define how different origins can access your function URL, use [cross\-origin resource sharing \(CORS\)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)\. We recommend configuring CORS if you intend to call your function URL from a different domain\. Lambda supports the following CORS headers for function URLs\. - - -| CORS header | CORS configuration property | Example values | -| --- | --- | --- | -| [ Access\-Control\-Allow\-Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) | `AllowOrigins` | `*` \(allow all origins\) `https://www.example.com` `http://localhost:60905` | -| [ Access\-Control\-Allow\-Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) | `AllowMethods` | `GET`, `POST`, `DELETE`, `*` | -| [ Access\-Control\-Allow\-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers) | `AllowHeaders` | `Date`, `Keep-Alive`, `X-Custom-Header` | -| [ Access\-Control\-Expose\-Headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers) | `ExposeHeaders` | `Date`, `Keep-Alive`, `X-Custom-Header` | -| [ Access\-Control\-Allow\-Credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials) | `AllowCredentials` | `TRUE` | -| [ Access\-Control\-Max\-Age](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age) | `MaxAge` | `5` \(default\), `300` | - -When you configure CORS for a function URL using the Lambda console or the AWS CLI, Lambda automatically adds the CORS headers to all responses through the function URL\. Alternatively, you can manually add CORS headers to your function response\. If there are conflicting headers, the configured CORS headers on the function URL take precedence\. - -## Throttling function URLs - -Throttling limits the rate at which your function processes requests\. This is useful in many situations, such as preventing your function from overloading downstream resources, or handling a sudden surge in requests\. - -You can throttle the rate of requests that your Lambda function processes through a function URL by configuring reserved concurrency\. Reserved concurrency limits the number of maximum concurrent invocations for your function\. Your function's maximum request rate per second \(RPS\) is equivalent to 10 times the configured reserved concurrency\. For example, if you configure your function with a reserved concurrency of 100, then the maximum RPS is 1,000\. - -Whenever your function concurrency exceeds the reserved concurrency, your function URL returns an HTTP `429` status code\. If your function receives a request that exceeds the 10x RPS maximum based on your configured reserved concurrency, you also receive an HTTP `429` error\. For more information about reserved concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. - -## Deactivating function URLs - -In an emergency, you might want to reject all traffic to your function URL\. To deactivate your function URL, set the reserved concurrency to zero\. This throttles all requests to your function URL, resulting in HTTP `429` status responses\. To reactivate your function URL, delete the reserved concurrency configuration, or set the configuration to an amount greater than zero\. - -## Deleting function URLs - -When you delete a function URL, you can’t recover it\. Creating a new function URL will result in a different URL address\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of the function\. - -1. Choose the **Configuration** tab, and then choose **Function URL**\. - -1. Choose **Delete**\. - -1. Enter the word *delete* into the field to confirm the deletion\. - -1. Choose **Delete**\. - -**Note** -If you delete a function URL with auth type `NONE`, Lambda doesn't automatically delete the associated resource\-based policy\. If you want to delete this policy, you must manually do so\. \ No newline at end of file diff --git a/doc_source/urls-invocation.md b/doc_source/urls-invocation.md deleted file mode 100644 index eb5c756a..00000000 --- a/doc_source/urls-invocation.md +++ /dev/null @@ -1,201 +0,0 @@ -# Invoking Lambda function URLs - -A function URL is a dedicated HTTP\(S\) endpoint for your Lambda function\. You can create and configure a function URL through the Lambda console or the Lambda API\. When you create a function URL, Lambda automatically generates a unique URL endpoint for you\. Once you create a function URL, its URL endpoint never changes\. Function URL endpoints have the following format: - -``` -https://.lambda-url..on.aws -``` - -Function URLs are dual stack\-enabled, supporting IPv4 and IPv6\. After configuring your function URL, you can invoke your function through its HTTP\(S\) endpoint via a web browser, curl, Postman, or any HTTP client\. To invoke a function URL, you must have `lambda:InvokeFunctionUrl` permissions\. For more information, see [Security and auth model](urls-auth.md)\. - -**Topics** -+ [Function URL invocation basics](#urls-invocation-basics) -+ [Request and response payloads](#urls-payloads) - -## Function URL invocation basics - -If your function URL uses the `AWS_IAM` auth type, you must sign each HTTP request using [AWS Signature Version 4 \(SigV4\)](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)\. Tools such as [awscurl](https://github.com/okigan/awscurl), [Postman](http://www.postman.com/), and [AWS SigV4 Proxy](https://github.com/awslabs/aws-sigv4-proxy) offer built\-in ways to sign your requests with SigV4\. - -If you don't use a tool to sign HTTP requests to your function URL, you must manually sign each request using SigV4\. When your function URL receives a request, Lambda also calculates the SigV4 signature\. Lambda processes the request only if the signatures match\. For instructions on how to manually sign your requests with SigV4, see [Signing AWS requests with Signature Version 4](https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html) in the *Amazon Web Services General Reference Guide*\. - -If your function URL uses the `NONE` auth type, you don't have to sign your requests using SigV4\. You can invoke your function using a web browser, curl, Postman, or any HTTP client\. - -To test simple `GET` requests to your function, use a web browser\. For example, if your function URL is `https://abcdefg.lambda-url.us-east-1.on.aws`, and it takes in a string parameter `message`, your request URL could look like this: - -``` -https://abcdefg.lambda-url.us-east-1.on.aws/?message=HelloWorld -``` - -To test other HTTP requests, such as a `POST` request, you can use a tool such as curl\. For example, if you want to include some JSON data in a `POST` request to your function URL, you could use the following curl command: - -``` -curl -v -X POST \ - 'https://abcdefg.lambda-url.us-east-1.on.aws/?message=HelloWorld' \ - -H 'content-type: application/json' \ - -d '{ "example": "test" }' -``` - -## Request and response payloads - -When a client calls your function URL, Lambda maps the request to an event object before passing it to your function\. Your function's response is then mapped to an HTTP response that Lambda sends back to the client through the function URL\. - -The request and response event formats follow the same schema as the [Amazon API Gateway payload format version 2\.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)\. - -### Request payload format - -A request payload has the following structure: - -``` -{ - "version": "2.0", - "routeKey": "$default", - "rawPath": "/my/path", - "rawQueryString": "parameter1=value1¶meter1=value2¶meter2=value", - "cookies": [ - "cookie1", - "cookie2" - ], - "headers": { - "header1": "value1", - "header2": "value1,value2" - }, - "queryStringParameters": { - "parameter1": "value1,value2", - "parameter2": "value" - }, - "requestContext": { - "accountId": "123456789012", - "apiId": "", - "authentication": null, - "authorizer": { - "iam": { - "accessKey": "AKIA...", - "accountId": "111122223333", - "callerId": "AIDA...", - "cognitoIdentity": null, - "principalOrgId": null, - "userArn": "arn:aws:iam::111122223333:user/example-user", - "userId": "AIDA..." - } - }, - "domainName": ".lambda-url.us-west-2.on.aws", - "domainPrefix": "", - "http": { - "method": "POST", - "path": "/my/path", - "protocol": "HTTP/1.1", - "sourceIp": "123.123.123.123", - "userAgent": "agent" - }, - "requestId": "id", - "routeKey": "$default", - "stage": "$default", - "time": "12/Mar/2020:19:03:58 +0000", - "timeEpoch": 1583348638390 - }, - "body": "Hello from client!", - "pathParameters": null, - "isBase64Encoded": false, - "stageVariables": null -} -``` - - -| Parameter | Description | Example | -| --- | --- | --- | -| `version` | The payload format version for this event\. Lambda function URLs currently support [payload format version 2\.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)\. | `2.0` | -| `routeKey` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | -| `rawPath` | The request path\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example/test/demo`, then the raw path value is `/example/test/demo`\. | `/example/test/demo` | -| `rawQueryString` | The raw string containing the request's query string parameters\. | `"?parameter1=value1¶meter2=value2"` | -| `cookies` | An array containing all cookies sent as part of the request\. | `["Cookie_1=Value_1", "Cookie_2=Value_2"]` | -| `headers` | The list of request headers, presented as key\-value pairs\. | `{"header1": "value1", "header2": "value2"}` | -| `queryStringParameters` | The query parameters for the request\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example?name=Jane`, then the `queryStringParameters` value is a JSON object with a key of `name` and a value of `Jane`\. | `{"name": "Jane"}` | -| `requestContext` | An object that contains additional information about the request, such as the `requestId`, the time of the request, and the identity of the caller if authorized via AWS Identity and Access Management \(IAM\)\. | | -| `requestContext.accountId` | The AWS account ID of the function owner\. | `"123456789012"` | -| `requestContext.apiId` | The ID of the function URL\. | `"33anwqw8fj"` | -| `requestContext.authentication` | Function URLs don't use this parameter\. Lambda sets this to `null`\. | `null` | -| `requestContext.authorizer` | An object that contains information about the caller identity, if the function URL uses the `AWS_IAM` auth type\. Otherwise, Lambda sets this to `null`\. | | -| `requestContext.authorizer.iam.accessKey` | The access key of the caller identity\. | `"AKIAIOSFODNN7EXAMPLE"` | -| `requestContext.authorizer.iam.accountId` | The AWS account ID of the caller identity\. | `"111122223333"` | -| `requestContext.authorizer.iam.callerId` | The ID \(IAM user ID\) of the caller\. | `"AIDACKCEVSQ6C2EXAMPLE"` | -| `requestContext.authorizer.iam.cognitoIdentity` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | -| `requestContext.authorizer.iam.principalOrgId` | The principal org ID associated with the caller identity\. | `"AIDACKCEVSQORGEXAMPLE"` | -| `requestContext.authorizer.iam.userArn` | The user Amazon Resource Name \(ARN\) of the caller identity\. | `"arn:aws:iam::111122223333:user/example-user"` | -| `requestContext.authorizer.iam.userId` | The user ID of the caller identity\. | `"AIDACOSFODNN7EXAMPLE2"` | -| `requestContext.domainName` | The domain name of the function URL\. | `".lambda-url.us-west-2.on.aws"` | -| `requestContext.domainPrefix` | The domain prefix of the function URL\. | `""` | -| `requestContext.http` | An object that contains details about the HTTP request\. | | -| `requestContext.http.method` | The HTTP method used in this request\. Valid values include `GET`, `POST`, `PUT`, `HEAD`, `OPTIONS`, `PATCH`, and `DELETE`\. | `GET` | -| `requestContext.http.path` | The request path\. For example, if the request URL is `https://{url-id}.lambda-url.{region}.on.aws/example/test/demo`, then the path value is `/example/test/demo`\. | `/example/test/demo` | -| `requestContext.http.protocol` | The protocol of the request\. | `HTTP/1.1` | -| `requestContext.http.sourceIp` | The source IP address of the immediate TCP connection making the request\. | `123.123.123.123` | -| `requestContext.http.userAgent` | The User\-Agent request header value\. | `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Gecko/20100101 Firefox/42.0` | -| `requestContext.requestId` | The ID of the invocation request\. You can use this ID to trace invocation logs related to your function\. | `e1506fd5-9e7b-434f-bd42-4f8fa224b599` | -| `requestContext.routeKey` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | -| `requestContext.stage` | Function URLs don't use this parameter\. Lambda sets this to `$default` as a placeholder\. | `$default` | -| `requestContext.time` | The timestamp of the request\. | `"07/Sep/2021:22:50:22 +0000"` | -| `requestContext.timeEpoch` | The timestamp of the request, in Unix epoch time\. | `"1631055022677"` | -| `body` | The body of the request\. If the content type of the request is binary, the body is base64\-encoded\. | `{"key1": "value1", "key2": "value2"}` | -| `pathParameters` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | -| `isBase64Encoded` | `TRUE` if the body is a binary payload and base64\-encoded\. `FALSE` otherwise\. | `FALSE` | -| `stageVariables` | Function URLs don't use this parameter\. Lambda sets this to `null` or excludes this from the JSON\. | `null` | - -### Response payload format - -When your function returns a response, Lambda parses the response and converts it into an HTTP response\. Function response payloads have the following format: - -``` -{ - "statusCode": 201, - "headers": { - "Content-Type": "application/json", - "My-Custom-Header": "Custom Value" - }, - "body": "{ \"message\": \"Hello, world!\" }", - "cookies": [ - "Cookie_1=Value1; Expires=21 Oct 2021 07:48 GMT", - "Cookie_2=Value2; Max-Age=78000" - ], - "isBase64Encoded": false -} -``` - -Lambda infers the response format for you\. If your function returns valid JSON and doesn't return a `statusCode`, Lambda assumes the following: -+ `statusCode` is `200`\. -+ `content-type` is `application/json`\. -+ `body` is the function response\. -+ `isBase64Encoded` is `false`\. - -The following examples show how the output of your Lambda function maps to the response payload, and how the response payload maps to the final HTTP response\. When the client invokes your function URL, they see the HTTP response\. - - -**Example output for a string response** - -| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | -| --- | --- | --- | -|
"Hello, world!"
|
{
"statusCode": 200,
"body": "Hello, world!",
"headers": {
"content-type": "application/json"
},
"isBase64Encoded": false
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 15

"Hello, world!"
| - - -**Example output for a JSON response** - -| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | -| --- | --- | --- | -|
{
"message": "Hello, world!"
}
|
{
"statusCode": 200,
"body": {
"message": "Hello, world!"
},
"headers": {
"content-type": "application/json"
},
"isBase64Encoded": false
}
|
HTTP/2 200
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 34

{
"message": "Hello, world!"
}
| - - -**Example output for a custom response** - -| Lambda function output | Interpreted response output | HTTP response \(what the client sees\) | -| --- | --- | --- | -|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"isBase64Encoded": false
}
|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"isBase64Encoded": false
}
|
HTTP/2 201
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 27
my-custom-header: Custom Value

{
"message": "Hello, world!"
}
| - -### Cookies - -To return cookies from your function, don't manually add `set-cookie` headers\. Instead, include the cookies in your response payload object\. Lambda automatically interprets this and adds them as `set-cookie` headers in your HTTP response, as in the following example\. - - -**Example output for a response returning cookies** - -| Lambda function output | HTTP response \(what the client sees\) | -| --- | --- | -|
{
"statusCode": 201,
"headers": {
"Content-Type": "application/json",
"My-Custom-Header": "Custom Value"
},
"body": JSON.stringify({
"message": "Hello, world!"
}),
"cookies": [
"Cookie_1=Value1; Expires=21 Oct 2021 07:48 GMT",
"Cookie_2=Value2; Max-Age=78000"
],
"isBase64Encoded": false
}
|
HTTP/2 201
date: Wed, 08 Sep 2021 18:02:24 GMT
content-type: application/json
content-length: 27
my-custom-header: Custom Value
set-cookie: Cookie_1=Value2; Expires=21 Oct 2021 07:48 GMT
set-cookie: Cookie_2=Value2; Max-Age=78000

{
"message": "Hello, world!"
}
| \ No newline at end of file diff --git a/doc_source/urls-monitoring.md b/doc_source/urls-monitoring.md deleted file mode 100644 index 70b53761..00000000 --- a/doc_source/urls-monitoring.md +++ /dev/null @@ -1,37 +0,0 @@ -# Monitoring Lambda function URLs - -You can use AWS CloudTrail and Amazon CloudWatch to monitor your function URLs\. - -**Topics** -+ [Monitoring function URLs with CloudTrail](#urls-cloudtrail) -+ [CloudWatch metrics for function URLs](#urls-cloudwatch) - -## Monitoring function URLs with CloudTrail - -For function URLs, Lambda automatically supports logging the following API operations as events in CloudTrail log files: -+ [CreateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunctionUrlConfig.html) -+ [UpdateFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionUrlConfig.html) -+ [DeleteFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunctionUrlConfig.html) -+ [GetFunctionUrlConfig](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionUrlConfig.html) -+ [ListFunctionUrlConfigs](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctionUrlConfigs.html) - -Each log entry contains information about the caller identity, when the request was made, and other details\. You can see all events within the last 90 days by viewing your CloudTrail **Event history**\. To retain records past 90 days, you can create a trail\. For more information, see [Using AWS Lambda with AWS CloudTrail](with-cloudtrail.md)\. - -By default, CloudTrail doesn't log `InvokeFunctionUrl` requests, which are considered data events\. However, you can turn on data event logging in CloudTrail\. For more information, see [Logging data events for trails](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) in the *AWS CloudTrail User Guide*\. - -## CloudWatch metrics for function URLs - -Lambda sends aggregated metrics about function URL requests to CloudWatch\. With these metrics, you can monitor your function URLs, build dashboards, and configure alarms in the CloudWatch console\. - -Function URLs support the following invocation metrics\. We recommend viewing these metrics with the `Sum` statistic\. -+ `UrlRequestCount` – The number of requests made to this function URL\. -+ `Url4xxError` – The number of requests that returned a 4XX HTTP status code\. 4XX series codes indicate client\-side errors, such as bad requests\. -+ `Url5xxError` – The number of requests that returned a 5XX HTTP status code\. 5XX series codes indicate server\-side errors, such as function errors and timeouts\. - -Function URLs also support the following performance metric\. We recommend viewing this metric with the `Average` or `Max` statistics\. -+ `UrlRequestLatency` – The time between when the function URL receives a request and when the function URL returns a response\. - -Each of these invocation and performance metrics supports the following dimensions: -+ `FunctionName` – View aggregate metrics for function URLs assigned to a function's `$LATEST` unpublished version, or to any of the function's aliases\. For example, `hello-world-function`\. -+ `Resource` – View metrics for a specific function URL\. This is defined by a function name, along with either the function's `$LATEST` unpublished version or one of the function's aliases\. For example, `hello-world-function:$LATEST`\. -+ `ExecutedVersion` – View metrics for a specific function URL based on the executed version\. You can use this dimension primarily to track the function URL assigned to the `$LATEST` unpublished version\. \ No newline at end of file diff --git a/doc_source/urls-tutorial.md b/doc_source/urls-tutorial.md deleted file mode 100644 index 078bccb3..00000000 --- a/doc_source/urls-tutorial.md +++ /dev/null @@ -1,195 +0,0 @@ -# Tutorial: Creating a Lambda function with a function URL - -In this tutorial, you create a Lambda function defined as a \.zip file archive with a **public** function URL endpoint that returns the product of two numbers\. For more information about configuring function URLs, see [Creating and managing function URLs](urls-configuration.md)\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create an execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your Lambda function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the AWS Identity and Access Management \(IAM\) console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-url\-role**\. - -The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to Amazon CloudWatch Logs\. - -## Create a Lambda function with a function URL \(\.zip file archive\) - -Create a Lambda function with a function URL endpoint using a \.zip file archive\. - -**To create the function** - -1. Copy the following code example into a file named `index.js`\. -**Example index\.js** - - ``` - exports.handler = async (event) => { - let body = JSON.parse(event.body); - const product = body.num1 * body.num2; - const response = { - statusCode: 200, - body: "The product of " + body.num1 + " and " + body.num2 + " is " + product, - }; - return response; - }; - ``` - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function \ - --function-name my-url-function \ - --runtime nodejs14.x \ - --zip-file fileb://function.zip \ - --handler index.handler \ - --role arn:aws:iam::123456789012:role/lambda-url-role - ``` - -1. Add a resource\-based policy to your function granting permissions to allow public access to your function URL\. - - ``` - aws lambda add-permission - --function-name my-url-function \ - --action lambda:InvokeFunctionUrl \ - --principal "*" \ - --function-url-auth-type "NONE" \ - --statement-id url - ``` - -1. Create a URL endpoint for the function with the `create-function-url-config` command\. - - ``` - aws lambda create-function-url-config \ - --function-name my-url-function \ - --auth-type NONE - ``` - -## Test the function URL endpoint - -Invoke your Lambda function by calling your function URL endpoint using an HTTP client such as curl or Postman\. - -``` -curl -X POST \ - 'https://abcdefg.lambda-url.us-east-1.on.aws/' \ - -H 'Content-Type: application/json' \ - -d '{"num1": "10", "num2": "10"}' -``` - -You should see the following output: - -``` -The product of 10 and 10 is 100 -``` - -## Create a Lambda function with a function URL \(CloudFormation\) - -You can also create a Lambda function with a function URL endpoint using the AWS CloudFormation type `AWS::Lambda::Url`\. - -``` -Resources: - MyUrlFunction: - Type: AWS::Lambda::Function - Properties: - Handler: index.handler - Runtime: nodejs14.x - Role: arn:aws:iam::123456789012:role/lambda-url-role - Code: - ZipFile: | - exports.handler = async (event) => { - let body = JSON.parse(event.body); - const product = body.num1 * body.num2; - const response = { - statusCode: 200, - body: "The product of " + body.num1 + " and " + body.num2 + " is " + product, - }; - return response; - }; - Description: Create a function with a URL. - MyUrlFunctionPermissions: - Type: AWS::Lambda::Permission - Properties: - FunctionName: !Ref MyUrlFunction - Action: lambda:InvokeFunctionUrl - Principal: "*" - FunctionUrlAuthType: NONE - MyFunctionUrl: - Type: AWS::Lambda::Url - Properties: - TargetFunctionArn: !Ref MyUrlFunction - AuthType: NONE -``` - -## Create a Lambda function with a function URL \(AWS SAM\) - -You can also create a Lambda function configured with a function URL using AWS Serverless Application Model \(AWS SAM\)\. - -``` -ProductFunction: - Type: AWS::Serverless::Function - Properties: - CodeUri: function/. - Handler: index.handler - Runtime: nodejs14.x - AutoPublishAlias: live - FunctionUrlConfig: - AuthType: NONE -``` - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. diff --git a/doc_source/welcome.md b/doc_source/welcome.md deleted file mode 100644 index 28a9f0a4..00000000 --- a/doc_source/welcome.md +++ /dev/null @@ -1,105 +0,0 @@ -# What is AWS Lambda? - -Lambda is a compute service that lets you run code without provisioning or managing servers\. Lambda runs your code on a high\-availability compute infrastructure and performs all of the administration of the compute resources, including server and operating system maintenance, capacity provisioning and automatic scaling, and logging\. With Lambda, you can run code for virtually any type of application or backend service\. All you need to do is supply your code in one of the [languages that Lambda supports](lambda-runtimes.md)\. - -**Note** -In the AWS Lambda Developer Guide, we assume that you have experience with coding, compiling, and deploying programs using one of the supported languages\. - -You organize your code into [Lambda functions](gettingstarted-concepts.md#gettingstarted-concepts-function)\. Lambda runs your function only when needed and scales automatically, from a few requests per day to thousands per second\. You pay only for the compute time that you consume—there is no charge when your code is not running\. - -You can invoke your Lambda functions using the Lambda API, or Lambda can run your functions in response to events from other AWS services\. For example, you can use Lambda to: -+ Build data\-processing triggers for AWS services such as Amazon Simple Storage Service \(Amazon S3\) and Amazon DynamoDB\. -+ Process streaming data stored in Amazon Kinesis\. -+ Create your own backend that operates at AWS scale, performance, and security\. - -Lambda is a highly available service\. For more information, see the [AWS Lambda Service Level Agreement](http://aws.amazon.com/lambda/sla/)\. - -**Topics** -+ [When should I use Lambda?](#when-to-use-cloud-functions) -+ [Lambda features](#features) -+ [Getting started with Lambda](#welcome-first-time-user) -+ [Related services](#related-services) -+ [Accessing Lambda](#accessing) -+ [Pricing for Lambda](#pricing) - -## When should I use Lambda? - -Lambda is an ideal compute service for many application scenarios, as long as you can run your application code using the Lambda [standard runtime environment](lambda-runtime-environment.md) and within the resources that Lambda provides\. - -When using Lambda, you are responsible only for your code\. Lambda manages the compute fleet that offers a balance of memory, CPU, network, and other resources to run your code\. Because Lambda manages these resources, you cannot log in to compute instances or customize the operating system on [provided runtimes](lambda-runtimes.md)\. Lambda performs operational and administrative activities on your behalf, including managing capacity, monitoring, and logging your Lambda functions\. - -If you need to manage your own compute resources, AWS has other compute services to meet your needs\. For example: -+ Amazon Elastic Compute Cloud \(Amazon EC2\) offers a wide range of EC2 instance types to choose from\. It lets you customize operating systems, network and security settings, and the entire software stack\. You are responsible for provisioning capacity, monitoring fleet health and performance, and using Availability Zones for fault tolerance\. -+ AWS Elastic Beanstalk enables you to deploy and scale applications onto Amazon EC2\. You retain ownership and full control over the underlying EC2 instances\. - -## Lambda features - -The following key features help you develop Lambda applications that are scalable, secure, and easily extensible: - -**Concurrency and scaling controls** -[Concurrency and scaling controls](invocation-scaling.md) such as concurrency limits and provisioned concurrency give you fine\-grained control over the scaling and responsiveness of your production applications\. - -**Functions defined as container images** -Use your preferred [container image](images-create.md) tooling, workflows, and dependencies to build, test, and deploy your Lambda functions\. - -**Code signing ** -[Code signing](configuration-codesigning.md) for Lambda provides trust and integrity controls that let you verify that only unaltered code that approved developers have published is deployed in your Lambda functions\. - -**Lambda extensions** -You can use [Lambda extensions](runtimes-extensions-api.md) to augment your Lambda functions\. For example, use extensions to more easily integrate Lambda with your favorite tools for monitoring, observability, security, and governance\. - -**Function blueprints** -A function blueprint provides sample code that shows how to use Lambda with other AWS services or third\-party applications\. Blueprints include sample code and function configuration presets for Node\.js and Python runtimes\. - -**Database access** -A [database proxy](configuration-database.md) manages a pool of database connections and relays queries from a function\. This enables a function to reach high concurrency levels without exhausting database connections\. - -**File systems access** -You can configure a function to mount an [Amazon Elastic File System \(Amazon EFS\) file system](configuration-filesystem.md) to a local directory\. With Amazon EFS, your function code can access and modify shared resources safely and at high concurrency\. - -## Getting started with Lambda - -To work effectively with Lambda, you need coding experience and expertise in the following domains: -+ Linux OS and commands, as well as concepts such as processes, threads, and file permissions\. -+ Cloud concepts and IP networking concepts \(for public and private networks\)\. -+ Distributed computing concepts such as HTTP as an IPC, queues, messaging, notifications, and concurrency\. -+ Familiarity with security services and concepts: AWS Identity and Access Management \(IAM\) and access control principles, and AWS Key Management Service \(AWS KMS\) and public key infrastructure\. -+ Familiarity with key services that interact with Lambda: Amazon API Gateway, Amazon S3, Amazon Simple Queue Service \(Amazon SQS\), and DynamoDB\. -+ Configuring EC2 instances with Linux\. - -If you are a first\-time user of Lambda, we recommend that you start with the following topics to help you learn the basics: - -1. **Read the [Lambda product overview](http://aws.amazon.com/lambda/) and explore the [Lambda getting started](http://aws.amazon.com/lambda/getting-started/) page\.** - -1. **To create and test a Lambda function using the Lambda console, try the [console\-based getting started exercise](getting-started.md)\.** This exercise teaches you about the Lambda programming model and other concepts\. - -1. **If you are familiar with container image workflows, try the getting started exercise to [create a Lambda function defined as a container image](gettingstarted-images.md)\.** - - AWS also provides the following resources for learning about serverless applications and Lambda: -+ The [AWS Compute Blog](http://aws.amazon.com/blogs/compute/ ) includes useful articles about Lambda\. -+ [AWS Serverless](https://serverlessland.com/) provides blogs, videos, and training related to AWS serverless development\. -+ The [AWS Online Tech Talks](https://www.youtube.com/channel/UCT-nPlVzJI-ccQXlxjSvJmw) YouTube channel includes videos about Lambda\-related topics\. For an overview of serverless applications and Lambda, see the [Introduction to AWS Lambda & Serverless Applications](https://www.youtube.com/watch?v=EBSdyoO3goc) video\. - -## Related services - -[Lambda integrates with other AWS services](lambda-services.md) to invoke functions based on events that you specify\. For example: -+ Use [API Gateway](services-apigateway.md) to provide a secure and scalable gateway for web APIs that route HTTP requests to Lambda functions\. -+ For services that generate a queue or data stream \(such as [DynamoDB](with-ddb.md) and [Kinesis](with-kinesis.md)\), Lambda polls the queue or data stream from the service and invokes your function to process the received data\. -+ Define [Amazon S3](with-s3.md) events that invoke a Lambda function to process Amazon S3 objects, for example, when an object is created or deleted\. -+ Use a Lambda function to process [Amazon SQS](with-sqs.md) messages or [Amazon Simple Notification Service \(Amazon SNS\)](with-sns.md) notifications\. -+ Use [AWS Step Functions](lambda-stepfunctions.md) to connect Lambda functions together into serverless workflows called state machines\. - -## Accessing Lambda - -You can create, invoke, and manage your Lambda functions using any of the following interfaces: -+ **AWS Management Console** – Provides a web interface for you to access your functions\. For more information, see [Lambda console](foundation-console.md)\. -+ **AWS Command Line Interface \(AWS CLI\)** – Provides commands for a broad set of AWS services, including Lambda, and is supported on Windows, macOS, and Linux\. For more information, see [Using Lambda with the AWS CLI](gettingstarted-awscli.md)\. -+ **AWS SDKs** – Provide language\-specific APIs and manage many of the connection details, such as signature calculation, request retry handling, and error handling\. For more information, see [AWS SDKs](http://aws.amazon.com/tools/#SDKs)\. -+ **AWS CloudFormation** – Enables you to create templates that define your Lambda applications\. For more information, see [AWS Lambda applications](deploying-lambda-apps.md)\. AWS CloudFormation also supports the [AWS Cloud Development Kit \(AWS CDK\)](http://aws.amazon.com/cdk)\. -+ **AWS Serverless Application Model \(AWS SAM\)** – Provides templates and a CLI to configure and manage AWS serverless applications\. For more information, see [SAM CLI](lambda-settingup.md#lambda-settingup-samcli)\. - - - -## Pricing for Lambda - -There is no additional charge for creating Lambda functions\. There are charges for running a function and for data transfer between Lambda and other AWS services\. Some optional Lambda features \(such as [provisioned concurrency](configuration-concurrency.md)\) also incur charges\. For more information, see [AWS Lambda Pricing](http://aws.amazon.com/lambda/pricing/)\. \ No newline at end of file diff --git a/doc_source/with-android-create-package.md b/doc_source/with-android-create-package.md deleted file mode 100644 index f37aa7ac..00000000 --- a/doc_source/with-android-create-package.md +++ /dev/null @@ -1,103 +0,0 @@ -# Sample function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js](#with-android-example-deployment-pkg-nodejs) -+ [Java](#with-on-demand-custom-android-example-deployment-pkg-java) - -## Node\.js - -The following example uses data to generate a string response\. - -**Example index\.js** - -``` -exports.handler = function(event, context, callback) { - console.log("Received event: ", event); - var data = { - "greetings": "Hello, " + event.firstName + " " + event.lastName + "." - }; - callback(null, data); -} -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Java - -The following example uses data to generate a string response\. - -In the code, the `handler` \(`myHandler`\) uses the `RequestClass` and `ResponseClass` types for the input and output\. The code provides implementation for these types\. - -**Example HelloPojo\.java** - -``` -package example; - -import com.amazonaws.services.lambda.runtime.Context; - -public class HelloPojo { - - // Define two classes/POJOs for use with Lambda function. - public static class RequestClass { - String firstName; - String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public RequestClass(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - - public RequestClass() { - } - } - - public static class ResponseClass { - String greetings; - - public String getGreetings() { - return greetings; - } - - public void setGreetings(String greetings) { - this.greetings = greetings; - } - - public ResponseClass(String greetings) { - this.greetings = greetings; - } - - public ResponseClass() { - } - - } - - public static ResponseClass myHandler(RequestClass request, Context context){ - String greetingString = String.format("Hello %s, %s.", request.firstName, request.lastName); - context.getLogger().log(greetingString); - return new ResponseClass(greetingString); - } -} -``` - -**Dependencies** -+ `aws-lambda-java-core` - -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. \ No newline at end of file diff --git a/doc_source/with-android-example.md b/doc_source/with-android-example.md deleted file mode 100644 index ba13575d..00000000 --- a/doc_source/with-android-example.md +++ /dev/null @@ -1,321 +0,0 @@ -# Tutorial: Using AWS Lambda with the Mobile SDK for Android - -In this tutorial, you create a simple Android mobile application that uses Amazon Cognito to get credentials and invokes a Lambda function\. - -The mobile application retrieves AWS credentials from an Amazon Cognito identity pool and uses them to invoke a Lambda function with an event that contains request data\. The function processes the request and returns a response to the front\-end\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-android\-role**\. - -The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -## Create the function - -The following example uses data to generate a string response\. - -**Note** -For sample code in other languages, see [Sample function code](with-android-create-package.md)\. - -**Example index\.js** - -``` -exports.handler = function(event, context, callback) { - console.log("Received event: ", event); - var data = { - "greetings": "Hello, " + event.firstName + " " + event.lastName + "." - }; - callback(null, data); -} -``` - -**To create the function** - -1. Copy the sample code into a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name AndroidBackendLambdaFunction \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::123456789012:role/lambda-android-role - ``` - -## Test the Lambda function - -Invoke the function manually using the sample event data\. - -**To test the Lambda function \(AWS CLI\)** - -1. Save the following sample event JSON in a file, `input.txt`\. - - ``` - { "firstName": "first-name", "lastName": "last-name" } - ``` - -1. Run the following `invoke` command: - - ``` - aws lambda invoke --function-name AndroidBackendLambdaFunction \ - --payload file://file-path/input.txt outputfile.txt - ``` - - The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -## Create an Amazon Cognito identity pool - -In this section, you create an Amazon Cognito identity pool\. The identity pool has two IAM roles\. You update the IAM role for unauthenticated users and grant permissions to run the `AndroidBackendLambdaFunction` Lambda function\. - -For more information about IAM roles, see [IAM roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) in the *IAM User Guide*\. For more information about Amazon Cognito services, see the [Amazon Cognito](https://aws.amazon.com/cognito/) product detail page\. - -**To create an identity pool** - -1. Open the [Amazon Cognito console](https://console.aws.amazon.com/cognito)\. - -1. Create a new identity pool called `JavaFunctionAndroidEventHandlerPool`\. Before you follow the procedure to create an identity pool, note the following: - + The identity pool you are creating must allow access to unauthenticated identities because our example mobile application does not require a user log in\. Therefore, make sure to select the **Enable access to unauthenticated identities** option\. - + Add the following statement to the permission policy associated with the unauthenticated identities\. - - ``` - { - "Effect": "Allow", - "Action": [ - "lambda:InvokeFunction" - ], - "Resource": [ - "arn:aws:lambda:us-east-1:123456789012:function:AndroidBackendLambdaFunction" - ] - } - ``` - - The resulting policy will be as follows: - - ``` - { - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "mobileanalytics:PutEvents", - "cognito-sync:*" - ], - "Resource":[ - "*" - ] - }, - { - "Effect":"Allow", - "Action":[ - "lambda:invokefunction" - ], - "Resource":[ - "arn:aws:lambda:us-east-1:account-id:function:AndroidBackendLambdaFunction" - ] - } - ] - } - ``` - - For instructions about how to create an identity pool, log in to the [Amazon Cognito console](https://console.aws.amazon.com/cognito/home) and follow the **New Identity Pool** wizard\. - -1. Note the identity pool ID\. You specify this ID in your mobile application you create in the next section\. The app uses this ID when it sends request to Amazon Cognito to request for temporary security credentials\. - -## Create an Android application - -Create a simple Android mobile application that generates events and invokes Lambda functions by passing the event data as parameters\. - -The following instructions have been verified using Android studio\. - -1. Create a new Android project called `AndroidEventGenerator` using the following configuration: - + Select the **Phone and Tablet** platform\. - + Choose **Blank Activity**\. - -1. In the build\.gradle \(`Module:app`\) file, add the following in the `dependencies` section: - - ``` - compile 'com.amazonaws:aws-android-sdk-core:2.2.+' - compile 'com.amazonaws:aws-android-sdk-lambda:2.2.+' - ``` - -1. Build the project so that the required dependencies are downloaded, as needed\. - -1. In the Android application manifest \(`AndroidManifest.xml`\), add the following permissions so that your application can connect to the Internet\. You can add them just before the `` end tag\. - - ``` - - - ``` - -1. In `MainActivity`, add the following imports: - - ``` - import com.amazonaws.mobileconnectors.lambdainvoker.*; - import com.amazonaws.auth.CognitoCachingCredentialsProvider; - import com.amazonaws.regions.Regions; - ``` - -1. In the `package` section, add the following two classes \(`RequestClass` and `ResponseClass`\)\. Note that the POJO is same as the POJO you created in your Lambda function in the preceding section\. - + `RequestClass`\. The instances of this class act as the POJO \(Plain Old Java Object\) for event data which consists of first and last name\. If you are using Java example for your Lambda function you created in the preceding section, this POJO is same as the POJO you created in your Lambda function code\. - - ``` - package com.example....lambdaeventgenerator; - public class RequestClass { - String firstName; - String lastName; - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public RequestClass(String firstName, String lastName) { - this.firstName = firstName; - this.lastName = lastName; - } - - public RequestClass() { - } - } - ``` - + `ResponseClass` - - ``` - package com.example....lambdaeventgenerator; - public class ResponseClass { - String greetings; - - public String getGreetings() { - return greetings; - } - - public void setGreetings(String greetings) { - this.greetings = greetings; - } - - public ResponseClass(String greetings) { - this.greetings = greetings; - } - - public ResponseClass() { - } - } - ``` - -1. In the same package, create interface called `MyInterface` for invoking the `AndroidBackendLambdaFunction` Lambda function\. - - ``` - package com.example.....lambdaeventgenerator; - import com.amazonaws.mobileconnectors.lambdainvoker.LambdaFunction; - public interface MyInterface { - - /** - * Invoke the Lambda function "AndroidBackendLambdaFunction". - * The function name is the method name. - */ - @LambdaFunction - ResponseClass AndroidBackendLambdaFunction(RequestClass request); - - } - ``` - - The `@LambdaFunction` annotation in the code maps the specific client method to the same\-name Lambda function\. - -1. To keep the application simple, we are going to add code to invoke the Lambda function in the `onCreate()` event handler\. In `MainActivity`, add the following code toward the end of the `onCreate()` code\. - - ``` - // Create an instance of CognitoCachingCredentialsProvider - CognitoCachingCredentialsProvider cognitoProvider = new CognitoCachingCredentialsProvider( - this.getApplicationContext(), "identity-pool-id", Regions.US_WEST_2); - - // Create LambdaInvokerFactory, to be used to instantiate the Lambda proxy. - LambdaInvokerFactory factory = new LambdaInvokerFactory(this.getApplicationContext(), - Regions.US_WEST_2, cognitoProvider); - - // Create the Lambda proxy object with a default Json data binder. - // You can provide your own data binder by implementing - // LambdaDataBinder. - final MyInterface myInterface = factory.build(MyInterface.class); - - RequestClass request = new RequestClass("John", "Doe"); - // The Lambda function invocation results in a network call. - // Make sure it is not called from the main thread. - new AsyncTask() { - @Override - protected ResponseClass doInBackground(RequestClass... params) { - // invoke "echo" method. In case it fails, it will throw a - // LambdaFunctionException. - try { - return myInterface.AndroidBackendLambdaFunction(params[0]); - } catch (LambdaFunctionException lfe) { - Log.e("Tag", "Failed to invoke echo", lfe); - return null; - } - } - - @Override - protected void onPostExecute(ResponseClass result) { - if (result == null) { - return; - } - - // Do a toast - Toast.makeText(MainActivity.this, result.getGreetings(), Toast.LENGTH_LONG).show(); - } - }.execute(request); - ``` - -1. Run the code and verify it as follows: - + The `Toast.makeText()` displays the response returned\. - + Verify that CloudWatch Logs shows the log created by the Lambda function\. It should show the event data \(first name and last name\)\. You can also verify this in the AWS Lambda console\. \ No newline at end of file diff --git a/doc_source/with-cloudtrail-create-package.md b/doc_source/with-cloudtrail-create-package.md deleted file mode 100644 index eced5b66..00000000 --- a/doc_source/with-cloudtrail-create-package.md +++ /dev/null @@ -1,91 +0,0 @@ -# Sample function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js](#with-cloudtrail-example-deployment-pkg-nodejs) - -## Node\.js - -The following example processes CloudTrail logs, and sends a notification when an Amazon SNS topic was created\. - -**Example index\.js** - -``` -var aws = require('aws-sdk'); -var zlib = require('zlib'); -var async = require('async'); - -var EVENT_SOURCE_TO_TRACK = /sns.amazonaws.com/; -var EVENT_NAME_TO_TRACK = /CreateTopic/; -var DEFAULT_SNS_REGION = 'us-west-2'; -var SNS_TOPIC_ARN = 'The ARN of your SNS topic'; - -var s3 = new aws.S3(); -var sns = new aws.SNS({ - apiVersion: '2010-03-31', - region: DEFAULT_SNS_REGION -}); - -exports.handler = function(event, context, callback) { - var srcBucket = event.Records[0].s3.bucket.name; - var srcKey = event.Records[0].s3.object.key; - - async.waterfall([ - function fetchLogFromS3(next){ - console.log('Fetching compressed log from S3...'); - s3.getObject({ - Bucket: srcBucket, - Key: srcKey - }, - next); - }, - function uncompressLog(response, next){ - console.log("Uncompressing log..."); - zlib.gunzip(response.Body, next); - }, - function publishNotifications(jsonBuffer, next) { - console.log('Filtering log...'); - var json = jsonBuffer.toString(); - console.log('CloudTrail JSON from S3:', json); - var records; - try { - records = JSON.parse(json); - } catch (err) { - next('Unable to parse CloudTrail JSON: ' + err); - return; - } - var matchingRecords = records - .Records - .filter(function(record) { - return record.eventSource.match(EVENT_SOURCE_TO_TRACK) - && record.eventName.match(EVENT_NAME_TO_TRACK); - }); - - console.log('Publishing ' + matchingRecords.length + ' notification(s) in parallel...'); - async.each( - matchingRecords, - function(record, publishComplete) { - console.log('Publishing notification: ', record); - sns.publish({ - Message: - 'Alert... SNS topic created: \n TopicARN=' + record.responseElements.topicArn + '\n\n' + - JSON.stringify(record), - TopicArn: SNS_TOPIC_ARN - }, publishComplete); - }, - next - ); - } - ], function (err) { - if (err) { - console.error('Failed to publish notifications: ', err); - } else { - console.log('Successfully published all notifications.'); - } - callback(null,"message"); - }); -}; -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. \ No newline at end of file diff --git a/doc_source/with-cloudtrail.md b/doc_source/with-cloudtrail.md deleted file mode 100644 index c65c5529..00000000 --- a/doc_source/with-cloudtrail.md +++ /dev/null @@ -1,84 +0,0 @@ -# Using AWS Lambda with AWS CloudTrail - -AWS CloudTrail is a service that provides a record of actions taken by a user, role, or an AWS service\. CloudTrail captures API calls as events\. For an ongoing record of events in your AWS account, you create a trail\. A trail enables CloudTrail to deliver log files of events to an Amazon S3 bucket\. - -You can take advantage of Amazon S3's bucket notification feature and direct Amazon S3 to publish object\-created events to AWS Lambda\. Whenever CloudTrail writes logs to your S3 bucket, Amazon S3 can then invoke your Lambda function by passing the Amazon S3 object\-created event as a parameter\. The S3 event provides information, including the bucket name and key name of the log object that CloudTrail created\. Your Lambda function code can read the log object and process the access records logged by CloudTrail\. For example, you might write Lambda function code to notify you if specific API call was made in your account\. - -In this scenario, CloudTrail writes access logs to your S3 bucket\. As for AWS Lambda, Amazon S3 is the event source so Amazon S3 publishes events to AWS Lambda and invokes your Lambda function\. - -**Example CloudTrail log** - -``` -{ - "Records":[ - { - "eventVersion":"1.02", - "userIdentity":{ - "type":"Root", - "principalId":"123456789012", - "arn":"arn:aws:iam::123456789012:root", - "accountId":"123456789012", - "accessKeyId":"access-key-id", - "sessionContext":{ - "attributes":{ - "mfaAuthenticated":"false", - "creationDate":"2015-01-24T22:41:54Z" - } - } - }, - "eventTime":"2015-01-24T23:26:50Z", - "eventSource":"sns.amazonaws.com", - "eventName":"CreateTopic", - "awsRegion":"us-east-2", - "sourceIPAddress":"205.251.233.176", - "userAgent":"console.amazonaws.com", - "requestParameters":{ - "name":"dropmeplease" - }, - "responseElements":{ - "topicArn":"arn:aws:sns:us-east-2:123456789012:exampletopic" - }, - "requestID":"3fdb7834-9079-557e-8ef2-350abc03536b", - "eventID":"17b46459-dada-4278-b8e2-5a4ca9ff1a9c", - "eventType":"AwsApiCall", - "recipientAccountId":"123456789012" - }, - { - "eventVersion":"1.02", - "userIdentity":{ - "type":"Root", - "principalId":"123456789012", - "arn":"arn:aws:iam::123456789012:root", - "accountId":"123456789012", - "accessKeyId": "AKIAIOSFODNN7EXAMPLE", - "sessionContext":{ - "attributes":{ - "mfaAuthenticated":"false", - "creationDate":"2015-01-24T22:41:54Z" - } - } - }, - "eventTime":"2015-01-24T23:27:02Z", - "eventSource":"sns.amazonaws.com", - "eventName":"GetTopicAttributes", - "awsRegion":"us-east-2", - "sourceIPAddress":"205.251.233.176", - "userAgent":"console.amazonaws.com", - "requestParameters":{ - "topicArn":"arn:aws:sns:us-east-2:123456789012:exampletopic" - }, - "responseElements":null, - "requestID":"4a0388f7-a0af-5df9-9587-c5c98c29cbec", - "eventID":"ec5bb073-8fa1-4d45-b03c-f07b9fc9ea18", - "eventType":"AwsApiCall", - "recipientAccountId":"123456789012" - } - ] -} -``` - -For detailed information about how to configure Amazon S3 as the event source, see [Using AWS Lambda with Amazon S3](with-s3.md)\. - -**Topics** -+ [Logging Lambda API calls with CloudTrail](logging-using-cloudtrail.md) -+ [Sample function code](with-cloudtrail-create-package.md) \ No newline at end of file diff --git a/doc_source/with-ddb-create-package.md b/doc_source/with-ddb-create-package.md deleted file mode 100644 index 2cf7e228..00000000 --- a/doc_source/with-ddb-create-package.md +++ /dev/null @@ -1,170 +0,0 @@ -# Sample function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js](#with-ddb-example-deployment-pkg-nodejs) -+ [Java 11](#with-ddb-example-deployment-pkg-java) -+ [C\#](#with-ddb-example-deployment-pkg-dotnet) -+ [Python 3](#with-ddb-example-deployment-pkg-python) -+ [Go](#with-ddb-example-deployment-pkg-go) - -## Node\.js - -The following example processes messages from DynamoDB, and logs their contents\. - -**Example ProcessDynamoDBStream\.js** - -``` -console.log('Loading function'); - -exports.lambda_handler = function(event, context, callback) { - console.log(JSON.stringify(event, null, 2)); - event.Records.forEach(function(record) { - console.log(record.eventID); - console.log(record.eventName); - console.log('DynamoDB Record: %j', record.dynamodb); - }); - callback(null, "message"); -}; -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Java 11 - -The following example processes messages from DynamoDB, and logs their contents\. `handleRequest` is the handler that AWS Lambda invokes and provides event data\. The handler uses the predefined `DynamodbEvent` class, which is defined in the `aws-lambda-java-events` library\. - -**Example DDBEventProcessor\.java** - -``` -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.LambdaLogger; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord; - -public class DDBEventProcessor implements - RequestHandler { - - public String handleRequest(DynamodbEvent ddbEvent, Context context) { - for (DynamodbStreamRecord record : ddbEvent.getRecords()){ - System.out.println(record.getEventID()); - System.out.println(record.getEventName()); - System.out.println(record.getDynamodb().toString()); - - } - return "Successfully processed " + ddbEvent.getRecords().size() + " records."; - } -} -``` - -If the handler returns normally without exceptions, Lambda considers the input batch of records as processed successfully and begins reading new records in the stream\. If the handler throws an exception, Lambda considers the input batch of records as not processed and invokes the function with the same batch of records again\. - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` - -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -## C\# - -The following example processes messages from DynamoDB, and logs their contents\. `ProcessDynamoEvent` is the handler that AWS Lambda invokes and provides event data\. The handler uses the predefined `DynamoDbEvent` class, which is defined in the `Amazon.Lambda.DynamoDBEvents` library\. - -**Example ProcessingDynamoDBStreams\.cs** - -``` -using System; -using System.IO; -using System.Text; -using Amazon.Lambda.Core; -using Amazon.Lambda.DynamoDBEvents; - -using Amazon.Lambda.Serialization.Json; - -namespace DynamoDBStreams -{ - public class DdbSample - { - private static readonly JsonSerializer _jsonSerializer = new JsonSerializer(); - - public void ProcessDynamoEvent(DynamoDBEvent dynamoEvent) - { - Console.WriteLine($"Beginning to process {dynamoEvent.Records.Count} records..."); - - foreach (var record in dynamoEvent.Records) - { - Console.WriteLine($"Event ID: {record.EventID}"); - Console.WriteLine($"Event Name: {record.EventName}"); - - string streamRecordJson = SerializeObject(record.Dynamodb); - Console.WriteLine($"DynamoDB Record:"); - Console.WriteLine(streamRecordJson); - } - - Console.WriteLine("Stream processing complete."); - } - - private string SerializeObject(object streamRecord) - { - using (var ms = new MemoryStream()) - { - _jsonSerializer.Serialize(streamRecord, ms); - return Encoding.UTF8.GetString(ms.ToArray()); - } - } - } -} -``` - -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - -## Python 3 - -The following example processes messages from DynamoDB, and logs their contents\. - -**Example ProcessDynamoDBStream\.py** - -``` -from __future__ import print_function - -def lambda_handler(event, context): - for record in event['Records']: - print(record['eventID']) - print(record['eventName']) - print('Successfully processed %s records.' % str(len(event['Records']))) -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. - -## Go - -The following example processes messages from DynamoDB, and logs their contents\. - -**Example** - -``` -import ( - "strings" - - "github.com/aws/aws-lambda-go/events" -) - -func handleRequest(ctx context.Context, e events.DynamoDBEvent) { - - for _, record := range e.Records { - fmt.Printf("Processing request data for event ID %s, type %s.\n", record.EventID, record.EventName) - - // Print new values for attributes of type String - for name, value := range record.Change.NewImage { - if value.DataType() == events.DataTypeString { - fmt.Printf("Attribute name: %s, value: %s\n", name, value.String()) - } - } - } -} -``` - -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/with-ddb-example.md b/doc_source/with-ddb-example.md deleted file mode 100644 index 43ede930..00000000 --- a/doc_source/with-ddb-example.md +++ /dev/null @@ -1,300 +0,0 @@ -# Tutorial: Using AWS Lambda with Amazon DynamoDB streams - - In this tutorial, you create a Lambda function to consume events from an Amazon DynamoDB stream\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – Lambda\. - + **Permissions** – **AWSLambdaDynamoDBExecutionRole**\. - + **Role name** – **lambda\-dynamodb\-role**\. - -The **AWSLambdaDynamoDBExecutionRole** has the permissions that the function needs to read items from DynamoDB and write logs to CloudWatch Logs\. - -## Create the function - -The following example code receives a DynamoDB event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Note** -For sample code in other languages, see [Sample function code](with-ddb-create-package.md)\. - -**Example index\.js** - -``` -console.log('Loading function'); - -exports.handler = function(event, context, callback) { - console.log(JSON.stringify(event, null, 2)); - event.Records.forEach(function(record) { - console.log(record.eventID); - console.log(record.eventName); - console.log('DynamoDB Record: %j', record.dynamodb); - }); - callback(null, "message"); -}; -``` - -**To create the function** - -1. Copy the sample code into a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name ProcessDynamoDBRecords \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::123456789012:role/lambda-dynamodb-role - ``` - -## Test the Lambda function - -In this step, you invoke your Lambda function manually using the `invoke` AWS Lambda CLI command and the following sample DynamoDB event\. - -**Example input\.txt** - -``` -{ - "Records":[ - { - "eventID":"1", - "eventName":"INSERT", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "NewImage":{ - "Message":{ - "S":"New item!" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"111", - "SizeBytes":26, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - }, - { - "eventID":"2", - "eventName":"MODIFY", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "NewImage":{ - "Message":{ - "S":"This item has changed" - }, - "Id":{ - "N":"101" - } - }, - "OldImage":{ - "Message":{ - "S":"New item!" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"222", - "SizeBytes":59, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - }, - { - "eventID":"3", - "eventName":"REMOVE", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "OldImage":{ - "Message":{ - "S":"This item has changed" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"333", - "SizeBytes":38, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - } - ] -} -``` - -Run the following `invoke` command\. - -``` -aws lambda invoke --function-name ProcessDynamoDBRecords --payload file://input.txt outputfile.txt -``` - -The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -The function returns the string `message` in the response body\. - -Verify the output in the `outputfile.txt` file\. - -## Create a DynamoDB table with a stream enabled - -Create an Amazon DynamoDB table with a stream enabled\. - -**To create a DynamoDB table** - -1. Open the [DynamoDB console](https://console.aws.amazon.com/dynamodb)\. - -1. Choose **Create table**\. - -1. Create a table with the following settings\. - + **Table name** – **lambda\-dynamodb\-stream** - + **Primary key** – **id** \(string\) - -1. Choose **Create**\. - -**To enable streams** - -1. Open the [DynamoDB console](https://console.aws.amazon.com/dynamodb)\. - -1. Choose **Tables**\. - -1. Choose the **lambda\-dynamodb\-stream** table\. - -1. Under **Exports and streams**, choose **DynamoDB stream details**\. - -1. Choose **Enable**\. - -1. Choose **Enable stream**\. - -Write down the stream ARN\. You need this in the next step when you associate the stream with your Lambda function\. For more information on enabling streams, see [Capturing table activity with DynamoDB Streams](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)\. - -## Add an event source in AWS Lambda - -Create an event source mapping in AWS Lambda\. This event source mapping associates the DynamoDB stream with your Lambda function\. After you create this event source mapping, AWS Lambda starts polling the stream\. - -Run the following AWS CLI `create-event-source-mapping` command\. After the command runs, note down the UUID\. You'll need this UUID to refer to the event source mapping in any commands, for example, when deleting the event source mapping\. - -``` -aws lambda create-event-source-mapping --function-name ProcessDynamoDBRecords \ - --batch-size 100 --starting-position LATEST --event-source DynamoDB-stream-arn -``` - - This creates a mapping between the specified DynamoDB stream and the Lambda function\. You can associate a DynamoDB stream with multiple Lambda functions, and associate the same Lambda function with multiple streams\. However, the Lambda functions will share the read throughput for the stream they share\. - -You can get the list of event source mappings by running the following command\. - -``` -aws lambda list-event-source-mappings -``` - -The list returns all of the event source mappings you created, and for each mapping it shows the `LastProcessingResult`, among other things\. This field is used to provide an informative message if there are any problems\. Values such as `No records processed` \(indicates that AWS Lambda has not started polling or that there are no records in the stream\) and `OK` \(indicates AWS Lambda successfully read records from the stream and invoked your Lambda function\) indicate that there are no issues\. If there are issues, you receive an error message\. - -If you have a lot of event source mappings, use the function name parameter to narrow down the results\. - -``` -aws lambda list-event-source-mappings --function-name ProcessDynamoDBRecords -``` - -## Test the setup - -Test the end\-to\-end experience\. As you perform table updates, DynamoDB writes event records to the stream\. As AWS Lambda polls the stream, it detects new records in the stream and invokes your Lambda function on your behalf by passing events to the function\. - -1. In the DynamoDB console, add, update, and delete items to the table\. DynamoDB writes records of these actions to the stream\. - -1. AWS Lambda polls the stream and when it detects updates to the stream, it invokes your Lambda function by passing in the event data it finds in the stream\. - -1. Your function runs and creates logs in Amazon CloudWatch\. You can verify the logs reported in the Amazon CloudWatch console\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the DynamoDB table** - -1. Open the [Tables page](https://console.aws.amazon.com/dynamodb/home#tables:) of the DynamoDB console\. - -1. Select the table you created\. - -1. Choose **Delete**\. - -1. Enter **delete** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-ddb.md b/doc_source/with-ddb.md deleted file mode 100644 index 2dd35ee6..00000000 --- a/doc_source/with-ddb.md +++ /dev/null @@ -1,633 +0,0 @@ -# Using AWS Lambda with Amazon DynamoDB - -You can use an AWS Lambda function to process records in an [Amazon DynamoDB stream](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html)\. With DynamoDB Streams, you can trigger a Lambda function to perform additional work each time a DynamoDB table is updated\. - -Lambda reads records from the stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. - -**Example DynamoDB Streams record event** - -``` -{ - "Records": [ - { - "eventID": "1", - "eventVersion": "1.0", - "dynamodb": { - "Keys": { - "Id": { - "N": "101" - } - }, - "NewImage": { - "Message": { - "S": "New item!" - }, - "Id": { - "N": "101" - } - }, - "StreamViewType": "NEW_AND_OLD_IMAGES", - "SequenceNumber": "111", - "SizeBytes": 26 - }, - "awsRegion": "us-west-2", - "eventName": "INSERT", - "eventSourceARN": "arn:aws:dynamodb:us-west-2:111122223333:table/TestTable/stream/2015-05-11T21:21:33.291", - "eventSource": "aws:dynamodb" - }, - { - "eventID": "2", - "eventVersion": "1.0", - "dynamodb": { - "OldImage": { - "Message": { - "S": "New item!" - }, - "Id": { - "N": "101" - } - }, - "SequenceNumber": "222", - "Keys": { - "Id": { - "N": "101" - } - }, - "SizeBytes": 59, - "NewImage": { - "Message": { - "S": "This item has changed" - }, - "Id": { - "N": "101" - } - }, - "StreamViewType": "NEW_AND_OLD_IMAGES" - }, - "awsRegion": "us-west-2", - "eventName": "MODIFY", - "eventSourceARN": "arn:aws:dynamodb:us-west-2:111122223333:table/TestTable/stream/2015-05-11T21:21:33.291", - "eventSource": "aws:dynamodb" - } - ]} -``` - -Lambda polls shards in your DynamoDB stream for records at a base rate of 4 times per second\. When records are available, Lambda invokes your function and waits for the result\. If processing succeeds, Lambda resumes polling until it receives more records\. - -By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. - -If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. - -You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the shard level\. - -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. - -**Topics** -+ [Execution role permissions](#events-dynamodb-permissions) -+ [Configuring a stream as an event source](#services-dynamodb-eventsourcemapping) -+ [Event source mapping APIs](#services-dynamodb-api) -+ [Error handling](#services-dynamodb-errors) -+ [Amazon CloudWatch metrics](#events-dynamodb-metrics) -+ [Time windows](#services-ddb-windows) -+ [Reporting batch item failures](#services-ddb-batchfailurereporting) -+ [Amazon DynamoDB Streams configuration parameters](#services-ddb-params) -+ [Tutorial: Using AWS Lambda with Amazon DynamoDB streams](with-ddb-example.md) -+ [Sample function code](with-ddb-create-package.md) -+ [AWS SAM template for a DynamoDB application](kinesis-tutorial-spec.md) - -## Execution role permissions - -Lambda needs the following permissions to manage resources related to your DynamoDB stream\. Add them to your function's execution role\. -+ [dynamodb:DescribeStream](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_DescribeStream.html) -+ [dynamodb:GetRecords](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html) -+ [dynamodb:GetShardIterator](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetShardIterator.html) -+ [dynamodb:ListStreams](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_ListStreams.html) - -The `AWSLambdaDynamoDBExecutionRole` managed policy includes these permissions\. For more information, see [Lambda execution role](lambda-intro-execution-role.md)\. - -To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: -+ **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) -+ **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - -## Configuring a stream as an event source - -Create an event source mapping to tell Lambda to send records from your stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple streams with a single function\. - -To configure your function to read from DynamoDB Streams in the Lambda console, create a **DynamoDB** trigger\. - -**To create a trigger** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Choose a trigger type\. - -1. Configure the required options, and then choose **Add**\. - -Lambda supports the following options for DynamoDB event sources\. - -**Event source options** -+ **DynamoDB table** – The DynamoDB table to read records from\. -+ **Batch size** – The number of records to send to the function in each batch, up to 10,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. -+ **Batch window** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. -+ **Starting position** – Process only new records, or all existing records\. - + **Latest** – Process new records that are added to the stream\. - + **Trim horizon** – Process all records in the stream\. - - After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. -+ **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. -+ **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. -+ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. Your original batch size setting remains unchanged\. -+ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. -+ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when the mapping is reenabled\. - -**Note** -You are not charged for GetRecords API calls invoked by Lambda as part of DynamoDB triggers\. - -To manage the event source configuration later, choose the trigger in the designer\. - -## Event source mapping APIs - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -The following example uses the AWS CLI to map a function named `my-function` to a DynamoDB stream that its Amazon Resource Name \(ARN\) specifies, with a batch size of 500\. - -``` -aws lambda create-event-source-mapping --function-name my-function --batch-size 500 --maximum-batching-window-in-seconds 5 --starting-position LATEST \ ---event-source-arn arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525 -``` - -You should see the following output: - -``` -{ - "UUID": "14e0db71-5d35-4eb5-b481-8945cf9d10c2", - "BatchSize": 500, - "MaximumBatchingWindowInSeconds": 5, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1560209851.963, - "LastProcessingResult": "No records processed", - "State": "Creating", - "StateTransitionReason": "User action", - "DestinationConfig": {}, - "MaximumRecordAgeInSeconds": 604800, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 10000 -} -``` - -Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. - -``` -aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ ---maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 ---destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' -``` - -You should see this output: - -``` -{ - "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", - "BatchSize": 100, - "MaximumBatchingWindowInSeconds": 0, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1573243620.0, - "LastProcessingResult": "PROBLEM: Function call failed", - "State": "Updating", - "StateTransitionReason": "User action", - "DestinationConfig": {}, - "MaximumRecordAgeInSeconds": 604800, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 10000 -} -``` - -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. - -``` -aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b -``` - -You should see this output: - -``` -{ - "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", - "BatchSize": 100, - "MaximumBatchingWindowInSeconds": 0, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:dynamodb:us-east-2:123456789012:table/my-table/stream/2019-06-10T19:26:16.525", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1573244760.0, - "LastProcessingResult": "PROBLEM: Function call failed", - "State": "Enabled", - "StateTransitionReason": "User action", - "DestinationConfig": { - "OnFailure": { - "Destination": "arn:aws:sqs:us-east-2:123456789012:dlq" - } - }, - "MaximumRecordAgeInSeconds": 3600, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 2 -} -``` - -To process multiple batches concurrently, use the `--parallelization-factor` option\. - -``` -aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ ---parallelization-factor 5 -``` - -## Error handling - -The event source mapping that reads records from your DynamoDB stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. - -If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. - -If the error handling measures fail, Lambda discards the records and continues processing batches from the stream\. With the default settings, this means that a bad record can block processing on the affected shard for up to one day\. To avoid this, configure your function's event source mapping with a reasonable number of retries and a maximum record age that fits your use case\. - -To retain a record of discarded batches, configure a failed\-event destination\. Lambda sends a document to the destination queue or topic with details about the batch\. - -**To configure a destination for failed\-event records** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Under **Function overview**, choose **Add destination**\. - -1. For **Source**, choose **Stream invocation**\. - -1. For **Stream**, choose a stream that is mapped to the function\. - -1. For **Destination type**, choose the type of resource that receives the invocation record\. - -1. For **Destination**, choose a resource\. - -1. Choose **Save**\. - -The following example shows an invocation record for a DynamoDB stream\. - -**Example Invocation Record** - -``` -{ - "requestContext": { - "requestId": "316aa6d0-8154-xmpl-9af7-85d5f4a6bc81", - "functionArn": "arn:aws:lambda:us-east-2:123456789012:function:myfunction", - "condition": "RetryAttemptsExhausted", - "approximateInvokeCount": 1 - }, - "responseContext": { - "statusCode": 200, - "executedVersion": "$LATEST", - "functionError": "Unhandled" - }, - "version": "1.0", - "timestamp": "2019-11-14T00:13:49.717Z", - "DDBStreamBatchInfo": { - "shardId": "shardId-00000001573689847184-864758bb", - "startSequenceNumber": "800000000003126276362", - "endSequenceNumber": "800000000003126276362", - "approximateArrivalOfFirstRecord": "2019-11-14T00:13:19Z", - "approximateArrivalOfLastRecord": "2019-11-14T00:13:19Z", - "batchSize": 1, - "streamArn": "arn:aws:dynamodb:us-east-2:123456789012:table/mytable/stream/2019-11-14T00:04:06.388" - } -} -``` - -You can use this information to retrieve the affected records from the stream for troubleshooting\. The actual records aren't included, so you must process this record and retrieve them from the stream before they expire and are lost\. - -## Amazon CloudWatch metrics - -Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. - -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -## Time windows - -Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. - -Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -Each record in a stream belongs to a specific window\. Lambda will process each record at least once, but doesn't guarantee that each record will be processed only once\. In rare cases, such as error handling, some records might be processed more than once\. Records are always processed in order the first time\. If records are processed more than once, they might be processed out of order\. - -### Aggregation and processing - -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: - -**Example `TimeWindowEventResponse` values** - -``` -{ - "state": { - "1": 282, - "2": 715 - }, - "batchItemFailures": [] -} -``` - -**Note** -For Java functions, we recommend using a `Map` to represent the state\. - -At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. - -At the end of your window, Lambda uses final processing for actions on the aggregation results\. Your final processing is synchronously invoked\. After successful invocation, your function checkpoints the sequence number and stream processing continues\. If invocation is unsuccessful, your Lambda function suspends further processing until a successful invocation\. - -**Example DynamodbTimeWindowEvent** - -``` -{ - "Records":[ - { - "eventID":"1", - "eventName":"INSERT", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "NewImage":{ - "Message":{ - "S":"New item!" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"111", - "SizeBytes":26, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - }, - { - "eventID":"2", - "eventName":"MODIFY", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "NewImage":{ - "Message":{ - "S":"This item has changed" - }, - "Id":{ - "N":"101" - } - }, - "OldImage":{ - "Message":{ - "S":"New item!" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"222", - "SizeBytes":59, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - }, - { - "eventID":"3", - "eventName":"REMOVE", - "eventVersion":"1.0", - "eventSource":"aws:dynamodb", - "awsRegion":"us-east-1", - "dynamodb":{ - "Keys":{ - "Id":{ - "N":"101" - } - }, - "OldImage":{ - "Message":{ - "S":"This item has changed" - }, - "Id":{ - "N":"101" - } - }, - "SequenceNumber":"333", - "SizeBytes":38, - "StreamViewType":"NEW_AND_OLD_IMAGES" - }, - "eventSourceARN":"stream-ARN" - } - ], - "window": { - "start": "2020-07-30T17:00:00Z", - "end": "2020-07-30T17:05:00Z" - }, - "state": { - "1": "state1" - }, - "shardId": "shard123456789", - "eventSourceARN": "stream-ARN", - "isFinalInvokeForWindow": false, - "isWindowTerminatedEarly": false -} -``` - -### Configuration - -You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 -``` - -Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. - -Tumbling window aggregations do not support resharding\. When the shard ends, Lambda considers the window closed, and the child shards start their own window in a fresh state\. - -Tumbling windows fully support the existing retry policies `maxRetryAttempts` and `maxRecordAge`\. - -**Example Handler\.py – Aggregation and processing** -The following Python function demonstrates how to aggregate and then process your final state: - -``` -def lambda_handler(event, context): - print('Incoming event: ', event) - print('Incoming state: ', event['state']) - -#Check if this is the end of the window to either aggregate or process. - if event['isFinalInvokeForWindow']: - # logic to handle final state of the window - print('Destination invoke') - else: - print('Aggregate invoke') - -#Check for early terminations - if event['isWindowTerminatedEarly']: - print('Window terminated early') - - #Aggregation logic - state = event['state'] - for record in event['Records']: - state[record['dynamodb']['NewImage']['Id']] = state.get(record['dynamodb']['NewImage']['Id'], 0) + 1 - - print('Returning state: ', state) - return {'state': state} -``` - -## Reporting batch item failures - -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. - -To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. - -### Report syntax - -When configuring reporting on batch item failures, the `StreamsEventResponse` class is returned with a list of batch item failures\. You can use a `StreamsEventResponse` object to return the sequence number of the first failed record in the batch\. You can also create your own custom class using the correct response syntax\. The following JSON structure shows the required response syntax: - -``` -{ - "batchItemFailures": [ - { - "itemIdentifier": "" - } - ] -} -``` - -**Note** -If the `batchItemFailures` array contains multiple items, Lambda uses the record with the lowest sequence number as the checkpoint\. Lambda then retries all records starting from that checkpoint\. - -### Success and failure conditions - -Lambda treats a batch as a complete success if you return any of the following: -+ An empty `batchItemFailure` list -+ A null `batchItemFailure` list -+ An empty `EventResponse` -+ A null `EventResponse` - -Lambda treats a batch as a complete failure if you return any of the following: -+ An empty string `itemIdentifier` -+ A null `itemIdentifier` -+ An `itemIdentifier` with a bad key name - -Lambda retries failures based on your retry strategy\. - -### Bisecting a batch - -If your invocation fails and `BisectBatchOnFunctionError` is turned on, the batch is bisected regardless of your `ReportBatchItemFailures` setting\. - -When a partial batch success response is received and both `BisectBatchOnFunctionError` and `ReportBatchItemFailures` are turned on, the batch is bisected at the returned sequence number and Lambda retries only the remaining records\. - ------- -#### [ Java ] - -**Example Handler\.java – return new StreamsEventResponse\(\)** - -``` -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.DynamodbEvent; -import com.amazonaws.services.lambda.runtime.events.StreamsEventResponse; -import com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class ProcessDynamodbRecords implements RequestHandler { - - @Override - public StreamsEventResponse handleRequest(DynamodbEvent input, Context context) { - - List batchItemFailures = new ArrayList<>(); - String curRecordSequenceNumber = ""; - - for (DynamodbEvent.DynamodbStreamRecord dynamodbStreamRecord : input.getRecords()) { - try { - //Process your record - StreamRecord dynamodbRecord = dynamodbStreamRecord.getDynamodb(); - curRecordSequenceNumber = dynamodbRecord.getSequenceNumber(); - - } catch (Exception e) { - /* Since we are working with streams, we can return the failed item immediately. - Lambda will immediately begin to retry processing from this failed item onwards. */ - batchItemFailures.add(new StreamsEventResponse.BatchItemFailure(curRecordSequenceNumber)); - return new StreamsEventResponse(batchItemFailures); - } - } - - return new StreamsEventResponse(); - } -} -``` - ------- -#### [ Python ] - -**Example Handler\.py – return batchItemFailures\[\]** - -``` -def handler(event, context): - records = event.get("Records") - curRecordSequenceNumber = ""; - - for record in records: - try: - # Process your record - curRecordSequenceNumber = record["dynamodb"]["SequenceNumber"] - except Exception as e: - # Return failed record's sequence number - return {"batchItemFailures":[{"itemIdentifier": curRecordSequenceNumber}]} - - return {"batchItemFailures":[]} -``` - ------- - -## Amazon DynamoDB Streams configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to DynamoDB Streams\. - - -**Event source parameters that apply to DynamoDB Streams** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10,000 | -| BisectBatchOnFunctionError | N | false | | -| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | -| Enabled | N | true | | -| EventSourceArn | Y | | ARN of the data stream or a stream consumer | -| FunctionName | Y | | | -| MaximumBatchingWindowInSeconds | N | 0 | | -| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | -| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 604800 | -| ParallelizationFactor | N | 1 | Maximum: 10 | -| StartingPosition | Y | | TRIM\_HORIZON or LATEST | -| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-kafka.md b/doc_source/with-kafka.md deleted file mode 100644 index b3fc8bf2..00000000 --- a/doc_source/with-kafka.md +++ /dev/null @@ -1,488 +0,0 @@ -# Using Lambda with self\-managed Apache Kafka - -Lambda supports [Apache Kafka](https://kafka.apache.org/) as an [event source](invocation-eventsourcemapping.md)\. Apache Kafka is a an open\-source event streaming platform that supports workloads such as data pipelines and streaming analytics\. - -You can use the AWS managed Kafka service Amazon Managed Streaming for Apache Kafka \(Amazon MSK\), or a self\-managed Kafka cluster\. For details about using Lambda with Amazon MSK, see [Using Lambda with Amazon MSK](with-msk.md)\. - -This topic describes how to use Lambda with a self\-managed Kafka cluster\. In AWS terminology, a self\-managed cluster includes non\-AWS hosted Kafka clusters\. For example, you can host your Kafka cluster with a cloud provider such as [CloudKarafka](https://www.cloudkarafka.com/)\. You can also use other AWS hosting options for your cluster\. For more information, see [Best Practices for Running Apache Kafka on AWS](http://aws.amazon.com/blogs/big-data/best-practices-for-running-apache-kafka-on-aws/) on the AWS Big Data Blog\. - -Apache Kafka as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) - -For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. - -For an example of how to use self\-managed Kafka as an event source, see [Using self\-hosted Apache Kafka as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-self-hosted-apache-kafka-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. - -Lambda sends the batch of messages in the event parameter when it invokes your Lambda function\. The event payload contains an array of messages\. Each array item contains details of the Kafka topic and Kafka partition identifier, together with a timestamp and a base64\-encoded message\. - -``` -{ - "eventSource": "SelfManagedKafka", - "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", - "records":{ - "mytopic-0":[ - { - "topic":"mytopic", - "partition":0, - "offset":15, - "timestamp":1545084650987, - "timestampType":"CREATE_TIME", - "key":"abcDEFghiJKLmnoPQRstuVWXyz1234==", - "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - "headers":[ - { - "headerKey":[ - 104, - 101, - 97, - 100, - 101, - 114, - 86, - 97, - 108, - 117, - 101 - ] - } - ] - } - ] - } -} -``` - -**Topics** -+ [Kafka cluster authentication](#smaa-authentication) -+ [Managing API access and permissions](#smaa-permissions) -+ [Authentication and authorization errors](#kafka-permissions-errors) -+ [Network configuration](#services-kafka-vpc-config) -+ [Adding a Kafka cluster as an event source](#services-smaa-topic-add) -+ [Using a Kafka cluster as an event source](#kafka-using-cluster) -+ [Auto scaling of the Kafka event source](#services-kafka-scaling) -+ [Event source API operations](#kafka-hosting-api-operations) -+ [Event source mapping errors](#services-event-errors) -+ [Amazon CloudWatch metrics](#services-kafka-metrics) -+ [Self\-managed Apache Kafka configuration parameters](#services-kafka-parms) - -## Kafka cluster authentication - -Lambda supports several methods to authenticate with your self\-managed Apache Kafka cluster\. Make sure that you configure the Kafka cluster to use one of these supported authentication methods\. For more information about Kafka security, see the [Security](http://kafka.apache.org/documentation.html#security) section of the Kafka documentation\. - -### VPC access - -If only Kafka users within your VPC access your Kafka brokers, you must configure the Kafka event source for Amazon Virtual Private Cloud \(Amazon VPC\) access\. - -### SASL/SCRAM authentication - -Lambda supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. Lambda sends the encrypted credentials to authenticate with the cluster\. For more information about SASL/SCRAM authentication, see [RFC 5802](https://tools.ietf.org/html/rfc5802)\. - -Lambda supports SASL/PLAIN authentication with TLS encryption\. With SASL/PLAIN authentication, Lambda sends credentials as clear text \(unencrypted\) to the server\. - -For SASL authentication, you store the user name and password as a secret in AWS Secrets Manager\. For more information about using Secrets Manager, see [Tutorial: Create and retrieve a secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html) in the *AWS Secrets Manager User Guide*\. - -### Mutual TLS authentication - -Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. - -In self\-managed Apache Kafka, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with your Kafka brokers\. The client certificate must be signed by a CA in the server's trust store\. - -The Kafka cluster sends a server certificate to Lambda to authenticate the Kafka brokers with Lambda\. The server certificate can be a public CA certificate or a private CA/self\-signed certificate\. The public CA certificate must be signed by a certificate authority \(CA\) that's in the Lambda trust store\. For a private CA/self\-signed certificate, you configure the server root CA certificate \(as a secret in Secrets Manager\)\. Lambda uses the root certificate to verify the Kafka brokers\. - -For more information about mTLS, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. - -### Configuring the client certificate secret - -The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. - -**Note** -Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. - -The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: - -``` ------BEGIN CERTIFICATE----- - ------END CERTIFICATE----- -``` - -Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. - -The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: - -``` ------BEGIN PRIVATE KEY----- - ------END PRIVATE KEY----- -``` - -For an encrypted private key, use the following structure: - -``` ------BEGIN ENCRYPTED PRIVATE KEY----- - ------END ENCRYPTED PRIVATE KEY----- -``` - -The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, include the private key password in the secret\. - -``` -{ - "privateKeyPassword": "testpassword", - "certificate": "-----BEGIN CERTIFICATE----- -MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw -... -j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk -cmUuiAii9R0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb -... -rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no -c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== ------END CERTIFICATE-----", - "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- -MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp -... -QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ -zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== ------END ENCRYPTED PRIVATE KEY-----" -} -``` - -### Configuring the server root CA certificate secret - -You create this secret if your Kafka brokers use TLS encryption with certificates signed by a private CA\. You can use TLS encryption for VPC, SASL/SCRAM, SASL/PLAIN, or mTLS authentication\. - -The server root CA certificate secret requires a field that contains the Kafka broker's root CA certificate in PEM format\. The following example shows the structure of the secret\. - -``` -{ - "certificate": "-----BEGIN CERTIFICATE----- - MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx - EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT - HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs - ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dG... - -----END CERTIFICATE-----" -``` - -## Managing API access and permissions - -In addition to accessing your self\-managed Kafka cluster, your Lambda function needs permissions to perform various API actions\. You add these permissions to the function's [execution role](lambda-intro-execution-role.md)\. If your users need access to any API actions, add the required permissions to the identity policy for the AWS Identity and Access Management \(IAM\) user or role\. - -### Required Lambda function permissions - -To create and store logs in a log group in Amazon CloudWatch Logs, your Lambda function must have the following permissions in its execution role: -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -### Optional Lambda function permissions - -Your Lambda function might also need permissions to: -+ Describe your Secrets Manager secret\. -+ Access your AWS Key Management Service \(AWS KMS\) customer managed key\. -+ Access your Amazon VPC\. - -#### Secrets Manager and AWS KMS permissions - -Depending on the type of access control that you're configuring for your Kafka brokers, your Lambda function might need permission to access your Secrets Manager secret or to decrypt your AWS KMS customer managed key\. To access these resources, your function's execution role must have the following permissions: -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [kms:Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) - -#### VPC permissions - -If only users within a VPC can access your self\-managed Apache Kafka cluster, your Lambda function must have permission to access your Amazon VPC resources\. These resources include your VPC, subnets, security groups, and network interfaces\. To access these resources, your function's execution role must have the following permissions: -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) - -### Adding permissions to your execution role - -To access other AWS services that your self\-managed Apache Kafka cluster uses, Lambda uses the permissions policies that you define in your Lambda function's [execution role](lambda-intro-execution-role.md)\. - -By default, Lambda is not permitted to perform the required or optional actions for a self\-managed Apache Kafka cluster\. You must create and define these actions in an [IAM trust policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#term_trust-policy), and then attach the policy to your execution role\. This example shows how you might create a policy that allows Lambda to access your Amazon VPC resources\. - -``` -{ - "Version":"2012-10-17", - "Statement":[ - { - "Effect":"Allow", - "Action":[ - "ec2:CreateNetworkInterface", - "ec2:DescribeNetworkInterfaces", - "ec2:DescribeVpcs", - "ec2:DeleteNetworkInterface", - "ec2:DescribeSubnets", - "ec2:DescribeSecurityGroups" - ], - "Resource":"*" - } - ] - } -``` - -For information about creating a JSON policy document in the IAM console, see [Creating policies on the JSON tab](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) in the *IAM User Guide*\. - -### Granting users access with an IAM policy - -By default, IAM users and roles don't have permission to perform [event source API operations](#kafka-hosting-api-operations)\. To grant access to users in your organization or account, you create or update an identity\-based policy\. For more information, see [Controlling access to AWS resources using policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_controlling.html) in the *IAM User Guide*\. - -## Authentication and authorization errors - -If any of the permissions required to consume data from the Kafka cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. - -**Topics** -+ [Cluster failed to authorize Lambda](#kafka-authorize-errors) -+ [SASL authentication failed](#kafka-sasl-errors) -+ [Server failed to authenticate Lambda](#kafka-mtls-errors-server) -+ [Lambda failed to authenticate server](#kafka-mtls-errors-lambda) -+ [Provided certificate or private key is invalid](#kafka-key-errors) - -### Cluster failed to authorize Lambda - -For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: -+ DescribeConfigs Cluster -+ Describe Group -+ Read Group -+ Describe Topic -+ Read Topic - -When you create Kafka ACLs with the required `kafka-cluster` permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. - -After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. - -### SASL authentication failed - -For SASL/SCRAM or SASL/PLAIN, this error indicates that the provided user name and password aren't valid\. - -### Server failed to authenticate Lambda - -This error indicates that the Kafka broker failed to authenticate Lambda\. This can occur for any of the following reasons: -+ You didn't provide a client certificate for mTLS authentication\. -+ You provided a client certificate, but the Kafka brokers aren't configured to use mTLS authentication\. -+ A client certificate isn't trusted by the Kafka brokers\. - -### Lambda failed to authenticate server - -This error indicates that Lambda failed to authenticate the Kafka broker\. This can occur for any of the following reasons: -+ The Kafka brokers use self\-signed certificates or a private CA, but didn't provide the server root CA certificate\. -+ The server root CA certificate doesn't match the root CA that signed the broker's certificate\. -+ Hostname validation failed because the broker's certificate doesn't contain the broker's DNS name or IP address as a subject alternative name\. - -### Provided certificate or private key is invalid - -This error indicates that the Kafka consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. - -## Network configuration - -If you configure Amazon VPC access to your Kafka brokers, Lambda must have access to the Amazon VPC resources associated with your Kafka cluster\. We recommend that you deploy AWS PrivateLink [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/endpoint-services-overview.html) for Lambda and AWS Security Token Service \(AWS STS\)\. If the broker uses authentication, also deploy a VPC endpoint for Secrets Manager\. - -Alternatively, ensure that the VPC associated with your Kafka cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -Configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. -+ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Kafka broker port for the security groups specified for your event source\. Kafka uses port 9092 by default\. -+ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. - -For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. - -## Adding a Kafka cluster as an event source - -To create an [event source mapping](invocation-eventsourcemapping.md), add your Kafka cluster as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. - -This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. - -### Prerequisites -+ A self\-managed Apache Kafka cluster\. Lambda supports Apache Kafka version 0\.10\.0\.0 and later\. -+ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your self\-managed Kafka cluster uses\. - -### Customizable consumer group ID - -When setting up Kafka as an event source, you can specify a consumer group ID\. This consumer group ID is an existing identifier for the Kafka consumer group that you want your Lambda function to join\. You can use this feature to seamlessly migrate any ongoing Kafka record processing setups from other consumers to Lambda\. - -If you specify a consumer group ID and there are other active pollers within that consumer group, Kafka distributes messages across all consumers\. In other words, Lambda doesn't receive all message for the Kafka topic\. If you want Lambda to handle all messages in the topic, turn off any other pollers in that consumer group\. - -Additionally, if you specify a consumer group ID, and Kafka finds a valid existing consumer group with the same ID, Lambda ignores the `StartingPosition` parameter for your event source mapping\. Instead, Lambda begins processing records according to the committed offset of the consumer group\. If you specify a consumer group ID, and Kafka cannot find an existing consumer group, then Lambda configures your event source with the specified `StartingPosition`\. - -The consumer group ID that you specify must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. - -### Adding a self\-managed Kafka cluster \(console\) - -Follow these steps to add your self\-managed Apache Kafka cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an Apache Kafka trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, do the following: - - 1. Choose the **Apache Kafka** trigger type\. - - 1. For **Bootstrap servers**, enter the host and port pair address of a Kafka broker in your cluster, and then choose **Add**\. Repeat for each Kafka broker in the cluster\. - - 1. For **Topic name**, enter the name of the Kafka topic used to store records in the cluster\. - - 1. \(Optional\) For **Batch size**, enter the maximum number of records to receive in a single batch\. - - 1. For **Batch window**, enter the maximum amount of seconds that Lambda spends gathering records before invoking the function\. - - 1. \(Optional\) For **Consumer group ID**, enter the ID of a Kafka consumer group to join\. - - 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - - 1. \(Optional\) For **VPC**, choose the Amazon VPC for your Kafka cluster\. Then, choose the **VPC subnets** and **VPC security groups**\. - - This setting is required if only users within your VPC access your brokers\. - - - - 1. \(Optional\) For **Authentication**, choose **Add**, and then do the following: - - 1. Choose the access or authentication protocol of the Kafka brokers in your cluster\. - + If your Kafka broker uses SASL plaintext authentication, choose **BASIC\_AUTH**\. - + If your broker uses SASL/SCRAM authentication, choose one of the **SASL\_SCRAM** protocols\. - + If you're configuring mTLS authentication, choose the **CLIENT\_CERTIFICATE\_TLS\_AUTH** protocol\. - - 1. For SASL/SCRAM or mTLS authentication, choose the Secrets Manager secret key that contains the credentials for your Kafka cluster\. - - 1. \(Optional\) For **Encryption**, choose the Secrets Manager secret containing the root CA certificate that your Kafka brokers use for TLS encryption, if your Kafka brokers use certificates signed by a private CA\. - - This setting applies to TLS encryption for SASL/SCRAM or SASL/PLAIN, and to mTLS authentication\. - - 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. - -1. To create the trigger, choose **Add**\. - -### Adding a self\-managed Kafka cluster \(AWS CLI\) - -Use the following example AWS CLI commands to create and view a self\-managed Apache Kafka trigger for your Lambda function\. - -#### Using SASL/SCRAM - -If Kafka users access your Kafka brokers over the internet, specify the Secrets Manager secret that you created for SASL/SCRAM authentication\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping --topics AWSKafkaTopic - --source-access-configuration Type=SASL_SCRAM_512_AUTH,URI=arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName - --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function - --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. - -#### Using a VPC - -If only Kafka users within your VPC access your Kafka brokers, you must specify your VPC, subnets, and VPC security group\. The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. - -``` -aws lambda create-event-source-mapping - --topics AWSKafkaTopic - --source-access-configuration '[{"Type": "VPC_SUBNET", "URI": "subnet:subnet-0011001100"}, - {"Type": "VPC_SUBNET", "URI": "subnet:subnet-0022002200"}, - {"Type": "VPC_SECURITY_GROUP", "URI": "security_group:sg-0123456789"}]' - --function-name arn:aws:lambda:us-east-1:01234567890:function:my-kafka-function - --self-managed-event-source '{"Endpoints":{"KAFKA_BOOTSTRAP_SERVERS":["abc3.xyz.com:9092", - "abc2.xyz.com:9092"]}}' -``` - -For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. - -#### Viewing the status using the AWS CLI - -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping - --uuid dh38738e-992b-343a-1077-3478934hjkfd7 -``` - -## Using a Kafka cluster as an event source - -When you add your Apache Kafka cluster as a trigger for your Lambda function, the cluster is used as an [event source](invocation-eventsourcemapping.md)\. - -Lambda reads event data from the Kafka topics that you specify as `Topics` in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, based on the `StartingPosition` that you specify\. After successful processing, your Kafka topic is committed to your Kafka cluster\. - -If you specify the `StartingPosition` as `LATEST`, Lambda starts reading from the latest message in each partition belonging to the topic\. Because there can be some delay after trigger configuration before Lambda starts reading the messages, Lambda doesn't read any messages produced during this window\. - -Lambda processes records from one or more Kafka topic partitions that you specify and sends a JSON payload to your function\. When more records are available, Lambda continues processing records in batches, based on the `BatchSize` value that you specify in a [CreateEventSourceMapping](API_CreateEventSourceMapping.md) request, until your function catches up with the topic\. - -If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. - -**Note** -While Lambda functions typically have a maximum timeout limit of 15 minutes, event source mappings for Amazon MSK, self\-managed Apache Kafka, and Amazon MQ for ActiveMQ and RabbitMQ only support functions with maximum timeout limits of 14 minutes\. This constraint ensures that the event source mapping can properly handle function errors and retries\. - -## Auto scaling of the Kafka event source - -When you initially create an an Apache Kafka [event source](invocation-eventsourcemapping.md), Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. - -In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. - -If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. - -To monitor the throughput of your Kafka topic, you can view the Apache Kafka consumer metrics, such as `consumer_lag` and `consumer_offset`\. To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. - -## Event source API operations - -When you add your Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function using the Lambda console, an AWS SDK, or the AWS CLI, Lambda uses APIs to process your request\. - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -## Event source mapping errors - -When you add your Apache Kafka cluster as an [event source](invocation-eventsourcemapping.md) for your Lambda function, if your function encounters an error, your Kafka consumer stops processing records\. Consumers of a topic partition are those that subscribe to, read, and process your records\. Your other Kafka consumers can continue processing records, provided they don't encounter the same error\. - -To determine the cause of a stopped consumer, check the `StateTransitionReason` field in the response of `EventSourceMapping`\. The following list describes the event source errors that you can receive: - -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration isn't valid\. - -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda couldn't authenticate the event source\. - -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda doesn't have the required permissions to access the event source\. - -**`FUNCTION_CONFIG_NOT_VALID`** -The function configuration isn't valid\. - -**Note** -If your Lambda event records exceed the allowed size limit of 6 MB, they can go unprocessed\. - -## Amazon CloudWatch metrics - -Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic and the last record that your function's consumer group processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your consumer group processes it\. - -An increasing trend in `OffsetLag` can indicate issues with pollers in your function's consumer group\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -## Self\-managed Apache Kafka configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Apache Kafka\. - - -**Event source parameters that apply to self\-managed Apache Kafka** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10,000 | -| Enabled | N | Enabled | | -| FunctionName | Y | | | -| FilterCriteria | N | | [Lambda event filtering](invocation-eventfiltering.md) | -| MaximumBatchingWindowInSeconds | N | 500 ms | [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching) | -| SelfManagedEventSource | Y | | List of Kafka Brokers\. Can set only on Create | -| SelfManagedKafkaEventSourceConfig | N | Contains the ConsumerGroupId field which defaults to a unique value\. | Can set only on Create | -| SourceAccessConfigurations | N | No credentials | VPC information or authentication credentials for the cluster For SASL\_PLAIN, set to BASIC\_AUTH | -| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | -| Topics | Y | | Topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-kinesis-create-package.md b/doc_source/with-kinesis-create-package.md deleted file mode 100644 index 09ee9978..00000000 --- a/doc_source/with-kinesis-create-package.md +++ /dev/null @@ -1,166 +0,0 @@ -# Sample function code - -To process events from Amazon Kinesis, iterate through the records included in the event object and decode the Base64\-encoded data included in each\. - -**Note** -The code on this page does not support [aggregated records](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-kpl-concepts.html#kinesis-kpl-concepts-aggretation)\. You can disable aggregation in the Kinesis Producer Library [configuration](https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-kpl-config.html), or use the [Kinesis Record Aggregation library](https://github.com/awslabs/kinesis-aggregation) to deaggregate records\. - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js 12\.x](#with-kinesis-example-deployment-pkg-nodejs) -+ [Java 11](#with-kinesis-example-deployment-pkg-java) -+ [C\#](#with-kinesis-example-deployment-pkg-dotnet) -+ [Python 3](#with-kinesis-example-deployment-pkg-python) -+ [Go](#with-kinesis-example-deployment-pkg-go) - -## Node\.js 12\.x - -The following example code receives a Kinesis event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Example index\.js** - -``` -console.log('Loading function'); - -exports.handler = function(event, context) { - //console.log(JSON.stringify(event, null, 2)); - event.Records.forEach(function(record) { - // Kinesis data is base64 encoded so decode here - var payload = Buffer.from(record.kinesis.data, 'base64').toString('ascii'); - console.log('Decoded payload:', payload); - }); -}; -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Java 11 - -The following is example Java code that receives Kinesis event record data as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -In the code, `recordHandler` is the handler\. The handler uses the predefined `KinesisEvent` class that is defined in the `aws-lambda-java-events` library\. - -**Example ProcessKinesisEvents\.java** - -``` -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.KinesisEvent; -import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord; - -public class ProcessKinesisRecords implements RequestHandler{ - @Override - public Void handleRequest(KinesisEvent event, Context context) - { - for(KinesisEventRecord rec : event.getRecords()) { - System.out.println(new String(rec.getKinesis().getData().array())); - } - return null; - } -} -``` - -If the handler returns normally without exceptions, Lambda considers the input batch of records as processed successfully and begins reading new records in the stream\. If the handler throws an exception, Lambda considers the input batch of records as not processed and invokes the function with the same batch of records again\. - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` -+ `aws-java-sdk` - -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -## C\# - -The following is example C\# code that receives Kinesis event record data as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - - In the code, `HandleKinesisRecord` is the handler\. The handler uses the predefined `KinesisEvent` class that is defined in the `Amazon.Lambda.KinesisEvents` library\. - -**Example ProcessingKinesisEvents\.cs** - -``` -using System; -using System.IO; -using System.Text; - -using Amazon.Lambda.Core; -using Amazon.Lambda.KinesisEvents; - -namespace KinesisStreams -{ - public class KinesisSample - { - [LambdaSerializer(typeof(JsonSerializer))] - public void HandleKinesisRecord(KinesisEvent kinesisEvent) - { - Console.WriteLine($"Beginning to process {kinesisEvent.Records.Count} records..."); - - foreach (var record in kinesisEvent.Records) - { - Console.WriteLine($"Event ID: {record.EventId}"); - Console.WriteLine($"Event Name: {record.EventName}"); - - string recordData = GetRecordContents(record.Kinesis); - Console.WriteLine($"Record Data:"); - Console.WriteLine(recordData); - } - Console.WriteLine("Stream processing complete."); - } - - private string GetRecordContents(KinesisEvent.Record streamRecord) - { - using (var reader = new StreamReader(streamRecord.Data, Encoding.ASCII)) - { - return reader.ReadToEnd(); - } - } - } -} -``` -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - -## Python 3 - - The following is example Python code that receives Kinesis event record data as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. - -**Example ProcessKinesisRecords\.py** - -``` -from __future__ import print_function -#import json -import base64 -def lambda_handler(event, context): - for record in event['Records']: - #Kinesis data is base64 encoded so decode here - payload=base64.b64decode(record["kinesis"]["data"]) - print("Decoded payload: " + str(payload)) -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. - -## Go - - The following is example Go code that receives Kinesis event record data as input and processes it\. For illustration, the code writes to some of the incoming event data to CloudWatch Logs\. - -**Example ProcessKinesisRecords\.go** - -``` -import ( - "strings" - "github.com/aws/aws-lambda-go/events" -) - -func handler(ctx context.Context, kinesisEvent events.KinesisEvent) { - for _, record := range kinesisEvent.Records { - kinesisRecord := record.Kinesis - dataBytes := kinesisRecord.Data - dataText := string(dataBytes) - - fmt.Printf("%s Data = %s \n", record.EventName, dataText) - } -} -``` - -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. \ No newline at end of file diff --git a/doc_source/with-kinesis-example-use-app-spec.md b/doc_source/with-kinesis-example-use-app-spec.md deleted file mode 100644 index 1118ec5e..00000000 --- a/doc_source/with-kinesis-example-use-app-spec.md +++ /dev/null @@ -1,86 +0,0 @@ -# AWS SAM template for a Kinesis application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-kinesis-example.md)\. The function and handler in the template are for the Node\.js code\. If you use a different code sample, update the values accordingly\. - -**Example template\.yaml \- Kinesis stream** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Resources: - LambdaFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - Timeout: 10 - Tracing: Active - Events: - Stream: - Type: Kinesis - Properties: - Stream: !GetAtt stream.Arn - BatchSize: 100 - StartingPosition: LATEST - stream: - Type: AWS::Kinesis::Stream - Properties: - ShardCount: 1 -Outputs: - FunctionName: - Description: "Function name" - Value: !Ref LambdaFunction - StreamARN: - Description: "Stream ARN" - Value: !GetAtt stream.Arn -``` - -The template creates a Lambda function, a Kinesis stream, and an event source mapping\. The event source mapping reads from the stream and invokes the function\. - -To use an [HTTP/2 stream consumer](with-kinesis.md#services-kinesis-configure), create the consumer in the template and configure the event source mapping to read from the consumer instead of from the stream\. - -**Example template\.yaml \- Kinesis stream consumer** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: A function that processes data from a Kinesis stream. -Resources: - function: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - Timeout: 10 - Tracing: Active - Events: - Stream: - Type: Kinesis - Properties: - Stream: !GetAtt streamConsumer.ConsumerARN - StartingPosition: LATEST - BatchSize: 100 - stream: - Type: "AWS::Kinesis::Stream" - Properties: - ShardCount: 1 - streamConsumer: - Type: "AWS::Kinesis::StreamConsumer" - Properties: - StreamARN: !GetAtt stream.Arn - ConsumerName: "TestConsumer" -Outputs: - FunctionName: - Description: "Function name" - Value: !Ref function - StreamARN: - Description: "Stream ARN" - Value: !GetAtt stream.Arn - ConsumerARN: - Description: "Stream consumer ARN" - Value: !GetAtt streamConsumer.ConsumerARN -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/with-kinesis-example.md b/doc_source/with-kinesis-example.md deleted file mode 100644 index 5b849b21..00000000 --- a/doc_source/with-kinesis-example.md +++ /dev/null @@ -1,245 +0,0 @@ -# Tutorial: Using AWS Lambda with Amazon Kinesis - -In this tutorial, you create a Lambda function to consume events from a Kinesis stream\. - -1. Custom app writes records to the stream\. - -1. AWS Lambda polls the stream and, when it detects new records in the stream, invokes your Lambda function\. - -1. AWS Lambda runs the Lambda function by assuming the execution role you specified at the time you created the Lambda function\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaKinesisExecutionRole**\. - + **Role name** – **lambda\-kinesis\-role**\. - -The **AWSLambdaKinesisExecutionRole** policy has the permissions that the function needs to read items from Kinesis and write logs to CloudWatch Logs\. - -## Create the function - -The following example code receives a Kinesis event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Note** -For sample code in other languages, see [Sample function code](with-kinesis-create-package.md)\. - -**Example index\.js** - -``` -console.log('Loading function'); - -exports.handler = function(event, context) { - //console.log(JSON.stringify(event, null, 2)); - event.Records.forEach(function(record) { - // Kinesis data is base64 encoded so decode here - var payload = Buffer.from(record.kinesis.data, 'base64').toString('ascii'); - console.log('Decoded payload:', payload); - }); -}; -``` - -**To create the function** - -1. Copy the sample code into a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name ProcessKinesisRecords \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::123456789012:role/lambda-kinesis-role - ``` - -## Test the Lambda function - -Invoke your Lambda function manually using the `invoke` AWS Lambda CLI command and a sample Kinesis event\. - -**To test the Lambda function** - -1. Copy the following JSON into a file and save it as `input.txt`\. - - ``` - { - "Records": [ - { - "kinesis": { - "kinesisSchemaVersion": "1.0", - "partitionKey": "1", - "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", - "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - "approximateArrivalTimestamp": 1545084650.987 - }, - "eventSource": "aws:kinesis", - "eventVersion": "1.0", - "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", - "eventName": "aws:kinesis:record", - "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-kinesis-role", - "awsRegion": "us-east-2", - "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" - } - ] - } - ``` - -1. Use the `invoke` command to send the event to the function\. - - ``` - aws lambda invoke --function-name ProcessKinesisRecords --payload file://input.txt out.txt - ``` - - The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - - The response is saved to `out.txt`\. - -## Create a Kinesis stream - -Use the `create-stream ` command to create a stream\. - -``` -aws kinesis create-stream --stream-name lambda-stream --shard-count 1 -``` - -Run the following `describe-stream` command to get the stream ARN\. - -``` -aws kinesis describe-stream --stream-name lambda-stream -``` - -You should see the following output: - -``` -{ - "StreamDescription": { - "Shards": [ - { - "ShardId": "shardId-000000000000", - "HashKeyRange": { - "StartingHashKey": "0", - "EndingHashKey": "340282366920746074317682119384634633455" - }, - "SequenceNumberRange": { - "StartingSequenceNumber": "49591073947768692513481539594623130411957558361251844610" - } - } - ], - "StreamARN": "arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream", - "StreamName": "lambda-stream", - "StreamStatus": "ACTIVE", - "RetentionPeriodHours": 24, - "EnhancedMonitoring": [ - { - "ShardLevelMetrics": [] - } - ], - "EncryptionType": "NONE", - "KeyId": null, - "StreamCreationTimestamp": 1544828156.0 - } -} -``` - -You use the stream ARN in the next step to associate the stream with your Lambda function\. - -## Add an event source in AWS Lambda - -Run the following AWS CLI `add-event-source` command\. - -``` -aws lambda create-event-source-mapping --function-name ProcessKinesisRecords \ ---event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream \ ---batch-size 100 --starting-position LATEST -``` - -Note the mapping ID for later use\. You can get a list of event source mappings by running the `list-event-source-mappings` command\. - -``` -aws lambda list-event-source-mappings --function-name ProcessKinesisRecords \ ---event-source arn:aws:kinesis:us-west-2:123456789012:stream/lambda-stream -``` - -In the response, you can verify the status value is `enabled`\. Event source mappings can be disabled to pause polling temporarily without losing any records\. - -## Test the setup - -To test the event source mapping, add event records to your Kinesis stream\. The `--data` value is a string that the CLI encodes to base64 prior to sending it to Kinesis\. You can run the same command more than once to add multiple records to the stream\. - -``` -aws kinesis put-record --stream-name lambda-stream --partition-key 1 \ ---data "Hello, this is a test." -``` - -Lambda uses the execution role to read records from the stream\. Then it invokes your Lambda function, passing in batches of records\. The function decodes data from each record and logs it, sending the output to CloudWatch Logs\. View the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the Kinesis stream** - -1. Sign in to the AWS Management Console and open the Kinesis console at [https://console\.aws\.amazon\.com/kinesis](https://console.aws.amazon.com/kinesis)\. - -1. Select the stream you created\. - -1. Choose **Actions**, **Delete**\. - -1. Enter **delete** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-kinesis.md b/doc_source/with-kinesis.md deleted file mode 100644 index d0d9270e..00000000 --- a/doc_source/with-kinesis.md +++ /dev/null @@ -1,582 +0,0 @@ -# Using AWS Lambda with Amazon Kinesis - -You can use an AWS Lambda function to process records in an [Amazon Kinesis data stream](https://docs.aws.amazon.com/kinesis/latest/dev/amazon-kinesis-streams.html)\. - -A Kinesis data stream is a set of [shards](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#shard)\. Each shard contains a sequence of data records\. A **consumer** is an application that processes the data from a Kinesis data stream\. You can map a Lambda function to a shared\-throughput consumer \(standard iterator\), or to a dedicated\-throughput consumer with [enhanced fan\-out](https://docs.aws.amazon.com/kinesis/latest/dev/enhanced-consumers.html)\. - -For standard iterators, Lambda polls each shard in your Kinesis stream for records using HTTP protocol\. The event source mapping shares read throughput with other consumers of the shard\. - -To minimize latency and maximize read throughput, you can create a data stream consumer with enhanced fan\-out\. Stream consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. The dedicated throughput can help if you have many applications reading the same data, or if you're reprocessing a stream with large records\. Kinesis pushes records to Lambda over HTTP/2\. - - For details about Kinesis data streams, see [Reading Data from Amazon Kinesis Data Streams](https://docs.aws.amazon.com/kinesis/latest/dev/building-consumers.html)\. - -Lambda reads records from the data stream and invokes your function [synchronously](invocation-sync.md) with an event that contains stream records\. Lambda reads records in batches and invokes your function to process records from the batch\. Each batch contains records from a single shard/data stream\. - -**Example Kinesis record event** - -``` -{ - "Records": [ - { - "kinesis": { - "kinesisSchemaVersion": "1.0", - "partitionKey": "1", - "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", - "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - "approximateArrivalTimestamp": 1545084650.987 - }, - "eventSource": "aws:kinesis", - "eventVersion": "1.0", - "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", - "eventName": "aws:kinesis:record", - "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", - "awsRegion": "us-east-2", - "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" - }, - { - "kinesis": { - "kinesisSchemaVersion": "1.0", - "partitionKey": "1", - "sequenceNumber": "49590338271490256608559692540925702759324208523137515618", - "data": "VGhpcyBpcyBvbmx5IGEgdGVzdC4=", - "approximateArrivalTimestamp": 1545084711.166 - }, - "eventSource": "aws:kinesis", - "eventVersion": "1.0", - "eventID": "shardId-000000000006:49590338271490256608559692540925702759324208523137515618", - "eventName": "aws:kinesis:record", - "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-role", - "awsRegion": "us-east-2", - "eventSourceARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream" - } - ] -} -``` - -By default, Lambda invokes your function as soon as records are available\. If the batch that Lambda reads from the event source has only one record in it, Lambda sends only one record to the function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a *batching window*\. Before invoking the function, Lambda continues to read records from the event source until it has gathered a full batch, the batching window expires, or the batch reaches the payload limit of 6 MB\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. - -If your function returns an error, Lambda retries the batch until processing succeeds or the data expires\. To avoid stalled shards, you can configure the event source mapping to retry with a smaller batch size, limit the number of retries, or discard records that are too old\. To retain discarded events, you can configure the event source mapping to send details about failed batches to an SQS queue or SNS topic\. - -You can also increase concurrency by processing multiple batches from each shard in parallel\. Lambda can process up to 10 batches in each shard simultaneously\. If you increase the number of concurrent batches per shard, Lambda still ensures in\-order processing at the shard level\. - -Configure the `ParallelizationFactor` setting to process one shard of a Kinesis or DynamoDB data stream with more than one Lambda invocation simultaneously\. You can specify the number of concurrent batches that Lambda polls from a shard via a parallelization factor from 1 \(default\) to 10\. For example, when you set `ParallelizationFactor` to 2, you can have 200 concurrent Lambda invocations at maximum to process 100 Kinesis data shards\. This helps scale up the processing throughput when the data volume is volatile and the `IteratorAge` is high\. Note that parallelization factor will not work if you are using Kinesis aggregation\. For more information, see [New AWS Lambda scaling controls for Kinesis and DynamoDB event sources](http://aws.amazon.com/blogs/compute/new-aws-lambda-scaling-controls-for-kinesis-and-dynamodb-event-sources/)\. Also, see the [Serverless Data Processing on AWS](https://data-processing.serverlessworkshops.io/) workshop for complete tutorials\. - -**Topics** -+ [Configuring your data stream and function](#services-kinesis-configure) -+ [Execution role permissions](#events-kinesis-permissions) -+ [Configuring a stream as an event source](#services-kinesis-eventsourcemapping) -+ [Event source mapping API](#services-kinesis-api) -+ [Error handling](#services-kinesis-errors) -+ [Amazon CloudWatch metrics](#events-kinesis-metrics) -+ [Time windows](#services-kinesis-windows) -+ [Reporting batch item failures](#services-kinesis-batchfailurereporting) -+ [Amazon Kinesis configuration parameters](#services-kinesis-params) -+ [Tutorial: Using AWS Lambda with Amazon Kinesis](with-kinesis-example.md) -+ [Sample function code](with-kinesis-create-package.md) -+ [AWS SAM template for a Kinesis application](with-kinesis-example-use-app-spec.md) - -## Configuring your data stream and function - -Your Lambda function is a consumer application for your data stream\. It processes one batch of records at a time from each shard\. You can map a Lambda function to a data stream \(standard iterator\), or to a consumer of a stream \([enhanced fan\-out](https://docs.aws.amazon.com/kinesis/latest/dev/enhanced-consumers.html)\)\. - -For standard iterators, Lambda polls each shard in your Kinesis stream for records at a base rate of once per second\. When more records are available, Lambda keeps processing batches until the function catches up with the stream\. The event source mapping shares read throughput with other consumers of the shard\. - -To minimize latency and maximize read throughput, create a data stream consumer with enhanced fan\-out\. Enhanced fan\-out consumers get a dedicated connection to each shard that doesn't impact other applications reading from the stream\. Stream consumers use HTTP/2 to reduce latency by pushing records to Lambda over a long\-lived connection and by compressing request headers\. You can create a stream consumer with the Kinesis [RegisterStreamConsumer](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html) API\. - -``` -aws kinesis register-stream-consumer --consumer-name con1 \ ---stream-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream -``` - -You should see the following output: - -``` -{ - "Consumer": { - "ConsumerName": "con1", - "ConsumerARN": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream/consumer/con1:1540591608", - "ConsumerStatus": "CREATING", - "ConsumerCreationTimestamp": 1540591608.0 - } -} -``` - -To increase the speed at which your function processes records, add shards to your data stream\. Lambda processes records in each shard in order\. It stops processing additional records in a shard if your function returns an error\. With more shards, there are more batches being processed at once, which lowers the impact of errors on concurrency\. - -If your function can't scale up to handle the total number of concurrent batches, [request a quota increase](gettingstarted-limits.md) or [reserve concurrency](configuration-concurrency.md) for your function\. - -## Execution role permissions - -Lambda needs the following permissions to manage resources that are related to your Kinesis data stream\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. -+ [kinesis:DescribeStream](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStream.html) -+ [kinesis:DescribeStreamSummary](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStreamSummary.html) -+ [kinesis:GetRecords](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) -+ [kinesis:GetShardIterator](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html) -+ [kinesis:ListShards](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListShards.html) -+ [kinesis:ListStreams](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreams.html) -+ [kinesis:SubscribeToShard](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_SubscribeToShard.html) - -The `AWSLambdaKinesisExecutionRole` managed policy includes these permissions\. For more information, see [Lambda execution role](lambda-intro-execution-role.md)\. - -To send records of failed batches to an SQS queue or SNS topic, your function needs additional permissions\. Each destination service requires a different permission, as follows: -+ **Amazon SQS** – [sqs:SendMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) -+ **Amazon SNS** – [sns:Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - -## Configuring a stream as an event source - -Create an event source mapping to tell Lambda to send records from your data stream to a Lambda function\. You can create multiple event source mappings to process the same data with multiple Lambda functions, or to process items from multiple data streams with a single function\. When processing items from multiple data streams, each batch will only contain records from a single shard/stream\. - -To configure your function to read from Kinesis in the Lambda console, create a **Kinesis** trigger\. - -**To create a trigger** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Choose a trigger type\. - -1. Configure the required options, and then choose **Add**\. - -Lambda supports the following options for Kinesis event sources\. - -**Event source options** -+ **Kinesis stream** – The Kinesis stream to read records from\. -+ **Consumer** \(optional\) – Use a stream consumer to read from the stream over a dedicated connection\. -+ **Batch size** – The number of records to send to the function in each batch, up to 10,000\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [payload limit](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. -+ **Batch window** – Specify the maximum amount of time to gather records before invoking the function, in seconds\. -+ **Starting position** – Process only new records, all existing records, or records created after a certain date\. - + **Latest** – Process new records that are added to the stream\. - + **Trim horizon** – Process all records in the stream\. - + **At timestamp** – Process records starting from a specific time\. - - After processing any existing records, the function is caught up and continues to process new records\. -+ **On\-failure destination** – An SQS queue or SNS topic for records that can't be processed\. When Lambda discards a batch of records that's too old or has exhausted all retries, Lambda sends details about the batch to the queue or topic\. -+ **Retry attempts** – The maximum number of times that Lambda retries when the function returns an error\. This doesn't apply to service errors or throttles where the batch didn't reach the function\. -+ **Maximum age of record** – The maximum age of a record that Lambda sends to your function\. -+ **Split batch on error** – When the function returns an error, split the batch into two before retrying\. Your original batch size setting remains unchanged\. -+ **Concurrent batches per shard** – Concurrently process multiple batches from the same shard\. -+ **Enabled** – Set to true to enable the event source mapping\. Set to false to stop processing records\. Lambda keeps track of the last record processed and resumes processing from that point when it's reenabled\. - -**Note** -Kinesis charges for each shard and, for enhanced fan\-out, data read from the stream\. For pricing details, see [Amazon Kinesis pricing](https://aws.amazon.com/kinesis/data-streams/pricing)\. - -To manage the event source configuration later, choose the trigger in the designer\. - -## Event source mapping API - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -To create the event source mapping with the AWS CLI, use the `create-event-source-mapping` command\. The following example uses the AWS CLI to map a function named `my-function` to a Kinesis data stream\. The data stream is specified by an Amazon Resource Name \(ARN\), with a batch size of 500, starting from the timestamp in Unix time\. - -``` -aws lambda create-event-source-mapping --function-name my-function \ ---batch-size 500 --starting-position AT_TIMESTAMP --starting-position-timestamp 1541139109 \ ---event-source-arn arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream -``` - -You should see the following output: - -``` -{ - "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", - "BatchSize": 500, - "MaximumBatchingWindowInSeconds": 0, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1541139209.351, - "LastProcessingResult": "No records processed", - "State": "Creating", - "StateTransitionReason": "User action", - "DestinationConfig": {}, - "MaximumRecordAgeInSeconds": 604800, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 10000 -} -``` - -To use a consumer, specify the consumer's ARN instead of the stream's ARN\. - -Configure additional options to customize how batches are processed and to specify when to discard records that can't be processed\. The following example updates an event source mapping to send a failure record to an SQS queue after two retry attempts, or if the records are more than an hour old\. - -``` -aws lambda update-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b \ ---maximum-retry-attempts 2 --maximum-record-age-in-seconds 3600 ---destination-config '{"OnFailure": {"Destination": "arn:aws:sqs:us-east-2:123456789012:dlq"}}' -``` - -You should see this output: - -``` -{ - "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", - "BatchSize": 100, - "MaximumBatchingWindowInSeconds": 0, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1573243620.0, - "LastProcessingResult": "PROBLEM: Function call failed", - "State": "Updating", - "StateTransitionReason": "User action", - "DestinationConfig": {}, - "MaximumRecordAgeInSeconds": 604800, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 10000 -} -``` - -Updated settings are applied asynchronously and aren't reflected in the output until the process completes\. Use the `get-event-source-mapping` command to view the current status\. - -``` -aws lambda get-event-source-mapping --uuid f89f8514-cdd9-4602-9e1f-01a5b77d449b -``` - -You should see this output: - -``` -{ - "UUID": "f89f8514-cdd9-4602-9e1f-01a5b77d449b", - "BatchSize": 100, - "MaximumBatchingWindowInSeconds": 0, - "ParallelizationFactor": 1, - "EventSourceArn": "arn:aws:kinesis:us-east-2:123456789012:stream/lambda-stream", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1573244760.0, - "LastProcessingResult": "PROBLEM: Function call failed", - "State": "Enabled", - "StateTransitionReason": "User action", - "DestinationConfig": { - "OnFailure": { - "Destination": "arn:aws:sqs:us-east-2:123456789012:dlq" - } - }, - "MaximumRecordAgeInSeconds": 3600, - "BisectBatchOnFunctionError": false, - "MaximumRetryAttempts": 2 -} -``` - -To process multiple batches concurrently, use the `--parallelization-factor` option\. - -``` -aws lambda update-event-source-mapping --uuid 2b733gdc-8ac3-cdf5-af3a-1827b3b11284 \ ---parallelization-factor 5 -``` - -## Error handling - -The event source mapping that reads records from your Kinesis stream, invokes your function synchronously, and retries on errors\. If Lambda throttles the function or returns an error without invoking the function, Lambda retries until the records expire or exceed the maximum age that you configure on the event source mapping\. - -If the function receives the records but returns an error, Lambda retries until the records in the batch expire, exceed the maximum age, or reach the configured retry quota\. For function errors, you can also configure the event source mapping to split a failed batch into two batches\. Retrying with smaller batches isolates bad records and works around timeout issues\. Splitting a batch does not count towards the retry quota\. - -If the error handling measures fail, Lambda discards the records and continues processing batches from the stream\. With the default settings, this means that a bad record can block processing on the affected shard for up to one week\. To avoid this, configure your function's event source mapping with a reasonable number of retries and a maximum record age that fits your use case\. - -To retain a record of discarded batches, configure a failed\-event destination\. Lambda sends a document to the destination queue or topic with details about the batch\. - -**To configure a destination for failed\-event records** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose a function\. - -1. Under **Function overview**, choose **Add destination**\. - -1. For **Source**, choose **Stream invocation**\. - -1. For **Stream**, choose a stream that is mapped to the function\. - -1. For **Destination type**, choose the type of resource that receives the invocation record\. - -1. For **Destination**, choose a resource\. - -1. Choose **Save**\. - -The following example shows an invocation record for a Kinesis stream\. - -**Example invocation record** - -``` -{ - "requestContext": { - "requestId": "c9b8fa9f-5a7f-xmpl-af9c-0c604cde93a5", - "functionArn": "arn:aws:lambda:us-east-2:123456789012:function:myfunction", - "condition": "RetryAttemptsExhausted", - "approximateInvokeCount": 1 - }, - "responseContext": { - "statusCode": 200, - "executedVersion": "$LATEST", - "functionError": "Unhandled" - }, - "version": "1.0", - "timestamp": "2019-11-14T00:38:06.021Z", - "KinesisBatchInfo": { - "shardId": "shardId-000000000001", - "startSequenceNumber": "49601189658422359378836298521827638475320189012309704722", - "endSequenceNumber": "49601189658422359378836298522902373528957594348623495186", - "approximateArrivalOfFirstRecord": "2019-11-14T00:38:04.835Z", - "approximateArrivalOfLastRecord": "2019-11-14T00:38:05.580Z", - "batchSize": 500, - "streamArn": "arn:aws:kinesis:us-east-2:123456789012:stream/mystream" - } -} -``` - -You can use this information to retrieve the affected records from the stream for troubleshooting\. The actual records aren't included, so you must process this record and retrieve them from the stream before they expire and are lost\. - -## Amazon CloudWatch metrics - -Lambda emits the `IteratorAge` metric when your function finishes processing a batch of records\. The metric indicates how old the last record in the batch was when processing finished\. If your function is processing new events, you can use the iterator age to estimate the latency between when a record is added and when the function processes it\. - -An increasing trend in iterator age can indicate issues with your function\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -## Time windows - -Lambda functions can run continuous stream processing applications\. A stream represents unbounded data that flows continuously through your application\. To analyze information from this continuously updating input, you can bound the included records using a window defined in terms of time\. - -Tumbling windows are distinct time windows that open and close at regular intervals\. By default, Lambda invocations are stateless—you cannot use them for processing data across multiple continuous invocations without an external database\. However, with tumbling windows, you can maintain your state across invocations\. This state contains the aggregate result of the messages previously processed for the current window\. Your state can be a maximum of 1 MB per shard\. If it exceeds that size, Lambda terminates the window early\. - -Each record in a stream belongs to a specific window\. Lambda will process each record at least once, but doesn't guarantee that each record will be processed only once\. In rare cases, such as error handling, some records might be processed more than once\. Records are always processed in order the first time\. If records are processed more than once, they might be processed out of order\. - -### Aggregation and processing - -Your user managed function is invoked both for aggregation and for processing the final results of that aggregation\. Lambda aggregates all records received in the window\. You can receive these records in multiple batches, each as a separate invocation\. Each invocation receives a state\. Thus, when using tumbling windows, your Lambda function response must contain a `state` property\. If the response does not contain a `state` property, Lambda considers this a failed invocation\. To satisfy this condition, your function can return a `TimeWindowEventResponse` object, which has the following JSON shape: - -**Example `TimeWindowEventResponse` values** - -``` -{ - "state": { - "1": 282, - "2": 715 - }, - "batchItemFailures": [] -} -``` - -**Note** -For Java functions, we recommend using a `Map` to represent the state\. - -At the end of the window, the flag `isFinalInvokeForWindow` is set to `true` to indicate that this is the final state and that it’s ready for processing\. After processing, the window completes and your final invocation completes, and then the state is dropped\. - -At the end of your window, Lambda uses final processing for actions on the aggregation results\. Your final processing is synchronously invoked\. After successful invocation, your function checkpoints the sequence number and stream processing continues\. If invocation is unsuccessful, your Lambda function suspends further processing until a successful invocation\. - -**Example KinesisTimeWindowEvent** - -``` -{ - "Records": [ - { - "kinesis": { - "kinesisSchemaVersion": "1.0", - "partitionKey": "1", - "sequenceNumber": "49590338271490256608559692538361571095921575989136588898", - "data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - "approximateArrivalTimestamp": 1607497475.000 - }, - "eventSource": "aws:kinesis", - "eventVersion": "1.0", - "eventID": "shardId-000000000006:49590338271490256608559692538361571095921575989136588898", - "eventName": "aws:kinesis:record", - "invokeIdentityArn": "arn:aws:iam::123456789012:role/lambda-kinesis-role", - "awsRegion": "us-east-1", - "eventSourceARN": "arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream" - } - ], - "window": { - "start": "2020-12-09T07:04:00Z", - "end": "2020-12-09T07:06:00Z" - }, - "state": { - "1": 282, - "2": 715 - }, - "shardId": "shardId-000000000006", - "eventSourceARN": "arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream", - "isFinalInvokeForWindow": false, - "isWindowTerminatedEarly": false -} -``` - -### Configuration - -You can configure tumbling windows when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. To configure a tumbling window, specify the window in seconds\. The following example AWS Command Line Interface \(AWS CLI\) command creates a streaming event source mapping that has a tumbling window of 120 seconds\. The Lambda function defined for aggregation and processing is named `tumbling-window-example-function`\. - -``` -aws lambda create-event-source-mapping --event-source-arn arn:aws:kinesis:us-east-1:123456789012:stream/lambda-stream --function-name "arn:aws:lambda:us-east-1:123456789018:function:tumbling-window-example-function" --region us-east-1 --starting-position TRIM_HORIZON --tumbling-window-in-seconds 120 -``` - -Lambda determines tumbling window boundaries based on the time when records were inserted into the stream\. All records have an approximate timestamp available that Lambda uses in boundary determinations\. - -Tumbling window aggregations do not support resharding\. When the shard ends, Lambda considers the window closed, and the child shards start their own window in a fresh state\. - -Tumbling windows fully support the existing retry policies `maxRetryAttempts` and `maxRecordAge`\. - -**Example Handler\.py – Aggregation and processing** -The following Python function demonstrates how to aggregate and then process your final state: - -``` -def lambda_handler(event, context): - print('Incoming event: ', event) - print('Incoming state: ', event['state']) - -#Check if this is the end of the window to either aggregate or process. - if event['isFinalInvokeForWindow']: - # logic to handle final state of the window - print('Destination invoke') - else: - print('Aggregate invoke') - -#Check for early terminations - if event['isWindowTerminatedEarly']: - print('Window terminated early') - - #Aggregation logic - state = event['state'] - for record in event['Records']: - state[record['kinesis']['partitionKey']] = state.get(record['kinesis']['partitionKey'], 0) + 1 - - print('Returning state: ', state) - return {'state': state} -``` - -## Reporting batch item failures - -When consuming and processing streaming data from an event source, by default Lambda checkpoints to the highest sequence number of a batch only when the batch is a complete success\. Lambda treats all other results as a complete failure and retries processing the batch up to the retry limit\. To allow for partial successes while processing batches from a stream, turn on `ReportBatchItemFailures`\. Allowing partial successes can help to reduce the number of retries on a record, though it doesn’t entirely prevent the possibility of retries in a successful record\. - -To turn on `ReportBatchItemFailures`, include the enum value **ReportBatchItemFailures** in the `FunctionResponseTypes` list\. This list indicates which response types are enabled for your function\. You can configure this list when you create or update an [event source mapping](invocation-eventsourcemapping.md)\. - -### Report syntax - -When configuring reporting on batch item failures, the `StreamsEventResponse` class is returned with a list of batch item failures\. You can use a `StreamsEventResponse` object to return the sequence number of the first failed record in the batch\. You can also create your own custom class using the correct response syntax\. The following JSON structure shows the required response syntax: - -``` -{ - "batchItemFailures": [ - { - "itemIdentifier": "" - } - ] -} -``` - -**Note** -If the `batchItemFailures` array contains multiple items, Lambda uses the record with the lowest sequence number as the checkpoint\. Lambda then retries all records starting from that checkpoint\. - -### Success and failure conditions - -Lambda treats a batch as a complete success if you return any of the following: -+ An empty `batchItemFailure` list -+ A null `batchItemFailure` list -+ An empty `EventResponse` -+ A null `EventResponse` - -Lambda treats a batch as a complete failure if you return any of the following: -+ An empty string `itemIdentifier` -+ A null `itemIdentifier` -+ An `itemIdentifier` with a bad key name - -Lambda retries failures based on your retry strategy\. - -### Bisecting a batch - -If your invocation fails and `BisectBatchOnFunctionError` is turned on, the batch is bisected regardless of your `ReportBatchItemFailures` setting\. - -When a partial batch success response is received and both `BisectBatchOnFunctionError` and `ReportBatchItemFailures` are turned on, the batch is bisected at the returned sequence number and Lambda retries only the remaining records\. - ------- -#### [ Java ] - -**Example Handler\.java – return new StreamsEventResponse\(\)** - -``` -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.KinesisEvent; -import com.amazonaws.services.lambda.runtime.events.StreamsEventResponse; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class ProcessKinesisRecords implements RequestHandler { - - @Override - public StreamsEventResponse handleRequest(KinesisEvent input, Context context) { - - List batchItemFailures = new ArrayList<>(); - String curRecordSequenceNumber = ""; - - for (KinesisEvent.KinesisEventRecord kinesisEventRecord : input.getRecords()) { - try { - //Process your record - KinesisEvent.Record kinesisRecord = kinesisEventRecord.getKinesis(); - curRecordSequenceNumber = kinesisRecord.getSequenceNumber(); - - } catch (Exception e) { - /* Since we are working with streams, we can return the failed item immediately. - Lambda will immediately begin to retry processing from this failed item onwards. */ - batchItemFailures.add(new StreamsEventResponse.BatchItemFailure(curRecordSequenceNumber)); - return new StreamsEventResponse(batchItemFailures); - } - } - - return new StreamsEventResponse(batchItemFailures); - } -} -``` - ------- -#### [ Python ] - -**Example Handler\.py – return batchItemFailures\[\]** - -``` -def handler(event, context): - records = event.get("Records") - curRecordSequenceNumber = "" - - for record in records: - try: - # Process your record - curRecordSequenceNumber = record["kinesis"]["sequenceNumber"] - except Exception as e: - # Return failed record's sequence number - return {"batchItemFailures":[{"itemIdentifier": curRecordSequenceNumber}]} - - return {"batchItemFailures":[]} -``` - ------- - -## Amazon Kinesis configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Kinesis\. - - -**Event source parameters that apply to Kinesis** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10,000 | -| BisectBatchOnFunctionError | N | false | | -| DestinationConfig | N | | Amazon SQS queue or Amazon SNS topic destination for discarded records | -| Enabled | N | true | | -| EventSourceArn | Y | | ARN of the data stream or a stream consumer | -| FunctionName | Y | | | -| MaximumBatchingWindowInSeconds | N | 0 | | -| MaximumRecordAgeInSeconds | N | \-1 | \-1 means infinite: Lambda doesn't discard records Minimum: \-1 Maximum: 604,800 | -| MaximumRetryAttempts | N | \-1 | \-1 means infinite: failed records are retried until the record expires Minimum: \-1 Maximum: 10,000 | -| ParallelizationFactor | N | 1 | Maximum: 10 | -| StartingPosition | Y | | AT\_TIMESTAMP, TRIM\_HORIZON, or LATEST | -| StartingPositionTimestamp | N | | Only valid if StartingPosition is set to AT\_TIMESTAMP\. The time from which to start reading, in Unix time seconds | -| TumblingWindowInSeconds | N | | Minimum: 0 Maximum: 900 | \ No newline at end of file diff --git a/doc_source/with-mq.md b/doc_source/with-mq.md deleted file mode 100644 index 4cb19389..00000000 --- a/doc_source/with-mq.md +++ /dev/null @@ -1,331 +0,0 @@ -# Using Lambda with Amazon MQ - -Amazon MQ is a managed message broker service for [Apache ActiveMQ](https://activemq.apache.org/) and [RabbitMQ](https://www.rabbitmq.com)\. A *message broker* enables software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols through either topic or queue event destinations\. - -Amazon MQ can also manage Amazon Elastic Compute Cloud \(Amazon EC2\) instances on your behalf by installing ActiveMQ or RabbitMQ brokers and by providing different network topologies and other infrastructure needs\. - -You can use a Lambda function to process records from your Amazon MQ message broker\. Lambda invokes your function through an [event source mapping](invocation-eventsourcemapping.md), a Lambda resource that reads messages from your broker and invokes the function [synchronously](invocation-sync.md)\. - -The Amazon MQ event source mapping has the following configuration restrictions: -+ Cross account – Lambda does not support cross\-account processing\. You cannot use Lambda to process records from an Amazon MQ message broker that is in a different AWSaccount\. -+ Authentication – For ActiveMQ, only the ActiveMQ [SimpleAuthenticationPlugin](https://activemq.apache.org/security#simple-authentication-plugin) is supported\. For RabbitMQ, only the [PLAIN](https://www.rabbitmq.com/access-control.html#mechanisms) authentication mechanism is supported\. Users must use AWS Secrets Manager to manage their credentials\. For more information about ActiveMQ authentication, see [Integrating ActiveMQ brokers with LDAP](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/security-authentication-authorization.html) in the *Amazon MQ Developer Guide*\. -+ Connection quota – Brokers have a maximum number of allowed connections per wire\-level protocol\. This quota is based on the broker instance type\. For more information, see the [Brokers](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-limits.html#broker-limits) section of **Quotas in Amazon MQ** in the *Amazon MQ Developer Guide*\. -+ Connectivity – You can create brokers in a public or private virtual private cloud \(VPC\)\. For private VPCs, your Lambda function needs access to the VPC to receive messages\. For more information, see [Event source mapping API](#services-mq-api) later in this topic\. -+ Event destinations – Only queue destinations are supported\. However, you can use a virtual topic, which behaves as a topic internally while interacting with Lambda as a queue\. For more information, see [Virtual Destinations](https://activemq.apache.org/virtual-destinations) on the Apache ActiveMQ website, and [Virtual Hosts](https://www.rabbitmq.com/vhosts.html) on the RabbitMQ website\. -+ Network topology – For ActiveMQ, only one single\-instance or standby broker is supported per event source mapping\. For RabbitMQ, only one single\-instance broker or cluster deployment is supported per event source mapping\. Single\-instance brokers require a failover endpoint\. For more information about these broker deployment modes, see [Active MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-architecture.html) and [Rabbit MQ Broker Architecture](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/rabbitmq-broker-architecture.html)in the *Amazon MQ Developer Guide*\. -+ Protocols – Supported protocols depend on the type of Amazon MQ integration\. - + For ActiveMQ integrations, Lambda consumes messages using the OpenWire/Java Message Service \(JMS\) protocol\. No other protocols are supported for consuming messages\. Within the JMS protocol, only [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQTextMessage.html) and [https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html](https://activemq.apache.org/maven/apidocs/org/apache/activemq/command/ActiveMQBytesMessage.html) are supported\. For more information about the OpenWire protocol, see [OpenWire](https://activemq.apache.org/openwire.html) on the Apache ActiveMQ website\. - + For RabbitMQ integrations, Lambda consumes messages using the AMQP 0\-9\-1 protocol\. No other protocols are supported for consuming messages\. For more information about RabbitMQ's implementation of the AMQP 0\-9\-1 protocol, see [AMQP 0\-9\-1 Complete Reference Guide](https://www.rabbitmq.com/amqp-0-9-1-reference.html) on the RabbitMQ website\. - -Lambda automatically supports the latest versions of ActiveMQ and RabbitMQ that Amazon MQ supports\. For the latest supported versions, see [Amazon MQ release notes](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-release-notes.html) in the *Amazon MQ Developer Guide*\. - -**Note** -By default, Amazon MQ has a weekly maintenance window for brokers\. During that window of time, brokers are unavailable\. For brokers without standby, Lambda cannot process any messages during that window\. - -**Topics** -+ [Lambda consumer group](#services-mq-configure) -+ [Execution role permissions](#events-mq-permissions) -+ [Configuring a broker as an event source](#services-mq-eventsourcemapping) -+ [Event source mapping API](#services-mq-api) -+ [Event source mapping errors](#services-mq-errors) -+ [Amazon MQ and RabbitMQ configuration parameters](#services-mq-params) - -## Lambda consumer group - -To interact with Amazon MQ, Lambda creates a consumer group which can read from your Amazon MQ brokers\. The consumer group is created with the same ID as the event source mapping UUID\. - -For Amazon MQ event sources, Lambda batches records together and sends them to your function in a single payload\. To control behavior, you can configure the batching window and batch size\. Lambda pulls messages until it processes the payload size maximum of 6 MB, the batching window expires, or the number of records reaches the full batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. - -The consumer group retrieves the messages as a BLOB of bytes, base64\-encodes them into a single JSON payload, and then invokes your function\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. - -**Note** -While Lambda functions typically have a maximum timeout limit of 15 minutes, event source mappings for Amazon MSK, self\-managed Apache Kafka, and Amazon MQ for ActiveMQ and RabbitMQ only support functions with maximum timeout limits of 14 minutes\. This constraint ensures that the event source mapping can properly handle function errors and retries\. - -You can monitor a given function's concurrency usage using the `ConcurrentExecutions` metric in Amazon CloudWatch\. For more information about concurrency, see [Managing Lambda reserved concurrency](configuration-concurrency.md)\. - -**Example Amazon MQ record events** - -``` -{ - "eventSource": "aws:mq", - "eventSourceArn": "arn:aws:mq:us-west-2:111122223333:broker:test:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "messages": [ - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/text-message", - "deliveryMode": 1, - "replyTo": null, - "type": null, - "expiration": "60000", - "priority": 1, - "correlationId": "myJMSCoID", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "data":"QUJDOkFBQUE=", - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - }, - { - "messageID": "ID:b-9bcfa592-423a-4942-879d-eb284b418fc8-1.mq.us-west-2.amazonaws.com-37557-1234520418293-4:1:1:1:1", - "messageType": "jms/bytes-message", - "deliveryMode": 1, - "replyTo": null, - "type": null, - "expiration": "60000", - "priority": 2, - "correlationId": "myJMSCoID1", - "redelivered": false, - "destination": { - "physicalname": "testQueue" - }, - "data":"LQaGQ82S48k=", - "timestamp": 1598827811958, - "brokerInTime": 1598827811958, - "brokerOutTime": 1598827811959 - } - ] -} -``` - -``` -{ - "eventSource": "aws:rmq", - "eventSourceArn": "arn:aws:mq:us-west-2:111122223333:broker:pizzaBroker:b-9bcfa592-423a-4942-879d-eb284b418fc8", - "rmqMessagesByQueue": { - "pizzaQueue::/": [ - { - "basicProperties": { - "contentType": "text/plain", - "contentEncoding": null, - "headers": { - "header1": { - "bytes": [ - 118, - 97, - 108, - 117, - 101, - 49 - ] - }, - "header2": { - "bytes": [ - 118, - 97, - 108, - 117, - 101, - 50 - ] - }, - "numberInHeader": 10 - }, - "deliveryMode": 1, - "priority": 34, - "correlationId": null, - "replyTo": null, - "expiration": "60000", - "messageId": null, - "timestamp": "Jan 1, 1970, 12:33:41 AM", - "type": null, - "userId": "AIDACKCEVSQ6C2EXAMPLE", - "appId": null, - "clusterId": null, - "bodySize": 80 - }, - "redelivered": false, - "data": "eyJ0aW1lb3V0IjowLCJkYXRhIjoiQ1pybWYwR3c4T3Y0YnFMUXhENEUifQ==" - } - ] - } -} -``` -In the RabbitMQ example, `pizzaQueue` is the name of the RabbitMQ queue, and `/` is the name of the virtual host\. When receiving messages, the event source lists messages under `pizzaQueue::/`\. - -## Execution role permissions - -To read records from an Amazon MQ broker, your Lambda function needs the following permissions added to its [execution role](lambda-intro-execution-role.md): -+ [mq:DescribeBroker](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/brokers-broker-id.html#brokers-broker-id-http-methods) -+ [secretsmanager:GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -**Note** -When using an encrypted customer managed key, add the `[kms:Decrypt](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget)` permission as well\. - -## Configuring a broker as an event source - -Create an [event source mapping](invocation-eventsourcemapping.md) to tell Lambda to send records from an Amazon MQ broker to a Lambda function\. You can create multiple event source mappings to process the same data with multiple functions, or to process items from multiple sources with a single function\. - -To configure your function to read from Amazon MQ, create an **MQ** trigger in the Lambda console\. - -**To create a trigger** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Choose a trigger type\. - -1. Configure the required options, and then choose **Add**\. - -Lambda supports the following options for Amazon MQ event sources: -+ **MQ broker** – Select an Amazon MQ broker\. -+ **Batch size** – Set the maximum number of messages to retrieve in a single batch\. -+ **Queue name** – Enter the Amazon MQ queue to consume\. -+ **Source access configuration** – Enter virtual host information and the Secrets Manager secret that stores your broker credentials\. -+ **Enable trigger** – Disable the trigger to stop processing records\. - -To enable or disable the trigger \(or delete it\), choose the **MQ** trigger in the designer\. To reconfigure the trigger, use the event source mapping API operations\. - -## Event source mapping API - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -To create the event source mapping with the AWS Command Line Interface \(AWS CLI\), use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) command\. - -By default, Amazon MQ brokers are created with the `PubliclyAccessible` flag set to false\. It is only when `PubliclyAccessible` is set to true that the broker receives a public IP address\. - -For full access with your event source mapping, your broker must either use a public endpoint or provide access to the VPC\. Note that when you add Amazon MQ as a trigger, Lambda assumes the VPC settings of the Amazon MQ broker, not the Lambda function's VPC settings\. To meet the Amazon Virtual Private Cloud \(Amazon VPC\) access requirements, you can do one of the following: -+ Configure one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. -+ Create a connection between your Amazon VPC and Lambda\. Your Amazon VPC must also connect to AWS Security Token Service \(AWS STS\) and Secrets Manager endpoints\. For more information, see [Configuring interface VPC endpoints for Lambda](configuration-vpc-endpoints.md)\. - -The Amazon VPC security group rules that you configure should have the following settings at minimum: -+ Inbound rules – For a broker without public accessibility, allow all traffic on all ports for the security group that's specified as your source\. For a broker with public accessibility, allow all traffic on all ports for all destinations\. -+ Outbound rules – Allow all traffic on all ports for all destinations\. - -The Amazon VPC configuration is discoverable through the [Amazon MQ API](https://docs.aws.amazon.com/amazon-mq/latest/api-reference/resources.html) and does not need to be configured in the `create-event-source-mapping` setup\. - -The following example AWS CLI command creates an event source which maps a Lambda function named `MQ-Example-Function` to an Amazon MQ RabbitMQ\-based broker named `ExampleMQBroker`\. The command also provides the virtual host name and a Secrets Manager secret ARN that stores the broker credentials\. - -``` -aws lambda create-event-source-mapping \ ---event-source-arn arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-24cacbb4-b295-49b7-8543-7ce7ce9dfb98 \ ---function-name arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function \ ---queues ExampleQueue \ ---source-access-configuration Type=VIRTUAL_HOST,URI="/" Type=BASIC_AUTH,URI=arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt \ -``` - -You should see the following output: - -``` -{ - "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", - "BatchSize": 100, - "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", - "LastModified": 1601927898.741, - "LastProcessingResult": "No records processed", - "State": "Creating", - "StateTransitionReason": "USER_INITIATED", - "Queues": [ - "ExampleQueue" - ], - "SourceAccessConfigurations": [ - { - "Type": "BASIC_AUTH", - "URI": "arn:aws:secretsmanager:us-east-1:123456789012:secret:ExampleMQBrokerUserPassword-xPBMTt" - } - ] -} -``` - -Using the `[update\-event\-source\-mapping](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-event-source-mapping.html)` command, you can configure additional options such as how Lambda processes batches and to specify when to discard records that cannot be processed\. The following example command updates an event source mapping to have a batch size of 2\. - -``` -aws lambda update-event-source-mapping \ ---uuid 91eaeb7e-c976-1234-9451-8709db01f137 \ ---batch-size 2 -``` - -You should see the following output: - -``` -{ - "UUID": "91eaeb7e-c976-1234-9451-8709db01f137", - "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", - "LastModified": 1601928393.531, - "LastProcessingResult": "No records processed", - "State": "Updating", - "StateTransitionReason": "USER_INITIATED" -} -``` - -Lambda updates these settings asynchronously\. The output will not reflect changes until this process completes\. To view the current status of your resource, use the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) command\. - -``` -aws lambda get-event-source-mapping \ ---uuid 91eaeb7e-c976-4939-9451-8709db01f137 -``` - -You should see the following output: - -``` -{ - "UUID": "91eaeb7e-c976-4939-9451-8709db01f137", - "BatchSize": 2, - "EventSourceArn": "arn:aws:mq:us-east-1:123456789012:broker:ExampleMQBroker:b-b4d492ef-bdc3-45e3-a781-cd1a3102ecca", - "FunctionArn": "arn:aws:lambda:us-east-1:123456789012:function:MQ-Example-Function", - "LastModified": 1601928393.531, - "LastProcessingResult": "No records processed", - "State": "Enabled", - "StateTransitionReason": "USER_INITIATED" -} -``` - -## Event source mapping errors - -When a Lambda function encounters an unrecoverable error, your Amazon MQ consumer stops processing records\. Any other consumers can continue processing, provided that they do not encounter the same error\. To determine the potential cause of a stopped consumer, check the `StateTransitionReason` field in the return details of your `EventSourceMapping` for one of the following codes: - -**`ESM_CONFIG_NOT_VALID`** -The event source mapping configuration is not valid\. - -**`EVENT_SOURCE_AUTHN_ERROR`** -Lambda failed to authenticate the event source\. - -**`EVENT_SOURCE_AUTHZ_ERROR`** -Lambda does not have the required permissions to access the event source\. - -**`FUNCTION_CONFIG_NOT_VALID`** -The function's configuration is not valid\. - -Records also go unprocessed if Lambda drops them due to their size\. The size limit for Lambda records is 6 MB\. To redeliver messages upon function error, you can use a dead\-letter queue \(DLQ\)\. For more information, see [Message Redelivery and DLQ Handling](https://activemq.apache.org/message-redelivery-and-dlq-handling) on the Apache ActiveMQ website and [Reliability Guide](https://www.rabbitmq.com/reliability.html) on the RabbitMQ website\. - -**Note** -Lambda does not support custom redelivery policies\. Instead, Lambda uses a policy with the default values from the [Redelivery Policy](https://activemq.apache.org/redelivery-policy) page on the Apache ActiveMQ website, with `maximumRedeliveries` set to 5\. - -## Amazon MQ and RabbitMQ configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MQ and RabbitMQ\. - - -**Event source parameters that apply to Amazon MQ and RabbitMQ** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| BatchSize | N | 100 | Maximum: 10,000 | -| Enabled | N | true | | -| FunctionName | Y | | | -| FilterCriteria | N | | [Lambda event filtering](invocation-eventfiltering.md) | -| MaximumBatchingWindowInSeconds | N | 500 ms | [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching) | -| Queues | N | | The name of the Amazon MQ broker destination queue to consume\. | -| SourceAccessConfigurations | N | | For ActiveMQ, BASIC\_AUTH credentials\. For RabbitMQ, can contain both BASIC\_AUTH credentials and VIRTUAL\_HOST information\. | \ No newline at end of file diff --git a/doc_source/with-msk.md b/doc_source/with-msk.md deleted file mode 100644 index cc4fbe14..00000000 --- a/doc_source/with-msk.md +++ /dev/null @@ -1,431 +0,0 @@ -# Using Lambda with Amazon MSK - -[Amazon Managed Streaming for Apache Kafka \(Amazon MSK\)](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html) is a fully managed service that you can use to build and run applications that use Apache Kafka to process streaming data\. Amazon MSK simplifies the setup, scaling, and management of clusters running Kafka\. Amazon MSK also makes it easier to configure your application for multiple Availability Zones and for security with AWS Identity and Access Management \(IAM\)\. Amazon MSK supports multiple open\-source versions of Kafka\. - -Amazon MSK as an event source operates similarly to using Amazon Simple Queue Service \(Amazon SQS\) or Amazon Kinesis\. Lambda internally polls for new messages from the event source and then synchronously invokes the target Lambda function\. Lambda reads the messages in batches and provides these to your function as an event payload\. The maximum batch size is configurable\. \(The default is 100 messages\.\) - -For an example of how to configure Amazon MSK as an event source, see [Using Amazon MSK as an event source for AWS Lambda](http://aws.amazon.com/blogs/compute/using-amazon-msk-as-an-event-source-for-aws-lambda/) on the AWS Compute Blog\. For a complete tutorial, see [ Amazon MSK Lambda Integration](https://amazonmsk-labs.workshop.aws/en/msklambda.html) in the Amazon MSK Labs\. - -For Kafka\-based event sources, Lambda supports processing control parameters, such as batching windows and batch size\. For more information, see [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching)\. - -Lambda reads the messages sequentially for each partition\. After Lambda processes each batch, it commits the offsets of the messages in that batch\. If your function returns an error for any of the messages in a batch, Lambda retries the whole batch of messages until processing succeeds or the messages expire\. - -**Note** -While Lambda functions typically have a maximum timeout limit of 15 minutes, event source mappings for Amazon MSK, self\-managed Apache Kafka, and Amazon MQ for ActiveMQ and RabbitMQ only support functions with maximum timeout limits of 14 minutes\. This constraint ensures that the event source mapping can properly handle function errors and retries\. - -Lambda sends the batch of messages in the event parameter when it invokes your function\. The event payload contains an array of messages\. Each array item contains details of the Amazon MSK topic and partition identifier, together with a timestamp and a base64\-encoded message\. - -``` -{ - "eventSource":"aws:kafka", - "eventSourceArn":"arn:aws:kafka:sa-east-1:123456789012:cluster/vpc-2priv-2pub/751d2973-a626-431c-9d4e-d7975eb44dd7-2", - "bootstrapServers":"b-2.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092,b-1.demo-cluster-1.a1bcde.c1.kafka.us-east-1.amazonaws.com:9092", - "records":{ - "mytopic-0":[ - { - "topic":"mytopic", - "partition":0, - "offset":15, - "timestamp":1545084650987, - "timestampType":"CREATE_TIME", - "key":"abcDEFghiJKLmnoPQRstuVWXyz1234==", - "value":"SGVsbG8sIHRoaXMgaXMgYSB0ZXN0Lg==", - "headers":[ - { - "headerKey":[ - 104, - 101, - 97, - 100, - 101, - 114, - 86, - 97, - 108, - 117, - 101 - ] - } - ] - } - ] - } -} -``` - -**Topics** -+ [MSK cluster authentication](#msk-cluster-permissions) -+ [Managing API access and permissions](#msk-permissions) -+ [Authentication and authorization errors](#msk-permissions-errors) -+ [Network configuration](#services-msk-vpc-config) -+ [Adding Amazon MSK as an event source](#services-msk-topic-add) -+ [Auto scaling of the Amazon MSK event source](#services-msk-ops-scaling) -+ [Amazon CloudWatch metrics](#services-msk-metrics) -+ [Amazon MSK configuration parameters](#services-msk-parms) - -## MSK cluster authentication - -Lambda needs permission to access the Amazon MSK cluster, retrieve records, and perform other tasks\. Amazon MSK supports several options for controlling client access to the MSK cluster\. - -**Topics** -+ [Unauthenticated access](#msk-permissions-none) -+ [SASL/SCRAM authentication](#msk-permissions-add-secret) -+ [IAM role\-based authentication](#msk-permissions-iam-policy) -+ [Mutual TLS authentication](#msk-permissions-mTLS) -+ [Configuring the mTLS secret](#smaa-auth-secret) -+ [How Lambda chooses a bootstrap broker](#msk-bootstrap-brokers) - -### Unauthenticated access - -If no clients access the cluster over the internet, you can use unauthenticated access\. - -### SASL/SCRAM authentication - -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with Transport Layer Security \(TLS\) encryption\. For Lambda to connect to the cluster, you store the authentication credentials \(user name and password\) in an AWS Secrets Manager secret\. - -For more information about using Secrets Manager, see [User name and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -Amazon MSK doesn't support SASL/PLAIN authentication\. - -### IAM role\-based authentication - -You can use IAM to authenticate the identity of clients that connect to the MSK cluster\. If IAM auth is active on your MSK cluster, and you don't provide a secret for auth, Lambda automatically defaults to using IAM auth\. To create and deploy IAM user or role\-based policies, use the IAM console or API\. For more information, see [IAM access control](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -To allow Lambda to connect to the MSK cluster, read records, and perform other required actions, add the following permissions to your function's [execution role](lambda-intro-execution-role.md)\. - -``` -{ - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "kafka-cluster:Connect", - "kafka-cluster:DescribeGroup", - "kafka-cluster:AlterGroup", - "kafka-cluster:DescribeTopic", - "kafka-cluster:ReadData", - "kafka-cluster:DescribeClusterDynamicConfiguration" - ], - "Resource": [ - "arn:aws:kafka:region:account-id:cluster/cluster-name/cluster-uuid", - "arn:aws:kafka:region:account-id:topic/cluster-name/cluster-uuid/topic-name", - "arn:aws:kafka:region:account-id:group/cluster-name/cluster-uuid/consumer-group-id" - ] - } - ] -} -``` - -You can scope these permissions to a specific cluster, topic, and group\. For more information, see the [Amazon MSK Kafka actions](https://docs.aws.amazon.com/msk/latest/developerguide/iam-access-control.html#kafka-actions) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -### Mutual TLS authentication - -Mutual TLS \(mTLS\) provides two\-way authentication between the client and server\. The client sends a certificate to the server for the server to verify the client, and the server sends a certificate to the client for the client to verify the server\. - -For Amazon MSK, Lambda acts as the client\. You configure a client certificate \(as a secret in Secrets Manager\) to authenticate Lambda with the brokers in your MSK cluster\. The client certificate must be signed by a CA in the server's trust store\. The MSK cluster sends a server certificate to Lambda to authenticate the brokers with Lambda\. The server certificate must be signed by a certificate authority \(CA\) that's in the AWS trust store\. - -For instructions on how to generate a client certificate, see [ Introducing mutual TLS authentication for Amazon MSK as an event source](http://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-msk-as-an-event-source)\. - -Amazon MSK doesn't support self\-signed server certificates, because all brokers in Amazon MSK use [public certificates](https://docs.aws.amazon.com/msk/latest/developerguide/msk-encryption.html) signed by [Amazon Trust Services CAs](https://www.amazontrust.com/repository/), which Lambda trusts by default\. - - - -For more information about mTLS for Amazon MSK, see [Mutual TLS Authentication](https://docs.aws.amazon.com/msk/latest/developerguide/msk-authentication.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -### Configuring the mTLS secret - -The CLIENT\_CERTIFICATE\_TLS\_AUTH secret requires a certificate field and a private key field\. For an encrypted private key, the secret requires a private key password\. Both the certificate and private key must be in PEM format\. - -**Note** -Lambda supports the [PBES1](https://datatracker.ietf.org/doc/html/rfc2898/#section-6.1) \(but not PBES2\) private key encryption algorithms\. - -The certificate field must contain a list of certificates, beginning with the client certificate, followed by any intermediate certificates, and ending with the root certificate\. Each certificate must start on a new line with the following structure: - -``` ------BEGIN CERTIFICATE----- - ------END CERTIFICATE----- -``` - -Secrets Manager supports secrets up to 65,536 bytes, which is enough space for long certificate chains\. - -The private key must be in [PKCS \#8](https://datatracker.ietf.org/doc/html/rfc5208) format, with the following structure: - -``` ------BEGIN PRIVATE KEY----- - ------END PRIVATE KEY----- -``` - -For an encrypted private key, use the following structure: - -``` ------BEGIN ENCRYPTED PRIVATE KEY----- - ------END ENCRYPTED PRIVATE KEY----- -``` - -The following example shows the contents of a secret for mTLS authentication using an encrypted private key\. For an encrypted private key, you include the private key password in the secret\. - -``` -{ - "privateKeyPassword": "testpassword", - "certificate": "-----BEGIN CERTIFICATE----- -MIIE5DCCAsygAwIBAgIRAPJdwaFaNRrytHBto0j5BA0wDQYJKoZIhvcNAQELBQAw -... -j0Lh4/+1HfgyE2KlmII36dg4IMzNjAFEBZiCRoPimO40s1cRqtFHXoal0QQbIlxk -cmUuiAii9R0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFgjCCA2qgAwIBAgIQdjNZd6uFf9hbNC5RdfmHrzANBgkqhkiG9w0BAQsFADBb -... -rQoiowbbk5wXCheYSANQIfTZ6weQTgiCHCCbuuMKNVS95FkXm0vqVD/YpXKwA/no -c8PH3PSoAaRwMMgOSA2ALJvbRz8mpg== ------END CERTIFICATE-----", - "privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- -MIIFKzBVBgkqhkiG9w0BBQ0wSDAnBgkqhkiG9w0BBQwwGgQUiAFcK5hT/X7Kjmgp -... -QrSekqF+kWzmB6nAfSzgO9IaoAaytLvNgGTckWeUkWn/V0Ck+LdGUXzAC4RxZnoQ -zp2mwJn2NYB7AZ7+imp0azDZb+8YG2aUCiyqb6PnnA== ------END ENCRYPTED PRIVATE KEY-----" -} -``` - -### How Lambda chooses a bootstrap broker - -Lambda chooses a [ bootstrap broker](https://docs.aws.amazon.com/msk/latest/developerguide/msk-get-bootstrap-brokers.html) based on the authentication methods available on your cluster, and whether you provide a secret for authentication\. If you provide a secret for mTLS or SASL/SCRAM, Lambda automatically chooses that auth method\. If you don't provide a secret, Lambda selects the strongest auth method that's active on your cluster\. The following is the order of priority in which Lambda selects a broker, from strongest to weakest auth: -+ mTLS \(secret provided for mTLS\) -+ SASL/SCRAM \(secret provided for SASL/SCRAM\) -+ SASL IAM \(no secret provided, and IAM auth active\) -+ Unauthenticated TLS \(no secret provided, and IAM auth not active\) -+ Plaintext \(no secret provided, and both IAM auth and unauthenticated TLS are not active\) - -**Note** -If Lambda can't connect to the most secure broker type, Lambda doesn't attempt to connect to a different \(weaker\) broker type\. If you want Lambda to choose a weaker broker type, deactivate all stronger auth methods on your cluster\. - -## Managing API access and permissions - -In addition to accessing the Amazon MSK cluster, your function needs permissions to perform various Amazon MSK API actions\. You add these permissions to the function's execution role\. If your users need access to any of the Amazon MSK API actions, add the required permissions to the identity policy for the IAM user or role\. - -### Required Lambda function execution role permissions - -Your Lambda function's [execution role](lambda-intro-execution-role.md) must have the following permissions to access the MSK cluster on your behalf\. You can either add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role, or create a custom policy with permission to perform the following actions: -+ [kafka:DescribeCluster](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn.html#clusters-clusterarnget) -+ [kafka:DescribeClusterV2](https://docs.aws.amazon.com/MSK/2.0/APIReference/v2-clusters-clusterarn.html#v2-clusters-clusterarnget) -+ [kafka:GetBootstrapBrokers](https://docs.aws.amazon.com/msk/1.0/apireference/clusters-clusterarn-bootstrap-brokers.html#clusters-clusterarn-bootstrap-brokersget) -+ [ec2:CreateNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html) -+ [ec2:DescribeNetworkInterfaces](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeNetworkInterfaces.html) -+ [ec2:DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) -+ [ec2:DeleteNetworkInterface](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkInterface.html) -+ [ec2:DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html) -+ [ec2:DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) -+ [logs:CreateLogGroup](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogGroup.html) -+ [logs:CreateLogStream](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html) -+ [logs:PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) - -**Note** -Lambda eventually plans to remove the `kafka:DescribeCluster` permission from this policy\. You should migrate any applications using `kafka:DescribeCluster` to use `kafka:DescribeClusterV2` instead\. - -### Adding permissions to your execution role - -Follow these steps to add the AWS managed policy `AWSLambdaMSKExecutionRole` to your execution role using the IAM console\. - -**To add an AWS managed policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. - -1. In the search box, enter the policy name \(`AWSLambdaMSKExecutionRole`\)\. - -1. Select the policy from the list, and then choose **Policy actions**, **Attach**\. - -1. On the **Attach policy** page, select your execution role from the list, and then choose **Attach policy**\. - -### Granting users access with an IAM policy - -By default, IAM users and roles don't have permission to perform Amazon MSK API operations\. To grant access to users in your organization or account, you can add or update an identity\-based policy\. For more information, see [Amazon MSK Identity\-Based Policy Examples](https://docs.aws.amazon.com/msk/latest/developerguide/security_iam_id-based-policy-examples.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -### Using SASL/SCRAM authentication - -Amazon MSK supports Simple Authentication and Security Layer/Salted Challenge Response Authentication Mechanism \(SASL/SCRAM\) authentication with TLS encryption\. You can control access to your Amazon MSK clusters by setting up user name and password authentication using an AWS Secrets Manager secret\. For more information, see [Username and password authentication with AWS Secrets Manager](https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. - -Note that Amazon MSK does not support SASL/PLAIN authentication\. - -## Authentication and authorization errors - -If any of the permissions required to consume data from the Amazon MSK cluster are missing, Lambda displays one of the following error messages in the event source mapping under **LastProcessingResult**\. - -**Topics** -+ [Cluster failed to authorize Lambda](#msk-authorize-errors) -+ [SASL authentication failed](#msk-sasl-errors) -+ [Server failed to authenticate Lambda](#msk-mtls-errors) -+ [Provided certificate or private key is invalid](#msk-key-errors) - -### Cluster failed to authorize Lambda - -For SASL/SCRAM or mTLS, this error indicates that the provided user doesn't have all of the following required Kafka access control list \(ACL\) permissions: -+ DescribeConfigs Cluster -+ Describe Group -+ Read Group -+ Describe Topic -+ Read Topic - -For IAM access control, your function's execution role is missing one or more of the permissions required to access the group or topic\. Review the list of required permissions in [ IAM role\-based authentication](#msk-permissions-iam-policy)\. - -When you create either Kafka ACLs or an IAM policy with the required Kafka cluster permissions, specify the topic and group as resources\. The topic name must match the topic in the event source mapping\. The group name must match the event source mapping's UUID\. - -After you add the required permissions to the execution role, it might take several minutes for the changes to take effect\. - -### SASL authentication failed - -For SASL/SCRAM, this error indicates that the provided user name and password aren't valid\. - -For IAM access control, the execution role is missing the `kafka-cluster:Connect` permission for the MSK cluster\. Add this permission to the role and specify the cluster's Amazon Resource Name \(ARN\) as a resource\. - -You might see this error occurring intermittently\. The cluster rejects connections after the number of TCP connections exceeds the [Amazon MSK service quota](https://docs.aws.amazon.com/msk/latest/developerguide/limits.html)\. Lambda backs off and retries until a connection is successful\. After Lambda connects to the cluster and polls for records, the last processing result changes to `OK`\. - -### Server failed to authenticate Lambda - -This error indicates that the Amazon MSK Kafka brokers failed to authenticate with Lambda\. This can occur for any of the following reasons: -+ You didn't provide a client certificate for mTLS authentication\. -+ You provided a client certificate, but the brokers aren't configured to use mTLS\. -+ A client certificate isn't trusted by the brokers\. - -### Provided certificate or private key is invalid - -This error indicates that the Amazon MSK consumer couldn't use the provided certificate or private key\. Make sure that the certificate and key use PEM format, and that the private key encryption uses a PBES1 algorithm\. - -## Network configuration - -Lambda must have access to the Amazon Virtual Private Cloud \(Amazon VPC\) resources associated with your Amazon MSK cluster\. We recommend that you deploy [AWS PrivateLink VPC endpoints](https://docs.aws.amazon.com/vpc/latest/privatelink/aws-services-privatelink-support.html) for Lambda and AWS Security Token Service \(AWS STS\)\. The poller needs access to AWS STS to assume the execution role associated with the Lambda function\. Lambda must have access to the Lambda VPC endpoint to invoke the function\. If you configured a secret in Secrets Manager to authenticate Lambda with the brokers, also [deploy a VPC endpoint for Secrets Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/vpc-endpoint-overview.html)\. - -Alternatively, ensure that the VPC associated with your MSK cluster includes one NAT gateway per public subnet\. For more information, see [Internet and service access for VPC\-connected functions](configuration-vpc.md#vpc-internet)\. - -Configure your Amazon VPC security groups with the following rules \(at minimum\): -+ Inbound rules – Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ Outbound rules – Allow all traffic on port 443 for all destinations\. Allow all traffic on the Amazon MSK broker port \(9092 for plaintext, 9094 for TLS, 9096 for SASL, 9098 for IAM\) for the security groups specified for your event source\. -+ If you are using VPC endpoints instead of a NAT gateway, the security groups associated with the VPC endpoints must allow all inbound traffic on port 443 from the event source's security groups\. - -**Note** -Your Amazon VPC configuration is discoverable through the [Amazon MSK API](https://docs.aws.amazon.com/msk/1.0/apireference/resources.html)\. You don't need to configure it during setup using the create\-event\-source\-mapping command\. - -For more information about configuring the network, see [Setting up AWS Lambda with an Apache Kafka cluster within a VPC](http://aws.amazon.com/blogs/compute/setting-up-aws-lambda-with-an-apache-kafka-cluster-within-a-vpc/) on the AWS Compute Blog\. - -## Adding Amazon MSK as an event source - -To create an [event source mapping](invocation-eventsourcemapping.md), add Amazon MSK as a Lambda function [trigger](gettingstarted-concepts.md#gettingstarted-concepts-trigger) using the Lambda console, an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), or the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)\. Note that when you add Amazon MSK as a trigger, Lambda assumes the VPC settings of the Amazon MSK cluster, not the Lambda function's VPC settings\. - -This section describes how to create an event source mapping using the Lambda console and the AWS CLI\. - -### Prerequisites -+ An Amazon MSK cluster and a Kafka topic\. For more information, see [Getting Started Using Amazon MSK](https://docs.aws.amazon.com/msk/latest/developerguide/getting-started.html) in the *Amazon Managed Streaming for Apache Kafka Developer Guide*\. -+ An [execution role](lambda-intro-execution-role.md) with permission to access the AWS resources that your MSK cluster uses\. - -### Customizable consumer group ID - -When setting up Kafka as an event source, you can specify a consumer group ID\. This consumer group ID is an existing identifier for the Kafka consumer group that you want your Lambda function to join\. You can use this feature to seamlessly migrate any ongoing Kafka record processing setups from other consumers to Lambda\. - -If you specify a consumer group ID and there are other active pollers within that consumer group, Kafka distributes messages across all consumers\. In other words, Lambda doesn't receive all message for the Kafka topic\. If you want Lambda to handle all messages in the topic, turn off any other pollers in that consumer group\. - -Additionally, if you specify a consumer group ID, and Kafka finds a valid existing consumer group with the same ID, Lambda ignores the `StartingPosition` parameter for your event source mapping\. Instead, Lambda begins processing records according to the committed offset of the consumer group\. If you specify a consumer group ID, and Kafka cannot find an existing consumer group, then Lambda configures your event source with the specified `StartingPosition`\. - -The consumer group ID that you specify must be unique among all your Kafka event sources\. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value\. - -### Adding an Amazon MSK trigger \(console\) - -Follow these steps to add your Amazon MSK cluster and a Kafka topic as a trigger for your Lambda function\. - -**To add an Amazon MSK trigger to your Lambda function \(console\)** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your Lambda function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Under **Trigger configuration**, do the following: - - 1. Choose the **MSK** trigger type\. - - 1. For **MSK cluster**, select your cluster\. - - 1. For **Batch size**, enter the maximum number of messages to receive in a single batch\. - - 1. For **Batch window**, enter the maximum amount of seconds that Lambda spends gathering records before invoking the function\. - - 1. For **Topic name**, enter the name of a Kafka topic\. - - 1. \(Optional\) For **Consumer group ID**, enter the ID of a Kafka consumer group to join\. - - 1. \(Optional\) For **Starting position**, choose **Latest** to start reading the stream from the latest record\. Or, choose **Trim horizon** to start at the earliest available record\. - - 1. \(Optional\) For **Authentication**, choose the secret key for authenticating with the brokers in your MSK cluster\. - - 1. To create the trigger in a disabled state for testing \(recommended\), clear **Enable trigger**\. Or, to enable the trigger immediately, select **Enable trigger**\. - -1. To create the trigger, choose **Add**\. - -### Adding an Amazon MSK trigger \(AWS CLI\) - -Use the following example AWS CLI commands to create and view an Amazon MSK trigger for your Lambda function\. - -#### Creating a trigger using the AWS CLI - -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html) AWS CLI command to map a Lambda function named `my-kafka-function` to a Kafka topic named `AWSKafkaTopic`\. The topic's starting position is set to `LATEST`\. - -``` -aws lambda create-event-source-mapping \ - --event-source-arn arn:aws:kafka:us-west-2:arn:aws:kafka:us-west-2:111111111111:cluster/my-cluster/fc2f5bdf-fd1b-45ad-85dd-15b4a5a6247e-2 \ - --topics AWSKafkaTopic \ - --starting-position LATEST \ - --function-name my-kafka-function -``` - -For more information, see the [CreateEventSourceMapping](API_CreateEventSourceMapping.md) API reference documentation\. - -#### Viewing the status using the AWS CLI - -The following example uses the [https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html](https://docs.aws.amazon.com/cli/latest/reference/lambda/get-event-source-mapping.html) AWS CLI command to describe the status of the event source mapping that you created\. - -``` -aws lambda get-event-source-mapping \ - --uuid 6d9bce8e-836b-442c-8070-74e77903c815 -``` - -## Auto scaling of the Amazon MSK event source - -When you initially create an Amazon MSK event source, Lambda allocates one consumer to process all partitions in the Kafka topic\. Each consumer has multiple processors running in parallel to handle increased workloads\. Additionally, Lambda automatically scales up or down the number of consumers, based on workload\. To preserve message ordering in each partition, the maximum number of consumers is one consumer per partition in the topic\. - -In one\-minute intervals, Lambda evaluates the consumer offset lag of all the partitions in the topic\. If the lag is too high, the partition is receiving messages faster than Lambda can process them\. If necessary, Lambda adds or removes consumers from the topic\. The scaling process of adding or removing consumers occurs within three minutes of evaluation\. - -If your target Lambda function is overloaded, Lambda reduces the number of consumers\. This action reduces the workload on the function by reducing the number of messages that consumers can retrieve and send to the function\. - -To monitor the throughput of your Kafka topic, view the [Offset lag metric](#services-msk-metrics) Lambda emits while your function processes records\. - -To check how many function invocations occur in parallel, you can also monitor the [concurrency metrics](monitoring-metrics.md#monitoring-metrics-concurrency) for your function\. - -## Amazon CloudWatch metrics - -Lambda emits the `OffsetLag` metric while your function processes records\. The value of this metric is the difference in offset between the last record written to the Kafka event source topic and the last record that your function's consumer group processed\. You can use `OffsetLag` to estimate the latency between when a record is added and when your consumer group processes it\. - -An increasing trend in `OffsetLag` can indicate issues with pollers in your function's consumer group\. For more information, see [Working with Lambda function metrics](monitoring-metrics.md)\. - -## Amazon MSK configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon MSK\. - - -**Event source parameters that apply to Amazon MSK** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| AmazonManagedKafkaEventSourceConfig | N | Contains the ConsumerGroupId field, which defaults to a unique value\. | Can set only on Create | -| BatchSize | N | 100 | Maximum: 10,000 | -| Enabled | N | Enabled | | -| EventSourceArn | Y | | Can set only on Create | -| FunctionName | Y | | | -| FilterCriteria | N | | [Lambda event filtering](invocation-eventfiltering.md) | -| MaximumBatchingWindowInSeconds | N | 500 ms | [Batching behavior](invocation-eventsourcemapping.md#invocation-eventsourcemapping-batching) | -| SourceAccessConfigurations | N | No credentials | SASL/SCRAM or CLIENT\_CERTIFICATE\_TLS\_AUTH \(MutualTLS\) authentication credentials for your event source | -| StartingPosition | Y | | TRIM\_HORIZON or LATEST Can set only on Create | -| Topics | Y | | Kafka topic name Can set only on Create | \ No newline at end of file diff --git a/doc_source/with-on-demand-custom-android.md b/doc_source/with-on-demand-custom-android.md deleted file mode 100644 index b12d8432..00000000 --- a/doc_source/with-on-demand-custom-android.md +++ /dev/null @@ -1,11 +0,0 @@ -# Invoking Lambda functions with the AWS Mobile SDK for Android - -You can call a Lambda function from a mobile application\. Put business logic in functions to separate its development lifecycle from that of front\-end clients, making mobile applications less complex to develop and maintain\. With the Mobile SDK for Android, you [use Amazon Cognito to authenticate users and authorize requests](with-android-example.md)\. - -When you invoke a function from a mobile application, you choose the event structure, [invocation type](lambda-invocation.md), and permission model\. You can use [aliases](configuration-aliases.md) to enable seamless updates to your function code, but otherwise the function and application are tightly coupled\. As you add more functions, you can create an API layer to decouple your function code from your front\-end clients and improve performance\. - -To create a fully\-featured web API for your mobile and web applications, use Amazon API Gateway\. With API Gateway, you can add custom authorizers, throttle requests, and cache results for all of your functions\. For more information, see [Using AWS Lambda with Amazon API Gateway](services-apigateway.md)\. - -**Topics** -+ [Tutorial: Using AWS Lambda with the Mobile SDK for Android](with-android-example.md) -+ [Sample function code](with-android-create-package.md) \ No newline at end of file diff --git a/doc_source/with-s3-example-use-app-spec.md b/doc_source/with-s3-example-use-app-spec.md deleted file mode 100644 index 1195cf42..00000000 --- a/doc_source/with-s3-example-use-app-spec.md +++ /dev/null @@ -1,31 +0,0 @@ -# AWS SAM template for an Amazon S3 application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-s3-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Resources: - CreateThumbnail: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: handler - Runtime: runtime - Timeout: 60 - Policies: AWSLambdaExecute - Events: - CreateThumbnailEvent: - Type: S3 - Properties: - Bucket: !Ref SrcBucket - Events: s3:ObjectCreated:* - - SrcBucket: - Type: AWS::S3::Bucket -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/with-s3-example.md b/doc_source/with-s3-example.md deleted file mode 100644 index d974f2a1..00000000 --- a/doc_source/with-s3-example.md +++ /dev/null @@ -1,300 +0,0 @@ -# Tutorial: Using an Amazon S3 trigger to invoke a Lambda function - -In this tutorial, you use the console to create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. The trigger invokes your function every time that you add an object to your Amazon S3 bucket\. - -We recommend that you complete this console\-based tutorial before you try the [tutorial to create thumbnail images](with-s3-tutorial.md)\. - -## Prerequisites - -To use Lambda and other AWS services, you need an AWS account\. If you do not have an account, visit [aws\.amazon\.com](https://aws.amazon.com/) and choose **Create an AWS Account**\. For instructions, see [How do I create and activate a new AWS account?](http://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -## Create a bucket and upload a sample object - -Create an Amazon S3 bucket and upload a test file to your new bucket\. Your Lambda function retrieves information about this file when you test the function from the console\. - -**To create an Amazon S3 bucket using the console** - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Choose **Create bucket**\. - -1. Under **General configuration**, do the following: - - 1. For **Bucket name**, enter a unique name\. - - 1. For **AWS Region**, choose a Region\. Note that you must create your Lambda function in the same Region\. - -1. Choose **Create bucket**\. - -After creating the bucket, Amazon S3 opens the **Buckets** page, which displays a list of all buckets in your account in the current Region\. - -**To upload a test object using the Amazon S3 console** - -1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the bucket that you created\. - -1. On the **Objects** tab, choose **Upload**\. - -1. Drag a test file from your local machine to the **Upload **page\. - -1. Choose **Upload**\. - -## Create the Lambda function - -Use a [function blueprint](gettingstarted-features.md#gettingstarted-features-blueprints) to create the Lambda function\. A blueprint provides a sample function that demonstrates how to use Lambda with other AWS services\. Also, a blueprint includes sample code and function configuration presets for a certain runtime\. For this tutorial, you can choose the blueprint for the Node\.js or Python runtime\. - -**To create a Lambda function from a blueprint in the console** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose **Create function**\. - -1. On the **Create function** page, choose **Use a blueprint**\. - -1. Under **Blueprints**, enter **s3** in the search box\. - -1. In the search results, do one of the following: - + For a Node\.js function, choose **s3\-get\-object**\. - + For a Python function, choose **s3\-get\-object\-python**\. - -1. Choose **Configure**\. - -1. Under **Basic information**, do the following: - - 1. For **Function name**, enter **my\-s3\-function**\. - - 1. For **Execution role**, choose **Create a new role from AWS policy templates**\. - - 1. For **Role name**, enter **my\-s3\-function\-role**\. - -1. Under **S3 trigger**, choose the S3 bucket that you created previously\. - - When you configure an S3 trigger using the Lambda console, the console modifies your function's [resource\-based policy](access-control-resource-based.md) to allow Amazon S3 to invoke the function\. - -1. Choose **Create function**\. - -## Review the function code - -The Lambda function retrieves the source S3 bucket name and the key name of the uploaded object from the event parameter that it receives\. The function uses the Amazon S3 `getObject` API to retrieve the content type of the object\. - -While viewing your function in the [Lambda console](https://console.aws.amazon.com/lambda), you can review the function code on the **Code** tab, under **Code source**\. The code looks like the following: - ------- -#### [ Node\.js ] - -**Example index\.js** - -``` -console.log('Loading function'); - -const aws = require('aws-sdk'); - -const s3 = new aws.S3({ apiVersion: '2006-03-01' }); - -exports.handler = async (event, context) => { - //console.log('Received event:', JSON.stringify(event, null, 2)); - - // Get the object from the event and show its content type - const bucket = event.Records[0].s3.bucket.name; - const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' ')); - const params = { - Bucket: bucket, - Key: key, - }; - try { - const { ContentType } = await s3.getObject(params).promise(); - console.log('CONTENT TYPE:', ContentType); - return ContentType; - } catch (err) { - console.log(err); - const message = `Error getting object ${key} from bucket ${bucket}. Make sure they exist and your bucket is in the same region as this function.`; - console.log(message); - throw new Error(message); - } -}; -``` - ------- -#### [ Python ] - -**Example lambda\-function\.py** - -``` -import json -import urllib.parse -import boto3 - -print('Loading function') - -s3 = boto3.client('s3') - - -def lambda_handler(event, context): - #print("Received event: " + json.dumps(event, indent=2)) - - # Get the object from the event and show its content type - bucket = event['Records'][0]['s3']['bucket']['name'] - key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8') - try: - response = s3.get_object(Bucket=bucket, Key=key) - print("CONTENT TYPE: " + response['ContentType']) - return response['ContentType'] - except Exception as e: - print(e) - print('Error getting object {} from bucket {}. Make sure they exist and your bucket is in the same region as this function.'.format(key, bucket)) - raise e -``` - ------- - -## Test in the console - -Invoke the Lambda function manually using sample Amazon S3 event data\. - -**To test the Lambda function using the console** - -1. On the **Code** tab, under **Code source**, choose the arrow next to **Test**, and then choose **Configure test events** from the dropdown list\. - -1. In the **Configure test event** window, do the following: - - 1. Choose **Create new test event**\. - - 1. For **Event template**, choose **Amazon S3 Put** \(**s3\-put**\)\. - - 1. For **Event name**, enter a name for the test event\. For example, **mys3testevent**\. - - 1. In the test event JSON, replace the S3 bucket name \(`example-bucket`\) and object key \(`test%2Fkey`\) with your bucket name and test file name (that you uploaded in your bucket)\. Your test event should look similar to the following: - - ``` - { - "Records": [ - { - "eventVersion": "2.0", - "eventSource": "aws:s3", - "awsRegion": "us-west-2", - "eventTime": "1970-01-01T00:00:00.000Z", - "eventName": "ObjectCreated:Put", - "userIdentity": { - "principalId": "EXAMPLE" - }, - "requestParameters": { - "sourceIPAddress": "127.0.0.1" - }, - "responseElements": { - "x-amz-request-id": "EXAMPLE123456789", - "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" - }, - "s3": { - "s3SchemaVersion": "1.0", - "configurationId": "testConfigRule", - "bucket": { - "name": "my-s3-bucket", - "ownerIdentity": { - "principalId": "EXAMPLE" - }, - "arn": "arn:aws:s3:::my-s3-bucket" - }, - "object": { - "key": "HappyFace.jpg", - "size": 1024, - "eTag": "0123456789abcdef0123456789abcdef", - "sequencer": "0A1B2C3D4E5F678901" - } - } - } - ] - } - ``` - - 1. Choose **Create**\. - -1. To invoke the function with your test event, under **Code source**, choose **Test**\. - - The **Execution results** tab displays the response, function logs, and request ID, similar to the following: - - ``` - Response - "image/jpeg" - - Function Logs - START RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Version: $LATEST - 2021-02-18T21:40:59.280Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO INPUT BUCKET AND KEY: { Bucket: 'my-s3-bucket', Key: 'HappyFace.jpg' } - 2021-02-18T21:41:00.215Z 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 INFO CONTENT TYPE: image/jpeg - END RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 - REPORT RequestId: 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 Duration: 976.25 ms Billed Duration: 977 ms Memory Size: 128 MB Max Memory Used: 90 MB Init Duration: 430.47 ms - - Request ID - 12b3cae7-5f4e-415e-93e6-416b8f8b66e6 - ``` - -## Test with the S3 trigger - -Invoke your function when you upload a file to the Amazon S3 source bucket\. - -**To test the Lambda function using the S3 trigger** - -1. On the [Buckets page](https://console.aws.amazon.com/s3/home) of the Amazon S3 console, choose the name of the source bucket that you created earlier\. - -1. On the **Upload** page, upload a few \.jpg or \.png image files to the bucket\. - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of your function \(**my\-s3\-function**\)\. - -1. To verify that the function ran once for each file that you uploaded, choose the **Monitor** tab\. This page shows graphs for the metrics that Lambda sends to CloudWatch\. The count in the **Invocations** graph should match the number of files that you uploaded to the Amazon S3 bucket\. -![\[Image NOT FOUND\]](http://docs.aws.amazon.com/lambda/latest/dg/images/metrics-functions-list.png) - - For more information on these graphs, see [Monitoring functions on the Lambda console](monitoring-functions-access-metrics.md)\. - -1. \(Optional\) To view the logs in the CloudWatch console, choose **View logs in CloudWatch**\. Choose a log stream to view the logs output for one of the function invocations\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the IAM policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the AWS Identity and Access Management \(IAM\) console\. - -1. Select the policy that Lambda created for you\. The policy name begins with **AWSLambdaS3ExecutionRole\-**\. - -1. Choose **Policy actions**, **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the S3 bucket** - -1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) - -1. Select the bucket you created\. - -1. Choose **Delete**\. - -1. Enter the name of the bucket in the text box\. - -1. Choose **Confirm**\. - -## Next steps - -Try the more advanced tutorial\. In this tutorial, the S3 trigger invokes a function to [create a thumbnail image](with-s3-tutorial.md) for each image file that is uploaded to your S3 bucket\. This tutorial requires a moderate level of AWS and Lambda domain knowledge\. You use the AWS Command Line Interface \(AWS CLI\) to create resources, and you create a \.zip file archive deployment package for your function and its dependencies\. diff --git a/doc_source/with-s3-tutorial.md b/doc_source/with-s3-tutorial.md deleted file mode 100644 index 13bbe139..00000000 --- a/doc_source/with-s3-tutorial.md +++ /dev/null @@ -1,548 +0,0 @@ -# Tutorial: Using an Amazon S3 trigger to create thumbnail images - -In this tutorial, you create a Lambda function and configure a trigger for Amazon Simple Storage Service \(Amazon S3\)\. Amazon S3 invokes the `CreateThumbnail` function for each image file that is uploaded to an S3 bucket\. The function reads the image object from the source S3 bucket and creates a thumbnail image to save in a target S3 bucket\. - -**Note** -This tutorial requires a moderate level of AWS and Lambda domain knowledge\. We recommend that you first try [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md)\. - - In this tutorial, you use the AWS Command Line Interface \(AWS CLI\) to create the following AWS resources: - -**Lambda resources** -+ A Lambda function\. You can choose Node\.js or Python for the function code\. -+ A \.zip file archive deployment package for the function\. -+ An access policy that grants Amazon S3 permission to invoke the function\. - -**AWS Identity and Access Management \(IAM\) resources** -+ An execution role with an associated permissions policy to grant permissions that your function needs\. - -**Amazon S3 resources** -+ A source S3 bucket with a notification configuration that invokes the function\. -+ A target S3 bucket where the function saves the resized images\. - -**Topics** -+ [Prerequisites](#with-s3-tutorial-prepare) -+ [Step 1\. Create S3 buckets and upload a sample object](#with-s3-tutorial-prepare-create-buckets) -+ [Step 2\. Create the IAM policy](#with-s3-tutorial-create-policy) -+ [Step 3\. Create the execution role](#with-s3-tutorial-create-execution-role) -+ [Step 4\. Create the deployment package](#with-s3-tutorial-create-function-package) -+ [Step 5\. Create the Lambda function](#with-s3-tutorial-create-function-createfunction) -+ [Step 6\. Test the Lambda function](#s3-tutorial-events-adminuser-create-test-function-upload-zip-test-manual-invoke) -+ [Step 7\. Configure Amazon S3 to publish events](#with-s3-tutorial-configure-event-source) -+ [Step 8\. Test using the Amazon S3 trigger](#with-s3-tutorial-configure-event-source-test-end-to-end) -+ [Step 9\. Clean up your resources](#s3-tutorial-cleanup) - -## Prerequisites -+ [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and [configure it with your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)\. -+ Install the language support tools and a package manager for the language that you want to use \(Node\.js or Python\)\. For suggested tools, see [Code authoring tools](lambda-settingup.md#lambda-settingup-author)\. - -## Step 1\. Create S3 buckets and upload a sample object - -Follow these steps to create S3 buckets and upload an object\. - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. [Create two S3 buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html)\. The target bucket must be named ***source*\-resized**, where *source* is the name of the source bucket\. For example, a source bucket named `sourcebucket` and a target bucket named `sourcebucket-resized`\. -**Note** -Make sure that you create the buckets in the same AWS Region that you plan to use for the Lambda function\. - -1. In the source bucket, [upload](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) a \.jpg or \.png object, for example, `HappyFace.jpg`\. - - You must create this sample object before you test your Lambda function\. When you test the function manually in step 6, you pass sample event data to the function that specifies the source bucket name and image file name\. - -## Step 2\. Create the IAM policy - -Create an IAM policy that defines the permissions for the Lambda function\. The function must have permissions to: -+ Get the object from the source S3 bucket\. -+ Put the resized object into the target S3 bucket\. -+ Write logs to Amazon CloudWatch Logs\. - -**To create an IAM policy** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) in the IAM console\. - -1. Choose **Create policy**\. - -1. Choose the **JSON** tab, and then paste the following policy\. Be sure to replace *sourcebucket* with the name of the source bucket that you created previously\. - - ``` - { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Action": [ - "logs:PutLogEvents", - "logs:CreateLogGroup", - "logs:CreateLogStream" - ], - "Resource": "arn:aws:logs:*:*:*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:GetObject" - ], - "Resource": "arn:aws:s3:::sourcebucket/*" - }, - { - "Effect": "Allow", - "Action": [ - "s3:PutObject" - ], - "Resource": "arn:aws:s3:::sourcebucket-resized/*" - } - ] - } - ``` - -1. Choose **Next: Tags**\. - -1. Choose **Next: Review**\. - -1. Under **Review policy**, for **Name**, enter **AWSLambdaS3Policy**\. - -1. Choose **Create policy**\. - -## Step 3\. Create the execution role - -Create the [execution role](lambda-intro-execution-role.md) that gives your Lambda function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties: - + **Trusted entity** – **Lambda** - + **Permissions policy** – **AWSLambdaS3Policy** - + **Role name** – **lambda\-s3\-role** - -## Step 4\. Create the deployment package - -The deployment package is a [\.zip file archive](gettingstarted-package.md#gettingstarted-package-zip) containing your Lambda function code and its dependencies\. - ------- -#### [ Node\.js ] - -1. Open a command line terminal or shell in a Linux environment\. Ensure that the Node\.js version in your local environment matches the Node\.js version of your function\. - -1. Create a a directory named `lambda-s3`\. - - ``` - mkdir lambda-s3 - ``` - -1. Save the function code as `index.js`\. - - ``` - // dependencies - const AWS = require('aws-sdk'); - const util = require('util'); - const sharp = require('sharp'); - - // get reference to S3 client - const s3 = new AWS.S3(); - - exports.handler = async (event, context, callback) => { - - // Read options from the event parameter. - console.log("Reading options from event:\n", util.inspect(event, {depth: 5})); - const srcBucket = event.Records[0].s3.bucket.name; - // Object key may have spaces or unicode non-ASCII characters. - const srcKey = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, " ")); - const dstBucket = srcBucket + "-resized"; - const dstKey = "resized-" + srcKey; - - // Infer the image type from the file suffix. - const typeMatch = srcKey.match(/\.([^.]*)$/); - if (!typeMatch) { - console.log("Could not determine the image type."); - return; - } - - // Check that the image type is supported - const imageType = typeMatch[1].toLowerCase(); - if (imageType != "jpg" && imageType != "png") { - console.log(`Unsupported image type: ${imageType}`); - return; - } - - // Download the image from the S3 source bucket. - - try { - const params = { - Bucket: srcBucket, - Key: srcKey - }; - var origimage = await s3.getObject(params).promise(); - - } catch (error) { - console.log(error); - return; - } - - // set thumbnail width. Resize will set the height automatically to maintain aspect ratio. - const width = 200; - - // Use the sharp module to resize the image and save in a buffer. - try { - var buffer = await sharp(origimage.Body).resize(width).toBuffer(); - - } catch (error) { - console.log(error); - return; - } - - // Upload the thumbnail image to the destination bucket - try { - const destparams = { - Bucket: dstBucket, - Key: dstKey, - Body: buffer, - ContentType: "image" - }; - - const putResult = await s3.putObject(destparams).promise(); - - } catch (error) { - console.log(error); - return; - } - - console.log('Successfully resized ' + srcBucket + '/' + srcKey + - ' and uploaded to ' + dstBucket + '/' + dstKey); - }; - ``` - -1. In the `lambda-s3` directory, create a `node_modules` directory\. - - ``` - mkdir node_modules - cd node_modules - ``` - -1. In the `node_modules` directory, install the sharp library with npm\. - - ``` - npm install sharp - ``` - - After this step, you have the following directory structure: - - ``` - lambda-s3 - |- index.js - |- /node_modules/... - └ /node_modules/sharp - ``` - -1. Return to the `lambda-s3` directory\. - - ``` - cd lambda-s3 - ``` - -1. Create a deployment package with the function code and its dependencies\. Set the \-r \(recursive\) option for the zip command to compress the subfolders\. - - ``` - zip -r function.zip . - ``` - ------- -#### [ Python ] - -The Python deployment package for this tutorial uses the [Pillow \(PIL\)](https://pypi.org/project/Pillow/) library\. You can't use the AWS CLI to upload a deployment package that contains a C or C\+\+ library, such as Pillow\. Instead, use the AWS Serverless Application Model \(AWS SAM\) CLI [sam build](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-build.html) command with the `--use-container` option to create your deployment package\. Using the AWS SAM CLI with this option creates a Docker container with a Lambda\-like environment that is compatible with Lambda\. - -**Prerequisites** -+ [AWS SAM CLI version 1\.39 or later](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) - -**To create a deployment package using the AWS SAM** - -1. Open a command prompt and create a `lambda-s3` project directory\. - - ``` - mkdir lambda-s3 - ``` - -1. Navigate to the `lambda-s3` project directory\. - - ``` - cd lambda-s3 - ``` - -1. Copy the contents of the following sample Python code and save it in a new file named `lambda_function.py`: - - ``` - import boto3 - import os - import sys - import uuid - from urllib.parse import unquote_plus - from PIL import Image - import PIL.Image - - s3_client = boto3.client('s3') - - def resize_image(image_path, resized_path): - with Image.open(image_path) as image: - image.thumbnail(tuple(x / 2 for x in image.size)) - image.save(resized_path) - - def lambda_handler(event, context): - for record in event['Records']: - bucket = record['s3']['bucket']['name'] - key = unquote_plus(record['s3']['object']['key']) - tmpkey = key.replace('/', '') - download_path = '/tmp/{}{}'.format(uuid.uuid4(), tmpkey) - upload_path = '/tmp/resized-{}'.format(tmpkey) - s3_client.download_file(bucket, key, download_path) - resize_image(download_path, upload_path) - s3_client.upload_file(upload_path, '{}-resized'.format(bucket), 'resized-{}'.format(key)) - ``` - -1. Install the Pillow library to a new `package` directory\. - - ``` - pip install --target ./package pillow - ``` - -1. In the `lambda-s3` directory, create a new file called `template.yaml`\. This is [the AWS SAM template\.](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy.html) - - ``` - AWSTemplateFormatVersion: '2010-09-09' - Transform: AWS::Serverless-2016-10-31 - Resources: - CreateThumbnail: - Type: AWS::Serverless::Function - Properties: - Handler: lambda_function.lambda_handler - Runtime: python3.9 - Timeout: 10 - Policies: AWSLambdaExecute - Events: - CreateThumbnailEvent: - Type: S3 - Properties: - Bucket: !Ref SrcBucket - Events: s3:ObjectCreated:* - - SrcBucket: - Type: AWS::S3::Bucket - ``` - -1. Create a file called `requirements.txt` and add the following content\. This is the manifest file that specifies your dependencies\. If you installed a different version of Pillow, change the version number\. - - ``` - Pillow == 9.2.0 - ``` - -1. Build the deployment package\. The `--use-container` flag is required\. This flag locally compiles your functions in a Docker container that behaves like a Lambda environment, so they're in the right format when you deploy them\. - - ``` - sam build --use-container - ``` - ------- - -## Step 5\. Create the Lambda function - ------- -#### [ Node\.js ] - -``` -aws lambda create-function --function-name CreateThumbnail \ ---zip-file fileb://function.zip --handler index.handler --runtime nodejs16.x \ ---timeout 10 --memory-size 1024 \ ---role arn:aws:iam::123456789012:role/lambda-s3-role -``` - -For the `role` parameter, replace *123456789012* with your [AWS account ID](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html)\. - -The create\-function command specifies the function handler as `index.handler`\. This handler name reflects the function name as `handler`, and the name of the file where the handler code is stored as `index.js`\. For more information, see [AWS Lambda function handler in Node\.js](nodejs-handler.md)\. The command specifies a runtime of `nodejs16.x`\. For more information, see [Lambda runtimes](lambda-runtimes.md)\. - ------- -#### [ Python ] - -Run the following AWS SAM CLI command to deploy the package and create the Lambda function\. Follow the on\-screen prompts\. To accept the default options provided in the interactive experience, respond with `Enter`\. - -``` -sam deploy --guided -``` - ------- - -The function configuration includes a 10\-second timeout value\. Depending on the size of objects that you upload, you might need to increase the timeout value using the following AWS CLI command: - -``` -aws lambda update-function-configuration --function-name CreateThumbnail --timeout 30 -``` - -## Step 6\. Test the Lambda function - -Invoke the Lambda function manually using sample Amazon S3 event data\. - -**To test the Lambda function** - -1. In the project directory that you created earlier, save the following Amazon S3 sample event data in a file named `inputFile.txt`\. Be sure to replace the following values: - + *us\-west\-2* – The AWS Region where you created the Amazon S3 bucket and the Lambda function\. - + *sourcebucket* – The Amazon S3 source bucket that you created in step 1\. - + *HappyFace\.jpg* – The object key of the \.jpg or \.png image that you uploaded to the source bucket\. - - ``` - { - "Records":[ - { - "eventVersion":"2.0", - "eventSource":"aws:s3", - "awsRegion":"us-west-2", - "eventTime":"1970-01-01T00:00:00.000Z", - "eventName":"ObjectCreated:Put", - "userIdentity":{ - "principalId":"AIDAJDPLRKLG7UEXAMPLE" - }, - "requestParameters":{ - "sourceIPAddress":"127.0.0.1" - }, - "responseElements":{ - "x-amz-request-id":"C3D13FE58DE4C810", - "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD" - }, - "s3":{ - "s3SchemaVersion":"1.0", - "configurationId":"testConfigRule", - "bucket":{ - "name":"sourcebucket", - "ownerIdentity":{ - "principalId":"A3NL1KOZZKExample" - }, - "arn":"arn:aws:s3:::sourcebucket" - }, - "object":{ - "key":"HappyFace.jpg", - "size":1024, - "eTag":"d41d8cd98f00b204e9800998ecf8427e", - "versionId":"096fKKXTRTtl3on89fVO.nfljtsv6qko" - } - } - } - ] - } - ``` - -1. Invoke the function with the following invoke command\. Note that the command requests asynchronous execution \(`--invocation-type Event`\)\. Optionally, you can invoke the function synchronously by specifying `RequestResponse` as the `invocation-type` parameter value\. - - ``` - aws lambda invoke --function-name CreateThumbnail \ - --cli-binary-format raw-in-base64-out \ - --invocation-type Event \ - --payload file://inputFile.txt outputfile.txt - ``` - + The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - + If you get the error "Error parsing parameter '\-\-payload': Unable to load paramfile file://inputFile\.txt", make sure that you're in the directory where the `inputFile.txt` is saved\. - -1. Verify that the thumbnail is created in the target S3 bucket\. - -## Step 7\. Configure Amazon S3 to publish events - -Complete the configuration so that Amazon S3 can publish object\-created events to Lambda and invoke your Lambda function\. In this step, you do the following: -+ Add permissions to the function access policy to allow Amazon S3 to invoke the function\. -+ Add a notification configuration to your source S3 bucket\. In the notification configuration, you provide the following: - + The event type for which you want Amazon S3 to publish events\. For this tutorial, specify the `s3:ObjectCreated:*` event type so that Amazon S3 publishes events when objects are created\. - + The function to invoke\. - -**To add permissions to the function policy** - -1. Run the following add\-permission command to grant Amazon S3 service principal \(`s3.amazonaws.com`\) permissions to perform the `lambda:InvokeFunction` action\. Note that Amazon S3 is granted permission to invoke the function only if the following conditions are met: - + An object\-created event is detected on a specific S3 bucket\. - + The S3 bucket is owned by your AWS account\. If you delete a bucket, it is possible for another AWS account to create a bucket with the same Amazon Resource Name \(ARN\)\. - - ``` - aws lambda add-permission --function-name CreateThumbnail --principal s3.amazonaws.com \ - --statement-id s3invoke --action "lambda:InvokeFunction" \ - --source-arn arn:aws:s3:::sourcebucket \ - --source-account account-id - ``` - -1. Verify the function's access policy by running the get\-policy command\. - - ``` - aws lambda get-policy --function-name CreateThumbnail - ``` - -To have Amazon S3 publish object\-created events to Lambda, add a notification configuration on the source S3 bucket\. - -**Important** -This procedure configures the S3 bucket to invoke your function every time that an object is created in the bucket\. Be sure to configure this option only on the source bucket\. Do not have your function create objects in the source bucket, or your function could be [invoked continuously in a loop](with-s3.md#services-s3-runaway)\. - -**To configure notifications** - -1. Open the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Choose the name of the source S3 bucket\. - -1. Choose the **Properties** tab\. - -1. Under **Event notifications**, choose **Create event notification** to configure a notification with the following settings: - + **Event name** – **lambda\-trigger** - + **Event types** – **All object create events** - + **Destination** – **Lambda function** - + **Lambda function** – **CreateThumbnail**\. - -For more information on event configuration, see [Enabling and configuring event notifications using the Amazon S3 console](https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-event-notifications.html) in the *Amazon Simple Storage Service User Guide*\. - -## Step 8\. Test using the Amazon S3 trigger - -Test the setup as follows: - -1. Upload \.jpg or \.png objects to the source S3 bucket using the [Amazon S3 console](https://console.aws.amazon.com/s3)\. - -1. Verify for each image object that a thumbnail is created in the target S3 bucket using the `CreateThumbnail` Lambda function\. - -1. View logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. - -## Step 9\. Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the policy that you created** - -1. Open the [Policies page](https://console.aws.amazon.com/iam/home#/policies) of the IAM console\. - -1. Select the policy that you created \(**AWSLambdaS3Policy**\)\. - -1. Choose **Policy actions**, **Delete**\. - -1. Choose **Delete**\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the S3 bucket** - -1. Open the [Amazon S3 console\.](https://console.aws.amazon.com/s3/home#) - -1. Select the bucket you created\. - -1. Choose **Delete**\. - -1. Enter the name of the bucket in the text box\. - -1. Choose **Confirm**\. \ No newline at end of file diff --git a/doc_source/with-s3.md b/doc_source/with-s3.md deleted file mode 100644 index 0900fa4b..00000000 --- a/doc_source/with-s3.md +++ /dev/null @@ -1,60 +0,0 @@ -# Using AWS Lambda with Amazon S3 - -You can use Lambda to process [event notifications](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) from Amazon Simple Storage Service\. Amazon S3 can send an event to a Lambda function when an object is created or deleted\. You configure notification settings on a bucket, and grant Amazon S3 permission to invoke a function on the function's resource\-based permissions policy\. - -**Warning** -If your Lambda function uses the same bucket that triggers it, it could cause the function to run in a loop\. For example, if the bucket triggers a function each time an object is uploaded, and the function uploads an object to the bucket, then the function indirectly triggers itself\. To avoid this, use two buckets, or configure the trigger to only apply to a prefix used for incoming objects\. - -Amazon S3 invokes your function [asynchronously](invocation-async.md) with an event that contains details about the object\. The following example shows an event that Amazon S3 sent when a deployment package was uploaded to Amazon S3\. - -**Example Amazon S3 notification event** - -``` -{ - "Records": [ - { - "eventVersion": "2.1", - "eventSource": "aws:s3", - "awsRegion": "us-east-2", - "eventTime": "2019-09-03T19:37:27.192Z", - "eventName": "ObjectCreated:Put", - "userIdentity": { - "principalId": "AWS:AIDAINPONIXQXHT3IKHL2" - }, - "requestParameters": { - "sourceIPAddress": "205.255.255.255" - }, - "responseElements": { - "x-amz-request-id": "D82B88E5F771F645", - "x-amz-id-2": "vlR7PnpV2Ce81l0PRw6jlUpck7Jo5ZsQjryTjKlc5aLWGVHPZLj5NeC6qMa0emYBDXOo6QBU0Wo=" - }, - "s3": { - "s3SchemaVersion": "1.0", - "configurationId": "828aa6fc-f7b5-4305-8584-487c791949c1", - "bucket": { - "name": "DOC-EXAMPLE-BUCKET", - "ownerIdentity": { - "principalId": "A3I5XTEXAMAI3E" - }, - "arn": "arn:aws:s3:::lambda-artifacts-deafc19498e3f2df" - }, - "object": { - "key": "b21b84d653bb07b05b1e6b33684dc11b", - "size": 1305107, - "eTag": "b21b84d653bb07b05b1e6b33684dc11b", - "sequencer": "0C0F6F405D6ED209E1" - } - } - } - ] -} -``` - -To invoke your function, Amazon S3 needs permission from the function's [resource\-based policy](access-control-resource-based.md)\. When you configure an Amazon S3 trigger in the Lambda console, the console modifies the resource\-based policy to allow Amazon S3 to invoke the function if the bucket name and account ID match\. If you configure the notification in Amazon S3, you use the Lambda API to update the policy\. You can also use the Lambda API to grant permission to another account, or restrict permission to a designated alias\. - -If your function uses the AWS SDK to manage Amazon S3 resources, it also needs Amazon S3 permissions in its [execution role](lambda-intro-execution-role.md)\. - -**Topics** -+ [Tutorial: Using an Amazon S3 trigger to invoke a Lambda function](with-s3-example.md) -+ [Tutorial: Using an Amazon S3 trigger to create thumbnail images](with-s3-tutorial.md) -+ [AWS SAM template for an Amazon S3 application](with-s3-example-use-app-spec.md) \ No newline at end of file diff --git a/doc_source/with-secrets-manager.md b/doc_source/with-secrets-manager.md deleted file mode 100644 index 0dd06a0a..00000000 --- a/doc_source/with-secrets-manager.md +++ /dev/null @@ -1,15 +0,0 @@ -# Using AWS Lambda with Secrets Manager - -Secrets Manager uses a Lambda function to [ rotate the secret](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) for a secured service or database\. You can customize the Lambda function to implement the service\-specific details of rotating a secret\. - -Secrets Manager invokes the Lambda rotation function as a synchronous invocation\. The event parameter contains the following fields: - -``` -{ - "Step" : "request.type", - "SecretId" : "string", - "ClientRequestToken" : "string" -} -``` - -For more information about using Lambda with Secrets Manager, see [Understanding Your Lambda rotation function](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets-lambda-function-customizing.html)\. \ No newline at end of file diff --git a/doc_source/with-sns-create-package.md b/doc_source/with-sns-create-package.md deleted file mode 100644 index 25919e17..00000000 --- a/doc_source/with-sns-create-package.md +++ /dev/null @@ -1,114 +0,0 @@ -# Sample function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js 12\.x](#with-sns-example-deployment-pkg-nodejs) -+ [Java 11](#with-sns-example-deployment-pkg-java) -+ [Go](#with-sns-example-deployment-pkg-go) -+ [Python 3](#with-sns-example-deployment-pkg-python) - -## Node\.js 12\.x - -The following example processes messages from Amazon SNS, and logs their contents\. - -**Example index\.js** - -``` -console.log('Loading function'); - -exports.handler = function(event, context, callback) { -// console.log('Received event:', JSON.stringify(event, null, 4)); - - var message = event.Records[0].Sns.Message; - console.log('Message received from SNS:', message); - callback(null, "Success"); -}; -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Java 11 - -The following example processes messages from Amazon SNS, and logs their contents\. - -**Example LogEvent\.java** - -``` -package example; - -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.events.SNSEvent; - -public class LogEvent implements RequestHandler { - public Object handleRequest(SNSEvent request, Context context){ - String timeStamp = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(Calendar.getInstance().getTime()); - context.getLogger().log("Invocation started: " + timeStamp); - context.getLogger().log(request.getRecords().get(0).getSNS().getMessage()); - - timeStamp = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(Calendar.getInstance().getTime()); - context.getLogger().log("Invocation completed: " + timeStamp); - return null; - } -} -``` - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` - -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -## Go - -The following example processes messages from Amazon SNS, and logs their contents\. - -**Example lambda\_handler\.go** - -``` -package main - -import ( - "context" - "fmt" - "github.com/aws/aws-lambda-go/lambda" - "github.com/aws/aws-lambda-go/events" -) - -func handler(ctx context.Context, snsEvent events.SNSEvent) { - for _, record := range snsEvent.Records { - snsRecord := record.SNS - fmt.Printf("[%s %s] Message = %s \n", record.EventSource, snsRecord.Timestamp, snsRecord.Message) - } -} - -func main() { - lambda.Start(handler) -} -``` - -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. - -## Python 3 - -The following example processes messages from Amazon SNS, and logs their contents\. - -**Example lambda\_handler\.py** - -``` -from __future__ import print_function -import json -print('Loading function') - -def lambda_handler(event, context): - #print("Received event: " + json.dumps(event, indent=2)) - message = event['Records'][0]['Sns']['Message'] - print("From SNS: " + message) - return message -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. \ No newline at end of file diff --git a/doc_source/with-sns-example.md b/doc_source/with-sns-example.md deleted file mode 100644 index ba5bbb4a..00000000 --- a/doc_source/with-sns-example.md +++ /dev/null @@ -1,217 +0,0 @@ -# Tutorial: Using AWS Lambda with Amazon Simple Notification Service - -You can use a Lambda function in one AWS account to subscribe to an Amazon SNS topic in a separate AWS account\. In this tutorial, you use the AWS Command Line Interface to perform AWS Lambda operations such as creating a Lambda function, creating an Amazon SNS topic and granting permissions to allow these two resources to access each other\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -In the tutorial, you use two accounts\. The AWS CLI commands illustrate this by using two [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html), each configured for use with a different account\. If you use profiles with different names, or the default profile and one named profile, modify the commands as needed\. - -## Create an Amazon SNS topic \(account A\) - -In **Account A**, create the source Amazon SNS topic\. - -``` -aws sns create-topic --name sns-topic-for-lambda --profile accountA -``` - -After creating the topic, record its Amazon Resource Name \(ARN\)\. You need it later when you add permissions to the Lambda function to subscribe to the topic\. - -## Create the execution role \(account B\) - -In **Account B**, create the [execution role](lambda-intro-execution-role.md) that gives your function permission to access AWS resources\. - -**To create an execution role** - -1. Open the [roles page](https://console.aws.amazon.com/iam/home#/roles) in the IAM console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaBasicExecutionRole**\. - + **Role name** – **lambda\-sns\-role**\. - -The **AWSLambdaBasicExecutionRole** policy has the permissions that the function needs to write logs to CloudWatch Logs\. - -## Create a Lambda function \(account B\) - -In **Account B**, create the function that processes events from Amazon SNS\. The following example code receives an Amazon SNS event input and processes the messages that it contains\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Note** -For sample code in other languages, see [Sample function code](with-sns-create-package.md)\. - -**Example index\.js** - -``` -console.log('Loading function'); - -exports.handler = function(event, context, callback) { -// console.log('Received event:', JSON.stringify(event, null, 4)); - - var message = event.Records[0].Sns.Message; - console.log('Message received from SNS:', message); - callback(null, "Success"); -}; -``` - -**To create the function** - -1. Copy the sample code into a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create a Lambda function with the `create-function` command\. - - ``` - aws lambda create-function --function-name Function-With-SNS \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam:::role/lambda-sns-role \ - --timeout 60 --profile accountB - ``` - -After creating the function, record its function ARN\. You need it later when you add permissions to allow Amazon SNS to invoke your function\. - -## Set up cross\-account permissions \(account A and B\) - -In **Account A**, grant permission to **Account B** to subscribe to the topic: - -``` -aws sns add-permission --label lambda-access --aws-account-id \ ---topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ ---action-name Subscribe ListSubscriptionsByTopic --profile accountA -``` - -In **Account B**, add the Lambda permission to allow invocation from Amazon SNS\. - -``` -aws lambda add-permission --function-name Function-With-SNS \ ---source-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ ---statement-id function-with-sns --action "lambda:InvokeFunction" \ ---principal sns.amazonaws.com --profile accountB -``` - -You should see the following output: - -``` -{ - "Statement": "{\"Condition\":{\"ArnLike\":{\"AWS:SourceArn\": - \"arn:aws:sns:us-east-2::sns-topic-for-lambda\"}}, - \"Action\":[\"lambda:InvokeFunction\"], - \"Resource\":\"arn:aws:lambda:us-east-2::function:Function-With-SNS\", - \"Effect\":\"Allow\",\"Principal\":{\"Service\":\"sns.amazonaws.com\"}, - \"Sid\":\"function-with-sns1\"}" -} -``` - -Do not use the `--source-account` parameter to add a source account to the Lambda policy when adding the policy\. Source account is not supported for Amazon SNS event sources and will result in access being denied\. - -**Note** -If the account with the SNS topic is hosted in an [opt\-in region](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable), you need to specify the region in the principal\. For example, if you're working with an SNS topic in the Asia Pacific \(Hong Kong\) region, you need to specify `sns.ap-east-1.amazonaws.com` instead of `sns.amazonaws.com` for the principal\. - -## Create a subscription \(account B\) - -In **Account B**, subscribe the Lambda function to the topic\. When a message is sent to the `sns-topic-for-lambda` topic in **Account A**, Amazon SNS invokes the `Function-With-SNS` function in **Account B**\. - -``` -aws sns subscribe --protocol lambda \ ---topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ ---notification-endpoint arn:aws:lambda:us-east-2::function:Function-With-SNS \ ---profile accountB -``` - -You should see the following output: - -``` -{ - "SubscriptionArn": "arn:aws:sns:us-east-2::sns-topic-for-lambda:5d906xxxx-7c8x-45dx-a9dx-0484e31c98xx" -} -``` - -The output contains the ARN of the topic subscription\. - -## Test subscription \(account A\) - -In **Account A**, test the subscription\. Type `Hello World` into a text file and save it as `message.txt`\. Then run the following command: - -``` -aws sns publish --message file://message.txt --subject Test \ ---topic-arn arn:aws:sns:us-east-2::sns-topic-for-lambda \ ---profile accountA -``` - -This will return a message id with a unique identifier, indicating the message has been accepted by the Amazon SNS service\. Amazon SNS will then attempt to deliver it to the topic's subscribers\. Alternatively, you could supply a JSON string directly to the `message` parameter, but using a text file allows for line breaks in the message\. - -To learn more about Amazon SNS, see [What is Amazon Simple Notification Service](https://docs.aws.amazon.com/sns/latest/dg/)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -In **Account A**, clean up your Amazon SNS topic\. - -**To delete the Amazon SNS topic** - -1. Open the [Topics page](https://console.aws.amazon.com/sns/home#topics:) of the Amazon SNS console\. - -1. Select the topic you created\. - -1. Choose **Delete**\. - -1. Enter **delete me** in the text box\. - -1. Choose **Delete**\. - -In **Account B**, clean up your execution role, Lambda function, and Amazon SNS subscription\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the Amazon SNS subscription** - -1. Open the [Subscriptions page](https://console.aws.amazon.com/sns/home#subscriptions:) of the Amazon SNS console\. - -1. Select the subscription you created\. - -1. Choose **Delete**, **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sns.md b/doc_source/with-sns.md deleted file mode 100644 index 3bcc95cb..00000000 --- a/doc_source/with-sns.md +++ /dev/null @@ -1,58 +0,0 @@ -# Using AWS Lambda with Amazon SNS - -You can use a Lambda function to process Amazon Simple Notification Service \(Amazon SNS\) notifications\. Amazon SNS supports Lambda functions as a target for messages sent to a topic\. You can subscribe your function to topics in the same account or in other AWS accounts\. - -Amazon SNS invokes your function [asynchronously](invocation-async.md) with an event that contains a message and metadata\. - -**Example Amazon SNS message event** - -``` -{ - "Records": [ - { - "EventVersion": "1.0", - "EventSubscriptionArn": "arn:aws:sns:us-east-2:123456789012:sns-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "EventSource": "aws:sns", - "Sns": { - "SignatureVersion": "1", - "Timestamp": "2019-01-02T12:45:07.000Z", - "Signature": "tcc6faL2yUC6dgZdmrwh1Y4cGa/ebXEkAi6RibDsvpi+tE/1+82j...65r==", - "SigningCertUrl": "https://sns.us-east-2.amazonaws.com/SimpleNotificationService-ac565b8b1a6c5d002d285f9598aa1d9b.pem", - "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e", - "Message": "Hello from SNS!", - "MessageAttributes": { - "Test": { - "Type": "String", - "Value": "TestString" - }, - "TestBinary": { - "Type": "Binary", - "Value": "TestBinary" - } - }, - "Type": "Notification", - "UnsubscribeUrl": "https://sns.us-east-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-2:123456789012:test-lambda:21be56ed-a058-49f5-8c98-aedd2564c486", - "TopicArn":"arn:aws:sns:us-east-2:123456789012:sns-lambda", - "Subject": "TestInvoke" - } - } - ] -} -``` - -For asynchronous invocation, Lambda queues the message and handles retries\. If Amazon SNS can't reach Lambda or the message is rejected, Amazon SNS retries at increasing intervals over several hours\. For details, see [Reliability](http://aws.amazon.com/sns/faqs/#Reliability) in the Amazon SNS FAQs\. - -To perform cross\-account Amazon SNS deliveries to Lambda, you must authorize Amazon SNS to invoke your Lambda function\. In turn, Amazon SNS must allow the AWS account with the Lambda function to subscribe to the Amazon SNS topic\. For example, if the Amazon SNS topic is in account A and the Lambda function is in account B, both accounts must grant permissions to the other to access their respective resources\. Since not all the options for setting up cross\-account permissions are available from the AWS Management Console, you must use the AWS Command Line Interface \(AWS CLI\) for setup\. - -For more information, see [Fanout to Lambda functions](https://docs.aws.amazon.com/sns/latest/dg/sns-lambda-as-subscriber.html) in the *Amazon Simple Notification Service Developer Guide*\. - -**Input types for Amazon SNS events** - -For input type examples for Amazon SNS events in Java, \.NET, and Go, see the following on the AWS GitHub repository: -+ [SNSEvent\.java](https://github.com/aws/aws-lambda-java-libs/blob/master/aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/SNSEvent.java) -+ [SNSEvent\.cs](https://github.com/aws/aws-lambda-dotnet/blob/master/Libraries/src/Amazon.Lambda.SNSEvents/SNSEvent.cs) -+ [sns\.go](https://github.com/aws/aws-lambda-go/blob/master/events/sns.go) - -**Topics** -+ [Tutorial: Using AWS Lambda with Amazon Simple Notification Service](with-sns-example.md) -+ [Sample function code](with-sns-create-package.md) \ No newline at end of file diff --git a/doc_source/with-sqs-create-package.md b/doc_source/with-sqs-create-package.md deleted file mode 100644 index 74fb39e9..00000000 --- a/doc_source/with-sqs-create-package.md +++ /dev/null @@ -1,152 +0,0 @@ -# Sample Amazon SQS function code - -Sample code is available for the following languages\. - -**Topics** -+ [Node\.js](#with-sqs-example-deployment-pkg-nodejs) -+ [Java](#with-sqs-example-deployment-pkg-java) -+ [C\#](#with-sqs-example-deployment-pkg-dotnet) -+ [Go](#with-sqs-example-deployment-pkg-go) -+ [Python](#with-sqs-example-deployment-pkg-python) - -## Node\.js - -The following is example code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Example index\.js \(Node\.js 12\)** - -``` -exports.handler = async function(event, context) { - event.Records.forEach(record => { - const { body } = record; - console.log(body); - }); - return {}; -} -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Node\.js Lambda functions with \.zip file archives](nodejs-package.md)\. - -## Java - -The following is example Java code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -In the code, `handleRequest` is the handler\. The handler uses the predefined `SQSEvent` class that is defined in the `aws-lambda-java-events` library\. - -**Example Handler\.java** - -``` -package example; - -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage; - -public class Handler implements RequestHandler{ - @Override - public Void handleRequest(SQSEvent event, Context context) - { - for(SQSMessage msg : event.getRecords()){ - System.out.println(new String(msg.getBody())); - } - return null; - } -} -``` - -**Dependencies** -+ `aws-lambda-java-core` -+ `aws-lambda-java-events` - -Build the code with the Lambda library dependencies to create a deployment package\. For instructions, see [Deploy Java Lambda functions with \.zip or JAR file archives](java-package.md)\. - -## C\# - -The following is example C\# code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to the console\. - -In the code, `HandleSQSEvent` is the handler\. The handler uses the predefined `SQSEvent` class that is defined in the `AWS.Lambda.SQSEvents` library\. - -**Example ProcessingSQSRecords\.cs** - -``` -[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] - -namespace SQSLambdaFunction -{ - public class SQSLambdaFunction - { - public string HandleSQSEvent(SQSEvent sqsEvent, ILambdaContext context) - { - Console.WriteLine($"Beginning to process {sqsEvent.Records.Count} records..."); - - foreach (var record in sqsEvent.Records) - { - Console.WriteLine($"Message ID: {record.MessageId}"); - Console.WriteLine($"Event Source: {record.EventSource}"); - - Console.WriteLine($"Record Body:"); - Console.WriteLine(record.Body); - } - - Console.WriteLine("Processing complete."); - - return $"Processed {sqsEvent.Records.Count} records."; - } - } -} -``` - -Replace the `Program.cs` in a \.NET Core project with the above sample\. For instructions, see [Deploy C\# Lambda functions with \.zip file archives](csharp-package.md)\. - -## Go - -The following is example Go code that receives an Amazon SQS event message as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - - In the code, `handler` is the handler\. The handler uses the predefined `SQSEvent` class that is defined in the `aws-lambda-go-events` library\. - -**Example ProcessSQSRecords\.go** - -``` -package main - -import ( - "context" - "fmt" - - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambda" -) - -func handler(ctx context.Context, sqsEvent events.SQSEvent) error { - for _, message := range sqsEvent.Records { - fmt.Printf("The message %s for event source %s = %s \n", message.MessageId, message.EventSource, message.Body) - } - - return nil -} - -func main() { - lambda.Start(handler) -} -``` - -Build the executable with `go build` and create a deployment package\. For instructions, see [Deploy Go Lambda functions with \.zip file archives](golang-package.md)\. - -## Python - -The following is example Python code that accepts an Amazon SQS record as input and processes it\. For illustration, the code writes some of the incoming event data to CloudWatch Logs\. - -**Example ProcessSQSRecords\.py** - -``` -from __future__ import print_function - -def lambda_handler(event, context): - for record in event['Records']: - print("test") - payload = record["body"] - print(str(payload)) -``` - -Zip up the sample code to create a deployment package\. For instructions, see [Deploy Python Lambda functions with \.zip file archives](python-package.md)\. diff --git a/doc_source/with-sqs-cross-account-example.md b/doc_source/with-sqs-cross-account-example.md deleted file mode 100644 index 47d7f89a..00000000 --- a/doc_source/with-sqs-cross-account-example.md +++ /dev/null @@ -1,237 +0,0 @@ -# Tutorial: Using a cross\-account Amazon SQS queue as an event source - -In this tutorial, you create a Lambda function that consumes messages from an Amazon Simple Queue Service \(Amazon SQS\) queue in a different AWS account\. This tutorial involves two AWS accounts: **Account A** refers to the account that contains your Lambda function, and **Account B** refers to the account that contains the Amazon SQS queue\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role \(Account A\) - -In **Account A**, create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. - -**To create an execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) in the AWS Identity and Access Management \(IAM\) console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda** - + **Permissions** – **AWSLambdaSQSQueueExecutionRole** - + **Role name** – **cross\-account\-lambda\-sqs\-role** - -The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. - -## Create the function \(Account A\) - -In **Account A**, create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. - -**Note** -For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. - -**Example index\.js** - -``` -exports.handler = async function(event, context) { - event.Records.forEach(record => { - const { body } = record; - console.log(body); - }); - return {}; -} -``` - -**To create the function** -**Note** -Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. - -1. Save the code example as a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. - - ``` - aws lambda create-function --function-name CrossAccountSQSExample \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam:::role/cross-account-lambda-sqs-role - ``` - -## Test the function \(Account A\) - -In **Account A**, test your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. - -If the handler returns normally without exceptions, Lambda considers the message to be successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. - -1. Save the following JSON as a file named `input.txt`\. - - ``` - { - "Records": [ - { - "messageId": "059f36b4-87a3-44ab-83d2-661975830a7d", - "receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...", - "body": "test", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1545082649183", - "SenderId": "AIDAIENQZJOLO23YVJ4VO", - "ApproximateFirstReceiveTimestamp": "1545082649185" - }, - "messageAttributes": {}, - "md5OfBody": "098f6bcd4621d373cade4e832627b4f6", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-east-1:123456789012:example-queue", - "awsRegion": "us-east-1" - } - ] - } - ``` - - The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. - -1. Run the following `invoke` AWS CLI command\. - - ``` - aws lambda invoke --function-name CrossAccountSQSExample \ - --payload file://input.txt outputfile.txt - ``` - - The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -1. Verify the output in the file `outputfile.txt`\. - -## Create an Amazon SQS queue \(Account B\) - -In **Account B**, create an Amazon SQS queue that the Lambda function in **Account A** can use as an event source\. - -**To create a queue** - -1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. - -1. Choose **Create queue**\. - -1. Create a queue with the following properties\. - + **Type** – **Standard** - + **Name** – **LambdaCrossAccountQueue** - + **Configuration** – Keep the default settings\. - + **Access policy** – Choose **Advanced**\. Paste in the following JSON policy: - - ``` - { - "Version": "2012-10-17", - "Id": "Queue1_Policy_UUID", - "Statement": [{ - "Sid":"Queue1_AllActions", - "Effect": "Allow", - "Principal": { - "AWS": [ - "arn:aws:iam:::role/cross-account-lambda-sqs-role" - ] - }, - "Action": "sqs:*", - "Resource": "arn:aws:sqs:us-east-1::LambdaCrossAccountQueue" - } - ] - } - ``` - - This policy grants the Lambda execution role in **Account A** permissions to consume messages from this Amazon SQS queue\. - -1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. - -## Configure the event source \(Account A\) - -In **Account A**, create an event source mapping between the Amazon SQS queue in **Account B** and your Lambda function by running the following `create-event-source-mapping` AWS CLI command\. - -``` -aws lambda create-event-source-mapping --function-name CrossAccountSQSExample --batch-size 10 \ ---event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue -``` - -To get a list of your event source mappings, run the following command\. - -``` -aws lambda list-event-source-mappings --function-name CrossAccountSQSExample \ ---event-source-arn arn:aws:sqs:us-east-1::LambdaCrossAccountQueue -``` - -## Test the setup - -You can now test the setup as follows: - -1. In **Account B**, open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. - -1. Choose **LambdaCrossAccountQueue**, which you created earlier\. - -1. Choose **Send and receive messages**\. - -1. Under **Message body**, enter a test message\. - -1. Choose **Send message**\. - -Your Lambda function in **Account A** should receive the message\. Lambda will continue to poll the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -In **Account A**, clean up your execution role and Lambda function\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -In **Account B**, clean up the Amazon SQS queue\. - -**To delete the Amazon SQS queue** - -1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. - -1. Select the queue you created\. - -1. Choose **Delete**\. - -1. Enter **delete** in the text box\. - -1. Choose **Delete**\. diff --git a/doc_source/with-sqs-example-use-app-spec.md b/doc_source/with-sqs-example-use-app-spec.md deleted file mode 100644 index 93a3b751..00000000 --- a/doc_source/with-sqs-example-use-app-spec.md +++ /dev/null @@ -1,29 +0,0 @@ -# AWS SAM template for an Amazon SQS application - -You can build this application using [AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/)\. To learn more about creating AWS SAM templates, see [AWS SAM template basics](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html) in the *AWS Serverless Application Model Developer Guide*\. - -Below is a sample AWS SAM template for the Lambda application from the [tutorial](with-sqs-example.md)\. Copy the text below to a \.yaml file and save it next to the ZIP package you created previously\. Note that the `Handler` and `Runtime` parameter values should match the ones you used when you created the function in the previous section\. - -**Example template\.yaml** - -``` -AWSTemplateFormatVersion: '2010-09-09' -Transform: AWS::Serverless-2016-10-31 -Description: Example of processing messages on an SQS queue with Lambda -Resources: - MySQSQueueFunction: - Type: [AWS::Serverless::Function](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html) - Properties: - Handler: index.handler - Runtime: nodejs12.x - Events: - MySQSEvent: - Type: SQS - Properties: - Queue: !GetAtt MySqsQueue.Arn - BatchSize: 10 - MySqsQueue: - Type: AWS::SQS::Queue -``` - -For information on how to package and deploy your serverless application using the package and deploy commands, see [Deploying serverless applications](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-deploying.html) in the *AWS Serverless Application Model Developer Guide*\. \ No newline at end of file diff --git a/doc_source/with-sqs-example.md b/doc_source/with-sqs-example.md deleted file mode 100644 index 15473f22..00000000 --- a/doc_source/with-sqs-example.md +++ /dev/null @@ -1,206 +0,0 @@ -# Tutorial: Using Lambda with Amazon SQS - -In this tutorial, you create a Lambda function that consumes messages from an [Amazon Simple Queue Service \(Amazon SQS\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html) queue\. - -## Prerequisites - -This tutorial assumes that you have some knowledge of basic Lambda operations and the Lambda console\. If you haven't already, follow the instructions in [Create a Lambda function with the console](getting-started.md#getting-started-create-function) to create your first Lambda function\. - -To complete the following steps, you need a command line terminal or shell to run commands\. Commands and the expected output are listed in separate blocks: - -``` -aws --version -``` - -You should see the following output: - -``` -aws-cli/2.0.57 Python/3.7.4 Darwin/19.6.0 exe/x86_64 -``` - -For long commands, an escape character \(`\`\) is used to split a command over multiple lines\. - -On Linux and macOS, use your preferred shell and package manager\. - -**Note** -On Windows, some Bash CLI commands that you commonly use with Lambda \(such as `zip`\) are not supported by the operating system's built\-in terminals\. To get a Windows\-integrated version of Ubuntu and Bash, [install the Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\. - -## Create the execution role - -Create an [execution role](lambda-intro-execution-role.md) that gives your function permission to access the required AWS resources\. - -**To create an execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the AWS Identity and Access Management \(IAM\) console\. - -1. Choose **Create role**\. - -1. Create a role with the following properties\. - + **Trusted entity** – **AWS Lambda**\. - + **Permissions** – **AWSLambdaSQSQueueExecutionRole**\. - + **Role name** – **lambda\-sqs\-role**\. - -The **AWSLambdaSQSQueueExecutionRole** policy has the permissions that the function needs to read items from Amazon SQS and to write logs to Amazon CloudWatch Logs\. - -## Create the function - -Create a Lambda function that processes your Amazon SQS messages\. The following Node\.js 12 code example writes each message to a log in CloudWatch Logs\. - -**Note** -For code examples in other languages, see [Sample Amazon SQS function code](with-sqs-create-package.md)\. - -**Example index\.js** - -``` -exports.handler = async function(event, context) { - event.Records.forEach(record => { - const { body } = record; - console.log(body); - }); - return {}; -} -``` - -**To create the function** -**Note** -Following these steps creates a function in Node\.js 12\. For other languages, the steps are similar, but some details are different\. - -1. Save the code example as a file named `index.js`\. - -1. Create a deployment package\. - - ``` - zip function.zip index.js - ``` - -1. Create the function using the `create-function` AWS Command Line Interface \(AWS CLI\) command\. - - ``` - aws lambda create-function --function-name ProcessSQSRecord \ - --zip-file fileb://function.zip --handler index.handler --runtime nodejs12.x \ - --role arn:aws:iam::123456789012:role/lambda-sqs-role - ``` - -## Test the function - -Invoke your Lambda function manually using the `invoke` AWS CLI command and a sample Amazon SQS event\. - -If the handler returns normally without exceptions, Lambda considers the message successfully processed and begins reading new messages in the queue\. After successfully processing a message, Lambda automatically deletes it from the queue\. If the handler throws an exception, Lambda considers the batch of messages not successfully processed, and Lambda invokes the function with the same batch of messages\. - -1. Save the following JSON as a file named `input.txt`\. - - ``` - { - "Records": [ - { - "messageId": "059f36b4-87a3-44ab-83d2-661975830a7d", - "receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...", - "body": "test", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1545082649183", - "SenderId": "AIDAIENQZJOLO23YVJ4VO", - "ApproximateFirstReceiveTimestamp": "1545082649185" - }, - "messageAttributes": {}, - "md5OfBody": "098f6bcd4621d373cade4e832627b4f6", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:my-queue", - "awsRegion": "us-east-2" - } - ] - } - ``` - - The preceding JSON simulates an event that Amazon SQS might send to your Lambda function, where `"body"` contains the actual message from the queue\. - -1. Run the following `invoke` AWS CLI command\. - - ``` - aws lambda invoke --function-name ProcessSQSRecord \ - --payload file://input.txt outputfile.txt - ``` - - The cli\-binary\-format option is required if you're using AWS CLI version 2\. To make this the default setting, run `aws configure set cli-binary-format raw-in-base64-out`\. For more information, see [AWS CLI supported global command line options](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-options.html#cli-configure-options-list)\. - -1. Verify the output in the file `outputfile.txt`\. - -## Create an Amazon SQS queue - -Create an Amazon SQS queue that the Lambda function can use as an event source\. - -**To create a queue** - -1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. - -1. Choose **Create queue**, and then configure the queue\. For detailed instructions, see [Creating an Amazon SQS queue \(console\)](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) in the *Amazon Simple Queue Service Developer Guide*\. - -1. After creating the queue, record its Amazon Resource Name \(ARN\)\. You need this in the next step when you associate the queue with your Lambda function\. - -## Configure the event source - -To create a mapping between your Amazon SQS queue and your Lambda function, run the following `create-event-source-mapping` AWS CLI command\. - -``` -aws lambda create-event-source-mapping --function-name ProcessSQSRecord --batch-size 10 \ ---event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue -``` - -To get a list of your event source mappings, run the following command\. - -``` -aws lambda list-event-source-mappings --function-name ProcessSQSRecord \ ---event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue -``` - -## Test the setup - -Now you can test the setup as follows: - -1. Open the [Amazon SQS console](https://console.aws.amazon.com/sqs)\. - -1. Choose the name of the queue that you created earlier\. - -1. Choose **Send and receive messages**\. - -1. Under **Message body**, enter a test message\. - -1. Choose **Send message**\. - -Lambda polls the queue for updates\. When there is a new message, Lambda invokes your function with this new event data from the queue\. Your function runs and creates logs in Amazon CloudWatch\. You can view the logs in the [CloudWatch console](https://console.aws.amazon.com/cloudwatch)\. - -## Clean up your resources - -You can now delete the resources that you created for this tutorial, unless you want to retain them\. By deleting AWS resources that you're no longer using, you prevent unnecessary charges to your AWS account\. - -**To delete the execution role** - -1. Open the [Roles page](https://console.aws.amazon.com/iam/home#/roles) of the IAM console\. - -1. Select the execution role that you created\. - -1. Choose **Delete role**\. - -1. Choose **Yes, delete**\. - -**To delete the Lambda function** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Select the function that you created\. - -1. Choose **Actions**, then choose **Delete**\. - -1. Choose **Delete**\. - -**To delete the Amazon SQS queue** - -1. Sign in to the AWS Management Console and open the Amazon SQS console at [https://console\.aws\.amazon\.com/sqs/](https://console.aws.amazon.com/sqs/)\. - -1. Select the queue you created\. - -1. Choose **Delete**\. - -1. Enter **delete** in the text box\. - -1. Choose **Delete**\. \ No newline at end of file diff --git a/doc_source/with-sqs.md b/doc_source/with-sqs.md deleted file mode 100644 index 31c29e21..00000000 --- a/doc_source/with-sqs.md +++ /dev/null @@ -1,293 +0,0 @@ -# Using Lambda with Amazon SQS - -You can use a Lambda function to process messages in an Amazon Simple Queue Service \(Amazon SQS\) queue\. Lambda [event source mappings](invocation-eventsourcemapping.md) support [standard queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) and [first\-in, first\-out \(FIFO\) queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html)\. With Amazon SQS, you can offload tasks from one component of your application by sending them to a queue and processing them asynchronously\. - -Lambda polls the queue and invokes your Lambda function [synchronously](invocation-sync.md) with an event that contains queue messages\. Lambda reads messages in batches and invokes your function once for each batch\. When your function successfully processes a batch, Lambda deletes its messages from the queue\. The following example shows an event for a batch of two messages\. - -**Example Amazon SQS message event \(standard queue\)** - -``` -{ - "Records": [ - { - "messageId": "059f36b4-87a3-44ab-83d2-661975830a7d", - "receiptHandle": "AQEBwJnKyrHigUMZj6rYigCgxlaS3SLy0a...", - "body": "Test message.", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1545082649183", - "SenderId": "AIDAIENQZJOLO23YVJ4VO", - "ApproximateFirstReceiveTimestamp": "1545082649185" - }, - "messageAttributes": {}, - "md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:my-queue", - "awsRegion": "us-east-2" - }, - { - "messageId": "2e1424d4-f796-459a-8184-9c92662be6da", - "receiptHandle": "AQEBzWwaftRI0KuVm4tP+/7q1rGgNqicHq...", - "body": "Test message.", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1545082650636", - "SenderId": "AIDAIENQZJOLO23YVJ4VO", - "ApproximateFirstReceiveTimestamp": "1545082650649" - }, - "messageAttributes": {}, - "md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:my-queue", - "awsRegion": "us-east-2" - } - ] -} -``` - -By default, Lambda polls up to 10 messages in your queue at once and sends that batch to your function\. To avoid invoking the function with a small number of records, you can tell the event source to buffer records for up to 5 minutes by configuring a batch window\. Before invoking the function, Lambda continues to poll messages from the SQS standard queue until the batch window expires, the [invocation payload size quota](gettingstarted-limits.md) is reached, or the configured maximum batch size is reached\. - -**Note** -If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function\. This is true even if you set a batch window lower than 20 seconds\. - -For FIFO queues, records contain additional attributes that are related to deduplication and sequencing\. - -**Example Amazon SQS message event \(FIFO queue\)** - -``` -{ - "Records": [ - { - "messageId": "11d6ee51-4cc7-4302-9e22-7cd8afdaadf5", - "receiptHandle": "AQEBBX8nesZEXmkhsmZeyIE8iQAMig7qw...", - "body": "Test message.", - "attributes": { - "ApproximateReceiveCount": "1", - "SentTimestamp": "1573251510774", - "SequenceNumber": "18849496460467696128", - "MessageGroupId": "1", - "SenderId": "AIDAIO23YVJENQZJOL4VO", - "MessageDeduplicationId": "1", - "ApproximateFirstReceiveTimestamp": "1573251510774" - }, - "messageAttributes": {}, - "md5OfBody": "e4e68fb7bd0e697a0ae8f1bb342846b3", - "eventSource": "aws:sqs", - "eventSourceARN": "arn:aws:sqs:us-east-2:123456789012:fifo.fifo", - "awsRegion": "us-east-2" - } - ] -} -``` - -When Lambda reads a batch, the messages stay in the queue but are hidden for the length of the queue's [visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)\. If your function successfully processes the batch, Lambda deletes the messages from the queue\. By default, if your function encounters an error while processing a batch, all messages in that batch become visible in the queue again\. For this reason, your function code must be able to process the same message multiple times without unintended side effects\. You can modify this reprocessing behavior by configuring your event source mapping to include [batch item failures](#services-sqs-batchfailurereporting) in your function response\. - -**Topics** -+ [Scaling and processing](#events-sqs-scaling) -+ [Configuring a queue to use with Lambda](#events-sqs-queueconfig) -+ [Execution role permissions](#events-sqs-permissions) -+ [Configuring a queue as an event source](#events-sqs-eventsource) -+ [Event source mapping APIs](#events-sqs-api) -+ [Reporting batch item failures](#services-sqs-batchfailurereporting) -+ [Amazon SQS configuration parameters](#services-sqs-params) -+ [Tutorial: Using Lambda with Amazon SQS](with-sqs-example.md) -+ [Tutorial: Using a cross\-account Amazon SQS queue as an event source](with-sqs-cross-account-example.md) -+ [Sample Amazon SQS function code](with-sqs-create-package.md) -+ [AWS SAM template for an Amazon SQS application](with-sqs-example-use-app-spec.md) - -## Scaling and processing - -For standard queues, Lambda uses [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html) to poll a queue until it becomes active\. When messages are available, Lambda reads up to five batches and sends them to your function\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that an event source mapping can process simultaneously is 1,000\. - -For FIFO queues, Lambda sends messages to your function in the order that it receives them\. When you send a message to a FIFO queue, you specify a [message group ID](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html)\. Amazon SQS ensures that messages in the same group are delivered to Lambda in order\. Lambda sorts the messages into groups and sends only one batch at a time for a group\. If your function returns an error, the function attempts all retries on the affected messages before Lambda receives additional messages from the same group\. - -Your function can scale in concurrency to the number of active message groups\. For more information, see [SQS FIFO as an event source](http://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/) on the AWS Compute Blog\. - -## Configuring a queue to use with Lambda - -[Create an SQS queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-create-queue.html) to serve as an event source for your Lambda function\. Then configure the queue to allow time for your Lambda function to process each batch of events—and for Lambda to retry in response to throttling errors as it scales up\. - -To allow your function time to process each batch of records, set the source queue's visibility timeout to at least six times the [timeout that you configure](configuration-function-common.md#configuration-common-summary) on your function\. The extra time allows for Lambda to retry if your function is throttled while processing a previous batch\. - -If your function fails to process a message multiple times, Amazon SQS can send it to a [dead\-letter queue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html)\. When your function returns an error, Lambda leaves it in the queue\. After the visibility timeout occurs, Lambda receives the message again\. To send messages to a second queue after a number of receives, configure a dead\-letter queue on your source queue\. - -**Note** -Make sure that you configure the dead\-letter queue on the source queue, not on the Lambda function\. The dead\-letter queue that you configure on a function is used for the function's [asynchronous invocation queue](invocation-async.md), not for event source queues\. - -If your function returns an error, or can't be invoked because it's at maximum concurrency, processing might succeed with additional attempts\. To give messages a better chance to be processed before sending them to the dead\-letter queue, set the `maxReceiveCount` on the source queue's redrive policy to at least **5**\. - -## Execution role permissions - -Lambda needs the following permissions to manage messages in your Amazon SQS queue\. Add them to your function's [execution role](lambda-intro-execution-role.md)\. -+ [sqs:ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) -+ [sqs:DeleteMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html) -+ [sqs:GetQueueAttributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html) - -## Configuring a queue as an event source - -Create an event source mapping to tell Lambda to send items from your queue to a Lambda function\. You can create multiple event source mappings to process items from multiple queues with a single function\. When Lambda invokes the target function, the event can contain multiple items, up to a configurable maximum *batch size*\. - -To configure your function to read from Amazon SQS in the Lambda console, create an **SQS** trigger\. - -**To create a trigger** - -1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console\. - -1. Choose the name of a function\. - -1. Under **Function overview**, choose **Add trigger**\. - -1. Choose the **SQS** trigger type\. - -1. Configure the required options, and then choose **Add**\. - -Lambda supports the following options for Amazon SQS event sources\. - -**Event source options** -+ **SQS queue** – The Amazon SQS queue to read records from\. -+ **Batch size** – The number of records to send to the function in each batch\. For a standard queue, this can be up to 10,000 records\. For a FIFO queue, the maximum is 10\. For a batch size over 10, you must also set the `MaximumBatchingWindowInSeconds` parameter to at least 1 second\. Lambda passes all of the records in the batch to the function in a single call, as long as the total size of the events doesn't exceed the [invocation payload size quota](gettingstarted-limits.md) for synchronous invocation \(6 MB\)\. - - Both Lambda and Amazon SQS generate metadata for each record\. This additional metadata is counted towards the total payload size and can cause the total number of records sent in a batch to be lower than your configured batch size\. The metadata fields that Amazon SQS sends can be variable in length\. For more information about the Amazon SQS metadata fields, see the [ReceiveMessage](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) API operation documentation in the *Amazon Simple Queue Service API Reference*\. -+ **Batch window ** – The maximum amount of time to gather records before invoking the function, in seconds\. This applies only to standard queues\. - - If you're using a batch window greater than 0 seconds, you must account for the increased processing time in your queue visibility timeout\. We recommend setting your queue visibility timeout to six times your function timeout, plus the value of `MaximumBatchingWindowInSeconds`\. This allows time for your Lambda function to process each batch of events and to retry in the event of a throttling error\. -**Note** -If your batch window is greater than 0, and `(batch window) + (function timeout) > (queue visibility timeout)`, then your effective queue visibility timeout is `(batch window) + (function timeout) + 30s`\. - - Lambda processes up to five batches at a time\. This means that there are a maximum of five workers available to batch and process messages in parallel at any one time\. If messages are still available, Lambda increases the number of processes that are reading batches by up to 60 more instances per minute\. The maximum number of batches that an event source mapping can process simultaneously is 1,000\. For more information, see [Scaling and processing](#events-sqs-scaling)\. -+ **Enabled** – The status of the event source mapping\. Set to true to enable the event source mapping\. Set to false to stop processing records\. - -**Note** -Amazon SQS has a perpetual free tier for requests\. Beyond the free tier, Amazon SQS charges per million requests\. While your event source mapping is active, Lambda makes requests to the queue to get items\. For pricing details, see [Amazon SQS pricing](http://aws.amazon.com/sqs/pricing)\. - -To manage the event source configuration later, in the Lambda console, choose the **SQS** trigger in the designer\. - -Configure your function timeout to allow enough time to process an entire batch of items\. If items take a long time to process, choose a smaller batch size\. A large batch size can improve efficiency for workloads that are very fast or have a lot of overhead\. However, if your function returns an error, all items in the batch return to the queue\. If you configure [reserved concurrency](configuration-concurrency.md) on your function, set a minimum of five concurrent executions to reduce the chance of throttling errors when Lambda invokes your function\. To eliminate the chance of throttling errors, set the reserved concurrency value to 1,000, which is the maximum number of concurrent executions for an Amazon SQS event source\. - -## Event source mapping APIs - -To manage an event source with the [AWS Command Line Interface \(AWS CLI\)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) or an [AWS SDK](http://aws.amazon.com/getting-started/tools-sdks/), you can use the following API operations: -+ [CreateEventSourceMapping](API_CreateEventSourceMapping.md) -+ [ListEventSourceMappings](API_ListEventSourceMappings.md) -+ [GetEventSourceMapping](API_GetEventSourceMapping.md) -+ [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) -+ [DeleteEventSourceMapping](API_DeleteEventSourceMapping.md) - -The following example uses the AWS CLI to map a function named `my-function` to an Amazon SQS queue that is specified by its Amazon Resource Name \(ARN\), with a batch size of 5 and a batch window of 60 seconds\. - -``` -aws lambda create-event-source-mapping --function-name my-function --batch-size 5 \ ---maximum-batching-window-in-seconds 60 \ ---event-source-arn arn:aws:sqs:us-east-2:123456789012:my-queue -``` - -You should see the following output: - -``` -{ - "UUID": "2b733gdc-8ac3-cdf5-af3a-1827b3b11284", - "BatchSize": 5, - "MaximumBatchingWindowInSeconds": 60, - "EventSourceArn": "arn:aws:sqs:us-east-2:123456789012:my-queue", - "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", - "LastModified": 1541139209.351, - "State": "Creating", - "StateTransitionReason": "USER_INITIATED" -} -``` - -## Reporting batch item failures - -When your Lambda function encounters an error while processing a batch, all messages in that batch become visible in the queue again by default, including messages that Lambda processed successfully\. As a result, your function can end up processing the same message several times\. - -To avoid reprocessing all messages in a failed batch, you can configure your event source mapping to make only the failed messages visible again\. To do this, when configuring your event source mapping, include the value `ReportBatchItemFailures` in the `FunctionResponseTypes` list\. This lets your function return a partial success, which can help reduce the number of unnecessary retries on records\. - -### Report syntax - -After you include `ReportBatchItemFailures` in your event source mapping configuration, you can return a list of the failed message IDs in your function response\. For example, suppose you have a batch of five messages, with message IDs `id1`, `id2`, `id3`, `id4`, and `id5`\. Your function successfully processes `id1`, `id3`, and `id5`\. To make messages `id2` and `id4` visible again in your queue, your response syntax should look like the following: - -``` -{ - "batchItemFailures": [ - { - "itemIdentifier": "id2" - }, - { - "itemIdentifier": "id4" - } - ] -} -``` - -To return the list of failed message IDs in the batch, you can use a `SQSBatchResponse` class object or create your own custom class\. Here is an example of a response that uses the `SQSBatchResponse` object\. - -``` -import com.amazonaws.services.lambda.runtime.Context; -import com.amazonaws.services.lambda.runtime.RequestHandler; -import com.amazonaws.services.lambda.runtime.events.SQSEvent; -import com.amazonaws.services.lambda.runtime.events.SQSBatchResponse; - -import java.util.ArrayList; -import java.util.List; - -public class ProcessSQSMessageBatch implements RequestHandler { - @Override - public SQSBatchResponse handleRequest(SQSEvent sqsEvent, Context context) { - - List batchItemFailures = new ArrayList(); - String messageId = ""; - for (SQSEvent.SQSMessage message : sqsEvent.getRecords()) { - try { - //process your message - messageId = message.getMessageId(); - } catch (Exception e) { - //Add failed message identifier to the batchItemFailures list - batchItemFailures.add(new SQSBatchResponse.BatchItemFailure(messageId)); - } - } - return new SQSBatchResponse(batchItemFailures); - } -} -``` - -To use this feature, your function must gracefully handle errors\. Have your function logic catch all exceptions and report the messages that result in failure in `batchItemFailures` in your function response\. If your function throws an exception, the entire batch is considered a complete failure\. - -**Note** -If you're using this feature with a FIFO queue, your function should stop processing messages after the first failure and return all failed and unprocessed messages in `batchItemFailures`\. This helps preserve the ordering of messages in your queue\. - -### Success and failure conditions - -Lambda treats a batch as a complete success if your function returns any of the following: -+ An empty `batchItemFailures` list -+ A null `batchItemFailures` list -+ An empty `EventResponse` -+ A null `EventResponse` - -Lambda treats a batch as a complete failure if your function returns any of the following: -+ An invalid JSON response -+ An empty string `itemIdentifier` -+ A null `itemIdentifier` -+ An `itemIdentifier` with a bad key name -+ An `itemIdentifier` value with a message ID that doesn't exist - -### CloudWatch metrics - -To determine whether your function is correctly reporting batch item failures, you can monitor the `NumberOfMessagesDeleted` and `ApproximateAgeOfOldestMessage` Amazon SQS metrics in Amazon CloudWatch\. -+ `NumberOfMessagesDeleted` tracks the number of messages removed from your queue\. If this drops to 0, this is a sign that your function response is not correctly returning failed messages\. -+ `ApproximateAgeOfOldestMessage` tracks how long the oldest message has stayed in your queue\. A sharp increase in this metric can indicate that your function is not correctly returning failed messages\. - -## Amazon SQS configuration parameters - -All Lambda event source types share the same [CreateEventSourceMapping](API_CreateEventSourceMapping.md) and [UpdateEventSourceMapping](API_UpdateEventSourceMapping.md) API operations\. However, only some of the parameters apply to Amazon SQS\. - - -**Event source parameters that apply to Amazon SQS** - -| Parameter | Required | Default | Notes | -| --- | --- | --- | --- | -| BatchSize | N | 10 | For standard queues, the maximum is 10,000\. For FIFO queues, the maximum is 10\. | -| Enabled | N | true | | -| EventSourceArn | Y | | The ARN of the data stream or a stream consumer | -| FunctionName | Y | | | -| FunctionResponseTypes | N | | To let your function report specific failures in a batch, include the value `ReportBatchItemFailures` in `FunctionResponseTypes`\. For more information, see [Reporting batch item failures](#services-sqs-batchfailurereporting)\. | -| MaximumBatchingWindowInSeconds | N | 0 | | \ No newline at end of file From 64c5797a673f1781157cac3ad5b820911d167243 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 31 Oct 2023 09:53:09 -0700 Subject: [PATCH 213/243] sample template script --- templates/create-stack.sh | 27 +++++++++++++++++++++++++++ templates/delete-stack.sh | 18 ++++++++++++++++++ templates/function-inline.yml | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 templates/create-stack.sh create mode 100755 templates/delete-stack.sh diff --git a/templates/create-stack.sh b/templates/create-stack.sh new file mode 100755 index 00000000..36dc0332 --- /dev/null +++ b/templates/create-stack.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -eo pipefail +if [[ $# -gt 1 ]]; then + TEMPLATE_NAME=$1 + shift + OVERRIDES="$@" + OVERRIDES_ARG="--parameter-overrides ${OVERRIDES}" + TEMPLATE=$(cat ${TEMPLATE_NAME}.yml) +elif [[ $# -eq 1 ]]; then + TEMPLATE_NAME=$1 + TEMPLATE=$(cat ${TEMPLATE_NAME}.yml) + if [[ "$TEMPLATE" =~ PLACEHOLDER ]]; then + echo "Usage: ./create-stack.sh " + echo "e.g. ./create-stack.sh my-template parameter=value parameter2=value2" + exit 0 + fi +else + echo "Usage: ./create-stack.sh " + echo "e.g. ./create-stack.sh function-inline" + echo "e.g. ./create-stack.sh my-template parameter=value parameter2=value2" + exit 0 +fi +STACK_NAME=lambda-${TEMPLATE_NAME} +if [[ "$TEMPLATE" =~ "AWS::IAM::Role" ]]; then + CAPA_ARG="--capabilities CAPABILITY_NAMED_IAM" +fi +aws cloudformation deploy --template-file ${TEMPLATE_NAME}.yml --stack-name ${STACK_NAME} ${CAPA_ARG} ${OVERRIDES_ARG} \ No newline at end of file diff --git a/templates/delete-stack.sh b/templates/delete-stack.sh new file mode 100755 index 00000000..0496d389 --- /dev/null +++ b/templates/delete-stack.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -eo pipefail +if [[ $# -eq 1 ]]; then + TEMPLATE_NAME=$1 +else + echo "Usage: ./delete-stack.sh " + echo "e.g. ./delete-stack.sh function-inline" + exit 0 +fi +STACK_NAME=lambda-${TEMPLATE_NAME} +while true; do + read -p "Delete stack ${STACK_NAME}? (y/n)" response + case $response in + [Yy]* ) aws cloudformation delete-stack --stack-name ${STACK_NAME}; break;; + [Nn]* ) break;; + * ) echo "Response must start with y or n.";; + esac +done \ No newline at end of file diff --git a/templates/function-inline.yml b/templates/function-inline.yml index b1ddaf7a..cf2537ff 100644 --- a/templates/function-inline.yml +++ b/templates/function-inline.yml @@ -29,7 +29,7 @@ Resources: Handler: index.handler MemorySize: 128 Role: !GetAtt executionRole.Arn - Runtime: nodejs12.x + Runtime: nodejs16.x Timeout: 10 TracingConfig: Mode: Active From 5dc7858dbf84e75ef8a991b6be2bfef88bf54661 Mon Sep 17 00:00:00 2001 From: Ben Blanton Date: Wed, 10 Jan 2024 15:31:11 +0000 Subject: [PATCH 214/243] Update s3-java and blank-go for latest runtimes --- sample-apps/blank-go/2-deploy.sh | 2 +- sample-apps/blank-go/function/go.mod | 8 ++++--- sample-apps/blank-go/function/go.sum | 35 +++++++++++++--------------- sample-apps/blank-go/template.yml | 11 +++++---- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/sample-apps/blank-go/2-deploy.sh b/sample-apps/blank-go/2-deploy.sh index 5530600f..0141912b 100755 --- a/sample-apps/blank-go/2-deploy.sh +++ b/sample-apps/blank-go/2-deploy.sh @@ -2,7 +2,7 @@ set -eo pipefail ARTIFACT_BUCKET=$(cat bucket-name.txt) cd function -GOOS=linux go build main.go +GOOS=linux go build -tags lambda.norpc -o bootstrap main.go cd ../ aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml aws cloudformation deploy --template-file out.yml --stack-name blank-go --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/blank-go/function/go.mod b/sample-apps/blank-go/function/go.mod index d1111739..c06ee314 100644 --- a/sample-apps/blank-go/function/go.mod +++ b/sample-apps/blank-go/function/go.mod @@ -1,8 +1,10 @@ module github.com/awsdocs/aws-lambda-developer-guide/sample-apps/blank-go -go 1.14 +go 1.20 require ( - github.com/aws/aws-lambda-go v1.15.0 - github.com/aws/aws-sdk-go v1.29.33 +github.com/aws/aws-lambda-go v1.43.0 +github.com/aws/aws-sdk-go v1.49.12 ) + +require github.com/jmespath/go-jmespath v0.4.0 // indirect \ No newline at end of file diff --git a/sample-apps/blank-go/function/go.sum b/sample-apps/blank-go/function/go.sum index fa3ee7b1..263508e0 100644 --- a/sample-apps/blank-go/function/go.sum +++ b/sample-apps/blank-go/function/go.sum @@ -1,23 +1,20 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/aws/aws-lambda-go v1.15.0 h1:QAhRWvXttl8TtBsODN+NzZETkci2mdN/paJ0+1hX/so= -github.com/aws/aws-lambda-go v1.15.0/go.mod h1:FEwgPLE6+8wcGBTe5cJN3JWurd1Ztm9zN4jsXsjzKKw= -github.com/aws/aws-sdk-go v1.29.33 h1:WP85+WHalTFQR2wYp5xR2sjiVAZXew2bBQXGU1QJBXI= -github.com/aws/aws-sdk-go v1.29.33/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/aws/aws-lambda-go v1.43.0 h1:Tdu7SnMB5bD+CbdnSq1Dg4sM68vEuGIDcQFZ+IjUfx0= +github.com/aws/aws-lambda-go v1.43.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= +github.com/aws/aws-sdk-go v1.49.12 h1:SbGHDdMjtuTL8zpRXKjvIvQHLt9cCqcxcHoJps23WxI= +github.com/aws/aws-sdk-go v1.49.12/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= \ No newline at end of file diff --git a/sample-apps/blank-go/template.yml b/sample-apps/blank-go/template.yml index 841d6623..51552935 100644 --- a/sample-apps/blank-go/template.yml +++ b/sample-apps/blank-go/template.yml @@ -4,15 +4,16 @@ Description: An AWS Lambda application that calls the Lambda API. Resources: function: Type: AWS::Serverless::Function + Metadata: + BuildMethod: go1.x Properties: - Handler: main - Runtime: go1.x - CodeUri: function/. - Description: Call the AWS Lambda API + CodeUri: function/ # folder where your main program resides + Handler: bootstrap + Runtime: provided.al2023 Timeout: 5 # Function's execution role Policies: - AWSLambdaBasicExecutionRole - AWSLambda_ReadOnlyAccess - AWSXrayWriteOnlyAccess - Tracing: Active + Tracing: Active \ No newline at end of file From 2ecab87d2137732f38fa01e1866b024df6be58bb Mon Sep 17 00:00:00 2001 From: Ben Blanton Date: Wed, 10 Jan 2024 15:32:30 +0000 Subject: [PATCH 215/243] Update s3-java to use java21 --- sample-apps/s3-java/README.md | 2 +- sample-apps/s3-java/template.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sample-apps/s3-java/README.md b/sample-apps/s3-java/README.md index 7576c733..55601044 100644 --- a/sample-apps/s3-java/README.md +++ b/sample-apps/s3-java/README.md @@ -14,7 +14,7 @@ The project source includes function code and supporting resources: Use the following instructions to deploy the sample application. # Requirements -- [Java 8 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) +- [Java 21 runtime environment (SE JRE)](https://www.oracle.com/java/technologies/javase-downloads.html) - [Gradle 5](https://gradle.org/releases/) or [Maven 3](https://maven.apache.org/docs/history.html) - The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. - [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. diff --git a/sample-apps/s3-java/template.yml b/sample-apps/s3-java/template.yml index c82e5ac0..58189a55 100644 --- a/sample-apps/s3-java/template.yml +++ b/sample-apps/s3-java/template.yml @@ -10,7 +10,7 @@ Resources: Properties: CodeUri: build/distributions/s3-java.zip Handler: example.Handler - Runtime: java8 + Runtime: java21 Description: Java function MemorySize: 512 Timeout: 30 @@ -42,4 +42,4 @@ Resources: Description: Dependencies for the Java S3 sample app. ContentUri: build/s3-java-lib.zip CompatibleRuntimes: - - java8 + - java21 From 39bdd92de7a442bab453b3e61801bc88c4858db3 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Thu, 22 Feb 2024 13:50:17 -0800 Subject: [PATCH 216/243] Add layer-python example --- sample-apps/layer-python/function/lambda_function.py | 9 +++++++++ sample-apps/layer-python/layer/Dockerfile | 2 ++ sample-apps/layer-python/layer/docker_install.sh | 7 +++++++ sample-apps/layer-python/layer/docker_runner.sh | 11 +++++++++++ sample-apps/layer-python/layer/requirements.txt | 1 + 5 files changed, 30 insertions(+) create mode 100644 sample-apps/layer-python/function/lambda_function.py create mode 100644 sample-apps/layer-python/layer/Dockerfile create mode 100644 sample-apps/layer-python/layer/docker_install.sh create mode 100755 sample-apps/layer-python/layer/docker_runner.sh create mode 100644 sample-apps/layer-python/layer/requirements.txt diff --git a/sample-apps/layer-python/function/lambda_function.py b/sample-apps/layer-python/function/lambda_function.py new file mode 100644 index 00000000..11ef4b5e --- /dev/null +++ b/sample-apps/layer-python/function/lambda_function.py @@ -0,0 +1,9 @@ +import requests + +def lambda_handler(event, context): + print(f"Version of requests library: {requests.__version__}") + request = requests.get('https://api.github.com/') + return { + 'statusCode': request.status_code, + 'body': request.text + } diff --git a/sample-apps/layer-python/layer/Dockerfile b/sample-apps/layer-python/layer/Dockerfile new file mode 100644 index 00000000..846893f4 --- /dev/null +++ b/sample-apps/layer-python/layer/Dockerfile @@ -0,0 +1,2 @@ +FROM amazonlinux:2023 +RUN dnf update && dnf install -y python3.11 zip && dnf clean all diff --git a/sample-apps/layer-python/layer/docker_install.sh b/sample-apps/layer-python/layer/docker_install.sh new file mode 100644 index 00000000..40f67711 --- /dev/null +++ b/sample-apps/layer-python/layer/docker_install.sh @@ -0,0 +1,7 @@ +python3.11 -m venv create_layer +source create_layer/bin/activate +pip install -r requirements.txt + +mkdir python +cp -r create_layer/lib python/ +zip -r layer_content.zip python diff --git a/sample-apps/layer-python/layer/docker_runner.sh b/sample-apps/layer-python/layer/docker_runner.sh new file mode 100755 index 00000000..5b7201d2 --- /dev/null +++ b/sample-apps/layer-python/layer/docker_runner.sh @@ -0,0 +1,11 @@ +container_name=lambda_python_layer_container +docker_image=lambda_python_layer_image:example + +docker run -td --name=$container_name $docker_image +docker cp ./requirements.txt $container_name:/ + +docker exec -i $container_name /bin/bash < ./docker_install.sh +docker cp $container_name:/layer_content.zip layer_content.zip + +docker stop $container_name +docker rm $container_name diff --git a/sample-apps/layer-python/layer/requirements.txt b/sample-apps/layer-python/layer/requirements.txt new file mode 100644 index 00000000..2c24336e --- /dev/null +++ b/sample-apps/layer-python/layer/requirements.txt @@ -0,0 +1 @@ +requests==2.31.0 From a4cd6cf0596fcfc96fdfe44884d4da3e7780e9c6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Mon, 18 Mar 2024 16:17:27 -0700 Subject: [PATCH 217/243] Updates to the layer-python sample app: - Update the regular layer scripts to not use Docker, as it isn't necessary - Add an example using numpy to show how to package a layer when universal wheel isn't available --- .../layer-python/function-numpy/lambda_function.py | 12 ++++++++++++ .../layer-python/function-numpy/response.json | 1 + sample-apps/layer-python/function/response.json | 1 + sample-apps/layer-python/layer-numpy/1-install.sh | 3 +++ sample-apps/layer-python/layer-numpy/2-package.sh | 3 +++ .../layer-python/layer-numpy/requirements.txt | 1 + .../layer/{docker_install.sh => 1-install.sh} | 4 ---- sample-apps/layer-python/layer/2-package.sh | 3 +++ sample-apps/layer-python/layer/Dockerfile | 2 -- .../layer-python/layer/create_layer/pyvenv.cfg | 5 +++++ sample-apps/layer-python/layer/docker_runner.sh | 11 ----------- 11 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 sample-apps/layer-python/function-numpy/lambda_function.py create mode 100644 sample-apps/layer-python/function-numpy/response.json create mode 100644 sample-apps/layer-python/function/response.json create mode 100755 sample-apps/layer-python/layer-numpy/1-install.sh create mode 100755 sample-apps/layer-python/layer-numpy/2-package.sh create mode 100644 sample-apps/layer-python/layer-numpy/requirements.txt rename sample-apps/layer-python/layer/{docker_install.sh => 1-install.sh} (55%) mode change 100644 => 100755 create mode 100755 sample-apps/layer-python/layer/2-package.sh delete mode 100644 sample-apps/layer-python/layer/Dockerfile create mode 100644 sample-apps/layer-python/layer/create_layer/pyvenv.cfg delete mode 100755 sample-apps/layer-python/layer/docker_runner.sh diff --git a/sample-apps/layer-python/function-numpy/lambda_function.py b/sample-apps/layer-python/function-numpy/lambda_function.py new file mode 100644 index 00000000..f245743f --- /dev/null +++ b/sample-apps/layer-python/function-numpy/lambda_function.py @@ -0,0 +1,12 @@ +import json +import numpy as np + +def lambda_handler(event, context): + + x = np.arange(15, dtype=np.int64).reshape(3, 5) + print(x) + + return { + 'statusCode': 200, + 'body': json.dumps('Hello from Lambda!') + } diff --git a/sample-apps/layer-python/function-numpy/response.json b/sample-apps/layer-python/function-numpy/response.json new file mode 100644 index 00000000..a93c1cef --- /dev/null +++ b/sample-apps/layer-python/function-numpy/response.json @@ -0,0 +1 @@ +{"errorMessage": "Unable to import module 'lambda_function': No module named 'numpy'", "errorType": "Runtime.ImportModuleError", "requestId": "31c0a568-b1e1-4e63-8f76-1ddc89eea07c", "stackTrace": []} \ No newline at end of file diff --git a/sample-apps/layer-python/function/response.json b/sample-apps/layer-python/function/response.json new file mode 100644 index 00000000..7a7e22f9 --- /dev/null +++ b/sample-apps/layer-python/function/response.json @@ -0,0 +1 @@ +{"statusCode": 200, "body": "{\"current_user_url\":\"https://api.github.com/user\",\"current_user_authorizations_html_url\":\"https://github.com/settings/connections/applications{/client_id}\",\"authorizations_url\":\"https://api.github.com/authorizations\",\"code_search_url\":\"https://api.github.com/search/code?q={query}{&page,per_page,sort,order}\",\"commit_search_url\":\"https://api.github.com/search/commits?q={query}{&page,per_page,sort,order}\",\"emails_url\":\"https://api.github.com/user/emails\",\"emojis_url\":\"https://api.github.com/emojis\",\"events_url\":\"https://api.github.com/events\",\"feeds_url\":\"https://api.github.com/feeds\",\"followers_url\":\"https://api.github.com/user/followers\",\"following_url\":\"https://api.github.com/user/following{/target}\",\"gists_url\":\"https://api.github.com/gists{/gist_id}\",\"hub_url\":\"https://api.github.com/hub\",\"issue_search_url\":\"https://api.github.com/search/issues?q={query}{&page,per_page,sort,order}\",\"issues_url\":\"https://api.github.com/issues\",\"keys_url\":\"https://api.github.com/user/keys\",\"label_search_url\":\"https://api.github.com/search/labels?q={query}&repository_id={repository_id}{&page,per_page}\",\"notifications_url\":\"https://api.github.com/notifications\",\"organization_url\":\"https://api.github.com/orgs/{org}\",\"organization_repositories_url\":\"https://api.github.com/orgs/{org}/repos{?type,page,per_page,sort}\",\"organization_teams_url\":\"https://api.github.com/orgs/{org}/teams\",\"public_gists_url\":\"https://api.github.com/gists/public\",\"rate_limit_url\":\"https://api.github.com/rate_limit\",\"repository_url\":\"https://api.github.com/repos/{owner}/{repo}\",\"repository_search_url\":\"https://api.github.com/search/repositories?q={query}{&page,per_page,sort,order}\",\"current_user_repositories_url\":\"https://api.github.com/user/repos{?type,page,per_page,sort}\",\"starred_url\":\"https://api.github.com/user/starred{/owner}{/repo}\",\"starred_gists_url\":\"https://api.github.com/gists/starred\",\"topic_search_url\":\"https://api.github.com/search/topics?q={query}{&page,per_page}\",\"user_url\":\"https://api.github.com/users/{user}\",\"user_organizations_url\":\"https://api.github.com/user/orgs\",\"user_repositories_url\":\"https://api.github.com/users/{user}/repos{?type,page,per_page,sort}\",\"user_search_url\":\"https://api.github.com/search/users?q={query}{&page,per_page,sort,order}\"}"} \ No newline at end of file diff --git a/sample-apps/layer-python/layer-numpy/1-install.sh b/sample-apps/layer-python/layer-numpy/1-install.sh new file mode 100755 index 00000000..43172827 --- /dev/null +++ b/sample-apps/layer-python/layer-numpy/1-install.sh @@ -0,0 +1,3 @@ +python3.11 -m venv create_layer +source create_layer/bin/activate +pip install -r requirements.txt --platform=manylinux2014_x86_64 --only-binary=:all: --target ./create_layer/lib/python3.11/site-packages diff --git a/sample-apps/layer-python/layer-numpy/2-package.sh b/sample-apps/layer-python/layer-numpy/2-package.sh new file mode 100755 index 00000000..e552d783 --- /dev/null +++ b/sample-apps/layer-python/layer-numpy/2-package.sh @@ -0,0 +1,3 @@ +mkdir python +cp -r create_layer/lib python/ +zip -r layer_content.zip python \ No newline at end of file diff --git a/sample-apps/layer-python/layer-numpy/requirements.txt b/sample-apps/layer-python/layer-numpy/requirements.txt new file mode 100644 index 00000000..d4db0621 --- /dev/null +++ b/sample-apps/layer-python/layer-numpy/requirements.txt @@ -0,0 +1 @@ +https://files.pythonhosted.org/packages/3a/d0/edc009c27b406c4f9cbc79274d6e46d634d139075492ad055e3d68445925/numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl diff --git a/sample-apps/layer-python/layer/docker_install.sh b/sample-apps/layer-python/layer/1-install.sh old mode 100644 new mode 100755 similarity index 55% rename from sample-apps/layer-python/layer/docker_install.sh rename to sample-apps/layer-python/layer/1-install.sh index 40f67711..97f79f97 --- a/sample-apps/layer-python/layer/docker_install.sh +++ b/sample-apps/layer-python/layer/1-install.sh @@ -1,7 +1,3 @@ python3.11 -m venv create_layer source create_layer/bin/activate pip install -r requirements.txt - -mkdir python -cp -r create_layer/lib python/ -zip -r layer_content.zip python diff --git a/sample-apps/layer-python/layer/2-package.sh b/sample-apps/layer-python/layer/2-package.sh new file mode 100755 index 00000000..b720b012 --- /dev/null +++ b/sample-apps/layer-python/layer/2-package.sh @@ -0,0 +1,3 @@ +mkdir python +cp -r create_layer/lib python/ +zip -r layer_content.zip python diff --git a/sample-apps/layer-python/layer/Dockerfile b/sample-apps/layer-python/layer/Dockerfile deleted file mode 100644 index 846893f4..00000000 --- a/sample-apps/layer-python/layer/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM amazonlinux:2023 -RUN dnf update && dnf install -y python3.11 zip && dnf clean all diff --git a/sample-apps/layer-python/layer/create_layer/pyvenv.cfg b/sample-apps/layer-python/layer/create_layer/pyvenv.cfg new file mode 100644 index 00000000..daa133da --- /dev/null +++ b/sample-apps/layer-python/layer/create_layer/pyvenv.cfg @@ -0,0 +1,5 @@ +home = /opt/homebrew/opt/python@3.11/bin +include-system-site-packages = false +version = 3.11.6 +executable = /opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11 +command = /opt/homebrew/opt/python@3.11/bin/python3.11 -m venv /Users/yualexan/AWSDocProjects/aws-lambda-developer-guide/sample-apps/layer-python/layer/create_layer diff --git a/sample-apps/layer-python/layer/docker_runner.sh b/sample-apps/layer-python/layer/docker_runner.sh deleted file mode 100755 index 5b7201d2..00000000 --- a/sample-apps/layer-python/layer/docker_runner.sh +++ /dev/null @@ -1,11 +0,0 @@ -container_name=lambda_python_layer_container -docker_image=lambda_python_layer_image:example - -docker run -td --name=$container_name $docker_image -docker cp ./requirements.txt $container_name:/ - -docker exec -i $container_name /bin/bash < ./docker_install.sh -docker cp $container_name:/layer_content.zip layer_content.zip - -docker stop $container_name -docker rm $container_name From 6b426edd47465d2edcecfce9c26f83ac45cd88a6 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 16 Apr 2024 10:14:09 -0700 Subject: [PATCH 218/243] Add layer-java example app --- sample-apps/layer-java/function/pom.xml | 59 ++++++++++++++++++ .../function/src/main/java/example/F1Car.java | 33 ++++++++++ .../src/main/java/example/Handler.java | 23 +++++++ sample-apps/layer-java/layer/1-install.sh | 1 + sample-apps/layer-java/layer/2-package.sh | 4 ++ sample-apps/layer-java/layer/pom.xml | 62 +++++++++++++++++++ 6 files changed, 182 insertions(+) create mode 100644 sample-apps/layer-java/function/pom.xml create mode 100644 sample-apps/layer-java/function/src/main/java/example/F1Car.java create mode 100644 sample-apps/layer-java/function/src/main/java/example/Handler.java create mode 100755 sample-apps/layer-java/layer/1-install.sh create mode 100755 sample-apps/layer-java/layer/2-package.sh create mode 100644 sample-apps/layer-java/layer/pom.xml diff --git a/sample-apps/layer-java/function/pom.xml b/sample-apps/layer-java/function/pom.xml new file mode 100644 index 00000000..607f4152 --- /dev/null +++ b/sample-apps/layer-java/function/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + com.example + layer-java-function + jar + 1.0-SNAPSHOT + layer-java-function + + + UTF-8 + 21 + 21 + + + + + com.example + layer-java-layer + 1.0-SNAPSHOT + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 21 + 21 + 21 + + + + + + + \ No newline at end of file diff --git a/sample-apps/layer-java/function/src/main/java/example/F1Car.java b/sample-apps/layer-java/function/src/main/java/example/F1Car.java new file mode 100644 index 00000000..06c77d22 --- /dev/null +++ b/sample-apps/layer-java/function/src/main/java/example/F1Car.java @@ -0,0 +1,33 @@ +package example; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class F1Car { + + private String team; + private String driver; + + @JsonCreator + public F1Car(@JsonProperty("team") String team, + @JsonProperty("driver") String driver) { + this.team = team; + this.driver = driver; + } + + public String getTeam() { + return team; + } + + public void setTeam(String team) { + this.team = team; + } + + public String getDriver() { + return driver; + } + + public void setDriver(String driver) { + this.driver = driver; + } +} diff --git a/sample-apps/layer-java/function/src/main/java/example/Handler.java b/sample-apps/layer-java/function/src/main/java/example/Handler.java new file mode 100644 index 00000000..85bbf4c2 --- /dev/null +++ b/sample-apps/layer-java/function/src/main/java/example/Handler.java @@ -0,0 +1,23 @@ +package example; + +import com.amazonaws.services.lambda.runtime.Context; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Map; + +public class Handler { + + public String handleRequest(Map input, Context context) throws IOException { + // Parse the input JSON + System.out.println(input); + ObjectMapper objectMapper = new ObjectMapper(); + F1Car f1Car = objectMapper.readValue(objectMapper.writeValueAsString(input), F1Car.class); + + StringBuilder finalString = new StringBuilder(); + finalString.append(f1Car.getDriver()); + finalString.append(" is a driver for team "); + finalString.append(f1Car.getTeam()); + return finalString.toString(); + } +} diff --git a/sample-apps/layer-java/layer/1-install.sh b/sample-apps/layer-java/layer/1-install.sh new file mode 100755 index 00000000..b39292ee --- /dev/null +++ b/sample-apps/layer-java/layer/1-install.sh @@ -0,0 +1 @@ +mvn clean install diff --git a/sample-apps/layer-java/layer/2-package.sh b/sample-apps/layer-java/layer/2-package.sh new file mode 100755 index 00000000..f7a9c67b --- /dev/null +++ b/sample-apps/layer-java/layer/2-package.sh @@ -0,0 +1,4 @@ +mkdir java +mkdir java/lib +cp -r target/layer-java-layer-1.0-SNAPSHOT.jar java/lib/ +zip -r layer_content.zip java diff --git a/sample-apps/layer-java/layer/pom.xml b/sample-apps/layer-java/layer/pom.xml new file mode 100644 index 00000000..ccfc9025 --- /dev/null +++ b/sample-apps/layer-java/layer/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + com.example + layer-java-layer + jar + 1.0-SNAPSHOT + layer-java-layer + + + UTF-8 + 21 + 21 + + + + + com.amazonaws + aws-lambda-java-core + 1.2.3 + + + + com.fasterxml.jackson.core + jackson-databind + 2.17.0 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 21 + 21 + 21 + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.2 + + false + + + + package + + shade + + + + + + + + \ No newline at end of file From 94069b5d8d3b0269d0d6ebfeaa593eb999ff071b Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 16 Apr 2024 12:54:38 -0700 Subject: [PATCH 219/243] Remove print statement in layer-java app --- .../layer-java/function/src/main/java/example/Handler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sample-apps/layer-java/function/src/main/java/example/Handler.java b/sample-apps/layer-java/function/src/main/java/example/Handler.java index 85bbf4c2..1ff1c4e9 100644 --- a/sample-apps/layer-java/function/src/main/java/example/Handler.java +++ b/sample-apps/layer-java/function/src/main/java/example/Handler.java @@ -10,7 +10,6 @@ public class Handler { public String handleRequest(Map input, Context context) throws IOException { // Parse the input JSON - System.out.println(input); ObjectMapper objectMapper = new ObjectMapper(); F1Car f1Car = objectMapper.readValue(objectMapper.writeValueAsString(input), F1Car.class); From 54f81e324e69443f16b496707f54cb73a3041aa2 Mon Sep 17 00:00:00 2001 From: Alexander Yu Date: Tue, 7 May 2024 14:57:20 -0700 Subject: [PATCH 220/243] Change SLF4J logger to context logger, update dependencies accordingly Tested changes on both Gradle and Maven, works well --- sample-apps/s3-java/build.gradle | 13 ++--- sample-apps/s3-java/pom.xml | 53 +++++-------------- .../src/main/java/example/Handler.java | 20 ++++--- sample-apps/s3-java/template-mvn.yml | 2 +- 4 files changed, 28 insertions(+), 60 deletions(-) diff --git a/sample-apps/s3-java/build.gradle b/sample-apps/s3-java/build.gradle index 06cf433f..d1029343 100644 --- a/sample-apps/s3-java/build.gradle +++ b/sample-apps/s3-java/build.gradle @@ -7,18 +7,15 @@ repositories { } dependencies { - implementation platform('software.amazon.awssdk:bom:2.15.0') + implementation platform('software.amazon.awssdk:bom:2.16.1') implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.11.0') implementation 'software.amazon.awssdk:s3' implementation 'com.amazonaws:aws-lambda-java-core:1.2.1' implementation 'com.amazonaws:aws-lambda-java-events:3.11.0' - implementation 'org.apache.logging.log4j:log4j-api:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-core:[2.17.1,)' - implementation 'org.apache.logging.log4j:log4j-slf4j18-impl:[2.17.1,)' - runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.5.1' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk' - implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-instrumentor' + implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' + implementation 'org.slf4j:slf4j-nop:2.0.6' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } @@ -35,8 +32,8 @@ task packageJar(type: Zip) { } java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } build.dependsOn packageJar diff --git a/sample-apps/s3-java/pom.xml b/sample-apps/s3-java/pom.xml index 53cb112d..c8099a40 100644 --- a/sample-apps/s3-java/pom.xml +++ b/sample-apps/s3-java/pom.xml @@ -8,8 +8,8 @@ s3-java-function UTF-8 - 1.8 - 1.8 + 21 + 21 @@ -46,26 +46,6 @@ aws-lambda-java-events 3.11.0 - - com.amazonaws - aws-lambda-java-log4j2 - 1.5.1 - - - org.apache.logging.log4j - log4j-api - [2.17.1,) - - - org.apache.logging.log4j - log4j-core - [2.17.1,) - - - org.apache.logging.log4j - log4j-slf4j18-impl - [2.17.1,) - com.amazonaws aws-xray-recorder-sdk-core @@ -76,7 +56,12 @@ com.amazonaws - aws-xray-recorder-sdk-aws-sdk-instrumentor + aws-xray-recorder-sdk-aws-sdk-v2-instrumentor + + + org.slf4j + slf4j-nop + 2.0.13 org.junit.jupiter @@ -101,7 +86,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.2 + 3.5.2 false @@ -111,29 +96,17 @@ shade - - - - - - - - - com.github.edwgiz - maven-shade-plugin.log4j2-cachefile-transformer - [2.17.1,) - - org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 - 1.8 - 1.8 + 21 + 21 + 21 diff --git a/sample-apps/s3-java/src/main/java/example/Handler.java b/sample-apps/s3-java/src/main/java/example/Handler.java index 67d463e5..e4c14c4d 100644 --- a/sample-apps/s3-java/src/main/java/example/Handler.java +++ b/sample-apps/s3-java/src/main/java/example/Handler.java @@ -21,16 +21,13 @@ import software.amazon.awssdk.services.s3.S3Client; import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; import com.amazonaws.services.lambda.runtime.RequestHandler; import com.amazonaws.services.lambda.runtime.events.S3Event; import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification.S3EventNotificationRecord; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - // Handler value: example.Handler public class Handler implements RequestHandler { - private static final Logger logger = LoggerFactory.getLogger(Handler.class); private static final float MAX_DIMENSION = 100; private final String REGEX = ".*\\.([^\\.]*)"; private final String JPG_TYPE = "jpg"; @@ -39,6 +36,7 @@ public class Handler implements RequestHandler { private final String PNG_MIME = "image/png"; @Override public String handleRequest(S3Event s3event, Context context) { + LambdaLogger logger = context.getLogger(); try { S3EventNotificationRecord record = s3event.getRecords().get(0); @@ -53,12 +51,12 @@ public String handleRequest(S3Event s3event, Context context) { // Infer the image type. Matcher matcher = Pattern.compile(REGEX).matcher(srcKey); if (!matcher.matches()) { - logger.info("Unable to infer image type for key " + srcKey); + logger.log("Unable to infer image type for key " + srcKey); return ""; } String imageType = matcher.group(1); if (!(JPG_TYPE.equals(imageType)) && !(PNG_TYPE.equals(imageType))) { - logger.info("Skipping non-image " + srcKey); + logger.log("Skipping non-image " + srcKey); return ""; } @@ -75,9 +73,9 @@ public String handleRequest(S3Event s3event, Context context) { ImageIO.write(newImage, imageType, outputStream); // Upload new image to S3 - putObject(s3Client, outputStream, dstBucket, dstKey, imageType); + putObject(s3Client, outputStream, dstBucket, dstKey, imageType, logger); - logger.info("Successfully resized " + srcBucket + "/" + logger.log("Successfully resized " + srcBucket + "/" + srcKey + " and uploaded to " + dstBucket + "/" + dstKey); return "Ok"; } catch (IOException e) { @@ -94,7 +92,7 @@ private InputStream getObject(S3Client s3Client, String bucket, String key) { } private void putObject(S3Client s3Client, ByteArrayOutputStream outputStream, - String bucket, String key, String imageType) { + String bucket, String key, String imageType, LambdaLogger logger) { Map metadata = new HashMap<>(); metadata.put("Content-Length", Integer.toString(outputStream.size())); if (JPG_TYPE.equals(imageType)) { @@ -110,14 +108,14 @@ private void putObject(S3Client s3Client, ByteArrayOutputStream outputStream, .build(); // Uploading to S3 destination bucket - logger.info("Writing to: " + bucket + "/" + key); + logger.log("Writing to: " + bucket + "/" + key); try { s3Client.putObject(putObjectRequest, RequestBody.fromBytes(outputStream.toByteArray())); } catch(AwsServiceException e) { - logger.error(e.awsErrorDetails().errorMessage()); + logger.log(e.awsErrorDetails().errorMessage()); System.exit(1); } } diff --git a/sample-apps/s3-java/template-mvn.yml b/sample-apps/s3-java/template-mvn.yml index be8d8527..32eab63d 100644 --- a/sample-apps/s3-java/template-mvn.yml +++ b/sample-apps/s3-java/template-mvn.yml @@ -10,7 +10,7 @@ Resources: Properties: CodeUri: target/s3-java-1.0-SNAPSHOT.jar Handler: example.Handler::handleRequest - Runtime: java8 + Runtime: java21 Description: Java function MemorySize: 512 Timeout: 30 From 41e1510f96dc7d52390d05e2e45b8044c6481beb Mon Sep 17 00:00:00 2001 From: Ben Blanton Date: Wed, 22 May 2024 22:33:51 +0000 Subject: [PATCH 221/243] JavaScript SDK v3 updates and deprecations --- sample-apps/blank-nodejs/function/index.js | 35 +++++++++++----------- sample-apps/blank-nodejs/package.json | 4 +-- sample-apps/blank-nodejs/template.yml | 4 +-- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/sample-apps/blank-nodejs/function/index.js b/sample-apps/blank-nodejs/function/index.js index eb471714..d4145bb6 100644 --- a/sample-apps/blank-nodejs/function/index.js +++ b/sample-apps/blank-nodejs/function/index.js @@ -1,26 +1,27 @@ -const AWSXRay = require('aws-xray-sdk-core') -const AWS = AWSXRay.captureAWS(require('aws-sdk')) +const AWSXRay = require('aws-xray-sdk-core'); +const { LambdaClient, GetAccountSettingsCommand } = require('@aws-sdk/client-lambda'); // Create client outside of handler to reuse -const lambda = new AWS.Lambda() +const lambda = AWSXRay.captureAWSv3Client(new LambdaClient()); // Handler exports.handler = async function(event, context) { - event.Records.forEach(record => { - console.log(record.body) - }) - console.log('## ENVIRONMENT VARIABLES: ' + serialize(process.env)) - console.log('## CONTEXT: ' + serialize(context)) - console.log('## EVENT: ' + serialize(event)) - - return getAccountSettings() -} + event.Records.forEach(record => { + console.log(record.body); + }); + + console.log('## ENVIRONMENT VARIABLES: ' + serialize(process.env)); + console.log('## CONTEXT: ' + serialize(context)); + console.log('## EVENT: ' + serialize(event)); + + return getAccountSettings(); +}; // Use SDK client -var getAccountSettings = function(){ - return lambda.getAccountSettings().promise() -} +var getAccountSettings = function() { + return lambda.send(new GetAccountSettingsCommand()); +}; var serialize = function(object) { - return JSON.stringify(object, null, 2) -} + return JSON.stringify(object, null, 2); +}; \ No newline at end of file diff --git a/sample-apps/blank-nodejs/package.json b/sample-apps/blank-nodejs/package.json index 83237315..daf01e27 100644 --- a/sample-apps/blank-nodejs/package.json +++ b/sample-apps/blank-nodejs/package.json @@ -6,8 +6,8 @@ "jest": "29.7.0" }, "dependencies": { - "aws-sdk": "2.1484.0", - "aws-xray-sdk-core": "3.5.3" + "@aws-sdk/client-lambda": "3.582.0", + "aws-xray-sdk-core": "3.6.0" }, "scripts": { "test": "jest" diff --git a/sample-apps/blank-nodejs/template.yml b/sample-apps/blank-nodejs/template.yml index 1104ad27..a4c5b105 100644 --- a/sample-apps/blank-nodejs/template.yml +++ b/sample-apps/blank-nodejs/template.yml @@ -6,7 +6,7 @@ Resources: Type: AWS::Serverless::Function Properties: Handler: index.handler - Runtime: nodejs18.x + Runtime: nodejs20.x CodeUri: function/. Description: Call the AWS Lambda API Timeout: 10 @@ -25,4 +25,4 @@ Resources: Description: Dependencies for the blank sample app. ContentUri: lib/. CompatibleRuntimes: - - nodejs18.x + - nodejs20.x \ No newline at end of file From b41832dc202ee342cbbef6e58ba9db7c4bcbf953 Mon Sep 17 00:00:00 2001 From: Ben Blanton Date: Wed, 22 May 2024 22:39:36 +0000 Subject: [PATCH 222/243] Deprecate error-processor, list-manager, rds-mysql --- .../error-processor/1-create-bucket.sh | 5 - sample-apps/error-processor/2-build-layer.sh | 6 - sample-apps/error-processor/3-deploy.sh | 4 - sample-apps/error-processor/4-invoke.sh | 21 -- sample-apps/error-processor/5-cleanup.sh | 48 ---- sample-apps/error-processor/README.md | 124 ---------- sample-apps/error-processor/event.json | 5 - .../images/errorprocessor-application.png | Bin 138310 -> 0 bytes .../images/errorprocessor-exception.png | Bin 88280 -> 0 bytes .../errorprocessor-servicemap-traffic.png | Bin 100445 -> 0 bytes .../images/errorprocessor-servicemap.png | Bin 74306 -> 0 bytes .../errorprocessor-trace-randomerror.png | Bin 166326 -> 0 bytes .../images/errorprocessor-trace.png | Bin 102237 -> 0 bytes .../images/sample-errorprocessor.png | Bin 138017 -> 0 bytes sample-apps/error-processor/package.json | 12 - .../error-processor/processor/index.js | 107 --------- .../error-processor/random-error/index.js | 59 ----- sample-apps/error-processor/template.yml | 128 ---------- sample-apps/list-manager/1-create-bucket.sh | 6 - .../list-manager/2-create-dbpasswordsecret.sh | 4 - sample-apps/list-manager/3-deploy-vpc.sh | 3 - sample-apps/list-manager/4-deploy.sh | 6 - sample-apps/list-manager/5-create-dbtable.sh | 4 - sample-apps/list-manager/6-invoke.sh | 10 - sample-apps/list-manager/7-put-records.sh | 7 - sample-apps/list-manager/8-cleanup.sh | 38 --- sample-apps/list-manager/README.md | 223 ------------------ .../list-manager/bin/get-kinesis-stream.sh | 4 - .../list-manager/bin/get-stack-event.sh | 1 - .../list-manager/bin/get-stack-status.sh | 1 - sample-apps/list-manager/dbadmin/index.js | 37 --- sample-apps/list-manager/dbadmin/package.json | 12 - .../list-manager/events/db-clear-table.json | 3 - .../list-manager/events/db-create-table.json | 3 - .../list-manager/events/db-read-table.json | 3 - sample-apps/list-manager/events/kinesis.json | 68 ------ .../images/listmanager-application.png | Bin 124527 -> 0 bytes .../images/listmanager-servicemap.png | Bin 121777 -> 0 bytes .../list-manager/images/listmanager-trace.png | Bin 140558 -> 0 bytes .../images/sample-listmanager.png | Bin 124812 -> 0 bytes .../list-manager/lib/nodejs/package.json | 12 - sample-apps/list-manager/processor/index.js | 170 ------------- .../list-manager/processor/package.json | 14 -- sample-apps/list-manager/template-vpcrds.yml | 141 ----------- sample-apps/list-manager/template.yml | 125 ---------- sample-apps/rds-mysql/1-create-bucket.sh | 6 - .../rds-mysql/2-create-dbpasswordsecret.sh | 4 - sample-apps/rds-mysql/3-deploy-vpc.sh | 3 - sample-apps/rds-mysql/4-deploy.sh | 14 -- sample-apps/rds-mysql/5-create-dbtable.sh | 4 - sample-apps/rds-mysql/6-invoke.sh | 10 - sample-apps/rds-mysql/7-cleanup.sh | 38 --- sample-apps/rds-mysql/README.md | 133 ----------- sample-apps/rds-mysql/dbadmin/index-iam.js | 49 ---- sample-apps/rds-mysql/dbadmin/index.js | 37 --- .../rds-mysql/events/db-add-column.json | 3 - .../rds-mysql/events/db-clear-table.json | 3 - .../rds-mysql/events/db-create-table.json | 3 - .../rds-mysql/events/db-drop-table.json | 3 - .../rds-mysql/events/db-read-table.json | 3 - .../rds-mysql/images/rdsmysql-application.png | Bin 63829 -> 0 bytes .../rds-mysql/images/rdsmysql-servicemap.png | Bin 58698 -> 0 bytes .../rds-mysql/images/rdsmysql-trace.png | Bin 180820 -> 0 bytes .../rds-mysql/images/sample-rdsmysql.png | Bin 31716 -> 0 bytes sample-apps/rds-mysql/lib/nodejs/package.json | 12 - sample-apps/rds-mysql/template-vpcrds.yml | 125 ---------- sample-apps/rds-mysql/template.yml | 85 ------- 67 files changed, 1949 deletions(-) delete mode 100755 sample-apps/error-processor/1-create-bucket.sh delete mode 100755 sample-apps/error-processor/2-build-layer.sh delete mode 100755 sample-apps/error-processor/3-deploy.sh delete mode 100755 sample-apps/error-processor/4-invoke.sh delete mode 100755 sample-apps/error-processor/5-cleanup.sh delete mode 100644 sample-apps/error-processor/README.md delete mode 100644 sample-apps/error-processor/event.json delete mode 100644 sample-apps/error-processor/images/errorprocessor-application.png delete mode 100644 sample-apps/error-processor/images/errorprocessor-exception.png delete mode 100644 sample-apps/error-processor/images/errorprocessor-servicemap-traffic.png delete mode 100644 sample-apps/error-processor/images/errorprocessor-servicemap.png delete mode 100644 sample-apps/error-processor/images/errorprocessor-trace-randomerror.png delete mode 100644 sample-apps/error-processor/images/errorprocessor-trace.png delete mode 100644 sample-apps/error-processor/images/sample-errorprocessor.png delete mode 100644 sample-apps/error-processor/package.json delete mode 100644 sample-apps/error-processor/processor/index.js delete mode 100644 sample-apps/error-processor/random-error/index.js delete mode 100644 sample-apps/error-processor/template.yml delete mode 100755 sample-apps/list-manager/1-create-bucket.sh delete mode 100755 sample-apps/list-manager/2-create-dbpasswordsecret.sh delete mode 100755 sample-apps/list-manager/3-deploy-vpc.sh delete mode 100755 sample-apps/list-manager/4-deploy.sh delete mode 100755 sample-apps/list-manager/5-create-dbtable.sh delete mode 100755 sample-apps/list-manager/6-invoke.sh delete mode 100755 sample-apps/list-manager/7-put-records.sh delete mode 100755 sample-apps/list-manager/8-cleanup.sh delete mode 100644 sample-apps/list-manager/README.md delete mode 100755 sample-apps/list-manager/bin/get-kinesis-stream.sh delete mode 100755 sample-apps/list-manager/bin/get-stack-event.sh delete mode 100755 sample-apps/list-manager/bin/get-stack-status.sh delete mode 100644 sample-apps/list-manager/dbadmin/index.js delete mode 100644 sample-apps/list-manager/dbadmin/package.json delete mode 100644 sample-apps/list-manager/events/db-clear-table.json delete mode 100644 sample-apps/list-manager/events/db-create-table.json delete mode 100644 sample-apps/list-manager/events/db-read-table.json delete mode 100644 sample-apps/list-manager/events/kinesis.json delete mode 100644 sample-apps/list-manager/images/listmanager-application.png delete mode 100644 sample-apps/list-manager/images/listmanager-servicemap.png delete mode 100644 sample-apps/list-manager/images/listmanager-trace.png delete mode 100644 sample-apps/list-manager/images/sample-listmanager.png delete mode 100644 sample-apps/list-manager/lib/nodejs/package.json delete mode 100644 sample-apps/list-manager/processor/index.js delete mode 100644 sample-apps/list-manager/processor/package.json delete mode 100644 sample-apps/list-manager/template-vpcrds.yml delete mode 100644 sample-apps/list-manager/template.yml delete mode 100755 sample-apps/rds-mysql/1-create-bucket.sh delete mode 100755 sample-apps/rds-mysql/2-create-dbpasswordsecret.sh delete mode 100755 sample-apps/rds-mysql/3-deploy-vpc.sh delete mode 100755 sample-apps/rds-mysql/4-deploy.sh delete mode 100755 sample-apps/rds-mysql/5-create-dbtable.sh delete mode 100755 sample-apps/rds-mysql/6-invoke.sh delete mode 100755 sample-apps/rds-mysql/7-cleanup.sh delete mode 100644 sample-apps/rds-mysql/README.md delete mode 100644 sample-apps/rds-mysql/dbadmin/index-iam.js delete mode 100644 sample-apps/rds-mysql/dbadmin/index.js delete mode 100644 sample-apps/rds-mysql/events/db-add-column.json delete mode 100644 sample-apps/rds-mysql/events/db-clear-table.json delete mode 100644 sample-apps/rds-mysql/events/db-create-table.json delete mode 100644 sample-apps/rds-mysql/events/db-drop-table.json delete mode 100644 sample-apps/rds-mysql/events/db-read-table.json delete mode 100644 sample-apps/rds-mysql/images/rdsmysql-application.png delete mode 100644 sample-apps/rds-mysql/images/rdsmysql-servicemap.png delete mode 100644 sample-apps/rds-mysql/images/rdsmysql-trace.png delete mode 100644 sample-apps/rds-mysql/images/sample-rdsmysql.png delete mode 100644 sample-apps/rds-mysql/lib/nodejs/package.json delete mode 100644 sample-apps/rds-mysql/template-vpcrds.yml delete mode 100644 sample-apps/rds-mysql/template.yml diff --git a/sample-apps/error-processor/1-create-bucket.sh b/sample-apps/error-processor/1-create-bucket.sh deleted file mode 100755 index 64a5f749..00000000 --- a/sample-apps/error-processor/1-create-bucket.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -BUCKET_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') -BUCKET_NAME=lambda-artifacts-$BUCKET_ID -echo $BUCKET_NAME > bucket-name.txt -aws s3 mb s3://$BUCKET_NAME diff --git a/sample-apps/error-processor/2-build-layer.sh b/sample-apps/error-processor/2-build-layer.sh deleted file mode 100755 index caf7b985..00000000 --- a/sample-apps/error-processor/2-build-layer.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -eo pipefail -mkdir -p lib/nodejs -rm -rf lib/nodejs/node_modules -npm install -mv node_modules lib/nodejs/ \ No newline at end of file diff --git a/sample-apps/error-processor/3-deploy.sh b/sample-apps/error-processor/3-deploy.sh deleted file mode 100755 index 80e798cd..00000000 --- a/sample-apps/error-processor/3-deploy.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -ARTIFACT_BUCKET=$(cat bucket-name.txt) -aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml -aws cloudformation deploy --template-file out.yml --stack-name error-processor --capabilities CAPABILITY_NAMED_IAM diff --git a/sample-apps/error-processor/4-invoke.sh b/sample-apps/error-processor/4-invoke.sh deleted file mode 100755 index d6e443dc..00000000 --- a/sample-apps/error-processor/4-invoke.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -ERROR_FUNCTION=$(aws cloudformation describe-stack-resource --stack-name error-processor --logical-resource-id randomerror --query 'StackResourceDetail.PhysicalResourceId' --output text) - -while true; do - if [ $1 ] - then - case $1 in - async) - aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json --invocation-type Event out.json - ;; - *) - echo -n "Unknown argument" - ;; - esac - else - aws lambda invoke --function-name $ERROR_FUNCTION --payload fileb://event.json out.json - fi - cat out.json - echo "" - sleep 2 -done \ No newline at end of file diff --git a/sample-apps/error-processor/5-cleanup.sh b/sample-apps/error-processor/5-cleanup.sh deleted file mode 100755 index 3cdc8707..00000000 --- a/sample-apps/error-processor/5-cleanup.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -eo pipefail -STACK=error-processor -if [[ $# -eq 1 ]] ; then - STACK=$1 - echo "Deleting stack $STACK" -fi -APP_BUCKET=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id bucket --query 'StackResourceDetail.PhysicalResourceId' --output text) -FUNCTION=$(aws cloudformation describe-stack-resource --stack-name $STACK --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text) -aws cloudformation delete-stack --stack-name $STACK -echo "Deleted $STACK stack." - -if [ -f bucket-name.txt ]; then - ARTIFACT_BUCKET=$(cat bucket-name.txt) - if [[ ! $ARTIFACT_BUCKET =~ lambda-artifacts-[a-z0-9]{16} ]] ; then - echo "Bucket was not created by this application. Skipping." - else - while true; do - read -p "Delete deployment artifacts and bucket ($ARTIFACT_BUCKET)? (y/n)" response - case $response in - [Yy]* ) aws s3 rb --force s3://$ARTIFACT_BUCKET; rm bucket-name.txt; break;; - [Nn]* ) break;; - * ) echo "Response must start with y or n.";; - esac - done - fi -fi - -while true; do - read -p "Delete function log group (/aws/lambda/$FUNCTION)? (y/n)" response - case $response in - [Yy]* ) aws logs delete-log-group --log-group-name /aws/lambda/$FUNCTION; break;; - [Nn]* ) break;; - * ) echo "Response must start with y or n.";; - esac -done - -while true; do - read -p "Delete application bucket ($APP_BUCKET)?" response - case $response in - [Yy]* ) aws s3 rb --force s3://$APP_BUCKET; break;; - [Nn]* ) break;; - * ) echo "Response must start with y or n.";; - esac -done - -rm -f out.yml out.json -rm -rf processor/node_modules random-error/node_modules processor/package-lock.json random-error/package-lock.json \ No newline at end of file diff --git a/sample-apps/error-processor/README.md b/sample-apps/error-processor/README.md deleted file mode 100644 index 643bbf3f..00000000 --- a/sample-apps/error-processor/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Error processing with CloudWatch Logs and X-Ray - -This sample application triggers a Lambda function when CloudWatch Logs detects the word ERROR in a log stream. The function downloads the full log stream and the X-Ray trace for the request that caused the error. It stores both in an Amazon S3 bucket. - -![Architecture](/sample-apps/error-processor/images/sample-errorprocessor.png) - -The project source includes function code and supporting resources: - -- `processor` - A Node.js function that retrieves logs and traces, and stores them in Amazon S3. -- `random-error` - A Node.js function that generates errors at random. -- `template.yml` - An AWS CloudFormation template that creates an application with the processor and random-error functions. -- `1-createbucket.sh`, `2-deploy.sh`, etc. - Shell scripts that use the AWS CLI to deploy and manage the application. - -Use the following instructions to deploy the sample application. For more information on the application's architecture and implementation, see [Error Processor Sample Application for AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/sample-errorprocessor.html) in the developer guide. - -# Requirements -- [Node.js 10 with npm](https://nodejs.org/en/download/releases/) -- The Bash shell. For Linux and macOS, this is included by default. In Windows 10, you can install the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to get a Windows-integrated version of Ubuntu and Bash. -- [The AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) v1.17 or newer. - -# Setup -Download or clone this repository. - - $ git clone https://github.com/awsdocs/aws-lambda-developer-guide.git - $ cd aws-lambda-developer-guide/sample-apps/error-processor - -To create a new bucket for deployment artifacts, run `1-create-bucket.sh`. - - error-processor$ ./1-create-bucket.sh - make_bucket: lambda-artifacts-a5e491dbb5b22e0d - -To build a Lambda layer that contains the function's runtime dependencies, run `2-build-layer.sh`. Packaging dependencies in a layer reduces the size of the deployment package that you upload when you modify your code. - - blank-ruby$ ./2-build-layer.sh - -# Deploy -To deploy the application, run `3-deploy.sh`. - - error-processor$ ./3-deploy.sh - added 16 packages from 18 contributors and audited 18 packages in 1.979s - found 0 vulnerabilities - added 17 packages from 19 contributors and audited 19 packages in 1.782s - Uploading to e678bc216e6a0d510d661ca9ae2fd941 2737254 / 2737254.0 (100.00%) - Successfully packaged artifacts and wrote output template to file out.yml. - Waiting for changeset to be created.. - Waiting for stack create/update to complete - Successfully created/updated stack - error-processor - -This script uses AWS CloudFormation to deploy the Lambda functions, an IAM role, and a CloudWatch Logs subscription that triggers the processor function. If the AWS CloudFormation stack that contains the resources already exists, the script updates it with any changes to the template or function code. - -# Test -To generate logs and errors, invoke the random error function. - - error-processor$ ./4-invoke.sh - { - "StatusCode": 200, - "FunctionError": "Unhandled", - "ExecutedVersion": "$LATEST" - } - {"errorType":"function.DoublesRolledError","errorMessage":"Doubles rolled: 10 & 10","trace":["function.DoublesRolledError: Doubles rolled: 10 & 10"," at Runtime.myFunction [as handler] (/var/task/index.js:36:17)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]} - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - {"errorType":"function.DoublesRolledError","errorMessage":"Doubles rolled: 2 & 2","trace":["function.DoublesRolledError: Doubles rolled: 2 & 2"," at Runtime.myFunction [as handler] (/var/task/index.js:36:17)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"],"depth":8} - { - "StatusCode": 200, - "ExecutedVersion": "$LATEST" - } - {"errorType":"function.MaxDepthError","errorMessage":"Maximum depth reached: 9","trace":["function.MaxDepthError: Maximum depth reached: 9"," at Runtime.myFunction [as handler] (/var/task/index.js:30:17)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"],"depth":9} - -Let the script invoke the function a few times and then press `CRTL+C` to exit. - -This function generates errors for a configurable percentage of invocations. When an error does not occur, it invokes itself recursively until one does. The event (`event.json`) provides a base error rate and maximum recursion depth. - - { - "max-depth": 9, - "current-depth": 0, - "error-rate": 0.07 - } - -The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. The following service map shows the random error function generating errors for some requests. It also shows the processor function calling X-Ray, CloudWatch Logs, and Amazon S3. - -![Service Map](/sample-apps/error-processor/images/errorprocessor-servicemap.png) - -Choose a node in the main function graph. Then choose **View traces** to see a list of traces. Choose any trace to view a timeline that breaks down the work done by the function. The following example shows a trace for the processor function, which is invoked by CloudWatch Logs for each error. - -![Trace - Processor](/sample-apps/error-processor/images/errorprocessor-trace.png) - -Traces for the random error function include all recursive calls. The following example shows a request that resulted in 3 invocations. The third invocation resulted in an error that was relayed back through the other two (successful) invocations to the requester. - -![Trace - Random Error](/sample-apps/error-processor/images/errorprocessor-trace-randomerror.png) - -Click on the error icon next to the function segment for the final invocation to see details about the exception. - -![Trace - Exception](/sample-apps/error-processor/images/errorprocessor-exception.png) - -Finally, view the logs and traces that the function stores in Amazon S3. - -*To view the output* -1. Open the [applications page](https://console.aws.amazon.com/lambda/home#/applications) in the Lambda console. -2. Choose **error-processor**. - - ![Application](/sample-apps/error-processor/images/errorprocessor-application.png) - -3. Choose **bucket**. -4. Choose **errors**. -5. Choose a request ID. -6. For each file, check the box next to the filename and then choose **Download**. - -# Configure the random error function - -With the default configuration, the function runs up to 9 times before returning an error. When invoked continuously with the AWS CLI, it maintains a concurrency of 9, with approximately 100 invocations per minute, including when the function invokes itself. The effective error rate is close to 14%. - -To generate a larger, more varied set of data, lower the error rate and increase the maximum depth. The following example shows a service map for the application running with an error rate of 0.5% and a maximum depth of 500. - -![Service Map](/sample-apps/error-processor/images/errorprocessor-servicemap-traffic.png) - -Lambda records traces for the first request each second and 5% of additional requests. - -# Cleanup -To delete the application, run the cleanup script. - - error-processor$ ./5-cleanup.sh diff --git a/sample-apps/error-processor/event.json b/sample-apps/error-processor/event.json deleted file mode 100644 index d12c7edb..00000000 --- a/sample-apps/error-processor/event.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "max-depth": 50, - "current-depth": 0, - "error-rate": 0.05 -} \ No newline at end of file diff --git a/sample-apps/error-processor/images/errorprocessor-application.png b/sample-apps/error-processor/images/errorprocessor-application.png deleted file mode 100644 index 317d133409c5409fd52a0fab1e8e0968704d5a55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 138310 zcmaI7V{|25*YBN9r(;_k+Z{XU*tTukwr$(CZQHhXY`nRj>$;!wemQ51+GCIXU$a)N zS~Y87{^kyqkrIZ1#DoL_0)i105s(7{`WX)d1ndkB`mI1n{wn>?myL+3JrEEo@qa!) zMCFLCzeO+yQAt6teGm{-22}3bkCy+D1XUdVIy#tG+X0nUO^AF;&<@{{fT6vjuWzCIZE6S9+|v;KErb6@R@Sw%GPN=W>cKh+{?@?$ zIp5Jv-w^2G%m4hpX8hKcmWEaiK#vni-QODMf6Nq29V`riO0MQefq?LULbcgpNGx75}XrOqyIrJ_LpsF981Z1A^?!FsKz0 zUq%jZ>vKkP7zY~DRQdmcEMn;UP&#uOWz90=fqcz^ofVb+QW!3y~lKy-4tPLqNZ$PwwI zB8+leiK6(MvV8?)qXfX;7td8_bo&;XFU3t6)h4(Zhk|ljO%bw^UCQ&G#5!yCeTYbd z;kZt-bguu?eM4W;V!nI5-Fdy;&z}>y8vuAdifd3%7du<9@>dUR$7?s8gu;{6hD@w1 zGhKO_0k`n2--Se#=IX7xiBfX-9q|?cYDkd+=&Lh6g~;Md75eLsunBU28e{Psg{;K! z^;U05$R7YaE>VRRDy=%-byT<*lrW1YSS$CY$U;wi{!m3Ge_xY=nR$`|yyewFYt*JX zJ-h?l%~I4Ld=%nB#znaN`r=^X@B0}us)41;Ngg9uZi*X5rP4E}aT)Fmm~#@b*6h`f z?iLWI;4NjDPHw<Zf;*op;I9D<_ErXYc^a&gqM& zr<|6wq3Ol;ye4ONjR`Ca>DJVEbBX4(L*bi`?B$JHU2&1qKOfS&Per_CgNxBIH05x~ zb*|PyGtFN@DK1J9g*liqB*fm6=Y`9gzD^5}Xs_2i7(4mby}8{r<0_r9**sktYbRx>(# zkvx?gv#@D}^q!Y)@~;Q3oNHaUW-pvadundJx5Iof|IeHI47QFTadnZpfg%As+stk& z0(A|JKME=O`G9L8Vr&O}U%YyyzMzCEi=+sWJM_fguv9Rw+E)LA7)3B4H0H{eF;jK) z`i#gBR)koD9g!tnw_ho`L4IJw4h$+1HRn!s$=R@WPxKZ%%pw%nuP2`}v$&izIAqv_ zEF2;6V!37@(+@AFst%E)$Gm*G#^6D1Mn+pxFsC0M_7p{>Y5Mi>)=w2}rF z=X6INT+6f4)?RhZUBkdOu1F3G!_1Fv0E)?qd9vx#CvHyfEDXiO*HTmu*bk`e?CfO% zBTXchsQT||%%?Av=Z^tBSuw&m4{m8^3Sn!CoB{$-%~%+(p0mJ+M^Lth_$P%$nIHYx;mKG84D~@#aDa$c#M?UUF+sSZ zBBZP&lJLpGtj0uZC4c9{XR>9ubtInNz zwaNb=HbhAv&Ijk~!{a>%Vu>%Jy+ow0&RKyJfxDlHM^sQ!ltV-SH{4|n!(-tU9*3o` z3rHJdh2#ZqNH%gerq%6$WKmd&ibM`{N|iD`ImhgY9w@D#BCdK|q=EV?dt!LHHY+JM zR9ZnsZ1r~s46o_7G;sfX619cDxzsjN>VLVdaN>S_VTvUgmbq-tQZU#j;A4afkTpxBDI6rJ} zq{zebIgXliM8usYu||kuo08ffVyLO)+%AA={yZ3%Z<|0gV(`4lpI(am!`zKOiajru z7DqmEu`%=fYORm3YVe>Wub5-9rv^l@N%(H8^8LCM+Dl+Q{Z@2A`R3yZwpi{2e=;4a zFJ^5_%t*rLdrqjc*kosHgExQ;j1kzx!P!XJ9T_D=Z`8+Pp*}tE)DJ>Js`1#xtWt~D zZICelH^K3F%AyOKmJqAiX;svyCpoxI(GgxU?zFzS`EI}J{1py{;oq|S_;u8l306a@ zyD`v~w_KQavv9a1owXD8suZOCn_ud!&4hSGp3DU($Jr{=e^P&ZJ`F-&W{n?qYfYXG zGhVL_Q7Ln;OdlFY?gpFyIdj#;@>oEJ2!UMY4jPh19P!78tvvU+b=4Il+sdXhFB|g< zXBC}Fdbn#5XNIT0Tv4iKgybxT-R!#dr*6adKlFV-k@dq9gX{}Og6MoK{m0?Q7i{%I zh4aB0#>!=wDV9gWqp5cmmw<%Z?vJTRCOLxdik>;`p7txwZe^MVB%fmH;}#M~ZWuZp zo(gKqN$h70i*+cWQn!cfqd5oY$MuDqh5PaCSg z8h^5M$xW)viPH@N>M? zzSrEKF^4BJ-{M_^CTm^<9n}jPAt|z3pE8=ugSLEbP=PFZ%Oa}A1ld^2g(BZg`!H%) zIVZ8m9hizKklyR4 zW>AO@AX(YIp_5Lyj>>)9Kk67N(yJVv>(}ATV)yzt?}++gn&Y+(bhO+CpkGnSC7hIx4&F< z5iRBsnUIwECOIe$%u`bV=^==GZj;^$k1RVIRynM73r@Bg|_ttT8fIxOk zEDVYZ|Lrf^%r<8alvRNEaDttKCGHc?%=9?dkKtrWxu0xHg+yPDrvh8@sJFNJ<}caD z>#S8(u?o&X+~pC`8jNW}Gl#yxN;jRw%{N;Ji|s)PVZB*pO;emm1xEYh)EhN4JMza8 zI$o8MCHMr4#aW!b^_GGNrk@S~F&wSL z$o|&P12qD6JY2pltTlem940X_l1Lm$Z+3ojVcn}Ud?Zr5LTo$U(x1^eC2@pOT_O1v zQ0vomCt2#QP7g|U^5!BB4RgsElfu*7$i{DaRxcm@CpX9TH@1?{6<&VY+v^i+mvo8& z0d*Pt(L9m*LTK}kXZsts3*!}->jT%7)AdA(ldAxpz*^!s#pummF7>+u57CE|{^ywz z!dlDl_ax)z!A$ejnFpLRth~V7QA~J9%8g#}aMaq_v;pGm49S-sOslVc{f-tp=zP1M z73;vp8XolXLCHuB)jKZ_={LriqpikK#Y88E)=xAB?x$2VJjSTCT@M?M>x7)Q&9xpj zVba@6F!z$|sZdhC#Y2Dp$gQdD0~Y2Zf1fFAFAN@NV9Rj66);!^{j_`Q=e(O!5Q@Az zS#1l|Su)jd8FCQ=Wxnar))tK5%8Jfp#j!pw-*6ia=WI1V2Ba_b_eXb$vF@?bq_ZTI z$Ov50puXQ2`pMosuRz2@q-7s1!&T|57U{hzHNvOcU?xxf<`;OwtKrE^O#)I><5$H-jel{|kqu)<8mKV%Ody-P<0zS-Eg0odObGcH60D$XdRiEnzG4&n zy(xTC9zm{%K%Rs(Md8UHHPzOv^x>n=+^ZZcbt6Pz4!x1?gLw_IEX%lGVP?gcsepD8 zY$ZG&?u>^pIWgOEVRJPcKFA?4u>j%JCm1~+BJnT-mfJ`n^_=BL#W;Tx&!o2Ull^-w ziU@h=5OShmm1eK%$PF-0d5LFNabwqov zBn!#f{GuR!tUY8^oM374qfbLqt*s+lKkASHi=aeyB7(3qg9JSefpPG85|Y;AL)0oS zy6JcFMC^5R;nUm)XtXo!nfYaDl5}Fdb%lh44*yCukS4+tOU>yxrb-vNxu$-8B~jj- z0wSdhqO1`3$e|EneIi8BusqqmF}tygN@Opd868qGDUuL@aP&WUv7oCHOHq~v>!2YE zQ+gh*(Brmbp@KC6;A4Csos6_vLrD$1h3cchz@&(CwWe&eopqrRaRP`;6B%lPPf@=M zZvSYxKbks}MMr7iq)rkR;%Tu&3ZncIw+RNzisk0H{lv()Ok^KNF4oFT!w zE)GN#k-=GR@h&eQQl%OUgy=3TE9pKs*VxV4Q<+cZ7vOEtMd}AZC=f}>%0i5)fRuM+ zjXJ_gTdWH`34~V0F)}aC%c$}J9<7++1Xv49Srco)U)KIeRC)OtQm>zsoEO^T^({Ox z%E}^=LK96zU0PgD(eE(cO~_}?)CXo+_yCB}St>&vX?aFBS1%`0xMLv*DbU$$sl>C~ z1G_htrwdBuSq=Cw)|nmiD2?cH>7!7>=?(b^r>i#yl6)cX^c55r=;}(-ZY84LWriBD z{+T4e27gqtkrx7y*Ax(;E?THJC#K_`>*ND+h+NzN0gX$6FY&oT_4f9!edjTr6%G_2 zd}xTV{$IhmEy6Z(DjGy*M=j2}3_Mz~LTs?QKtBR`?MkAP^#luOWKFk>)@A5U!7?F3`V@vi_%5Iw-NgajI@-va8Ao``7U!A;xN0-g^K z>Jm=VWZb=w0wpQi=)pevZlqit{5Mvgj||$GoLHct`btxvp=bdr8L~)d9Wq6d!B8!! z-Npf=1`pN2A8?4iP5vN9))Z;vIloM2(i+ zXzG*&%x$O>jFGwd^rA`@NoVH4p(ZbOfjIG_$eny)Wje~-QCKII*S{gSSKQlo{2rZm zg+p+lxI;__bFR!z?FMzGS=#HO>}dzrZHPt76dRVE9SfK7(*-LVnT9=RDs0io>T|65 zWvzN!HZ*C7`8bi)!At3l3^5wB9p9lIwbJTRqp_CS0qo<*A0z3AtQ0!(;%Hc}`x8P76(l?w?_M#s7gDehoD9r3RGF~*iKV~xH+4H zkj#i>mG_}y*oorD=Cd9~!7v+!9)8kCO-}3%CNw|XP9!m|b`0kce^f{fr7%s90L*Sb zuX;q`K3U;GxKkqx1`gc1++OL5O0dP%>|6A{lpU!-;yyZ>?3hj^l1B4|8S1)lDj$AK zCf|GF(q5keO!5m^#_m^#?dLZ5Q&moP!0>Y*e&X_MEW$&0cstAF@dNXaft;xA8#~Qx zCH74|)OWcuts4*%o?~IKQ2j0P{5{TY|D1}m*7hdqj<~_N-qfJSG_|vU6lFLS0jf7g znjEhXnbK!^+?5P9#U9CUj5}4brbj^`UUNZDg3TT*FU^^x50@&Usj>I=!>eYvL%tI1 zt`MS;B#FvcqH=HuX3|3HS4(HQN)wy->UFHb8T>LFc!N;zkK9ay_gqq&-PK~-Pt{_( zHQmS+M1h#x=JxQc24QVs261&RGok1Ls%zVi9QY8kzov#vgyMD;CR-B1L;2qB43r$i zjs2JK;%F3pPE~1WSZ}g021)oFGusN{`D+uq#Ab6B` z5`MX!+r`Gu|9vFY`=q&IFTlZf;OF7(7G3356FB3smaR8`l6EQtcC=V zxIUqIK5rbD9yU2+48((EEH(SH=)I4q5y?R?1KY&cPB#C5l*&vNoMBj>YEmNcH(T zFu&olzg^?!vo|aJ$5{xYO0)0%h2dq~@A&0%ayma#EsE2N=1z(ysQv4eljY+;Fpr{# zI(q=4KHbFihApYdP?kNqDt+v|bdizAjdt4lgino|yg0UXewf}!g>cxaBfA*T7Klcj zZJ{!FArEV)5}HS?CJ_2t5T_>^=D%A-{8up0$1hWh8sk4$CQen=c?AWmMd05gu4#g9=~@a&pOp1j^4a)k(#M#5b^kP*4KuFcbQ zg~;GgUbLdsf`r9XeNv_J#zt@q6!5C)b+>5*!UyP%+#VS*H(2E778SvZuupl>w$v-T z`J4xX$id6&E!%LCLjs`I^-lB0Uj~Fmt!dCj8^L=+W#Vf>U)ii$jWKwplx)rg`(r$R z#JU8Gl@QHf@<|TCfF}}E;ej*i*=S2+1UMAd-Mhw!2#`mM1pwxj0D7ykVFZZ6kOwtaZrvx1LJ32wmq#^=_v`8f~} z|A2)K$OT%mG{~p~ioo!I!`Ia$h3w-5FGJ8U0S zEf}OrT0~b{yng&2;xyz-DMiu^cHgnM-Mfk@0G@{s{+xC9=%7n1#et*mq8E*)XY&Jf zI5s3RycYcL1bM{-##vuiB0@2IiizTiFoJq4RalQsTVQSw{+v?@tv#gsxGea_y9^Sf zprPq(RY%XxM&$=p94<(Jt_Z&*jQnsE+YT=xEBCB?k_eX$_^rVzO$6p}JrDmj^V8i8>{6`L=yVu&b#j1?{XvV9mG z0QZ9zOK|*aPPpMF)3Rz~gO3_#WD#H!>Y7aOD0y(7K&0ZlvKcz(rg0f_s$uep!9~n~ z0bAsgnwhPDK3ggW^t?hv6^SvY5ENqHzW2?{OSu(Uu`&IgsTV*0ClJxRf(!zuX~Kow zt{_9$rFNA33i_^k_&{bd3xXt^jN&%oE~iURwUoQkJO~OsL4Vho0N*Xgiz@od_NHrp zph|49F-p91)Gqs6ul>db5@cXXEeS_Gn<%3e4(q>UHhK^g`-1IfWZ;ZRNckOR#;tvP zUi%Pwp_$vOF?0(nwXBCX16qf0OyH+78d{<^H~@3r)j%$jeiqt{e<__ab3@jsH@}=% zT`RU2IrcjD4zJx;74b@KWB4*CNN^NozQHlcBX9!jYJ({l);qee1R2Rux0P`xVoVOAMF3WuubBS)-Rlzfb3nSjS_80x8iXw=F)$7!m^GFZG!3QMbd;%Yao zA*CK7{fkbuj_l7UeFS`>OgM}^OujGec)3qae;0jiPT zgZ>zhr2G?3_)l|#CjNh0Rj}EGx&eu^S*Fe-ADrj zE+@3n^Wfw_zYfPO|4Vys;20ZpnRS$H7eSYpI}!U5+Gm&b4Vprw~n62TUp={&RT zy6J_pon`9Y9lYeW74Ga0AeO>r*J{f)-*P5T_S$z+a(ZKp>KpjqZs|~m!AC?E!MAO; z+)4ZueSLB}X#ni|j&_!YEVuK}e6yAxeY+CJ)bIxE3f~4_7~`_ueEqFmkC`b{1Fn+xEv`ja|&C1101 zk&VAq`z<|rbNEtP^P-BSL5QJ&`A*5Q@85^(#Ga#bJNXTIR!{?e{Dp^y<&K~*%q4p6 zl7_$X;zN{S3v z>G%5pOj##Ur73WRI}7cCa0XtbDH0KLo7SU>3JWW8P1(5sR9E$TC+eb^T3A<;fOpOL ze%+Hb7Fbt9&7_hY_)aOFTQFqL^(djFhJgLc7qIsWc)eB@u@8^vnhTh^1{;g`mlwCR z&-ds2dOT<>a2!I+Sj>sy!@b`PO{V|k30s& zqoyi^c<0MRJwx)a1~3Q21fHJ)E#J-b_0^&POTvS+U+rJniT3quE7FWBiR9jFvWy?= zbQR!%_w(715Q#zZZ4a*R6Pdyk0RX98fkZuyADwIIF_7y`Gwuh1s*vIkoGjh#QGo+Z zmI1I%l>}6Y-@9!-Yrwfb?<(^*-L)18EJT(AbIF?CYL?PjMWDjiY2B(~#s~Th(%u#P z&w?kYmKKaU1sV8Vf_9ywx!$p#eaUJ?%-tHNlt2L%cYK21nBGg^7sBPfc?{yl1nd&E z`CwU<@%^=0-EVaht=bG_<;p?^bNO{f-~1@Fs4U_D5y3xf7AiZT~ewnQInVB_OFNuI=_)HTUZvd z9MUGXa@T*(L*~SMWO@ z7?L#0=!GqBEMcVJ$mVpi7vxs+q?#WnIDlZ_-c;|@@5XF(N_6=WFsp|t%>1Xwlywl{ z7bev($;5q)*FHs3SDPQxx?3$`Vnh~uIDb)8e(lE4-3MQEo?Xpot>>m3YG+G|RI)@iMLvciI6TPp^9f+DwOb8zT@DPfH{W!)dqhFdxlBN1m zt*$sJyV`icXugO_ulhE}zuQ>N^Bj!_7ENQNr6qV*;C4TMTbQ4d z{`qw2vUym3ULZ$;&kDW-XV-E~n9jb@E;!O22|k+Md1<#gI(=Xh(`V-Ty?!d`D#89{ z{|*q2E_mtMw%NCwW{}a~<104Vp7T|v&#xbn_+WZB?fsxS zvmuLwaB66riKjWL5$7KLdVdm5<(lYyfb8T-LLzQHRIU0tTYSIxEIf!$gs!F`W|2bEe0M-oUw4yf48A?B_6(lZri%>$ zTpH6xgQE1_vb(-N@$7heUkfiCP?}hj4UFE`=-P9{-T)5Mw_C%)qe}(bFayW))_Eob zd755&l&ki`_?PV`y+3KaKh+r?S5`falY*ZwCSb3g*Nk6Q^L~4rE^(x+x{)e--z9U_ znsJP-P1_EKe@$-eLTp4OZrqLI-ehKP4F_pt=)x$fywEf?-N$5bMpJfqpx|;i(j#ON z3h0VP4?27MK~>$c9gkr>-(H}0eY95J6$hHb6Grc(cef`~!qE~Of?98RRglfzt9`nB zkiNWD_CL=t-PxjTe}h14Vl`Qi(n|{~X?eyg)-H!d<>wL8dD}kD6;!P!NGtBAk9VsD zi1+I^?ZT_T^Op^#=30w(qu0`}Nx;{;Ac-J9eI{k={_(PHfAy7dr~1V8nwWqS81?!q zd6pZ!vet*T$H71-s}_#5{}90u_*xRzXe7@wPPd26pAQ02)eX?gxJPPk*M3cp!;RE| z0_mB~AP(^?0Gf8=L%!-|X4V<6OI1utM*9ktxr~#4-@oxBad{XGmsy==y?|Dj?!Ec((CLg zjt8n9hjpeB6|_d@;ZOGS)quT4cdzkdB~D()eHW>Z5pVka8Bv9qQ7Gs4DDBM`#;0vh zsNqSTsPW>J77nl*Hrb5B>G~d?0K#L>2z7cPeR~8-nx1z)s;(#~r=`Uqb2b z4A*)R2HOjhGI1g+Z>VW57Y?58eKxDlUYH5?Jy0nOoZg3R&YU$#1jk#d*Gor@m&omy zOa~I}j%SS{>{)@l>cC>$mc;BW2i)x!D>lL*&&<|D$mw7i@CyYn+V`__syBNaSq~80 zZ>Tm{ojv@? z+k)mMOo&8D&E*Y6(A)tJ!Vm5FQgWT`V5I+fK@r#ZtOfHv%8~P-r*p&WSYG4pJFI?W z?6DU@q?L<+A0W7WWca?Fn9cWs14F7Yq8m#VIZqm&kYi`L@!((n{7#!)XfQUaVcY8w zmC6pe+8rwx&DoO;Xi2ZuPQ`!RKX38S;v$G2j#B;Rs}TTgTVfvX+UV3`&5@1%;&~Md z-;ug}Lo6gr#K2$K9n4psgUio*k>TjBdtfg!U`Gt*5-?iBa#yVnPa7WFks6MdWLE8; zo{U5U_ucncRUcQ=&*@J%+#ii_HXHab1CB{ml~}6HrGc|3h?N$7kEAcB&E1n+Bb=hA34|qK&u^}Pf7Zqk z&iVd`5@viJXhT`Ird{s3zz`t*ca;|BB2ugkK~tnO$46I<9UYCy@t73g4nTZ4z|o&W zrXDZnJO|^$(Lj72)U`&@L+dq3iQOJS_ao7_{@EU3{O0>7bOIuy84w7}oHrESCl|%7 zh5j}|gm%X&$}IeD7oi>pYv(WT8E$wzP{{VjQ^ue7kTkCYa4v_j>d)hacdfT2n4IJ$ zUV9{7_5gZ{G@70BuP1&Q>}0%a&j6<2rz~%TaI07L?2qW|It%4e{*4NqXL7W=hr4|N zkbqoic)vO-DNa3BOYvpfx7TEqw$ki*VFk3Kyv{)aZZ-3Q-~F4fc-`;&To#Q{yX`#B zG}&p2{3osfj|xUpX%UMznAzU%syJ>=P{W#ZsHgt$sA5H;<&ZR=*Q9L60~m};#I=4g z8CZyJ_+p~BFFu!M(8`|YSQ%~u24&&;BD=oeEAK1*8@J`frqw*5=T$G<$`j^%0o=J6 z{qOTqhC+uZ9w)(Yck5W*`KwD!J0xp)(H2d>K3{?%F|AtJfIMIEV%Gg#AgUlF?;j-fU_hQV0(W5!KtG&w=$ z%Gu<^3wd)waSn{xDl*ys$h3bjxRyb?b0~R*}vK*~zVrcSX!RsjAw=}r=6!Q%@yX4A0F>-j%0=-T>i{wR^@GXtnRn@+>YaLV>$d@e!POngwE%| z;k#_@t^}kgbbd!s=*!lFI~vt&?@`6{e{!B9yu0wNVQ!T~RmEb)4@cc`{;H_h(gTSo z{Lx?!AiJ&Z&I9C^pO@gu{`ec^s}N+tF3jtPAb6+{;3wk9wK$0SVv(jmB0e;^&t|v) z1@#WZiQ9QhSPej0T9D=Gu%MfyYPASc7|OSLJk9vi1QEN|Cm+5PFUQRMyTjuPv2BB3 zDAN^|G&(#^vUudcu0S5cg9zo2DdF_m5h_K*0^%>X@Ydb6e=mJ7uk5e>d{GMpT`yc9 z;8Nry!^?eXf|wPltRv%W-PKp8xZ=*}C#fnSFd8fLJ$G&aGuDHX(h%6>%W-zmTu^I0 zUhZ=`rzH#xw^QsP1vZyc=v0j;nR7k?_@EZ2h(E^~eZo>%f{M^~tBk1`LPzeZw`=2^ z^-SZj#o2wP^=UIN(4`Vl5)^{W6*^bHj%_3y6Oz6&QymmpnkqrZQDUaoBDfD2Y2IdR zBg&(84C@T)*!*M&w;CqSVBQ?fsL|Qlvh04XN`y%;3sYqF(qayhA7@Jha`hxNPS@vc z4%UHA!)Vmq2t{#x>Ctd{U=xp#W=_S8`&YWDzRyrvoGdJ4+u|EfmJwu2#!nrI6wkRl z(ivsD!VX6}s@^P6b~F_s>8ci}E8UFE)6QhG`qk5LCi7!a)tw^$EZy|3qOG~x?06mH z%QCIp?JUmhtq=;Incfe^ufobXBcX4vOA~2HeX#uLBiKPCH85MS+&L5{Nq(#4vxM)( zEl!cxcgJMn8!v)bPi>d3e6tp2dC<`Z$LO0(nkf}~_cP#7=YjcdM4WQrT!r+?*$L{j#6geRgGgk)2w6KHUtHBUknf(dA_+jGZY1@#-h;rT#d?_hVHPm zX*w4P?1)*?R?!EHKe7OKuYb!heJ#}kT9Gd^*H6zR_h0Z=1QUeSPbb~M$)VmfAww5D zD_m{a(%a{A4ywQ$E1AYhb#5y#BB;jZmNxj!f(xXqj#A$Mgaly9@5qSiAQhgCShUBx zh5ntlMDRJDb=(J=TuOTz`ECI|KyWNPD#dLzEXBzfIi7E3b9$@{!jVOsuv<9xhkba_ zWjMXNwFEd9BDJ>q99tP>JN8R>ajAB;aNDkGm^K^Q1CFdBhQWKQm-^8W6&1IzS|6*?y-`D#)wG4cyv2 zi^ZO92&sEh4v^SAKeHR4UudN&fw}bMQwz3Xcx;ny zF8Y&|QG;mo_03jpyhPI8^phqd5$%=q%00Vg8(d<%@71PbC?3uwPsS=TuNr?&JZVLB zU%V#=Zt23@he|mSU z{+Pj5fo=AaMv2Nhh~pC=Z2|khR{?G&d`RQ1r*W4+~K{l@KhyK0v`iu`ZH5JXtELkVuiGrGQz&U1EM zczE(GA^ljgdnW<}E#8NYC;LU!V1(rAZFPi(5LpgAkf!s_++l|kMm{!`STQ{9m1w$+ z;mo)=UgTSJNZFA7E&5gXX=f953mV*K9kx`LfK49K=VvdjdCV}pnYV|2pM}6J4Rg8@ zk2gKj8Via9Ndfb^toG^t0MwBfKH+AXdsfOr_#ZZ&?|5Vr#~%B?;QNM}_74~ivF(?< zue;`j^bBv^t2Zb?C=d&EE&gQT!k_tsK@{6PNFUqGjzhU#&lbCW4j#K)C7HkM^c}y9 zIeU+wkU|T))6_YEW`AByW;l)#;CMdUYH8d9M{_-5aeqA5cidKf?W^N*`H2*u8=~bq zf-bKsOF}jz`13dX+U5CDH~A-S{*J|Zts{5wDJ)2IDZM%EIZY#^oH4mv^~HT0N#6J5 zSz!3b`btEu`yFcfD&P4SAOs$eP>r=mF3Ua`1;b{S6v)sTCszqEK9+hk&_cR6T=sC; zqJ-3U=loCy0b*AjXit=c+(7k#6}@rC$(28~`?mdwnvARV_ryIQDbjHaWDSjTGVE}* zkH6#5R`9p6*A2zgrg0Ecs|0K|h@<0R!jJ~LB4K@0I)CPG#kxT@e+z-h@0oF?*VF7N;G^ z5b)lqbjr#Yi?ZykN&JL_cq&Oe1Y|`8Ic=!jv9IARPoZVmOiSD^0C{oQcv5(U9#-p< zR;{GfvEJm?gA|iaQf+r!-9f-^s;M|lMXy&1o9Z;GU^()CFL(yW%)wd5D z13FmvfZxeBUrTdfqQ;LG3=C@L-+vld9jmHzzj<>UBsjQSPc_S{B@pAd7km>ZztR}L z*(Zsa>GirZ*hX|&eTP>s1b?T>4YS#3sefJ@s9$M!CHL-rA@w*2{&RW7V|O`?dl0J**xg_dwigS|LPlPWyHl?BGKLyc&>`=( zEGh3>N>h+0e9#s7tC~^gr_%KW@O%h>=L5$NaFM>$@*(9(_|q-gh7}5LYiS`q-(U`= zHAaX55VjOVuJrVy6Ue^{U&WrH22JqGh`wQ5LCBjWn>9&LArNz0q~xr#`RSEMNg8=B zuDgRIP>#;s8irUN>Nw3czL6OdA-o36*KXD(^ zwByIJy6!bYsk7^JrNK5nbTLsm*H zu6L`6_97Qg5(0!YVuyG8_K$G_1*2iGnULlq-$H{E5qS zT}@brpRie8Ml|XCAwu~rRpN{Y{Zm)FjmgEebZGhlfY1AKDk5lNF-ZLH=N#fcA2n7W zgp^;>mLibYtKFJLY+aG3FC%1HEH-9dMo#5qVwE;1UeCif83LOk6aPKL4_m(x!m$*~ z{J!jG=%K+Rt@QwH_If%lnfA=M@f@qQ6alzpzIoldXQ|JMO$yTx!tR8sEyQxS0m}ZTh2V{>%GTwvc4S~tK)#uz^-AdaolgdR5@RtA%UrQ7QgI~^c0e4gd*E1CW%vv8?lHqH-R4pp4( z3<}r98f}dGj?#UlIK^}vnMVcsOx^J~q5XVw$pG#yxtC!tRcNg1bKL%QwFmJZ2Livz zT09C0Y0nqpvY54nDw;0cT0X_<)b{;q-Z1@?0Y>)gfhOL(gOi7CljR0?5& zzkmKNRs`t~W9Zy(H5Lq)(^s*ptj(HCdpUX(-0{jb$NsmPJo^A_yCtO!9i(f>Bzncx z*k<$TZ1thDo9?`Ndv5~FTSx&T0x7q{20Gx|`V70*#j=cM~yAL)^l+`l$G*1ByA0I6f3{^2)3Sj0*nVaa2La zyktXx9T*R;w5kKeMD6uf_Vr0LOFX0n72~Q!lF6Y>Rm-CrP5NA_1~bsI>p2_UTb6$_ zgD&i%E|vE4)uP466t3&p<2li%jm(O^Na*-C%%wK7F2zx7BxTgRkSkY-<&`G~XY zF43*7yEWLo%kfwA=0@ff(_q1Jh5kp>W{DNyOLnzaWO%Uxf>FH*haWxu>H^M8VS&AM zbsp3|&I(xB?)ZEKbZ?`j(-FxnCAL**l8FqImRydPKpnS87pU(A4U~u?t5!3iGgS0}QW{3}_++=Xt;VD9#Pg-In6pk`C zB9gSxoji|9U@C}KSeB`Kp+QD3Z264rAY{2W&*lzI7nzC*qu__O zS0k+REznq+{Zr?&^w#<=HEuJvuQ#P7a%Pl}lbnmn+Jb%{N$<`tYYZ>q{uU#+hIn*` zReO3B0EIFB|CsyAptzQ3-6UvmcXti$7Cd-x2+p8^f#7bzJ-9>g1b26LO<-W~!5s$I z$4Sn;b^pAod+XJ$di%%Ju01{7Ypw3y{q_1*uNmo!yV%R55H`LkoeP;sr&P@5_pj+8 zsKD;8M~UlscR?l?66<%y?7hWhsfK+$e3X$5b3J6>@XfA+plDU;j*MI=e|Qfp9$qpKley&kd@9%N z*t2gEbMZwV8jM8#v`Jz~Hzbw6Able>5IfqGFr()k4+@zRywS}_%I(85vEs~RT&D|C z4@r3%i`Fz^Q6_hYsAj*;-72~P-alv!<5|S_ZZ>D)P0h*W<>SfAWQ^4uXJtLQJGA=P zG|lh8*C`!XC^7RB#mSR@%+f$RGebc@bhMr^L}ak#ljq$2dL?HGLv_ZFM)otA zJ6li6dZ}l$Xt*8XEfh=~iS5L~spNIGgcv-`KQI}GOhFWDiXAU!c?!NOu}yIomY-Vu z0I>OB;z0=aZj)0$kw$zhgd&5Aw9b!KZ!`uYR+eJEr(${B{gX*Q(jF-HTiDxSGtOH$ zN1UeWH>PL=M{&wqQwSPqD0pXIrF?DB*d!ybj{#CZJ{jTtwR+x}sYG!wX2j?SW5hQ8 z+jDfpe&ssxnfS!LPYxa~^o%xy+}=SJGoHH9MMc7?x>V}FA)yZEQDsh1 zXI-M{FkW`;yzf*9V12fw$>UAi7CBtV5C^Nu3nr_sS#hSZoIHHckur72Yj{!HO36zq zQbBHU&0HNg88^~M9v&aYzxj#S8kEsZAYJ!8wI-e>`D)ngTzn#??}HTSSA8zjR=u|p zVK|9Xx!eI~oM!D9z%Ix0$z)tJPtGQ-Koucb}}wNJ10s&#HXzAJxl0#JL+ zifYyQqiyv!4NyZHY%Jdk^kF&Z!v&;JCLk9GGX7bXDb+P}Zjg;9y?oN#7Gx`yP0q`y zp`{s5Hmyjb4b`|oCSB|LZaW5y$fIfu`KulM1Fhu#=6Vc(sk_JW_ckxVCu+Ow!rwRC zP7}=m;9DREdpdd~iKszIf;nxLq~$ zh2ABX;#KoVi-Nv`&&RDFIS!+wm&z{D{y_8&1e7_PgS6C_BO z76+Z=349i5^^F$#s$M7Q+;4tKkZhW5nr;}bM8hJS|ZFff&Ks6;$*amYWxj81+A2e-POQEHQ5&8zbcSmV$sFEk!O6MFxHdojXRF8 z3I(E~!irM_sQodIH-lWNFcL%IkOx^QpY52RU(h}E3b^C6$+K6+F`M4xzm$?6VxI@Z zqBy8G8Co}{`+qcv45h`kuK ztA(1$(S==B(Y)jj>CB@OV*7%^G_fr;KwC5euRl#}fSfj&5=P+X;lzTiR|2f<`flKt zhSnE|du!NPFJVWwF^Hx9E%azD0-LBy%Pm5AgS-`9sgA{s0Q2xH{pn8NIj1sgW+XIn~OC z(emctJB!BpTjfD=P$gs$4ZW+FG|a-%YWf+#S!THScR`C5OfH{(|07NrTOWRw+`U;?t$P z$yL350Gi8_vMw(kd^wMO>jCiSfZh9G=YH98wBdWXV{xK%kpr^cOvFq?OdoLeiW3>E z7WzZN3vmGxtNBv+d{cxGN3*tGiv zYvj6@8t64vZRWT+%`Zw!+>hb&=kv#Hp@^S; ziEAo3J!N*%sO=~=H~b)H>h*DL%rd*aCbWTQKpsceW*~qi+#&N}a7ss9^xHNHo!U3@ ziU^oEnm#NH71KP`C?Fv3?U&4lPy->PX#yF6A1%n$VrRIAD_N=n=$Wv6*j8+z)d?65 zuY<#BDL4F8*XY=%&7MXWiSy*54jg}Z^J{(Acn_U`Z#Y8yu{)P#SNM+EQnZ`x`3rt6 zZ{xNY=q1$O0UuI~7^OsoCvNgFS&5sdkRpx3BJ^f)?Irz%mMDv-ZfqubL)I7-RwTB% z=z=~TI2t<^^qm6BC0u5)qS+ifS~^Sz$$UX7PZevJhC>$OA*xIz&Pg~(8(G}#V!(nT zvmga=pkk7pfQAhKn(&NurKmBn&R~a|qOWQhMk)83`r^?_b6TQ}9@a(Y;8f!=iNWDm zu>@`UMENA9nD-2K2>!w5j)%ad;g(AUkKQYc@ewR@C1)z>YWU7jtR2{9imNx}Y8)xNyj z`?xRy@5x>Vs!eq5rZ@sjM|YyUaQ^V7NE>o$bHJYga8`llXRfwj%!4iJhE1m#(6V8- z6wagb{^pbY!|DTp2oS!-6UXApfWU@o0ulfCJ4N^OH3fVrM)$OL(ma>5CtH?&KIsTWsDRxqNI0*(+1&-AMUg)-Ibt0&1^nxJt>108YEfr zKy7R0+u58EPM&p~fOYS=BW@b(>W63fLk2qwWT;X0_+dY>6^BE~J-S5?DDD@|;rb>1 zb}bW7-Hb@L{^#pSM)RA*1cK#uM7H1ZwMG&{hAZx8=0&WFlC?QoXW$ddNsww3`R_EI zO5xGNU}jLJTB7Ea$$3HC#eSyo=)q*Qaj}xL+-u?#`#jGFcfm%pGapHz@IEZS*3=XIb6xLtfaXmMKBeGyByv~Fw7eSP8tv0f0o%W z^tDrMx+Iu1&E325kM8huQ+7X`i4v}=VuVnCFN7RTnttUk^G5VJVcq4PIv4DQ5tFL4 zk+An6dCtxGP8hM=ip2%>e9*=ZSoQZk2k&}yNb>vOc|zVzMW_B0qxUw!quaE=P>k+k+t7`D7|1opPIur+=6)?VD{&Qq;~zt{>=wnkm(mx1O$z$7WAlZeMmriT9?w zxPNya2wx24vsgP$x6YqG0MJiC4_P#VT5HF;Vi%NJi?H`4%VM|BJYpe z66og$T3o_wT?c#~j&oCfOcv=r_aF;Dfk=q*-<2O20`?zOYCJ1tiyUZUSD^%xte_8d zd8uRjaKhdv)MG1FKNy^JI!~>S-F+Daj%KU&1?*ZNa1Dc=oGp!`ne^n4X*h7M2Qybr zOOBV3j`GMmx^4Tl=}wUeMHCN*<(+AR-KXJ90lgn&iy7}osbLrCimqxdk_MaiCRM7#9htCD726-} zo}PLR3aDR~S|~!gJ4JfWwK8U!CQAro9qyeJtcSNjZB|Tf!W;>Aa~KKW{$mSrAVrD- zggKH_p~zt;>zV^-lbDXwKVx~kaUDBhB5TvNa;M#NeSF`1eWIRredp-PTVLaQta0qO zAjrf*&3j%d^n7w z2WTz9L>qkcp_8~o)bK_q%ZVLsHcojz&*f0joU`k(V{$D_$n!&pyUpLuw&z#nfb$cq zYi0U_sn~GdgT#BGZIih&8J8T`dO)r^Bg@OtD+J@{6SO_u-QUdYC_xY=c4EAIx3Vsr z%qS6K;p8NtyPi!^y7#h349*);wT!NOwr0~yN_{QAW*RG~mzg7n4i|dP$IC%>K{~?n z%cLrJD9UGb2H^HMk&ebs;@HLx*+y>gKu#9c7kv@d?ubBM){5(KZ`H! zNn}*c+*`3BtzH4IX2IF`{RvTt%_xHg;T%gjy?JY&DX+nOG~|W6g8+(AauvSiySROr zl!Fj1HHW#kF_SkRQYn+^N`tVBYpmPc>FJcydYXK*x{+f_z=bX!$_^-$#j5ESXk(oY z+9zv;=W^7GFN#^Pur}TwxF)mc^u^dgnl@(?ZVu_+ZP!86SaePWZCr`5&iHAAH5H#g zgUyFaZ!b>b%-qzGJIFT%;&EuGFmR@?gU(RO7%0*X2Lw|5zRt?vRiF1u+kW03xlJ(| z+sbMA_Uz`Z;yUJ@WDdUmp2v~7F%iWN!Rml!mGbAR&{H)i2xIoDekVzJA&(|8iyil* zcO36PD~Uy)hRxKu?R~ORh)hxVZ%IU*j&(D+YY<40NHPKDE;RqSyryy!Au&kGn5E4R7X$yYi1b@2Lk{or){l!uc;y3Uw1%CgggH(ubqK?*NNKlZ#^-W792fhk2g zb$TryfcB=XE5EAd>-kp(t+uF={Wro#aZvB`NKEOl1&pBYB*rz5r7}P3I!+Br3>#(13A&yz{=6r1T&fj?}72OqCkV24>V80SU=yj~WtW zYlt6h+U)hKiUVV?ta{YH4uW5pI^#UBCDpRgJ;LYwcejI6^vZA2rz)4eT8HP+dBZZ} zy?Rt_hwnP{dYhl|vA3d^Ni*n-^NTS5p3LD>5`!43GFDPn(rU4q*KIp>;Hyl;Uzz?) zK4gzQ_FenoBE}3&Phfl#Ih^;1CC5yM&u2*D^l(=}nVn;LJt4z6@=e(pQa4(;-p5*d z`xt9yImhf0MYxhsF(OuS_2HLESV9@(mx8GL^c5mZ$OUcMqT(w8;FpcJ5l9i%hPBCe zq(Tgl_JFN@3#7;d9DJDt>vLS+a+jy{Hn7+1ca5-}LQuOCU$azD-Z{f-J>3RZA(&ba%43uYTU(TvWh_(j8PX@kAs2a=)6MMYBX?+fe@JJmR=HKyyFNHE35~Zw>E9u~)efJ*LXrr)e#*3b>9jU%DMU0==+4BeVoxUYx@Gc_DccvBQ=zrt8bIH;|J#RlOpL zc(bKjZLXn)YG9~~)AR6nMp3oR5%J-XK+Le@0fU@fQ3=f`Hk;UJ?_&$JI((4J;g%`8 z`I^_Yjlg{L4)`m}6SMd8=oj0Z06;5rcT^>T&>0@aQ)7cDhyCJ1ebGxWYB1FWXTglM zH!4Q_Xo0mB;hWZP9S{}3SX-;dCL3Q(UB#Pxn3gEvoX8e}nlvrW7x%8>Zro?NxJz#o z(mkFZU+Ih9?Hr3O$!#BYz_RM;Gz%(lE{@<8r;3W$FjDdh&dE!>rfjxN*Mh7QXY6;V z^S8#*^$ma%sI!!@p^mWOWKo&y;kODon^zfjn`uLaS||GhdzR6;vf@K|bKE~Qk}=@u zC^F=xzs7QebSccHPi)wrY6-N%yR7XMr#S4`+nb*R?{FR`GDdy!qE}hC8(OPW}CEzu-XMuXT8BCxW#+~jbJvB3LrM%B1DcRNW zdO1GHtIKs!%67~GFsdWk^Kf=%faHn~d zC*QOqw66(7fnjW>tP;0&VwZUl+BeLd74R}m%bqL&ZZUZ~lU+FIy+l)_xSPH3F+JQY z(rmt@o;g7Vzv1da7pgJZi(db}cP~>e{00_pvSPB>v51N=c1aE5apz|uGv%F-sZ`E| zSLtDz-<^ModCOdVmmP%*6-bq4WF5`p$+Fnn=ZPZXU!!naSJ!b38CTG%?Z^$*2OCDg znP=_ISH{dRz{;3-jhA@=I28CAF<`&3ob-L?z-G{gqWgM{`nU(OnJH?%Azi%KoljY* z&#HbzK|M&Ra`#D(uMi;+EO<$u=ZME@G&$k?p{y>#MDlK`kml>wBKQ2{ruO`@_r`!!lUM^PwLZ>RAqT&ntXEcbD!_)q7L=ws?NBUAXkw+YJatV7O{5K z>E(ExrzoAOqGnDm3gdW{_X6ibggDBfVN9nND>D8`UY(`N-NkN{-KWWoLSoQ@*^hk# z$=ubUh@_0+?+j&!!{48Lc8O-)$xpM7!1PWl@r5X5LNR7k0dwSa9K?LKroTs$Y#UoS z4x1|afPr>kHR*agi|!Ftsn&~Jzj@BQlC(?aWllN?=_3ael8>@KfA^(Jmx9v6 zXYDnNe@9BpQTu^x>+zFI#M?(2 zgCueuo7cW*Z(za+g2>Dq+XQsSUfGf0)^ZrWGYYo_bE);SDDtBEg649DI;!K}BQ9`T zA?L|yz$(&ZiCGEwPIPa%4{k{d>~1)^(T$Sbi!FAU@1ft zMrX4!>yOfQH(w_)T+ki4&3QuExnQG8c&n-$B(+32WIpUksmv`trspkZxaC$xRLaemD1jyP>$O@=#aNsLgd$V;h2zBn{ zaxfI0*4#d_i0v8(6_{WJc2nX-uCK*S+*w^+j{DZ3f3>lWQe{9{ zu#I`ICxy+SuaKZ*j+m$*jMv|v&qHk7>R=i}modIg?!qUQGN+c_1s&R!$kfUF0i1$o zDLi%5eaX%s1?eLlGUswPd72yvrwdyQ(Wg_gk`5oF+SQMUvj0NGv7s8-1^vKhZ{A(Y zHVw*6uTaKj6BUT&I}FfwI+DI%b9&pGpD)VtkJtLl#D(4D9C0jdNhLMV8SUe(%H;FR z;KLUYwQ}J4=g!z?L!>r0{&&9@U4MA$alsNQ9{7rVtV4C$DxbGO=LAZct=g&waIV#x zwmr5adxVOT(k9N_ETBBKcD{0c&rABM43J6wz+oSS(;D9=*ATLwT9xI*z+U}!pQF%C zPDaN=zYdn}PGR!&L*HwUXWna{9OWawTJJW#li6w4`Nb7C*VX%#PJ5&}6~Sd!`Xq@o z47LnwFEM+OYkBK7MIw8njF*@G+o6U>(bJhjx9}xT}+?Dp^RZxLwpqehBHYI?oPJS^Esj*B6>gEUq`>}P+Ykp z(%O_Z9lDk;CW#A1!030$XjQxzU}JfcC!&yh5b5H`W@rE* z{4A|tjNyTB9s4&Z#-UEIY=1XHCjU3~<9|e!$nmos{zojpwB6C7ku*H20sqJDDA-MWk-REwKV_>c2UAxzB6L15p{2$pU`&3VS zLgfl^!lk~_lljG$R^Cx57o3VMRH7$!jZPQV#M4%`%bSS5?l>Xed-vCvlrfaKbFe01 zf>Ar(MkX_A5oJ5ouCo@V{rwM}kz#VfWcMo9N0QVil1NBM?f@T=Y9M%8Po4m= zLj9G!0ANj+l*NSD+nYkWqMgd^Z>|eU?oX7%7Pudqo#w=Wep5wq{$ah?ieHYp|K&+Y z{13)_={V$ix{a1lpO&S2R&2qgMjiS!u~V5 z8|uxX7m@bYj))F*>>VmUaN<6|MhV#N_!ya}F$SkVKUi{VxR$&pA3*yLCEYC>%%|h! zr+>{zc+fcNOg=s_Cwzh+yq0G~^LwrNZ%cgviE38mXAiHWeLrukQvtO8HRc9^8x4~0 z|7f62+x<6+3&^&>{M94u8La^b&{eDaj7}O7^oe}W&YR*tD?k{p27Xev-X1rSqRWtG zbSY?c*5DfW_)U@hbKghPY6cVcLpb^WU}nPtO?C11Y?FUZ3QtZLpweK=u_*LxdQE?- z&)CxuQ7w<-ASv9IfNfA#%FEo<86+Raz{%M3kkjP zF!kzoLW=%yqrFGC$W>g)M|f*VXQqb?ZA5i2U*WCELyDY~}PfE}divMx`~kjj`wE7<&Ve zG&NF;I-YVCWMp;%XT61)8q$X&1rOg9&Y3J3r@64tB#A~vkO)^nnHyFlA7g2$_?BneWTV4#iDWuC{F9ufOPox?@R2h*>o z<@4!}-{(%4}hM<|G^iwCeB1G1+8 z4YQXT=FQE>fXj;EZ*CLBhCm?k8!@YckjVV=0E~m9--4uVvtM+P8-Xsx>?kiRFc5s( zfS7h0n{o3niM=Fh^X9RYp{i?;)-Oyvlqhjo>owY$PnP}c?L4PRhfveWzF;0v* zh;xVRB_ulSqYG2#P3P))nrhbKwlL8JzDvgpA?(Wu2^$aFPd8YTW4>8RsJci(m!?Z^ zi#aQ_qsmJScZNf^Ydtb#JW;^>7} zUu+9OC00wk*>WcR6p*ztQP(_riv1hqaHi*w5LvggHc2P+(?FIpl_V4LD`e){K)Bi> z=uDm`rcsOw5!HijIWa^Cc)MXSzet2f)^C_3538OxLLX{y@vE=nv-9U-aO zWgF7Q?+51#ic3=wkuuZf+lN;&eShYP$C}z(8aY?%WDk$aTwt^Ofli4);#w_q%HDi$ zbanx!)I_86vnxyXXp07)OjP;z^(1uLFiDrT;1Z;bjvVi%Z!nNCjeDV@o~6vMR_ z$METgk3#O8#maU zg*F}Bt8l&A69rd%-f48l;1dCGKI8~d5SvbmfoVCyr;(HZbdKV1NAu44O2>G|ndeB& zuj@OTz!q27byEC%TQB&X2`PvS6eoFU7i%qRn_3D4_dz&#fs1{770>T#cg7$JMh_&t zp{PESCY4CY&LM@hIc6>m{$~kdBhC4O^^a<~AAwK~a7kctuJ4sm(>ZddMR)~3Z53;7 z$%)#}=gyI=X^SaY?1s4F7Q#%UpipJhlr<^l$wvP)d3|#pZa?y)o#dLdb6So=+Lxni>)p=0z64o_w$G-6vr<)WL^Q5xBL-gT|9ny3t|NISKHR7!j&FpE~L2?j`-)y!~7>+xP(I3x!m2 zSzc4X|LOx(ds0HRbo8%g#m>MsD#Z+-frQRG7QdyLl-W>iuE!3qpRswIN+8UQqWxVns7ugNw$miA_N@KQmk}_I&t!HPyT*rW9epNv!@8NXYu9`~iY zR=Li)a>l(=Bm9Ic1>8#l@&`S@1T@ZVkID`i9mX;yCjb@`LwsER!b#ZnP1* z$$*gW)_vgOKpw6Yu}{!Y;3q0scJArS({vk;0WqU z$enx|c~$%9;_GnGTedna--pCV&L6B|=>2ZFw{XelF-O-cc9j_fv`rmNS1q<>MNarM87?P}YNiop6=(=}_OtqlmXb*2lpQPY$1zU4%|s1JvMlT-6f_q{Gz z)H=BH7B@$%1Nk8PMr7XSTAFtNV*iXDp{9e>(0L{7r}wLC4cWKr$ge4JqFhg>6I;+F z=KN=lciJ-Fvw!Fg*<^~Jw*Wo*fkdMrFJ*qyRft!Z+o4MAI}YB-j*Ln}2cBnlbGj5G z2SIEITDTddS9&^VExRkl_Yq$n37)-7g{NMuIeD3HrArJiv&%)SHEK9eNS%wKC!PLe zV}Lk?^LW&6qv2rUd)=O92Xq0s=`vujdGj#t0?eL7{B%N#6p}f4?R#ZTH_xOc>Pej9 zYl&(iwA1q!lDL zTu<*PUoN>gxn^x;$d?5^PFK10A0{y>)Db%%%ud(pYr>XMgP5gW?jG6J$nUuzf; z#|NjMD=mq#TJDMSxU)6B@1AwAYkYjtlM^j|541b)3B)BFw0yCdki8`A7ARKngbGVT z?&BVgu+8Fm6h)ylcTBH()2B9jPknu6a`T!X6cZx$B<EV_5qp?Hj-y=NdwBN@hlyqE+J>6wi`C&xLs{QyNGIuE4qT<;>@diKr&iLy?@^|^lYsgV5xkYy|Cbs zdF|a1+*M-w#RK;Mf5QBVgq)#B{eXXx&gb*&`-<0MN;MZ0G0hKx6(aoh2i8JlLa7rf zMZ;!`oNK4p{4GW(d6!FkK(yKeCIS-hSP-A#z^@8ZAd~p=qEgwyFDcXG+A$lZt($<= zwX*5=H^YCxYGLU;^S*IZ15JhwI%r`di26HV?>z$I-Cto26l65;lR!knt@NdU|&a;cK(F-jo2`c$y=Q?aj zk#)GB4a6eOC~3G>bhJh{W zaXayLOJRWuV-w4ZPenyz^b;SMsa~%0a2Ddm=EIbqlP)2X3ua zNYj3Xi}3l9#?$!$`Y!(=e}~hGYLlxg9Y~4=O{YmKs);m?-5-5myh5X@SGd|2D*}BT zykozSTfDLzAhtBrc^9?agREkHKQ+u;}@3G#t{RU5PVtmTtLqOpT!pK4ZH&> zD3avYy~wC#QFbbXo_g4x@A2#GSC6qCioeVwL)FMSNv6WWu$m@`WU}-fxs=5 z@cz}dj_0odJdGyy73_<5ei-i!t>1>{k;ISU*P1#Jy~=pS27pI5;n8G2|}9 z3Wp`Vplj}CRRS}e48SuZcY-ADfN*G#1#Uwd&*m~J&nLk4>>hUr-WOA`{B`Y-)q)sO z(Z9GWXcm^@^Mtk4nIgl&!iI_gCA$1n_3`Yu4FiTr^&6ZLMCO2?pl5Ws}nnHv>ja z%Y?wx>us+#E}ypn;J5^~Cq}=!e!poUo;3Uw&m3H@MuL97vPZlE$Qi$RVWGb30+1KM60}Y}<3)!7gg~%4r_hLxrX$OHLIg=w|?ksGxgm4Ur6E=-I?N!;; zORSSS+Pn&BZ~OJdM#1YXe#7)T4W!b+FUtF>QZEN;i`n~&_>9&nc%v^4X40Oh@8h*~ z9#jx}%Z+mp3y!K7b z=Uno^{wua+3uA&2Rtb7v!F4fv4>G{XsBRXOj-W~hW;40AY-~p;WLcm+^k*B z(+_B*qCvj6lczVUCxzM*avIwUQqeqRBR@B*)&qAr9?Z}x+@pt2#CpoFaoJnASYCKj zq8T#an6}4ptiI?UK{(to~sA9Paqqtd>o_a#fg zyX)vIrEf+uyk_Mzhyg{=-F5>noVeZ(wr_OLRhs16Yic z5dprXuEU(iWG}xbR25%Al#2jr}0Yx)o@{PeH+8s;M21Zd!b2fO~rxrXoTJQkfBWVYV< z#oj8oRyFF|&mrPS*-1S}>c+&@=0K0Wd?AwU`(W&QH3ZdnJrB=3kL7c}xL&oKU~Xp| ziTtp&jmZnN*84#B8&Qdo)1+?M<|U85hC`17J#=61`pc?)<>qjOF%L20k8DY8`c`eKuq9zVswhFq*SVyN|$UIZFTjBEY$H1hGv*@;vm6pZ#4XT_kLpytGVV;K)TRR5*IZxZFZh0C{_vcT~ z$^=*p4J4U3H13hRoC_4bG&^-mK+oayR2% z9D@U??B9~pD-bSKBA6@3Z;>mnLo_It@2~O|0%~36^Z^2?o1WX_>EjRem;Axyd*Dtn zQh6tb8RAr~d&zCqN?OFOm>t!HcD~1!I@)zXeiKwDI+Y#Bi=Rkgak^54ww~Ni(MMds z=l(LcYgtnJ%|D|-V6C}gG$N_geeFc$bXBa?&W~@$fBjapvw2TN-{-cGk(sso`kEd7 z7#oxvYg^?G|7iXDJ*%RxARwAwdu7m(|okSdqMz*32T#fyQ0tA zuQyw(g5YR_4+T9NOje$x_F($CM+sGmrfVfP_7ccLnuL_oXT1#!p)v!m4h{DDyO3bK zirRZmuLdC4z-AY6#GQ0#7fUGBD!RgQD$--ccYpK+(SDxLM*1HlC>GMQS?u&ZbQs3> zJa_6Eq&B|gB&mU9TIpY-QR%R_T?)RrYZwJp0p_Sj{&8u8HH@|Wt2Yzd7(^nSTI>5o%#D+yM#Fq*FBP-^u zVjcq(B9-U$q4?yn=6$OG0t%q!V3a&e9LpG;87AV75Ore#L=jgh41!fgT$*(Mbf46w z6Vy6oBLOCsDdA7cR5PYX{||SphA-q;;4Rgszm-w3nnrb}J|;|k!l0w>Vdz7L345;) z_g9!hKVOW)6zH)_s;C8I|EiMzeM3Gc5E9S3e6dBY?F9c-=UFxLaoK;eM~642 z9Y7W%K`s{Nx`HuS&GDY#26jDWQm-KzsQW(b1n#hoZ@}@3EsW|14A>wc`%_vo|0$b- z2FfnbyE7@04676y?0;+=XFv$}l4$^m-|^s&3FK%^wh^8L<15|Ifb30XYHBE7a=WWk zH+H*{mMOwG(RWTJHY5LZ8{J!OWka~!mC(&rz%U0SaD*@@);jdV6TL~gQ2- z8IGb^gWA#-TX3}6{Lkm$bijquqXZAXEVS%@&^w-6X{vp&TdGp1jgCGz6!>U<6?f=p1IM<}uLRVJ#=Kth}BiI#=^xeb=#l#rHvcFI~*zbtz8%j+!(%U2s{FA zBneeO+yJ6&HRFmkSCt%%WVD2r9btp3@ zx8HjLmeE(3svv!7ZunA31tTzyVVwoNJ*()6y6#CGd^w=qk;j%JroqDl2jEBwFnLt) z0Z7m5nGgo`K)Xs5H{T$GQ$K_4!gmUU76TXX%qY>uk;>k?{Tr%#fUCC9!Wvv{RT%>S z;|-fd&}aK5*B{JbI~fSC7B~F}gHDPh@Epu>T^X^(C8UhM%xxtS570|~*JG>TVYYY< zcyPn*ax`D<=if{fPsg|yd$YvghU*d*TNYwS<$AN2(d2V8A6tz{{95mE=~zFhOnoNE@HP$=vkZiQV1HxZc3;~U_O3sVC**q?H{<2* zU;@i^EMV%)!JzkR9zl9cWnd#?94ta&fc^8wuxg+!mG>ll&kHDZU1IG4(X~eB_`nd; z%e;g>cnBQN;ejhMM2v8-WDcjuNRT1GwOsIXitH+RzY}@XcONnxlQ8n5IyT;h*AnFR zJ9hp5%oPM8z`D-MaUs7UJ+{u_dt|=#U`)~wpJ-$ikqDO)v0;PRmzBSAC-nhiGS*lD zL_>wrdsJdrbgS@eg)U}KSb?inyK7+A?tug|@r;L`1BxUBJP&}-ORYzwf>hrV;GNe; zvTZbV0INk}hjet3DNzEmB$kpndymO#tIB}56Rg2uR-wF>U^7fiJEOO#v$mgBr4ono z8Tb%Faoetj9;5VrM=1FE3Iys2+=wF%e17L2B!u%GrRcULBa*I_@tf_lP!$V|$rSfo`I zs+77qwk(-oyuv#{^hs#LRRsxWm6%`W32(Odo$iXSJ=Fl`<|d8knfr72l|m}_!0Fsg zqX%UCOfj1?+NQ&ec9kE(eSUs^>XWmJ-Lb-+Oj)8k(5Ia|^Q%N?$NSl{LbMLif7gtB z5}9HV%NJ$Oh09~R(B*>A1J7r%Vk>-SW%E&Yhii8TO=sMmf*FsV%}}Z$!EAdJ;C|WG zD^OmFYJyrRcIURT`iiy??ial&zmPYp8N1fdcE6Jc|d#gA0ikZVTmyG93Ee=Dw)C3xu{8TU5z|A+w z-R#zI!dWrnl@fTYLIXkv5QAsqXulbej<6RM@+@xMWUS6rH_kQ?jq&q*N-r9*eB(K6 zt8eP7fsc)zcAIC-lTmOAKPs7bqIU+=!1bge zcW4EY;V|{1X~OG1bQ6ZsGpujU9w$n<^3mKE6XBFC5)l z%uW2tAV+tUa6#Q;2E$Vy;_S3ArSmQZH7=)*%fYk)IUp8a1{4!$PH`^sV5NsiaUuK$ zrQ+a~Cw4k?D@8a0@6XyS=G}QjBdyLwU1*43VJkSM9{NSy&1NX8-ANG7+Kl<2 zVL`CsK|p&(QP`X8*rS0AWE9bCm4?voJD3aaV&GsIX9A>!@dBslt4I#(PaJ2TI~2R; z-))6pmryVPriLh`GDi1O?J+~vn%;$Auq6zHZyCe*I-R;?0^z<5DPXraEHU&!-O5&U zVpIdqT>H*-@`R7H((4AKpE;QUfbyQ+!P{tt0)9TZphZViS&fB?bW z-QAtw?jGFT-GjTk2MO-(P9u%GySux5yl?Wm_s&#J%}jk&GyT`;KHX=_d3v9{*R%Fo zt^+oYk2rLQ$SBp;Z~mHIdpZYpn~~ga!Bk&O`1*b)zXZ8hP+`oLq5zFwLtCF-_|BU4 z@3H3!LhsMoL(kWr7+%M)g{-YufU2}6k8zm8K{&%Ph}lQq($yN>NuZPR(VbV{F9*-Z z@+9k$Ol;ms=R4OzV^@d2#(yjOQR~-VN+_azD{1|{D||z4yoWkQos%S#{YmPGC;=McKWIjI5wd?82IlWt=@c3JA5#`dzjf-&& zt#aQ)FKhv^^+KH`>v7xt}lt2hKD@}Iy z!~K4hr$Nw^3=amkK6$$&Qa&54-tb5u@lxY&>sd_3%P5%Rbf6zbZ81wTvz7MH@GZe< zNlB5Ip<0XXSFB#m5?IWh9RHRLOSO?@#lq{$t6SzT43zFTBL@Vahv?K>_48y^rUu{2 zNuv!cy=nX*oCd-Y6_St!Si!f^%~ienZp0N+wX|eq+~8m_ma@IIhC|XyQn~ebSyW&{ zN2yYEw4ycU0w;sNr%~krnjX^kF2@oMM}9Pc*mK$~Fa*nGX#%j~lN4)NquH{& zVMX9}HcB*&+c`oPB~@w&FeXc^;6$P^g$iptv5{)*9;HZSHM)jJaRU<}>~03_vFH1p zEV1W(TihZ%YUKEyXB>hwNs$D{bGD1RvalI34blks0^StfMF?h8i1rd-oGLgM+bfT~F z_U8wC0|U{thZ`%KlG1TqLxn$dHLK~9zHNf9;au}p!~-Wbd(qi1@LOO8H`^JI)S4Ll z&E6;pp#%lC>5n49n;pfvxZW{=&!uyWZ`CHL%IiV3mE7^ZZU}l!4h-DHkOnt==a?1E zb!gQvb?4Vs)*d(KE3TJz3BOUV2gl!r`+^8w&OxIuZ&C)D_Ma3@Q=Va5+UnqKZCBZ& zYU9)ji5?E|&bH1QUo*CYP^(?1xDk74H=^%X2Ug!5K!Tl%HeU}N)Y=$64-lZbn3as@ z9Dh}{1A@X`4&t!czv)I_!tnt3251Z_6<6-jD;{^7VNA7x2M}I%<~r@h&npa+T4Rjp*80ogq6^1=voY-*4m=JJ`D{Ft zNUu2D*N&_ublcax{Ik@?PNBw{Dpjp9>{rkS6>$(cze5-BTpw6Bn?m&mneIE8&)%Hl z*%}~ ze3*S`kdz(;SFlXIAmhTOj$i4jyC-8b+u|D0Zh&2{G5x_4+xq5+Cfi>7IexltS(axI z2d-m~a=k}~FMA)aJ(+Lq4Ihs0mGOMM%y_z>zwPEgYlX-8GmtgFQk&bC%epg~p>mu6 zgCzBS3Hb7QPFG845L>L(9d=|c#n18hCIMKx`!p`2DMGr`*AqAk<}GGCZI4>MB(_vy z@WhwBcjlp!w^Z|$b!2}L!g^D7+)HSfbp-Doo^9=&nrZHFp_@|M?S$dX`@n6_+BCnw zo!0=bEqQ>Hnj|vP2qU7pIun!hZTst)mpN%d9qA@Zb#q6Mv;}IFX}v7^W0^*M2unKV zMSCQ*dP9(5S%5v;kcYt=K&x_u#LQB`qTsqK`)tEz+^6dazaQ|Ms#qFA7b5~^K$>nh zao}uwE_hwv3qW#~hANG3sE(S2cd?LSf_^>jV>dYAtLZ)TMXAB8w~_9Jv@px{Mb*5G z*i$?SyqY>(hE?N2vL2a^NOvIc*Kk=%D*)x| zvRVzFu6P2M&3Gqtc{?&b;!Tm>)Z^R9@I7@kZM2Dqp^uoh-XOs4D8fGOHV<2h*tm(0 zCP5SPx`D%e{}ro(v%E3mIdWVXRHm~%ozS4(WQro^+pSBT+#Ai6BoE5T&nS3LD;y9H z#PAxChdERi2=aEM2}jR{f=n;XBfZI~L-L2^it~3z{vOSm!Fv7m?0twkX;ecfjh4OD zQ(1RfuglJHkh#jRTR(~TLw%|`;zct(@EB{ToIQm|7GqFLc5R^S8xQ-|4HLQwWL1#p zT8gBWm4!${Sjz2KdS6;ZeUcaV(Zft`3}KQB_?hC z%f}j*kyLbhQj*W%-25Zc4{^&+r(qhKmMIatOODu{)a!4R z1T#`%jIZx|iY!~lnvRYfR;9@oj!s0k(g@9&K_4RVg0|S{PrFuXT)XF%+UFI(!w`xr1pljI+eFsz>15RXj`iJSfd>y-jYv~;k zZ=wUC1NLUhtRWvF`2G*U<2BZgo^#eE1NYtR@Ot$5#UJ@#bRlFX%r3T|d*X4}%PF@A z^mkqh^B)dZB&zm~zX>2gJKo;MdhKZRog4d8pS7s!%J+=^xeb8-}jFKJBay`FV{f&@t|eo(G%O+AM)O)wZNfw zW1wk|<)h(k?_uF>>?Y&o?Jt@z9yCepwcle(9;?braOmTE*ll;&s>2;Rx8X@03%qvLYPHv}_+)B+)%E?Lun58) zgfBIh6pyvSGup%E34UAn;Sl@^NLhTOIoIam{H~;k1ft7Ea@h_q^}VDRfjo!eaPtee zffbvy)16^{y!3YvA=JR#c7`@_FGUvdt|bnsC6H^K_W1SHD=-IhL}XOr!7_~z0Ddy- zXfd+oV5uPM^#FDEoUwf#Sc7f=My|g z=nELf7mhNG>LjI4YBCP!V7b5CV6>erNwkS>V}s4s1MePDQxrIzt%Of=!4=HlmQzlM z=^H?!R=JTnx;NsbSYu`Ca}AaSK2dY|wrWX!ER-viQP!JYG;YSAZNrC$zQ)hYv%!~| z3P0bW{FH1gnIkTkk<-Zb)fYq-NpLxpIj21h1&KVabxFNkVMo=?z_!uIVf0uW z^0#CoTwzWo%W{oXKej@Y2|~e0=Zy-C?6#wcFw)yc-dtckp)Zb+rOYIbHy2hOP_VQd z=2D&{U`bap;EA>CR_nWh68jWuw8;s+yyks~l8sNjUj#jF_)0W>@gb$n@R&#`!*P!t zbs8_Z!n%+oZLN(B3@WlisN}hnT~kjYAVa8fcKf~w57F}z&?2o?zC2N0;&8{}gnjW1 z;5=BS)t!(?A+?{!?kMJhEzpL#)={C}8bvY9t9#M)rumo&O+i8XVRt{33d7gD+30vU z6ML@h&Ct;aTxfb%`$(RAgeYYupus8#26wQ2-ZL3VmK}G%?v8R&RAcRDwI?O#{r(PB z_`^e}YD!&EY$Pu{?f&fiUahqk0ZtIRrCNI$JXT>@Ok1Q=nb)O}v9{M|(fYMJ<@oH& zDhYSHrAAtPz>!Z3#~We?Llcb0>WL5Et{pN_SeG;QRU>mbzD#<4w1yL5Bd-^aKh)>8 z3Bo}`0`CgA|=>R_ApWLKr_Df;A7cCzujl_<$fm^ z-*xWG*pK^uR-=pY!8vRf8M1U2u+fCT_*?c}DA9y1m>!4P5r_83-*V zer|gj&F8_JUvoDU(6o2B7T>Wpe4An+_CTrCTU1c#H&EI|(+`eZ+zTF++zV{gQ6Pa~ z5)$^}cwh3)sM)Zxe(h|AV!+DL!cLfaoG?D@O}-E>p} zJea8_(nEiH#y7K+YDyBn?;O+oaNn)*3&SqTV$0f3svuzVK_9rYmUe$rjL7Cne;S@{ ze(%6~{4uZD)74$>lWj5H5(lx@HWZGe>M&Eh%jLz!81l$ocIf^|HsA0=?!PY zHd(2SUc$#Gnk%Trot$@K z+IoMLr6P`5Jn>=k%@I#PZ%}71k?e}Bu{s>06ZFDL0&(Wh*x3;YR&k{baVjhU8FA~4 zTgEVmsNG1@v)gsGM{%n9px;ob8Pf$A?CH)1o!In@oM_4-YX=h)cN*rAsnqjma!PJT zM{EMxXM|KkqHmGXuD*iS-niE6*;Ns@EJ73}M{C0c22ao5;oCogMBO#ralj9p?NV;5sFK8f$ z^Uchs)x!c}SsU0I-PzZp6ycYFIhRgI2?P#SI~-25$KBMqaeFW8h-G=OLZB(fTyXEn zdi&d1V5&8>!SeA%+Vq?9ov1~*ZQHatuAeH&R^~FR42AB)5Dw1NHg`{KH`N|&TW`!q zuaD|z1yjl3N>!tH>f4cpHU+ij194QeJnNnmv%y+b=_Vn zMjD^tIW=E>+FmO186DV@6N>@2J~F#)f`C$==hb7fy96Hggac&ZYw?|KHBPw+wv$Tz zA$=(9&ru|ZP=SN+1H9A`e*lhVD~ql0>LrivYFm-6CqI6s&_dkk*#!~IyW!m#EXhFd zAim5dK+S&MhA#J{rw}LDGm|MedjBo?Y-daHOn1WNeFUkqGp^S9fg--*nZ`xih4mh- zo)jV9bi`tG-o`Vo(ut;5mPH}C*y^npJol%PB2PYIe)=-f7mT!{X)w~+l`kmttf=2S zna@DHZ!YXn>9hn44!bqodUrE;>M|h7&sakoL>sn}>|E>uhw_fj&aZnNATCckd4X`W z3*Q^>NaVIBk%O4?Yw^&lok2Nv4+K-W9jH5-x0HwBI3m;WT*IKF+Y>B0Yva~e-HA*( zJ?TguQN0<(#}N2*Pk4AtHFObzN@PBgq=UW`7hV$XIAdQ_k>y#u2rMk71G>6~vm7ZK z%$WYMY*Im+Yu=3+%6XP2b5L*dJG`EcVZ~v;-|^?rmt#ZBkv#?}wB3C?Rg*tgoG7N+ zzeAVOV$7bR|2ah|^Rl;_aFfz+&KDd8@_IN=CG6Je4BvFa{p2`iHJIncz0z{?172vS zktfB*>s+6+y)j1m@F&qYI$)z$bb1U{Ea`S5;Qbyax1u~$7=-_mwK~c`_BBr1SfU#L zcm4svri)xkPG>4YNc|hmC+4y8@w^oYIo=nr3i{ukb%0*VqXCZfLvinC+7$e*Q~C@^ zIz}n=hOA$8@bk2rzqVxo#Y2VEH#y2EWM0=2KcrK-<62-&qcOVNdV?6MBBdu5qAD}p zNSy+;Lcf629S%_JYlqEOgEIJ?{D>nBAkV&2#!+j`PXiPMY_2!?^@`s7?gCT7v4c(K zaww{}q=@P_UA{M^<)#Zx1+rBwT93<{XoV;)B?=+OOdG?mKdq5CW>p19XNhXtab0Z- z-(Y&dCf`vNI_1U;D~@m0EWns+X4m2AZ!Ol-xsZi**7F{b;09`S89v4=J zq_SN1Rq!JPIkm}HTAn9HeO=Klej-WZF~hx{`UDtsz(s|XtyDvXjXLZt73sxVME%0! zD!RKNUJu7~YR9j%yWZ$uqUoL^&d^PmKtfZ^0Z~QLs;<)>0?_9v>wU@$h6U%Yy+=Go zyRnal@~@hEUD(6o~JECIbeRTU-Rz$MR*niLP!(DweVg7Jv2dxkYif#n-Gw?C{)`4r@V)=bkVEl^oq?YKc^9$ z%-kjmydbzES>crd=x+@u)p~ElAIqGKUxGTYSaaD^GXiU#UX+ro1w-Z7T^G2plF60C zNAw{?Es6ROft`8`(*@&tmjLjqAF2$F2i9D4YPNXhAupt+1 zx)vyw!0HAD_KMo=lSlcV`@tzR$3lo(9*ajichPRz6KzpM-+%5~l{N@xiB>r+XD)Bo zTAc!D=FxRCPUlC#fKJse3yp58qT3s+bW>*@xRyM!&Xxxaz~xKqMZpJG{<>8s=JS0~ z_Ey%Uu4~A~ip}O%JwHo3Q=o-;!z-@fx`FI;E_;-;mKINE+okMCdMCZc!;%%+oaOv# zhEN7lG+z>s?s1McJ7A!J+WhEfK}}I|Iqa%@HS1pG|I89%ZFTEq0lsaXK8RfL*aTab zEWd+5WCbriIs9yFjhasKZ#Bxz>RJ|DKhj!G@KQW4F6Ye}a6VnR5;b9?>l?P_#ZSYl zNFO-m!|k4}#2wYad&XMF(XRV&6X0uGt*5x+5ir^3yDJ}O_0c`q1Fd*WYxIIVCHKhu zr_0~@r5ci##-Mvoy<1nU6157f#-Fi9I{BW??wRV?={+w8tg@6$8Y}zv*TD@&$Sm&{ zb%+e`VTf3*SELjfo1d{4ErB~y!oq>bD5#zwo$0a-e7!r~*`v49UmJsX4a!c^Nmjfy z4Q@i$A;H#Urazs(T+tn$d- z{62EoYq)3#kJy-)fdsxqDR=|QkB_bp@1RsjvX$zD1Pu)Do zA_)EHSLpWFj_D8CVT&Ep?hCxXQzkCi9IE~ynBWukFb4JbeO^jRKEJ;HL+Y7#`j}1_ zI9TB%8C69DY5Zje(IFt{iuG;p?Czai!{&Qvr80jn-O>+(f-<$P{Zo?@6F^N>q_62Z zULcAJfP7ke zeWv`8o{bqY6eCrvD<&sf3jT)t5vd=sx>`#e4giRlV_}*qYqrUbx8ElY;S+DWEdYK+ zRs1R9Iok?G4?S+k6}?7z*h?7c;!o4X!YQQwl=T1S5iVpzxATXdnPq2p1GxdGzhvMV!hl;!!fxiL(MnTD2rPTf9Q{Lsp|AsuU=n*X442u7{CC~ zKUjH7&Gu$6NeqkMF@;-|HhJyV#|5u1Lj|0zmbB~A_nglQ%m6hPiXXyeHGTzccXbq0 zgh8^SM}bmWO43^3mRx;sDz&+}IPD&eInvrxl#&u^9kvwVAA)w@g=vGn&;F(VX`Wuw zo52W0&PsXte0IPJvVAimGQ*RtwcL`7aN8KC{t+*^3%dSWwjvM@Q1Q*-_pA2lc8qPOGbx*7eKK6SOeNZ$`PgoH& zT6e*-L`|tR$)2(0ApwEq%Co0;%cIR!^P{jTk%WX&cPw8$UvMZxz{7tAJ=R~MZu zhD~W=(KQFbp_LJ*78&;a8beMAX*r5^^_gTu-AR~e@xVZ_`XS%qjzgtdk*De=ia6@4 z@^5eNT-W#jq<+9!Q)drHk=dSpQ=I_%>OPvb)ph_EhTty8a>Ea}etnuBt};HfB<e$+YFXd&cg2@Z1)CHB=zZ9F-pH!{oLY&*Byd@Gvr{IK|WLxZA|aB^m%Ru z0=eOIhM;* zIAS>`!%fxZjhRkBC=CCoeSvi5*hrv-cq$kUC!Env(OI2Dij{%LHz7T--j+z_{wsZj1&}KcUME!ezm@Hr@aakLb-)nt12Wze%|iAJlPJu zw)qr7^?E?HwD@GzKes3<=!VhS?QI}}Qj+ocak*(Pt&^TeOKP8$6_{L}H(M3nbh?*q zZ@Er5bzEROAa3Gt%wK3X(C%UW1vnQDA@Ug%f@|25UA``G-9SJeM{}lvxkX{a;xIGGEcNB%`F`BQ1f7->H+1f=@NAf z65{$e-KUGfOOuq>jq2TNdcCRIg%7snkb4*h3)s+I)8MSbf^NACsG&(CqODFDC{RXH zQ*$9id)rcF2aPT$)5C>(-$~|Xp5Kc&e+z<^;R}E|T1;5~R%%BfyZYF<(pUuA+48PZ zfjt}aIR27kqkZ$f*m{1^G|YAWem-q1(#{5?Y}i@DVy)1nFGz-u`?SbhlP;ZQDem2x zZpk_nKT3z?T$@fEfDB0x$^01%vK>7F`fN4HN?hf9N-Xb?sgTD<>D2fE~7iHyOG60BNRT=SN;O@(9=NsF+D(oue%Do2e z;>_>^2is+;&m&AJ^oRQF!@=~)N_+6lAzmT-;%J9g<_(xq%_(O~dNjODYX8V(F*Eb& zmdpJ+)b5x@vw1&vSGUxXt^NGZaDTs&Qd7>Rg3l6h-^qivhw`bpuxdLq8-5AuxyPlL z#c#^n`XUR8Dr-_Rea$D5{_Bzv0&SMilP}1a6Qk%3vHp5UlXC1m_Ws^JKrdN9U&#&n z)0G%T{6kh1?O}|K^;Z$AF|(NCiX~vzSYD1N^8Iy$);Ir>|| zZKS0n`RN^`ghDzi@SA!1A8m$)KuX|-)tRv9`khuxZT6K?xC&g^)hwp zKBdWCp1#UdGP&Bl0592AVfFI$KRZ;=m}0O849I2c@X<>BckMYOjAX&9e?9SyBnG^hHmr5rRyXMiu8P{eJ|R>begPO?X~*Z6GgL;bxj(aC)GKMUgpV#QBn}m96x-Z=6nNd(OBb2i@RDsrcmtCA^?{}-*57(8~ z6C}{7b_1We!$vQ6*-#u|X8R?6q0c9>v6n@^Up>qjnecjrLAn8r%~ zu97CfZoJh*xt5@mul&a*1kx@i@`yRR!T_=U=SZ{XkpUZnI#*w`_lsl{F}}+%qOnwY z!F4^FoBK2_W?Gt=H76iz)WggYk9cOf%c1goL(U_^Z%DG)QX9i;2=Xl?dg_aVdd;t& zOZ!>7F0$5!17oKzo3SRYkEWQC$)kEAz7W_bB=dn$&afSKl*=xbTg4`92r`_7jt)Gf zeGA`zEMiw=r%6t~d2!#wuh*Cz!!}s14z`H!nf-Q1sWk=3DL;1Gt1q8nVV<6{k9gI% zv%gW}3)SVKvsxLec=DbaMyo!G6GtYO_tSG}BDvgIQzA)RQOY!&B1UlH2gx4)#3bWW znQb}+aFQbQ_jd0QSLzi_gC%G6w?k5$6d#`={^RoqNkH2qZC-=tUj&8gzEwfaBiSPCm;Pt+L^*jcA zdcO^%b09y-bI*|3&Ox2pU+vGNBHdJsYWxXXA7q{;z^}(S77LkU3(v+D{t{eAMtMz#fVlD#aT-mqAmOmc*=t`9IQKwCp74Q0-PTa>#*V%p&B7 zdOZ(Q@fHLf@i--vNu5zn>2L`1g?5j#@k0uqq{&<@k?2lMh3T^T(-NnLW~hI_S(#jq z{Q%czrG>&EiC3#RL8RndRHeHJwHGDZ@1(@cBJ(;nzgSlpD5lVz zEZ^m)OqHsb6>gyZi!wmt{(1?p>KKG#KTKBp5JxG%#X50Pu6tM`Y{=Da>2dgtGm#m! zyd`eR5pBSZf0mv(c#TM7v98wlOb(l+{inL5N|miXY!G<+H;=`p+fO|FNDzSuZT6_N z?Fq$hcCeN!!xb&g`bqw=iajTisx?iNX#EYgGHzzd$|MM9hR1WD!~@d1Qy55tj#hD# z-b=6iJ+bTs&@F6{85!JR4hoaXk*=yV>9DN7B6PY+jx?39hyD)FZE$8K68PwSc>bBCfc=c+IUD(==ueC7uH~Cf*!=u#H*A?60}RrZ!UO2q5J=11lbjqv{q$qhKf}#_ zbWIp?o76JU-0rZ-whu7djkU?kPp*Q|IJGWLRn+RPS(Z4ovlp3$g&T0O|12>VWNKWZ z#gsRPJKO$VIhNb+fRSyy!ER!u{ztLwl9xVB&px50IW6UGu~DPI4FHNGH4T!mSsg%2 z24_INl9^II<0Nb2&1=Lut(eVq(`c0T3x?*K{n-3KJ$tPf84lgDEr!f;XSi8f zVZ!swDVN|f_S(7nF7NgO&Zwl`A#p+fa_GQ^sw5sbYJtbq0?u*|II=PkMyP=~g_2C# zcfBx>3b4N}M}2{8=C#dHBdPos2_9>tZk<+)KBe?7S!^=w@ysDT(2r z?&FO_nGq2 z+$Q>iv|sFrH@Ysn?(c^Y33dPZTLhpp{72Xfl0Zc2zkR9@{@bTYzwf{F%KqPf-HX|| zq?j@+Hv&-cABDKK=8EuB_B^c!hQr(-abbB|t>l(HRLOE9&L4pDmmE00aTD0eHu@{toboyK^!ahfxPE5^;J9t1S zqwK0Bu`KmtD$=?G4e1dHhw-D5c11ThlgJZ4Z9V{f|uF zWaJ`!F}a|m8#bpVuw|Z2USs|H`}dzWH_W6;3Dx$8`n0KhXv)gAhL>{xx&K9glN50+ zHg+|KgzVR+dq-y{huvM^t1Bzrpg$9h~gN(_Xo0i?d$Ak&_jnKYP0yVi?kB|+m0V~x@X|2!G2@dPdt=ZtmM~Z2f1>@wndzhSL z+=U;CkF@Fa)^g200Yf#BiT8OWx*8PcWTh^(ZFg2`kni1!Ye;3y)d~7>Ub>L_yeHva zt5yKpb(BIM50Qj%gOcR{t)&{BmLOTlo>yY zl1xK{9A$fPF*!}P?{-Y%zbtqiBI~Z);>3^IoMOtXfovhiAl$y%m-YU?P z>b7Ibx;X~gc2$_XxQvXChzC_BgD&1<55TWIU+*ipHK=)sxk?>x5eJ@&yrWM6~bZi~?t7B|QcrDGyo zsvet77VA0#zq9)qrLtFq8}xteM=Uxd(X{V3-%~D_TwDmuiuK(+&soOXdO#M5!XQdR zw-$Gx*{WtQFhV>kF?hWmuWI%FY5U?Tso~cV#mXt;=FL4JXkmfn)s4O%b`z@0R&JFE zLn@0+{}tHngo7AMZ+CrTSE;fft6>4n1F9#(oSVkqvb1#YwNKV9U$Ut(e6E4^^W@IN z@u6CuRhJC>SJ7bLHsYPj(8M$fuQWf>SDj{$%$R#rX1a*E7V~Y`|2uB z08N(+Vl<#SI(eu%L};rJr*?K;yfRf>J`|StD>%3~3?Kf~JikV8cGKwwabBPFb03E; z$(E1-10ln;Q0l0VUlYemaw0x9OLXTi$NKsyF4r2PSs7A0I|d|qf$B{cK-Ba$1fQBt}cIvA`^fikodbU{h%(rkh~tqr#o9<-f_!^lef1wZj#aD{yE=!WXboc zc;3R8)N8W%Y^N*Q_s!80m;?t&6->}gVvbqihbs?PT8I8d%3 zX&FMEwoI)7_lsr^j)WYA3KzSg0yH+1jGk2Lk*nHHmCd*sPw*$g1!ufgwt4w=Jw~t7 z(Xx`UTyLNQHc$<~avf&p0e8LCplv)-mVZ8hby9ks_kCT2f9dxKj*Y$Pv9)>nvT1Z- z?Zt3u(H(QO*Q+BA`U zO_kv65im7r{|o+tdheZds~PN%9hEWNN0jhETvPq|iuM_{$58hxHMi?gsnLk3Iuqz+ z*m|T;Qn@Qq+r@fSg~iTble?RkO-{8AC>1Sr;rBBdOYR8)C7|BgkuowEI6Z`P+L3d0 z;~jkL%HxXbs{$1F0PqwZ`WXYV|Da-dES4x(_Xu-Ns$rqMK2zMHGKUif9JXRVF-pHe zgDZY!GixsA4)^4Rk#d$Fwyh(3*Kbzmw>{}u-%Z!|YkAggs2XK}Ad zx2inzUt#{7`L$%e%s6bR8$iaoMXT0}qG)fn@`M;1@mQAn;V9KY!wf;VAc6p0(H7VI z8$5DZJI}eRZw_0bG^y5J(+?+|b$S7*Cj$IHnX-xd{j(#)ANgYag%rzFunV{L2T$$X zYKLfbNn%9P5)p~v$NNsDPqi*TySr7K+i$>Rc^*G=!8&bhOt=>X`BsTgW0S@>4i1fj zPF+w?9wMRI%?<}DxwX2U?tT-3O1|7&rtM{u6Ezt8U09v;L}bOzv0ap=)Dw!>EZ)N9 zA=U)GU7}+9SSDqDhiizBU{LittAZWA+~_%ncdGVkB1-3Ypk?9VV-tP#aP!lgMswZZ z@8)_q4M`GdWig8E0c9#Q1ugmSEuiLa#42TKV<+Mm4_L6ZjSX-#r2)l8>R@T+#c-St zE4(e>h{TtSW{W7)}R(|XfKH!?qB_M02lBD*{*#Ix+G^9* z_PNC;e@1G3zE*PsW@>T};n_IzJ}$ZWDE%D;H4GS~S}G(L z9}tH>tP$_m{D~32!t{QhX1>|{>T-9+CuUv}ZKg=NnYC|O0W~qb7@5wKb+v-cI5mCY z=JYFj?Wf3LlVxr-Z*Dcr6%_Zz^;VM{vl;2Ga5D_VXR-( z)4BGGw<}fpyz#&qjw~9@(%>jwyjr@}wBp@nWaEPEY2>!lZ3?MSgb>ohrPgfMZf0ZI z5zb3vN1T z6Q<&h4}G#0M+D_Z@K;}WvwkC2P%Fpy@hd7-rs}GcvJ-4iTD48qCqxY7DWJ}AZDGYyl*2?Un!q{t_$vv29=f*gdGg&PwFM02+{wNzk(S&CWIQ}b>z7?y zeWoj&!M<(6Wtmz65)u?fB!?+>d~a*CTNJfTPkTUhW}nZCPnW7vd2J=wEiM;FQ7Q^k zwISHcL)G6gf4d>DcGN`)^&3%3SQzy-z>?CoCJ7sH5Wo5_9ByM|TTf15=9wDnef}4d$0hZil2M*WFPMQBc99K1xjSz>AexL$i)3n%-y%EvhJtCRk;rlOJg?J~ zG|?JV^i`c&i!0l2hFM}bY%(6fZ`0a69z)Z96+*39mleZ5m}4P!c$ZB}Mm>rD{Cmhv z?q!C1$e)>X+dmPw)F3P_kC05O-IdcT`uMsn`yp#BL5^Ke+8S-5?fS82NL$v}m{S>v za?F8M^;^jFEE0a{lR`zy7Nd$zv!D8GU{Q{9i-FnBzMx}QbgF`oIO&Gt#M-`sn&u~V z$8SO*5B^}%{uJRV4znfdJAIr7VFx=qg;`$M{ybobgru@EpmEIg&qLHj_-u_SE1yB% zJ8({{9a6cyIGf2hvB^xWpySjP#6!U!JPsn&cTmv$mIWoFg}o;)G4y)soWF>V)8eDx z!|URo#bqE+-&Sb$3JvN>*pLY@jaofq+io%R-)wkDy8Yjn77WHyS|cVjERd&7Prj+ zF^p7_jmlWyxbPVpLYc^8Etk_gCE-@h|-0|Wmr#-3iaP$Bot&G zA^Y7ALXG5kIM7BVblpCcCXfA+W@ipbVPq(E$Q-) z&d`j%D=>ZnAFvzBeq(xw?D}oQoA0%n zct{SL4cnML1Al5&EZOIiFxvzZA0jt%>8tYMG z=g1r?-L#2nY;2N*S!{R3t%lf+tjS#hwM=BMHjcpRDRYBM&Gv0FJL5)Pky^0fPhUAd zQyXX;9uR6a5qfMg%!7j3(&V`_8G#`sd+6X6UxDzJ|8N1y0Dd%%H;?4Fg;SGjf{f$8BjZ*&gK@_iX@zu~_j5q-!$aEY$DMoP2rUqRVlHiNiB=m)&uINp5;#WHivP^ziD z9vZ&OQA2on1$A@*XSf2QXXECX;JaVpGy9h*(QWSeGdI-RIlfvjyOAZSyAIVjkKzpx7FEQ6$rr?&CZ> zs%D7Cshca?-}UmB%3=b|CJWECCQ6Tx`h=$C->1tJX_blXd1`d$Qi7b= z7G1FY$BDtf@2*nkahPrGj6W<_Hw{&MnwX3!-lat%r@+kd_D=7B^RbzOeQdGT6nDRc z7PnV-DM4H*A#&jOa^u=9MNS@Yqzr62E17+G25svwgBG7Q+zNo=#vM<0aZ^^FG3C<& zh1xEVDPX=ftW_(jO#f9FgAq?DHkn(8ZPq)2E9$1s0LEF&XP*GVmb~ad8gs%koFh13 zYI-O#o-LNeDJBOrQBdYEsThe3xtZKP&%HF|8GXgw({cM2PB{&dsC$ij_w1nVb!!gz zorNjx$k;Zq>iCn0hUegSeDN4Xq5BfMf)kufRWcw?^f1(eB3ns1h(}E0BfI6xPSK3< z;3+JXCNF^*1LHhtvddtw#|{a8U~RRlrpWWbS1+w-528?~Ogm$oaE^GrT|E$C-7W#9 z$Z>?eL@;OAqD9sRAJk8!vRk00#;TY{VgGLEh^@+!mT1bvNoT8StoTM|f=Q(^LNvhT zNgc+o;tg9J^m@XrDJn`GjWVw-Zqy=dqVv=5D-#8uL3^y+F+XehdRNvGX;0QAwR*E3 zg|L~>(=oeek#7)yHO_2Ts${Gm$I|3IC+~)1JB6Dd{K~ABLdJRe(2zdQoe)DCg@wl- znQbr@^tsr=l&H)oF8%ig=122bqm<@z8e79>t}v9)vQEH`0D_Lr_fxA%l2#rGp}>mG zD~!ORpR*dhcbv)n7L|q)75jBp!OvV67s&KJ0Oa9tg#)t#A-dGwnHBO|7SW>8@50Y~VN5@eSA3hD=DrX+ZVE)K^0aarY+{W9rU;D=E0*MGo{y73Xty zAwkuM8j|@Ma{)?FFCOwm6sfeBXo$oFrA*yxy*s>9069%g)vvVFX$kRZfZ=NFKlnyp z${ZiN7^9hjg4#vWqfuQ^m;iSyKB{a?EbEo8w9C5Jy)piq%6rFUq)o ziDhdz-HC!*?OB>Fl^MBnr!6VSD?axYksPp-7p=+Myn=o8iI{7*xp=xml~7&n+Eo;- z3fTaa-v9JCgkoZR1emn>5|HQ-%oXujkHRtIXoRjInc<*bD$F7Y^d@*i+B&uAogs8K(SbTKt` z#l4q>e&x|QU;IV?8bxX|EFD!Y!{IJ~NB?As5m0-xBoPM9v~GkuKUCQgfMvWJA5UuG z^e=24a$j-pm;zR1iKVP;w_1%y48pw_h#c)q&=+z@(VUR48A5}xgN)q%+WY4@iN3vd zt%ryn532VcwD(o2z~ztTy8tAE{(l*D2t+IhpYORJHHn;B6@s)^&4jn{{XsMPJk~w* ztdk~fCwmRu&7u4^>EC>PH$xq0&#>|aYoPwj?Lw|M*kOHjV@B%gCTWLL9OZlSjntJA zqVhVL6TL*Eb2AJ^d-$k|<^J@AKn4UF+I(Q{3pb^tWHq%#T{!ce=FC5PT+&JyoCHV| zNtLumw4nc%A3_0BFD|Y+UmH1`BJPIur(y8tU*fdZGDgIR{=Wa;LdE|dVD2}uy!`UW z34EgBe+v}&ATE-V4<8WMUBkwQeQq#7iW0HYydPI5{fh#_@AE4v>xcFgfen9rqXN1l zcZ&h$ze-{NH!TUvF>A_;nG~5BRhCEo?=vDFXDZC{YR(a&QysNjloTrec3a5whbW-w zZ>H4I|FV7gKY-o;<8Gz|{7q{F{9j|^h@|~raw42T{x%3LF+lvXg8b(;yAV?7ByHG- zZJK-mIn<@l=Vd!N{cg# z@M?r~az`EOFW#A=3BClz(NoYu7Jow$fCRbn!0$7S8P7zg`JeUV{lTSzj3Nv&Z`TB$ zsfVmAIIW}!?7_9W$NVBaFJE0<#stj!RRje^8@2rzs>EI5H2Qd}mYl!*TR0qL)n+zKXKa}e%y9nVTGbBs)*6St2n{@t-roHN~hC8aNdTU zH3>AWU}NEKao*mh142n!P+8N`VrM@3Ts04sG?=!CZX&dVoPARpa~Wc&h@5EMBIEr_ zYwj<0h9!$-jG3BLxvXeaoR$MT+QW~Ol(|j#IJ-FBlN6KzPd_fmU?jqzE=`Bsvgn{n_TY~!elOd^ zX{bmvjQ>>3_5cWv9qOs^D=RYxB6z!fCFs-1f>vIn?lV;k@_An`BP!W$VUKc<2i_P* zsRngwgq7r2Ks7i;h22BT@XO<`D2l3rF+x*O$Vg7Du0ct)bMzL_RE zq^Rz7uOkt(|B6^a9?Oe>qGV`U=K2a~Lsm_QsVFA;U#xxedt_19Wyc+NY;9E3% zZM$Pz9d}Z(ZQHhOqhi~WnQz{A{(*U(`%|4=_v}-3pL@>UYwfiyiQO18U`Xw+`|@*h zEKnK+?sPJXX}2eRKeRym0VY`=yVNJYZ(PsnwBQzUEMd}j5{YEzO0*sYy*^&G)UOY= zt`^G1>_g;r#Z=_$2{T{3f^%&0PL5Q0W8Pkq+<9(Q2|FLGP5m~DQhCe&&Qy=abJN*nB7anz{sq6WgxNxEEuiXLqWjVD5%+tN&P42+0AXO-gT zL1lxz?ORKRlacN z+eECVW73WFC!(x_a9Aj=!mx;d!jij7@AOw)%R=kt&=xBVq}NRMfFjO?*{ZU9<9$|> z6DLf))@15ni$9f#vOj~K;EPUpK>83nobCOBLhki^yD)zJ>qvVAuqzDhDTv`A}SrlFJYimmS)OzIrv_*bSoIQKiA&@ zre-hI<+okYKJw`>m)&B>K)7rgBpr45Z|Gkv@JvT|S08KUIf_H1V9|+gF8UYVpPTm(ap13$dS$)nRJ7KCv#&By&T-M;7a&eaHgiHhS+2dTmA&CF;vY^@=@A z2)JpfPrX>5!S0TSR|$-ttl>PhnhAoGV)lRU8y)X{lfKMr7<&TGysuFeLqB$ zsVMwEerPmCBYnN2Ox?O`6qFJFgj#hgBZxrY(`gAWp=H287LUb2xLrBr6FFAq@S9HBax?hHE}O_!cxi5435~rkR@4W! z#@^R)(uqy1uL#Use>K}2yKieLu^{(!$oEZ_PD_Fl9e=Ff1;a^1qGymz7NHNmGRh)q zhREi+Qy&}J)5>zW+6Jc5^Cgb^;*a$F9RS$ua(}=T&1$)13?=fDtJ#x0MFJ>C7%%@`Z{)e`CU<-w*o+H>+&e>LB-Qmey5c`DG=@Qbd1#(QMi3xM^ zxgnh6%TCdxRwCcGnHH}_?T&4O7(e4*Z8N^V^FD*NyrPMGUSH|-JQz7;Bzx=!b%nk* zuCe;&$4#QEUFp;122W&1&^QQ`X4_p`&g?WxgS`n}`MfOnN2x)0;#P1sZELN!@-$IN zdz*BjjA^+x1}lqKQraxwtyF_9Q$_T#(*|LG!uTUH%or84yvS+(M=F`K4#9T=ljGc$ z!q|+(=%S#!J^u%Nh2Jk)h^o>&DhhsCnB|tD=m+7Xw^|MD#`4IX)D3Iy>2P1BAj+;( zZg>U*`ve%V1tx^|`kD+%sVYnC5PzSyepPfnYP9G5q>q#WcLAOz!AaluZ4{sTH@3p9 zh7fxJ49D_Cfv=E<>JJ?reMJD?=g#SRxzPLVJT? zTdCKbB;%{Ab&;Se1#5&&G@%X2ML<_a6c}sN$+NUNiwPffh-~pIF&@WxK@RON-2*2~ zMy>uJC!=Bv<9cN6cE*-U>F}vg6RmzA;BIdT_$Swyk(Ja)dCZMQWsceDJsyV#LwVrm zbbX*~Tg=SN-p~WaZ+=haG1DZVsf77zR|2AE%#2;30>2fCqx3u9tvDk8440OkPvU+Y zxwb$BeihHWhz#@Va>qN9cccI6mMlgGyy3WPV*=C> zYJTEMMU~cDTX2h=bs*wQ-)hBqdxLi`T2D6)!cN^0Qv;JG=WqHhUl{5iz0qD@5NjMF zzOES;OS z+m*hLbc0q}a=v~J(PWu&Cv0X&IW{`v!w#ECo4BtJ17KU~E}^G#3icNXeyR{|;tb+# zPJDVD5Iyfsx%`_~_HYpxO%k|8%&deJ&QBToe690(_w^MnD%ss~75scSn7W=tfuFd( zJ(KSm%+PC3QnPx0;!Q0%KQ8KOiESnIxjU0VZIHiy)N4tjj2Y~4J54e$M@>NUMRbm- znaB}z#JcgfGG!IGp=pc0+spnF9m#y6ta4BzD9}Sh_)bbK!1(b2cF}Pu!PZotdz#1L z^dQT{RSDY*nw@Fyywq#5fZiF0jkFJisg~lw*8>k2y}AWA=#B8lbS=bi~UT z^uxC$BsBMrg8=yBQ;@}oE(iZB-pA|AIiyXJ+odky%ST?hAkW|Pt%*LtPika-*MHeI zGxe`fou7h&W>!}JME9{{K8}87u5%0d*yF-vx(9`3u8Lqosel@>d?^}jSSw1yx#x;< zN>2X3Z%^+>Q^74@V9+JAI~IE$C6_D<2IposBL&(>m>&WDB?9}lV<+DBCAv(q1bc<% zPS+p%hF0dx{$*9{Tpm*_uSnXQ5+~ZuEUgN8zY<6DdaZ|tBw8O7Y`sSl@!uhYdca_t zSMDG`eg2Sh_K{+X)EGPSD;+-L~PTL1jk<=%nVcVV_cM7Yh1Y&V$22HRw_ z8@lyM&Pa5X$7Ar;!AvJ1w$Q=!CrI!E1m@FFl9}C=5yBuC9hcu!5Su3vQ*HJRd^`M7 z_ByHgp1L|f8}k`QB%NhqTuoXw{T+ zt50%UC{JXY&2!J^R~in7Iho1sG8NdwWU3fcYN`KFef-#!t(q|ubI}%qN2^8k-YxO8 z1w(YWEJ2~vWlO+_8}YpH=sOHU5#m<-I5gkz^c!qJlAM$@ZJrG|Y!UHoXK6~&>;3a) z?z1HWE=zsl>{;qHe76Cs#L2%wb78=Mc1cr=SPDtK_z{Scw2Fwkv5F`wc4X2*F^ro zGV={XSLy&T;`#*{)wLsjLZ{E{!xC239qi-%8rNfFw{b!3di~MGvAiPbq+Vnm@0qT} z8digU3JsQGn7(-XM2o>l8*aNk*WEk6;Q1=q;H0T@{Io|=;N!XLpig>Ggf66n3SIAB zjgHBQjZ?}ZJ9=xudHVD!ng(7joiS6nRbz&I?Y;1vlqJd?PRKL&bFb!)3D7 zSB>Q5I;kPf`p8w*8zM`gm~qD{V8`Sn417z@Gs+3%j)$|0D`IN$$gP!o%N#f*C3ITV ze)IA1%=U;ba+QHm;>Q76PiLseggSXY8Gj8`JC3}#3???M8BcIayTrq8)*8JziW5{_x`x|0xbgYJ#tg- z8JEe>0@-Zb10g=pD?i$%u1kX9PQOIDb|Ow!94FYMEIDe~wR?4Z-vI*c#993KIiRTh zX*UU#p+jlmr4Dp?y$J~hyZz6P@-%6?=0Ie6n%wt$nC0g+TZ9;_R@WLIJKE>D3;l@% z41Cs@FV+wA3GXRvhl8Kw1H#A0rC?8Qq(}S%hc1_8)YIDTlY6z>CcY*w?=jy!pCrI! zr57r{AYVUv;dYxo(l%LnKF2-+&Kz!=?EBpSjvika^}#oj@eB=_$s9sx68m2}TqC=d zH#gtV+i}dW^i*`>dVG2z1VB?6!YRl?wNu)fm&%&Y&^_F9LC+e8wi7NSInK3%^H8a!rt=NA^Ho1;9q@x7hwY*jlQ zqgHlZr0&4NigP2iF)$E@Qz|o6FlC61RT+$)9mkuveRo-HE)|xt#D&W~rfG#vOp^jE z$bb?$x-;|c_bF1DSi)2E_@hUut)BlhWl?en^l-X%_2jY>?eAH!{0_AW!XG0+$M2@f z7|cJp79si@kA7!Nw5I0~N6G1$onP?d6hTOnI|Lr^Eq(`g@HQv=cyQXt$lwjaCs&Mh z3{-QGI<(6e&7M0)k^xzk01REo+|hmm#e_$b;Q z99G~@B&GNqU8|GpNl(BkQpMiR&?CxSey%tVj9xR*L-! z{oA>-i5nu6+Wo({)Tl}eb+bvuQY!2cYHUACx2tFL`uUtw5@m05SWb3;+ce2U(nS8K z_BWa_Y3jvCChTY+VfZ#JbxtuE^0$ey%(`B^h4v=|2(cNab_;V$INcbRcI+QfMzkE> z5}en4o*X~~m=XFk;SiKU_H1CRqND}1pMQ?~@6Dayv;!_<6XROz9q>%u$CI!TH_V9) z>6K=CBXh;^Sey=~52Lgw^;MI?Tg(hXt-mi1)G_N;F@k2N@_b6** z23o4?7N!|y-X(#Jw7 zDjYVOy^KE3R=KfEi6)tJneY(a-fvTn7X|}21;%D(MyYvgnjH0Hk~EG<6+4O4Ekkxe zXnPvk_-03aAcU#u!&C|>UGiJdr2f(-mK$|CvG0sTa;7Cv22}GF=sR>%mgaT_v$dC! zlx6Y}5X16D5Rhw;Utkh@cCxQ-MC<4%^_u|b59)Y3Hp82-dqMyFv!?ALct=lY)A$GD zD^eN)pvqFzXit*<)(nDvg*8V>ZL&38%Os?!N|OVq!nI3uaRvP_tmop$SDP|$Il$Ca z|0JvMVFU_P|5d~QXV`A-hlXK3=gQF0ae7r5y>XNTNJ}^)P*k+W#xPWL2L|pP<(HUE zQ8D%ho33#zBw&nZ2t>*9x-c8vkeSM+z%ey0$`W)65Fy+#AJK>a)mk&!@9MBDWWHKw zdLOvN-*@e14p}nE!b^-9PTu?W1(fl)o%nz08!E{=9>>Xp(U2Ji<^7CvIpH2!Xo(K& zn@$!Uf?BZugPjUk7#MKw*x$$L2X3&{BUIC^6;^Zr1$fia5r~eDkIC9R%`I$5HR2_h z%rhMmy|B!h+up9NBp>%3d@A8Pm7OHW?G~j39LKb4`8hCkXWM;nyr?-b9B|twf8ch(S3P$(!vx5XfXHPn4G^{r=`j_my&DvP8S$GW`o$O?qD3@{SH= zC5~lFx$a@SnL&QzXKnl{$N2mpa;qrMz(VS&o!XFemgBgHA_9F{zoB-03}Th&FvT`@ zP^`}9XhKoqkT7ji;xk{AU;n^RVpVP9ds2kmnC?WQ6;xZIpQc1eBCmCO_I z{h~9%{d_v_GPRGzGK-`)JmEqT6BAo^9|{c{-0h>U64A!OA2OZIKglV4V6JYA%7{ck z3I?b%AZ=?>M3-fs!c}IF;fMc_Md;v^V-cr9CrOk6PZ>|)OuNSO9hvNb6Xe`(smbA}Cp`Qlb>8L)4cRIGcbl&uzedu{jJrv^@l&%;uWqL2gDcruQCt}ru^Cd+ zM)hAh=SZFDh)04U`)T$ls5;Xe8k)J%GJyQ6@7ac#8^MtG(dXqw=H|3#6=V;zYAj>~ zRZX~9ZmaQ-OT4;**WPJ;+WI~SbV=50gSSXH);UZ!44LoP*!O095)?n(Lg*WISP z;Mxb{w}1>1(b@d`XFg=zZ=RE9`mQc6KD>3Tm20+cWjW%J1LhP=b$@nmy~> zb+IPTXiz{@5l(&CxoVAyr8F(F6)7)OFcT9oGVTQU&;W%2!04Ym~ zfdLCQIwa$W;O6*W6e^Jg#Z+LdrD&0>RGDnC*L$N>lOq(Y?3w-J=%^bd`$_x%^qYt? zCW@?k(lopKYYO(sx&G11DLOa~kBm~V@@9o=+GmA&Yi;EDA7;h8jw`{-g__^LYay}kQm4uQ0z&)C z9TElWBTHJsmMiSh6AyO>M3vYPB0~4mNu(Uns-<=lAa+2kA!aW0lT$-`E*t+0qTw zv~3|(Ycdmb)&jDK{5z7-FORf@fZph;<9jn0b;A#cyNA|0(i-=z!h< zC*_51!-i-l4ZUj2XzPQsud1q2Lv;q-E>!GJW^Y0}QB)D5?!MUXgh{8ZbG&WQC?O#p z3dTMc>8Zt~A=dnDi{{Co)x5LKmb40@OtRM=yQ`=H6LmyHhU87$kV(!yD@^9vhvk6- zg(U>^u>!=OA}TXev}i}TC+b|G2Uo9ItJ5dq-4K32 zJwl0y&%AJXzhHYd+3fZ8L99PFe2!pIlIu&dK)_@j5M^#kZIW*76JZ+1 z<+T{65qseR;zZdnMdqB>+;haw|`LVhtIh{0X?ezU1t5J|z|b(z(<# zvoeFErV@(dpH05jQeAuSyt>0XIuR9SV|Z0o(Xs3E_V&u~bnY>?=GyOR`FSZ6#WXJ~ z2b$xK@|lcujGz`47*eHOY!RsMBkf0F_X8%o0kS7hbDSF|uD_v#e+Zm2G&54M)Xq#@ zZ=|^!Nf6Dc3XX=~h$83=)elo~5T)Q)^wWx5N~VOk^t^vq6L=e}3H=EAsb-gj+yG?g zv}N#>O;NL;HL%pKPK#J|#cG0Th;8&yWM?QmGmKp9ocXH zRFqJ;r#%z#(^_PG1{{lm`#`^;APfi_I*<^yv3bP>Ywd_X%J{HATaw8TTW(*u*=rr- zID6PC*g}4}TV*RgwO`;w((?mFXYk;DTbav_UMfLSMx=4IMz4_b%fiamdMf|Q;-32~ zN|{^AL}9af|(HG}~i0QRq@#Vg-~TxO%$>BU0$2jmWGf52FhpBl8t($vK0cS%fM z!ZfsT_)muK0mSS0S(W;;Y%>kC$bsm#8CvgT<7{`d$VETC-1yM9{dn*0pJtC7V~3W3 z(4o8i>4mg$;*xyze18l_5xf>XGL4`p*Y>VzCiZ3DJRmdIZ_q?KR%^Zv*GuGQk*ba^ zrtR2EPZ|K&X$8auEm&eCBoluR_=C2UfDXCiV5}h?OJ=_T+Z5!+tJC~b6pG@@A-`s# z@4XeomApHuC_VXK*8g)cS&}59fBE!3m$)n>@c#}FfA1|0(^vez1CYYl>?ksD{~gPt z2mt)&OOOWh;vJLuWB^G{Qp*2Y^cG9T1(9u}em_qQ1OUJ{reTBnl0)oSZ^`~MHL*5? zMk1_4UK3e%JLv1Tl10}Tw5{71fBUb&_dIVc}+_Kl2C>-nsvV>!^* zy(zlqZ%8y`54N73_ORa6l+nE}!H%T2pj-^%3Zzq@Stpl&$;u{Pt=)fJTpO{$k{SH9 zamKw%Swa_j^K?3%$WBlSfm0i_A4<2T&0Z8K#456 z>FH;wzby;)Or>X577;Z6y+rYevywnf&?*0Y_S~FXaw#F!0ovGKwaSm<-<}whys~hk zqmuPHmz}|&{$?E9=_a1R9zu543MU(RWh0orlsqdr&!SEbijpdu>@3v~Y z&v|lpUZRWJLZPu}C%u0An8eidG*aI~9Uhb1)nfv?vp*CsNb)6*Q7==KQ#SoZj4&mr0Bz#~Ik^#>$e+J?&ln74dX@ zaYkNjNri+QMos->on2W~Tk(`}EbrW@>^UgPI!F%=7D!M3+(*DA6Qo1f32%r}_-??wE zD~SH67FXviX+Bj@ouD5C__gwpW+1z@oUms6N?!O-nesYr5^2v z>6+vOnPnvT0S?1t`QFEDL~mGz!(9!ojhVbZHe{y4@SI)hw{bYS+B4?`8H{8U-`Kq= zXE%gAm*q5Fc;xJ5;j*A>bW5WNOdg{jm$x#8ODQ`id)p%}dm->WTik=$-u89K_s;w z5!x5c1AqG&CTpa~JW?{<_(h%OKhuNAM%2$;to=%LkKgp96FB+7uHo@_ z3OG6Eeta|wDU#wwA?h7s*3zn8ndzzj`Y-_pVB=adj=-t5LHMb&@zhSt8$psV3~tniXmu-aM zN7^e5iXqn9jjwTkDtc@ zwbNTO<87~q6dNgH*lO{8Yp2id3&da|hA%;0naTP+6oJ+Xe%~+cN z32;O|TD`cr&*3njIl`%t0=_mPL$H8`a_^Dj)Mbu9q> zxUfO~Cpl-5Oib3vsvI~oFqfBTzvdWc`3#9fcF65{NnyVS^Vb6csKU*UyM;mjAH?aV z>1{0LUwQEhE?L)EV|+|(u7>DC&IMFf4bVC1HJ#x5{fc^Wt)gpwSa>LriH|`q)awF_T-`-Q;GJgRoy#+9u(Jd0<=*w^uU}DL zxNcSOzk&Vn5(ZP>;|Lk&`nsKo2K=+xYW<%bhA1%%_z@6CRU0F#_q-O1`2FOVH8&As zk~aL^cy^cBlT`-xgRJ&F9dra(@_n6A*2_NOy0R41Wq;e$s=9UV39Xv&3$#=u$A?Y6 zxaIMlt1BNM4;Ph3RFR)K&0hi+7i4Rz6Puh()8~Nf<8D}OG};!|5p)Khx@E(f*+y3g z!OL~w<|Z_9GoHsPO-cW@sPn3eevcuzi?5c_M{HJG+_IDDyd}d|KTdgiS~)o!XsmmV zCk?J|sHrgFYe|eCRv+6(c+I}JD;+^Hn#;Ae{9k&~Gw4|E7zuP#vnvlbZRsVfZpTA{ zAfaP)LN{X$EDj}S9=Qws^TKy03)S^#8BAYyZi|h3{PMUIucU;RsLSb8N6s=DMT-}6 z2+!BqWZxpJqFj5!N6k!b>>NkppmfE_Jmd}8Xx>;r!kEOvZ|%5jlUaV4&9QJRQ zgYeODDCpCt8e5yVG}oq{s9}v|H7ALtqzirerrh&12mXcJEc-wCy6HGF$M! zFle>ixE)oZ;<|Q9t91R+^Q7fBg+ul-L8*DibKC2~WlIX|-)(#9ZFhUPc=-ps|B`+d zBzVWAHc8-X_264L<(N%kPYVXJd~YD!KWMU|ZZpGSt=qWE^ons-(N$gN1X`VTp#(_} z^m^an=@uRy>^MtpNA6kEQ?2onE%V={yM+==*sp&cNTj43H_OmKBPGSu&%5o06**{v zwQU|15J}pujg`Ulj;HGZDkXA0?~oc7@MKa1ljuDE8sX^~Y`_YlLK}g$hTgzoFg1Ru zo(U1HZFz*gG^g;fbp4C&J9WQ(r+Etxnn;=QMqZDaeF78I@(tH*2+r(*rWn^7ISC)f z3dUPn;eRZrw+!*jjj>UuxWyrZo*!iY%71Zq90Y!Q<16Wno0YdBw`7MisEb-FN` zIOQ!tw!~hh?r?-ED+C$9J74uYoKulYC#!7>BWD?$u8NS+>rOOJ|6C-r>*mJJZekjU?L*SOHZ9iXAYvob zK1lKwfs0HD1-y5heX%Q=z;r@Sp4uuh;$?>S%5LGC+qwfcn3%|5Lvf7{Ux%I+X0T1% z18}^wehGUU_-}t`RW_2`PYPgGZa1~? z6Q$g)HeZ|VT9e-Gx`x91zkNLPwYTgL_dM0m>2d|5^E_WwJaR9ahh|WQOVMDvOq{&Gx#usl8@pzs>*YgpQSy|3*YjW`YJhCLc zFVdcyi%|_40m4d=unsh7a=@R!WhtOP@j3*HmIKP`n13i0A&P9M^PK|21?Mp>2i`Mw zcKfR%!DBHP?xX|qJ?WEqs4&g>8Z*t72z%1>q|(X9b6l5d+7^a%$}SIk+*|5x^rkX} zD3ppYfywEk``nJn{0;x4qdQkeD$j}j401%js#O^de8EF&=+LQ1b!JNn9wsoyus$w! zZlN0z4>cBtKYw*9ud4!+Ee&r$OjeuVs+&4OQ!@l!%7Sh)_y!QxzK>Ljo9Kh?-I!T^ zZCx3uAuiDGKF|;b2whqJnS?^UXh{ggkR&vNl1*X4zPHp5M8)J>Z%Lhnq-Q)c0b#=O z_dgfQdHvXZ!QnyiXgr-^pPG(A&Ef8JEmmL&2gmC5y3w{PQaW_OqispG9y4w)NEK!i zog7D1217kG0m*l4mpcthTYJ-C6f)T-dFS{9+qH)(KPpwUeaIsyu-iZKd=DiUJNm8{ zedcc)kuz7v8GTwp#OFfg6&cr#5-{+3I#r|b1$z9?t8UUb<>R=^;(kHRcWSy2Z~^3v zk0Np&=FS8)C;Z?tUUd(G3C_{gHYaAq;8T**{tnDDk;8N3WxQKu9aaEw3&^SaS6%8Z zGK}&kTa!XnEAoHy_eT&Z1OM^+rwjn{3ouw7D_fL}hr)yuo6j})VVg1jLW}fAmdWT@ z;F?FX6;5VO?2@xyHJ%x+<%l!2tvv1Wl*ZSTYj*}D06XxtZ&}t-e`SYqxf?T5@{)eT zu91^FTa_^S5$P}P(peV`^q^rqRApf}=;f7^+Hp$UtczPHBhnXE^?P(Z%W-7t&Uw@| zb=2Z>rPmvcYlHiq$=97T`0WR1JB0J8dUACAfVTPZ!r={O3)Jvf)?eI{w%vG|!iI=8 zU|Uen6^6cEeM zBfmCh-=8p5IB-MtL-6Hz^)xc4Sl(rkgm0L|P^unsuL1ZtsgN(viK@&ICsQ~WQi$2} zr*q8*y2_!tM1+Cvw~u%Mhx+j{Uj-DbSvYltil%{*T4<_zaKUq?tPSIc^rtIZ#($Rd z81%Ih!A%581z%7kqMa2r^?PE|N1AaGWJYSf1+o$HiZzuQ;9@GmM*tEln)lk#6XbLF zkg@knPolHzOB<6&vI1z?)52J3OC%vW>;z%tMXBENOq3(n{oPx2XnjvBm< z2lZYpYgiro^< zrKmFTi7p)V?)nXO*j?`pqF;DD0WMOKp<`Loi!F##nX=r9ps2S8vqKmECcO?G#Qu>q zINOIC92BXqN&z|(Kw{uTuzw|wxfIdX`%h9W;FFkhh(p~Xg7j*3{!sZvopHz1wH|wV zU49Z6EzU|j-)d+qFQ6UOCe+Vf$4AM+SjSiJ2BRoUr8)A5zb`I5W%EW!d>CK+jyZ3Z zQdO?6-f`{P&f{W4s>?z<$4qRl{BWo;Y}j*J70<+`QH5c6onE7_9SCP^N?w64jH3=- zx$eD1D3k|nip@##r3qytM(qDAGDk3yj_}ilmM1Wt$gxeN&-nZ7K#E9D5R}Vgb1k~g zFIyk9G0(}J@;(fCwxk66J^coo!)0TN(wu?3b?+LB@=tV!4a99Isg!>Wbme z0i@WYqoFT*WJl7gStJ2Kn&4k`@t4@#4o-AY(v5_kcRFks3nCHWLGspw2sNB4o0mPN zW~xUurM!uuF8I9z2aqz}ac3D-_{oVCAuv8&ks^wEK#Js^*VUe{Fb5Ie$Sz_ey^2v^ zI~rMq-F9eq30o|By+?ws-)Yzr`$5 zcI-i291mY!G-04H`(R^V27ZqyXF4A*g znIYOFi4)dn)M%Of%3&%T5^Yo$#|4z)g3X1Gxj(SG=d8N8~PRFHd>~>aunt zAS-&BBgf8tK{kpUMFDqD2owT0*rTnkD^I;u%kkWqFhtsuH$#Md4Ldpr?M#ePs| zWfRea@MsF`#(-amQvwQcvBt2lXi72qqe%GCx6s z^*euLoPMXCrTN|pOq8QWt9UYUV^lTmBQkduUAHCn2F)vcEI(NcY_-l2sd2C8r^JTWR*xbGc-%|KbM9*9>D!A2{jN5Q-Z(F>=;X50M27&Kur69Fc+C zC0)k+{KKS}mM8oxE*+H@W(x2@6I6ZCa#W=T*gOi5J9QF?PKJI7*s0W{v@C@v!azow zwIFa|gbm)i&Fiaot++4bSb|2CZr0=lG3s0BQdf5wj0jnQ`?TgMPNcj&9=zqWyx2qUHp+k6(ynZ&cW6X?bMZf zkxfJ&G??|r49`KvN>?YAYBT6zJKv|!eImK>FG+{q_Dp2!K=KT z?iK8ttx(skHTyohT|8uTxgstweJ=wIA=nYnoXJm&f?|ryP%qoBn50nu`rOUTu_I2@ z@6`5oUn8%eQ5|l5bcIT0f34&`>rPx5f$LJZ?;pGm=S1ulIV?DYa4&AQ(A2Rev^FgI z;DC|z?Y7`=Su;06d%3^R?@xKQzhRz^0`r;=KU_aR7s}@9LxTKz@{)DT_JetERXB&| zT&n?$DnA`h6f;}(F?+Bn*%0TLnwhLX!~3!hQef^k!Y8R7$-p@98CAxJIU*!lI<#>c- zc^z6T5~Pc*=(y80f0ofTSEcBEeY9CVV&vk%XUEQgYK$OYSkK00Kp{)nXOgEmHe!@w63f|fxK(>_sF z`Kvtum(i0K6;Et-g1w_!U3RwrlJ6_RESm55_#GrF!L@Pz)J|E9Y)3YqMF)>2@!uWn zQc1&XpD~bhlFf`Pf)8h!t?nSB^z|1-HA-k@U@X=(Hh$ zkzM@LKhJzg;RdP6RFeJXd^caXb2jiehQDV+>`+A}6$vvq=#B(+nycl3SVu}gI-J4d zx3lmnY9YEQu^|qU4&qzK&$~J!Fj=%drclD(VFpD-V3>7P5jEVwgQJC{V*JPS)epP8 zq*BoL5$=`d3T_!%;Pdh1d42(dq1abbB2T$mn?7p3h)m)!pNhI|xZZ&P9=`u!7{ zOmjA`t{5jmfP&7r3$+)G&iZ1j+ZvSPZ8AlnLG}~eh+3m#VM(aFMad65+qH420n3PN zBjB%(U?@8)3}S4r9KvLUXTqSPWJP4nZ6 zp^T)St$mHyUoNIxd0wvteeFPtA~IajhUecZDPeUE8msCPOFr&?WNo4v_L#ox!ad4} zPV#ViUfse^&qiLivlD->>YtHix9Ck*3*ihD@)USmUUM%YbW}L0e^3B_&l5%nP*fuNdPsjDS>~L&}$vZbl=`% zj@J{#U8MeHn-1h2Q`wW#by(4LdA?eFINR~q#>9*cBat?uumg$w?N9HQj!wPSgkD!j3`Y==_tma*W!4o< z`b|L=bMPAc6i@|=kR##v=7t-WoH_y+yF4x|+Kau{Wfd=NVdYq^vld(gh3s3tF=EScFB2w&6Fnn&$KZyrUDac)M zkr^WTF8&qsHb)b=+VyQMipB6}F)~sKgF8@QqOMfK+Ne^X;zULu*Hx;TEMys9!zSIJ z1);=VNe)eIQnn*VLQBe#1+DPM)f;u?}gl|#@Fd6n*GhFg1tn%lq8jrSt$67HKg;%rcJcm=0eLx!+e1WnCWJr1$Z& zB4wmMbn=Jtp#Q|ge!-*TNpREC3i28ibyS`_uo?$PL~ zKEuYBbn&ZMZZ>=Cv&P%}{}6q?2lt|b4mRfzjxB?tC#igNiW+%EmoJPph56hWpr(&c zarHe#{Qgb=EaC!1%YJF+!e>Fv3ka^^!W=~kn~I~l=4%`sA?3Jv8@rQ@>-z_nLL;<%F}svr<<$64uL6GC>G3I!OOG_<|Zb;YmMu>PrWMZKB*QKo_usYR$_)yi3EBR%eJq24Q zq)iQ|g8_Y0*G7TqB_)L=j3N9CvAea*WYh+!R;9(4u%tMus4O>BBhIs`YSJR|kWjo9 z&jaWMV_&iF^fZAuM@2peQ!yO_IT^uaUP)z5s=q!qPE7{j0uG1rB{!_VPi;)0Z4sV` z-C@HIX=LE>`ihP4%R`u1499+0$T~aaB$eVt1&=y~nv0y*o;vIaUzLfpenDAbiQt!m z8#NU}FUlDO)lh842}DO$>nek`#z1~sPFF?hoSDZo`R`ptDmprf6@%SN^ZdpVM23hZN>FK@%t!dVADrdm4{A7|BJSF439K;*L`E#W``5ob~>KPBoo`V zZFiE1t%+?-Y}%$s;e^ulECJ(n2J$ zisF1@R+JLKyK^QlNM_a4@XkRPLe-D_BAW}o4f z_8R^v?zZ0UoxtZ~=_!h8pqY>RKM0k5Z0WXL`GIpzP=h;vPz>qK%K_7Y@3B%^&g-+a z*JhdiP5t!VbC8F_6FK1LAEAvKK-eZQHh$1)u_T;ZG#6BYC*9cz4kw772J{{sHK-Jo_n1WHW36c z_=+!@C#9AJ0($?4Jqy;7O)&Y=Ljj3Ee8d~|mI+~N zGWeaW|M@i3HYVEtWjO4AdpPxL6~XTTWF=OX5mH9OAm@Q8{Njjp)1tx_xSS=Y`Z~)0 znfjUtH)E=R!wJXdP30#U8k`~C0k$yB7zR^GqTkDFcfRA|ot4ZA85Ugr7>WSXx1T6# z(tQ%h&=GR3YmEs z6LWG1bmaEAu=l{IRRGRC<_yDE36=^B^mZ|814~a$gfRVi!A_5i2u06mRJ6&CZ(yTE z;KNjuK9&%ql^nEMwsJAD)BU5^u$$aMHzcpt$lQaAB?}$TmWim#6GK)DeJFY6x|h7afV{F zoJ`>Ho&|7Hp5(`Z{U|KD<_1tDz4D+`fBbk47l3J2akk6`;D z^d@UT8HJQkLGloMH>N@gBc940wT{+ju*!9nGbUI%=>0WT6Npk2e8Kt2>_;w#3Teow zpoTjJ>hV-5gO1xZ{3D^Bu+>MEB^56uWgrH$!Md>cdPg;r^rD zttQ5KUYc5OsqL$GnUeb}^)iTKU?ox1~;LiRc=#0{_2`oRp2q zV#DVG;FP28eSJ^5jewt+**?f?_}cdkd1e0J%Kd@5B2qAm3I5!)GH9^ga)d*bh?|*U zf&bz9UokrtvvyBXL;0stpuJ>(<;F%sO7R7r`U;t)yxB#d2XLH#fY9oAsvILXE}%4`!Cr4e_Xqi@V!HeVHxe*V^pG1%Gh2G9&8rteS+vO}MWAZxjj z7BjSR@zm!J`wap^E!*0P1u(yRaACs(XR#1| zquzX(TH+Bp$}MDot@eyG^ZUTm{kO`Mv?zj1>g%3Vvn1~tnUyVm`m~{>yF2e6OLV?< zmF>e}MdHXV&`X{ck%Bx;TLdbpLu^2{U_e% z864Lv^S+iX4HUod)Ts` zjV-r44xxHE@~TUcX5}plp`M<2jCuRIDtDzBMyMx6UxJfD!7feN)9dHE-P@_~Coy*7 zAS4=!bbQr~B9%Eu6RPq$=D@+7a+1YX-8Y^o!gLJeC*EI6;!&1VjDit#nkd#H3|K{+ zFq#go6(Ct2Jn~#kneci;(UQ*Aj7}T$9SmZQegF|ygfa`Tx-1^YPF%F4ntRlLLau8F zAyi7u52<+-C4g*!`27x+)36Kb0BaDFdEgKKOy8=sCvDBWGMPu|u=6fUL8dic;kQDA zs9QGHg~&OB9)ehhjz&^HE9Sg@DANOKG_!=7UnWF27RFEI1W5LKKvd$gU~bL`{<^h3 zr4wYnRj=hG0>I2J6>Cq#kO}3Sjp#ir&-}E4*Swgmr@#O{$y)O>8u5zZfNebzGSw_Z z182kR%%(IMeL||5n1dn&m$-?2Zi{;*xfrB7?gFYkmL?Y1NBaTnW2?NjwtyOLv~s?|%Hq6IpjCDEXSZbPROl z6IR{5S7yl@2LzVCUjP0U=}E;<&BQV65fxKOHfIoVtNu~|Ws{STlq_g3f^|~_*SwzA z{5g>}3Fbaa`=!ynQmWq%@dT;DAzswpnbXn%G24kN)Wm+z;&(y99vfnL$4t03Od1)mu3{{L8S?Yuy-M~=9l%0~w#-QvEQ9~TkkfNeO z52UuZ9OKIi@nHE|+Q$9F_s@E_&21GOx1G<;X5hm3pYcDBOaKx8(m{@(9{-+BYF9)4 zCL}bD68;JXox5hxD!mI<3gQe4>=lmLt)JoZbxGDPF zlQxmo7^Y@NA~m_aW}+7QP+H^OfHwcSWXXs6r%aroemThTER@~q zMc|qUc7o)%)baNlA(txK#~2U|x}xd(!G_~ybk_Z z{GG@}LQO!{5%SVb;O`SNA zUeZ^c!c}&FnA;$uTpFR6i8+ucL=%E)T3XEtw$mplSc3m}<+-r^9Cu;#G(8pz zTj6@Gh#}{s>nfy}g@eW4GM0RiDTu_d#te`3UywN5^yNJUd@vr-QJ$9wc~NdSFwV$$ zB|wNE{U1J(70+&B1g8ZD5wF<5HBan8`-mJ6u%I@q;4~KzNn%0z^KG4DaekI0K0;QG zhMOIokS`$57lIr*$1i;2!Zz?gA`+3!UbEWDVfxC9f(XTcF107m+x_N0E7s#v+xY%HAgn9uDs4G+sHMP}9RQ8J`B1a6P_^Hhf1W238hWk5q zo-@hViF`7e2=j8JKX=?q%5!|-c!@HG4bWy48Rq5i;nSO{N-j>!ZH&L8zpVKTh5RNe zmIUv4aA`^SeLl*i#_?jS*V!BMV1K7Y47659O8J7gX`<0^tR^gN1p453jcVwmREMB-)0b4byXkLrN)Le^yln+(v&m&Q>mGfp>M%qL)kN zHrK{2p-5bz!tl<|j>pIsUv16}+zv@#h#))PzBZS+uO5;uAB@Y1^-*=wne-* zMLe)4b+NNETB-Nz%THBTe?O7VTtuLa#yq~TEU;J}e7YV9h6zGy%1Mx7F5L#$s3 z>@JAyTy4fILYiJ_%l5hL8dj5!WI@i_Tfo)btsqeXtp-#-GjzhUvqWuK@$|PRUNHk|?g^xYvJ`B~` zdmzE;{u{AZ6cRfmD|)OlzIr0jU7eNyS~AGlv7gQ!T;1W~qA%2?Y`$5eT8ff5d!;>W ziIXBwCto=FUccW%In72SLR09(RBX6W`n~U|GH|XwPmD>U-PY-o^{z>)Dl6I?HkYGP z4wmTOG|w^N-p*q_CfYqZxKBiNc>M|c6D(n9$gY`C>;GHO?)Koq)w*^j7?!K9^2zq& zCDz%s+B1Y$0qv5_C`R5$G%#w?<#TMX9wFQO+hVGOX*H0h+>4a?-SeBzgFDeIiw>!V z=H0+h3zb!TjPN^eiD6wW3KEFNhy?y?z&|{dY`4tpk_&zr)ed^3*0F@}9;*7NKnV69 zGgjZcWaALQU(*JCsR0~Zou%Mn{%DN&Tv?bBNA(T4CNbx)OK*0SU;A*=BU^II{Hf=j zWhswg5zGGcj{r|`QuKkl{`#C7FZ~%yNl_`+^_}^-I!1`(InK{WQJY!o^Koe&z`S3z zW6NdB8)V9cZeDGcY(}jl><)R~j_TNC0q5h+Z+8#e`*=->=c&m^@vRT=b)!}Zj7b~& z&E8`yiHxFLYsO!B!t$Pl+`xBu-D$@tLU5i%9xhTCrgPab+(y7&O2Yn*Tppo!1s2Dg z70zQH$gS%eCRZJX6c^mwo*3^z;P=^F&)af>-Na?-p3kUZq?Wp?Sn@PW64)jM*fH+0 z+5HMF8Yw)xlVp>Gk-=pu#X^HCAa5hWqKA1|oF|OP$P*n8mY$MTgp#)ZHw%znvm)Il zI1IM_bN48-m#2vKwvJkNUoeSXngf=yHJ+ z2A@+y7#>|9cW&+pnH(F}(6AfGrtmP@_%}S~f{GyCL}oip3={~gE_o-UepuiMWrzSK z?K?ertf0`Lg+wpP0i#y%qQ+#pIHtR^>+HbL>{Tgz;MKOj!1PpvAgO)LSg0C`@@7M* z!=rcNP;n%Y`|Fam?RVMH$glv#^nb9|#@HZQ=%e%VT;BNJxzD>FH&mF8xrw8YUU>Eh z&W#PVbS8XCf}VtQme_W0JJ^bF@P+O9aIW*yxPp*TvNZE*0|zeqQ0M9mAEvsfdspLn zegQj2QBkT8d~&q@Wuem?;3LLTcW$*G_j=QUAF>}O#ov`r+&_oxcD(oWGz^4#tMxo^ zCp5!X%cj>CWiB7Yx^5<<@o8LYo)`3LYZpR?Y^f`q*(96LyhaJ|2#!qF%fPtDb$WHU zoxhG(#HN!=**k+rB#YfQ2(SN$0iF^sd`t1JV@3i(+!1P4dIz1D^zbVr!P8)zjl_Fv z-oi@NsorUFf_;Yy%a>*?^fXpMJi55l6t;EQ){+)5(`JpvL;d)GH#scHxI)$n=n=OthPNr7M2?W0Q3|-Gi1SIS{89KxeB~i+WdJQ+!E! z;zRJvlBCyq#-e;hWHz(i<0h64YRdcXl50b!v>L2n^px{-*ti-l&7_wz@M*N1PZK+*(n zWaq1O;!a>HcZ6RSzLzaUbtosAM1=&c@b@VcKcdg;1w({!d*?^+4-YfSF?s4OG?(x1 zVvrp|FMgaDhNo4wdpkrMU4qDPH$9heb?Vq(zH5JrxoR4zfTeTtoy3FpPo*<1759*Z z((QB#HHkT_*=b*_&uZr*4`SRSTZ1{oW{c9!wABJoM<~I}Y5Z<6Yo{daN4BRshTb?q z=WzpCJ0v|TUBug*&NI)9`(rZO$7iuI5h{qdpxwgTPZVn%NY(Q$P{&Se4dr_cHnj{UOf+S_U;XA_g(5-NQ3u*z;PP7&Yu z{qZv@G*on6H7i#MVD*7Oq7@%7+me3y_Jo(_L}H?egGA&VacOIl%g=_b0B@i`IMt~n zAW;RE1*>=Pys%oTqaktjk(G&#_;j)b)xR z_XZ2T1uo4O=@_G<6^GWohu_6V2_E`*)#*JwLvEg=1nM^{9m3H%_gE1w*KqBD%=49Oi!Cgp9za2uigPP*BJM zwch}4xH4PiTQr+KQG%THsmus>DDdN{PW*1zLxI)VxPFbOrM$tlLK6{^5 z9~gFP2k?KNN_RsgQ)-L5TvPG%MJvm$OXx}f$pU75KrZ~J!`+V=-VTmLNZ+seNIOUV zova8jz?--E=AFh=#q|qAG>|NhvyMr0-TGb7$of~UcW((E~7Y2i^6mW;1DX)U8eGy!mzWibeTRHGAKSw)s9giLqyI*N)8O zy4IiI5+0MfF@HWyH{4FWA!k0Iv$m(z?-<~e1bRL&er*4YahAeDgMxwrfJ2xyUyFu} zXMJ8RjYo!TrMW#VrEoiVn({4*xBtN#Jv`m?4Y$TmZ+c5Qj60HPa4N2fYQaanJp<)` z+ti0J{{`i=gYMR*|9k_rne3^I9~D4 z0r5ECr#vJbmx}6k8zYx~^*KlL5#xGw{wuB55-*;3O_GW3vib}wh7PNcNcX6szoT(% zjmF9zOPk=I(!cRC;oO8oL@X=lHuNyLcHZ)3*%GQ2rddX6veKj|@5**O@T^tIBS@;$ z0+z90Ud3}Gep;K%H?XL_eZOEpf4(la;_>M#z$KRNGaFAB4}|UN37m)uF&$?G&*hl#G793$u8vu>E)>DXwud~#m44C;sZivyQ;gI367`jtlX$Eo|F23YE z=?hGhX(}yOX->CA ze7=&d%A|j~TrfG#_}wY^HZ&!uleRz;OY%N$`O6Jk8J+~`8EbYS>n-qQ`xS)#CJ!f^ zm}9msl#-Z<7|9u0BDuO5+iZ5c-4q^i$GjuS>BX7-n&E5~tr$9JS7hIq+B z)`h-&GO`GWNH&?F+~LC6qg(kT0JsjeLw`Hor3&xLa^K1yGNNF$j~6Ll?Zr5~-}vSv#(%f*@mpx}^N!F|q#oMqC*)nCvr3I1(TS&_t?L9lAtc7t z(Z^D&+9@0Fr>6;ug}GwSWGlJu%c!>9XOj3@{Q_1d+S$xCr^Xd(awbhqm74h?~ zdk0GK!LQbhD6}i%-5{f&pPg(U6*uGY{9&D+i!_uKt2eE2z6R*7zY$DjjT-(tduB*W z|B|^cxfv|xeom=RTeF{ItjNSFuAB<;p-t_5jr11-qw<$q}WMpn#HlO-`*LKqy&KS#KZ%G3G$+WlL>9EfzNCp zj$%o1H1z%i{oKlhC@QL~!Wm{sO);z=9OXfQYuc`MrA5V(xdVw~y#h4J_cZ44jk*73 z@p4EJyDS&G+QZu7@uR8}sP%}r5>fJ4BFhTsw`ZKbJiDqx#rW748YZzH0 zCwxYra;(WD@h#6=FLhH91B@m?t7gDaZ-#rJJqB`e^4Y(ph@XD{V(%|WXqcG@v2OR6UHq({evD8oKM9t{=`}?ygcPSbB7--W7E<> z))@A6EY&BhTL+G9)Z-+Q+ouz3L%17zI zJ#^rK{z5#Nn2=uX$bg+x|AtQoZvjCsUDdD3Gd|MbOB)RU^0ClK=9u zl!7ATnAa;*L<$A;Pf4j-qW5mzNh?B=%jmZYM37*E7bBo3E@>e?ad@i1;Y;{xdo@z{ zXHd1yqrU2#6jN?%y%`1}=0wJ2$5h2JH;c(le^ggDQ4fUy=J!wt+^GV~m*Mtr(CE#Q z)T1TYq|r1Os#ow3Oo{%*$L4Sv<1DIJ3o76$ECv`HZ4ldtUnwWWmgdyo5FL&Flv{46 z2qC(ypO7D2T@Pkc?*P^1obp-1_&v7YaYE&9T4;tOI&t)e{JB5@$GMhdF|H%^E5dUeZhVGd)Dk4XlmHWkR6iR7v}P62TvcuO(p|q0RvsVGF6f~%_a!A)0gM{ zbo6D#d9jQ+CwwR7R6%I_e*@%Xc-?j=pZXARGLTiUra5gID5Rv~4e2sHC>_wT6)To;A-0i?9S9*<;uci%qv*hx*T` zSWlR;dnRSw; zrA{t)d&R?W7s9lrm!J%`$5R0ka9l4xY#NXdGoW+IuZNFFWpq6&X6bRNhckFHK(3#NtgtYrA1+7(g}ZjC&sm}?d;9jXVC-4&r56{NQ?Rb= z+IuzC7`Wh;CYq|HCQMB8w=c6<51{)&wtiireLm`-c+l8izG<5;@vI6*m&FjNDa@f2 z&76>rC?-kfZJt6KGHsyh9BS9OeejXk6p0X(>Vs@hoPTV;p@&1k(^BAsVW*4*{$mlz zfnh?YFu>*rL33p@TN_)dD^c}%gR|o95}m%oYu<}CYvPTGr`30Asf{4#aCZIytv#+I zkb!AeX%>Szi%?7kRt7P->}-ma60O}8V(?JymzT`@h?)pnyH?5fKD82)127$EM6l5^mWIhw+IUD?pJ^x z``!m=@H=x76)LPeSjrH-V!h@B0kL1)`gh?UtD8n@iBat-3PXI(pv4zWhMzSvO5b5NKx^tJ{lDEPTG_ar;lE(?yza9V z4Q-g$snBEzbW|hO%iQ5gCO{Tm!?Q;33qJlw&F)#~604LPB|?jtl&Pih*k{G1X=iW? zj&5$Pvs49T0V6ItjBuxe?Hj2i-0tEl zQApi()KP`hcGp}3dPX){zND!hR|Xu5qAV~p+&H$^QXMX2Du%WM1CBmigMBRO@w((@){`<5FN8_ym;aAsC@mSWD0Gp?y@GtLBh(WFBCspAcK2 zVu~#x|Iz8s+>m}!Y@m#76YORz<(sbjt`(hnCMfOGwb|FTv?Vp&>!>E~$zA?1K`!kuku}>Kde0B(f8WBiQK=EeNhFQQ4~@`@Lu6Qy*>P zRiBz^S<+e-z@*1_gx(>pJAZ^{XtWc4CqqjvOs>$MtU7#G$eK~nHq7L#y0j6?!AMNQ zC*driBmP4SDroyQ1Xo854mwam3Xw#0N5Zs_$Z)gR#(3hJh|RiE>r&4fNW!{@9^zwq z_#O%l6m>QmVH~IFQm8|N0cZcPjD8Z{=VgkRoCkG5cSpt@2KOYM8KpKc(+Z?zt#^2p zqAw^$=hPm#Ac%251(I`;r#nBpoo#ePEtejrPN)lHb0A?&fKvNfNAM%d@l{!9K>~lhX!7!WT&G}sYf^#Jgaie z+_*Z>+7?(+ug^WJHUcb%zHGBP^Af(}gvq-ed)H#dy+|lX1w7jQ1A}?UGUf?z=s#d* zqJO}v`qTy1XB(;}&eAeD+#F=1E~mI7Mo>eWc_ZW(V<74BaGRq;1fbDlnAS&kmxmM! z2`3IIP@B#12|eY4211zlP%lfE=`-@90iZpL!ZXb&uS=?$n(6V{8&hX;d`;BZxtS0> zw|G!?=&1-*kU`ebJP~zCEN@rB927)PLb2@MboQ7cZlc3Y-z)I#z}0v#QPi2$bumdD zNY-GB@?}XgXX^Sys&EOo&_Jlb6w(dV<4VJ^036kW3NkMsxcCx9aA4ldmR7O;wwx`` zn~tydxa^`f`n;{;50`?Bf*M(Z^&!-mbKpVo6P|Hne*sw-66g{J~e zOhp8sr7dtsmg3=|uAKSN+p{IpR%R6pn^DT=ldf%e#MczW#~ITe#XfR6((AHCOE`*< z1~Sj9Y>QB|Bgow$Bq1X!+=_@1l?s$OTC;HusKU5`Mf3J$LijYsT&#&Zh@_mS#w|d} z${*ndg8LVvA;Cz`Vo2RaDaR{I08F&O;a?x>ZQX>N*zyys6+wvt%M4seO_rlmSZbhn z5zrrW1SmKJ6(DUYaJGurdd&m0a;(B}CMe-2hd$sy{R;v-FmL!d(wY;40_z1ys*d{& z8g5p1RmM+a&@dUkkvOkHm+~>zxFVHyRLSVQX~9~iD+t00_e)7T;kzTI1Fodvm)dmv zbgNieF&dHD!^{F)o-*DK*m;%!r+omY7z>^RuW*hSEtc5KU+X3`3xU48NKd&n`jXSt znlr@wC=}|cQNy8PmyYB=D&|#(8d|86bQn#`0NY{58q-a# z*g=J%eg3`+`h@(|p<53x-nhH-OYg(hxC~h|sNMv)gm5wIahg-6mF4;I2c6g9i4lo8 z4!-ub_?F%JuMouRHWU)%OmORKF<7WZ<|Fcdn=Op+Gs})HxIQWD37#-?Ppj; z18hv+B6rSc&n6(>&NOgeSM!FADEU_>k^qFNN#O@k`bu)fvMNZnDuqrW18SM$H&}!+ zu0-ydS~HVPe9Y7t_->X&QEb{gL=>{YD~=sG3hxACa%yQQDDAN>*Z+=5M$;*QjNyYs z2$-&t^|Y%INJtN_*R9%X>FDBtg-(UFxO&lH9?#cUzq~tqYZ4#JUd=gqpG)>Vuy}xg z!XZ^-gxW7Rt?rS~AGdQP=i489EZu9`LzkoNE2~(>Ye~TDOrlpBT{ViGa5na3*GMVy zWI{Q_+J>KXPE)L9{Mb7fh9gXLRCA?sOWZ*12dEp&bMrjWwlL$mAtkaE6wBP43wsXC z!6M4%AlkBCktKZB%c|VX>?s>m2AUxz1BFQ{$)jBBM=$S?V72(QumKDr_Bl6wc!#OVEM@n(Eza@`_>zJqWddCAk)gd zY|YYCV)#9(bPHPHzYpR=ysInHV#fjphf;Iy&bS$q-Av7J+(drhDFG#$;Bh5lmnd`Z znO-2lh6%anJi3zX_Lr&~Mjbd#^@>%baK#;yd$zy#o8rW$96JD$l*ft4(--7O_a~PFqB*ji}vrf0NETs+KJ15QlIXz(EY9 ztcB@jY~R^x}H7G``a-JfrFsFLARjO6QdshBLnW8XAFI2~x8vu66zliLHXy#4UAPw|sEbk3lg7o&%>ay+mV@t*6 zJIuuNSos)zrHKNv73kr9DuB`4E4rFo8Ysp6eN*c#MJ{g3#;&BbGG^{aVj=&LvzA6Q~>N%!a^6%lXlCX8O(c*;~oN zu$r?TFr}BZd_mL`Qf2IEZ}89nzQMh!U;Z1DWEc4uHv&fVoIq;rMV68{;*z&{&9(?C z_8xJmYl&H7W@2%Ae92weIM#wNpF0mukmFE7I!L<8#=p+zDq*CuZR7wqV6-Ls(rR4e!QQ!PPY^s#G=>O@NmxY)IKomZMRbFro#R^d0 z{diuIUzHV36}r|-RL7)X8xnjG5hr^_Y@07uXf+Tc{|l4&F>@3j_t8HjkH!GB+gdm2j20e$FTrG zv@7YW^VmC_CseQ!LH==WIhpsrL4A|Em2Ri*rK>QC<*CNE7tf~@T%{S_qTrkYec$IstpzHe{1(aw=wP0!52 z3QI*}v92CA)%EXy?(SJ3o%1eT<|X$Si-H2!7$$l6Fp;KM6bq8=>2l$%^PaS~+qqk5 zui4Miv&WL6+*68P>5de;mSZqNH}%r4D` zt@DkA5jlohE;i2L=0V$*-rt2Bk@vH#9Fv#2i(|V;wv38>_V~WE$-$^kk0^-~EPdZE zyTx^%0D75;tkj-QbHi@1VPVH7$5eFW+20;%x&%_@o_%sZ3qJ0?K{+om4iWuK8fyN0 zAcP9+i6Y7DOe(h0V8j_r@$Nqg`a5J-<{ffN8~CIGf6Pe~s6-?K0k@6~5Tmqzq*f5w~ANjh~Z&k5_hPqa2XS_*l-56OgYkaek(WqvNC(_J{9$|i5Ra?1KlK)s*MkwBO&zT=JWjqz2pu`x6+Tmk}90@N=>7OA^6sM*uHeo z)(9l1>JDF$mMn;CtBEycWoMt0w46VD4gBbsrVwv%Lo$q0qI?j4$3ym;!6Kb-;pBJ> zoiNkfppB5ul0u2fc>>ah`LW$@rl!DSbJU9xvlaBI5{(pz{pAoT$p+QNAiY$HB z1OT)pS>VaY^tsah8n@}L8vU= zpA&G@|G(z#7yhpn@0~Vo{rkGF{Cwd@LP8<;?)T>7`^uvWyXcMz?8rQA6wV7-Ft# z48)bSy;PV7zlqCLrVie{PK)b$Leew+jOSiIGc3}%*jaWH-^@@P^-+Y+1c zILN#E*P50cp$6@~!+0E1^WiXkm+b~$AcSu+1!N3S^*I%6Ap%8Gv*~nchbGv9VdECt9>9?VR!FtrJuQ35ru{%`ED`@?z2B?S(a}=J;M}Xy zm7NWW@4E(T#8L-GAL(zo)oq&!zU03@Z-k@tRrB_T)i-#P`+r6X38fO1(HV)i_KtE; zroK7NIeBw3pJ99KS)nGHeTrk{hn6niP;{?tNK2I=maIopQO7+;;UuuPq~LDw47^Ea z8!LtyIr}F6$D?E6H$%3sGd`Y{%CJ9gN)5VGxJ&AUP85#RnzXw5mwn-bcP|xP3P&T4LXLS>H^z%`cCt6htAeRHQ}Xy$NyjE|9kW*xPkaE=iTi0;+DYc6}nA znbZ#onFx0GyPgc$XQVlrg(XpiYKboiBUAACNyv_yQTSq^Hz-85%$yZZq#X7H(UUSo z2m4KG6xV+H)s&p=gJ}871oBvG4F#8%_r0%WHQ*HQ%dEow<1(|Vip2G7Wh#@fBr%f% z<02v@?eeCVHZq(+&mz%faBBR}3?1`21t=Zi?_Fh|j|N|!I-W8=UVw&Dn#!1>NLrs6 zcUEKdRB>cKavz(f}}5 z1nrd^PGJZNiA#eyBBu!4CtxGY3NJGNRcXWBCNXW#2w>9vmOoUPPM9M7sRK_rOp2n~ zAcJ=;{`#asfpi}#L)(%tM4BGCw%WhgczK)gQ{ioQE~Lc1H#tdl`b|>;3QaOXq)*ZJ`WJG<$PBFwzlX;<>tLmO zpqJbPk@tObh36wAD7!6=L7s+x!!uF*#F^yvpSR;VIv)%clvI`9Wlc`5qpW03)fVbQ zt=GAyZJO@iioFCQ+_KGyMaUBK@DWPGSc97m%`iSx6yl^=f}x`HQZvI!B5U?y0~~dC=d)7qnQ437}`t~i+HNOM!#j3_h?Bueed&^ zp}Y!~@rv^WWgD46?JqEB>@?IOmS0c`90v7i=pk2<&ma=`ykQ(*ifjWX=de9kon32C zSc#W1CvrdSPF23k4;2pM=K`%m%8Avddv)&5n?|Zsa9#^OR38h78F(XlUuCJe{cj9b z&ZIHEV4+UE#3el56(GeNY&s0GT;1c3Idlb_Gy8#?qiCht%xGh$96i2D1!$MQ0N z=MdF+0!rTY6br^_}{Egv9)_R{olx6fs_$9C8zKPk}iMY=(TKB!`SLAFvU&xKYb zM~RA6IL2;Lp{Me$*5fBLql5NwqvB@mNnZ8t@yri4N^i^7mTLA*_O(_AfS|%3YPeIzNgl>X7-c zIg%EVU&-;vh{8Ww{QTNN_Od%ItHFfH;8K}USE#&L>F)0wX9ROGkp0#DA|p4bXP+iK z-fb&Q{bbse{k;Gt-R9DGV)ak5M_3{&kk1^=V|sD~5s{nN;(fS_Bb>2y$64#4*94uP zUc1qlgcHJekA}PCHm$LaB{S7jcctkNQxFZ!Lx%}LlVM1^<(JzU{V}}UAZ3}$+)WB5 zZwHNTOXR!8KS(Hy+&5YVLvM;PRc5KB%aSEDvD-wT*2whE7i-wsO6(VCx`wQ>urQ=N zGa_@Si7lkFM_*5Jn`g3uO*;Z>MVt)@14Flj7**? zaN*~OJe!v7p`Yd`L7jx312zk{-dvY?lcuCRVq%|}K02+KTYP)){VxM*wXoQ4?CG7z ziYKM6v5yOR;(!Zqs@&6elDuy;^A2l6*9ETKPdVYVM0UP+t-vw-9J|$IO!srzGADD| zHjDhSBvXB^(%+yVi@5$&TsQyMxJ&Erqghk^^6W%eCr8mtMi+zX@)qe`u1r1w9YD3; z{(lRV9LpDnay~ujpOL}nX>(`{lzw>P6J;Znxddw_-;bbI3LC>|}I!5LtpsNz!vX!toD?ftLd zMwsT2>`Auqryj_{f&bj-|LMBrW$9pg8S>}VkO9(I3<i*Q*p%RO^9p00euOA^wykgOb4>epx#v zQjuZInJz+M?4`=69~C3qcw_s0fGQ>gvoN9AU~dmjj>dEzkVbU)l8|i=+D*g#qc~!` z0C%5bF|eo>Q%UEnPF-RP7hhdPb^Vh08@X`kyR#;7Ma7aJZ=r!Av2cvA4=ueMx+u}s z)1ulk_QnWeMT(#03ET^3=Pog{fN?|B&KB9ahUyyON;jyLU}S2sgpPgtlvf|{sK0w(U0!>q+UaU$>9Xc zE9>EYCc&u%q@nc0=5}K#nL&z&^&ZRq?ywRXur}A~wR+R5#~ISwLJtn>Almr2f4Pb_ zd}bi6$*3K(hzA$XL;I7}F01y8YU|s!%L`t>#!E8dCwQLcuVjt|wkM^}H&g%D6WwG? ztgDl(tf%nHcQ6f&03{`g{3l+=hUg*#dXGt_t?NukrX1VtwrGDd#@^s^X> zt>{}%X9=>5-S@Y*D^h&4xZJa?6*d3Tw9(>kNPM5E7iJ}j$k{GHK*B_5t5v!SSz>T;Q#or{)bCthe% z#?ISS=+#LH2JNPVXLdQqP`;IRKWhCr)x}!fi8FN+nC1mG^fR-~+@hFbje7robl4hc zz-o^=ml3iT40^2|d#vc6bTWU2t%T}QCf$TCv^q2Y$kD^*ZBFs~Fr!h74?(=HI9Eq! zXEdf8B=x;cGxe6V|06s_%iyv^`6e2AG{ow6F@QjCD#CX!S5?(d(KF37L z4noNFTi3nq=28f)4>UsRhD_KaU@hJ?fy3oX{bfqTfp<9fg)HKs(PznB=eI<)VN2>W zo&mBwZ*L%e!70dq>+BLxU!KIvervxH2#DgFl?HQQ5$8GE235FMXN2yhLq#1Zj_@vm zN`heXXM78gSl#eT@SHsPyje@k5^uYK$g})BF%&&9>z*R<=(x8md?&`_m=X{TmXig_ z7yIfyxPjd+3i8D%YAMI9WR!k80x*g&6*>)IFh*`|b#Y%hk4Kb*8MfA`Zy25}I`-~;tmGeA-5fp}ex=P+0sMA!S=QHd`xXDvioC=A&>2~FFu?`ld z1`KGA@f|@E@KC?K|EswA1K|SH?Y@J@`7F*K&*lqD8`p1r ztKIF4bh^Yy;Zz*wq0|Jf!Z&rXE8>#Aqur=2^ocBa;;ynp&F1o;syXRA>uQB#DJha9 z5)W65BX4@qZ_Yrcx!mH0Fao1KALrNET$VA`8&aWe`1jyG0eZs ziNu_aBlUlv+?I4oEMz7^9`Rk=qxW!6r(NT{Y&-`2&ImjSUbDSDwd}MQcHXQu1Phha ztcWc;sSLV-{OhAr z131?KFCKrdq(;wV`>fFuevz4-KgNvAaTcnQ&sk_TdLFwDF8(4Em_v%Ge~e|!jz4I0 z-j~%(jw0N=!u}G1&wsJzaZ7&b8}mq~LUI03W;_R<8Rq9{vc@?4rdVmQq@3is3tL%y zCX3CiKeqbkG(GLe_;7m{@%0zSnIACc9Q#Y?aX9JOUUG_fSG)ryLb=BW!za^ZzFKQ2 z6AB8EXbr?4t}8q?@o0I95g%WJXm}qJvy*d0CWDS4L;}m#UK22SrHPjHPh7(ZyK4MA z@R!I4tZvpD;y&y$2BCab?zAB&+cvQ_4WOq9_XWLB-muSU2{U4aqmT575pi^2XtOY4 z&C?vlOGOM7y59NV-mPgR8JEnI{7oZucBbj|WC-=lioD^EdfMsFdZk3n1L#9k%OqZuVE?z>im5^=*3 z@`$rSTQK@k@{T|PZutRi6qyN4VB!wBB>uJOAzpe!0%Ih=0=v%W_wElYP;a6=P?6Ny6dbJ#HkoNmR7~O>QJrKUNO-&6~fv&XlE z?KU)%vV(MYTT$F-_pul*i^@qUF$!nqOBEA5RV0@G-i~1d=UfuglnnDNhu8?GJlV=7 zjVGh5!JeS`tVs~iF(7Sg5N{e4wCt$ZZY&$>D!)b2Rr|$uy49x?q%17!!R@I}nJ(On zL3IoZqPursq0LA{KHU+PPFEClexl6nX7*9+1An(yxM({5 z_-ev>Jy@P8IhtrnS`%`q*|(q~#j)}&$~{^kdDLi$zSf_2K7b~)K2BR`IQ^83%9K(W zAAL2Mj}Fhd4Zq^X;Hn!k8+g8DFE-EfszN*!%*Zfv$T-L09^2lgJ@BtI zZUoof^2u@0vq5g64mrLs%E_#F*%}Te$W zKiUX#hC^M7&Yb;#g<=V@giA-qptRz5IA#EScjt;gLlZtf>OB668Ua~pR5}KGhNhYE za+xtYy9~D*Mr0*7aULl-9a{U;Vnf@KIKzR(dzy=k9J^^FZ=IpOo^1b#qfsIigmUyh zh3&f)d1en0@AR>C#CFTIyBUi>aOnFejA18g=+MaqgJ*c?l|^H@}_~Hpd%|SQR|;oo^!@>e&8=Og1<2EEKU9jY=w;ETElGi!)@H{uJY-V7ROS z);5|P8e_LT<*z6<8o|N7A4__azR1cfJ>Mt@ggH2Y*57T+WI#;mHcP>fl>zgFC+wdd z{pGUj!|PX**5swsP}vSiBSq5M8#af7+ujJ-!us>v^ga>>7*z;%b%)YDGHdGQ`*`_5 z@cF|0IT~di{pFmk#qi+Mf&X>?3;X};^a9hl&c$?VQ3M45^26t*R(kj*Phz z->86rl_y7iaG6SkRGv=G#BLvN_%}P8&>G-X3xj*|Xu>(Me>$D4V54PvRqE0m0!ndt zZ3>)coj+=)r}o~~l}dGALE%- zH;MC?S$PMqQjz@I!>A%W(v|*`1>mF6Z9;rZC2^th;SKmxhdW_~0sn)J9G`-^#c?og z%rbX$_w2%hNBd3Vpj3~4XMWwL(qa*fDNihjwR^#lo_oJXtL~S+gZA}SQzv8;1aMCoWCo;U(BM<+P*E*aLC_xZp4N>XWZ zDw&~8|BypNe(}+aAT@#l{(Kd??t1t9D)>ys+!Yl64CZMW2ys9oWFMTXX!=9hie!jvEcxeC-QfGmoxpf2htB4G3Cvb;Lqnhp(Xr-Xh<224RB)l{16bz!I;G8};) ze#0moQ&c1w(gfZp6Fx~|Rtv4)aSdSHP@NG`NJ=h?-j4qrn{jYcy~R5B>+fcQRO!@# zhE!><0at+mLNz)@vuGmBwm!OTRNp2gV8^q~42$1<2dId}!7WX~VJ864L@`BDA_pM} zAATAuX3qr?!|nX&vqR*3)AF-PQ%e$uzrB4L$006iE#Er1T0$v0Rmii)ZN_NT3Fabs-J$vq%#L#l_ zN~Jt1I4Xq)!888yu)HPv@_l+b0R&6X^NG2exI8b|b)0+3{o%B)BpR5{EbmHJc-`!_ z)kvwFkPyKrh#cTYP;`?6&=Nt0f)hVS&Dwg}Xk5k)2>-5may$flH=h!xPBp_BsuG&8v>Y__cnhqGxsOk)7g`;j z4tQed;b%|l(NzKI=e=`z(EfXS37>ALe{KZ1bS!TyNu~2gNEzq1pfFlvVrSwrH*62j(|N7drO>bHWE-hK9hDWz<}SGW)}Ks?n=cyQf%1WqrxSMUp-Zq?auXo3XLVjP0+))7s?kUG(Gh zb#r6Y%u1OzqqZ=KJw=R&R}txe7m^>&vo{dXM4>k z8}ozZP4t%MrDPc z1H-Zu4k&@1roXPW7N*N1;ldIGqlg_xg>Wgu% z$V`k5dN<^K&;WGF=9eO+Vl2(0TpGv}dXC$Ddl%Soh0;GhJbssw@!pPM#Q){og7Sbb z2fAh5Js)dr&o$Je#wP=Wa5kldEf)zhHCmu@HvxiK|3skyG`j2sk-$@B+ zS(BUoj|AMlBPR9hY`0*fu+rc3c-HzohIg;xy^qy_PllXK=ujkN+Cv5UYno~r{j9NL zDQoJ5^%dd8H53zcvsG2-iXTLA(twn`x(5>o;pcN}F7xGCa{NZR#-~*VGzrZ_VXLoP z+mtFX7Z~dJ#BxcPGgZX9ZwB*tduj+XDqYWliI`-MB{~-|#@0XYH_I7XF2F0`c5{i_ zP+e41fS}2tM6YY;m-6pJML@7IUrW(U+#%{XQGnaB%k8HCxdizK>k@ zZ$olkoh;x5tg;+*hB-XULx+vFlkx_>hh85&2YP3T2HvI~SK++=TYo(K$CctNO&2heZY-Uq|8h*7txdFv!ufzkT8pypp@ib>*M=&D zh&pyGwLlgNP3RWbjE7GS9@o2NI*xFnVZ)OQ-nPWYstJzblHKM|XZW*bCTIQNALpUb zEUQvI%!zJFQvenG-1U!ktOHlhFa|jwlB5lycAUPT2PYN9#Q6NbITce@@1-_Xt5F7+5S7aIqcw=c+Eb#XmUG zXL)o>ttlhQ+_T}=HJmYPCRsxLwRCwblr-?Zpmwz=!yvk#QmxM(dUg+SM-A6mzWK}E zRGa||g{3NY=(0(Ork|*yj)f{spYHDlWv8zeVU2F$8A3t8J$J6xyU92@49U=a%5;*u zI(iCo^ZZg-I7Y0YFOgbAl1YLX5C%X~GfHn)U@pjZLXV{5QH9qM;LbaHa_RhtJ{(i3 zN5hLirDp}_lVylvP)yPHyU};zbU3D~r@w?(fB~j8u5B7Q2E-I}8w~EGFwn+PGrC|Q zD0TKT2fWF#B?0SU_^uH&jG7ZQl9kME?fpNhsItdIhkxO7GaJR$phruhrDTQmtnScA zd(?gY!|`h8Mfgz&iohOVWL?R^jWzHS&Q~C=BAk;h*O@#~W4`X6&ZXj?lJ(toz0mJS zPkvKHZ@$!kFbR?KV}@B$)@cvYp=4zX0E16-r%y!j5{eqv9T1F2M;MH z(0I|FH~gddHoEMUmOj!{Yq8!MUV4Q=UpP&!)^7JzDQ}>_2k)M`{w0!k*zrOsaO?I} z_zsU8_FIs0gffl1ivNa`?9QpHXabi9h|L24eSvbK5& z7%M9)OK~n>Vs6NuG%35FxsA}pBxV@1VZL>*oP2^Kk4ri$JIXA-$Y+SSg+G-OdHJl9 zcl)r@-X73@zh(Fi%nnJx)$=W4Q9P>bM`E6lD3bTl2|{8*npD*JBCpbgaBqCxhTO~Q zw6gsz21a%=s2o7O5pqUSXvre$>`%PpZ%#IDq(-3tfl;37={!N#wmXh~ljy|6%{j}< zWGW|L;QQkGw}g~P0mtf59MzS5Y(+vHllQ30H?nyfma0$IVwPjvg_19m=`RIMy`@~&p;mYl@Von%!oIlfy)xr3 zP3l^L9>$!`WY3xJuKMjFr;fOy+`#lisf8xQH^H1I(D9x{t5E(Q#$l}h5{&QYP#JK* zY3Ly(pEa;l(0Auj{}!g5^Wq_hHYg~-#>{o;&aqWtn`Ml&yjYZ6aej4nzZn7Qz}&37 zTzq&wolyfINh4j#So3DV*nT!rRL7gb40}J(q^D*{lDMeLCFbeu+uz+9erNOSg9FWW z=yzBXLSA!o`3c4L3m4|JldNMr1d~X)B3lc}3}iG;0YwKNZipbmMPTqey&p4v?t@%R#(MHzi99m+kN!K9yP`Jd zF&UQOHvF2|6x3ftM0ef;K%~C*Ff)bX&IZ`YIcd{Z$U;G=mbDNbhu@*>yRIE?#HTp}V$lga#s2E<2o{qMxqhqh`c z;IlHNYmt~~;@$jMS!{hJ2nu&F>UtUWs`W|fK#9Wl)eg}g?|0286s3nreqyq7^Niy1)xmoVGxg05-PB_M$k^rl39X>Zi`3iT=%@xtJMwpfsXes7U zt@0`_x=eGcBxHZ;zRJu&aqi4;ylsFrag%QU69OGPq$-}dn~H3e5V@Ij+@oQPXlib5 ztg8HNf(uK%W?%}?e1l7{YL7#k^>{z)?B5A^UGbOHy)WC~}#h2o7Dck9W*B|5Bht5S0!oGgk$~p+@#P zn5mzEJ)Qv~82-Wo6h&smWnBU3i{XyEIl^GW0h_|_5Z<3c^+pX9ZJ~z3kLaem8=C<_ z-vDiTzPnY1`IQZC!_(w`Z|}^RjtqMJ!VKP@Nm$SWdGu`_D4%b4WH#Nef)}q=5;scH z!VaHThSsznbf5Rz@TT1j|G{yF5gfw@^&#^GJDE|fT)CYe#@Y#jKKr?~G*BP6*FLH5 z!r`fe>y2yn%_-lGUO%6@+Z0;JVabzRqeEQ*{4ST$QqrBxVDWuMU}Q|d$`jdj>{z93 z9DgBmU^*#_$w-M)0BBV5=%w@0*}E%Bv4$oxzMf&ZPO z-1{POs6HFrtp6|c`9-{{8A1N{n_BH8S*-ty3JqJc_GQ?^B@$LT4nuS6DQG=LJqUrDq!b5%mdq!X3i@4~Z zam#Mqn(&w@+kd^pfK;(He*4EUbdnM1zj3b613ka~C%)VKKj~iktpD$q19mtRBYZC}0Bn8A53N^zSJX?pd#<@?{v$MIv-SZylfzVqH*E=?}E=|~`EigMqMnsss zHCZKO7}$}IMog-lz_J`UBEKio&u&bPuW3F^5l!I@ir2Z4qQUPWg=imEE|E28NH7uW zC#A=9&OG8gr6wE%;5sqVG$P{9xV7P>s7Nr8G?E3Zxcr3L!Tt#|I`m>iY@rt8WhVPBuUj<8yeE&yD@0-h=f)hmFe}}xj)w$d0aF}>sheLE4GvyMrm4D_>6z9Dg zmhZB(RX-R2!hHg6B*WGM?RgYm3S$Q#qlFvZ;+2|p3g$x;k^`+<8aRoRY6HG_4unDI z>BgdFa3$q_TkKh^$ilYhbi>@x(0J0-iNpaM>Gb*}JbQ%v8MThsmiTNjm$XKUcQKHw zp^Qwyp9@s|R5ne}cvl4_OYeUB<56Rp%VCVbUN_&y`kd6HSiD-!n+o#Y3y4+J^xVn& z&Nr2j@$g{BIU1P%x-R;Vdm-i4rrqERHTTzkRrc2TLYb&Lo0ox6p=}Z(6X27%{HG=E zqdc_XnO;kX5g7lm7c=YPPBQX3*ZSCJNP3j+V(Glu55J>8w))i) zK3Wknc>vg?{>YubCmF4~G2IDDe?1Rb<2a>gGCE=!_OfdKq+zUa%>dh@!c$Xx zLp(yZg*$}L|I!4ZM;8n>DIJMJs*_2B-E+|~lEezIO5cVeOBP9XOkou%gnN1TFq$@- zsooPecR$b(Oe2ElqYxctSZ)^59u%|Cf(m}*nGRHJj2VQ9@bd?}%6&{v`%lO@5S0!P zWXda(Yni)y|)XslJ{w<;xF8w|B$ zzS+r@3$b7BABo)T8gMXN6@494h?L;tbt@#0GRC@o;%VNNFc6-Xb5_JpEX{d4Sjcge zsNEE?ygKvGeSId#J|gU@SOQ27)Vn<8gzmL6JV^;ejA;lwEsKFb&TPwdv75Ghqjg49 ziUeCvH55%xn52Ux7(OdLrO_xSn+Q!r2SZC6W^1`~@(&wFzc@6;0jautdU5L3+gs$-pa7y&)=WbY}xP+(G zbf;NxJ2h&9#yvggi73cK%3i-DzH^Qx-Ig7PWR@AwgON#HoL&h!*S5;)DuY2H6g_^{ z6bh#Js9Rm!x!d>cXbtdl*Ic%{Y0T#XMc{}oSCfZcr-P&yo$8%sEmv7fkF1c=NfDFw zJ1RgO+0Yi|#K6z1a%cx&ON2n8i+EIIRhjF3uXmNKz}&pV#> zZwXfXYCipreROTSw##arpLW3T^Pga>yO)C=o7=ZBU#8FY4uzlKguU!3I(}wF`Yuy> zhdexTU7rNm|D`WgvpqGQb1*#E>qW}QF2Kn0dinF4&^oU*2cn&h!!h{K|4$G$Wk&EG zSh&F_l0zOrcdUVAVqIB$^P(|%I?Ed13>gEt1Mf#tV9PNN|4-dStc)*_KCgR6f&+E# z#cODTfCmXhWLhIOu_!GbD!O$62 zUqh%_Y<7g{c8d8k#n3@muGgfWDHQMYwEy!Gw{*_ut7BAs`r?Uf8+CTN)z$UKwTdfg zR|9(L@?g{dn(a_hIL=8tEbDlKs=4z`?c=!u$J6cyBO~{c6IcY>vUA2m!Azbfs_|3n z+w8r(jZN~5cwhoKJ0FYm%pRbpE`cLFggAOD%@o!d@-hU)#Th##dP#+xhouPp;RUt| zz7Gzi$Ui6KOdttv8;@w1AZe75v5!c2WxV!D%IflB04GIyf|;CqD5zWl4w}5YJO(A! z)Xg%H^Va?%?e}028XRQgu-W%*xZ&`Tgq-Jfm4qnTGYZmW>8Pv|2-W@=D6<_sI4!u@ z%~_dGaZFuRY>8)kLUPz7xT?uuKvZCy!@SshrnpWg9`9B`OGnmhI+BOGP+P@y05ldX zlGGx@#j_rg%!N2Zy>YehCz_k(s#hIV&IAm~tbK0Z=WPbeXx$(UdhRy&pFa%Mo+0uI z6m71wn>t$ka?H6Bx%e05cLoPWbFgzupGYVmSt`xUerAK^@sBVsU#G>CjYQJ46J}D& zX=8)t$PWk~-V3<{0z;n=YsDb#nzZNHpaH!~redl|_#@A$3)6rJ(t{`UGj5Gj>dX@> zRhQ?RVDynykiM198Te4kaCBXd60xup?Ec`P}gL6#TyyWB4wxnQ5%;1dNM`;4|zL?h5Gbr1{7F3qYC#`>} zswp|`eDpmzRLM8ir>qS&h4Q-b2eM*hpnlquH%9Un5Taw;I^rdI{>&QSW_`Z*C&(oXxs8Ae@5xZrpB)^adJ(5 zC+y>4J)EPxtB(Q1RkeylNLLXS?Yd0Jw_oo~$VhBtl&b3L(n;o(Qj8~-`8~jH)=+>4 z7w^jPatMntZEVS-Z|X_IKU-^znsX^6R)IZZvvoPrLSW_(ar;UH7Y>p4XM}P}!<~)L z5)ovIdnJ{n17mv&WU$pEJg)N#N$Dozw(cKN4|AKsgCW)EY3YiR-rpK56Z%w`4FbUA zWWg!hDtJKnu`rJ_C*^yWBt3Z?w36K)2)QeU6G`LYqipn^Fy2SFxMC4@67m(zSss84JS0S9**wh$5q(A8>vEvy8;lO~oEczJq$CUWC z>-}{)!V^k7*=}w|73+eic2UGp?VN!7k|}V|0};qL$Urci^q>oOZ$EPFYcX**1X?OM z4!nh2`QyS@Pe<#i1;4;Rrq`oOo3c&jE!k-@VQMIX{4ugORxDO@lXa5*%Ak>sQaDnp76PFOpPiH=;3vY7Q~17hS1SgOug3oaH5| ziW5uPKIWZs;YDpdl6)q_2scKxk+D+uC$_!06Aac7GzMwcZMTl zPrbgBT)8NU;pK$z!~|Iz(W=V775~Wsd`%Z=x@rt1W)HpH$JYtyQ{r3g#*%dRF0OJ_ zUiRz`TWU)p^J-f!LquVh#+Q(|p8QlCTY z!X5x_q7bAT{B89|@-nSRB_;3Kx>Z?Y1$`8Yj$3T-u~=4YVQ(M>{RC-pjrT&ne^rR< zWx!O1efW>@AH+Jdf`e_*8F$o);e!_>Iwi!H%!0dFlGwqsu!pJX)%K|)cq!xM5C5Q2 zo)HbQv-PJl$Ka>QSc_6IRY4v>LhD$QAR0TD08?#;4ji|eGSeAI-d$Z$P+6%HfLU^q z!ROeArcd!NMF>;_1Jqt0hFt7=t}tVx;#4o`(guT@{@n;mH_tCw2=z7@fy4qd(7;6aEUgshve zlU=OX!Vhkm;w`tgjbm^3+$7|4m2;09k_J4?*KN!jN_Sm2o)t{uHVs$-m#7sULj6k@ zzlQCfzdS!%BbG6e z>Zs-4D?;$%Go>p=heN_kHAy5~ELeGWra?sP@O621g+Dpu4eVKOu@O)scj{n|Ues~X zVYd*pq-Amt13)Wt<>MQ&`ahXht1-nzh%QUIDdcCzZS+ET16IVo5Aj7&Z_XG0NKWju zBO#&yxA|Kw9&x)O0 zq{_5IZiu3jkydPN|3eD9PMBp-5WnEk$)C~D(;8gkN5JFL9y{cb_BEMHC9d)veW*fq z#EiU5lIqSl>4a*#w*1)JiYO1aGJZuVzgOfaT9 z-H3G+k=&3stD1Vo#`V7VA$t=@_N+fK(lcKE; z&`tr)_xMv^ZX<=OM49<@!#kx&3^|F2H4H{V)9;?Xnn_XQn)~V^PEt0lno^DzJQHlz zSdma*^!bBS)sukvYl`{oV?-;rR=LFw=3hp%C(R}KNa3p6GeG3u6ww`kd2d@I$5jfG zL*%Q^5rn3A_D{5fHX@*oq~wkGw4nQ#qC1Oy0QX z?QR`ba8L@#e&#He0q*y7R^rapD?%3<4-N}>qIk&AY zlA=3guKEWnZngS~?~s$-i|1hBYX$QxN3s{mIahCpv-gKYc*0Q@D_+rs0<~oKNYY^0 z8~mpQvLff;{x%t0Nbx_vv6GpE4 z4uGO=c~kbo?cHemdV=F&HU0TMWsh1OsTjxrOj+1UaZuQpG&)o<@HOWiK<0KjfrLn8 z5c>SbtW5Fe>Sco8iSg-M{G_53p7q}OkH>_UEkhSWG`)@2Z_|W?WSkUO)I}VRRhXHz z`>6Vn!8KntFOgInUI`EmUE>#W2}u^i!fdh+mD9Hi`z17tFi$HFK!7$7Ru*oaA$#hn zf-(CBpps6vO?1t&*QlzT2)-*iEGP)ccDWPqk(MIfak6rAf%gXIKA#9qb;kZQ47{}# zY)!*>H(f6Dxkkov*-RsmSp9_d8L9Hzp`WNT*cfT7B^f*f^QrMmD-ETH{QFfbka!E)`hPoc>8GJ%w zr@JKm7!o0Azm$xJGpBu1+)|JgZJ)>pI#kPLTXyc_XNB_Bgak1Ji&2Sfil#ZUdR`tZ zX;~s8k|KGi14B4B!mLzh0Q7^t^Y(tBT{sjx+1S29BqbgJzo;wUZT-Cg1Igo-UkNpJ`s<`aBh8$A^-p0XJK}@wT0zl| zQDcLrNvHY#&%CZzJ%xDu1ab(1N*gry7*%)_;Ui zjPCYYeEN<}4SO`eneCYdE1C>|&Kh6g^&|GP2y_wr)*}3XnP-40vv&RCd0`4UxJYbf z_yxAOX1_v;8};(^Amz}ox9JQoR|_?c%`fancVk+JlnKR9x?F&T^0?8iprEbWoX8*Lm{qT69oUVu$-jFh*l&1RL= zh76@Ox6Uq%!Sz=_o*^(Q;N!q`mvS?`xgPqergZ((2|Ijh zc=+nzKEqi;Hh)(1R}~~I*Z~DoboSC0Pg83{=@&Y>oF1RwwEwm+hZkX$y(t_zBFrzG z4=H)o;jnvMwumu~`}%PUlgxdO=C4G2p)bYDU5!q_t>`93T>$5Sc1(Nd6He9oP9HE? zDvt1xO7u1na9(O60}W+CZ$T#FF@#K4NieqlMuURMU%vT)9%}<0aNXj85tf!@7!aL= zfunU@5iDHj`Yq)aW^<=0VFWk<6cL`gR6LB}c(I9D&wVoIQ})i}XShAsHB8OJzCTuPKFnip9{zOn-6knPL5dwg&KmSL`+?6;TLdzJ*zU#p)m?|8Zgt%c(}qW z54knFn=iI)nCG+=BwgB3tTa2?ckgnxAT@aXUc7WqN;m<#@l zLTBkZ6=+uU&|n103}I4PpeCYEw#}6tC$r0NP1{L**$KT@Vt$X7Fso}!yNp=$> z6%ASw1~%W%{X)PzS3UQCtMM!fP7c?xC+EzfDWKDI5i@%89{3Y-^1wb4hAc-ga!fMJ!b7HLQ-yg7^(Rs2{K}^8QWmb`Rs)Jaw5yK z3IwHn9G1yIR_4C;bgHcMzl6vuUI>T;oY8gHv8BFKj?B)3EdyJ3XGd_YUr~lreRFGV zrN61ajBgeeQ^$l0H)duuK&x-=D_iB8P=~h{dA?<=9eceWHnA?jX+ms8n4AwNHIO0S zb*p~d^OvYs8}>!j0|~7|J9=I?u|q|Cj+LHQ3V?`=ehIi}B9fXlilkVCZ2~VP>uo(@ zD-T_HGmGm88N8TGS|Z0mhn~kNaQ!0$c$3}{;q1X+D3*^sGAXIkb3dbbZ-<4N+5|~z z{`F-|auL7I)z$$Hc2t%kz4vYzvR|vr592-Wzf=GE`77h=AkSdh46T&q3m%*B{7G>b zmq+D$JLl_Ujft3cH5ov^3vwmvFW5!oOTGPLc?pnB;%$5{v;C=7le>U~=v@6qI5q#< zOsf0VnMZc4d0-T;N;}2h?NBVs{&24Xd?)pvLML3)HvEPVTi-ad@I;s=0>(b`)$ai; zJ*{k|*`e213w&O!IjNTh#zDv+p_RTM47ZTlfK1`dWaJyt+K;mlSCemTDMYWj(yLd1 z>Gf229fF?chg*=RIb`9=8;IRD_Z^(@b=pB?mLt%^;A|-M3ZqY$J;V^6eB5o9{}ECJ zQXqRdATald|7nD|dT@&8HQ+^mL%=b$P=Sg=LbOXgn-fz)6brQVd;k2`JErgxmQV)^ z{F~)dyo3D!fwCxvDUiBC=!s9*0i~~&Py4o4Kg5H?^ivz-@qHn$Q2<@?)L>`RaDD2S zGC-mrf9E)d{Jqg|Cj+WJVou?0=Uj#yN1#9La!lf!dE4+~8m%8k0AvYI5hEByY* ztK;{RW=eM=?RIhMVn-fI_#;h_!&`WW2t{~YdQDFHRA@p>ZWm0LQ;4LYuz-d=ds$^% zedE{Lt{4I;-d^lwKpuDepQJ8G-=eRK#qMD2o|Z*>Lg~|wVA7AB0j@{jsN9npPwiJk z4D7Z}CnvUTn;qM>eKU1yre^Njt$Em0r)od!vvJnh^}>wf5r32@axCZuGR6*1=F2z;ZAlu|BRA zx~Q)FyRL`ih%tirtl331SmijcsFw;t#gLHqhx$B*sh|Rui7~0wZ9@*BjWoEF5QXJ= z206nZ_%FE5hjaENzFQ04ZdzbWBTw7ZKlBI=-Mk?~JYqH_(N!l26tSQ=TjMRBMYvaQ z{eA~+K#Rcxq)Y%^_-0Wdpav)<-!zkbX|wZz1VcX0>_1EL#2dt!i@}SBnRG92oW~XG zP}J>Nt58%t@FiGE?ZjEiKti>KDV?kuxCO@C@gp1-M$b9@HB^*qL!zQNSL5Ep1=SjLhiKevkYw6#3$sF=rAguhqg30CS&_~M9P@M6)#E;t6v+ta0>tQ44eRV2kCm}2k9uEt%Y;w+P zaUBKG1wX`uvG#S1oh4S;KaRqnKvAJyE%zm2Fjl3M`!{{a{x|o)xqeShM-n|XWR^#k zrJ3>7HZEm3Dyo-j;vF_v0sIWXf&c=oB_vlc-pz*u@TAl~tj}63Lh4Y!V35QfQ+@|_ zwMOV4t{T?|0{VV9KF;h2#R-ba^D{+Sdo8xQPUR1W1OjZ8U3 z#&jJsl$CxL?gb%Tsa~q)K1ketb_1nKT&5D~H7nu0o(o9sxwhhLS(uiVLur`_TCl^r zsW^4D-Mh zl74D$Jf0bLI6va*T|QyCpzLYs4`SXcz&#kqkiJpa24>32qE6FrXkC!jhlL}PEW%)? z!ki_TZg=fn-rP`Pk68hy%>cWrYw5cBB{R^WVHChZ&kBL+?Z0f4&FG(c2txF6WReKa+McCiA?l`j1 zpjGZTQ|19#4hd;^M|;)&i|Zmil+h$0RaHHS*?&LtW2^iLlu?vH{NCWQq?K|xJlsmC zg%M5#`yl)GC`fklwoj|9Pkfv+`h@D3&CYKMAU!X+RbTRo;L)!#`>6zOK?m~%YWF?yI>pP4BbhI z+V57|UsxTwzDTrbT(mm;VPt~ePIFR66*6&78b=b74t4}R2uQXRX~}P$VMr#w+<|A= za{kUj?(JEem$kIy7}S`8^P%|j z*N{|7IL8*C)8u4vw&CPXmV#zfTOWLc+&%r7jGaO!N1(FdF7 z51yMDS(UhRJZqmmjETU=(-^SN!}*$5Q+*tk@i@ou@ok4cN&8xIv!j1r4_>twhK(w& zZAGjgWDNM?HcmmQQ&9U`&Ry=kkJDjcq1F1Z+5Q(`RAgy{4Iz!-BHUE4>Y|luDuLZh zXvu#Nvn;GOTms!nOI!*aI$Tf51skwWbr!uq72j-BrwQpMk&>0AfT-B$OEOpIl-C;H z9~YamKHwmut##9j(MIQ0?L#4!jA^z%YAHb7Fk0N%#wQYOccI}Ta z#Ut!9gBVxS9r}7pv6{#`Shwb%e6%Uw>DOEo8yyq6pcgAwhDaI|5I!drRvJs`TjgVU za%Q~KM&P7;H@iJIB74tHJBP&E#+q5&aD3C+pq1#oujHi%AykWmn=}+omxajvopoHE z)y6@ArG$tm3U$xJzi(Ft@Lv;Ejz(MM2&3YS_Ozj}IM>n4QTH8Kd`A@~LjiE3<#|Z_HWf+RB0@-)`#zwmyG9Nx!}6a#%)5$NX#O7`+^Di#;vz1B+tg z=eGqdJG-!%a6N@lw~l|fg?l=GjTm@) z#jZW$<}BnFf8X&L``|Ih(G`P%(yz5|n_tut^R(>WXJr$Ze}zB%PbpU>e&@;&CD~DI zr|{*boLasEF3X_*3Z96JA_2AoD2xUwA)fq94?AOSp~Lf35hA8}L%h=}boZVwGI;vI z6$Py%T=H|_w<(#Rx;lULa`#XLg>_`)<=>*VoVx9=P{25B7oSM%V)wNBvq+%?D9Mxe z&8ef6ylLeh41NAs)&M>kT<)Glc#_`*-pJTqO) zUmTG!?@@^=lMXl#d*H7#lS0^ zdyWSoe!VMc#bOl0FS4{TB8!ego;_%RkxXDMMoDX|Vu~Ae)i(3i!KLgUG`kTomZcM{ z!kEECw4XKMD+D5!)e$a*E-EzSa$Cn$z_`Ae4BGiQ@-o%jP-x#Bf*XMmaPL*DddUa= zi{BqNzid!5-tkEn$Ah%U;Ip6_aLQdU1{#c&r6&QU+igDqjAhF{`QyZboVV2&A%#A9 z(|zu>75n$glcAcK4Eh8^;>#7Rhbl6ati|bgKC+F2l2wZ~-RyO~YclwU%NC}SV3W!2QxU^1ytrj|aSi#y{34!2A?BmIbP3UTyI=|3_WJICPc|IF zDr6xu_}cXE2{x=VLJyU}B5znPVE)3p{Jv-gn`8CJ3WUrI zuP%eEcIAJ3Wl(Z_0{JZ=k#jltiApYqoL`vwSRnh;42PPg1cnlO-Bt5y=Zf8*=a z<@kQwB*fioTa7Dl2yd!9;>se)j*jRfwc$~2RO`N0M|MTTV!htALr`d!nz*0u+7b;84=dKvM))~gm}r>8!VE-kIv>y?X+0-n zJBjrcRJ_#C64XcJ?;4T2(FpCK{;Wxif$`;0#PkE@JVj%R6W?n&p8Bf>J$QwIexGqV z;L998sg`c*g=DrSRt{x@N|xt|rU~WZea)j)nw$aoA=) zAuF;SJnerxNV3RqRFiRSNt^fc!{brqGx>tW3qr{8?Z4EMC6=6?p7xQn)y6>cm3Yh@ z#T~_qLTD00rj2ttcmAm@z;rdh!SlztDrGEKAQ^2Yuvl&;39TGAZ9D@ye&poO!V=;P zBgOZP|K%f(+)bR3-@fTeWyQ-VfaF#B8^#1W-jJeTZKO}-7)oYUx^g0viz$S&EXYa* zHq6P~RZol!tikYH<8{eez*$gyVa@YBVx6gGt@m!wa8^9=lOH5H7&a8c?l9nEdvUUq zx%>>!eE=p+fl*)0nN<2$^y`a2o#{|z_JNAJrE6NND=-c$3KW5zk%_ZE%w?+30+dPD zE#2IOH%|tdq(4KxumZ}VS61dSV~%f42zOu?Bx?1 z-G7Yhy_?tR?xP;R3OA5a0lLi~0QP0ZrXJ^h-7~yxr z^*^npqEO=1;3&vgX2yKw#6)TB_OLN-B(wPh`ltgmvzw(XpOxQOVoEDO5z;!4G`^u5 zg_PcVwyFxZ%}6=_ISVj_n42E*%deVbmz;+t3}s}3YYS7teH1p%4lkBQDQ!I~o;f~S zee8Wtn4Y45su9m8iJ*H){I&}LW&b+=H8^$^U-}1NLCz{(F2l)mvKKT{q<^-PwO>C9 zRb$a_K|w_YEToYnwqUCsTsWr^kb2gq*vy;hQ|4DII+%h1P;xrsl-q@Ilx=eEUXI8m z58;Um7A@t~7s_vdOlt|No`&i_4ml$*HXQCBZ$wqr+h<*66+cke8vm2b^PBA)`Q_^> z%~OA4y!->xbq2P6Ow2hQtAT!DnJ=(}GjA`O(%L#+Im3h^++LcRB2q^wa=qLz13SMd zKj`Yj)i-C#HTDHkLrrp&nBt6+0$wArjvZyflcsA^rPUlq(=-oZ<^k4`DLplECS77a zDI^t_Z)Ug=(R+O21V(Q6N)+i)cjxRpp&IGt-F}5aC<{k&_A@pkCh(eYvuPak}4H7Xen_QO<6k&zfvmN8f z)T6PS`04-PaYUzGpw;TkcG$Dl$1niKPB%%cnPDv6kd$ajG|DaHwg9HRK(`{Hb9#B7 zIC{}cubeY{;Z!=NaNCz9@Wq-^ds@63S%Y$SeEh^t>}8t?$>^swlV4 z?YI!BnM7~_apolD9jOX{MH8?vI&oE4o*!nl?2T@!z3TIU3e%5nh{Ge|Rw4YRM-|Eg z0rm1;#2cN9jlf+4!@ii#r zrv!ZMo?kzb3n4;|GS^oko^|Wne?m|&Zi-#j-N#b0u&V!7S*1$pc~sfR*cHEzo#UfU zNmY?dUI!VCg@Xlz6)UA4nUNbSRl`e9QhCo@Og zveuhyGmTeNaH-A3^Ks>XwoD5qq@@QFD{nTW`CfYxm>BcIG?1j9T#G=-l`yhk(=em_ z8W^26jb;WQPRZLoEL08FJMAMAPZ6#dOU67Z={ctY(3-OG7@gKj@J+=EaJ;-Dx0Iq9 z!D6&(8FA_W;hDfVHV!&Mq4U#QIb^C!>P~yM6vDFL8Ay2#6tAVQjqHxqR>%nf+2L<2 z|5TS37z+^da^;kr(V?sB5h?>Re5Ij;+5?>yXY zcD@`TQCG~c7|ZPkDQwFXi-0uc@YUds)a~J`m$cKfJty71pKLbNrN_w6x9{&K9ey*bSFa@Aq*LkefUr9dWsD9VV!wNQS-gTVz((a5Lm;Orb^s1q}% zC8OCJd$(puQRR9KQLTWYH2*ae-XIDMYmcfOdjOl9G-yl(Ey)Q@r6ixhHJQ2fo_@3v z9d3=B(h`&(h5ZfDa{rbqU2b#M%4lTr$d^#d&xYBDuh8xjK8|9RU0M!kZbn(|m)q!} zM<^K*Qx-<7qKL1(R;4?RxY+nQ5uuHN5w8_ZMzaI7eK7hYs4ehbnl64K)N%7eDmaii zT(2mMjd_=sXWa}j?6N#>%V+BiBIinGSEYSAq$%s`43(`lypS+c$ws#q;A&<3v=sbL zweN_h0uzF&je?V*$K)K1nYAF@xtuySL&L&JULz6*V6-$4W5#TWMt6z-U6RxOi(_Pq zrsB>!1iOXomI{yfMcK^`Pry5t0n9>!@0lRqNk@5(G+z2dqlSsBDXMeWO8C#;bP6seLIY~;w6jbPm5=Rm5Qdyiko=KkC zddTa2%-kPh%cs2$Gb{z5u3QQpdEMeNpxJfBJ*kH;_V z=7Qj_!Z?<3T39@Yf}bVDYj?5j6I)*{-g!IW^^toRx`tOc7{TKDhPaNPp`xZFr;;Zu zt%QDx1*I8*L$w(Y+&+!}@RyR=SY>Qft~XxXzywXNSodlx(Zfqz{C;jhb!yc=uGbO6 zt;wRaoL^z4H0t8DY~^-d(Fr_YSh^W?#31*TLn1kYR?)yaF@&Oml0iVMXY`1a&Yll%rF<|Fp)QlA+73br4mSZ!@ZfI4gxT522=0f2+86$0_ke zrnf30&)-WzLs77-PKK#aP;zN0)JTjR%9C;k#Dpp)eO)1Cmw_FO=+okXpnKptRb$Ct z3Jlhbb8AzGtlXSNXkwa+WndNiD3g-(1ZqY=sWN+!gUorEj=ZDCB#{{gTsE#Pp+LrDmBfXcT3(SVYC8kk6_D3x7E4 zUG}8p<3;StO`r3nsTDkoC$=X|vKpY2El%(-DQKG_D^Cbr7YAl{NUI-&=c~Qx>jfo! z(Y>6wkEzGG^qn%t%elFELCVBnBwHpOtJ|{yY;>`2V8Q?tN$DAK-!ssep7tz~-%Z&# zFh-YuS0zA!iN+ z$4Y|Qg>U6T39}q0p_zsBg6aXNr82k%S9l+u#|F_bkZmBSSi>L#AdcTa(P?#rizg)9 z#(B8IQ13eCP>F7IO>ZS!&3htg3G5hd@GV29*0Y6HfOvq z9~!f8)ycX!pP6!@!EH+R$p@1pQ;o{>mBlXb5GSka3hE{Xn#Pcmj19i-OK|Gy%UrfO z?M1_AX=X>4JTW>DlofUsWUjdjSbIP z*kD}6}TmMFn%KGqn^6Jkgr)-^H_N1LwBm2MPq#W?Svt7wFv1eFlgM&8d>6JnnN>yV+PWLlcwVesavVlLM@g$rldMO)EdR zy1VT{N51c{{)p;36zO7VAu(lb`S1jNIs4!2+qJfQU@25Z_H4-m%Atczy{=u&yh8Z| z-svN3bzVw-)K$cnma%}DfSBvtT9@NXnjf|*)N37mugGDLh-}7PtDWAs&((QVftA0i zT(7M+L0MJ1tj8x2JVAxAMnpeA;gih6?34afu;KX_a+wAuGqwOKU3OWfdp7A1h&<)7 zoo1`t8EDM6Ydar6%{=es4=4wn6=Nwr=g$?&@I$YD^~?U&5nNCmJYT}V6N3sIyTgxR z*DJPWPWJqCm(}Q`EXc{~kdu^HR3*KQzAqfJ49++gI3*6O%w&>T?k=_RXPxp@S+cbS6X#*3MPyw+_23v^xQwBc!Ycw;= z=KUHv+I%lZY`*|!ISFS@(d-cXa`0MONQq2#nQHx7Do2js(@&d^J;yLYAIv*djF zdpNV<(Qg1N6O$@6p`e3l}Od(zSuZIEGwyPvZLFqc7?xi@q_~vbz{1zx}@T z+K5BUh{O9J`ZZcjb2|jJZ=MbzQQNmm5Lr+(dCQ_igafH%2cAEN^&9WG1~jSZgP-5- zoC5KN*gzJdU)cJK*K~Ku9JUifsj>SShLL;JUm&!|MZ+F^h^faWLblbP5USzuApD)g zkbV0_iHGBg5PBJoGzjPGoff57U?+7hj%N&nd|`^u`9wU3G|;gA8=l3afAQy|rGFaG zsdrHS#)!QtxIp92_Yq{>{xIgeZcbc@o6a-z?hygX0|hBK^~2TJ6+he`4kGQ;!E4*4 z;NKBM?j3x`?C9)9AWQ_U4#+_!Ej-tUk-PrJrb@TBc04@NtD!?lDm-s-=!XL_>@)2y z<93rHgd)@u(82=gfjA9cUfr(i)MptjWtsC2=0Ip7fu-AD31z8QpYgmugl705h(b18gh1+OP^syOZ zT*+*)2a~nW{(%1qtG@tD;iL@v?m`6~>_6sMiogC-s`Qg&cU<_NA|;Oh$Fuam*}ZEb zix?^}>c0K#@*he1Ww)QDxafjj0?Ua1W^!VbK^8OB5=RsSdO&bmzvfB*=Z5zq2tiUx zW)znCzf!IL2;9F6{8-^Yf%U!}e@V4Q8UEa^USoC>rYwiWum8F#KezyLP>`UXBgXms zH(AuK$;Ci!Qs?OZ6iEGVPVE2xs<~Elw{`(yG`4=Q!DCdR9$tArjV^fn&Tsqqg=B}t ztN(ruzg#DR$EvUJ-LL7$sHs6J7QF|a!9alD-XSy_9k(LTW#e6+9o3=C#p-buI>g$; z5t61oXS~+PLq)ipFjAw9eL;g*tcare{?<9&2R)#x%|`Y z3W!O+g&Hsau=x=%gUvKT(834PUdysVF)}d+Nh~pHUAF4VS0)D*zud|y>_e4W7GOmT z1P!={2-nbf^7_j*6VlG>nv}g`;b4ydf`{;9*AIJnTdbxyhHhS1naP9k)yYI*9i=)b^o0+&N#GYC5l=K~ATZ$oZJdp^yF&3hVVP%dO6V zuuM{t2ZvOOOV30Isifa}BGC$gYWZKo^s602*-v}KBIo>(NZsFD2icaSi6h~*qB`ZI zyM9~JY7e$>##Rs%pK}$IV1z(9f*+>cYKM=YS771Z9YIHyu3e?f58qBpIHdw}N&I!r zwm2iQ90pEaRc1;Nw%IP&e^ci)F&?d%6mvXdKk4e_@`GnpRPhM!dF%L& ztF~#e)~KG-T$tFF4O7lE1x+EqgXa4U;rXbGYVZ+bn*Fr>{BGJ_{(L{)hS~jsag8S{ zugf_WPaW2g#~3`OP&wAn`F4lJ&il?f$3$>Hk#}WM+7P#P7J^%iNB;d)b92&JE5k4` zP=(9anTHZbLK*nep|M-l<837UeY%A5v0SrNFoP{78Vb`gB>wT?w!zNu>sZaqps2?g zM__}mpHIR6PtmPV>6VcE&4JU zmm3O{O36!Kf(KI}XA}$q`RFMjy${rR8tQH{P%gat*IvoLupX6`Us)7dxsGi~H}UR{m8KYIa08Rkh_@lm9M;YR3! zmpo%NxdH?IGrUuFQrBNuu;Dn$#V59Hf{SBasgInicY|qKX)n{~hoHZC3`(eWk(7U` zY%d+`f0RK)&`I-!B0^_V*H{&_MOuB%gwaSxph@%lqUSBtRS5I-IDJsk>NYY}m_SRS z71I0@?zi7Hr~Zhvj+=$LaISEnF%dEupDMn`yD3U)NK)QC7_gsrPp$%)H})i38lBH5 z(#x)@Y7#wXgQb+^k*8}`k>|6sh{y5y@zvIr!B`zwvucRd9{Q?+{q`&*CqWhCq1E7m z^_@L{>IuS+c%{84nh)!jfr_{7QI_D+8iIsLxsKi z#v`E(GAnk4{N2)o0Knx!Dt9AwXb6#x(K#H?;kv-s5Z~hrW88o`qBB z=)npja0>hxV^K|)R2W0n41Zg^r&V$v6_^zGhf1tM6s_+I5j(lCh6r6pGoQlo$-eLF zmGMPzxCY+w%KADL{rFzro}}Oa2iq9xmyDZo-dRyy2hMk^xQq)03`%_+(3&dDy8ok0 zIY`-t)6BqugcPiTcb$%FDilLVNEPeHlO6gIzmz=U-`5Q6oL;V_N z+^8#UeZN;Rf0lc%Zf^zl1~##xE?bBid`qIoZZ-`A4%n7>Y(sBb+`gKP6S&dxz*liM ziRImB|FEA1U;*oMa(sD|rX9QeKWp7icF@(ShUH@#g-&XKw0X6M*c=)IN(yvTOF;BU zTIdfMIrxCI|LN=3n8(GN8;u^+|cSVLdYJMlJ5=mS2|5X*q22>)P9!{cmxNS+E6)PKeJ4 zw+RST*2}wC6B(NydP2f?M4tb5R$A~FjX_U1@7UKJ5^L7KlNoR%%TrYeq1HEXYTjEI{Tdea17yc2tF%;>-x8Y6tzDjSt5J8!Td zhL~~p*wqW7hf5$x13gkIW*>%TKT<>7v%?ugCUN{}!T(PUbcrFkV4lH_>pCY(ozlk- zq4{5)<^Cefg6yfe@x00FSve-L+^lnR%)C_2PLNZ)rryWlnQ1*<-o_arBuD`zVFs`Q z&$~XKY|2c+UP|2vYVG4z6Dgyx+AGppxKIXGp~r@>t~IpM6BE5IrlB-jQqvRu6&2)& zaTCgk-A)yTfduaLFh=%ZCQoxc;TnjiC8uxTe5QNjtmI%f_;5DZiY()*ZvT12&jPo< zZ*;~#Gn_UPCG6!a+Qs5_&cmryKl#Ph)9&%R3&WN+4fXCe;JNpk zvN}_&8cm69kNSVae^9DRM)b0vv$F7a%UgX%8me^SY?Kvm;E*EP)$uIzZ*=fn6n$7+*R|-Fi1V!fy z*bv~P$WYd$jW#HY5vM2oa=?eWYHPZrQS1VQ zJQF&uu*H;CWt+^3vksC*0zkp>&5~|ES=PcuKv@)gqMl6tvc^OZ;qRzAa?GCwH$8kI zlemi-E0J3-EL>bOPv6W^uNIf(GhtyeO#77?8wi}+%n&FPaIExZW2P+NjH~vL3%;en zP;#RLS)$(Ag#tiS8- zCGmc-K>rzKU9w$~G)j$VD5Ais<2fz2>rL*+{%r+q(LMr+f42LO8ds!qMeb1_&LKT< znzK~bj;z`4k0O)&Q=T2OQ9`JRKJEU2^=oyU%0u_pTrr*>QKE0ZaZ4be`@6T?EnD5QVR3qt6L06;M?lrRb4L{ZRLTKbq6 zGeRQc=kbXqsE8u>(DZzB@{hp1 zeZzcD?}-oPEKYP&<-$cuDvlu82IhF*S`_LWt1}0Or@jK(6(~rV5;(hl)aK`}6AEZX zVuGoIZT=DQ_VDDq>~SZNk_9AtttF4F0uHu@skQ|{r|~EkW!OX>a{TIYEWu+4ae

-Zzz4lvXrz+1sNiwmATajtgBV{rqip!?9Y9dkZuN z@+FKGcD$9hiT#WH!@1}RbOIMq#TW#QL_jt&-Rg$v>l4(F?8I-aH27L$VxM2;Tje(k?>T* zWK2ugt^I2K{plRXthXIFG5y88!)y&-mna$_;WK7yR&RN~H$EePo$)FlH&{|%pB$)W zk5~;UlXRueVx7e2M}vMBs~)biKWk&G<7p~=^Jf*Gyw^={iZ&3>(#OMc6v1kAEC4xr zWEhXOQL2W?b z3LfXpn}$4M`i5HQGRCwJOdLTr=JGnCPJ;NjK@P;G@dr|cNkEzOE>NVrcJ#BwNa$IL zoG+i zY3#XL*$5^X1=tkA4=!FPC#P&4W3kwF55D8$oqCGg4vMNYb>>jy67AU|Z9Md!(9G|K%tPDS#DRuwe6~CFCr<8sgSskAV=q=G&Nx>fmCBK*7>|3$~6V)-4{4MB<8eUqFFHIS0n+&{Ynm?Qw!1=cL$e~)`1e?sq&|I~cW zC*Ma;!6g=dw13XX|Jr;6j3tbc#@}*hSyYrs%m4d2eRftC+*!pbok%1Nnmn(jE(J}Cc}o}!SW?wKb6Nn`}$T?LG}?t_<#K|w*rPpy(0L} zFnLY+f5_^>{@-J2US0xN#5Dod&;RfHV;@@!XuF9hDLLbD`PWa1~9+7xIUHZUBA~WoB+(*wBy+d)EHnvw@^%@>5e& zk>D#l>3?6b@@!9!jhQ(!fC{)+f9}$2r8caY8Jn9c2BicF<>4UI|9Vt-P+>l#p`r0O zs|3Q1i2d)~GJrM)0lz?4N5+3UGQ+3w9_f+&z7{JDdPJ&b)D74i!6FXalHWhxWA z3tqprRUr^rvA=Z0ewee>)YK&S)AoOKaGMX3f?H^}z@;Rxp?`VuKma!MFW=%>bZC%^mX}zH|Q9CdYKPIVvjcQqsetx9~XZV})FEeGMVPww!BNNqd6dyv%_OHE5d;0^prI(S5 zD;Cze)W6olUpITzU0q)jfo5d`{=Jw!nO_3fFLp)smmmg<{nx7&B8-i>Y$6?d|Py*jx1fb==qAKdNKb)Ct)0 zjp5(ukc_iR2v~LhG>7%C0rVfzdNCBDwlJ1G{r7RwPw+9gX&J^0ZppuF{Pn`crMkYp z{?9Xs|DH)p2gifr7qCvS|8?@lIJZ7k$bAGhvHv*!mVt>$9^mFC06{PzW8eEHINaQJ z^Fl1I%ijZ@y@3Bmks@rifpY<{$glGsMZ|r*y{dmD!|>_9j=I(dl5;yF2)KY)J^rsJ zR?rie7y;+)xUpaLm9a_!rW@XRY8`LH;p(h-&2DiTv;cbk@|=1e?q7e+>nf&Fq1>Fa|=U>i73G z_I~hPmHm>0v>x0O#J>ZAP?dxC_V&gAlCYQ+5t76GcTlZ)fP4D&PCbBohP{6W1&Oq5 z3qXW%qvzkpCg5WM&ogEqFNQe(J~W&9E0v(c1dQlc7=MXgEPu?bm5zw^coX2s{_p>2 z{VpZ>AJ{&{&t#n`W39k50FZ#ovkC#`wR-n`lV zx4>hG|4|;!qFwodh=>S`ycOXedue~z*6aY66&QUHY<|D}o8K=Vh`8R^7l2m(o4|G; z>q0RYkgk}2lZEHfpa+isH((rHVgEh*OS7TZKbmDLETEJFDS`=r=B|GO`=Ivv^=lwc zcrb4Nqxnhxo58R7MMccc&d#s(P$3Gae`VM2o6i4h?aSk#Y~Qy>iYHl~lx#^0$*zRR zma>c`kwIgvo+3i_G}eTWJ(M+!ZH5`L3}YF}k}XTd7ADJNpRrG9c<;%0zTZFI_x=6z z^ZEFrncIDz*Lj`iah}IOS;=F#-Ah0`44?G5Cm?Z`gFfy`-b zPJ4U%WW!&eZ)fPky8_%GuIur`ey)acdL=4(3seAaZw#Oy(?HzzDBV4|*YI2o9`qtt zG76ktCHJs}6?ljR@L>39x|NduJbnzErxpn$@;7??pOpkG)COh{7|lB`y4#*S1YQdC zarmi{>*OmSiqzZb(bcD06p2EkyMg38D|~S6BS1h+1BL=U_Xn*(@N`;L-~^%}?+D#v zP$1nKJPv%SN4pw(FdN0d|8qs)a5lg^o_;R<_g}NXD`zmMOCX&q2Y(DeTOV*FO8?+s zzFmfoR**XFydBfzBOtJB$NZnuUO+q@K>Xl`fz|V!O<_Os8uw0rue-^Tof5wHo8n}q zq1CJr>E+X6=)0WJBZ?Pxhcikg<|-K8sUD1B>AhVB@4#j6=`Y8*xVde5{Toq(>rZ#| z9PFv@t>=FiXF2XZN8Aih#$TSFdC#l29#ngs_Ul1`G`DA9en&Vk%Bbu^HmGkP!BDkO z*6ypmeas2J{Ebg>f!4lLkL1dCpLTv&()HZP==ZkXiK|~5i4g*Oqc08YxDkr43t;Sv zr_#YV!N9`i0Rn;G;(44_#6fT1XtW`^b~VD<=@vM2|36e?fdJNMyrkJC9-LBF7IYK*-=TJ}} z?L{X+6s=>kyK6COMoU@w>ub+sAVl8Em6072*QuLWJgFS0m|%M3y*mZ8*xBl5KPZep zzeynk;7p6mFE0;sSfrZpztHWj6f7zE)RB5W^;|a_2V$}%%%f{E(KMOyEST=&Z|#og zx;!97Xi(OyU~LLKv3$m`+rny~YDhMza567!x_aV<pd%zs)(+rCSCbKDg> z9BQ}cGu9q|#ixrq_qK0&6!?@jpCxeY4EgtKq@e1rqy;E8Fp4sGe zF7i}+oq<|4T0T6HL57aTw(W|3S=x~cB<$pZ9twLe=A`O}m{X$(O^6mW(PT&c&LFIm z9I;vOVy1Ot$cYP#VpYFF&zZb5M;zr`McPwfpC4u<{YBGOpuE+Ld=^5S(w-{$LV3OX z42O!J=AgppPB&H!Ez|~K&`AnE>>+Cm5u(i~NXu`vS=!3z8l`YS4IV7GeS0LtJ>KKn z>LI_WXvx*FHHhNRN6|amAMN(Ef~LAInlLpu(EV4wYKR*v#+vy})srHdGy4?CzWuKv z;*k=2w^h6egP!gKo>TRe>tQjoQDv5AlXhtdVhlT7eqsXYi zaXVwk&+U~R$Mr35e_zYNtL3|IV%ZPa0x0SFsJltPShC%zNR- zsFW$}&xNpzzDz^G%Z2Abh4eru=|_rKKwz_lu2yRc9D8A4y!p%t@}+MB*#@D5f@GD; zBm$fI3wrZqj@azEtK^y0y1Y%UozZiXs%dG8C|V=pQ#Tsqazh6P&%DsZEo}#fb1~@9 z>p|cne@_Yc$W0h48eKb=BbEtg*5KKY_V&F&?(_}Is;J}MG2y?myThPkxIasvj{Y+v zIeOG&*5bO)MsNY7%0;t(>N?*DuZ~;i`pC}kLHD|Tk{5En5>hO=K(h3xl34k~&)~OH z!Ss1Sux=}%{heZKQ$(M38$`izp{pfRyR~dKukidO#Eg#1oW}+gqX6~WbmFM=KOx9knF>p!2QnM=9iq-CR6nZ6yAF^el<8!;* z8AW^hG2qGi9i-}aA!RcQajqV{OHKi8O%9-UA@uITnC4V}zu%CXj^Zx9I?-G2FPgm_ zKO^d^u3%?nXTLOFNxf*s*uYAU^S3W5KM&n!GLwd8b&suIPC$YK${u(2x1yyz>++P$t__IYP0(yTo)o@MI z4pP#VI4f(P@(yw`!A8=l@GbhTaRU;;gh5dKx2QEHShVuFTG`-UDQw-6^xW@eRrg4S zSd)W+U4GF%3s{+$SlZt+^6R#IatG3Oy{-{e`JuLygt?t5_HgW(oOQLBFCUU3IeIGI zeat~o2+U684(%T~7xLW#{*jYQlh7?53my4veD-6$wCUXt!-+rzsKwP$eyF=aPYXk?}wGVX<9GtwuTV3EV60_|COt z9O-ul9)AUJ(|v)_{GdC|zfZdjHYu&kU&3jMnRBuI5_>=7|D5#W9e^9SgTC)@3*bGG@0iCn575Fta2 zg6BTf$D*k69z6^R2dOUnCK`jXv{k5o^1Eslc=5Bu3-e$hE|*yCtS`@zLT%?LIcEwh zfn&?{3?lel1^(*dR2*{v7E$-|cKTZTtE`4B}XJ4w}DCZ0NqPK19*k$!d^C zAXPFM^8uRi;9)W!n{>=ZhKxCDpoi@OnM}rD|Du((hJFmtf0%9=;+_wCW>%r}J-w-Q za~p>pA2XbI1Oo9N1K+w~Vu>)W_|2u6M-abft>$;jWrsw}Ovl)6DyI+kzkL}2Y8rZ4 z*(&52v%x1BmYRq-|K}jcZ>cNC2VFgSqV&w`BdUUhrcEmXR$sZtm%9a(vSTxj&GfrZ zq@C)_uyfM{#UBto&K7OU)*V)*obzF_mi2oQeq9-t^%U2VkZYqvj-YD;-wo86^*NRI zk6(`E6i{h7gth#32wT`_AK2y&Bv0^u@__!88qNy4ar0dN**{x0pNIU+6d(v|F-{O? zh?O`@bi)L4Rc-f@6J2P4t zjyDJ$kh-IvFQAwVVRBLuHX(XaW{X6~v!Rp^wJ6;!r73jy-i~>wwPVI-m6lI>*qOk# zM@jf2G{=MTn5QnF+DIRcAuEPOyGiM8F{T=JsZb#z$8YKfJ_w>XR97m#6(`FZVm&ZX zrX0ZjE@GBWe_jEe6;caEl^IBi-5D>qZ(&~VWF2xc-aFOsK6u_faiBQq!jDAcClMQi z@*UKt{AUgPOHGlUU2I-GAq(O}#7aB=!T^$Y9I0?z!0ru`2Q3tj(kqGZ&#!3@FI`i@ z59TD@T>{s*{8G=+SS=LeOMwi8g%v&fLM_m~tw{9gmkfjd@Xus1RXi`K0K;Pkq;WVX z=`p&UlKh2C5H`H86U7`#5-z+Uwz5McEX9>&NfqXx_aSX~Em?$|2hyjLNgdvthbW*x z=#HoeEO@t*DcUx8u>#3t1(^Y^8**}05aZK3u*GfwPjyKZn(?RG#d(OUpL`XCL`4j9 zB&&^K-zof1ZDs+PYC4HD&bx-}>A}`HwY)4?iG1}`a_NFcee>azX>oC*I53xGAvGP> zn>u623*C{bDJAf#zc`?Zoy@BwnQ~{B9ld#Z9xW^2h&;DvMHOow_)^owtfqMU{9uu3 zJ~;u-i8I&zpFDTEH=cgc^w8PiYt6uEkRVX(m0WQbx!TRG&&(AQDU{p4GNLyuAW$PI zGpA|t*RGn-%%3R<`G-QL$0{v2^u+wGQV%KRJj4msZcBBg$_>(DE}@~wIa?jgm~2Iv`-JPqCHbB^!j+4=L&@~`oDl=G4NEn9F=zZ+fjWHH_EKus<~um4 z)H;Xw>`m1l)@nRI4sm2HhV7QD#CnX~<;O)~<>CeV59;F(mu@5YDY;hBH|3mf0GS&Kc3 zYYjMXQ~tF6=+u7q5GX8fxn}LRJP-6Edz0v0O@R2wm1eK6Sne=Tr#c8%YU?L2PTdy? zT&D}OC7sW)v%5RyI(uu)dyWs}=CT0Bl<7Q@SFgv-TD)i9r~*)mrfCG|9bNUZeeWsm zj2A(>15W7A{5`U&hYshu=MuaZfLziaTHaoHl?LiNv7eC*##{=j@Hg+>0b|--GVV-G z1Yb1$Cw)V0>pFFHmJEEl$R^lZQ|5A|6zH$%^IFn>U6yc}Bvk?nSiD@wxA2r>U=C*; z(7U`%bm#u2!mNM%pzVc>{)%Neg}zd|Tf7^IE#AFY2jw{GsD9f!lZL7P zMHJv69MfZ20njytDQwtf2ai4*Fx(JFw2+`lA4Q;-o)s zsn&ecfY@oFN?O?6N))NsW)?IXL#m!Yq`Wg5f7)y3Uw@ObJCviA_LQHpVN+eKLHd2& zpnx?H{}j-Esixe23Sh&XR+!%HFF5tM2X@2HHr?$oCCf0IP!5ls%-F!VDAjM2Bxgqe+@YEW3s1=CRkepo@M5PM5x z=c~QTj(^>+mJY<;+A)^Qg_Iuu@6OaW_0QHs5=;dCO{2V8jvX~LdC$kjcoPd~Bv_bc zY5OXv-_OTUq*w%|ZO-EOvj-^#JNXVYe8$}LL$?i4>O01~{7HxJpW?q^p+d5Ma7 zzVzuLgZT`A*UX~0nxTpWRN}FZi8W^}#BEkM_o}F^~+eDc*-t}hzP5bz)(%SEu zcNeF&h4rWW6ik2`?q(zVpLMG(;4ZJ&<~sfJiH zgWLwh9;Dv;l7(dJVwcfUO+ebf0AkLm`%QnaU#9Sn169`FZvLM0LF(~x!&gu|spQ&y=PKyKcRJZ|?TA2cATzYcw`)|m9WX8J4cF8SUH3Ql4>OQnN@%xxDdY(eIk zt;FaJuZ7ua1lRo7h;@;*x2AFz8f@ zj=F+4MDtJKioN}~>zydTL`;(zKq>b<|0ER9t$NU*P==O@^Fket&9DcU{oALH1#nCc?!Z21CJn3PBU}f`2hCn+4|uwK^Ox zaS4sol}z<+!;PNYWj{TS|U{>nMXmvl1QYYt1i6&?B^-0PNxpHA_Ld?b^j8r3WdEfGN z&2q)WwH8?T7yNa9S&yf*S1C;?^*Pk`qN+=Lxge{eLgbbqvJBkaNe5&8{WZ>_)~J5) zPP&sr+}&J9CPwkrZ3DNC{5&I+YmsPTS+(4%i}51(uPJ~O=7#3IB8XQJL@3Z0-F9CD ze{ry6i8esbJ?m~7n>$I;2sE2X;?zLil{QR3Q$YCfS47w+k(r;xz0YpPpLSE5k8_~B z`At5me|JAfWkin-jMzgWoC8rm>5mTpsN?7EKGHC_ zy_NC$Fl=IbX|?@C_0RilgQqD5ljMrel7ysR4dU>ZVbs-D&v-VTDgXKPC$Qq|Os9B0 z4Oa>>9xdU9v+|K#1p`(Onsi9!E7y3pr=K{w2$d&C^jCbpV7Ca<@@MeL!F@+{#e08W zE*&VvnWd%S#UxqVYA&lbiO099y~u~sn(#-$p94;SCpJ$N$^^)m-@RkN=A3v^Pm|*X z+>cqCr!nf)6H-{tn46pZhEl#p1@UO(KkzAMcun*NTKjq;xb+Lg({V;;FQegV%WH93 zsOU39Z(NUxsc(6io~F$8rLd3rf>HQ|ZqW+Oq?3?eM8Q$3tq^0!(Nm1+kY-^wr10wF zXp8GqQX|ro>(<`MfkwY`)q>-^b&rFUL+WS!flghAB+y%x_Z;{)(P1g}tvL8LaVC0I zMXSz6qG1G{t{86uXG=|At!O6AytVUQzm6sdc{`2$m3n;|wc=}`;7g+t>-#Kr1`dqzEiletE1 zR2N}75pNLNIo`ADg>DaXeQUhg4?j5?WaaT2bCt9ufOidbE_nVBj)+QR_kn%6 zWVdB_iXSnQI0kpmg(*z~YE72+ z+vu9(s)AlTH%(}I$IW@#*rv`L8EkFQzhD)TTQfCP4G`jsi9&C(wOXv}obEq)b;+fi zk3Z~H&;>G^z6+huU(5ltw6N1@wgs{z-NTz-VDH(hCeC+XjeLFhI%9X3-VjINRo$TuT%b{0NVbS}R1UNJP2W2f>48iXhd#@oB4z%U`O6-TLf%w~JR7 z#m%Za#1nm{!xsv~5kta;n$-_%nyY=x;EqmB2}V(4-EmU`16@&KgxPpAXCL`iH5)XP zH0zE}OI2}0y8eL8aBJOm#go!UN`?zpXI~@S-7A1C)UMqv?nsmGM7NNWK4;Qk=7z%s z1jl#heSYKPPCR5D=O6b|@UR>Z5O~Bks2~Q9)hKnH`I3*=bh-1rJ~nNklD)84NBEI3 z{)DR2C9jU&Uc{YGS)8TYR0PVEtzU45eQG-ZF?3;%9c{T%(HzsPrTsu*OGPZgOZ2BU z&by=~7h5Y%4d8ia`QL5vJ1r$Y#OTnwU%#*3)ztFfAB_5Y^Kh-3Q}2&=5+KWS|3zW} zS>g{&DXhydQ(}Wz35-`pq8AkZ;- zKLR?~mjc{Lg1-3h|8E|ETWQc+A5dTjy{QCl*!2-hvj)^4#J${Jp^4apnFxVt`Ik^R zP(^$#brisdT!$_3h-@;TQV&U~VDFLu$5{9>epgf=_kG=9j}nc29yNWYHUL|tA2qS9 zn>ZM%MfDYGerH@VzNSdiDc#uU z>tA|+3ms!khVn`x&SzQK#?&53olZ7Pw17L{)cEv6h{#LH-ibCDlf7ga%DxVpI6AwcbVDJLa&L|Ke)3dRipK03BBP|_`?Ph0yh(ul=$=l5sL zz$%Q}}gPH-#J1kEU=A>O0d+Mp^J# zTliecLiE%ecdwpA0k1GatOyrz4BQ%o{JQ$gv+GAiFf7_C=cK8ld(bM=p{|keH&H- z7YhIyLGs1kU*cv=^k9~+`$zeXh99zqR6H-gZ!r2ONX5YtBiE;x1SFkjl$aprSXgy-!gll>E0Fb~3|guve_vA?c=1X=Mu_s+-iG4pLc_51SslwqC=iBS*LXmu9B;Oym&@ z3twYBiw6|Qx}rPjm()k~1gN|VkFx%GXA_g=414a8Gi*z_kqREQvXx}@vq`Dac6zCw zR?=SpE)|u)&!?S(0RU5-V#3MR?&ajAMPUad*W&ouwI7^H14>XXF>xa!0Qosv+?j*R zI`BL|?S(n{`p(?3zA^f4*<6VOVN^=yLSoTHFt)c`;Ah{g+H>+;fEeB~m8JnN24~E@Rn#vB!dO32J zpKX#;>Bmb42Oic1rcV_>*L1ZtLsTSW0i(^>)`7nUXO!CZu^LrrIXOt>KE}yhZ|7&V zPKiA1R%%3O9AWx=vlVeDB>Q3gO7}ct?2EMh?B>Y~G=q!?1$_ek=sTan=3Hz|o|2nRV*?E6zAogaZHsMQLbv2(p9^qyVsFFr3cD=E0~K&f=-|Vc^VICPc-B#+Kz+y>s!)uY2q#{ul9FVbD_x8$7IA*Dp|ZE?%r0A7DY#G>ak{;_}+$Rdo7fz4szc5z>AKwLjdZp6j zTJq}Rf8Mew%W<@`m+9g6yh|TVieh17ppG{GJ9jn?JlXwx{hz0Ddv9FlL&J6H R@q4t}f;Dg7LTT8({6Bj3a6|wA diff --git a/sample-apps/list-manager/images/sample-listmanager.png b/sample-apps/list-manager/images/sample-listmanager.png index e21efebd3e52c6b3aaf24e396681e15005236252..1c9d85409a542d08be1cf911e34df0951c398d71 100644 GIT binary patch literal 124812 zcmdSBbyQVt_b$8v0TBdLlr9C?ASK<>p(0(<(%mgxN(%xK($a{4bc+Z`x1=B--AD?2 zbNin6jNkXiH^%qpIeQGBhp||Dt$WRT#&unDE?z4>levD4>>2`rxGpCvsf<8iv?CDc z30KkK$hL6t82k^%URKKqfw)7D`iCZ`Ot%9Ev7P1QrLY&VFod-r2&=7I6!Q_8uI+hB_``XYb)?VP@`(C?@C;fTQ^T zjyjqcqE4l8wy-fla32xiz;AF+zfrL>b#^m!G(qUvU!qRO{daK-CnIY^IMoqR-SRma z4qrtb)-ZImwXiiqw2=P}g=5(N`M!&zkqP3@W#IaMPm{2-u`#iAMjZAeG{Z40)M=^~ z&ekS~{H-Ad1cC-3Cn=`tp1LvP_L6Ay5V6B)W93OtC(1-in|Y6hGUw`@xh|DmE%(Db z1CP5rU-v|ntOLM3_MDpT2w+n*J#% z$;-`kEVb5YtM+Xc(vML5Ds2#r9Cnfiu`wG z%o%%{^uO~uy-5`A{rjaePSGe+x8noeZ~yD`%qJt`pq zq)3*?x?6deu}GQ+(@`z`-_StOCt zHC*r13sjlnALk8o|G&Q?$KJ~x!I`FBH2S=xYW1sR@uUCmM_v?($h+|$%TfP#J+%b? zUBGnce;@1rrv?8{y4;V$ErhtQ5>{YlRaHW+MOc=&goKNLuGi5&t8bZKx=+3+v!1D| z%*_p1sG$<}JXjwuZS)EnaA64h^(7crqg1bC)N<4HY`WHIyZO>**$z|eN2S$xt<$n* zLgee$qyo;!HulXQQwfwp?(BksDY>grl!8%Y+>eV!tK6c&%QAVEPTVIgD{X%^osSf# zgk{mu(LGJ&D_iofj(&9EzWb}4xqEW+@axyF@eeelWn{b>G_KAl8f)>8MgIBoN2q_w znx|-V?R1LT=XgGncQ(dEi>Q5IU|^{`k${9fqp@zXe5T&*(Vr0&I2+|XXS*HL3hxCf z8wG>m?v;%F9m5tD7HrLb9bH_w5$;}I*qE4+6#RRR3nq;BKZB6Z7_0Ffj+YW(Ecfcv7@~yvsr&VBHBOa|v9Z$8RJ{(VQ!*0yjfzC{ayL)(V(NQcSHDeEm{r@(eBW=#LNmQx>8D-2{!!Oafa`@;uw~H{|?KNRT{w{ z5Mp=VF{n~kIv5HKx5Cce28CAh_BKj+tFjP8eX>;AO& z(ah#hq|H=S5CzA!T4CcBR4EZ0#~oU`Y9 z{P-~vW%68$@OH<)$Ga^pqDn-K4Gpl5Wb!AL-{j}?o03u<-?n-xno=+! zDM?FNc?g_iw$ZDjql0%%TTgGc&Sf28aJ(~*gM-7;pI4lpk7Q+KWn)v2lPf4K-G(iH z@!~~C6s3`oQA+P&l_qm=aBwW$s&n1Sih1l4BaWo?HJ zx|;Wqk=nK1`_I~FI58Xe1y4#zW~Nw)`q}aE0GF^qi{H4uuP_r6)1yb1^P$u{DZS;) zaWxbO^W-seE+Q$M0762-Pu3IV(hl}2GSO7tyY0k9g@t@kUPm)-+jZ+7&(Dt7bn6a| zcNgHRw$v_1LRWxc@ruov_n?H)2+j6AAW1lQIA`6+Dlk@j*%C4ZGz_tGU^2zC` zr<4*bfSWAxc}de|)l{1Muh*vO1S6xP=f?}t&42g82hHD_BsIuVoeNf%Jui`ylj}}k z!M%Fbe#Y%*llKFSk3Bs-L|0nPxgN(ZuCD{uxOeZ~cKvpf*H&$w(qHG_JxNKNX0a=q zqZ<0&bN<-sCC@AE=f4ydGS$zZ@+Vu<@m*Hdk4w?pP!ZS1N~S(rsCanPGI!sP>$0u3 z;v$PhCn6?3>bw^{?Xmnm(zXbE)U+=(DLq|b_`vsKKOGV?B*@eC(&pJptHc>w@HdSD zRRBpUdC%;cPJYMGO6VL3+t0Ohvo-7J>u)bC?88#%85p*~aofXgLww8uc;Rt%~eR>`fDRC{p|@`qpF4mL)Z(5v8KO! z-B3QIx2r#YK3Ir;G+SnbopfwfG0`b^xWAtQmjLfeb;8CJla-UxsxXy*z!q3sT#Q;d zerVfC@Lea`5le093Lq_TC)=a$uSOU^%b0B#`Qh~%+qFyAO?GW`M zEK5^E16E0Mb#YE(0|)0KLOT0-3E&XeX0L@vUP~)0sNq^;VEBZky1KglN0-yK)y*fr zQ&0>2-Jfn(F(JFr#~y(UQ&Ur;_C9z+C)Y2uA7QmpWz-SHJL{fZTpVFYvPY%H6#u*= zfv)RCnIci8?M&Us$jFB$i9BI=6!@Wo=5!^nS-$6g#sP0N&DiEyBpZ@Edh|$2$(m=% zuKE0a*e`7AmvaI})}w`L+l@zQPR>bL$eW$l0%*F+M=haT+YJv7C$j0!nm=tUEL=-6 zOPi>+OV=x92)^IBmGg~#LOQ{uVnRnvZK)xYRz|PNdLmKZ$AXn+3l3$0pTN zm|}b`Yab?-tW+j)S%kzO6Q!!ACVX+c@KG=<>jyw0F0wAh?>#*)4=2p}-wOh+ zmr|m;v+N-P6(N{dPqW5;erLXo+?xvk9g)=QtQyZhYvX!ey)Vkx@g#=1PRuFrJJN)` z(jZ_JL{1jNs;_*M;UU43&Q>Cl3T&m3Q_j8~Mg2&`>u{sEm^uEjRMRMUoNaX+<>mRd z@49o{lx=;ab%W(-;n7du=A~|$d-se^_Ld;sBNTOYb(NH8_AG~{LboysqX4qL>eGEc@jEqb+b$$W$X)9-D zoRK;-A^Fzb9ezb(c6PQzORtarjZ%qvsb*PLRaMo;k5MLCzP`RUpPE-bms0xs_ivTW z6oA#ktr@E_P0fVskR$mh)Qi-LMmg{n?D?8b*NR~G?$gur6EuOjpnyj$9C$WXSM#p2 z{3ZRWLi9no;CpwsMzQ8#g_*+mytbo{?8EYCk<6RY#a5qg&JM!8#6QgzrLK9n0N#}0tsb{?7UQ`cCW=BgO0bYyW46g zM-FI7=lAcEkZNsgN*;euCX)J~447zc&S3n_F=|_>egBrx$t|iIPS-d{gy3ab2yk-7 zMI1X)RKI8sgLG$>?mb2-^oCQxmfh###4N7MxbnGN6k7kjzrVl6%dm2QAy5J1!up^# z_aWn$Q^X%Xe9oM(-E?NV@uN()&e`F7Kr2BFMKvw=fA@NLczpQqfw}wi_&9%bEhGd> zj1ZDyclpxN(ssjsAHk!)gm>=zJ{^qt$*Nt&Oiv$tWf%<&jZ0qek$Qp&CkMx@*LEZ1 z$j^?+%={bx_b=-%s&aCSA=tFEv=-BXQtvw6Gvr8OzVie;QcsWSbsqR#uSraNyc8=& zSk}vzFJ<*)D)f<|ZS!!;zv6GGVzG(k>n*FNh?zA%IW9fk8~rr3nM1G`E|;J^zUnO0 z-+Xy-=Huf7E3?mz4oRJ-6m+$ot|@D1NL}FLkQ%b)iHjcX=*X+7afeudn#pH^P8+0H z5B%`dkxp*%lOaY|IeXGmU~I>LXj0>kO?%#zc^%nu7(U?PIXpl5nMh{=<+b_zkeu{M zcx0saMp*}Vn52?wf$HLf^8>~(WgQ*ns{z&3M?cDpAhTUSn6!rzo0*x#$$kL}I$iT- z`2=iMnNbQ0COViBxhB{#Qf>x#KgqhetI8$eSJ&*{xB3t*R5$r zxtrbP_v0*vbLHb06z-Sdx3NEb_z=hdCBNe$FafWFmH8fB5x1>r*sW@KR`A!QrAh$S zP@ujfDJkmdHTj%-MoL4h2sp2NG9S#+wyniP~QVu4tV$G^fo z8)uUmpDQbuTTgI=wq=f5Vv4x~tkZwFE4BA^t`(bFr|d;LWOh;XU9d|u^`oYV-RH4a z*yNNU-2y3Kz7zf|&x&V#@^)A0=5+1;TSk>{QIzC&?ntxVPFqIR3)o!6Sh_~N^puo( zC^#KdUd5|7%#&y9-AZR{$1N)*Lh(_E=1W_fin4M7vzD@oO7^HFr~zVPt-vNwNJ?4| zsQBhob)132mmr*@X{TuQq8X^*-{T*6q%rVP0h0zyZE0weJ$42#lY^793sKT#T({pR zXx5iXNWCXxM9RGVFDPaf! zw;30W;hqt&C^nTl4L5hZ(930yrnlS(p4% z*rs~suupJ1rk-ZcIO9X~HG_c+G1#<0mg?ytBpK*};F3GPdsBc7OAoO_oU*zR%EkUY zKTr3)I00XeiEzG8M+aQIFNw3mn4^sONh~j*)>&uA9Awzw;9zO)PcOZ1!dibjXHYP3~18N%*w0F0gpgHdJ=a;x!k7>T z0HJ*^FLIQ$64-QVK&MD;j*N(CINPdExh@0n_U5fya(6hAzIxQU5tEP{1CA32v_R|t z%;zu(Q!jD}k^ETC066`6?rXRb@LPVBbls!77L|w$<$_bl1Lhs?-jQe}aFg|dH1;e_ zX!WHoQ9GcjwB;_NQ&5sBln(I=X6AeD0>d`1G6H@Ijsir{UPPIu`dY8;hGeXAGQLf$ z+e3pEL@YaSY^$p32U-bQ3Esz$J|MiuKl=-A)!gIZ8MCbXlI}p;wcC|dzEF-jgB&7YQd9i{mB`MJ5dx#Z(M+{%+r`Hh$R+Rx7q5#gZ?BCf z#oh!^L~lB_>626Vfs&Y5rpbhk{H(Ap6of>N?~&vRR$R$)argNt@THVwpM6nL5UvDD zJ)EbYznzOI26B?bFrj4L@EcK;*c_DLu%FIFcHN`zS?(6UlR^r>YG4{|^X5d@I;^gX z9wI;^R}p67;^=Z4u2oaw*&wiRJvLqCuh7*!ax`t-6Y~A_^|iG3vnNmPReXn_(Onj~ zLquc@71Q7NW>rFbe0&|~5P;col;mPT7fNxBzLELVf|0QGQuq$Vcjg<6+81sRTjQeXsNwg?5d z^6GVhBvO8dUtgu&%;)FlL6qyOH}7|)LTPu6i|y@|k91R{mkj*8P1kI|A=ZU_)G6hHuM zUBR2PjrC5Y<>lpn|GqS{-6Do+4E3d+D%E7-`}fDo22B0?0W@5XQ$f8g9k1^rZeYqn zrU`jC&eXZ&3{ds&(|u!NWUT$A<>;ER8V(5Zay2hq)^P9FuV2&C)BYIPJTt|sG7?H7 zkPyqw`l+OpMlAn8rhsBMutDRwzO=ZwBUGwhB)7XgX2vx-HnufcX$9%+W1@fii-O`} z>qCwjSAc}l*>9dQ&<|rI+k%s{efiQ^kc}+-{8^PS$TaUZ&n9hB$;z%Rs(que9uk#j z^x}oc@m!$Wtj99wIa$cHKb|G(pgp2MJd1V}Y{Zpvl1CFt)BNtYk2mZotKQh@mEvd zPoBcrO)TYGlOBXx3EH=?0bQZiwe5RZU)Vi2i4$O7>$LR!Pb%N~EZ68p{PynN3CQCy z}< zVCtUcyWh*}dpwV=Tvhug(O-sdVdhTV+G!m!jN~pjMcwN3$}SfIIugQro%bNaxp{h? zev2drFeNT6V4^h(`0nS$A@6v(GjA@qEs&mPN<`%w-H;}!Jr>`9M16A@^tIl14?(~v zo={7iaRmYUr_WjB=ltQ-i;JV?pKw(ObL04Ws5)Z|wt51}GahL=D*CV0V`h ziBu#Ce##6AZ8AunIdXAiCS(I#^1qC3YCbyrVFV9ft8*-y(0?!@2-Lefk*&12_+WoO zj?Myb1#o?107c&3-f|D1#B}!dHoiE1rleY-#Y<05Pq&}4eDdSRkKA!`e*Rul# z?ty!t)amk`=_OE)BBdqzm{t{rQ}42A2*r2oLtvO-TLIn zy!Z1nkp@62AXK1qxz>X!yY^>X-%U3oC8&YQ?x6ao4`m8cV4GlK zWoZeW4V_!x(OQf-KIG-arAsMAync;?hu5%H?PkH?^=B$Z^_D={k*` zl@r#7ySooldO;KRT8h`udGz)UYoN4jWoyxz4fGh!&(Gx?4nPk9J(IifJ!k_r~{O6H6N3Vt}d@1EJ$3e3xavg`Y0UP=0Ds0 zY=Q(9D}xPPYcDTeVGPU4Q;>Pt8V{5q1lQM_FHYBiyu9Zg>0%1mYLFmCg*w4CzNiPR ztg{UsPQx~1#ab1|>cDx9lnKu}MAcEPlN;{qHP570Wo=+g5{`$%aFy z#_)-AhmdidsypZPPAS8+#tW+Ly;Wtxq;*>W{*L+du^a zRinyd-?Y5ym5P$moAwv99%U3AwI5T7Z{8HYi^1Vs4fM2r#+D}q+zfh=_QJCU58gE3 zBQlWC&ja2d=(}Xk2kLure7uX=1C!4oPPzBH%drAm|5((w8USZy1NTU_d3%L7XQvaT zJ@)ec1i%yg(jFV1LiWj%Zh%e64&4qq*4E5jz9w3S;8;Mib%&o%npW_$uxx_Vb7W9y zFkTR8Z1ZIN=STf!A5c$9aEu{dfOLT3%WE^Ks;_Sc4Kpg?(?J<(r~onCo=_!00!*QF z28P%XP3`+T$qX7gy`~lIFD9D2&p@y2+863B51@gh=8<#vx?DX&W{F;@ekD{mwW0{= zdr3=4(4#VF4FJUrn%W~Lxt#=fZ6jl2b>F_axVW(BVC^guhvjIz7xDIlSO#U=n8U=( zjQ3QX=K&B_;3PWk0M}td&OlFnpBOY_`xD#>@Ih-ivzE3`iys;W7G6z=Qy{9x9KHT- zTdZ6ukwyCu0-ZP6$e1TZ-(xA>EX^Y~cxHWlUE`yUmaeX_^^Z?V+0wxwA+e6PfEZ!O zaYG{qY6xV6dZ)yg7(!)bKRU0Me|I}pS688B|LM~X=&V+CuiR1~c6LBUhYPDQshOB8 zL3;#vXg7NVDD3bvlw3@)f%QLW?_YC+lR)40&1hzSDnF;)Yy-4lZX-IGmd=j0^N`o{f45CgtLM1$_x=X&2DP z0K*H|Sv;rd=IC&sd*28GJRm~2m}y1Q2v*tDCg?nI_vN8@l4_5da{GVgwB0zeVJz!v< zA%#rj-tb(JXBXCe&^8p%!xw*M!y{ipwA{rvb{9SQ7$dQo$0p+$r-B(pr{kzjf z0BM)SP3?nnMVFl;)E~ENy-dNZ{Ikup;vpU6Ur=o?Ek6&%N}9D%ciEpbwbh zbq^$(eXwlI9TP45YuDBWvt^*z=;~6E;x`oP>DmTD6aOzXnHU)vXJ=>eLl;0A(WJ`)}Q(zJE661jp;sF+Bt6qJ3;)!`6IK;75VGhOetjcPVT z_`}$UzR$@LL|*NuPl_e#70mU}Z3Z;S7yUGs_Hpc22c7H}vnXOpk{R24^7LuyLnGAX9AqTLL}pb0}R`T<5uOeE%y ztF5htD*-vIY}K_|n{nu%EYc_yab6*;#Y{Nm{1a9^|D^mY>QK{LmIGv>^OTh zVw^izVpnNL^n|Dtu(7e@oV)I%eM)(He|)I@Uq|9!S2H#673?ShpmG388d_S6VOg9a zGzE=tRnQ48PZr}8>Zry#I+jbSXE{=Ou?eV*wGt#b0Xxvq<#10B5lL}#amAoF_Wlk9 z4W?-Hal)UFC+oj&T2?0KJk%^vH={R2%<GR(Ws*siRsq}##t`}$RKS@5>hpgGsr_;}okCG=QP^5Wtfnbb3UGA?sK z(kOZlJV00Xz10VPDJA!`BZ#d1eR5EqK|@USdedGbh1W7BF8GQ$4+beFR$osh?G=JO_pcta$|O zn68L{N)JE~(qFXj;SUHI@=e(>KR|prg>u7zaf~^1iK}7VZ&0H(g-?8C$F?(I45ISt2S-n)DE4zuP?b@RCm4Cp}Thi)v# zq7L9aFei)8S3OGg8k6;~z``igLp6iW$3BPobKh)8V4!RO#eV?(x-R0!*@F>O!jmVP zxHvc-E197%vDM4|)WE=C_}(XG*pCsQrZ%$;Cm<3pI$*B?vZ8+Y;%mNAcCxO(LmHYn z>dRvpM@Nn}cJN*K?n3i_s+h~h4+v&EyKUE}D*#&$h{yTr=R%|k2|LTDzu)bJYDs|~ zn`+;9=31HBHZ`udId4f$-*(7ijhe%fq4Eg2(h8RY#AQW>+jKZ-1?`;5=H}-17ps7G zK?wG&B?vY?<6Bs*VoYbaicVT+-7E1L#88IxmmH5Cr5lp?`d&f|^6>K~{S908h*k2g zwFSO-cCwsat;sCZf3!Bb4j9%Yw+Xcn%U_vCBR9<+t67by+AWz3yv=J;>}$Vok=%sV zoPwH-eE6Tqg46NC+=55ml}l{0zgt|^dbs!883_n@9uL(71_W%ldOdymR8diJ*ak)g zILSbgXOWb`Yx^vZxA|Q~X|j@;c_@K;SM9xVwczgpHX_z>)X>6ZI=M;vE$2X*H>63= z+(6=!3co`dDZOk5bWFWi^G#aX$Kh33jxCtOm=t;OZ#=ioVVY}UIN#=A`)4!kCBz4P zH<}N0kDxvuLg%?aH490G7t+um6nkk?`5e`Ql;$P{Xi6J&VF@FRi7S9IHYO^50@z7S zr2rXHxd2p`&I6J1PTYdZjpb#xab34YX!w3~d2TD6V@<)>J7#_T>z&T>jl(9CIZk~s z7A!`7z?wi;9WT*_iAj_;7-A^f2hon#2IC&^K}`n2Zrbpt?+FZARvH^pDu4Q0=vdn2 z$pst?@5jQ10Hm^&($(DP(1AZO?@%A8KjGowx>mD5>|k7tw?4N^o{5>+x+|96#Kgqd z@IA!J*!C3EacCOU=H_A{U_Q_GFw+yRbhQ?H!NOS!ums@L&6)7^aKm>ss1G0SApps~ zU!MQg-u>m23iSh=|9{_9uhCRJ227S-X}wk@fWY)ahskLJzJXB0(rSw5Ec)27 zyBI~7x*5yls13i0nq{_`f5}8~des=m919`(i=u(#uv2=O3AZ9+;KT;D6hFtDG0 z?x$X9mWXo9Xw)3{$Q|?FLmT**$evahS3kH!hw1Cgs*E9wY%HmZ{hwSr>M`wy8#m$f z#s9UwNo+nAB&*R-`BfTyA8faRm#p{W5r~176tT}kt z3jd6GOc3$=#oRMa1738y!xrkb zMLo}5)GUAHn;7G{16FzwzE7$xCtUr!L}Sab(>IgRyeQx1y8pA#)qm%a>JlEy=%zBt za?Y{0o~S0~SQ6mKp>OYmhqo(oy~0NdFV3s~@8=>n935CykI~^s(PDXP;+NUdc72c{ z=nqrZ(C&dJOlhyyM0sWuzF*@?OyVQ^_vzF{ka#8oNWQM=;gk<_7Zs5GkF0#S92aEa^;yT67gNI@R12k-$6}e^Zi>9 z(+k3&`?VvXxqdHb>~5*1?$}EhdegWHb$)4QwhRd@wC+4cw^9OWYLD*U`C+CsTlg72 z!o^s!(VZ|;H9flSGLJ`PWt^!FVCp{|&owvT>wJ!x=W}R`a;1x3|4drB@{rI6_Z6!O z20shYwts^>l`S%#+_{;+c=gxb0vB!=Uec4fX%T{I7))Pb!~N$lDytdWw=xc$ ziQ;Q{Eh)ki;NlqR*v);3s^5*c4VVLj?E*3f;%vY%PObhKPQ+6f-G7%x;NqA8v&CY5 zTBK9Q^I_-Vs}??z9g0uMPwtC33gipn2zed146Jj5mF{0&`X7nNEIwVgAQVKV@TRu3%zgx`u~u%~W{VD;kg= zb=bP)m{16May;0!&TQ4RE9RApU0hyYSYM~Sb$g;-=2wRH>G8?wXNOWk%gCBtd)iy& z8W?#PVd#hqtr&ONvnyOpgu>tAZ2owoZ(#8?Vv*b)=%HpSJTO4|y=QBCRh_v{sK5h# zy_Hgoh1Ic}R}8mXKVOziynP?1?RXI|YH3vas4tDVyS&)>D$W|ooyk12p+{TqNA59Z zUax~{&SN`OY5C_{>U70ur3<2^98Z3jND*e=V(H|RMg8=hjh7kSBGUyd?n;lYNVnzB zk7*4kVtruD*t^)5y8VOPV0$V9@ztF*N8O_}W*lMOsdatsrm~Zs!AC#cQn77c@n~$e zrYH!%%9}0=IS-~g%bzW?KCg2eZwkB<9%)DtAC_$~>9K}{$5kTo(1W)Ixaf}4_*<%<7?sv}u~WfD@PT^CL#(}wxm%g&10tqJWr*Ia6q&p>*fxF5~M(9yMlSz;TBo@L80`x=G{k!!6p$ArrTy!n!R@(bbw6@ zRdw`ylzx}R3CG(Or=k3PKX!E_cw1Gn?NQh2=f;t)tg= z+tA%vRZb&z7Kmhipk7p>;{N07Znj;sjr(@m41bi9tp)p--H$q}sXlK;3z#1*L`~P8 zuclVmHPqX8G3*Njhk6t~5p<~HKd-uRt0S6<<5PP2&vrZu zF(MUZPG0MYN~dlAWPw2Gk}-2t{Itu1@Y^6_A3bYoQ_&Ugyyy8B!=2NZ6-}#wWTD*B zo~z~J((kLp-}h8j;c9Ie#4V+`Io?=fmUEvGz8B4JMgtc8dgv8n(S@l4-aRB1L@8_B zxE*11yzew16FDEfQx^^7~ zL!&8pN!HXTx<5U&)f0QFx*T*|W3@fHtnXcIaz@3*CX9H;GS<`>N9=uk2y3*c`|xt5 z@BJ4UJW5p^$BU24@zJ1+lIIohS zZb&4SR20n{HKuwLpWw4WR{z=KEUj>jEWyNB3(Ll&+|x%Gx9*7L(bC}3 z=+%8jwxQ)=NTB8T;H9Jmw_Rc`@GDe7{$DW--F4=)ydH9p&0wCaPBiB+zxCSa*NeNQ zhcpDUydRt--_e92M3qz@KmT3n+%-Q(kYg$v`&8-esA>HN{rNNP;P$C*N+t4Okv_mZ(B9>RjlmmpWKcgy;Br#Xf8$+7>IuM=b7s^pYB3d zy=2gSgQ!vl^0CDUW_5j#BKa$lD+?n2&m_b?2W;G&9AdVAo-c$ZsP8ZAl$kja7m4+) zE&s%R3Vr1VH4)~OZhE6pB1|sqRQ%#f`!%y4f5?h`DWX_HL-r#>Kf{|q=TZhjGkAf6 zow(>yO67O4v5q}fUA8D0gqWGxTlC-3g`q1EJt(r8-cq)C55!uDtE4k5QE!~_ORq-| znokogtynA_njc+Ph(Pv~u6Vx9vDB9z1T-FGNDkSCZZ_oH0nNVssm6~3woa{uE{7M= zm}Luwzn0lIuEX+-Z%7JqCEK>xXB=X6p)JYG?f4pQN_^V3;d4V2Z}|?w@@C%JX9k#( ztjh<`_^G!k_Nd8ASWABRCF_VOuarfX^whMPz@$u*La21q^0t(r*4QRtx~X|`?rlZC zEF!5YO&eP`oJ^kV-9Xw>e|xfmB%>?4S7~>t zUQuBL3({EK9{C-Rh3M5&#z^_A@}^ZCTdP@gOZw^>7Ofmm*Dq&Y<)5ihv3%#-aPQ9H zSOqf%qMSLU=T3F>y|7riF6eTCn&y9TVM`6~qS{knhoKW)4KU}>p6*P)FMN`n8=A$A zM@i`Sp?RR!-!!8mkTCWN>645DLPa9>zCYne1MZB@m}*j1iqMa@U{O1p8)doNO)>5S zl954wSz;>iBc$fo(efJU3Ukdf%oRO=@U=gziNWz$7o)yL=_xjX1jqHx?>L3(wIUq| zF#^bJlqsHbdtz&j+cKWKqaeSyu!IvP6O@SfqHqbEF4+o8tE;6;eq;LQnx~AaD=96_ zlKsAZzhdx5%RmHr%fLaUGfrmJcqVVeCDF4B1cNWas+S&Pl;}Fs3^ga_ezo|QpEMV& zJFd&xLqaw*be9-)vzW_=V)M_C-B+|(K3QhG3-_j(nR7-U0NCRg7Nudmqo!5w;tb~NPnO%fqWIwF)XRq54wnaG>%o1W&6 z=Cj=WV1!9cNp7`I7<=Yb-h(1b*Dbk0^AQBi14rc-8VQCUYsQ!87{0kht!VmWikB!S zF(*)Z;s5pClPozbB-WWOJMwFPF}m*3KqGktTiW?xdWTZn2KkvG;u7!K`BesAbQRM4 z1JPR6+aJ+G0--Fr-Pz+28#*TxzQ(n+tj#U`kZ=t9%c=3Yp#A}h#oc3ibTAm zI3>NO@HY|u^LGLIz~8voDUjFRJ;-Rf@>oT5>AI!xv9wr6(?BMJy9>g`kHPB|At)7w zLNgK1<_+a=cIiJXAzI3&>v{z*L`;5-;xAn^Ie6*$WUA-In@4)_JE zN2ZZ)=LPkm9Y(9C1@jZAOi=W7ejM>Eehhq9M#zu;@~+SX_BQ*L?J%n=3^Kq8Rs2KU$QpF9Ep7Ai!#t-PuIHcsMtO^HR`XVfh=z zEXvn3d!Ru*I_q6?V-T;=dmIfByioJ~yJg%2V3e3K?5}y{&}h8;@!Q^>*{W<3>tOxQ z#w~)Pna5vT*9dPmxOC`MOni4p9W`Y`GLecHXOu>}J#ecQq$q9PpMR}l#$|b%?JAnj zMTP!LrecXsQ~`kBJN7h<2p+dT65 z&>-SgX#wV4tCBdmktmUQrB0;i@0fB=4*!%^)40keBMZB!%Js`!Fkl@9RTV|%buWJ_yFs~R^c46 z1ZcF}&GzA#MJ*BqFGPof&qY)H5oP%lC3E-puvCWwV>K6f$0OU* zJ64aV`QGk+pFWCy-+4b}V&l*uJEU=^Cz~u1`@&YnHHSbh-c~ zHSr8BT}^P~weTmu`z{y9fAYegun5WAbd|AoUaYtKE6BySG6^-?3VAJ60W$`l`f@5R%i$gzu!zuR>Acx_6S+ryL?XXEAZOj1?`MdHFvc;aa>s>OzK{KVh}IW( z(as+%VN0Dlg-ws0$&A4i6-Z0H*6%-x5XX?cD~oRboS>Nvl#%tCLic24GM1BIotH<$ zcH2HRvPAR=nNo6&J1<|noPJyX?Wf0?jZf38=liILZ2^jgi5L8F8aoSYR!4cJBcr4) z0xXD~fB_cP(=(IwkPvrfNBKvNe1p47UCK7`Kc18w zW$*$+R=Z_Uap8r>pODS^BjVeMmRw{g;tJ!!r+aZH)%Yt51+1AViOk(F9(Vip?Kf}U zz@*=J>@Qy_?B9VOZhrF_xpSKZ4>P73r_a_uL|Kt&j;l8!>H)`9bpyVgRlH0&LQZ^; zFKt@>ti|391eaSHF>k<%G{;c!7^XrfLOsx< zoED&jKx<3+Cr)skJH6h&!B*6eHDq16>N0tX6^Gu!9-*Gy)zz)P(-q6sd{U;Zx$`fS^1n?+rujU<5$rpq&#O&^?VE+d<@IFjA78GXf&o@PiZk`u4Pgn zuy<>~azw-W#`&eXu5Kf||GBni34OE0#YGqfgBRIX1uCT;#_S6oyM}0+>Kvi>Ts&kq zxKH=gfBKK&CrV2v$g=9X0)jjJOB!qaV(0u2vm)DjZh z^M@&f;^yTvCL+Yd8t>kp^ts*N=n?K0>OWVcvo~$cq7z>f_Vn|LSgX>tZ79B(x|dD0;%N$< zkAU>wa3ZI>(Os|;889GkR%v#EC% zGf3h*ctt0dh1?6Exf;-ddsB3nNJ^PVUWsnvH)Gg>dqB&8*tyx$TC0uCdu(QpuZ;`B zq%X`(urR@-H@vzDFEc|s2|B)dIBJc)XhTg1BhkOccz;8WRG9muRQMme-m}Aukczny z!_`^g%}FPFQxdJ=Rxui_93X4mkb89VmOTT{19KfUzYiz|eT&QQ4$QtG>U6AyE*3zC zwpU#DEnLR(;)#G!7r(l7_r%%3$|~;--);TmX!y$|0IRY+<(3z{r!e$XVH(U5chX$}{Gsp!9q(gmna6%7XN?p?n ztZ1_cfeD>!@1A{8Msp%{7u309?^?q`C>6scJ2afQ8(S{f&^a2RP_M&!BGS%olTFS` zn}u|wV34~h7t0i1_(vWlNE5p;{pjRE3=!}G0gbTmdzx1;YzKdh;hg2xEDT1Nn%2IR3#i37#Qpt$-hg@n-32U!CWmYDhf{3ii(Pch6aG>z$yYf6)$H`ENr8QOr9?z zf8uERZPIBvWSJ-Azt6s_QRAEp)v4DmqhEd)eOt@Tby=zKx}cBhHHNz%$Fgn^e+a9d7@V0XI*!~Ko@%F^aypk4hGrFK2 zqSU9KhF)35Pfqtg{@EjCrfc%FTmlbChCMLbm;2I9_xMwud_Z$tY`wC(_eJ(|bDsm# z`e|M@Jc8Y3&%@u7Dzg(@0=&@Ww)R)>Z|T~q|GUI2H(*&=D?x(%43aln(K_S!$-6}N z!*@Q=&bHZCEi%YdS#`|tOdfyyXpm=3)s{!(Q&(2DJaUy1@7b{1{+vl{)jgnZ+~A~s ztv{m;hVtNTNJ>aZh>f)Z<%|9XI8Q);4G^32qm7kzBC?>@_afFG*!yGqF{uo`=StP^ z^BJSO;i&w**qT%Rl$Fxq&V}=ma4UQWTJgP-N{|(%__dkJRrmR zVG@xLBTU5DtM%KFUYu)6zlNJh&!O;5BRUD&X62W$wkKG4VbcA{x;$4b_-KjK$`k#6 zmOP!qFjRjE?Z*Z$)Bv&x6e>np1FEQxjS?w4rfouGW83uhdiNOW)C2HSTnD^FM~F>m_KN6De>Ye z!z}`Q@}F74NJ7h%3_FKkvP-*NEtV&x{@x^s?*?m`?_X79Cgr%cbgiKhgykg>pMC*L~aZja!DmB@J| z+~a1y#s1H)4J8UL&ZbD?FRJ{1tr|a<^$l=&Xp*E=owTs&f!jxjL}0L}!BnXDZcmxR z(EV_YxPMMM^#Nc@`&>UQ)JxwHs(&q zJ-@qBpF~w}V2Rx!slX{h4{^e3XA{Q1oK7bU;XNc8+9-_bRG4FNB9lHj!^3K2x{+((6nW&z-cZ())`|U>;KP7 zU!S^-AM9iVgy%1d4EGNX0Q&)o?{tM=MJ2xCo-aYIv+s~{em1)LBhtq|n~$0Ajjaj8 zh9}+U`tSSKtTg|Bugui;;^mq+!@WB+5#QUzQ%Xbv>@QurdolCZM3a;>`dHKkV>el=5jjiq{n6X#MJFYK?fpX;N;Gq87CgSbN zX*uD2@ko%MN;gICzcDD`YyQ;*5`Q!zSM5@M@klnjpd7w`KThmrww%PD^`!zg%r=OH z$!qQvs3Fh)QHeOrc{6>(_Ut)mNN!n;&9ZLU@`yort0i%AnuvV-w{}0hWai|@Br~Jx zQJ779H|Tu%q)$7`HDwQJ2yiFgAiBQSY>(G^GY1?^k20Q5G2{-}7)u`+&3Ad*<4c!w zTU3t6m6+7~A5?vg4r`}z+|9kTkejd3YKTSd?uD{CR)vO zH$J>;lp6v_7S+58C(#=gJ6liJv=nT}UpuM8v(l0V^ZpzQUB`N6x zMmS($czFCp-n3j^4LVF=$)Mf)R3Ur1L;1U z(6jd%o{|#L3pHSg;W2Bd$;r7(_L_uI5>S5vH*YGNaq#dsfTs!G5UI>zG=n-3dHOb;c zE*O+t2nn5c7M5SGl0@7DMtk+wyVnk%74YY}Q~u_xdm|hIXkfRv<{aaAIgHXkCQ<4`u{Dfvle9t3Gkm?AV zKR(Da=&3^f#D=wMAdCFhbVIZ`Q~oqX3-a58^5rag>5rhLFLtddWqy{JPHt5(1HY#1 z!!&&$`0c>kUT0F`yzryF1I5%UHfuzAi9pTjaOkG2+zuBFocdwpY;ZA9z^6JB-Z(2D z1RZaVAIx4|0v7_z_qi1n9}#N*u}J`)20C@j(|{LBN^L-=skZ1K$sJmAsf8mK3WN4y zy6y-xl>uP=TDW+gq4TUdCU_aLqyk7!@yd_ic|2JB> z0!0sOMHgUQ1)LB#R5CgB4GebRarhoa4!3`NjF?yI73lAqPW}*lSiGhq?_)uN|MI)Z95sms*rq|7*&?e~+=?;IPU!2Aubyfi-$UT_)2ZHAk9@MyOqTeb ziGnP4Uo6iSOr%QU*K%2%>E3e;I1yEKF+|J2-o5 zXhaTJ6XA(7YH+9xqHta{;Nk)!Dcs-CfCA=AGk8$p{)TG=lG245lmfq?z!uCxyzzFR zibgF)po$L!A_xe#fsP0(+wQItNKo$G^FQCJo|u?`rTW1qeg%(26uu2WFH5Sp3S_Wq zg1bSw@BGBe-vQh&aDm5wkOy}I04YEgzvNO2CM%8(Ml+waY|t5x&dxHUwef@S|8CYE zmBh)F1 zKUJREMf3a!4XiGvK{_V1{_U{l5U;7y+E5Yxc@l;(G{nI zD2HbQHUvQ;AyAG3Yy_xSaF~QMN+1`v?abhbannJGmj?C``5eT4Ca@+P3-TiT4-i}raZOXSeN^Eva!?r zFDj}Jd#1jly&Wv^E)2Qfb6@CM1{)WSK%>9m4iZs43G#T@Fw9?m45tkOIl$p{0S(Q$w-Y9dm*FLB91N+cr~sUp z4Rt|Yp6cijPzC^=!-1BVGc-6z!YpfFX#^euF5GTx1r$>Qj2eEvzGgts1MB0@>%Xg~ zJthHEp=V@t`&|3yODr%Sv_FNF>=EEnz$C&Meg-=}P%ioKT7fc>>btKNJdY7?9-gTW zE_ZOU##uq(#YMkZsnDd}iGDOn2(T56+;h0E!G+St{|hP{sAT{aj9LHzs)LJzgCP!B zP$*@$|`%@ejCoVfB{L1jz&udXD-UV;liw4Q&KBY((`=YrM}tZ&~?5`2dB{toQx}J z38!;P$1lr;UUe_|Z(L|n^O;uKP&aL^Wx)iiL7Ry@0Xg-zNaq&tSbS3*?84I zuPn#+^0YQ#Wwrp`75M*wXZh}r*}Rc_$;WJ)x{?yWxt6A<%k!2X?^l9#9K0*QvAuFB z%aSF^no(X+5U<0CU1L$zDo%Pup=HDRmY=Fc_q9bKnE;Wg3Tp+8n?ZK|y?Rt_D({4W zWPVdgJ#sy-_wIt4uwLs!5`&mry_%_3E$X2y`M}Q_lYy$&ut*vRHL`N4o~l=INF=ey z2u}2)Bd{Ittck6u>$J$Q4l~k6(rNQ9&@hTfbtThd2~!cT23{StQ1OU!=o$PRL;zio zgCmqB44nS8rP24Y*8yo_Yg;h6g+c=W<7afaY{8?xBZB@IHp-um7@*ww2X1O0+d}UK z$aT<`A^7%~|MTb10B_QuRL&aUe6b3ig7Ym0hkM}Lset8X^n;iik06VO z1~e*QDWiuTe>_fx9mSG=2Lb8&|VsBDQfh zY=(;+%)3%TYnTR@d;MetWdFvLHWii>57`P6Wx3Q&GyB(lG1gs#E|iH^ z*t=k>Pp~*{I_Yoc>sZl6BqH+74N4kaH&;J7(x@&B*+PS7)Obj%#sk1Fu#CV9V3WWm z&Qu+8gBO(QU<&cCB3;N@rNyfK>jEY^SpnG8+?VH|p~}x(KET^SuHg3fElO_6l0j|!hS5eY==aE^`n|oVtm)IME65Ex22`JuLoxZcmV-| z0^2myfzaj!TAg)HPa>R$r>h+3)rWvE;Go?Gf9F_jjQk9%FE(!4-ftjXeSVk^=rz>R z+81XvK3cWya;$=)G}b--P|f`WpbGZo<6xF_-CykDgTimCdbWu+i%1P=o#<$K)X5KO zUI!1LV%?-S0LrV7kdTfBE{EDfSs^%ymXwglgB=VCK)5~60RaiDEMZyMOK>hS0rcGc`Oy-L%e80oW+O34SM#cF-7~j4Te}cjL5-%3@&B~| zz@*`mJ@*Q{!Y2B}`?ld>GqototJYyD5KR&-orI@@x8W)ly_WCc5-8SgB%m4EoyE&9&z za;7NFsT~#CH0t zMJRMJ3rFBhLfHiHCj@M<-l@-Nf2_G}kC(4(5`~Tm>iXl^d!CLP^8gnE>LOr5Ju3$t zc{N^rdApmx|0NtzfWr;Xf-EcsaR$PoN$O-+YDlQBCc=y!{pn_GHRg*~znDn*-QKXb z;4OumxG9;_!ossxuE7}+MFQ7{9Z$k8Z);$zVfC0Yvtw?RAbASI^*U!PhiMJ=_#;i^TvetZX6#z}2wu2KE;^ouywlX|vgtHN zeh@oZqC8dyx(=(_7yXPq$|4c|G*Ar0-7_qFQjGH)S0QDbso~MxG$HNJGI$u@XWj7Q z&ugO%mIF|$J{;|!O6syagX&_5RtPPK#So+qRbRjEL1zMm+&2*H0dUMAAm;!G?6xz5 z0#dw>isDdn0jvbT*=&c>THuR18ZiJk77~Ht-2ncBhdF=5wpK#`(g_x7M$M@s7Z&?> zZc^=-5s`$l$;$dew+6)!1tcmw#34l2T|PWwrnyr%;=-`9u^|PW5SV&Zd9#Dp8CVVb za#>kfDCRGiJ0a4*4;CjlH$c?}els{v%Ed=`!V-)+45|ZX2>>y0Bj^_%g);l|(-Og* zxc76Bin2r&F0@&thmx{hgnqH}fp1{*)%1c+gB^PS3y`X5-h%~i|ylaPk=dWMAy(I+&(2Dl>xiOgC4FC(U1os`RkG?xme%e_WmiE5P zuk(sA=Z2F9%!P{Y&?^LLy?V`YkRgdlg`4p=So8UbyF%y;-VSMVr(J7!B+FyG(2UqB zXIhy6?pXf#mWLp8;f|fNC&LbtzQcq;`T5`SxPPX3}fu3Q42@RtUCVCPv2T z%th-&csJnQkGYo(C94z=-m4ws|NST>217o?Q8YEl-nj9nja1IQ>jf_lk8)vp(J!#C z>X(}Fs11Tq8lY37XITJ`fqf4NAI%ZK0@Lqz!HetSnqd6m$i?M7!=OK0h4S)p6j?qd zMhH+CK+rhcPZ~gj9wW8#fTbYN=3(TX7GMQcE)X}NYz0n4Gjw193kuf_ItD8?VXF%Z zLRLT|)5+mBYw!XpyJ(UF+-~L1dg>$%=&`X&U5C~n7a%V7T4lIz0@5W3tBm^T0NZbaM}}oBVl9G2a&(#}6|N(dG1y8L`DF%g1G~AT|BXDo zS8UW=awk;;Pna|oNhUoB1-IT8{Wg6}J1TBHC*%35Ku<-=c|pv;NrIN?qH?Pb>VXJ_ zXqOWA^JTvpmm4Pg2=AAS_0vtz9SUs&P!+&3_>R`yL!5KFEDK6YVK)hYv;$~9@tSL5 zM#reRNt(XfC}+Wg8(`VH$vxx;oN`ep-uUhjc#;5?s*p8Mai<5}ZF@=r`1(yvGfOUj zWBl92k@hh@Hz$YJyvc;J9T+LKM5{a6mLr>tS)txy;-*fSUI%|==pyI>lNSCwwP5<>Q%%zm zuvW|QH}~1cScCi#BISote;It8CS(*|nQhopGf;}#@A8BSxh@4zr*f7Qmy+)NwY&Gm z4y$ma?paUb)RalBs(JQ9=qn$s4RHW8bjLyW$11rHwSa}TKU%Iwh9&8*n`nt#|9amy zeV|k&MpL~pMLoQd#Y-yjE@Lk^Kn%-GC2)$UK}vY+;Wn}(-w1P*#{a`}-^Hp{Gtz48 zOf+L+1b!rrlZKP1I6dqBml1_)bNsCi=n9I+$Axd^uuAk5;*)n+&0dY>0bRbYyPHDU z8HnxAJ&$*fkE7nbn{4uvYU78=qRVXDP`RyUOr^$W$8rW}SpkqLhy_l!jj$8~HUfe7 z2R7We$@Gd|jt})5fSf}E@B&+6BOBoAU=YD`tm6wcJvzA1X~5_UZ4l``=pZi1dvo^Ep2gZ= zHt@l(10e>GMc4|_rl*TpT0uhuV|=JfukBkKxs>kh zx~is2YqKYv#o?(<0$<1Np`>Bxun|rK=Mf~>u&}c)C)Q=V)4kRRjuyr|Iu);kjTIa+ z4%iB>p7HhLOgX6NN&X}ae40TF7RQOlCn`6-;07&Z5aJZqvI{Eph71G`q#fu;yk)p1 zPVW`3qS^hYUR~H|4qO|Zrmy%bvB*~Emby96>}Q)A0o_tM21fY8>4rBDD*@|SO-ac% z3X}oEyTxIUQrZh97>)f#2QCHBON#ZYNfMnHp2MFR%uTzGnZkFbcK^OHV3vSHfgdy{ zjv7V8)IX^fFBJnBLNU;-HIv0*R>t;X+e!TFaP6R#kdOaA*bT^8V7di(r_S23eLYEj zekZ^O0sGwKousE^3VTd`4_hHZ4JuRim^BkCUml>E#B@PG!=%wR+(-+diKnnR|JRt7 zr=zDgmeZ~=Df#i^$7tQ7naa(N(4aQ@F>Eai^T?8t5?L6ZL9T?T{ckjRO66MbMQC&^ zp5o%-!V>R0R$>af07Z8h9GigR3$+i5)w(pq+xH53V-i?6I62wb09Y=E(?upHU@1<| z&ovW;*8qCZaY|~UFmJTHJUA4@@@$2P4Id+rGaSSlQl6W0)25cpGVJEL;*sxGDP{Zb zComP)y88YsE%aXzPt8<~Tq%oM^fu5ueh@~yd*D!J_$VYFdSpv9kqwkla&I=mfDi$C z6)GAUXnR2?|K+i11kK(S(QNOk2mK~7r(9s!MP7I48kQH0wTNonh3K5il#yfoDnAJ0 z7c=bBaxverqxpZ>jSA5e_mxzj$5Nl0U3=lTM}}pH8AxBA_7tKPn0!_$# zWn(~*1>YdVkU%jTCB3f-?RXYE_|Kd8mcS{3f=y0+h$mb}bd?qe%bQfi1Jnn-n9&-|0zgADHaZIY`O59f-#956 zVvbWau%SR=O%<=q`>-%CXy?-KnQgk%0ujJ+o}Pw=W5v4~ArF}t&*9#K0HSTlTL8FW zfAA?9s0Yl<%-60BmNme^3}`h_y-mYEu@s^wSs*`#6!MT@`cRe%l+a%wI6-mA^z|WY z0meT|kG;Ef6nuUEL8}8l$a?K33Jn4}HJDy?x%UCs9WW{s><_fK^QcPfCiAY#g!E;U$dB) z*dyk%G#a6@$TIE)x7uw6*U6QG6`yRh>^GsQzBZHFesq;}Uk9WQKAg*W-OsPpuc@-W zt>VsZ>!KBlKcp7c(7_-1S!VS5N@jceBcybs%MDT^Og}ug4F1EsYjs@u`w7dgITgMec z@`ZAZLeo0U+sQ3a5m9mky8N|vu$DD)=Ab7_>)8q?Ea~cof4=tAqJcLDo%V3zgh?Qj zfzj85}k{1N@P)EvWOq=O#m=wCW@XYiK7ULwWRs#irkuw)Gor`d})b>798KEy|^0 zvV4=d)!2*@^2Hh674!Lr%uJNkHgD+PCf(O`4SH%^8u@O(&}80Qqfb#Mmp zUF&N|W}qyHjOTSJTsVWlir2vrbLOd>r-u<9S|E$Uhjd+eS5vkftmntyzu>nHT^N`A zWwTigO2-&{T3W;|cAFf5n;`nWN=>L0@IAnGk>TfIsRoLgL3w!2WZuuC^PpHs`m1On1 zQ+m-9=>c3o_x;%de@b92Wdp?x(p1bj8*0~*U(rJAbXG>y=qpe1@90R}AxGkckztb| z49)qC_+`^aw9YXCCuk6uu{aa*cnp%HiXFzhzLdzoIt%ei3Xxj)ttJG$=;3>ZJRFG; zd2dJiaC%ye{tOsm45@wGjYg~n%}-u$`mpLocq7F0qkDQI(`cfQbaS7CCO(2VEpp6S zJr|{#99e_~8s7KPA3O{o5pmOx7VNg(PcG5X&bLn4-fz`e$%(j#F-Uw}$^LED;PMp$ zKdEQirLIA$DX5j|&9iwL{AN`*CJb$~=fQ1QI^^q->7t}0Y$obXqEI>QV5kM_zWUrZ zDU_{F??fP8NM6$kjgES9GS&cvn=LVg#2C;-^X$XUao|-R_fMV*Kf@4@AQRUj;*3>E zNsH1S%Hd3ZL|k7CEnPjFaM3ohkX|LS*r5K;2e;-zFgE>3BPH_=X`DV$i?1s3pZQ@` zy1&u^#7xavP3>Vt+r0g0!V_Jt(IPoF@dLpQH&@>W)tv)vq5Z-mH|$_X_RcukZn(ek zaF2S0Ep+H~vMxfMnoHTt@j}<rZ~H@0gYJLQ~htU{#=t_%ZMFkkZCed_5w< z?33HePY)to9vC4JaaO*5L}1%JKfk(I*Ht@RqERS#1c&V5rDPl3f^?_pticvXtSF&|-ilvnm9b*&!LuD^@D&w?6xqWk~q=4 zL%fuFo&<&k`g&B>HfNDYDmyzY$t2BqL@yalL#mrGcE0b)MIQ*gS7yQEuk*l(N2p?8 ziD8LZi&Q8)Ch9+VB~TGt+kn~2Uc=)=J1?jd#9{DR-7dZ6#fmQ;UNGuN0aDLOXsKt}Lb2lbOhRt6oTKD}m$onb3 ze9SqHji25pI305*tRWX~kSsi1{6wXN@0x5%27aI{WkLDR;G5)sC4WbxDn3|H8)gpP z!}5CWYL}!>^Ad@pq%`N`%X9nTzyUf!{Y8>lCShBr=eM&PFR;IHB8^a=(-%JHMBms- zk3s6W%Rt|Vh&xE}X8MOkL)o|yHQ6`#S*y-dFKmzq8BYO=)fGaPLoMj_h`Qmh^Qzw#L5^=gG zve>TpbOcbcx8e1YR8xVz(ztwp2^)#wJ;Nm6;ABibN|?3GnrEzYSot0WC?Yk8pEtnW9(c+SR2m8T!l z?BY>bOnpw1E{a>-fY;n9^uzLy_KXe>L&YG_x};SX^<;`C!7fOFCE)TqeO}4&1Mzah zwTw74B+Jq!AsSmK@!9-UG1;9DnR!3hyU)}o8%uHxiojD?D{LFLa031`KOgp=-539S z11>HJ@sZV$gx5;$$kAcHDU3qE0uy)dQ+K~E&H}!$-Z!J^WcnV3YcitVSors_&yp`v z`zkRt1@TtoACtcSG}-j2YK-m3b+Pmfrx)R<@#-`JHSQAELvIfKw-Qc^V>9 z{#N9`inH$LOeeOVe_M=3rZO6@8xgC0f2+<LYOMF<-Izo@$Lwnv0Yp!MRHzh(qYQeAq{9j`wh&QYa(@!r8c;qm5u z$mV3(Bw1M{SIVqc{>e-pc+XwvQjv;s;*DqKy!Zo-C(IT>Uxmot3jbdCCp%fBJ;90TP${8c}N zhh;o&TsP4a2&096&FfO0$Du3&+rY>5iUM}kJU46cS3Isx-3P0u->xSO(GjH*H*@}8 z@BM;Bj?M40+TbWzfLeeUGdubCvW9FsW@KGfW`eZ}ZJ^_pe|}cqzVq+EYLK45jIy1N z`a&023PZNwKPB2_ju%AgOTOabM6>Q?t6X1+U+w+*w4|7WOvkBId)EeypH@Ebt#}O!umajQ>6rU5^YJNXwX321^9` zbhI$zG>6wCwQ5#j{0y~KS*G#kxkde5lK$d4yTXdOE%7gCBy4AL#1Gwns5COw1yTIB z?agQ(Rvg#*Eq-a=D~zI|T(2~W4L2)uF||K-B-NF~`(QJ)r@iX+A>8UR* z)kJjtEBm2(S~Vrk#{F7o7O;b7N)kq7_b}=q$Pjo1ejD#cRj;v#T=Aq{V#+U&I*<*c z!_s*4W`eZtv2{>7@vboa7>=oUm1z@m{fx4O^JKyEA7zD*UfN-n%vM~a?ffduw*%i(Ca0unNiK7M z)0b<>`Zdxp;e#M37^L|6@%b-EFXP*`N$CzC*X z?3Y1|y@44a_pcs4AjZ?jc(@ywi85`t3oh22-+G~dte_gY5fzEae;CnR{;2xJ^Y=ca z=mMQ5)Z6UQMY%2F3a@loj}7=`X?K4`Jl;@1e%2KFe$ykJ94iBuoYumS=k@)^51*T^ zJ3-K1fHAircN{!RK%gu9qJj-)l{*7N23SGg3i+fH%$;rst>i(2$a?sVa&D^kX z0|SZy#`#&Q5RLdx+J3hT3%?%l46g*+j7Z!|eUJ+Wu-m?^^ZXeOg>B8R5wAYCtoPjt zU}V=^v$Vsb+tZO35N{ykJy^4@_@}g7{g_zQ|2yGOy+25x5`e7>%v~3keMo!)!eL3P z1}N+V0agrG3FJg59i5r|KsKx|Z?p~%V{bGlt+r||_xLzC`Ye-EWer*nlY}0~rTO~p zIxP!D$@L2f^rkllX4z-e+8j3xr^OXXyNSR1tXdpGbrUa$-{*UD)a;eP$v9IifpK&Vc{*!ll(p$no9y(0BDCHIb`juOKJdaJcC4BHcPt}owS8he`woI-a= zM)jfaPx`QLz=x-LtydoWVlCPZp;K?-we@u;r3`xZo5%=W6 z01-q%hI}1pohR(j{zs4HoF@4cA&Le# z!l)4)X!by`WYL`qJY5(nm*s(M9r9L4h=^dSxC!J*Gj{X-Pm)>9m3VZN|bvOeJmO=W2k6rjS=M)+laxua)g5dc>w}Qj5 zSUb-x8Mn+DN;L0hKT=unr1_v-vS6`F%QTv=WLRBdYE5NTIiX1%ud6$zJ2E_O?-8P{ zjZjOm3FQdSyq6sw6_M%${lz9X!3%4t>3brs)9rAEt6?9sp6s))sOmI1V1aSB0g`N6M7rRP zLJcx2Dui=~^7RWL6NgUjoATtHJXh%L5pn6y$2hZR=)bJgNfHB7k2+jf^ z98G!qc0o4EWD=LH>I*}j)!$gCa@5DqC-Z2VI>93Dl zFsdg}5+8Gr2?1~)l0uFqC85EGT(APsL@UucW z^k&!GprsrIq6f%8Duj4v8#q(~J{B_3nt&h;OYuhoi0FVM%TV^sS9Jj zh=>TuloD95LA$awQiuxO+Xb&1oa-o1W}P%pWKN=MwmM zQW2kDTzIuKHc~ix@krO?p3X<3o}V11l*;jw>emq6f|SbIlis16_b)lk14eBvaT;ND z4g>;ZR6tA4&dK@tbsYp&u+72*7-pU3B6>YiPPSr^7a?`hzikx+R&-z8Af3T~h#kRv z$VfKBoPyid%;lEBQu^wTgbL>pz{L zWeS-HU-R?Ta)&^{qeEEzJ5;hg*o7M1)&>Do4R1LHvF1@9ao57b!vhwWr%(UD z=z1dM35dUfun9rMLvihzAlL>$eFh=ZpuAjOS%LcpoCuH$2FZTfl<53Ku%<>7hhRDk`nEgTV0l2P{#{*M;GLpo$e-#4W1dxY3 zfzMb6x-sw_!J-XSNqjdfzc-%;9&SyF2?*?kKMVZ0qw<%JQ*M#`=hiUZy=WkGdWlt_ zu>h(8EtA zK&V6@+*~l;OnveR2GFNy_(58QBQUcC?H#oKK|HnOEh{cg`webZkbE0gPhLPUdLv}T zfJYiWr%}afFsZCKpX-S%tT?L{Rz@MVAlsJ41mv< zbncM7*2tCeJ^9kydNo(kYh$>fZ)0wWvNhlMGGa!3dkG5v7BaB=X< zo9&R7)Rv&)Z+yJ+!2(+&H--jF?IU4hOtQHfrCx0?7Y*`mcKS0!#*Rh(w-~%`c_W>)ukk*@=bPjh*!AG=V*&tPG-DolDf}rX3}E9%_((2(4R+GhWnu z6bB(a)stIsN~l0#xJP(2F?dcBKyGyN<`S$kv91P-Q6R7$|NT1;oUo0@W)dlhh%P|; zzW}v3=q3Ap{zSG-Lc-Ju>{G_~Xa1*(cp@MO zjUcEWFxh|;?-JO7Wm$lYEh{I7T}rAxBV+!lU?&x&BR{3g7Is{zncUUTi+ex0+>9c8 z{lMOeP$OBL+}OqkbELbIp`p`#gIy+pY4*tLdSj2LDjYoZHBtwLS3O)|`H=uX6;Aq) ztzr;3I9H|YotmT5Swi+2vfgjaIDkoAGdAw3)_aASzIusW-s8)0iH*BDj& z$BUP}MY3IQ4Gw;r@{Wy6rL^h+vkYu)5G4->Fiswx;;O3AEe`{I{i^Q;u&x_z|A|-9 zk%;^k9whg;7`-QXzMq@z?c64d-tI=wuK%hBZV*L!lW208H?C@qgAe|W;_~sAk<`D3 z(H84pWBRu|RR2(Y97f{Bk|cgRC}C6hLmnGc)5S!wJsN$RR+HsGN?iT9FnxT6F6YGS zk}PtOiKL;wyr3l9H*WdzdepNRjN$JIaz`)GM2_proYtF@I;i zCy(9F2|Abclp*g+^7W04KBf#}Foi&kke?4BBL0GO5l}X5g86R4R!mJSHs> zt_(B~WCO>k>PtE>01OU3{4eqr81Sh0jl$zyJv|TTy$G&oL zPJQF_IVojICR`xvY3(BI??bDWXSCqZE7%e<$QpQw41r zJW0zz>bFl;N`>$P`;c&~Bu&kYG_2 z>0;-PhG+5G+8Gzh;p*m%Iw%+Zk>9|w>i$TMhkgx@3-g*H&Ulw;pLnyJV`ojR{59U| zi|77Fq%H?jE6MctPo`X(S6*VJt{nL^wmb&y0wnSY=o=ZKBsNeZx`VS4oI!R09DE^J zayPbQbeCVzWQa%v80cmEX0;`kVA8%7may2+Q&Mht+liO3J@nfi~qkyRh$o)^`y3)G;(fN=iL{ zetCE?@bJOM+)2J2x0YEmld8-3EuWOp^s)Tg<%UHq3h16Q9tVszg(_uANS5p^I1e!s0m_hwR|)KCOy!* zMBHV&_}gG4LBI*6uJXWM_5vvgHDN#2adL8kC^(5#`!bu2njUeb1~DvQ`rs98XzgZMu865@l!lo3bDiyc81dA(TVw(WC41^ip6` z(bVh%M<<+i#Y}%Rg@s7z>gl!r_|cmt*L>tz0})doWkLm2f?f@>VH_Y)1g;bHyQPx) zZQCU-tM?L1Mjg~@9fL=37_KyO7$O5+EZ7klH^!ltfs!7Ac)?9_8Z?UVVkCu4u=bx- zFRk5~_|h{)lT7JpjW^0SHLs4cdtmsU_yD7?y9^o-Dn#`An>wVVnoLsyuCz$9s~^af zrqd@q$gx=|*Q!nkE?Yekt-k=-sa@qns-JC!SGxx%K@b@^`TTEL&5a=guE>Q7qhf>_ zh`ougJb-D_?P6(Zc}|eu_xb6VASL7LJlEc=$aRtw(i6y`tYuN zO}vqjYCM`ddL51AfwEKPyRuLu5#<){tYt3}dw`~@iT z4^SH2?-ZKCAMvEZk5)DLxVpyknO}lrA68B9C!_qu!otHg z-}Ntpj=Y6MurSd715 zQyrs_gRTKSj(b(+I*roO;*sU|k=$IKQ$7os9n3^qzZqX;a`vXW>pa-WTQT?cGe2W( zQ~=PWWy1Mf3?DJhg-+B|zz4ym?iS~%)q$+@!!k|;jM8;thbBx?@y*ViNI{O-(MY*3#Bx7h0wO@(KKZh{7mF4&$cI5Tv zf74IMdULW66v*ohXuET#XXQQFlCOzFJ>O|SJn^f_g0H`oK0Mx49&F&Pdr?+tSne0z zfOFdXXG#F;yT{B&UTzkaZy#j4fBuYQmfN<@E-F|LfEadgB;+iqL0A@yuqr2BZrA3* zfi@CXPtU#L@e7~69Ih61sn?6k%RkGChSpHtg%DC(lbM#c3;!t5GC5I2XRLu41jF_H z`c+}b4T82vhN6Oktg{4x(Vtf2u$F-X2(NX%Efl;Hd>?Z+*4GIL2xu*!-Uf-Z=W81@ zh&pZ+W{nTtcS{->9+f%%X}2M2zqiZp%m7hamOmtvD`FFvG#*BB%Yj6w%8C?-LuEE;| z)_at-JvVm+DsVH{c2Za9%h=E$l3e9_8$9|@lO+AvIOjX7DrQau@5r z1o7I$gpr;eoQ~Tvf}u)))+wAzz=Uwp7jP-$b7-xn7fMX;@u8hin-V4wb$;g_kqeOc zxW2YF4ooDpf`Yh@A2%nfA(Y-_@Uxm^O7GYDub)3#f};>lT_3Ex!LWxiU@w>+F8%w5 zzt+X6Ssl@C>$kl$)^zTi(q*~mJ!4y$@IK_~d{U=+TCmuagPL-+c{BSt=0CsqfVyjQ z!gK@AV$5D{D8&qjzu4Z=MJgDbpa;AN z5Y^lR4;DB!XTLDLs5FA?94HkQJBJ|lsZhW8HZQL~{180P&<$;Z79KnjQjsAxMoiQE zaXJ^^s4C;0-15l9WyGGM@!ooE(!SbbJ^62Cfv@@G47bsY1K?r2_&1tYqewk`K6&)7 zRRs9_Yms_B4UQ?RM}<8L{@*;|Y4&%f}qAZSF%&PfDNmqmS_Gg%u@p&<%xt1q(N4 z`S)2jl&cgg*;q!s12XKDTec54(lF66AF1Ea3`dG%(Mi!kg04(ms7UfwI0YMXGw94n&Iqm;W|O>LVA#J6;B^ zu39J0QWSB9o0YyeJsy~xdk5e>lH7>Gw;KDSc*ZyTKH&{6^1C)W_?SIEhH* zvUXdD?_qCYldNf$1K*ktbk;#m5EamrCl%{w6_b zZ|(dVd=FUfjx(%1|NF*_vRN*pj}Lv{)hfaK z**^oPEmXAJW~~8~r)le<91c5!+p3P0m&WLA;WOVU&-i@Y$u)AQ5}!`w^LQ~n6dPyc zPSXeG6`Yj-Hxv>|DJlPlpY!tb!A%O>r*Uv_ERO4nGBX#z*BWYDw?5wH<%LIZ24WA; z>#%2o`1!;ZkmUc7sxc&201_{4^bl4pC_QRu#Jqhg_u@qcIK{yU8B`)wR3hhPq+?kg zb@ldgadMVVY{Ha-gAIGC-t?N9Q%C~Cg|`7G4MCo_y*EWnS6dtEeQ?~zrJiCB2{{~k z0_6$;AA%`^OGxON-_qOFH<2yC zV3#ymIEF$n6@?ulEg{3SWoi3|{gk=WTf-QF=VY%m4mkEhX#IA+?a*#` z5@J2@KRhq}Y$9obTVyy+ruYDxu~mOOIw#Mkrs9GA$>b;NTH0mU!c^LSek-=uN?-Fl z4wHy-=BU{)<=fGBR;9&M-jxHW!k8g;5Da(0SLj>duh@42uQbPG(Q9w{G z2wr~m79rpclgyW%k$8Me?JtsBz=DYDWAvomt<2!Te@ZKZCX*aGUvVSA5=-s7RoapC z7>`Ug!*j&>S#6C4i7Zx=eb|v>G!^|ZcF09@pM_G)bKLeqdXeST0Q&hALZWgC5xhT= zl?+~_HeS<0$^xK0E3;tJ_O7Ccdq&p$aZi_i99|)-|Me!E=U*=I1Jb@%f96U3EcyhS z@c@?OuJ1p;xW*RGV1zHbCr;8q3->=ay1E}4Q4BQNZeuM?9#m1pg4Xk(1xG>t)xjZF zz}#8Y>JX)ab3tJtlwXS5UJR@w)lsB_@a)eLobKU$xG^v~m#{oDdZd6qmzhn};oH1J zuNq@$Xfk&f^)6W{1`T0^3VJKkU5u#Pf3aQcH(V6+-+z#PZWmrhWlSx+n0MXDfNLcE z{;d^no!A`bevh=p_W4iO7BaS8#80&SF*!a8Fk@R&SX-A6MET?pZPLtIgMY*r7+FBM zxT@)X^_e?FK|$>CEe(yA+SS`tu6XOY(z@fD0#(zc-ezmc>pr~k?=kCrTrE!%4idNP zE&dmJKi|coAvBn0 zdUTI0A9a`@j5z9cFiq%JRcy-sO20J)Rb8(i-zF?{whCX7WJ{DZR|$A!sOsB2P)4J9 zyGvpd&%hX{htH;LIG)}j=bDu*#P1l_^9hVddQv^*%#_!D@lowW5Kg+T{2j=cyI!c- zZT}~vxFOYjk1x51V*6!u0F&L-%Gf1M6HaZ$M&RY6{=hRv zG|Mrb>g=ar4=&PL=y+q6R%n}O#qg^ujf%_qzrwH@sM0EtE|t*GQQbBQdS$g?Im&S9 zLb@UKgfWnxF8cF$`hm>3^#T5~y3Y)2)QY*^RbmLUohAjY2NL~?f*Wtn8#EiS`7Nnkbvi8bfNK1SP_22$F8&^l!q1B?d&*P%FcJS#SLFRk9DTuSJ*1g$`7l7cx@T4t&xZK%EX>tu6-z#IlmHovn!x}@m z#33@tO3CH1*^V>?Y}%k`vnKmOn@`J4(i3xcj)J?l=me{O(@kT^NkZ*Xmi&cR_sPZRaF=TE$-)mTTDToCNFsUlpVzsLB}#7sHA zXDg1^d$^B!{U^C9DeM@lHpawEhjp2)&vl66Ce8QQhn{+TFC+5s4H4RaTMJX?A zWg4lU|8)d@KmjKu-ldJmmZ~x0PkE7VyxK4K0E)!=r`Zyf`b(K0`^_%te){A?(fThfCO_;8%YX7Qp?NK%uyq>uY+P};66sab#*iPTa zmZ^6%6V8^3YEnmUeKGT@^>NU^mBJJ060{yGMLn+TuC5sk?l|~Z*%EhM$Gxx_GZoWC zy}`tjmM8I!f78Ux+bn{1`@xyLDXN~>{&tfU^FBI9*Nh*39-t9PNj9|mw9B{JkiTm` z!%U-#k=H9rA^ICLySbQf&NSmHj0aQid%U23?Vy?1<~qr*HVeF7UBYE-8noG_e55j%yR?%2K*jsL|iT?e81HR3g6rhXr8JO@Ed=np4~*x~bmO zW3O^^Y+cymF3gs;zp)LOIqV$8onkS4jx@%2c-|gz?)tN6+(k)$zZ&e=Ux3lDpn>YJ z_v)s#yrTSaiTd-2(6Ms?_2i)Tv5m~@aulMfq2DHWFRbx=J9~_3vWX@PTR$~^F3S8p z?@!=A(Hi|PZBlzgAe`XGhV!pggIf2l&v&-p)FS_C<7r%w2;C^k#Ij{%D1wNYew+2*NKWXO9hB{K8(G2muYBpqPF}? z(z07Ei-x9tn3efLKC^D*DLH`;YI{;a)=LgI6z?3PzAPx*(4F>d!VdEq8v2v6yK&j1BI;QcRhB=z2ts}d zDz|fuZ6$yJH$>g}Rz<$KF9I4VWegoL49A?(W03?LBYGvNgY_tgMDvUvQ-2SIy@g zFJNd(zN)+y$=hk_7R0>z0IzP-AE(s2OBwv=IxjHt@do-cJp$jF1XZ-1si+a5Po4yP z6Z%UMKIh>0jq`g(?1$&n zva3Bl@2#68^8;R>joRsw`4iC9k2?!Md|XpWaS7wq)Yk5~7VfJE5{le?*J9n2MweD+ z(}yiJa;XfWS*o)?xh#F;DqJJ2tPdU(VOUFWwp4q`#xE1zvLepJ(3{NMMQ-Bd_r6b6 z4O?~DOF~%9s34$z`y zGAgo+nB+3#cp}j^H2qu<_ejdz^${MSAZ}WHDwbu3Wxrx+&5>7=znQ3(88#{K3t|aYPZG4FBag~k#?W|TJ)jtv5Zlx)PCbY zatkln4a4WtwO^C03}*aJNxI`h41NUH;$PU>MahXtGnyyqF6n27i1L&RJr=>%dB(vo zEWB*t`T~Jf{FlSU7t#wGHs#t|kDeC(Zr-6m@VL2sbH4rM<6qG}!0D)K#IWR*$-wxpsz8Mi!j;RM|+~iC@nOzHZ+!DMB~yos8DN3BhZm#7hde6p--s zbF;+tzfD<9DFOoC3 z0dxKmbsHPJD)%%NwqK{c?Jsxo`)(8T9V@`LWv2S?H*+g`0~tFeg}Vt^W^zq0LmaIv zDdIw{xQ?sJ7AMDdkK(H9T5byMdJMAW_j@q#H2l9epa@DL>tjC*E4Q51S!-y+=D&r6 zD1^yhwLPNHaL0v_0{5`k{n+n?+(sB>Ep|J?l_0k2hDdA%(?oTpPcAFf|C~bX5v+$D8BWePKs>HUfUW*TxlLK36^jUE$L)}e z(b|L7Yf^t&y$Im`RE5j4+wW^>_^}(!yn656+#{z;Zy2`8-K;ZtUWxYsUzm_(D&V{0 zgx!m3L-7@FsII-*F)H+TC7rW%Y*D{~23vckEmT*I@d#saDOK)IIYI;jB;z6|7_2^) zhruu8R79N&HtQH6h4zLq)J~~3)UF_{{Yj%jhU8kJ zU|EiKoXeNTtbg7`i&s~-?C%VZ9WrfH^z*F-FXyu3+;~5Gjre|%wZQ($oBnjc>dJ;i z><&M)@ItBSJR2)1rU|a&JFB?#9dT9oW{G@7rnu#F*pDo&wO+w6#(`T{GP;X#e4_JH zbC!J#`(`&TqFw#<-cEMg&0iWcI(}blApiwhkd@-w-{W0+7M7&f&)Kq;2#7=BKBz72O-rG<76zP7Kn${K8Mpuge9S56wD$fzd zDOb>LxfN!B&(xm@2M6U;j^b}!mf<(G=|n7#t*ex_H{KDUB66yXwkHsyZsymFBMXD; zapo`oP|p9!@OfENq#dWZF(ZgqO~FiO>8tT*jO}>;;Y)*yKp}!sd{#}@Gf{n?>t;s+ znjd(`Xd?QJC^lTcIaX{?BZhR+s(DOx`itAqD^(n>(#eKeBfPq%qj%walz$S`uq|Q} zq&D=H^gI}c8P}*X&#T+2*<+U%bY9sKXTPL&N})WU#GJC%7C3q*)h`ikmU@+d)-k`Y zl+^98#~4n#v2v7q$Hq%*p6xKWp;B!b>_PPjAv40k`wPs1^$l$zhvD%n#$H;h5lfxB z%sh1SDSlHE$!IaOEnB0{3oI&U?o6cZwcq!ZO*yRXmox<-l%LX-FqweiGs~WMKEQ+ z-zY5;LAd!5^JG7wUpRNgLr^62nej;nDdGiEjWTR9 zcs2+(g_^dRelACz-rBey_C1-mlb@wecH_wwO{e4#SfV9O5?Z~yDCO<&BZ)l02=`f@ z6J=`)c`c|{wg1AMibjxtb%epQK2*exCJtA_W+U8zQLdrAL?i6vm`U(8FI%N4$8;$z zT6X$TtD<=Ff4NLxWVp)$N1S4Ua~M&%ybfY|%7$)b#g$F`cipRT|IPvVgzY6is(pp# z*Ehx*X{1_C=4qN3;`Q}7br~mKldq55=_Av+$wndg>&-kDZ8i$qb(7H0`@7d>-?Y2T zgwPro$zSRhe5%4>%*4uo+R3U4+3(INM7ZsHt5W=^c_PoUM6CSVtvjiHx3KIvT-<_; z_CNCI{iqas*Vwj7%O-+3@GSMc(3JD_#WvHD3KUjBahG(FZ>{PS?~>-fhi?8>=v2?W zetpZ|FqK~%OwK*9b*vczooL$a_OaBHF{k_QOTB4-E$RBr*KqR3fnY2~NqV%uAE^Gl zZgLYKTxg{Xjv|ycw*0mJIZRY~U8`ck??-=JLfu;TEo~w(;+?WTF4B-govNhV3Uo@U zVM>}BsLLwBPj4Z*|GfuoIHhgCmeHJA%lGCrDa_ik^bT1W<<>~grs!)UTDiES)F#xV zwV{9hT-{o!V~9^58$T5PfvO?7{fLWvM&rirn-p_b)%Z;Y-C63e0cDA0XLoVrhBjZd z9*Z$^KAPs?$s=t1m_c^*JD5H8zKZinPjWl0e~D;ga5LGMb}Tk$p4n|tmW~P>o|?Bl z$9p}3u8S`!)l}iOIm^tuDob-rS8ZTt@-4;?+6+48EBP2YFptMUZdhppd0`=I&`%C{B{_y2NZ@!TFIbPJLLHF%LR$X1 zhqA+w1jVg2-cx&ZikUye=AzUT={L~Sh$!EdD1Yb3*b$Xwt!HJlL{-m<(WXLBHti5` z_2+r)&r_b5ht}>8$t=8TF3S2k%JYObR6D3IT=&0Hn6&gwQ`P4#69_zNk+eN*Pjv6d+ zsKilomwvt3=|$y_?6lI49<~Y|5js7Bisusj-<9DyLpm(UxBipQ&e*~W{n=fcTM==J zCG#&|or%XKH<#o74jN13UEASsK4yY>{qo2Y^I#~@ne%izF z_M)HRr??T%1qg=}jF@?LFx-NqY^MBmjHP;RygCu#zoI3prWGsr({pUWh}^|6@Zq!RAo?ZQ6)qjMrbcBvgMrRkzQ*~1zeF?bZjSryul`>LC^$K{ z5K+cF?!1+vP(15Tpqf_27Usdwo`!?%IdEC$U#TxXHtD5pNmsUapk=wo*KV3fOD599 zxKl-064^_}8W_o+hMcR|_uu5+v2;ihL_d(s;i&HlAU9`1y5||CSU)+1VsokvG1aMV@4N zwsWn0hy)F_U=JR$EV;kkW!UfKrY(Z$2n_|C^VG;lvzc7)Iq+vxV%IT0643r+3Wu6? z&Ae;8`?cT20N{gSBkyB$pRRyD%#%WtsTiwym*Ge2O2pqI>w5|g#R<|v)-F~IV) zHnuZicbe*V2@}Pa=zq~!|2IPR6pL*PEgaY}xLT?C1xlaqQdBoGZ0a9BWVT~KC7B^c zuNQz%APYUTU)Xew3IhwNJ}Ia#16%vIg$*;4rdx6ya17*`FBT<<_f zrv&WsF=jG%lCxE|*Idh%nqR#%CPo>{UlY+4AXpe!I+*0R^McQx#BM_llCTgxY^uKr zw>n514oFPdzmTzUw#3(~keQ1;#|`8qYL~!HXqRplA~@6;B5TnLs=1zv>xM!@7>>m) zVZLJ^rLiXMGMy)%5HZtA;4utyuHs+p$F59RGQ4LVwq?78^18x&c>_CEKWqdIr%|%i z+@wgR7jq~{%y4%gkeNi_IeUIz+8UpF*6%q!0AXPKMMbA=y_TBSNh(in{vP{Ddz#3A z=hKhMc+kP+6i_FSms82QwO))c?)TvLY_-;z`dIxfKlJZvShP6fCBKPxK$4+KJenky zVwUfdhm{&|sii134HB7D>aY=v(^vB93YYcMd9U_g}CfrgYLu3&!x?c|_s zOqSA)L+L6+Z9?S(N*iXjKXU2OYcs=p9F&hhur@JctIiYg5)gl`)jPPx80h5sFO*3d z=k~cA2##4IFutMQq@RrT^*ufUq)D#eyQC*jE?s*1jQx25W``fe_jj?m`l>H^F!E6~ zFu9v&umb4oJ`;)2L7jhP*pE91*0t-%`wDNeV$d}zE-;Mz#L1Hyz$EG9nxgq~Y@I6f z=7w`*p?=Lm%e!6@#z)wX{PWY8sBgxziG(NIJMhHsSzfEP65vQdNke`8oxWWn4%G z`7(j*!C)ZK9406Z0GP%Q4)8!L()Xx#8t4tZDa6QkNUi^S2jIQ{9Fvlg0;o-Z|8H!p z!WXX!BJX6uLA!7Spyo(jI2DciKm`KfqB2&vhs*%v3Ln`W1D{S!1*8!QU>D#35Rgz# zP|RXP|G={OyUc99Jq)-l$zrhuH-;fg?R?3b*aM&jkW|mWemyUUfd9jhCkQK*naN>W z5SIN0{P`@Xq64V{PKQ5H0OkUI&@nLZsrZ7IPXLGoaD)zSl=e6V?Ah5_usq?iEn-su zjWv7wk{(mwDDm*{+`j$eIgj2uil+dsgp+6hHvzfB7sSZ5USOlbs33BP2d+;7-1dMu z6&oC%IV+TE0o>ZLX&!=tB8PWy0dYu1+n%9Q>4)c~0^gyVgX@dsy!4*U1K?PDMX zc@Chn{q@nlO>P<0XaJ!?YePbCtETI2wm*Y2TW9Br)Ko(_7{+=(CaVI8O<;LykLg62 z86l!QZl1WKF&rs5Y{j1_;^+VmA3*ig!cMtw-*&(uE~o=;?N0)F({`fr4hxG3KuSRk z`U6X1&#jOQrJQR34Tm3me1NfSh=8>b64Wu7mXwg-admOz3kZo1EEt%Wm>3usSXgH# zC*G&4IpKO+F0dc(t-XF^EA;1AmLk%c1L#Cw(Sp{6kqfu{8Lg-r;E;(Vl3x{kZK=P>Z zsvZu$a;!}|l6Wc@Ifx@!*e!sLw{nXAkmPeqy1RBq9&JL&N7T;2M zZ-uSz1wZ03V>;u)O3&3Oh2Lzb?j2j^8aD_Q*J;4uB-9Q=P?^%JT zsTz%JFktu)n1pm*E%*X_q}KGJZgv342MBkPp#2L#jX>|1XcJ&#gQQrH8rio=n`zL< z1_(PXeQOwvkOTBvc(Z*+ACiKvRcs&^PU8-;cK`tf{YYS`;3DY+99l)3oSY`_-90=& zSIZmZ>|)R8^SY5Ck8#rp<_gGfqpiR{fH$dn^}Cr;P2)ajRx>ltgYYGcpc^-Ce0~_V zwh@0_YMc{vP@#c9ldF8j33|DJfDG>dFkijvwgCdbTaF9knD2ROC%5FMK>oUT6b6sB z_Ug0LsT${ke}}#REVIBKBmk|IzP{o`nlGB`0Hi@`!cV;72OyvJCnVbPe6NrD*;hmp zF#f)o4`hJ(%zJwA21a3|(&8Hm18hRV#@QfhDmqfx5VUR)b(asLg5N)Rb;1qQIFG#on%*Gc)lNfW-I2aqe8G&l%ygu@K)1`e3*j9VHyO*Hl2G)2} z&v^i5|LDVmi~T`pjwJvtZO#Zs^8QUL&$yl?2KQ*6*`VGR`8GfKdz35YBF3k%Dvx z%q8;BH@y7MLCg#dv)lm{DRbZ8CDgYEqSdqyyxgp(@!<-1J?;!5A!KE7uX!qNTHRhxYy1{ z)dQ|~fTcm;(F&I{2JMPY^YIx5PTIg&a)(f7TfIn*fUx2QadvNSPXGoN%;(^Ym2VpQ z`jfDdK;WREqy*TNAjrZ35ev}V6~H}dX<-JRBEaOsv-G`KH>9Pn1%T!eL_K(ZNR?~= z3qd3SV$KS{$3!?dtiXo^IF2swxw>}&nJ=Tde{`h$=n+bPqwf`9{SGa=2FvNAh@{4U zT2>(an^Z}|9^QM=imggYed>u&(a5(-rND2G_Ri`f~ ziXVo$03%5w1ez2GEKUb~u|2w?$GmJq_S02(N^(@GLf z`$-Ew{|F8vEAt8p6qS`>4j`ekf}6W{0r3Zk7HCKQDD{Fh8tBi4_b;x(lV5@_+L8Ug~@hwRrcpyp1 z$(zs68Zw)jn!x163dubHHART5FtqC+n1PHwKphKasZy2`x%Mj?`uL2$yle~3&*!?@ z_y$aRNg{CRpdcce88i8@SC_#Ckh9%`18a|xL2Kx}>KAPxNXJF!HUM#^faAV3RjP)D)kF)qTw(g)O9b3O==PSmch za>#wjFH8W4+tCD5f)IDV_&O7$Wyt2j90p{vPR6ZF5e0eqmC@qqcOKRV5{0oRPGA+xi2|Cr^5S)dM1{&-ti?!omM&5^_c~Lec)++pt^G2ZsazD}xTF zBVZjNjPSNYxTd)y2sR=VbaW}Hsf`YcU4XlmRdv}MUsT`zPN_yJn=|;M^c>RCBAp6_ zf?+yP4*m8`5Cl?Yz2tyDzDV=LN;Jtp9l)m$9|T^F0a>5h0ai*!){R@6IHe|BM^g8|nQ$J^4;VFoa85I&t3+?q?>b_SjT zl(g_+f`Yr-_ve)NE!C~~bFBChV2XlRe?rev_Sp&!|W4AAhif%z=4SvXU_h zST}L7v*#BSaQ|uwUp@iW-?+(Lq(Cannf1|PtQo-|J3wwj3Tt&jDlXm#>+w0HRIo49 zEYK((?Mo8c107w*^W7VK=KVlM-2;L^GAJm(G76hZaC~|n9)8(EfBAaP;u)!|97Ut+ zl)D+|lf!^}_xshz`T+z0Z{VpHS1(a@Naz%TAy!vQ%jZ=yn^MkH5!a%0`?tU#4&`nz z=b;=aHoO9Ez#dRwjNfZ>l0%@$=D>hX0?Mhd*RdV=Z}pfa@>?e`V1p7ba1xLlMcN(- zR5UcmAGQF>TqJfSR>SfyC}6^N!tva=-$CHlo7RpF8%A8*f5IF7((XYZSCQ-6J1Nc zCs9XFZv{gs0g;!?B<09lF1yg)9e$m+x|ALJ-SzGxwid;-W9%ju!wg#4q_ zcm!0{{=K*<_y1kPfEVS@{y$%rq}+NFUaBF8;VsK#d+&S*$92iC(fCkpiQe?4blyZ3 zAc%g+#>82lg|Oqo9$OnFc~nWhuO(pbm&NIsI}4`AdSH>R#=lC5yq3Cg?C26X+34@` za9dIZ8%f+`qv4+ z@WD~pkDhqWsvnxVz|KlKuO3rPU8tgV0Ua2*<%crDRmb>_XpXCNya%`T|KHv}_5Alh z_60Sy@8p*_&!JNq3;Pl74!xVqjq1So*QrqcvA-K?>2oy9_@<=Sa_?2tkR&6W?W8bU ztK#Tw5)iTb@2QG~%RY7N?kR0XPj}oc|DAnIB@^#lHsZ$hzlXSL??#~Gw=8ta>1p*F z&bv>{!ZvOGC7Q?r)qi!X|DR``>+@e#s~iQ5G={ew@t4N6LS3@z{|3)59T)8i_WV@I z&m``M3YV-dc29GRsO6#{P1;RlsTw)L^r+B&x@5)1ZiTn@M^82Q-MaG{SjX)oS<`0Z ziJKvk98QNcB3Q_36!I<<%jCN^_b4ZTu>%9#ViLbuX2AKII zX=<9e4*Bh~iEUvZuQeI(!RNi%XyECss5zBY9Md)8bv0Y+D*i;=xPESrN$Y-X2BwF( zVH|m)noYy}VEO(%jStOysH}Ehf2>8wDcD?@_-002{=nfy45es2eDbfg_9D7#qoKAb z_s{xLH=NFrk9?0#=anB^T-JP!CAhQLA+B4q@^1OlW@pJaPpV8Tqt_WP#$Ttk8W{NM zdw%)D>AoTpwd@u?FQmk5XCTa5n0A_~>*yoG$;mrZfTijE-&pvgbX&N@b~r!Pw};*7 zC^8D99n zGW(!Y8{`^AhmlfH`Gd7DzNOBYDrMUuD&dg%I`k*448PW^iT(MiZEx=kIQMp!yE%E< z&s;?qdbp6jWw7&eTD-7fyZFd6N&jT&t%wPi$@#*Yqe&6A?a``OudnG{OZN_ez*Bdm zDNc*^nu5>4eM{@=WO~>3(C=D;(|p|-`QxL}9mGPH@idqIVcQ|I2Hm5hUP^XpqTb>s zy7{=i=P%k4ibt03iIB8hXYKJ`IQr;uwj#2FB~?RQ->J*;`&L1UFvXJ{L4ps>maj^c z7OGQ@?6Lnvh|B<*tDQwT!^tVvnaIllDgB*y)*P47_JZ>PwpTH)q}(q{ywC22(oZej z;5S!M|C#QrJ0*1db0k%;_Pecw%&UW?9$T^6+>n#{(08;zWUfCe)!(A88;M_(T0;w!-iryF(-+n z;19-m9EKQCJOR1)Z#WHC_W!oMI!iTv zv7cy|R5i1?UG_z7`q}wNVas{A*YVHIzPieb(aoEV9qW8aERUwpY<*7Zef8;Y(VcH7 zJEoq`#B%!xpPt=jJo9;WGHB2z>3CH=mrUww;#Kc9J550!`#lc#`N|hr4x0$7VR3AU zlfx>T>Z81tjzhClX?c0pt7r1DH|=OTq|rMZlR6zUnk;0dUW$l@2PiGbrVL`&DJ|Sb zeVa10f;{noMMcu9`7GX{(eu&|tBQtQ?PjmuXMr2{`4jPZ5RX-#HS(%;w637EhP|Vh zzF-t|pQ~s&N9M3m1b&vcm%#8Bgb% z;*Eoj(IlEHK3;#|#_?GK#TY?PPU3j}_UdxWb~?*U*R4HY!#3)z$@Wir?A22Bc9xin z>7lV30sgcV{YF!#V-kZa=7!&g6Yim*hp#VYh3*JUB@i{Eup3{Ee>yX=Y>;$3pihwh z7avwBKlK!g)y%|fd!I%mIc*;3c>eBvvffSBz8AJCV^W&+K+h4uDpfK*TZp07^z5T@ zpOAUqw$p-4{g0+RQ`wT=Uo;bwN6qouPq*`C(C@(EDZWa>d6bav#q>bnz^IUn_JLCUR97#_ar;`%kTdO1tWu=7z>38anE9|DB`+ zexp@ON6qCBOiEb0#v?n2#(d!+>tK0Pwtu6EBIFnOXt*B^29@+@Ne!mRUsU;-JpSgKC` z4t78n<@@ydbN5w~*_1-vu$RZv;^Kl&*{GRwt+}evlRG`v+djFEGuD%sl8J*UUU}$RJ@XB8x9xW9Uey&YKA^}x<>LYf9wl+fxanTY5j<0Xx(0V z^xTu;KfCAlwK=X`v=JAZuA?^)Es?rchdExW)7{fP4!ypjFS5DoT#HOMDb5PMe4v%u znDng?KRfCBB<3^tw9vL|$SNoh%XDbuwixR!k$@4NrZz3vqDY?MYmKKqf_h2%rX#iE znPZOsx5S9d6^UOt^?1Eo{!ZCsVlM63@en=yd>QM6tuR=M9bDsPtozUlFHFu*z@oIHc!oRRF=R-HE z`e+ucyaX_1Z(`gR-MYv5rD|Te0cGGbY6dme;34$ITGq~1Ez_O08`(~!G( zpHRI0$j3=ZTDEdWkBAj0%gybzwghDM;^eRu>OFdgD(n?0Fx` zODQr$o_ygP-TfnEwlu|JGF^SP@kCd5fq*zD>+D*0^5y*ER)w76gtqgnhoqIMSi9AW zvq8KT9{Bxt2l+0%7CnY{E!7%R z0w0wwm$Q#iNrLRw=*jVSFd&Jdg zgf_FBlIO~VH(8h{+2DqG;3?Uh*45uEqBR2ZtIPXlC+ROxiTW=EB^Z5TBA3*|5;p%e z=`mXO@0x`GTi1uv=SLBAb@#a{pR{DhF1@;#%c>e#VHLY-g0K74MJqtLl?TJc@akFj`p0?hLmBim^USduf&$|W zTqSM^$nK*G&#`NZrRO?l)Z$+!Eb>|}X7yBVJj(k%UU|i(!|I&4pA%2gEc80xIMt_Q zgLL}f(sQ}1<5NRpsnc%2-uSmFZtV|qzv4+)ryp3m^{p{vvN=wc-k%8V;*;)Z*faeZ zbC;r_%qjFwKE{HL*IIGBHP&O#{i2fWrqwJ%E-}-xDVNdu3*Asenvl{}xx?h)dm8`9 zbm{YjAA?v`Wm0KQ7h0*?Tq7fGz2`A+ z6}fIYqoFXCw~|Glm`3URoclLAECfT=kH718bl24db}MDu?ww-wFw}FncpqNYE+w{P zPxCS+q1i2Q8tz{boV34l{dqsf_W1a-{%tJZ51DC=Lu${Gt|qGz%PudjQfeHDxsDwfg&jj^fO4H9atdbe!v9Ru4T1Q?;V(@R2B3GMc-h^zX_eC603*CX3I zrw&KrS3}~O8@I7TLxz}b+gueJPWV?32rped1-8QvLZ_z5D}5UW^z%-;x^dYz)_ose z^~G+#kGQA5NfB=0K;$o)D3H^P7F*N7=@4g2=gPq!Du9oiHI8or+xo7YE()rg_M^`_ zM9(ja47GZ;?zr(Wa{e*rUF$s`Xv+}d6#et!I?rE+XWxd+)Hq#5k1Telh6w3X12@im z#v5{QC4NjF{$@?h5)l@?+zP6PYX8~g=fpEP!p3bw`g&32auLpp?MXWx!lIvpxRXS#x#is$G(-)6#M?PwyS&MZ0U` z#(2&7R_jXA`>@6>j=GxS8-phAXhuSl48FA%n_hp67MgPdCUbWBtO}_gQA4B%@$hp7 zn}wvaAm^4e>Ibh>qKBgmpUtVJpPM|?%>I?P9H(7Xj`jL0NNzQ3-r{&IAN&NI~#Q1^#1 zBz#PqrYuHn;iKnFF@;GH7vy|vGWu!8uwV%914mo(K4ZQ4ZEh)@{$)l4f`dXm_4T@OvQ+vVdRHMLwEOt=Mv1qGM`rQ;=H^r{XLL>AOW^pkXSoA*7-)y|(&= zOBmE}ANZzyPZ4h6Q~ckh+GXE8M5*(8&W0cu?-I3PZLT=SxfQ6Q!27VtNcDrv&6V3d z#c5^{jHEKxSqyDH~bVS`j*c7MZ}RB85PVR$dP> z;-Wbtdx2~U=EF|<%TcNu#{G|SKDgep?XF5yfD>&DIR(<>XJ&V?8FeCO4#hC{*D_7% zo}4b#dK0{z-w$6*_1ZJWkub>|{&FIA^2R;qRhCUL>T7ehXv`;r5-WUeCOK(me?KUX z(%g0sR0uD;bW^S27;_$qR5HTMuw2%(6tt>%d{2^1tU$3l<_gy`(160)@R>IuGGtpk zi$;@+`TT29q>Rye#c`0?)y92w@QL!z$6kf9uWDx}YvYwOW3@1Fa(!H1X7$YOynXnz zO-n<2)pl9ao54B$@A1{eq>%6Ia)i>wFD4YZw|@@$CJ;LNR3ax!S=(2~ZLODvxBl#n zfbASkY)SVzWC3SrxUYAX&Qiq<_RoJk;r??xZ*@JF^2YV;;|{9`Wq~f%%}RDNvK>rm zcQ(Ei=Nb+U9Lo*N@W*N_dwL=TO3b8&S+$rKl7(5?OV#VMDYE|y!7U$x`cBSjX*opj z*0}-+{tlEGdWhF-N8G5^$R6>wt@Bp-eHwF?WR%=2LFIGgJ55bGa8LCu0^yY0-f-UT zsW*{g%}FXj#e1;Gt&4Z!JpE1qw`PpM_+fZB`s>aqU-$Ly-ub8O8~rx@*dz#<1E1%Y zo&thl0TbAW=c|0D!*9ADUVU)d$RtEm*i75*A2S*;N$|W_lP)f=izko|#x1;Ow3|8| zTAkOC`#@{i`9)E_4R26Z8OiIBUo(HZ7^2rOxb(R7l2@roGe$cefE(XWjm4ugc*jS^#J9IF(?N*lY2bSj%~^2_x0#`s*b*4UU)xTO%U5vjLXAKpe$c#R5{c3*ctQT7t`-e?h0 z3;dHETQvVX&zhcdtw^T?GsvR-8Kh5-%RY}Qc5BvUj)xL;ph+Bmdy8Lh`^7o)YCo#0 z!q(h}0%2Fmd!C)+WbbW7yZWc9J*p0!Naa3T<;r#E^=nDDOGlzA4aHruY$cK;0u1zH ziKEm~@$by*Whq`!adu1kKlbYV8g=w6sHZyGtea0Pzp&rXt~IuPFfk@SdeQO$)=q6+ zHp5S}C8DLT3`VM2M;L6w>RIRNU-_{3Vo=*ki4`CAlIE=os!YH9R^;tlqT!`4u7%ga zCwSQ14)-n{@L;=SQ{gwx40>SGm}^LScvP$YqR?)^QVEJm?{j==XIuSI^)5%TxBMs! z8OP4F9P<5!qm^Zie{)&AndffK9WkjAmiL}f)NAKms$rF6jwaFRFV9l!k;Z2S=b{*z zmM)L+Zx7tL^p{SvAUYjGaeOv}CM9t@3!N=10k=`BtWbM|Jo$vMxoIbk0)-KQ9!S&} z>b9w1QOUf>F-2p&!mBxLotb_n$XL2b=9_^xxbYSF_?NI4S>)v-rFWdXt8ZX4OFs0+ zlZav%{b=vU6M=q1Y5<>mcrRXL4xOblI5skyp`k%1KR8yZjCr8tkgC`szrMA4PgmQM{APU=e;j-t}7;$Kb9%D7@w%0@| zQe@()sOmT>ZCKGv1~PTnNeD#n)1LLOIbMr@>h<2Qe%bzDPWM1=)QDm3*`!U71?L96 z`M)U1`TZA3QGEfe$R`X%humxig9SWI1VSMrlHwJREQ4tzm-%Itf&ZD2k({qZYt1ocGoG55>sh&TJB<5xcpWi1> zV^Q%EeU`NPr?I`?Sa0la_33exd}PsF!FQffj{ggCYV1nCKavX{T@i5#2chHapk8NT z2xLb|L+2rXA-r0P_iT)#`Yg#{f*{h-W3@2KwHw0==@JUV4mFW*s zAIx?Co)>qHL>I$0Y7+glkBB}N>z(YL#1dGkjliMi9UZc@oPXdLWZ{FHBaqwRzheh^ z!O_Z|Yv(6#iCCW}-$1;6I_Ju4u+XBrK7J%XSo36yM+G~g{@j5kcz&_69)5ce2?b0l zNsHrETSXiJ*?Ik59;{PtznOI-2 zmUC4@c!8JS{3BbX=AP=gL~zj{(O#29dthQKc`}uS3(N}v*|l00OS;76zuZM=>tb&O zthN+b)}$UWsN;`S-Pxs^Fs+{@?*3XUSf3T8+04^}`@g&fg{aN2Vn=MEk3K*ADJQk$ zFO-{nD`-F0Mes}T60J7`Vg%$23(BQBWTSpM%Q|Yf-K~6jUq!3XJn-upCo>A+a{?g6Pkm8u zeW$M0OZTo?VwP8dG>`|8CF4v#1<_RMes?d`YWE~XzF3%`fuoj?t4}vI^X=i@cp9wG z2(%>x%A8EaZn@aY+jD_bJtDn$=nC&fiP=TMWPYTkZv80>$@lX}5zz>cQcp^s$i3#4 z9EYiP(CxpgQB0Id()|#T7DCTfg4ZDCHD|a$fF@<^FB^a9&#aDb(8bS_6-=^lc+naM z+gf$C#@jXF0UHw(6a2oJHy;`pk2Ai_A=}-0b1?G*UqVMDF#k)|baWS1ZD0C=o>5{|`;)9gpSz zzW>{d-U!)yW@pdr9oaW&5|oMV^!B0Tkmoi>b;{a^S8cmF6JA&SQsQgk~|Xm zj#6Cr`XVCNw%U0iolv43O}0A$FCZZxbUakd``utjKR z%oK6(#G_j|?QY~nSo$@d-`f3@CaXpK`@$QfzA0vwY{q{m)#MUzoahpSPd{V#*f~0# zwrI|YrwF5U^U2)qZZ|KaStbd}&~{1RAfyJf!qVhRH4VyL_7&eESNJk?@w@lHf0tM? zpkXvvl&h}OB*uxz(*++M^oPsanmmtosi(=P8yMolUv){Yc>T3~!(~~B;b#E;s>i^d zm%`FHr_3;US*T6rU4t>}h&qDE=7I2HLT{%@wHvjim-X`>Pd7M?m)u_e${+Zq+p(!= zER8AE8fKY)+B4J@yV=lsN^i84n<4>kmhJ!EY#?qIMVC)Wq>xUKWPP3Z^I`-siHGt0 zm;YQGniUu5IiKUowPK{+$-y{MS37VmTEXpTc|Q9tCXrDw4v#3HgyAPYb_S8lR!8tp z9Daqd9JQmFYMRhLo26w44Nkhb044m=S9g{StIDgDI4Cb#Y=Zmb* z)28`iu_L|MNm1n9zs;T>-?>&hKK!MH6Vin7zqjYrXJBBaVd9_G!;fud?3O$hP+aNb zRP;GMr{h=47A1>vH4O?8vxX$5zQPi<*e*7E`VeW1`blF5zIZuWa&)5M7lXo)uX;x_ zVZ%rm7E;c82KNOv{YrIwf<*CpFsBah9ZgLY4qWFx&6H0-8jvrft9rdcUvb^4H*IDb z^c`k0B$&xI$<~~kczAdaIS^6+$SkoR9W4W}eqiek9I1f7$5Eo0=eWou3iJOG+XuKl z`K{S>`pkL^w~S9^*>v^u3FPUNUp4yf5{IQA{g?Ya?{~O=c-pn5n4A%`LGT%I`ByY# z4#-ym*K8z(;!=!j*PZfM!%`B<#w&d#6t&17WZ`h1WPjV{U^EfOV-}CGq)*2BT>FkO zlFH^}#GK`$0*Y!6*EBb*T+>jd!23jggP>*L;i;7gmGH^)0%WACOFGI4+|hv;u@%4N zTOq;#xTqM)N9O-7(T!CAI=1g?b$ z|AdwCyI%6HhoYguO;3^}+6)?2Iyw)-h)c*&14>GV<>voQpjrMh)-RZ4Zx64DMo_WBAE}e1p$&-KtzHsw#DF0+KSi|L2v}xAz*o&Xl>! zeE)YTZWrpaS9>G>$3N-;*V%6~B^Fx9*#=v_@7WUmKSzEz z4nmIe<$%dGfc)@#vKPH}E295S3~wHtgM%6-EihKZZh1vEIHCD@d3iu(#!pS5PMVlj zK4ticy-rP+5-;`HAg^#r*TEt->m3b@ewYXe?QXC!a5*(q&{U#R|G4%{Sabfnn~VD| zk0z!OD|1_{mNX2VqDp&R*u$5a`}}~|JM&^&1jp9%pkFTgAB&zlK8!0eA13z{|4YMx zI~|<~xn^7Dsk`?gi{IOIzd^a%VaFjm%M-n{omK-Gq9~3 z`1&b!jf;9CuJ zMO9d^5(DXzE5}2sIh^4={LwJ(#SVXe z5Ox?EQXoDp?63959*I_!u}Z(#ovMKEi)DC>0CQ)X#yOTkm<1{NJw>xtSIwmr!6y?R zA7A>i9YiiL>@PRi4KxzLU$4#k)HW>yH^K6}kK8dTR^r`&fu?3H1QdV>gOt|_^00j% zllo!GfGO9l8z&e=-wA;40k1e6jYM#ZH*jd`H9hNAs7%y+mh3CO1VdH}LZmUe044(Y zkD*J{^zPM4C^gJxxY7Vf$Hc~NebP7YfkK|c;3I%+5Q@zb9Ucy@{`z2Iwjp|IrlqAGyX;IpDb^2+mPM5rqOwE-~gxBLcu=Hx4g zP_`s)njDwJi^o|oq`63rFR#Gl)Dze_g(wmv1d#5p;d})j7)N?~2|%5J_Qwp&8Q;FO zmufZ1PxuiU15KRCD1_qASmf>LLdjV|Rz|as5dXVU_cbjpP6Yz#?Rjp$X4l&?Q zSs6IM-Wj#rSVT@BgrwXT`2ky+uM8bQyUghS8SnHB9F>eev=bwaWYiQyp8kyekt3VV z7&W+b^?sMW?C|R(UgM^gIHUmH;AbI&hgB8G)R1p+)EWh<=+LgLd0H^F)qRz@I+0fJOb<;oQa zH3LD3NT%v|J$RXq+=BWLivlz{Fs}fj;z@(7N#^hvmPPRO^zreLmPST|<=qU5C%bdmjnbNK7Bg%XJY`M<7ZdbNC+(SZs2_3 z{=yBQkp2QLqpuvv6HcV(C#o4P@iVnO++NFiF=ACYgy`~P{~seay>x0v~HsLA@R z=a)=uapG=6YA7W5+<;sJwwXh}K2_9{2T}iW4!FV^0M|WXK!N50rY7lba|;XZzO;mz@qvhY_b%V&2e#lm7g!}fG-`ehab=8*Adg7U)YsM~Xy&bIR{R3oJ178P+?bqS zUEiY9utm7dyvn{lF0SKYemEaTEAzBMe-aq(9eN0JgBMo79V#i|N*^S#h^iUb*cmGv z0O=Yqli6@tL19P@qYu=rjbxz8cTf%=+sMHp-O9c#JW8-m_4Dpa1BX90RHF0815-g6b;(I+x zN1rDX%0x!`eE-(Zwtp!oGUP-~BB#{4J+k ze5;v!_XmEwVW3A8+K%x2tE|>I&A6!-q1hk1`SoYzC3|??fNm?6C>r~j>aV{Pv-UrI z*BDKzsidD99`D`go{bu=de9m_@Uz}fJJ@N7-sIqphUL(3_kTARvU^~I4RVD`h$ccH zEMNv*2C6?fDG7|H?O=TKYhe1+^yBqOOP1N!VCj~frEvX zQuvC7#QlexI9j)JyR71p;^no62Armf7p3W z8CoAKTCd7UhYf7}xx7joQ)i4*em$itUw!t;_cDcKr0J0h0dtpVG8V?lf4fsg_gwK* z1Z}GshMXBVHSBxCi1|9k#u>E>LQ^p$H3v(u6+GL)-6m3XCvevrf=Z%^U#d`4A)BhFY%=ld~*j^|{bHm8oP210Y5`u)Nnr`tt zvVt5IeEffY{*NDHN|%5t0zRZTNE_jU1CmU{TJ_n<5ZHDY3q@tN8XECmpR=;ClFSolg)Yw{ zj*d+KhklT`eV8Om%PYFwh|Ja&e)@C<&^ssrMKbrxy{Xg5dLlCxqnHC-9IFcW@8?wE z(3Z6cJGr0l=n9Kt{U-v=(y4zz%{W1oJ@bilF4pmQiIyVdmNK3|mzLhtSEz0J`A zc-yM(nMNW=SEju>GJDP6L-robU(}FK2-mC_b|Xt2H~6dDuqlB^zZ)20x4D2Y$${U# zrj{1y<%TFd9RmJCq!sB%kVQo8>QWl$ns8{VR9SsDvh!_20}-NLbq?_6AaDbg{5>H0 zFsxyt;kig!MW@79hKj(A`|)uDw|R$=|2v99jiW(H6B`~AUiLtI>+#**@qhqZH#e+Y zr2y79B1dKKUCz`fUlluI?OogYrPNGgC*ygT{ImRd&{$7L!9IYNptUP>Q1g6goBrj^ zq0H6W!ixL@k6#yAXBlC{gw~}l{esZH;$(_0plWS!>nZ3U;`B*@q#|oqjSl$XXK9rPT$OTjMzkl)oA@si-PKC0yZBQ#>QH%S)8VeP) z6h=~FqO6?UTX`H3t{m9Efv^~KiJ!{K-bk8)ihOe8@6aUdr(nThWMZNZ9wHygG6+`H zNQBV>*H{Ab;$ULOO!`EGY6dd(ltc4>Qp{}m7ygtu3MK5zB^vn%n#2rjMDF7DN*Sw4TxHz7hEG?Q1y=tMM;EP+jOU-zw`H>XWidW+E=6pQ!y^!MXoND6Y@lS=4VWE8qS6I3!NSnwMiGL z8aF|$?8hJ1IfYew53V2Y-exSqAnCPbyJKmX=r=;wD0IhLP~{=sVM2#Im(v@x)U z1EmWbC@V!2+2oqj;797{Vc6jcSR`k}~Fn^Tfhg6ECFiao>Pf!9N52(|bR3!5@-wJ}k zp#DWvgYYP2Kn`PjwvGu=Z#xMYol%Fd2066s3B3Ed4yTN-*P=o51Q~rhkx>1dUHL^h zfnrAHbA6EwRcvu-@`+IQh;LNxWok1O_B!SF8~^dgospI1wEqPUhSz0yKeaU`$CoYS zS!%F8Aq*=HUt(+6p8V6UM(&-r+3C+Z*x>)Nq?>V4TW0t$gvx?*MI?h|Y{pu1L+$3? zgyf#YJA#0DoR`wCpC)(Sj;PnZDYsjzdgw>g)5XAA@le?!^Nzg_( zKiaB-OAjrX+z28tg$HF7^b}xgn+ry|MiZ8(iw`sEIu1e_&dMK zBN%+Jih$VdXt$~Zwyt?r0xl&Qo+TEZgF%z`CQoW_p)>jXLkJ9lvU3R(#RPJXRaGHM z5~ee1(A6VglYFax&B-wZ5ef_(Nmp0b$B(~44TgmtG`?Nl4mT~a*IWwY)-YnG+6*HX z5_4etI2F}YC9M1D%G(IK;U|amhTgg;vDGxfrxmqPt(QESj+}b$UjLmI&lA>c*R+?* z70SA8s490 z%hfsK(kf<2YK=0~)x*~mIH3a@ zcdx2wFmk8hZeL$OWg~vRem^+QxaxMl2OBDqoeBuexi!9kegIT+*PzCX$b%fW6{uBj zV<90>cfrBqrzZ3YGI*_3H8e&c!ME|{92jxJybZd*GuYG%XAV8UPc^QOwCxysfxB65 zLG4O?K^hi;Dy)~VH($r&{EatS;;7-=$j+R=Aa}PjR&NA}rtA#6jmcQ`v&|5RvHxm= zE!$lJ%A;(NFh(&Q-LbZ?k@3# z+27~(NYGIzc}m!P@1^bLVSWFH2Zcfc*XF|_+oxXf!_*j8grEHUk%s?K5}-*X%LQe* z@0Dl!1i4Lc)u~!(@FSqhS7iS^l{=5weP@EjRc+;&d^Fh!h|jc??DnZWb|$ty*T_?I|D|9qi`=jB#@3n2^A3Ji}yt@;!S8;DM&QtDPzRJ<*Mj=iox2?-shWKNTP z=ceb+Ae_y1P~{YQ7T`{BLkiHpjSY+R3n=_GcX}n{OrsJ-!hAMNXwlcy7q)(eU)^_AzKuQ^-cnXRE$~dt z38|5P^P6JR6BA*yuqquLMMslp8?oaibXeJDtKV!r7gO!&5z_BrGsc)(iRD`1AjOT< zJ<*rl(y`n&$M3-?O~N&OQBxJ&_Q3FL``l6WFU2|G?h|dT;NN;RavTR6B}H)P0=3w1 zy87;qmgb-1-Yf{|urj6N%$vI%hli2g;>0;W-+BM~sw@&=AocD(e{kGiIfqa^T3U!bH~Mk zr-U@dWB(p%b*)eN8wa`-d8s<>UsV1)3dQXT;67}D13^OZ+!g=kve}P5`pxT{iW6FS z=8vf_dz|5NMGG3eJJ}Vuypx@>vEl8?lbcw^n(UU>D{IiFh>lYAu4%WHj*)ix)Q+l3 z->_&VlVMpGH4Bj=8RvMPP3+M0`wX6&e}?m8cVgW==JM6U_qtm26YQ8;A`MYvMokyz zkPs8qfV1WIYN7Qs8?c+9KL+=Rdm@!ArK%Y&=V=o)Q72s1Q2k@lGM^2wMR$@0KrxGd%B>#fR-SdpkXE^WWw@-MU`G!8P>(*EwUnseQJm|x!Jyf>i` zoqtz*A3asLz{@T|bF0-*`MZN%inclf0U}&ZQszugij5&(f=vJ zT#=V?c}znjXV3G8a?N#3;n}ofnc;=e+d-;0xr$cJ^X2g|fr<@*igcU1xCq1Ig93o- zD&uI3RPW}O4l}Tm^H~>eR+e22Smev11lQODov=B)U~+@TA!Dsn(&noV0Tj5k&7oD%W7gq|v+ zue1yP9j|d5WDrgI1a7CXTlo#`ajS_fvVNy4Bb)ka`!vRJ_H-j+jKSef2kXo=5aiP& zt8OKgcM(D!yEwEI?2jz5IY5KR@OV3uzQe2 z?ZlYZ4B4w@=(yWTjiBOUWYQvaK8434KpRY&ET+)<<76f zv<+%HmND>MC0V*=Ml9wDy(0s;tf{<;T@F|Wb>5&pc1e1q*&*OcZlt`FxAc3ZVo+uu zgMb2EDURk+wXg}NocCU9Mf}qjzXY1QOm!%M2Ow0i$@yKd|mS79|-Ioqa#QJzv(~4`?oxfuf#I^Zm-4gbVw(kzRJ+g_}in`wD!loX88vntQA)Rn}!yaEM|jIGk2Fme&?-e+Mjy$ zrQdntW`9Mem+%&qRJ%iLo7bX>oQz(nJK=LS*kN@)Q#TM*(Rs@&*Kj`fP5H&2X&=;x z*gFw*T%3r)fa=P7e$)E@p9L6?lTQn?Ewj71m)37Z#TCt)`86$W?SgbwLCD=V78NtR zcIzjRi9;G3HhEQAQ2Dg@?n)Pm5@U)CZoMk-vHT^RdreNtNlHDXX*;RYK#YPcIpghY zl1c_t$+_zEyG-v4MoZ%$oIo;(`s_n^=ykp2RJu6c(It2^yB~N&AUk=NjgEhWRS8H#73qUg< zVdTzX#`2)j$#eUciAiQL7lzmWg0|Xu;0M5u`J89b5c1;*|IOF7R}W@o29J{JMZoGW=p8o9&`5ocT?^;RDht3xkv6xZH-l&7V-LV1^cUg5w!*)TG1)dGj}CS z^{&V0j+^dF=gx5tDf=!Q^549WWFca>DZMJID~FMw)N0JZ`v|x-P2Wgg1T}cs$ zV=upT^>@tX(n$2!xtj(&F})zfFtos3<>Jiy(ayz5Yy9FDe)WX|J=Q|Mt)K4Cpx0Y( z+!~URO21AxMvyGTqxy!e@y8A}?HVXe$m@}zMR9XZUaZm>%Vxa3n(QysSLYCx4_XZQ zl(;I96vA~UpoA!K?c#9r%RtAkrqW8#4#b|Hon4;Yz#ttgzv7nrk>x2~iHnD-p1N zQSz*G8IHJ6i`VxMJV{4JNFp63>@KTaXS7AviJ)RkUtJhFe&$mjyd1ZSx##Ha!y{IG zKtA$t*Fm%lHL#FLx(Z(>sM#GeI{v#P|73ittV<%@*MQe}%uc_~O?d`h|) z-EXQtKKe>sWyu=_IdyV0??txuYsHn^>48&fM^X{xu!s*^1OwI2U>l5|jdGZ`$?UXm zRIw{sV3zMscKmn`A9mOU`W)#?iMAOf9YbC}Mgy2${UR=0E_mvxDg2(b;Ne8{zd8~L zs_ln`UmACqM_Xgm3&LK<--~_u8x18u;vj(SC1t`8pCPmtJe;d`JDYdPePv>6LiQ~H zx&xdJ*LmOQCFLouqm9NEA)Wx!kn_GlzK9YYr)?H%e@qqdd;EQKOhW{;vK|-&)Cw6G zl1WEki@NKo@yk1W~qfkc~Zifo4DgT zAJA^~?4tX%PW~O7CVK%ii(uRxD#sV3E_mdNZ*ts^Q%_%5<#ZJx7ZTm4o=e-sga4v8 z{}+1jsc7`O{Xx9NV(s0*t?4K7?JwEd)zoBu3G3|Dy0kW(`vprbJ9UW5*KN}U%4Eje ze?1>1STqdBjJInB%SUgq(;KwAF*922bQ5oPDkENT9#vs^2r813a* z;<7=D%ZDaO_rID?bC1Qf6b8@juu~g{n$A9kMx8}jX)9yMJ-b;FJNJF#+$Oe~e{&o` z7)YDH3_7^5Gx|uoXtnQKExQhna%gMC)1WE4WIXElFZ(RTtCFSh!11TRx2#$MOnlQJ zU(+D}o@}V2$$btp?D4zwHB?Z712hYN$p)#7(l9)h#y|^_YFTK9lS?=bgRFL-FraQX z+)QGTyfUbHCcNn1VX*1yg{K}Q<#)&;^a1}1G(dHiSXntwEuJtwK0RI=<#7Bo(n21o zd_~RqPSZgmsE1W7)9TGc9uobc=qnn;n!E|O_LiUMA*e7IB z@XJdtt=@Zx)D()Z%KWhvi@fSHUnI=h-a~t_)ts%C$$xevQd%<2=t{SAxWX*9TyW@& zb2^XQG^^}Q=V)|g)xHOND*ntV2lgkS>X8X@H*?FFDS=^L58%n^7yCk*yD-U!GoUU{Q?xlCXrz}o}Yv`2%c63l$$oVu6Ja7E`mw=$tunPf?dfc!`3tU%7`#kiV;4j5ehSr5}x z!a$S#K=Eyg;Lf=PBCB=$nKngdD!w$cVUM*oPVvQ1Xs?}L`SEKMQH8E);;Az8^Op8 z#=k3B)ly!~7I?ctaBUSQX1Y?(=V)K~of106;E)T)hPZza`fT!Qrolt!ia7oUBZ+qu z?9UL=sVLq-k>V%6- zVrR-iy4W%#NsO>>eAMtY-wlgSkU>p-Ob*; ziP#LlXWzNQ$V;q{4s`EEjW2B)oT9^7{XHr*=Z6`4Xa7`h_N$hC+EDl# zqwzWF2V*VoPrWC1fBPoS0^r{{mm%zPEydRU(fk8%8zBpZsrN5R>=KGz>|aPEH-XCr z95!X~+f9K5AT*`e9^)7CB_h>=zm0r!8B&1evL`e9U&aGhZR+`^;iPxF8=gx3bLcp| zRqvlI$|#6!D~K^U`P!))b$+M>unPHZ2AhU8E=iNuCJn>t|!?jg$?V}Y`Xa`N~t;?S{;-dp31w4 zhvSa+P59rH#$c8TTpw6m5w0)2{y^%r1WZbHnUo|6EU1@K4TSvH?_S6Y*_HeKljx#a zdeOS~vR&t1r>IWQ=X`RbrGK;6D+Qg`2PMNA(@olkNVEaCg{YCu=qBl~;eAv4PH#d( zr8i+z)LwPHpd&JVPZArse>9*!zE=Av>lqdG6c3alWh}T#7++N$9jK*1|D^p=kL);D z9O1NoZtTJ@=@wZ>BPC052N8h#BAE3JdUoDtxBYp~z9>>?^FjNxShW}>03LsJ?KWsN zp_d{#KaA-nLF#*PiKA<&gNr~$+MBL$m&TP&TpQ{cC!s|&zj`)1egjMI#;X5S<3HEY z_bIMdMG^k3>i>RyC>-uE*4874V+5TwvK*~kuXTrT`J(Qkcc(?&2NDhAWk-^i0uv?j zWAux0LSH12=nK}@(Q8%D$k)OJ)!?B|jm$6G0e7+Ed6(hBf&#<61}@z|PU}WaZ{n%9 zNL_k-pT-426MJ3J7?shlP+wRUD3k>tzZjcMTY3(Liy8eUtueB6b-}&$;+A1z27Uus z9+tqG%@kHLDWZq#hW0k4)Te^Gye%poe$1{^;S4A*Y`MHYxO~l~$R5Nf@HMeB=Er>f zf|;CzmVxh8p(u3tn~qv|8x?I~m6lp^Llw}6{{OJ6VmwyX_q{Co^bcy>*r}`y5lm9l zrZKEY3OltILAvbe>@xe3tyr=s##ltw!kQ`kzv>VOc2Zo4U( zdz;G(eX`TNIo+yh`d|ti1@Mw2Ht{)xq-A2_Y$lnjyb>~pxgR5KAKq-yKI-pa8bm?B za3GzPLU6R#wY#ysSI0sGYa$Xy3`~qySlJr0znv0g{6z^Ug7CxZRZVY=nr?fB%tt$` zKfa1&%Ca1uC!v`na@^#We=Ex1=PW#SjgR0ewq@vIt+(@bXNi4CiCxQ%JR%vlNm%{5 z`E&IJ)%S*;t)r#|2c=Tx2s1P5{nVmF+cbHW4I!MH8YF&N+41_im`4;bk~9be0G_5? z6BKGJfFI$aA}~;qRg2%@;^X0cKI*tBf>V}Y+~K3NB9;hbgy?X7Gw;y6L*w*rVIml0 zs^gfb0D!i2gcLx70ml^c<2pKW7*6vCO?tb2G^|J!I=%UZTd4V^S?B{(9TV zUmAg$4sZ6AHzieHBr-KtK%T87VTw*wW@)L- z70Nd*Hw_&(=t%=pH#9WVM?#Jj0t00@U2xdE1~usOt=%rLCxY{@x`FM{q7(tr;~Fdr z*;rUS0pbBOzB`Ddq$CqCOM^oz$GTYrjex-4+hZyoOQoL#vHeHW9oKL!mam-5zT)Wz za2C8lM=%!?_)>EtSym-*ZQigrl=tL*WrSx4o`}8l*^(mU}n9 zgtM^b9li4aXZGUxi2i4+(A`(MpPl|@eZEfVXa=|6&M)QVT-U{#O*!wgkooOLS$8G5 znJz#8MkmGbpwr4g&>ebvP0KSDonFX<5O55C2b(Z zT^$g|1v8-F=20kXx_CH`8udJ!Tw?cn;7Nu+AlZJ&qAbgwh`%805=GD<#pd?w$yAXK zl|QV_wCSuMv|EyF4SxMKrDfQ6S>b4TWEkZxIrngrH%K1kTML>$7P7=e6!^DEQCM_cFOCfmg!Q+zu* z7*~k~S6VqhRz!f{zc9V2Kt1>AhKl{2{o!VZQMc*9Rbn=p=7@mkG8&FV1d=o+k~F@e zqT{%=!=tU!{%CG#9!%UMo`aOCl;`_mTUqZPTZx|vXK#51k1JV{M`KyxB3=YH&u?9F zjG)OXs)c?+s1t0!>6-6e!!#W|Jsc5(_z8%hoAY7+r#d=fN8foLybH(83nhi)!}!e1 zidXNhe^a*Z&T7X7eYg?ajX1w_6%Xw1musOf(#p&y2Y}U&OuVpm%t+?nl795G{9K5vjlE zyeR5Jjp<#U0ydf$-Lwy)-nt|1%BdQGLZf`I@Xh_|pQz6&`0$8x&N1ySj(?0*zZ;z4 zNi9(JhV_OIq4vhIlpx2iUrp_*sXoVUOS7;Ni-d?-3d@dC>>c;D-n$tQ=Mb06;)r~7 z7dp(>hL6M>v9ik=t=88r)6rF&?Ty3qI`h7^c{H`HJIE}JN>y5tI?0TCxNJ1z_e3P3 zW~7VPV`WFYb^lv5L^SphnYZ8hGL~p-V*^im$SCMKfeS0&ad-O_MX@!T!&18#6Vul5 zUJozo*SnZ?NB1Ary`0;&buT+$FLCqci+oF(X&HsFMzF!u@r5F^E`+pWZiIpDOtxv= zm4#48Nk%IGccSi2_Ed)@x7cd0HI>?zA?I@A-5=haDq%|D_1@VRT^$V_;yC#s1|;ZL z%irb6aw|%sE57g)lA$5cX@g$VwwY`R(~429BAY^G0#AbR>(^%z@cgrA6`4kXN$*jy z#MO3wtT-8%W1mc$`1ca(0!!UoUTzP>NQIXOC+9s2QFsUdp+M=prGmXqcHrTLF~!fp zF}QWqcJ+7eb~xSIz-MG+fL@0_7-AeO&!L1L{QmtPu-vj5{~$5~PUH>r^ge-QF&xGF z!oCoATA*m$ZEUvTnG*sdXq9nLtf-o}fY~|>LrR=}NB_$?NRuGCtzU5{gmV0S008rc zLvs)S+}eCsHSe%0ZQn`(z`%EFYYUdogNAA2@iq#Ieo`#-tgX2apW{0x4rqt~ZUM6B zT6S>5rvV56obHuraK8)z-f!B1zzJ~azV&tmfkg`pS1@~b*t>fP^sD1+ttAkX zRjq%NhO@+s9!?K%c8G#^^Q~<*8{6)D3)MfL*Y_%_u9og2O4^tyk(J)y2b0olk$GVz zZg}6@q7&nc#?L_{BCNO^T{k#B#x^Pc7nKtGK+ZlOgYpL{=zgIMt`SZ%9FYzN2#^WH4 z?kc;B{gwbL^@vDP~1e~GXtjdK-ctOK>6fPgQAy0LLPOw~%;U{ifEB80eYsljM} z1aA+RB3MVjyS(KZpElS>+@#95&De7zX<|bA>T?pC?$f7Ff7pKnNx-Z5Pfmyt02`o8 z-bN~bk$BK?LxpgFHw*6r848n303m?dH_*~@0ad}#Gc}aaFuMG|CwvI$lC_23yaD*r zQ?dLWC<1ztTBLS~mOar!ga0wZd6BktrbYK9w?}JHwjBl65Z{YhHb-uA&z|Z<6g!lS zJ3R%aj(IQF2Zt)MnHvhji21X-+g#oYukG;eZB65V_h372L79(NCBw&4T!kgyN@DQZ zEdNVU{<2GAUZpHpKFrW-Nho)~#E@?};jXT7=yX}qoi{JE{~~p}`1Xg>AK-?l^slmH zxdoFXYu?S73vAJ@ZD#v)%6>2LS5K?PJ=Hm92aAg0zwIAm+xjza8g|MQ*sDC#(*-&C zid05C@O##Clg*|D9RCGy|G;DV^q0L+?VTkVp%+)WgQo7I;^9%vZUA2}4O$OV#r6l`CNMn44F;u> zrIl4tQPIc2_rk;s?|bC`d*2-u8Usur(uRC=b)Wpv0LbrX|euBfc< z)?6g=Q6x^_ivK^W@dPL$hzSY#1q4DuVZ$O$fv~l+TX1NcwI3QBbQ3Z7rU9hlcDV1G z&RFV~Ks3I6yKPQ}FgG{v>h4xnQqo_0D4rdQ8;Cnb=%OI2pr9ZpM;i=ck=cb7^@C+?6O$EPQ;l;zS=Y)Ys@*b}aF<#bwUX+D-ibB*+{ zIfdWOtNV{XeNL3A^MQedL~XCot5spn4ELF;n1ug6c+=6{eW3Iqt1p-iImf2c{rY+= z;8C^pW7B@RLRYpIWHgBHuYCI>@~tstirfPx2i*(iy8M zXw^cUwVIn7f1!3`X+dEjHn{*Kd{lUIur)v0{=r7iIQ#Qx06Dg*Z48~#;}xY?*PjKi zl%=YdGpqKtn%rHO-1c7jp{mu3U;D&aR^u)35l9G~LdcfRVSbgU{_CXF;Ano$rAyye ztKsBNrI@jjwrT25#l#<{Oqf3jKz;S;$nL|AH0}Q$L3JgT!ay2O8V#ijR-HJtEKre? z+ckXTGfWk6+W~d#?#>QGD$K)!0Go86x1B*tDiebBh8lkuO=<@I4JJF+VU&Sda2h9B z(~8i?l|E)5^rbm3Ma?yGag4}2o6u5&jWsj}*o~T9L6&)|XafWG;wSI(2AmK=8$kw3 z{=wt;Ud;(h`CAo@z6Jc#?F&_Re6dA`9Rc_RDEh)pI0jU5ykyZ{p^HaEJ>(>I1h$+O zSZ1>PZxzLbT;A=m2nn>p{83|Ckk+L~XP&_s+%m-q*->zKwf0h0GYHIgv)I$YR@+bhoIubct}Ljv=m5Qn=>7=a{%O zi(ejK-{)*GA$iR&pny&qiF$wRB^JhR=K3(@QtpZ7x!-q8ge3p0`z&RYaO(o^-kMdD zyI*b-Iqrbg*Xh=4%JG21iw9BMFI#O!o}X57#($wj9K1PLzgRlbXbUu)PWDZ=+u~{1 zW>}S-T=@B;ribr^b7SjeV#)CxUc#d0sybWzb5STr*h-2i*vos5hc}-51RIi=? zwdWQ47>1bMI)~7*oFXGCscfIE8Iq}Dv*#DnxsRDRQaMXoB9{ddCjM@y{kc}5B94AK zkKbo+(a_{Sw%DuDkYKqR9)K^+T83=Jn{0U(k%-*K{2+ojIPS|nWE|o+wde2JR82p! zoha$J+H=gAM!Hy0w=>I!6F`Os4~Pf}Ay)u2dn=$sz{ov5c5P!15f7i+gMNA_WPu6D zY3N&W_kDt5a|FmzrD7frC?27T8yFb41TGSyp=zOG+sg8WXegOsFX5|*X7@%tb|@52 zFuU%NCsurb`f;H!>yPPfEM;bSN7?OG7aq~Ezi4J84?wh1XMJO5PQ@dq`0a%tHC~-h zj*rP6lmD2{kV`2qO(y#>(M#D>BuR$l8Y@-aV=^Q}a_+RyrIj~Mg+df2*VDrzw(wW8NMRKdU$-#RW}$C)Ms!Y{CjD8+`Ct~a<+T;|tOGA}Sk@@c zH|q14IZ;>Cri-mOv4v3cW;B=e2f?5uk^#N5#`D_ z_)WAFZ@3n4hzQVIggN-MQ>2U~Oi)oLbip%Q;mMUt95!xlzvNNQK)RrBK!Ew;@@&hP zKRf5A!{*467~8?E&T`4{5Rwr72Cbh*KHV#?Acl+?(i$sBA*>~5KB{9+8=j1ptlVx~6 zOlH+?_AOS2z$Vi5fwAMVgyYjcqGJcC7`=f3SvM}R$8Q!4#s93*|8Ei`!9uT_Wgp<_ zcY>zP&!6>>19cnT0J&sz>>I7TRoLVE@evc zfa&(j8eV%(>==Xv!Vo(Ja?w5#+FMJ8k4)1O6A*9!dbFr0A~`webnin$0XCe|b*vyu zaNnPw6<}(kXD9lvP+KDr#MzBMbP43*Z{u1*-@fI>%D2%6jMt-$rh_C(IFQ>zPc5a4 z$5ei)S#(!fsF7WhY@o)pD6K2Co8!IUj+t~1`LFx?Cxnjq+TE>El_I~s8{m6hnH+2M zU0Y!L%AeyncIBZV2{roJQ~LgAw>uLaQ|-2{QrX&@HXKf(>NX)P&`Rxnnr_`@uY@5m zbM|RsNUiNtP6AW)?s(@=Y*NBYNo~mhp*Jd2jGNzy#)?-3lK29kils{*WJD&r1l(a2#k_NV;hlGYo$wb;Kv!$SH74{UP*ww9S3& zwvdY$d$bU=@6GNH>!QE0Q4q~WQ^*^k^cHSQdbEtA96p#yx@N_KsSWE6c*xMsOLX4I$1j(bSSh&5D zXA`F9FsZWreXgw&w9X)N5kP%_f=%~Sr)d3?d$~4kA`K!LEm-J{Wo6r#fQ$a~-B9CA z_1*jT;ysV-24XJx0~-(inEzT4iojd(bT^E-x_86#h2Ky&lMn*)4gJ>5Xup!$9c-vcew-a>iLljAU{j^zoh_=k) zwT^+LK8Qg3aJ>(qk)XhUmo!4|2Xuu%l5jT=QXb(vXvINY_Ybss8>O zY$PS(`K4j^zn)hCxH^{OIbSzvC8p%LEDdd7jb`~rg=q!rGDqYu;l{f7$B533FP2TuBH|2VsFmiI+c?=t4ZW!Pi6{u23d>QLgX4ol&BJkM&^%hi6U zziV`or=O*^0ZabpFMlb_zBHv!yJ8D89F+gWc*sNQB%0(CKsq^@^U3x+80TQ+(OcAc zsEcsFM$54!T}k_tHPnfWNNa|;^8j$3mbeqezb1O^qKYsj<)SaLe+kr6CP#s`f1t^y%?_lB#~&v%cec` znhg85j`kMYAQ>v>yz`x+6;CAjntRbdNbse z;V2wXTqvsO>;danwHC!0q(RWMVy; zntmCjf`f!obL>(TGAOU#7hRve=94MdyDT7g=hS*ShHa`+cIf%(dvSu9+Z^K{WdJ29 z#YKEUme6E4#Fee5IAHQJ0n#Ncedo0g5q*X7?;n&90>tNwKwtslm$E=&9_VI44(P(} zImjOZWq{+;fSawMmi7`zgusvE;*W7N&bMR&Z+?H*SqkIw->d2aDNeCpzY2gUCCE$y z5(Hj;ejvpydm7Q)Jf-vGB@9%T7TYcStXbw#S5MFpsqQd)N_YezRX_{|)B;BAGc7=S zI+W}(km@JCQZp*f62A7sWgP{UCg7Z8?FE{qo7N7X8aoCE*w@5FF`z{7Zfpe==ntcE zkWloLMN=mKiKYC<+SA{H_$eSK{%Y#aq^Kb+-3eX@K(OGxY|~UgiM0kINzD@);7IXg zXVHE!Zx6ne){P`XsB~&RpMXFN2_G6nnSSEwzX4G14NyDC$;kn5f;Vm08`Um)o!@EE z^M<@L4?b_CjFRQNuc`xCwkL?m;Wq-x&UtAuz;aP?uM#3>tDdVU7dYG2U{}A8(*Zkpkh8`yZEL!EXEZ6DzbRRZs_g9*c zNK#-vb%=Iq30ay%c-uzS*2#C?cEdO2@F7TOkkAN>%|8$LF2WfAF$9+u8Pb~P1fV7V z=*X^#e<_R)2br_0TeFUf#trrDu05wjG_ok%#Mj^ch1Ao{(sW(_)1)bQg%lv^+NgzQ z##KXa`5AW6jp%Ygo|8ZR`t!|s@r_)TK$Dn3ht!Jwqi)8$u0l8=&u=z<76gc8jiY5v zKn6h>A?APB>(g*<X+KdF=_0Qc#;Vmul;Ivhv= z7CTrN0BU4_zyiVXp%Z{+K$@8M*AsvgEP?r*x9F@HCzz7~EevSJ8<-8iV7g{*o_`Iv zf&slE(2k3E9DGlBk}`ul&i(T1Bts{!TL5bMT^d6w7xuxR@oAVyij55i0XYmRW)7+EWm9)fkorN`uuv<&DbVGZYlA#+a_%EkRQ;>Q!@7A& z+JGzHXx(8V1Yg-NdL@;*ZOV9O6NHnT&prP=MRxXru!B{b|DHZCqM5bJ6R(h}J}cYT27 zBmlGadU~4rccWsL%4z&6940Q_!S29%1c=+bfe?}kDv4qqX=!0$kmhX2ngq1dSH5la zPT_z634T|In>0{BgaF@<6#y{;vytLr5({mRnR5reViP1Qg&4 zy>d_LJD`OFdCrP)XC(~u^)%n;RZIIpvIk2%;5no8NeqKzkc0?c_mo`iB*#YePgJLw(6w^>&788AUQ|4=e3$`xn8&3H5UFm-l^_7Rw4@;Yc-N zTlJd7HhR_hLhlHXRrmUG6ffiTLR2v0?7{@cll)39SA~mu`1x8Nh<>*~e$h(l39&h?}p!jErYl+?NMru>wXaRO- zB#D!P^0s^~QYvS!IOFiyQpjdhV{|ndbBSK;Xx(#-P#tM+;qFhe_Ae8nSG^wGVwVV# ztbvkVSlF&+PE|dR$WkoF7wvUTBVRuU3J6Q9sv>u~I~HAO_Sm{@2h$hFLrg>|+goa? z;Lfg(NPhuH2Y!M|zd6d@;kzp$IByn=Re-3UzqksaxDQ=JSMPUcqK+K99YS7 zX=!+|AGx7Xx0ntK#g7%6?dv2~?y0mmj4i*bfT|6lw#8)>mqbShu0vU;Ci4$hrr;@9 zlM9)T|Af^K`cM30oYLM}ypWJYfx>HJ$MF~#($;s*TMWyTqiT^MDnXr($otPJ=FKSP z%`KTAoS3N&3KW|n#SGls<;JGTAtqg)7~s|6AdGV9p*`iuO!s*rOzPN!>e>Xj$eBG6 zr-MJM_qxNjOos2j%EV3Py?NjwFBedCX zkyUruBCiU*N)+`+hF2Dti$2GZ?F;IEsxYfWvk^~`8|%N@EidWuK8`JZhM375mLAz> zuI^?0@c&@jmNSfE4v|d^{36QhHZx;0Wk|E04u z-;!jqkbx_34T{)f>b}TL#R!BHwp(oxzmnnwAGJsSqh4k)w|z`qbW`30H4*Kqi^B~R z0)bKAV)#`L$;>~VuT$f&=}&~=Kp@?uVz)ZCgYTbZEhdQT@1;m3LLl%;c>~msRpbx9 zjsJTrJy?p6=sq-f?JufkrK}YuF-I6Yv@znxBh%31CGJvSP`hr>-X0!=`ER$)?iR@2 z`C15fkIHUyz`%kaBzlM=KM)&)%QlY65wb7Zdyy;m%=Y+)+ytdr)!eg_w`-T;K5T7(lY$o4+X9agt2W7Pik=5a&5-F3r#465j7aR$n6Wv#M@$ zjRjaxT7u{RfXoyth2jfSUL$Ov zvKUI}=)c*cHYek}YE$KbN-Nb}H$2kBq2#W~O%gNx?9`odXEE9fGK+y9^Nn6GwQ#Ro zn@5tylP_P0941!4p3QSf(^!wF2N$|CaJwjaX5eeUZv};N4Ak|Jw0Tx7nZI{(0943eWQW%FWADOeUHjjH->rO(vr)COyoA+V}U8 z7z-!Pks|F#dEGUSA~;88g=lnc7sL1A>=UPyVhb45wySP5ibnM*csH7dzh z7{wu4NW3TOn-rZ1mLIGGx1?6zcoHq}j3+}G=oyavd?NmslZ~1~pon;+UB%&M+*}Tq z4SkJfPdyk++Q^Jb)ryrL5hbYi_Xx_?#VZ8-XV`;qYB@~xdxjs+`5ZoYqvO#QQ5C40(GBd?amyyO+}arccwW$%*M zjAo^Vy8w0T7*rZ~EGjUdK|B;u6&TPF@|pwRaD64cG44&5dD97P=RC)J*C91}0RQ+P zvz%(sPRkPm2z@XUNe8hZoso~* z{8Rc}K$1I!0D;&XNKa|U2z|goiXZ^Du`2og4XMhVlS8FC-_H<+*>_I6XVM|d`uT9U z=^|gL2tcKct~1B5+}BsHiQbMsO<+ms@oM2k!VT_+-@d_3Zl*gT)pF%*J;*#$TD?{c z7+3^SSS}B0D^wNNZC-xmw|Ye@yPAT}&6Szdd8Oev!5ZfRNG%>z>d5k=HW~^9K@N{I zPck&W2uDh5;;l9&lLV7rd;d61CS{sq7Nx8gJ44INzQUEUX} zOe*HK(3?`dn1o%aF9-| zlhn`3Tv$%+%NB;dpIr@==-~5;9fq62_LZ(BBKL6*T@MXa_>hisj9iE6?oWS_W*v0a z++r6qWn>|OBk1tm;R7-!vZN$$RUZ`>(|Tk%h)puzRo(JI-+fN_GMpM!lsi;Qr!a>q zS1Pp9g&$op6qly+6Q_t}1D8AkcbZ-#6OtsP7|p3-^ECGL=jlDI-5vO;y6}Yv^5=?4 z+R-u?IcAsq)cBRthGi}VmR45rOGtAz>JPt zk4fFQIcctUk+|jZ8=rlM>w?9Uc7%}nsgS*dPh89)R@1>Z5YA%hz0kKj+*gMiMhh3? zb(APZaZ}3jN>mmaiNN6UN9=FNyKe3ToUP4INw68WHIahu#(T}8{A8|KNll`UQ{o2{ z-R_ycwtpGRCPLPtv=V>(vRbhAaC3ZHv zwa41!_D0}UoT6rpceN5T`!R(mo}imndFh445ND)@e%Y{>uB%|Je#491{GFFyz_N*mk`ZJYilXlc!7|mjxHI$ke)|A&HZoWd)#MS&Xv)b|3q3+?3g#B zG&amHGo3p*0yuvSS)8byuCkCdqJPlnu6(CbrR7yP?4m@=^tPJw_|NFVj2%qig~!i1 zi!vIU>40-;3$LN@HX1|G+x9w)cJW`(ysFODb=RSAFaea?%dn>KwJsn$A)i|lYeD5i zPtcI7j%rb~Jyb0+hOz`lwJzxX$i%_tYBBNwt8(I~gmQoFs9eS>;Pl2L(Dvtv>;?KU zf-?D;5Sq)w+tNvat&D+QdVM@zm9AiJnF*B{BXdge?nRmhhZbV^n01S*A4KA=g>vfK z$7qj9qB9LEA}?cZg>($bJDlW7vE2Do%DN`WJ!UaP<*e?_m*YIE6nXlVef=&$h zW^PoPbq8Ui)3YX5n!N_BR^RqT&zz6rFsUVSDy#m~UU^z|ZTLt)WOVS%D(+as26YbO zIRlhsdjaKw%i}#sM_%gMtf;B`biG#b^N5DXAIFh6@?da)asRIHFVOa@XNZW;h^iP< zF3T-8x1l5)ASXS86f1#F^SaPv$v+XgG}xpPy(9d|hEKY3u6xPV=PbZPxy@hc?_AhF z%~iokfgZu#`q_Z?vC{!X{t$EQobb~0u+amHrx8)`)j1&Y04xUBOAG-gs(}4EBZI5w z&Sziu;D_KKv3}FB0`7U=%S9ebejdZK5`DnwepjC^62!;=hCf^$+g>NhJXbM?#{}hA z;_YKRT}ghVi3nOJ>Ox~DS%_d(OCOJ)pxJ@P{d!ytFvt_Z2OLb79JlJR z)~z(2)Nh)hD;u-bp$aC!#5ssp+so6XBV~VK{_Z3s_^nMpO0x&$4G-H{M(qCizm(R% zI(~&kM}LWjj}Q9}bNjbE`uUCmCVh7UP0uB+eLzlEQw-0ljjF3zy9u+%5Z z*eZwZiW9<4!`g8lv$9MpdA=!Lv(jYI(h2p0JLm85pMD-mqQc|xA7rZ5q1#8*gRO;S z2{i$J^DgiDAP9fDG%X0DBWF(B{Nh!4^DT?>II_}6_b|@dBGd=7;q~%t?S*6au^#XB z^DV$xp%gmr*HqOc=L5~MMh=Wsqu)}YAGG}S6a5>-T?ZL2tIXgfWiRIBN1#5>#UtdX z$1Miirc9gA)jLt>P5Yk*xMX_SZXr=N2WjX|*Iuwe&_ZEKfe{KAX>XkyhRD_kKW=PS zaj(>HXe&4K`~KE5w2;2UtDoTYE**M2FV5#%5%Kd6GhdA?PB8HeZfktHN5TN{8JPNz zkdns7$2;;bRJ5kQgjdo6t=`l`H_<*gr*oIY{ofblK6L=1S;aU6%CxIo-y=CO|7rNy z4vyKU3HVd#Qg*b&UM+#9hE1m6ecqJ}Df_>}V$+Bt7RnPcqk_pK>g7PeHm`f1&B&6T z?^!6Ohac*^3%r$3E#v?^-Hb!w^zdNZqaPteGle&8Rui3yYFvWgCk!Z^d=&w&%Ef~O zV~am*VjiaQl<#Sn%Pxj()f_JffEFlO0FF+wwz9t+-DFL;+Y5C~udIIL@#1#Mep-n8 za|$;y@r1@Om%0%li%%^bRcw5s#vk*;WrVi7*5#ch$f!mV>}$2F!PBtM=&z?}=FJW8 z!scvVIyk+K1{P{>46LlIMl;#?$N=+|8RT)nfaN?Imc+SXC19cD=Z9!0F<}B;xT>m? zPikG)e*nh!!D?V4;pZm?0rXE6R@S{UIUQYHO(hlj_zttN zW_`IAFGw+L#)@xp;M}X`411(rbrdJ%v@88g_sXp@1>Y5zvt4}M>r6)hK%ZWSXZHZ&6t5$2;yc|M z1!P;s!Rj1Fw4m(b;`}#{mjRC+J@_`%GwfuA`R^w`!*j95wi;hsd6Wjcau=}ZK$Pu5 zj&R&F9@B5N!#NW4VEq zDAdv{%&+%>!h(PB*i#U93h%tWT;2c^g(_RA^lf&%x!Rrc(A~`6G2U3dTO9p;E!YqU zk5*#ZbeoD|b436P5X@pk=w;fW**~u_z92Ol`L{dE{gefH(5YU#oj;w3wm&d z1!s=z{?-`aXioolQb#`_(P&$<8c>&e*OEHU!TbRo%7rVaG&@x|%$h4AbadCF`CE?0 zavMuvY%gaj6(@2m7YT8+90AWDr$SO#UkNkGxp!^gcg1RXlow3DwNf;q%%P)}+SXRY z-rW&!`oN>p&N(|G@rmCQ3+(OXQS|HVrhuh4V6%byFNYE6QaD=AG|bKafcfJ;H{tVV z0*>>vD4mARt=4r0aI3(|@M&TLD4+gd*beds)YRUBxdB*hV66JYIEG}uF#rZ>y`Be) zjqdL5fD}LoyVx?ce`NPE-?-X7y8HK!DBMQ{=NbO9%l!=Yszdqs5Hh* zo~OCJRcc)QrJ2^njNgN9(Hewb?}J7$(}jyinhak7ha@ACiY0wyohlh_y-S48jLEAx z)QX%FNUA)ZG+ty?K1^SIi6RONDH7nfFBd}}uCUO8e+A<}hPbJv&3L~&__5{I45i4Z zJYGtjCuKNgn*4_C{I@u|T++vFS(%xYl$36Om*F!Eq9ZW797*9RXl(QXN{#4<(awV z=E3sDA``3xBO{Ol z0VeLi%tKuXsHpC@b7SBo<>h;yl!~OJw}9~MbF^C1@7P48MxyG8rUU!AkL1B*MsSKO z$rzgc*5O+3jd1@{HAnPu7!=HF!pFU8DlVWs_~p-<44Pf@;|^T3g&shl9BH9TEkLbG z-+ANaaKl+|c+P7fG-X_|r@!oknEC`T+w0nWMu~p&^Qw}C!tU-yj*7&>YxuC(@PwE0 z>p@lc@8Gms8&S zVFJr*s?~;$U>FjrKp~S=`m5+wNU1C#V=#4e*GJ^!XPBGPfpM*yYwp2{Bnk~8aFZv>>;t<>>X%`R)_9dxA7W5u_?+V@(-XKw{Glt$ zgL|48GX5?DFKPGxO?2nm8Ufa!;UiHV7!VOnx>A;-_dOQ14q zZwG4!E*o%;p2TPro~v-}D7Ep!plshaR!FA0;UyFVMGd2tH`oolw30MO45cT-) z2Py5|Ag1r(BhjHH6iF=T#v)(M$Agh_K^y*hJoorAz%1*`Q03w_#woY>_Z#n(SJ`-^ ztkZvHo;f$qx`Rfj%468Y=|;_E60%=i^jRZVAAE4$ zLFyXR1;>`D0of2&mnvylA|EAk`>d?7mm=I{xW6Z0?EYsG=OF4~`UO-v7+Nwlp9-AJ zQ$gKqsH?jL{Ow=G)4ls8bDX8nP*VefKJd?HXP*XI z5UBJ#y$Gm0s#$l>y-!b04q6+!ZZvPG4O#qW9r%};%0y~F=!Bcw8K8#&5pis4YB<;O z4;M@D`dV6(|H2XpaTB1$N@H!A@_}kcZEm2kAE=|7HG`7|@Lb>0#3y0W$=K#Eh>Lo) zP`aOe-}PRMilUo?*-w&dbF&%#u`rZ{@w|^bjZk*wE`}$AVOt4RJMsNTIjzJZ`p;_$ zHqQu#xf)t%XOa+A@yx~}y>c&Co95+WdX{cg&&~*WJrLA4qMafaK5IDCx>sEGirQ8S zIR@<%i|~jIqebTBZMOQ13b?<_$`7YJmcM@vJ85FTynol^5(^u7#wq{D+{lyY>-@~@ zg^RSLHYz{|kBka8R*0cb*BM`{&N{96Ts5^;@#j}-{R!S+=mV@XAuH<iX_Wku@e_OFY{#9;1Azc{f~MRT1yUCeK){{S<2^%}M9F4LFudNX zfBcrTTI;YQF~Xg5x}DuFIO<_#KbYT=PxMSxa5ssdcakgr!4fQHSkkkhAD5*VX=ftr zIWGzj47rzsr1?@}RJm-F-^_@phJ|D5Y(KZ}$U`NKC2~KNC|+(%^Gw5b{+ZqZ2z3Bm zUl#gYCHvmh;-CIU;%N$x_cE=YcJ0NzwNCjhI}n4_=*%cR8vNG$mYRP;w|IyUMn7Af z%{^T)>DrGoyM6%a&@D4ajE_GBCagkYVoRXf00a^c2_<%KwRFFDV+jQ6+I3)87xTVj zjAP7mB&`EB`_d?VE@d0CBk=l3SQMhR+$o?w-G0{y^jzglJH_Bc00r!B=~fFB=NY-< zwn$TM?(cr-!*43GCpj0u57m{BIf}t>h$4Y|nsFwYj$9iZ4kC%d=)QlW;VJ;eD%vSk z@?bf-vhOxnuN<)J$%Tb@eKhhYb=e5O@OvSx_KaG3)-(w#0p2X|`6+AI-}Uv09Gizz zqa;FVlufDl9Ge!s+kRZFSSSmX>RTuMU@w_Tm4GgbOM$Fgx?}Q@vXn=WDfP05H^YbZ z&)eB|@(G*u0=Z>FU#5?(D277!-+}`c$aNx*wRMg8yiTm{rJ~nWJ;GqYfc^;Ny+E%6 z2N@n72B+)3E9_0Dpq0vxa6z+f0&j5~V04ON~ zSZsUjM8Rf z=@{?Z9B`X}`wwR*8J8@LP_Ti0r~A`~vy*ZZ^E;XC#w9qEphU9gFj_YH>tblNOd}#IowN&av`(fPXqjlr|>Gk z$ibFAyO{tf4bwgMc}kz1OWHj@8|mKQder5sDFx}Poc~sDQctr@7BHxB7VA5QsaBd? zkiP1$%O;_UrxGxSG^n8XYT5F+8f%$Lp`sfsYBmS}BqSMxX zIpxj_|N9Nw8a z&?!EZZ$R{zssDbG4q}NW6PbOzbDY9=Gu=v*pdfymEE4JWBI8y``3-K=n{_cHp!(jk zFtOYLeOUa8y;d5Qd_$`auVTNcrY+4HBlHpM!l@NPH%VVHT0N=r-I0(R~29PrmqG(RBkoQet05d*hMUGa*+QH}Y63`gi532;@~aC&VcGOszn$Y8jNrx;h7$r|XYHM6WDFI-LK zLu-%$AbLhf)bYFWj;>fC6t~LuguK7Z_f|k%;7$T?akc`Cr5oEy{r{aF7!N{V0BDA? zt@2|M5&B#jN*nEf)eK!i?p2sbz+d4%6xmJzL?rfw)Hv2ul`ZN=P_j_4o|KKcI}N)E z2;pUF_Fq5TKGghIkGy*gwsJtpt&f@AzW`0=Wx@n7F9TjAlNYf-4Z)D*d*ac4o00z} zh>9pm9&!aPooah<4kLg*ynuU2x++87q?7ZDZK$+oW;-Ch(Z9-MRg7Z{_udd8&)j;t z@$1DTfaeLQ{ROS#fOCQ$kbsp*uPkRqLb3R&*@7%pb;y z>#`I-YgO^M1~3Ky79!RBew*|94~@q41E9;8m5sMw;D~hBIBPG(*?d1iP~e0O1?A(+ z*^qk!8Y2Ce)p{EpQ>^s(>>=ItFe7tF*&B-vQGx2qn1}))R8P&Jq}+PH zU0YYKsx;@eF1Li5y4*qvTTQa*3{hGoa4b%3V%N&Mb>r@V$O;>k3Lf>ZSNqk+nV}S) z(bhLvLarmOlB+%8%-3m@J4xlGuMVN}-!g>j%7lfL@X3pwV{S}tmHq1=I=xOnPSZ1F z(9yb$h(>&l?-fnvdV41sMtf9n5zuJ&bwboUQ-0ew$S1~BjS4#U&#eGmE=%)mT!?A` zy8NjGM{+Vy&x1HffCoUb+u9z$4O2bm0HRz%WBTq1L2mcX-l#wkzigS2!1FO zbRM4`_PG%njD>E+V?Mqgn}o&_CL7fHCGoHHnwFJ7ghjb zdqlZJBpl4Q-2}#^p2{YYuFV%WL%52fSrVGVSm&NOz}(PDlt=H@3SN{fXc8yX24C4M};1}S^`2uTU;=8bGC`h6TFJpfY7{dP3hft^ zehrP;xN`-kUFBF(=+m>^2|zdB1hZrJxqxG!ddUe36I0B!BB=(*@fpDe3>jg~@@V`Y zeF2jFM>QpPVdJ+#G{RA86x-(yfDiY#C%=!>GUqV;o9cm`{;^Z`1<@a^U|nog=&tHC zo9B3&yNN=>aqojiVa~kCut`SKO2# zu3hD>{_XIPvN&GwSa-H^PmFt|NqWHX1N7!>vw{xUF zuTzdCUDEk7#>0@vEoaBes2TmmG$5C|*Q%)M>ZKqBiiiB5e6y0^R0VMcC;dliK5wax zkBVr`YNT#?MHcft%eRUOm&ceT;zxL!5YAO?tuloC(CL8?KFWFid)>787b`BI;*OP@ z?+8nh$lNn!NEbizH(}XC)b*kE!4>4#A#nD7hs58t2#Gsvf9(Bmc_hDBjs(}IUY2CX z;i|urg!1&3n{vVrlh5{)zT}L4-Ui_uZBHP-Q1z~>ayLuN zTH37;mewZevE;$@`z3m{d}=D9X{G8c9zg2mPQ)#5w{YRMrw0Z@yCs5!S4LW8G%evr z%xYG^8xxpSe>#$dRVUIHMU)#;s+6!63us3DnS7m2sDkR5JW5_DwkcFS?BigQeN(6x zpz)qhtuE6JqrLtZKHf{yNMV!cboF+!|3@4Aw?T~mKC1MTw~9vZ^};W6R9Q6yk@G+K z%=B^-%%|yWDbxsmUa1sPr3+WNTC%mi@PKea;Fa_3TI(G-R09s!bUiJHilm(6*3Qi5 z>%~ZS8Pxv;_CtQsDx$n{*qbc$T047viit&ZySzF3@X>DpYk93qIW{z#E+ID+YNlMR z6PBdme9XU)|ELiqg&$uW?l_vZuBBe)Wy!1k52YgKrgGvC0~HoNn&(Nb9BbX6T`B_O zPl%{vfS>Bgsf$yjjt36fi1-Bp2$tEul+hUDOvz_pw63L9j~P3`sw&fJF9|ET%XjGJU>ABIFXfO#hxFI z?`N)+Wiu+r3bv*cp9kx@guJCXn-qY33m+}=bWm2e`if+Q&4`silYlUQtrTYP>}N77 z6C4LD_=wrDc{yaLDkL&?=c+cp4Y!a9`h_m9!yCz-%&R4Qsfe>T^)WMB7Y}>{sPy&# zxU800hBD2s@OEDs-3GYq>u**FQ;Y24wSPWhrnW`tL+E>SPAR4yq#)&_H((hR#GnaA zP=Z6z{x@R4H26J``UV9;h|`g_?!JHf`6B(hs=^iqp$Sh^xh`Vh)?XFF48>zU+&;N& z_W%d}aipoq8;QsK&0k!UqfC&m*Q+xG;QWCFk4;G;)-m(*vGPxe?!i|2TibFMTCHyp zw0j=HWvVBnJ>gL3g5mR?Sl+=J0~zX=$VBPI8=ZJUdfg#RXqvRrUfOPk?nW=%jh=zL ztfonSBL&$BV@5l9!Du1l53kxvms>}9>GYZZP?@UN{tZ(rv=P%>E z?<%(aKQ2Iqh~4k`-Gzn;c{vnhu@~%4nISoxpEZjM(a6{@C`9+f)wWq!E}6q~a4N5O zA^&|}g{Y{TdL3jX_7V_C^0rN!=|yv1$h)3HWI1fo0sWs{=*)@RWRrs2 zy#V`{p%Zk?MsZ#J4$pNAw3f~Q3Shxj28(k7-~ll znoS>+YA1uFx%clG@z2blk3e`lIxt`tAM8V%BN4uvkU#$Bli#yN3XXM8B*`=Hl)jfF zB;RG^sNtwtsOiF~)S^XP8<@V($|c}IqBSzPkdlWa>4AVh5DL}*k#d-x&r)`jkWhDq zG?83@EsgSRbMSRdnMqr1Q+}_tv#smplFAaf8=E->ZOX+Cfv~lOR)^Hgi0@$=LUcHD zyM!bHoLro&nZMG9cfpWYt1lZXdtCz%Mi^Q=ouWk~b|-2}DxqY7wWA>^x5)18*%%#z zorzz`-&s_3zXR?YHl(M!eXt9!XE#C2X%$7xnMs)bW%vxthYTXg*!Nf7gVHL;^mrC7 zl$AMr)IIaQH!)E6;s?`VykGU2M^-^v_$ZT43spolY4UdS4||!Jw7`|a(`z>a$Db>< z<}ci)pg(%2m$;BW1mci%ULHE`tSnf0$YwGg<5Qj{XPa z8o5gfnPn?FxIGfWsK-Uu)Hg37oH^5|vHekXlePQU@7FaY0~O<-v9firs5)LZl93{J zNiX^v-hN|LN4JxbH>*oGXK0-zc z2q;Gj>#=&(+U#v)W=4=9N7wiTFW(EwrpcV#;KjU%{l3D=u2mGOI{2@4l4yWb<`Wd5 z@6@I}10g-Pv=m2>8}LtW*JeP zcWh;?G?13JNH&G5{_9enSl}tJV3NFvcjTH=)p(1F&-fkdeEi;NdhEc{rocg9RQ*bh zWxr+SelC|cMQ?IZlg@hHCQ!4s%_T8980o?$q`7|gv<0JlJN@^i_;5wU>iC`d zs+?k6Te2>p6F~?jzkqu?37>D}n_+LmH;p;!gW{&EC5O8wmtHTh1m5r3*(Mg=$3Mdg z-TTEgTAwj8MOw=6vegbBL4L{(zt1?S%{2c1-Xqp%Y_n6CsMa={_y{laxE*kJQ@3`^ z;B~4M>K-G@)k?G4x4i6Y5vj?~pU&0c%KUms?ncIXLQ7{WQj05GKap2A)6-iV32UMH zg6fq}{ZqUMjH4dk88D-|H8q{y=^?6;*nmW?d`A>#iv%V%uEf6R=pU4#M~wpe#G$rixiwRc}k zudsVgaiLIMs*Yf}c8t4r9KU!o%pMi;DXsBJPsQr{G@g>Qj8wrNX_+9tYvOOTP_=aS zxpnou=aq9C^WM&0d7}qr;u5HcvPxD`*>NcTa<+-z8~rq{g1P=AtodR+U3b{z4}YBk02ZCWYl67`yv5ea^2R zFJEvlZXP#r8``?$8R$o}Qje2m5HvPYO!@V5IJq-f7WJ*D*tvgTU``+_6GkA;2WThQ z&XCOz19KBTWHXL2>+@JiZWod&m&HHsk;U1Q|F^ZHe2d_=3KZg(KksR%Yiu?$iTQPm zLpN!GIXQiehpdwM{iCn=e0u|O(+-46R5_WO%kB#5+97pWE|%$cOFmTx7Z8XmCx?d+ z*$;e?f^!j3%m*HOr-=dT$Cb|rrw<2^EvdXU?H~*8I8|~PAFF@O?&EzuwyArFHZv|1ik2VaxnykYC*D2`i#FuW^tsc`y%b-U;SJ zCtgL9U+U;Q8(_ZE5piv{j?q27#Sf5-?KXYs#+gl4IHgsVV}NNh<_bd&jlsoP`jZ+qXk!YN>oSfqQkD)<8MhYr*;J`87VDRwU}9}7a9NWm6MgI zGA1yb|lT@9w2 z>28HGnlG094PU!yUT)3YsE+Mh$q60T!;z;C-(>A%kinItnk>WZUz-T+7w zv@9WCy3g7Kmd0odN^Vwmds53*MpoQvN6H9rn$EHW-zk(Lf3|+rAsY4cuiUEctc56B zjxTOBnjLI4amV>iE6CHDUJ&*Nyxk3Y^x5|z$RZ-le?~7tvSSl)-&Gb6@bA2!_sG2& zM8%gao%0Hb8+3iZsO}T6dH*ivHuG*qCRYPBaBWUvJ+{cyX_k~z)|OA}+NI;*1j|ND zSZirgcS?Dc6#c(1Btko(wVo3yVzvDx8oT~u+RSui{=ry}hGf@i$Wf-I$x^kwuE}zF z#cNTrHSw#ZnXC%tSjjF_Z<7rEoi56Ty@A1ns`qng0f$?2b-p)~Hf>AV2tVrs#CB^a zXY7%e&zGWG#6&zE&N^zB%Z3K{T=#X!qW@V_UF=%K@tU$ z*Al)ZwE8SES(N_tH09Y~Ou`jatOf+aTsSG(cN|+rFL9pP+F9j%zvqN;!h8mc?j}Lcdr}_HGotgGn6`zuc5#LP=^1lo z2t+5feJ6q=0u4f7>3#I~WaD<`zOU&f6{sup+9>@PVOYkLK?e$^p^*gKC{9ZND3@f%YZ3M1iE!&?(}%lw5ue`2w#P^~ zeBKVB@r&@acs_Q%thn^=2>Phv6~DLxArOeU41Ltz(Ng_9!mUz*;etox%;$cumlA0t zY>Qk@3OdcU``S$#Gsx+OAO2hTT)rYT4F?r7?!=t5AI2s}n7mu<`=-e^4m3|G5X<@< z-X%769cEqZ=MSf?G`W6R8!=8Xl~`LAO5=CDzUxoJ#PlKHFf=)U9UF(VUvN;JN+Vq9Ila5gj@Uc?9P2C$^x!r4)TwBEoFapHZ z)4{KgJ8ue2xp%t`-|c>w*gm5N3{b57epa7D#eCGIE zjP5J&YipnP`E+wY| z|98m)LkV&0oOD8Em?g}Qe(Ch98+`3dVW#>x%<1a{ll1hjW*@uD*2}flfL6d7@r&J` z3FZ-6z2?hS(l&hU&)cpM?|=E|LnX)JXq=|0UUVR_xA|vZ1p*!S=&U@*xIXD57rBJD z6*R-aZi;FQ@T^7+PWBh$K}>wRXO&`lZTyI;e*E2gW4Jw_C2p!)@^w=DFw3rW$E%Ulw&51Duw$Bpm7Y`3)Z2!~$qI^Ry5vq25 znMuP+FU7o22ht^sd)lsK%huSJzqk@XAPSW!Nj4p3%7tiwJDw<^9R*&HXxvHWxvIa3 zhJDL7dpYiMIwf@-2TAy=jClpmR}GHFMbIyJBY!+nYI@7T^G@n7iEG=2&UI((gtB** zYNJY`qEdW?go*=boO7TA5;}Tl)Bft0^6`!S&McwF!HD5m4-c_==F-cr>?0hHrZWM9 z=1d%A1$KT8Zh{bqv)x3%+C-Lb{ayUO0B3xaa1V}ojqP@_%X9C*|2fFEJD*!s2+L1C z7vaVcgqwQ9 zVk^ltcGuM#673$Qwd||$s!``Uo4yja&HEvxX^+P-{jVW`mEAu$TPM|Y_5X=X#fJP= ziii*C>+OS6IC1U^{m77awg?x)1+D#tjg9TsCnm8!Eq-BXZ`0O3i!2$WpQ$EwZr|}H z&*6GzFb1MX$(=n#T(Yk!l` za5aP@sa)&XGlB;k@rDy2P2Le*2*$VPO5vwY1`q2EyRZHqO=lfdb+EPJ14u|CC|%Ma z-3`*+-AH$L2ndLTba%JX-JztkbV+wNe8au>JIm!Cth0U`X6DT7+56q^qfMXayE1mm z-5|75q7uzu3pGk;IW~z=DCq}USDmNw%W;&ey>Hjs?EWZzL4SWw&#rd)PDah~seGF_ z<>x1F)w`YhBb>sZd3*im*@di1hLRted;9)cJodZ#_PTe!{7M?BPqE7Xx4}TMr}^Jm z4v;oYe#E3)O19*CbeNdw19-4Ip`&@ZCuV=xC@uPTp;YJu+3L{x)*pigH&IYES$~_? z%q-v&>=jq45aBePAG$`%?vx_EwoQn&S+}Sdk$UAoywYqm;#k#naqf*)>9b&diBHML zzdvMtOxrFvRp+LiunWe+6e1%}V55u>Z zR|Kf(Yn`vnH`TP`pMI*Ir-GLUOc+LP0w%3hF1=6D3z;|f z&)zN`bZ;RApU;l<{XItatD}Pgq*t2vGZZ>*G^toohcW~Iw>CwLz1vPkLvu=k=JCgT z*!E@ymLm>5r>08iAo-Er50ig##&MT|oGFKKP0W1=%50a0dSM_46>#$Y_Vt2%{4>Q; z-v9C#l{pW%^~KnYd_yjr4wkfvMJY>!30Lg*hUZZDBuur`{{_(3j!HxQiS)A(FIqF< zJfc3o??Qi*!EUH|??DKGup_shf0^SyENNQ+M}#H+Nu`4MwfwJx^Om+wH9heaK~^8l zPelSng)Ru=Dn$N0i=IWXf0RsR)2{CB8@PNS5x>K8C&h|fT5=>xkEX22?0kx$FY7W?Ec37V@?wzl3!VI6!5ya|S-xoe&TFCqGh{l$O?FHCqubNpSqBikulX0aM@857Vhe+)xe_Qed|h2HLHX~MFcV%RaDQn-6i4z^4fq+%+2B1CKFpJ|c)DP=`xOHm*N@L|{k#-+M2-d_nIIS5zE14G@+l zC*T7$v%01x0)!`{60jvS%Ayf+oIyzg9MtScySuxzc!_2h$1`^{WoQ%#lmw{H0h_$^UBjpDbc3Ql$7~o&=gm7`YUH|9ut;*!Hhc5mi&0{tvYt zm}GY)%1ux22jyAJ9h!KpI2_Y??=vhg%hZqJvKKE9KHt@fH`@&Gb(}>S$P-P}jb$(% zmA3lWBmE)%{NJRTIQZj%Wy{*ESSY~&>_^rDEC{e5I&y1Si|``Z88e*Wi5^+My4^%V zrquDfJ!_*XYHRza*aI6~GNs|2Q9sBt?!8tWniTr}md`F}VLvWG1}9rR%1-O1TSaBX zpl-$cwq-_n^(hPl1&XY>v-_a@3A`>Tq~^h}{Qk7gg$hxnRRc2%T(f@20sraL=Au~` z{Z%gcRqmren8*7WpX)A>wD0VeBHDj%b>2j6dkU}8_}5+a%M(5Qoqym>$wqzM6s#*@ z+c!ttA=u(evhjO7gVBFm8}7feaX!)Hy#4U-06eRKk`&AtQ$GTbz4!we0Y_RSbBHPb z6PB4^qnV!H7ZvQ4ydwDmr5ILt*Kh8&G<-hY;y7z2Eyy_WG1<@^zO#kLSK5*`5%r(W zAF3W`2=5{eru)giUbV8P$>5h0t-5Yqkmj|Br^~BFoLXfxR9Z}D64t#-U97i$e#(#+ z)M|B>FncIcq?!9i))7tYPz8tf#yicjIKAJxTX#Oiig zbN%06x9l9BYaA{994fMAFIGq_x=E_@&hLs7|1x#>VA^BU!9i~Q=a0PO)@0G&n6`=^ zrHKyX8FwhdRuzm(Z8m+Qv0;BTl~Z}|%Y=MFpUAxHFd^Y?pRnI$)~Wy!$5!^|-Jj49 zChy((OC9L7HVL%wVV(9f#R{r&wE-i}iEwNiHl6uU#tE5$V)i`U8LA^eAflIi=E*Wyepln4# z*BINc&+;n=&$N!qx#>lNPg)ZFTK%MUf>`e_R}nLP0UC1#yZMnJs~d}<@_47Eu;bps zJPra$r|ebw@sJ{sNWiPCsj`d8T(m53II>NIgSTFldOdz|-9G55wWk~W70T9l0E4mh z@gaZtce&TGw|)E5^cnQGf#0H$%+`w%#BJ<+)7AglEUSE5a$41M-$;DqSv+f?GVn37 zxv{VMt$%VZchr4GwtFhV>`RAaTU3G-F612 z{=L`cXSfE;PZcHiHwpqiC^I8Z$JI-F=y8{S29p{_hdeAsPvrZL&Dt(T7i}42+R|8* zrl^XdeNHpBDP0tT_a2@f_J0TcIqqNk;Vt&`Rh!OSx^XvZTi@@n>h&w=OL#&5bAzn% zd1V!N)t)}L#VguFA5lBA^bsoC0_P=bt>4uRE!l#1@&-~_6A6tH}*!>=QdMe?XH*|!frhq`I z$BxwGd`@c)HmKw?xmdP;mJhZvc4(&Bs`Lpyu4ED6qHD}%<32BP-n*MB5aJ#?YmvM^ zpU&bS=27x8K0fPktFO>ualReJgOI$UmZ&HgfU)$~Y31<$9T7^_+nvHHxZ*U0Ms9dr zLe;@WwS5ER{^90=iv`Bl*v?7E@eovdeKzlz<{#sXN4#FS)b8VPk0zb_{H;5WMbF3E zzc422GpIjsS3g}H%_x|IiA~)wABio5n!|Zxg*xqwrP_RQ!nEJsHo$t6_0!gV^c$x; z&0O7T+O#KP=jTWyfqR#ay^)M>33wg3wnLw1c_;P}F1&4y2ACrhF86$TIe zI?f!hsjJ`oVb^Y6Zdy|Z7Hp|N5%oevy5M3X6;;9t>iPpb+zJmD>W1sAH%3#v&J8l# zJU@kc1l(w3ajTzn%1pmEc^^Q#+l4JqOglKL$I(y;Wo1?H{RetW-6+|3-)`int_0**=U&N1KVToM&BB;YIAo!_1F z)7RKIw*bYO-!|%{X!d%Izqo8}ibM5}Fnpw3G!cFwRIG}f7&HPOOC6=e`e4$#LKru%^Y&!#v z3+yExO3_u?ML)5a59cd>M?J7}C>`9eHx!Zt9D*62_6dPn%jm5pcEbFPZZx7`a@9*Nytac8PSAo~U zD8aKk$WY_E7hYY~+)CR}CRRSGJGlHm6I8XyGn%h{g+#CDe}Fl$isY%c^{GAOLCWS@ zdC8|*MFoBl;EGbgf`wp-0WcDPgGs1d?`w zcq=s;o^bql-}UNojnTl%@(L|&$!Zic>|r4d3GwO}2sy__ZCg;W?7TLP9~lY6agnZg zZ$>`Sn7#?%*c8GUeGF!mMgAxUwf}WD!uu?}ug6nsDWI>BG*}t26H7d7Vb9^&%s_$in>_Ze?*M)a+PeerYpLRJ|b(p({_{H`9HT zu2QJ8_cGB(a|UBb&qJ!M;yOtkR?E@%p8`tRWt8ajmwEJ)wdK+K6@ceYg-^25I88d;%SzEfiUj;bZCOUQKSIw4vwcU+X zyH)F0pbF8;K460>Rf9#XGC1oA5h0~GjDk1l@V3A^E-NlBhk>-|mz~1gB|GJ&+V9|oM4IOq9rzFyAqF+FStS+Xt*|^uyu;%H-E7sXQ zHZM8}SIzEUiX6=+lp)g3YC+mYLl!VZW=l=W_B!-535{17{<4r%?@&(6g_ERt4{|~& zZMn}bn-wTgo+!kzPxjcEt=b38uEWt&C){to-#pvh9sm8j-(448*VWIbAG%OP{gTX* zj8?b4W=KEnyxKfG@;WR_3qjd!Vl!VFh(>;(kVYRX_`3f8S^!_yX{fD}#s?P2FDUc2 zFVS+RjQ0mW*|W|PUi2dtAK8XS+hDPs19jE*HF&ZyC=G1s?dF`tb$xxqfWUvy8|Rh z1Gd-E^k?9OQw|O4PG`>jDxPdOq2=2yD@)Io7&Gqr3NLSn-MRF8hfI-@pHvT58(bH4c699xbxn zVjN{GXLrYW`n3^+D0u4;w8#+%V|?&%A>kY+U{HJhsgAkyvGLRw?eW6IbwJ(=6=JbP zIQE#PT^BUf{dq(`SCSOZ+~-3m`cv$jlf;mUd<)8<}IL&xaiovZMdDG zb0fT>JL_EYZ`-}nsnOnt>VMik=Lqso?=Uqm?HqV-GC8p9=ABhrQ^sk%aFyzF-4hko zZiI*49MO2a+<3L50}oGyEVXphcrV}_UCCEOSX~^# zV2h=^7Eu0mvB{+?=O1#O_HmAp-@GxU*%3UAZBZgwqi8ST^Icm33&_ z`H)ixr1j@LO5AheDsiR}T)@pmiy+ul*RTZ-%N@T`nvCVd4YrR1*0AGV zbzll2H9HAj7(kV8^D;Oq3;bbrMg>BlYG3ZEy|$DBN;3ba7_;^tl)qj@i~(tjkNZ{BQ2W-^;hCTV%SsG5)XQ;q?6<`@N}>E%ApZG9`j6 zu)fGpiym%PFvU?&1h;G4LT`F&$%v|awt^5%s*xMy!!y|`cLn)ve!%JbU;i7&TrNC9 zXufJBjGd(A!Gpd`c$#OaDi~yxp;D_?%2`tC`M2D~xHZ{v{dK zm->lDqWJ3?8mUMzZj9+WTn6&~EN@ND;bBatC{IFUlHtXjvPw!5YAS?Rf>$50tJaf? z9>QA6|GJ+2D69Q-crF=?-jAaKf#5*y>nfphiu!vIz8K<1MkyR+D;!x!%CeK^?`$mW z;qjx0>_~Tml!=u%0+f;!TjbrNw26XLWXGNr(2^ie?ih1b7Icj1z#WwGTOGryvrM{>XJ#=C$_-Wux*oMX)0s95_z!|^ z{7$4t{)>sk$4*mBT$m)ivu5%nIVWCG5ut*D_}Fc#= zrR>3f-hymmokcZ0y!8?ibmf^af}U2NHvzBu?9r0V&uLg{1%!a?-0E(uFQOC{aXdSi z3%Kt$*w-BKobv~<=5}yuDmV;lUhUEPxNa_=D5_^?YXASD#Rq z5=7<|6}I!Y$K@>}M$S7RJhf^H|Mo4*`-od4Y+wVI*X;nbO3zR6iy-J_?a}$}Z)?~Y z=$V(DBjH79D2-PYyXtC2&{iZh$vmGFzjF0R57}TSm5ij3HVs#<+XDhHE#pL51KTEh z1Noku!HK) zVF835u!;p`qO@iegq;0wa$4}mSKJont~aJRiB@br==T|}^Io%?qkP?293wD(QX!6V zLPuX!d6$))uPC?m+&%Gw{~-Hc-eT=!t{Tqo|Q_e^N$^IE79i7t7o5jtJXfXQ6Ft z*sVU^!!>?)7a6(7Nx9eQwjVX^>Rp4+=NF?f-psPnU{CO2(KPMG!O11|>MRqB^i^_^ z(l@~S{TUbtE%J*jny(rlXhBC)g-!$L{XHG#P%oP{tLf|Sw_-~LmM0Sv$`DCO$*^!9 zwe3cb;B0Tt+-L;gvx=*O4rSnw1N@h}o(Dj$YHx44-{Ah`%*+gQ=dNIJHGSHMS==rs zD5F@}S0WQ*o#!KVy-2pK00A3AUWK&a9J};e5Pd6sO z5Msa)@;yHO0vO;cq;n}%sKWrb*JV773LYL_BE6OqV95c)iKfCrarEFyy%vGHojia& z{)o9aIV4;`>3zk0D?Smj@ImGcFP-`uh{$TE(QK)!+%wY1ZhSh!*KK?`nU-_Hs&?n@ zjhL}XN=YoOMlFy1>G%uOyVkbRB7Iu**R@(=R$@l+u?owFe@e(^Vs22hjIBGWG*87+ z258D$(^u#uC@jPmF$7l&aT2a*+pe<-cK`NFage#3D@^ZiX-p;DPw`Yf6yJALVMVu7 z8T}(X)!>*Uo9bqJ%pwl1Y!@Q=o|b0au)yoGW5|*Mdan>j0eP2~_kNW37`a{vYZLT8 z#7_Wn>kCy6a22X%;h{eV1_tg<7P;@w9D@1U=8~^amx*Qbe|i8NPJn?1TXRfT)mrVi z(GLY$H}N@SmE!*kUjsJm{hwGa4;Qc@oZOPq^wv989)I5 zt&n-Sxd0#F1->ufiF1cnz##)2qRXIRX;~s&;PrI74H{#2&TnhAE2zUkVcMx>2~6i} zG{Nh4K_lt<1COnxerpr+&H^$t%sWjrGd36^T+%bPHk$3tPo)>9KGYOmglexNDc^qi zOwA%?oZAci*%?g*6Oxchi-@_o+VHzXL#g}IrjJ--6=hwjBJ}p6e$f}q$H8?4nHfI~ zVFU+g3>c>*D5E$cIeA%j-N(`5DVG~tN5W=Y|8!5M=NUNtY=P*9$pNYil=U0_%s4XBN`gZU*Aa~-&0;*O`yFK7(6VwE!cL+B132sqzjY}|NhJa zZu=lv0{EZ6bVU1yVb^~tCU>1MXfF=;9BGHZG9NI|#z2S1iz_;CDq!gskHotK-WR}Y zf|rdA3j)&0z<%H}NO6M71?>3+m{3+0mcXFN7xL*lM*Z~UWSj$J2tDwh0C`c$I7<*L zfX=lB?Fs?6gTMIptuL(Xm*@Zc6;q*Imm3e4=OZsa3Xs=#fP~H556Idv9>~!=x324acIdLMAsy&#Q)t*Se2!zWRuYkA_g|JI{eyt z)?P^0ZP&~A=}W*|0OU6R0;3|(u0OWaE*CvB(kA~n*k)zCa2uqQl}Pj3^R+9D@2 ztz1XVDZcXGSLN;3RG9N0o&I|C!d>yMSTa4>qwu~f06)g}AcE(59@tLo@V@>#lV$C} zo*-6;v}X4tu@ALj!tgNYT*9>{(AbmM@!RPvTjdSzSR6;j$7WPSg?&?L$=e=Gn_91< ztpOd00c-3LzFkMjz|?>A6+qm(J%v?4)Ded8sP%FxZa6hLIXi>)qYl4E`Kssr*{T&l z%maKM0PS=!1DMgwZD58G^o(X^td*FTm#473!JyZ?bLkb@vv%qs-!W)a2e2vG)zwa* zXB^aO+*<)0lp^D@`~%2nuE*?`QrFJTj$tw?K#S(agI;TJ9^bg; zg6=Xvs>UgV>ion4nD%^E;^y0_@eKetU@u_vK?$Mcc#^;X1 zEL#T#b`k%V-DCZQ2*${$P&J#BnAmniOn=&4=|17kAGn&rJQ~ zQaq3T5R%|u07xKAf^HarAtFz806M7sujb5QVPS!d2~Wo8_BpJ(5#Lbv7bH-av|>pi z^4iH^{pOU;D(gsq%{Qc#^Ds;{<2rwDnt~qU#pEB&z1|*4w%d%Z zn-Ysep`z4E)+IX{@G?n81vE*iG-ShddKJ^VF6}m{k zSuhPUj^)ZyJUbU3shEaaZ<~4C=8Yc}Q~x>nYEtyEJJHg1M3{#AE^*@Wz+y>5N{ixn za(1nLA#Y*fuy4g*(nB z(2bn~4?7_LfemPFZ3WN{(8~5q3jC?S@fknSa@0)6MKN!|mg&kCJ#Y?AmW0GaRKV^f ze!dydQYmxgAte0=w!wGbHeFJp0QiC~{LPy;EDoze7N3ysQ`OZ7|F$m}ahz6nCqr-R z7Q;gbBwjKX!ttVT5cazDN`8>J=+tDzo!O+0`Sgy6@&=z~<#Q$Lro@uq2p`RzX;e{Q zqP%Cd+_oRK+UlJ0=0eTy*p6{!x8B3ra9VaXON-7T2k6%*Dy}H{$)@O;8Y4go_B7^MfxZTBObE3L=v_p+2KZf;kgop=yOMotc#_#0Wxup@8BFhOq} zTfFircPZOhh;S@ULAFv>Y47m4Xju-Q0#}p+f#qETE;9KSsrS4~A6uLZ)i2{iZ|1ehFC4z+(kx$;ta^EQggiV*vR*6M?0(%aPK$wg;TQJ3nY za(mJsCCOu3`D5Ekp53K7Fp8+wQZX_YbXFg>uYZYo*5}<5?6+49?+_<)bG6!Te?P~5 zyUWQiuf1Ww(h?7DJ5DRP(Fy`*>hKj%Do`Rx(Ed(}L)Cy32@Di~)fw>0$+}bpL?|$t z<|CQOD{A+9w6#)Iaw7};!{IA8X)#};UeJ4u=^cL0bKUrAw`of7$3&=8P z7uXOmb^@5xOklJYf`Shiz5w}qaDC6~x_7ZxRt2X)%+l{8kOe4%dUZU1+g5|j-Hzwi z-G&-g2>5?g-KO_#r8C@)ph@%T-wwmS?f(QTzKAYx7V?8~Y|<_CVmIk+!Df5mAzZW7 zjK4t><3jF)VwT1cJBt$t1h*}9HP%K}EVvt&++3=9_7hd{qL{_0jSzPteX^8{aAAfI zThcDDOO3D>q`fDDq&OGxG+GDRIa}5`)ysPDNa8`wThFiuEkP$~x^^Egb$KD3n~R<{ zXMAp&>^W7@ak0i%Ekk^aaMA2>vnBl0zeAuXj?|?9qz^xY(GRVyt!41IHt!aufg94O zS0Xx#$H^*)V|Fg@4BMJk8G=Bd$J>_V0elg`q}XzRhVLc$4kkdL0~R%hZt&Y?$s=2{ z`raRCX=yn*-GPG=xHCQh-!THz0bsA_?3H&0)G)yQ^4vUL?#hD?#5rBUr$2uD;9T)x zrK7V3wv2$I?AFqz*WyMd9+AvusodgLWL1zdvITZlaQ$NAdL*N!r>E!V*Fz5m$1$D5 zb7e@tulb@KZ+7LKo@0&W$HsrxDJjer3)%}U_rwfnPII1oXPknn8P=CH&8P|Qnm8U+ z`%Xm>f8?t^<`3wU;L$X$IZ6wT(TuEo`l)_T@wKE*RdF&vV+Q|A@+aGw?_rfeJ;t$h z+q#{!L&K(+DB^47yW?@AT}5L{6<;E1`U$lov{BWZx=3_u+|6b}f)H$-e-|qL(KG7dNdz|t=}6gc`h?GN z4-F<&v$LxFu5?j(Q^T@YT8xq}odCDUvivmFesI=DMc(s0LcHQh(`Fc#+yGG_157u| zT^hd38bg|9y!lGnlA`uMX~}7G6jb{xQyw~86-4F=7n9>@l#UO6&oeIxH$?Y^J-Ub1 zaEHZb^W)Zyyy8j0C!ZqQAv-Voe0UL(&#y#|HHAclG0^FXGMCOT{H~zAXp1soM{BU< zu|!i5paWf?ErZ!6=yqN2M~AQP?@hYjObEx8a~)$d>d*a-KbCcK7dZFH+CI+?ah_?z zA9bYlI_>Fc<`34$w(2qn6!51pKo4tAS-BPK^DWE!*Z!4-B`LhT$n;6~VgPPETvLoB z_+V=$sZHmL$oP1m_ExEINw)IDy#9l^V}m`SQgDq}VWr&AG%XL~%EbhJUl4O|`>!ER zS}qBU>yO>LA0tcP@!rx7TJ@{gT|}kL>!28`#e6mFron-n;1^0KZ!$XtF8sjYpLx!p zh*3F--ipdD|b~hSJqjM;52sKkRZmKOvTr`^Ljw`8YEP?(Hl=h@?W3 z#pT_x8ispru)#tFxt4pm5GFv)F0Nm`+CUAp@GDWDWP993Q9|PIxhUf43ZcQfeMMK* z#Gic)Zw8Hk{>FoVb@}or>3zC4ld_HNkGJOgasDNYvi7!?t3M?*Va3J`nZMCXkiPnY zThXUw8(KdVJg^&Ed5(y?_U~ZaQ=@BK9{h{L_ISQdX-$tCLC9Hd3kRx=mA4)ob#+b4 zv?u?5)u%R=*f|k9fzK`S)cFg%kco07hu@7`ywQUD$xmf}!eO)VRa#8SH6>S4)=UW< z;Y)T>1svvb$cN-VSbOzO7o}8;1r&l637gcP2Qari??X$x4LbB}FddwXTHa0;aEBaV zj^Kvk4LPCUU44VKW4IdD`YaQJjtt*Uig0%b&X zx7VQ}qm;PEgCQdP%?k6UxP_@+HDiU>GVyrLtF;3A9_NisnUAelV5CX*EkWfnrHh<9MF|oa}d)NU>j5OkPPvA_#w~SR5vqFg-$%;56Yl}4` zmU;OnWq*!}=|A1y-v2?4|A&LfGQa2(Zo0wj@JI>`m~V4tF6KG^?U7M671YISW5r7k$tJs}EXTXPO|)O3 zWvNFj4>Z;c7W>m&4OUCPyc03=azT+gJyzs{$TSi$LT1b2^Tk@>Fqz!k?+^XznMN4s z#SF~09t~V1BA7UHP1-*NWm~)Udl_9rfR`#|KCw+a_@uJW|NFdMKZ}3-O?MQx|LIbn zk!LwILFqCQF9bml*80Lt(I$r;!jhC!sHj3`&$6NKHNBnA-hO(_QloWn4i$hMmPXgI zm-2l_Qtn7=vZf44tN*7LgRv|%V%xn}@5zv|y}#mo>TUYJcj3^>;TuIQp72*YF|)jK z?C&zE$^)TaJsG8bJ#RIpYQDYT^%So#rPMu6-~#ZyU-53)q?@z-g;q#KxtEa~CJUzZ z&Syv}q5T#L#CGprolWYb0ausI>W=SV;J^Q8;PZqKil;B?v-TT~OOLGxKBI#sbcmR1 zb%GF^$cKdULWzKu>_?Z4nNpWp>g|2!hi#|Nn>nND|&_ z*26)BiJW|4C<$5-JNr#C2VxE1iWzS(QzAgZ$Xr~6g-Fpwjfst@s1Y^ajUzYm)EwEB zlXo%BLqSJK`NFIeVr$mx;n&%VeU1w`y;4SQDu5GF)Ucn#7YlJ4CXa{8Cuvh#W$ymP zDN0D>ev6BNU5O8U=dSVONH9HAF8Ta5Y}WIR4&R#oU7Timg+lU%Bdi-O___)G=j(`}be@0p3Gwvr3xy9Iy95dk6+7=OOy^~WVE#4sp4OgOJljh{26M*Fn!)l%Ly>>t%_ zfiQ$lV*oW&aU*Xkm{g~%Nk*^o-h37b;S-94=={%8r z9g@G=={@!rYF3Wctke%*#gJz=HItW007+&qVUFCym|e89ZBbwwOPVY&=X&>PR%Xen zn``^^#*>GdN^pR*l=s!2DHsz)>SoIX5d>GC#RP|b`l<*CwybosE*3M6Uydg z4D3*lA*HUK3^+E9thmL4t+I{ zHqdoTx#IF8#0D&;{$C3~cD=o?XJaHQDr-@imSDpX;r&Z**YbANSxj76OUo1F+d@J@ z0H;|tmF;UGA^*HyY+eJ77)iF9+4~LnJ>e*H$%U1ZzEbEF^vgkw_l#rF$JMwTi@)bG zSa&^D(iF8UE|3oM)FLAykbik;Z|!v&|I9Bc0=AyJezFKgS~Jtr>?|zGC9N!&)lqPy z`2ZT6pC4?5vr8d22~+~)z)GMx`bja)CkCZkNEV;`g`^0grOi^Ln27u4)gl7>kVL4t}hiqpJag7E}SCw=R;; z82tU483&m%?(6m~2nDU!qK+_?b0ZK}{$_Q0E32(4pgLuMn^$1d&1;pVhXu`OXu%SxU^!hW>MFkvrbb^5!3gkJ&irE7y})GO*NPJNZKYY8b4E~B@B4T^ z&2DS$%$ULNj{81@s!ri>^8*f&0!& z4GE-55)x%*;USc=$xI*z46-JGNsNVs1sDW?Ve1FDv;qPGA6?(OS>VxNVGSu;y>q0W zo+gBWGK5yAgM&obx*Hc-=C4wR2-APlEOfSAAt8(W1GX&uHLiiPa3UuJQs5m6mKAW{ zv$eG?079yN2L}ZB_-R1F;i}vRMfyq`ulyCJDA|e;ZE1^cMy7+4*<$NkWEso!1^X6x zhQ%;ZjpYzEJZ)!3c^{$1t@i2hthV&5q={U`aq~&-4v&J>N^CMXs?#8|?=8`RxdDd7 z6+a{yHi8@$>7uAL7v_<}RQB0QhXi3nBH-G@I^}t=zvLB>{YIv!&P;5=69TgM3$I6$ zXnwcn$7`5?Ih)b3v1d>#1F-5A)1h~uf8xc!KU(>GN&#Ku-8TvWfhS-(s7jlFvjN8L zaIxw9d`u8HD*IkeYk)h8h=|DQ!{txyia1I+ul27~uY`*$EB&@o%uxw>Q~|a6I5lr*rMTZ z^X?@6w{Qp+a7t{@0ofKsp({kF5J<80a$`%?ItYW?J=g`0Rm()gGUV(Zom{(?7{$F% zq}M|=vcrvNlt}tHx~%$Xz2CjV7^;rStf==8qv(ZoXBvK|QzKuffs>HeA9>pK0k_0l zn>v`OE10P=^Jkt!i~9uL-QeWz?WKB5KtC&+u}ku{5W>|1jJ3W00spmi=Ivf2ybt57 zgif)n|5aB)8tvlKaYhw!hNl{=>8DEimuc}L2?lGLii!&201V15E|5`BDoRTShldxz zjsgmvAk*0nOc_Bq1-`p|->?@rZ7eNsfl)7*%9oM>5z!Nv6=F~Y1s8RY9bW|g(`!AU zP$YbOKI6G!nVFea72vJlf(j_};mqO)G+5!F4g_$#| z2!TS-4_HQ|O9N}jaG!H|W=TM4wR2Vn<1O=r7Jo%WtFrKAkvbabPCX6=#EaS0Ej`&? zP{MfZhzSRIf)_ZqbA!~}RI!qOBMn&@E)sN%ysrD#l+*O;8Vqug&L3?}AHD8qj{QH} z)g+xeE7ViRU(8K`EoZdDTQPS^TO%v4s)DccKwLB|W{O6`D7{h7zZw{CV0;d0xOiuDstm zSz~2a#~`D+Ud3n-eAqF$);)GA7!xTkv#6{pLebN%&_@*gQOhws!-3vbaNRE^(iKyI z?`D2KtnW2@@#`qk`%|UW%a*4`N};fDdU>h$)3^^5U?=A1Q$glCKE4)w6EF8?6_S}q zNlA_V{xF)b0>kMEtTt6?rvah3r>6&OiT7Yhluhq}niNPH7lKM}g?bBcU0rIq26&FD z&`@{?I6nnJiM*+)36iZy9U-3AW%w7A?1Aqj7ihV%Y{2KV^8xq_P-q1Hq07L47Stt6 zRcR~K(_&&y|HUc1?3TdJmOVw*s?G~o>etoPp$Xh%>xtXWRc``9!^rR7F{Q}ByjG2N z`XvDmyjMYLC~8|0Va;>dE<$MX0`x|{JOn^Nw*UPD^&eoyZJ?6Vh+a@qS_=FaM@L6d zDXh`=Dy*|3k54s>$8=CAIWjLMokX#^Y~H4fwh=**eyR^MMtdWK^%)xhcV5=<6~gzw z`#3yi?zMGwb2Yqx_?(iQd=vWXXa~_A6Ba*FARo(l%@g`tuMO5h3!JImB^Gk|W?AU!wnz8kJ{;K_O$;lXbWf*={?tStb zTVd*E<#JuZKZBb<$lrMKE}pdjE`YAG$TGx;E6Q|dB@VtHj-suF!laJ6x%v93(A0{> zt>bq7jydt~eW8T@)9I(DA20C_tvMhQfNGBgTVa0w3(_3alX-k@96%!+*fS2ics_iP z%Tes@?FIEr5$!kV=qG*H24T5e=A#7m_Q&Pr<=|KZ!Wg@S`om@KW7q&7Tmd4L0-2=I zRQ92{xu){+1HtE81<-2-a@09w(qMN(2g<54Y#ePEMfI2hzBz zz%c#q-$t7`mPm16D+yA<*MRXpn#s>gON$7Zn4APPPd!b|m%=MB%$^+@vIbem7sfk~ zt`1d$Wpvo)M90O&#lyqH%3713pAW<$931M}z_$?)-og7I**|}t_Mi#6xV!rUi)e{R zJa$D5gF<*Lf`pU;gGY55F<~k_X;N~8{KlzXmW<65X({Z4Wc4bV-OU&i01`*f?ta5M z;KoQ&knEzao;YVCj_{Lye|;S^qs4vyPQo8`g_&xEF_L|*kb;2G%k(k1u21KyAq>sP z$GjGYYn$?)e!y(iH{na$;_^mYrvsLK4{|61+?Ui*8Qa^f$ZmN3=!s@jLuA#8yn=iz z`Zq&jyK2<*etS1z&wd(-=L<14vkdsJA%-*$haTENv>p%nCA6=gnb=4p;_Pi~BCv&4 zRs8u~{~ecjhANlcjLVB0)D3!Hq!8ZW@L_m*7he8fL%6^iCch zu2a|h-zsyP+0-J9UlYxJ^*1@5jN`@W&+qeyiA2z6m|MH8CqIos>%I#{4+dd()wdxrW|cHtBtCJ3)%74G4yVdqT{WA3 zSQ`2YWRP$>g(h(XF2E|B@!HZH>h**n-jEQI+)g3>V(_rY9p~PDYCXTUvX>ZjA!10! z_>1P3J0XYvSuYdhdp>hl>l|F?XHaJOVoWVmj>v9CS+t2&CStDdz2w>)HLyED+eYEO zpJu)Mu<|5Q_O(0SS@Hsf@$vrneBCE!?_b)p2UAvB(<+|RMQEPbWd&mNcQJSV=Y#Wx z8|afr&u8D$ug^AoT0z_^MkdA&<&sx+*r{lJNAb`1)Kk> zdtV{K1?tCML%H`M=+@iT;3OjtM-tUjv?*0a&rZln?03YIy#mB=mK{9RUfL;S>M>GFrT^N0A> z;D48_&r?X%w3V2Wi>vF)0stf;(DejVBJJP^1KVe5DQ$r=H_&rL>6ECJz96aw^TMKD zUJTUK*`xl)3*U-uICQM7tv|lJV0xI?03^Gj;sa<^HvSob%i7QI1&V}$A*yh9YikR13d^Uk6u4v1^P_=2 z$Ed3XzA-d>j^Ux9Z|KG~a{y8Uv_L?~cJ^}07pB?W>1k+f#gYg?aPThU1yLXYLI?4c zQUU1M7K(1adkOK-4Nr5wUVum&1QY<*@I}PPe*;5ATSo^x29)R+FA4c&peC~qhkUYdcp7QvNCp@{o;d3#CHKIGXBwxt*2b0F+}_( zX0Ud>nReVdH!jKAe)Dr9_jQlj*yHt&y^^XcK^}qHlfM#lN7|Ryv;4-hf|&WLEnXHV zuvGG#i+6XG4U09Lf=~WccDm2w7Ypwg5ve4euE+fCxVCt=kG)sgze%rL9h4p8m-kBG z3HCL4@$9p@`8_YNGx|Gy;*;{-UF)!2y!bhGgZtdh%HY4<@qD^9Kz+2OAm}SFI^bly zbgtlg(MMN)9mbd$DWuusR9VS@2#3D$Z?`Ajl=w`}=b~lfx#I6xKW3TW<3k#X^EQRv z`32{(h5o}pONaR4T{Pjddr;Y^iK6$(FD}SS@IMH$2Z1E$BH$e2j)DmQ-NSxBt_T;j z2Cn<#r&sH+=3RD;vQd$eCm=oUa3+!I7pF4XcA_a4C^LlOnogmYdgmN?MA|?H(v0kFc|pfl#Gd z6FCZWXoSyM_V@VHpICM;y$Y1)c4H$HQ?}2?iU8>mXNu4s*FC5OrIg^pCIL!<5B^=LKW*(swRo2=w#S z>|sa#@p8w$(C9~u7->X355aF+>P5^A9S^-hWVK9IPm2mq4V#iCa+d6Zw6wogR3u&v zTeiIq4BC{979{=8qWL{I$buJ%vjMncyBx&$_`G(DjR2l;1e6G=)|DUu!JIbY=;){% zD=u*$m(?Qu8B}ih?+Y6YW(?Kw|aDzwK!YK%c^?kTXm3eGR4f zM>Si$!mwEQ*L7HU_}<0oT0C2s(1iVmek7_~XOpT9I>P`s=R1eV(~LSHp*=EIf73s$ zEzodxO@mgw%I@Uh;(8fUoitnXuVVy>Ry-f3exJSGGJzkp`nWYhWNlv`ZV~cRHS@+{ z8UrKl`HU9u=lu`5pnss>(#EgVL+#K@dWW%+2K$ip0?Mu#Eh>s+n6`K6VC z>CB9%fcNjwI-&YX*|p0?{#r2w7UYzVM(F0kv@OVe*InexkNPno6ZmzakAhk;Rr}M! zgYVL`dd-L-lWM{=o-j80s`t~oY$SwBWfe8?wq?Y|$vWWGN)IcJh4)3o)Z!;jq&j52 z|64#nSSzgIPDaQlI6{zR)m2l(-de6c)Zs5`77+UbHBZOw7Cz1O$Ew+9Aad?_#>&sf2>$-tMXAUjs4IZk z&CyXxS~?JQ5QkLs|9bn%xG1|X+M#4Xgh9GfKm-)&hM}ZWKsuyLTDn6TDd`f1?nXdV zK%}KxK)R)CxQF+Dzu#~7`T0d)o|!r4Jo}uz_F8LuM4Z9kqL+UY0mM@Bt@gYp-ljqK zF(z86G6xo1eAMM}smz#JND4)OdUd~eLD5reuajINw3*O|WMH3^*h#Oumle z)~A!I(oV6=zGz6y3j0&@)0vrNzsg@I&*gT{mQ&VP(j|Vsne$7<((@OnZC`Kmh_tte zW|5-fzFW+_JV(d<=47v>2!+8}$V=P|+)xwwJz5V)!Xx9TXNclGKI3+?r9ED?&rxCc zGPs@gZg|6%2G=-H!=@qq%m^doLCbaZ7SV)dRM~nsrrV6YkPaccMby}|xsfk&_k}Jk zq#Rz7YyBf=m z70pTqWy+Tgq|qA)hU%J{iO3m<*mJ58o~&NWxJqM10AVqnwk534llW5g-=u*u&A{u> zaZf!$>4MQuX=#^dbB>75pIMTB0d%&^%xFZ-2&fq{}+NoflXXvzT?N-#LUqd^u}t?5-fwR7Jwk<89R7$4+qdThjz`REdW zXm|(S2DGlzP$L9pxBj3vlk02?_a4V>PD)B6XfP2HuU_Ix*)NO{{&HwD8M}0DeOac! ziVw06g~uma-kAH3#fy<{p5`wGq-8Hb5p|F5uBzwldK8UXP=rCucCuNM2&Dc+T5LTa+TdXKS-J$&~esG^KcyblHJV>-|Jx@5gC}N8hhf$w*737 zJ`NwA8KfoPR)A+9Gn7tsgd~~iyPNyT{kyB5iK*H3=TTRPYI)CC@51d$MP`BJP>#s* zUqmn8mt(EZOUHcCCny0|K_arhUXNKSJBf(tE{)(P7*5{K^tv-Q-7X3HL-g)j`svJ#5ngRI4Fs~$!fTA^%)aK(X(@(vjxN8uNNbG8LDjI=?c6)=L^lnLf=lG zV)_Y9=DK(Cnq*?`@w^m`5Pa`?t|IG@PD=cl&U4ORSWT;d%+oii6C1tb9GzjS3k^~- zEbH$f44ES-jX6mf?c7LR){e=H^>zlnHuzh98Y|KqIJ-NO^Rq24I6pJv2{OR~nHb=`BQGasZDm!hTLAz#z_bOM9O!Hf%)+wBN!_Fg zrPN@3o|kN<^bz&bITiwF!Eos<{WrAekcp%;ET-Zm`*MwQzTHbBB1rQki>!*1rA}*2 z&)I}+C~sY{>X?TpNdo@{e7WFj;;Pt`-?=iDBR&d>bl&ANw2cL->3-nlXwoGEk?1AE zG40e$y$CC*sE$BQAdhodaGQ}SHA$=@J6*2HA}irtm@ZuHl`-HiPUdT@uiuQ(q7X+| zq8A>t-@R`rx^gtSX0* zQIN<>nPuG|Q&G$iP**~i)KhrqSS=T5NuU169$q%Xq=Pa~EaJY@HCA(qI--*To5gALwSgU!8S9rB)k*t)D!m2Z*RZt_F6> z=o(O;0`e<6yIlZU-FJbEbtZ$bM7FM{+s0A~nDS;M%ddgH#Dd6_)#joiCP4nYzRfPO z1|0||Cz%=^OF{3I9Dsd%-*Fc77v_(Bh=cP5K=7d1otn0`<@REaEAkGq-u2ZUcmr7R0)SDZ^F%A)5vn85s`!=EDS8>VzT! z>vUr28h~TiG!PSmcwIbd1yFP*rF3pUJ4=41J-g6QxSFn51ilpzHk_QeM%QFy=t)Wa z$P{o%Vb@!yU8m-yn52*jlgMJ57L?HVY5H9zk)^_H^}`}(HC@bk8vBsgF>Ue)^EF-(wzOX+3f}CPya}w+;mn zqdKly59~BdD%rx|6M?E401*Ke{e~?C=z#z^bYx@%h=fAJ!_V_e<-$wc;{B+%DN3XG zWVs?B+><&|_+Dudn;{u-K^80ty+MyCbnRG~lM}fLG)J`(t*n+6Tu!M@T}QVj9j6G7 zwG=s_bj>E_#?KS1Km39h%+RuE)<=;bCL4{^C8NY&sN%Rj@;eXeW+d11luK_rpGIWF z=)K#Je3Jf)nAPrEOhNFjztk@=)5&%PC0E6A4G)s=BSoLBF?+7YyNmA~1Thu_u=9`| znr4?RoV(Zq`X1{=kpoQGq3LQf73;#7qUNn*WUcGvsRJax$G_)hPWZ=96Ao?&WL4Pf z7xehqxuUSjN7!cCx3C8!aem18|X{!`| zeHu%Gjzc1N^8&xgPy#r7_OF-xvQBQBu4AXLg`@Qa{g?mEG2@;?AR`!z3-8+8_$js| zY8pRbM5Vrw>}{M&w7NkUbWW#I6R!@V1XzAs*;uOa>o}SUW8(eM@A1>_cNH;|?vpW` znL0~ZSy|>MPmY8g z4{qJh7d+ws$h?Lt2<-i7A#zd@nq?C}#`sDBtd;v(Ph=#v_bQ;!9Upsx{)ymu04EPe zqh{l-po@zOfa&pYbH5rKU&oqAAq%ujEu4>UH1IN z#lM0|2))3S+%s=aPr!Z0c<|tijDeDS1xOOw=Zp%s_41&oPHrYi*w_#mnKDpzbmLxq z7!3$$wrv?Ksnt48@Gtw0cn@B>rXnKoLo^+v8gl@7LC;?)Mx@I z9l~o{Ri*;E)h3crBkzWO--(7&cgPo}^O8ld{0XxuvkZ{m=n0LREZTLj zhI@vs-mT;&)KR9~HNsbp(~8^|{ZT)`Mw~s#h10F)q*|Z&x5$zw>I)GXYNQNDc4{tS z=NbDIv4r!NGwj_X^mfTAz1u}MgVgI`{gcH3>2@mdHD0&AUnL4!XM)&kKl>DnGQQN0 zsn0%N?&A~fJWM}s-#g-S*r|s93CS?Zc~^J47EI$ei%bj%gsD}R+%mKIyKOHR#LBiY zmA|Jo=|(fae0-SNdAsv`@417{@#rHGzcsS+I6mZ@6OEb0BBzDL2Afb?e=x+@neG6O zAP6hvSmf>72gD7!zMv)VNxLB?;4?gW5Iks+A>dNf&d?+UR8-*VeL^U$1c=RGo24ST zy1bNYH`sM0mjtB*=0c9A2g(eiHVuHwuqpWM>({S9=W^~0#8&rLd%3YJz#7_eh1gaJ zTvrJ=W-!?Nl6d`+8V^n>@lvD(?a!CKQYvt&FU)nrP;r6@vE@fIybowcEs-9~pLI@) z)e3e!Cjc2lNC?!#_<4BTCd=QPoiGZ8h=*T*j@KMR#gwS1-*|AM&`|~+>n^-#5NwfuFn3v!G4`D08X zpZ@yI#a8>t$tqf_Bo8IGaM6PE0~7`RXV(wQtF`v)w5DyLwG{Ls+=yM7h;TFJYI0J` zup08SW>pNGB=qx~zq`HwJAlx|o&gcn^JmYFPfjSgECy8Lq#r=U3FVp^!VKsjgs5S8 zFd&x1_17Ibv6@jjk05)3o z1QvU1S^sLG5GDvZ#}7pKl^;1QZ?w6ZxXy|=IH*>~M~tS+=^guyyC9BPbuc2PgQY}tEHZuFM{ z2QN@u!lDE1+Ef4T(s8}pomo1$P0?jmTDnBz4SetY?(V(tw45Z3@MNu%0+o_bN?ayO zkd}hjtxk1#1|`(OE$w5BUGrDVKcd|QiJ$KP5llclIzry2g{6+9TEOBFICi^}A#*Oe~QOi~|>5qJO(;3SPk{Z89Z+K!rFo*<*dg`>{; zv@nR=xl=g0%j$83mK{x=;sL)9xICWA6{7m{=b$q_?z=LNI4GfGXc)@QEK#y5X%S4YM4Y5 z(~J@>VgWNQ_i4w($S}p$m?+8kJ0Qp zB9f2x%;ugV_mdy?prHAN_@ISrzAcO%CT^Q?7^fW>T@*Fn#z~hCof>jB;vaUgx=n(K zYeXGRUYkEDT&JV#nLtC?swr((!`gQ=>qhB*E=53eka?p()vuN&n_i!M_w$lmM4jX`4YDx>9uKw#xU%#`PcgKKZz1RHwrB(ViytH6baH z{HzT=VrjQPgeIJ$k5iM7)SBE$m&wP~pQv+!&4SV)-|CO2uw978t7r`|zNCbf6&QpK z9`1ujdKJE9_Y zCu~AyCr1xJKz%N*b8{M(#@R;~BnTGO%lxcd3U^m+g@oI`hcNn%{$IP5&$Di`Q&X~=4Zb7ILAH22M_Y@^e>=~1F3=o5) zGdMph^5q;0Hr3o4KBtZ*%|jBxHSUA#uLp}9J@hCcjeeSw>W*1%894|eK2Z-Po=GFV zY@zBB-9MawHrb4<3>d*}8N&20cPOb-BeXJ@R!h9*c>(#UU_Gc{Z!RGJ$LSlJ2cCb6 zUgH4F#mR?UDBi%z1JD-kzsw;m`ilpV@WQo}Z!6SeBQleq4g zx<(3(udVALXxlDgJ4x{4@lB}eW^}kNRwP7$&YUl_06sXuhBshL8wd*&rZ=W{r##Rz z&pZ0Fo}T`aYmgQq1x@pJ908SxGf6O5S<|mo)B-p`%zs2PQAI76FOKV2#X@F8Rh}J-mr(M?8c~5WzJU|V?ZeWZF z3`=nTLCwQ5@ki6Ov$48vtAF*75>jGgt3tjWvYe)C(_4khWv9@h!-D<<1aA8&=PGpc zsxr4uOF)^}50z(@Ms)0-1bFxx@Cc7e@637>)ynh^v{$qT=G>A|f{3vp{WM7=W<(EcfJr+U)%l!~MUpk3a3DiOOzn4Jq#! zRocr6&riS6c^*vT5n76P{%_&N1nax{n&qQTAB~oa(RifYrx$ap z12yYlu@bSedU|BFRhcfMb)79S4gHJG`s03rm`!RwU9*ho;SJ2khe2pjRmOD%=?(cD zVmCfhd`TwZBN!B(Jy~s4XM3#1m>pPpdH#U2T{)m$()gS&ndnj`r4XGW&Ao288oze0 zeqcm0*Vf0&N_HIczb^=tfB}P=(fN5{Kn4bv!fZ-DOPGmQy#;^VxHg$U2QMWy6tZxP zifnx+AKQDwtQ#l7FFm z$TSP$?AgrsTa9Hvpg=6x&IUzCGhJ#!mq!9=N+o4&dIxsrgyJ-QA0Iqo>*oOzNESPL z`ufRtwc`WadNFy{iIZ}@+mDq;du1y6oxbgk(r zu=>mg%^#U5d4!@0bsi#jKd>bX8|R73S1mIfp^$3baBxj~6UMjrj4MsLs0tHeNbA6{ zTWTp;z%XIy96emg@ir}+@+|B@G?sLphfx$IHP4H!#yx_Ly^Y;~zC`&)BL3#8*4bSa z#1$4dtF!7kCN`ZT9aUlepDbp^Ome=wpPXhL;hsf0y-}z*?YRzaa3Be(?MaJKeiy5} zSwQj7@q4fP6-Y`#b7fEC0!-prAkuUajK8&%22p#}LST88{`*~0znDzTE#Jj(kS zyvmQ=o}o70AflH?TGWq=&gJ(#1!~1Uj59DdFP=$l-Yv4$l1hh3WAaWVZBSS|Kcx{G z3*I+Po+h}ouDJFumJ=Hhf01X!IQ?@xRP=ZsYj?QOKBn;i`C4Dk#Dbsv;YF(uswvaW zrE}z4N+M^cU))Y#H@2c$un&F#9pNB=zB{hA%UW9nRaAxnVZ5lQ2((!MT4iToFp$pz zj8*}$@ri%{8J*Nvy-Yz1Xm)Nn@M+YVnOjM(VzR2^$_A9=A%9j^>rA^Nu?Uz>{O&O_ z$Bs)-R8K9kE>v%M+xHPPdhDz0#-amQ`wgIz*zso2LIIWlxalhT`t#!YA$h1~Knr5Kicn5ed~~6=<+oEq?ik*7qu=j_N;Ng4)2TTO$6Ad1Jf`hs}8u2_y@uowWvJU(ERqrP= zeS?`F8`HX-Ttqh5&O0*`QxnKYp>*^;E0;yjTT>S4&Gqd8*@+lf1mV*#a&W6Q!>KR#1Hany*LZ z8~Wd#0v>xqO^sTKCa`+|Xi}A4Qzf&U5_G283{r z{k5d4_f8Un={(RpVCfSw0(^1+4WRnR`74bvA<%W+gJd?`(N*0_?M=vY1zft9F z?TZ<*BKNEa`cK#wI4DrnMNGZFg};i3pyHJ2ep=iehf`L?ow`oW|HSuZLog<`WvwP2 z$*&&Q)-%?fICo=WEg?fONY4g$cUI`KzE#Q5dXHHGH?6N+q=ZAzVWICS94Z@L6J-n$ zQLxL5nm)FEP=o!;l-M^Y$tC3y1jweTphb6dYR5NvUUrsQa5+78Q`Mxg{P1w6+xL+8 z1TyZ{(|(576OkpX`;?|W7^Vv--avwKwl@cAxd@eF%{{*b=`>HJ@V8R9nOcomL@4-j_gzD(% zAQ&FQ0Z~>9)Pij%*{+vC+nFOk!v^+L7l0Q4#;;=3icmVigcLN?9@~P@f^`o(t8%Nt z1_J1L?h4wDcVXSs$01Z34lhX=woJvNs9r8f(lg4m?UqzOHym`dudktOaFk4zd(P(j zQnO<3TC~h%b$y9|-yv3Z)-mSkHTgCxn^v6_PZShIn$Ek8xI~(A84HoCDcI8;9F?(6 zE%sgHh5DF^KZO~^-EG?w*~Ten`N*cnSwc-Kci$wd!7x)}zRf>Y^$ z&aU34Q7tvA@~1ov<8uSxaU(1w8W#+EtxC>L0IR&uA*lDqX=)r0jo)r=g}M=VJWkk= zO{Nvk+HSV0r$0EPx|F_riS`J^I;iya_4R7~svq)yhZT~AFG9vOI)G(Z0}Q#qb_6Ke z08Ebo;wG!s1+3xYvm74sM@nOWcn`+HV2V&$jZnHl*FaSjptU#M9r|Sxz<4Y&|3wdg z{^CT=rU9-FTC7|HnyW8B;sKEO9%yy|0nrIVSx2TvjV{DES}oj5Dw?WD!W1vMvqvNE zbBBS(xQ_kn(yi#=M~^nx_{0b)`6k+Pyj6=gKVemVoOs~)ovGcJHv$p>vvS2jeCA(U z`#k%W(q@X( zw}5tbcQw^%m2TMlZaElFbaQ{d!(pNIo}kob-y6X*d>jHxmVYAMEJPQ&G+^NZf&zhx zFddfF)@Bgxy)E7B1gP!x#!xhQpYMYeu>SY29WWg%Dq070V`rB{GliGh?0;8owqpB| zVio7PJqihK_tIDX2?ziBP|5nz_X>`jpS!gHNXsV2UUt88Qk~Go&9zijjneeF!NlU- z>$Di1ywB`RoGj{fH#8;*N51@e{XcP@fLmHC4k3K_S?-V5TiLM*)nKYXFa*;AJUVs( zXFZ7+3CiHS85KKWA4MBG%gf3L(CGvPy#VLVKzp5E8DQCVyr9wnAX&qnRj_Qq6F%>? zQvqo4zQ==npn=Kp@$nj)OY}UbwcpaSSZgsu}gfMwlg_N$cbte(i^e8^hU3_U1Z_*dZpPrydwcbGLf7B6CU_ zoGdZqbPd}0J%qAO54hVv@dDojUU}e<0CYpPljSYQs~uoN1}tRmdEyQWf*u~{fZ1UA z_ALMwJ)%>wf@q=ew{QOflPN%1m&sDLd_lUsv$HTi4?;Bk6Fmhi5RkpwSAo-(KM2@h z!bSf5WB^$*4X0_ysMWyFpP&`bc{-16%5x(_ZS8Yl;RniQDp`WS78D#LrC}jJqzX!= zc`Y(8wNYo53TVPN_2Vuuu~eE0CSOKTQ}fz|j13JxlRw762}Y+7y)aXn4Gf!>a{%TP zxMX>IDs!m{K}{&uw5Y|uAwyNi2^nhz@y<4fA8uqYGoOVKeV4<+beOM zX#ObwJM!zK_yT5G#y#@EML|xUnUw{IMEGz}$TI>=e86)ye7}s5Vh&d0<+z5*y$>gd zIDT>GCnt6`HoC2@)~>E63eVe#Q(u?x0(>RHiG!i14M)ZG2x~tT z<<-G>QrfX{!{1E1K4pg*QjBy7ZZOo7tu-#7mZr12vtDpM+{wi8{@